NoBlock.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #include "NoBlock.h"
  2. NoBlockBlockType::NoBlockBlockType(int id, const Block* defaultB)
  3. : BlockType(id, 0, ModelInfo("", "", 0), 0, 1, 0, "", false, 0),
  4. defaultB(defaultB)
  5. {}
  6. Block* NoBlockBlockType::createBlock(
  7. Framework::Vec3<int> position, int dimensionId) const
  8. {
  9. return 0;
  10. }
  11. Item* NoBlockBlockType::createItem() const
  12. {
  13. return 0;
  14. }
  15. Block* NoBlockBlockType::loadBlock(Framework::Vec3<int> position,
  16. Framework::StreamReader* zReader,
  17. int dimensionId) const
  18. {
  19. return 0;
  20. }
  21. void NoBlockBlockType::saveBlock(
  22. Block* zBlock, Framework::StreamWriter* zWriter) const
  23. {}
  24. Item* NoBlockBlockType::getItemFromBlock(Block* zBlock) const
  25. {
  26. return 0;
  27. }
  28. Block* NoBlockBlockType::createBlockAt(
  29. Framework::Vec3<int> position, int dimensionId, Item* zUsedItem) const
  30. {
  31. return 0;
  32. }
  33. const Block* NoBlockBlockType::zDefault() const
  34. {
  35. return defaultB;
  36. }
  37. NoBlock::NoBlock()
  38. : Block(BlockTypeEnum::NO_BLOCK, 0, {0, 0, 0}, 0, false)
  39. {
  40. transparent = 0;
  41. passable = 0;
  42. hp = 0;
  43. maxHP = 0;
  44. hardness = 0;
  45. }
  46. bool NoBlock::onTick(TickQueue* zQueue, int numTicks, bool& blocked)
  47. {
  48. return 0;
  49. }
  50. void NoBlock::onPostTick() {}
  51. const NoBlock NoBlock::INSTANCE;
  52. AirBlock::AirBlock()
  53. : Block(BlockTypeEnum::AIR, 0, {0, 0, 0}, 0, false)
  54. {
  55. transparent = 1;
  56. passable = 1;
  57. hp = 0;
  58. maxHP = 0;
  59. hardness = 0;
  60. }
  61. bool AirBlock::onTick(TickQueue* zQueue, int numTicks, bool& blocked)
  62. {
  63. return 0;
  64. }
  65. void AirBlock::onPostTick() {}
  66. const AirBlock AirBlock::INSTANCE;