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

53 lines
2.8 KiB
Diff

--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java
@@ -54,7 +54,7 @@
{
if (i1 >= 0 && i1 < 256)
{
- if (!this.canGrowInto(worldIn.getBlockState(blockpos$mutableblockpos.setPos(k1, i1, l1)).getBlock()))
+ if (!this.isReplaceable(worldIn,blockpos$mutableblockpos.setPos(k1, i1, l1)))
{
flag = false;
}
@@ -73,11 +73,13 @@
}
else
{
- Block block = worldIn.getBlockState(position.down()).getBlock();
+ BlockPos down = position.down();
+ IBlockState state = worldIn.getBlockState(down);
+ boolean isSoil = state.getBlock().canSustainPlant(state, worldIn, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.SAPLING);
- if ((block == Blocks.GRASS || block == Blocks.DIRT) && position.getY() < 256 - i - 1)
+ if (isSoil && position.getY() < 256 - i - 1)
{
- this.setDirtAt(worldIn, position.down());
+ state.getBlock().onPlantGrow(state, worldIn, down, position);
int k2 = 0;
for (int l2 = position.getY() + i; l2 >= position.getY() + j; --l2)
@@ -93,8 +95,9 @@
if (Math.abs(k3) != k2 || Math.abs(j2) != k2 || k2 <= 0)
{
BlockPos blockpos = new BlockPos(j3, l2, i2);
+ state = worldIn.getBlockState(blockpos);
- if (!worldIn.getBlockState(blockpos).isFullBlock())
+ if (state.getBlock().canBeReplacedByLeaves(state, worldIn, blockpos))
{
this.setBlockAndNotifyAdequately(worldIn, blockpos, LEAF);
}
@@ -114,9 +117,10 @@
for (int i3 = 0; i3 < i - 1; ++i3)
{
- Material material = worldIn.getBlockState(position.up(i3)).getMaterial();
+ BlockPos upN = position.up(i3);
+ state = worldIn.getBlockState(upN);
- if (material == Material.AIR || material == Material.LEAVES)
+ if (state.getBlock().isAir(state, worldIn, upN) || state.getBlock().isLeaves(state, worldIn, upN))
{
this.setBlockAndNotifyAdequately(worldIn, position.up(i3), TRUNK);
}