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

Method GetOutputBlockPos

src/BlockEntities/HopperEntity.cpp:36–54  ·  view source on GitHub ↗

Returns the block coords of the block receiving the output items, based on the meta Returns false if unattached */

Source from the content-addressed store, hash-verified

34Returns false if unattached
35*/
36bool cHopperEntity::GetOutputBlockPos(NIBBLETYPE a_BlockMeta, int & a_OutputX, int & a_OutputY, int & a_OutputZ)
37{
38 a_OutputX = m_PosX;
39 a_OutputY = m_PosY;
40 a_OutputZ = m_PosZ;
41 switch (a_BlockMeta)
42 {
43 case E_META_HOPPER_FACING_XM: a_OutputX--; return true;
44 case E_META_HOPPER_FACING_XP: a_OutputX++; return true;
45 case E_META_HOPPER_FACING_YM: a_OutputY--; return true;
46 case E_META_HOPPER_FACING_ZM: a_OutputZ--; return true;
47 case E_META_HOPPER_FACING_ZP: a_OutputZ++; return true;
48 default:
49 {
50 // Not attached
51 return false;
52 }
53 }
54}
55
56
57

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected