NoBlock.cpp 1.8 KB

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