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

Method OnUpdate

src/Blocks/BlockSapling.h:34–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32
33
34 virtual void OnUpdate(cChunkInterface & cChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_PluginInterface, cChunk & a_Chunk, int a_RelX, int a_RelY, int a_RelZ) override
35 {
36 NIBBLETYPE Meta = a_Chunk.GetMeta(a_RelX, a_RelY, a_RelZ);
37
38 if ((Meta & 0x08) != 0)
39 {
40 int BlockX = a_RelX + a_Chunk.GetPosX() * cChunkDef::Width;
41 int BlockZ = a_RelZ + a_Chunk.GetPosZ() * cChunkDef::Width;
42 a_Chunk.GetWorld()->GrowTree(BlockX, a_RelY, BlockZ);
43 }
44 else
45 {
46 a_Chunk.SetMeta(a_RelX, a_RelY, a_RelZ, Meta | 0x08);
47 }
48 }
49
50
51 virtual const char * GetStepSound(void) override

Callers

nothing calls this directly

Calls 6

GetMetaMethod · 0.80
GrowTreeMethod · 0.80
SetMetaMethod · 0.80
GetPosXMethod · 0.45
GetPosZMethod · 0.45
GetWorldMethod · 0.45

Tested by

no test coverage detected