MCPcopy Create free account
hub / github.com/cuberite/cuberite / SetTrapdoorOpen

Method SetTrapdoorOpen

src/World.cpp:2703–2721  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2701
2702
2703bool cWorld::SetTrapdoorOpen(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_Open)
2704{
2705 BLOCKTYPE Block;
2706 NIBBLETYPE Meta;
2707 GetBlockTypeMeta(a_BlockX, a_BlockY, a_BlockZ, Block, Meta);
2708 if (Block != E_BLOCK_TRAPDOOR)
2709 {
2710 return false;
2711 }
2712
2713 bool IsOpen = (Meta & 0x4) > 0;
2714 if (a_Open != IsOpen)
2715 {
2716 SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, Meta ^ 0x4);
2717 BroadcastSoundParticleEffect(1003, a_BlockX, a_BlockY, a_BlockZ, 0);
2718 return true;
2719 }
2720 return false;
2721}
2722
2723
2724

Callers 1

HandleTrapdoorMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected