[1.7.10][Solved]Why is FOR loop resulting in NullPointerException
-
Recently Browsing
- No registered users viewing this page.
-
Posts
-
By TheSkullyKO · Posted
Cactus Flowers in vanilla can be placed on #minecraft:dirt, minecraft:farmland, or anything that is face sturdy upwards. Forge has added a line of code that works for other classes that extend VegetationBlock, but because CactusFlowerBlock has special placement, it has broken it. CactusFlowerBlock code @Override protected boolean mayPlaceOn(BlockState p_395694_, BlockGetter p_391810_, BlockPos p_391352_) { BlockState blockstate = p_391810_.getBlockState(p_391352_); return blockstate.is(Blocks.CACTUS) || blockstate.is(Blocks.FARMLAND) || blockstate.isFaceSturdy(p_391810_, p_391352_, Direction.UP, SupportType.CENTER); } VegetationBlock code that broke it @Override protected boolean canSurvive(BlockState p_397664_, LevelReader p_395119_, BlockPos p_393561_) { BlockPos blockpos = p_393561_.below(); if (p_397664_.getBlock() == this) { //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check. return p_395119_.getBlockState(blockpos).canSustainPlant(p_395119_, blockpos, Direction.UP, this); } return this.mayPlaceOn(p_395119_.getBlockState(blockpos), p_395119_, blockpos); } -
By TileEntity · Posted
1.20.1 requires Java 17
-
-
Topics
-
Who's Online (See full list)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.