12345678910111213141516171819202122 |
- #include "PlaceBlockUpdate.h"
- #include <Vec3.h>
- #include "BlockType.h"
- #include "StaticRegistry.h"
- #include "Registries.h"
- #include "Globals.h"
- PlaceBlockUpdateType::PlaceBlockUpdateType()
- : WorldUpdateType(ID)
- {}
- void PlaceBlockUpdateType::applyUpdate(Framework::StreamReader* zReader)
- {
- Framework::Vec3<int> 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));
- }
|