12345678910111213141516171819202122232425262728293031 |
- #include "BlockRemovedUpdate.h"
- #include "Dimension.h"
- #include "NoBlock.h"
- BlockRemovedUpdate::BlockRemovedUpdate( Framework::Vec3<int> pos, int dimension )
- : WorldUpdate( BlockRemovedUpdateType::ID, dimension, pos, pos )
- {}
- BlockRemovedUpdate::~BlockRemovedUpdate()
- {}
- void BlockRemovedUpdate::onUpdate( Dimension* zDimension )
- {
- zDimension->placeBlock( getMaxAffectedPoint(), AirBlockBlockType::ID );
- }
- void BlockRemovedUpdate::write( Framework::StreamWriter* zWriter )
- {
- int dimensionID = getAffectedDimension();
- zWriter->schreibe( (char*)&dimensionID, 4 );
- auto pos = getMinAffectedPoint();
- zWriter->schreibe( (char*)&pos.x, 4 );
- zWriter->schreibe( (char*)&pos.y, 4 );
- zWriter->schreibe( (char*)&pos.z, 4 );
- }
- BlockRemovedUpdateType::BlockRemovedUpdateType()
- : WorldUpdateType( ID )
- {}
|