Files
CatServer/patches/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch
2019-02-24 22:29:41 +08:00

35 lines
2.2 KiB
Diff

--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java
@@ -62,9 +62,9 @@
{
if (j >= 0 && j < 256)
{
- Material material = worldIn.getBlockState(blockpos$mutableblockpos.setPos(l, j, i1)).getMaterial();
+ IBlockState state = worldIn.getBlockState(blockpos$mutableblockpos.setPos(l, j, i1));
- if (material != Material.AIR && material != Material.LEAVES)
+ if (!state.getBlock().isAir(state, worldIn, blockpos$mutableblockpos) && !state.getBlock().isLeaves(state, worldIn, blockpos$mutableblockpos))
{
flag = false;
}
@@ -199,8 +199,9 @@
if (position.getY() >= position.getY() + i - 1 || blockhugemushroom$enumtype != BlockHugeMushroom.EnumType.ALL_INSIDE)
{
BlockPos blockpos = new BlockPos(l1, l2, i2);
+ IBlockState state = worldIn.getBlockState(blockpos);
- if (!worldIn.getBlockState(blockpos).isFullBlock())
+ if (state.getBlock().canBeReplacedByLeaves(state, worldIn, blockpos))
{
this.setBlockAndNotifyAdequately(worldIn, blockpos, block.getDefaultState().withProperty(BlockHugeMushroom.VARIANT, blockhugemushroom$enumtype));
}
@@ -213,7 +214,7 @@
{
IBlockState iblockstate = worldIn.getBlockState(position.up(i3));
- if (!iblockstate.isFullBlock())
+ if (iblockstate.getBlock().canBeReplacedByLeaves(iblockstate, worldIn, position.up(i3)))
{
this.setBlockAndNotifyAdequately(worldIn, position.up(i3), block.getDefaultState().withProperty(BlockHugeMushroom.VARIANT, BlockHugeMushroom.EnumType.STEM));
}