#include "PlaceBlockUpdate.h" #include #include "BlockType.h" #include "StaticRegistry.h" #include "Registries.h" #include "Globals.h" PlaceBlockUpdateType::PlaceBlockUpdateType() : WorldUpdateType(ID) {} void PlaceBlockUpdateType::applyUpdate(Framework::StreamReader* zReader) { Framework::Vec3 pos; zReader->lese((char*)&pos.x, 4); zReader->lese((char*)&pos.y, 4); zReader->lese((char*)&pos.z, 4); unsigned short id; zReader->lese((char*)&id, 2); if (blockTypes[id]->doesNeedInstance()) currentGame->zDimension()->setBlock(blockTypes[id]->createBlock(pos)); }