87 { a_PumpkinPos, E_BLOCK_AIR, 0 },
88 { a_PumpkinPos.addedY(-1), E_BLOCK_AIR, 0 },
89 { a_PumpkinPos.addedY(-2), E_BLOCK_AIR, 0 }
98 a_World.SpawnMob(GolemPos.x, GolemPos.y, GolemPos.z,
mtSnowGolem,
false);
121 auto BodyPos = a_PumpkinPos.
addedY(-1);
122 static const Vector3i ArmOffsets[] =
127 for (
size_t i = 0; i <
ARRAYCOUNT(ArmOffsets); i++)
155 a_World.SpawnMob(GolemPos.x, GolemPos.y, GolemPos.z,
mtIronGolem,
false);
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc.
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)
Vector3< double > Vector3d
Utilities to allow casting a cWorld to one of its interfaces without including World....
static NIBBLETYPE YawToMetaData(double a_Rotation)
Converts the rotation value as returned by cPlayer::GetYaw() to the appropriate metadata value for a ...
double GetYaw(void) const
cWorld * GetWorld(void) const
bool PlaceBlocks(std::initializer_list< sSetBlock > a_Blocks)
Calls the block placement hooks and places the blocks in the world.
void SendBlocksAround(Vector3i a_BlockPos, int a_Range=1)
Sends the block in the specified range around the specified coord to the client as a block change pac...
bool PlaceBlock(Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Attempts to place the block in the world with a call to PlaceBlocks.
constexpr cItemHandler(int a_ItemType)
bool TrySpawnGolem(cPlayer &a_Player, const Vector3i a_PumpkinPos) const
Spawns a snow / iron golem if the shape matches the recipe, supposing that the block placed at the sp...
bool TrySpawnIronGolem(cWorld &a_World, cPlayer &a_Player, const Vector3i a_PumpkinPos) const
Spawns an iron golem if the shape matches the recipe, supposing that the block placed at the specifie...
virtual bool CommitPlacement(cPlayer &a_Player, const cItem &a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override
Performs the actual placement of this placeable item.
bool TrySpawnSnowGolem(cWorld &a_World, cPlayer &a_Player, const Vector3i a_PumpkinPos) const
Spawns a snow golem if the shape matches the recipe, supposing that the block placed at the specified...
Vector3< T > addedY(T a_AddY) const
Returns a copy of this vector moved by the specified amount on the y axis.
BLOCKTYPE GetBlock(Vector3i a_BlockPos) const
Returns the block type at the specified position.