MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / updateTick

Method updateTick

src/main/java/net/minecraft/block/BlockLeaves.java:81–190  ·  view source on GitHub ↗
(World worldIn, BlockPos pos, IBlockState state, Random rand)

Source from the content-addressed store, hash-verified

79 }
80
81 public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
82 {
83 if (!worldIn.isRemote)
84 {
85 if (state.getValue(CHECK_DECAY) && state.getValue(DECAYABLE))
86 {
87 int i = 4;
88 int j = i + 1;
89 int k = pos.getX();
90 int l = pos.getY();
91 int i1 = pos.getZ();
92 int j1 = 32;
93 int k1 = j1 * j1;
94 int l1 = j1 / 2;
95
96 if (this.surroundings == null)
97 {
98 this.surroundings = new int[j1 * j1 * j1];
99 }
100
101 if (worldIn.isAreaLoaded(new BlockPos(k - j, l - j, i1 - j), new BlockPos(k + j, l + j, i1 + j)))
102 {
103 BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
104
105 for (int i2 = -i; i2 <= i; ++i2)
106 {
107 for (int j2 = -i; j2 <= i; ++j2)
108 {
109 for (int k2 = -i; k2 <= i; ++k2)
110 {
111 Block block = worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)).getBlock();
112
113 if (block != Blocks.log && block != Blocks.log2)
114 {
115 if (block.getMaterial() == Material.leaves)
116 {
117 this.surroundings[(i2 + l1) * k1 + (j2 + l1) * j1 + k2 + l1] = -2;
118 }
119 else
120 {
121 this.surroundings[(i2 + l1) * k1 + (j2 + l1) * j1 + k2 + l1] = -1;
122 }
123 }
124 else
125 {
126 this.surroundings[(i2 + l1) * k1 + (j2 + l1) * j1 + k2 + l1] = 0;
127 }
128 }
129 }
130 }
131
132 for (int i3 = 1; i3 <= 4; ++i3)
133 {
134 for (int j3 = -i; j3 <= i; ++j3)
135 {
136 for (int k3 = -i; k3 <= i; ++k3)
137 {
138 for (int l3 = -i; l3 <= i; ++l3)

Callers

nothing calls this directly

Calls 12

func_181079_cMethod · 0.95
getMaterialMethod · 0.95
destroyMethod · 0.95
isAreaLoadedMethod · 0.80
getValueMethod · 0.65
getXMethod · 0.65
getYMethod · 0.65
getZMethod · 0.65
getBlockMethod · 0.65
getBlockStateMethod · 0.65
withPropertyMethod · 0.65
setBlockStateMethod · 0.45

Tested by

no test coverage detected