BlockRemovedUpdate.cpp 699 B

1234567891011121314151617181920212223242526272829
  1. #include "BlockRemovedUpdate.h"
  2. #include "Dimension.h"
  3. #include "NoBlock.h"
  4. BlockRemovedUpdate::BlockRemovedUpdate(Framework::Vec3<int> pos, int dimension)
  5. : WorldUpdate(BlockRemovedUpdateType::ID, dimension, pos, pos)
  6. {}
  7. BlockRemovedUpdate::~BlockRemovedUpdate()
  8. {}
  9. void BlockRemovedUpdate::onUpdate(Dimension* zDimension)
  10. {
  11. zDimension->placeBlock(getMaxAffectedPoint(), AirBlockBlockType::ID);
  12. }
  13. void BlockRemovedUpdate::write(Framework::StreamWriter* zWriter)
  14. {
  15. auto pos = getMinAffectedPoint();
  16. zWriter->schreibe((char*)&pos.x, 4);
  17. zWriter->schreibe((char*)&pos.y, 4);
  18. zWriter->schreibe((char*)&pos.z, 4);
  19. }
  20. BlockRemovedUpdateType::BlockRemovedUpdateType()
  21. : WorldUpdateType(ID)
  22. {}