NoBlock.cpp 1.4 KB

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