NoBlock.cpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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, Framework::StreamReader* zReader, int dimensionId) const
  15. {
  16. return 0;
  17. }
  18. void NoBlockBlockType::saveBlock(Block* zBlock, Framework::StreamWriter* zWriter) const
  19. {}
  20. Item* NoBlockBlockType::getItemFromBlock(Block* zBlock) const
  21. {
  22. return 0;
  23. }
  24. Block* NoBlockBlockType::createBlockAt(Framework::Vec3<int> position, Item* zUsedItem) const
  25. {
  26. return 0;
  27. }
  28. const Block* NoBlockBlockType::zDefault() const
  29. {
  30. return defaultB;
  31. }
  32. NoBlock::NoBlock()
  33. : Block(BlockTypeEnum::NO_BLOCK, 0, { 0,0,0 }, false)
  34. {
  35. transparent = 0;
  36. passable = 0;
  37. hp = 0;
  38. maxHP = 0;
  39. hardness = 0;
  40. }
  41. bool NoBlock::onTick(TickQueue* zQueue, int numTicks, bool& blocked)
  42. {
  43. return 0;
  44. }
  45. void NoBlock::onPostTick() {}
  46. const NoBlock NoBlock::INSTANCE;
  47. AirBlock::AirBlock()
  48. : Block(BlockTypeEnum::AIR, 0, { 0,0,0 }, false)
  49. {
  50. transparent = 1;
  51. passable = 1;
  52. hp = 0;
  53. maxHP = 0;
  54. hardness = 0;
  55. }
  56. bool AirBlock::onTick(TickQueue* zQueue, int numTicks, bool& blocked)
  57. {
  58. return 0;
  59. }
  60. void AirBlock::onPostTick()
  61. {}
  62. const AirBlock AirBlock::INSTANCE;