mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 12:05:59 +03:00
90 lines
5.5 KiB
Diff
90 lines
5.5 KiB
Diff
--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java
|
|
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java
|
|
@@ -61,7 +61,7 @@
|
|
IBlockState iblockstate = worldIn.getBlockState(blockpos$mutableblockpos.setPos(l, j, i1));
|
|
Block block = iblockstate.getBlock();
|
|
|
|
- if (iblockstate.getMaterial() != Material.AIR && iblockstate.getMaterial() != Material.LEAVES)
|
|
+ if (!iblockstate.getBlock().isAir(iblockstate, worldIn, blockpos$mutableblockpos.setPos(l, j, i1)) && !iblockstate.getBlock().isLeaves(iblockstate, worldIn, blockpos$mutableblockpos.setPos(l, j, i1)))
|
|
{
|
|
if (block != Blocks.WATER && block != Blocks.FLOWING_WATER)
|
|
{
|
|
@@ -87,11 +87,13 @@
|
|
}
|
|
else
|
|
{
|
|
- Block block1 = 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 ((block1 == Blocks.GRASS || block1 == Blocks.DIRT) && position.getY() < 256 - i - 1)
|
|
+ if (isSoil && position.getY() < worldIn.getHeight() - i - 1)
|
|
{
|
|
- this.setDirtAt(worldIn, position.down());
|
|
+ state.getBlock().onPlantGrow(state, worldIn, position.down(),position);
|
|
|
|
for (int k1 = position.getY() - 3 + i; k1 <= position.getY() + i; ++k1)
|
|
{
|
|
@@ -109,8 +111,9 @@
|
|
if (Math.abs(k3) != l2 || Math.abs(j1) != l2 || rand.nextInt(2) != 0 && j2 != 0)
|
|
{
|
|
BlockPos blockpos = new BlockPos(j3, k1, i4);
|
|
+ state = worldIn.getBlockState(blockpos);
|
|
|
|
- if (!worldIn.getBlockState(blockpos).isFullBlock())
|
|
+ if (state.getBlock().canBeReplacedByLeaves(state, worldIn, blockpos))
|
|
{
|
|
this.setBlockAndNotifyAdequately(worldIn, blockpos, LEAF);
|
|
}
|
|
@@ -121,10 +124,11 @@
|
|
|
|
for (int l1 = 0; l1 < i; ++l1)
|
|
{
|
|
- IBlockState iblockstate1 = worldIn.getBlockState(position.up(l1));
|
|
+ BlockPos upN = position.up(l1);
|
|
+ IBlockState iblockstate1 = worldIn.getBlockState(upN);
|
|
Block block2 = iblockstate1.getBlock();
|
|
|
|
- if (iblockstate1.getMaterial() == Material.AIR || iblockstate1.getMaterial() == Material.LEAVES || block2 == Blocks.FLOWING_WATER || block2 == Blocks.WATER)
|
|
+ if (block2.isAir(iblockstate1, worldIn, upN) || block2.isLeaves(iblockstate1, worldIn, upN) || block2 == Blocks.FLOWING_WATER || block2 == Blocks.WATER)
|
|
{
|
|
this.setBlockAndNotifyAdequately(worldIn, position.up(l1), TRUNK);
|
|
}
|
|
@@ -149,22 +153,22 @@
|
|
BlockPos blockpos1 = blockpos$mutableblockpos1.north();
|
|
BlockPos blockpos2 = blockpos$mutableblockpos1.south();
|
|
|
|
- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getMaterial() == Material.AIR)
|
|
+ if (rand.nextInt(4) == 0 && worldIn.isAirBlock(blockpos3))
|
|
{
|
|
this.addVine(worldIn, blockpos3, BlockVine.EAST);
|
|
}
|
|
|
|
- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getMaterial() == Material.AIR)
|
|
+ if (rand.nextInt(4) == 0 && worldIn.isAirBlock(blockpos4))
|
|
{
|
|
this.addVine(worldIn, blockpos4, BlockVine.WEST);
|
|
}
|
|
|
|
- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getMaterial() == Material.AIR)
|
|
+ if (rand.nextInt(4) == 0 && worldIn.isAirBlock(blockpos1))
|
|
{
|
|
this.addVine(worldIn, blockpos1, BlockVine.SOUTH);
|
|
}
|
|
|
|
- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getMaterial() == Material.AIR)
|
|
+ if (rand.nextInt(4) == 0 && worldIn.isAirBlock(blockpos2))
|
|
{
|
|
this.addVine(worldIn, blockpos2, BlockVine.NORTH);
|
|
}
|
|
@@ -193,7 +197,7 @@
|
|
this.setBlockAndNotifyAdequately(worldIn, pos, iblockstate);
|
|
int i = 4;
|
|
|
|
- for (BlockPos blockpos = pos.down(); worldIn.getBlockState(blockpos).getMaterial() == Material.AIR && i > 0; --i)
|
|
+ for (BlockPos blockpos = pos.down(); worldIn.isAirBlock(blockpos) && i > 0; --i)
|
|
{
|
|
this.setBlockAndNotifyAdequately(worldIn, blockpos, iblockstate);
|
|
blockpos = blockpos.down();
|