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

Method updateTick

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

Source from the content-addressed store, hash-verified

239 }
240
241 public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
242 {
243 if (!worldIn.isRemote)
244 {
245 if (worldIn.rand.nextInt(4) == 0)
246 {
247 int i = 4;
248 int j = 5;
249 boolean flag = false;
250 label62:
251
252 for (int k = -i; k <= i; ++k)
253 {
254 for (int l = -i; l <= i; ++l)
255 {
256 for (int i1 = -1; i1 <= 1; ++i1)
257 {
258 if (worldIn.getBlockState(pos.add(k, i1, l)).getBlock() == this)
259 {
260 --j;
261
262 if (j <= 0)
263 {
264 flag = true;
265 break label62;
266 }
267 }
268 }
269 }
270 }
271
272 EnumFacing enumfacing1 = EnumFacing.random(rand);
273 BlockPos blockpos1 = pos.up();
274
275 if (enumfacing1 == EnumFacing.UP && pos.getY() < 255 && worldIn.isAirBlock(blockpos1))
276 {
277 if (!flag)
278 {
279 IBlockState iblockstate2 = state;
280
281 for (EnumFacing enumfacing3 : EnumFacing.Plane.HORIZONTAL)
282 {
283 if (rand.nextBoolean() || !this.canPlaceOn(worldIn.getBlockState(blockpos1.offset(enumfacing3)).getBlock()))
284 {
285 iblockstate2 = iblockstate2.withProperty(getPropertyFor(enumfacing3), Boolean.FALSE);
286 }
287 }
288
289 if (iblockstate2.getValue(NORTH) || iblockstate2.getValue(EAST) || iblockstate2.getValue(SOUTH) || iblockstate2.getValue(WEST))
290 {
291 worldIn.setBlockState(blockpos1, iblockstate2, 2);
292 }
293 }
294 }
295 else if (enumfacing1.getAxis().isHorizontal() && !state.getValue(getPropertyFor(enumfacing1)))
296 {
297 if (!flag)
298 {

Callers

nothing calls this directly

Calls 15

getBlockMethod · 0.95
randomMethod · 0.95
upMethod · 0.95
canPlaceOnMethod · 0.95
offsetMethod · 0.95
withPropertyMethod · 0.95
getPropertyForMethod · 0.95
getValueMethod · 0.95
getAxisMethod · 0.95
rotateYMethod · 0.95
rotateYCCWMethod · 0.95
getOppositeMethod · 0.95

Tested by

no test coverage detected