WorldGen rejects, lots of them. Couple of small fixes elsewhere.

This commit is contained in:
cpw 2015-11-12 23:30:53 -05:00
parent 8f94ff14ff
commit ce40f91fb0
30 changed files with 524 additions and 579 deletions

View file

@ -5,7 +5,7 @@
ItemStack itemstack1 = slot1.getStack();
- if (itemstack1 == null)
+ if (itemstack1 == null && slot.isItemValid(stack)) // Forge: Make sure to respect isItemValid in the slot.
+ if (itemstack1 == null && slot1.isItemValid(stack)) // Forge: Make sure to respect isItemValid in the slot.
{
slot1.putStack(stack.copy());
slot1.onSlotChanged();

View file

@ -0,0 +1,33 @@
--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java
@@ -55,7 +55,7 @@
{
Block block = worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(l, j, i1)).getBlock();
- if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves)
+ if (!block.isAir(worldIn,blockpos$mutableblockpos) && !block.isLeaves(worldIn,blockpos$mutableblockpos))
{
flag = false;
}
@@ -191,7 +191,7 @@
{
BlockPos blockpos = new BlockPos(l1, l2, i2);
- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock())
+ if (!worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos))
{
this.func_175903_a(worldIn, blockpos, this.mushroomType.getDefaultState().withProperty(BlockHugeMushroom.VARIANT, blockhugemushroom$enumtype));
}
@@ -202,9 +202,10 @@
for (int i3 = 0; i3 < i; ++i3)
{
- Block block2 = worldIn.getBlockState(p_180709_3_.up(i3)).getBlock();
+ BlockPos upN = p_180709_3_.up(i3);
+ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(upN);
- if (!block2.isFullBlock())
+ if (state.getBlock().canBeReplacedByLeaves(worldIn, upN))
{
this.func_175903_a(worldIn, p_180709_3_.up(i3), this.mushroomType.getDefaultState().withProperty(BlockHugeMushroom.VARIANT, BlockHugeMushroom.EnumType.STEM));
}

View file

@ -1,5 +1,26 @@
--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java
@@ -100,9 +100,9 @@
if (Math.pow((double)Math.abs(j) + 0.5D, 2.0D) + Math.pow((double)Math.abs(k) + 0.5D, 2.0D) <= (double)(p_181631_2_ * p_181631_2_))
{
BlockPos blockpos = p_181631_1_.add(j, 0, k);
- Material material = this.world.getBlockState(blockpos).getBlock().getMaterial();
+ net.minecraft.block.state.IBlockState state = this.world.getBlockState(blockpos);
- if (material == Material.air || material == Material.leaves)
+ if (state.getBlock().isAir(this.world, blockpos) || state.getBlock().isLeaves(this.world, blockpos))
{
this.func_175903_a(this.world, blockpos, p_181631_3_);
}
@@ -255,7 +255,7 @@
{
BlockPos blockpos1 = p_175936_1_.add((double)(0.5F + (float)j * f), (double)(0.5F + (float)j * f1), (double)(0.5F + (float)j * f2));
- if (!this.func_150523_a(this.world.getBlockState(blockpos1).getBlock()))
+ if (!this.isReplaceable(world, blockpos1))
{
return j;
}
@@ -283,6 +283,7 @@
if (!this.validTreeLocation())

View file

@ -0,0 +1,71 @@
--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java
@@ -34,9 +34,10 @@
if (k >= 1 && k + i + 1 < 256)
{
BlockPos blockpos = p_180709_3_.down();
- Block block = worldIn.getBlockState(blockpos).getBlock();
+ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(blockpos);
+ boolean isSoil = state.getBlock().canSustainPlant(worldIn, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling));
- if (block != Blocks.grass && block != Blocks.dirt)
+ if (!(isSoil && p_180709_3_.getY() < 256 - i - 1))
{
return false;
}
@@ -46,10 +47,10 @@
}
else
{
- this.func_175921_a(worldIn, blockpos);
- this.func_175921_a(worldIn, blockpos.east());
- this.func_175921_a(worldIn, blockpos.south());
- this.func_175921_a(worldIn, blockpos.south().east());
+ this.onPlantGrow(worldIn, blockpos, p_180709_3_);
+ this.onPlantGrow(worldIn, blockpos.east(), p_180709_3_);
+ this.onPlantGrow(worldIn, blockpos.south(), p_180709_3_);
+ this.onPlantGrow(worldIn, blockpos.south().east(), p_180709_3_);
EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.random(p_180709_2_);
int i1 = i - p_180709_2_.nextInt(4);
int j1 = 2 - p_180709_2_.nextInt(3);
@@ -68,9 +69,9 @@
int k2 = k + j2;
BlockPos blockpos1 = new BlockPos(k1, k2, l1);
- Material material = worldIn.getBlockState(blockpos1).getBlock().getMaterial();
+ state = worldIn.getBlockState(blockpos1);
- if (material == Material.air || material == Material.leaves)
+ if (state.getBlock().isAir(worldIn, blockpos1) || state.getBlock().isLeaves(worldIn, blockpos1))
{
this.func_181639_b(worldIn, blockpos1);
this.func_181639_b(worldIn, blockpos1.east());
@@ -188,7 +189,7 @@
{
for (int k1 = -i1; k1 <= i1; ++k1)
{
- if (!this.func_150523_a(p_181638_1_.getBlockState(blockpos$mutableblockpos.func_181079_c(i + j1, j + l, k + k1)).getBlock()))
+ if (!this.isReplaceable(p_181638_1_, blockpos$mutableblockpos.func_181079_c(i + j1, j + l, k + k1)))
{
return false;
}
@@ -210,11 +211,17 @@
private void func_150526_a(World worldIn, int p_150526_2_, int p_150526_3_, int p_150526_4_)
{
BlockPos blockpos = new BlockPos(p_150526_2_, p_150526_3_, p_150526_4_);
- Block block = worldIn.getBlockState(blockpos).getBlock();
+ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(blockpos);
- if (block.getMaterial() == Material.air)
+ if (state.getBlock().isAir(worldIn, blockpos))
{
this.func_175903_a(worldIn, blockpos, field_181641_b);
}
}
+
+ //Just a helper macro
+ private void onPlantGrow(World world, BlockPos pos, BlockPos source)
+ {
+ world.getBlockState(pos).getBlock().onPlantGrow(world, pos, source);
+ }
}

View file

@ -1,11 +1,50 @@
--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java
@@ -102,7 +102,7 @@
@@ -59,7 +59,7 @@
{
if (j >= 0 && j < 256)
{
- if (!this.func_150523_a(worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(l, j, i1)).getBlock()))
+ if (!this.isReplaceable(worldIn, blockpos$mutableblockpos.func_181079_c(l, j, i1)))
{
flag = false;
}
@@ -78,11 +78,13 @@
}
else
{
- Block block1 = worldIn.getBlockState(p_180709_3_.down()).getBlock();
+ BlockPos down = p_180709_3_.down();
+ Block block1 = worldIn.getBlockState(down).getBlock();
+ boolean isSoil = block1.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling));
- if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) && p_180709_3_.getY() < 256 - i - 1)
+ if (isSoil && p_180709_3_.getY() < 256 - i - 1)
{
- this.func_175921_a(worldIn, p_180709_3_.down());
+ block1.onPlantGrow(worldIn, down, p_180709_3_);
for (int i2 = p_180709_3_.getY() - 3 + i; i2 <= p_180709_3_.getY() + i; ++i2)
{
@@ -102,7 +104,7 @@
BlockPos blockpos = new BlockPos(i3, i2, k1);
Block block = worldIn.getBlockState(blockpos).getBlock();
- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves)
+ if (block.isAir(worldIn, blockpos1) || block.isLeaves(worldIn, blockpos1))
+ if (block.isAir(worldIn, blockpos) || block.isLeaves(worldIn, blockpos))
{
this.func_175903_a(worldIn, blockpos, field_181630_b);
}
@@ -113,9 +115,9 @@
for (int j2 = 0; j2 < i; ++j2)
{
- Block block2 = worldIn.getBlockState(p_180709_3_.up(j2)).getBlock();
-
- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves)
+ BlockPos upN = p_180709_3_.up(j2);
+ Block block2 = worldIn.getBlockState(upN).getBlock();
+ if (block2.isAir(worldIn, upN) || block2.isLeaves(worldIn, upN))
{
this.func_175903_a(worldIn, p_180709_3_.up(j2), field_181629_a);
}

View file

@ -1,6 +1,59 @@
--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java
@@ -146,4 +146,10 @@
@@ -60,7 +60,7 @@
{
for (int l = -j; l <= j && flag; ++l)
{
- if (p_175926_2_.getY() + i < 0 || p_175926_2_.getY() + i >= 256 || !this.func_150523_a(worldIn.getBlockState(p_175926_2_.add(k, i, l)).getBlock()))
+ if (p_175926_2_.getY() + i < 0 || p_175926_2_.getY() + i >= 256 || !this.isReplaceable(worldIn,p_175926_2_.add(k, i, l)))
{
flag = false;
}
@@ -80,13 +80,14 @@
{
BlockPos blockpos = p_175927_1_.down();
Block block = worldIn.getBlockState(blockpos).getBlock();
+ boolean isSoil = block.canSustainPlant(worldIn, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling));
- if ((block == Blocks.grass || block == Blocks.dirt) && p_175927_1_.getY() >= 2)
+ if (isSoil && p_175927_1_.getY() >= 2)
{
- this.func_175921_a(worldIn, blockpos);
- this.func_175921_a(worldIn, blockpos.east());
- this.func_175921_a(worldIn, blockpos.south());
- this.func_175921_a(worldIn, blockpos.south().east());
+ this.onPlantGrow(worldIn, blockpos, p_175927_1_);
+ this.onPlantGrow(worldIn, blockpos.east(), p_175927_1_);
+ this.onPlantGrow(worldIn, blockpos.south(), p_175927_1_);
+ this.onPlantGrow(worldIn, blockpos.south().east(), p_175927_1_);
return true;
}
else
@@ -114,9 +115,9 @@
if (j * j + k * k <= i || l * l + i1 * i1 <= i || j * j + i1 * i1 <= i || l * l + k * k <= i)
{
BlockPos blockpos = p_175925_2_.add(j, 0, k);
- Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial();
+ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(blockpos);
- if (material == Material.air || material == Material.leaves)
+ if (state.getBlock().isAir(worldIn, blockpos) || state.getBlock().isLeaves(worldIn, blockpos))
{
this.func_175903_a(worldIn, blockpos, this.leavesMetadata);
}
@@ -136,9 +137,9 @@
if (j * j + k * k <= i)
{
BlockPos blockpos = p_175928_2_.add(j, 0, k);
- Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial();
+ Block block = worldIn.getBlockState(blockpos).getBlock();
- if (material == Material.air || material == Material.leaves)
+ if (block.isAir(worldIn, blockpos) || block.isLeaves(worldIn, blockpos))
{
this.func_175903_a(worldIn, blockpos, this.leavesMetadata);
}
@@ -146,4 +147,10 @@
}
}
}

View file

@ -1,5 +1,41 @@
--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java
@@ -57,7 +57,7 @@
{
BlockPos blockpos = p_180709_3_.up(i2);
- if (this.func_150523_a(worldIn.getBlockState(blockpos).getBlock()))
+ if (this.isAirLeaves(worldIn,blockpos))
{
this.func_175903_a(worldIn, blockpos, this.woodMetadata);
@@ -72,7 +72,7 @@
{
BlockPos blockpos1 = blockpos.east();
- if (this.func_150523_a(worldIn.getBlockState(blockpos1).getBlock()))
+ if (this.isAirLeaves(worldIn,blockpos1))
{
this.func_175903_a(worldIn, blockpos1, this.woodMetadata);
@@ -85,7 +85,7 @@
BlockPos blockpos2 = blockpos.south().east();
- if (this.func_150523_a(worldIn.getBlockState(blockpos2).getBlock()))
+ if (this.isAirLeaves(worldIn,blockpos2))
{
this.func_175903_a(worldIn, blockpos2, this.woodMetadata);
@@ -98,7 +98,7 @@
BlockPos blockpos3 = blockpos.south();
- if (this.func_150523_a(worldIn.getBlockState(blockpos3).getBlock()))
+ if (this.isAirLeaves(worldIn,blockpos3))
{
this.func_175903_a(worldIn, blockpos3, this.woodMetadata);
@@ -132,4 +132,11 @@
this.func_175925_a(worldIn, p_175930_2_.up(j), p_175930_3_ + 1 - j);
}

View file

@ -1,13 +1,13 @@
++++ REJECTED PATCH 1
for (int j = 0; j < i; ++j)
--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java
@@ -44,30 +44,24 @@
{
- Block block = worldIn.getBlockState(p_180709_3_.up(j)).getBlock();
-
Block block = worldIn.getBlockState(p_180709_3_.up(j)).getBlock();
- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves)
+ if (this.isAirLeaves(worldIn, p_180709_3_.up(j)))
+ if (isAirLeaves(worldIn,p_180709_3_.up(j)))
{
this.func_175905_a(worldIn, p_180709_3_.up(j), Blocks.log, this.woodMetadata);
this.func_175903_a(worldIn, p_180709_3_.up(j), this.woodMetadata);
}
if (j < i - 1)
@ -15,40 +15,39 @@
- block = worldIn.getBlockState(p_180709_3_.add(1, j, 0)).getBlock();
-
- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves)
+ if (this.isAirLeaves(worldIn, p_180709_3_.add(1, j, 0)))
+ if (isAirLeaves(worldIn,p_180709_3_.add(1, j, 0)))
{
this.func_175905_a(worldIn, p_180709_3_.add(1, j, 0), Blocks.log, this.woodMetadata);
this.func_175903_a(worldIn, p_180709_3_.add(1, j, 0), this.woodMetadata);
}
- block = worldIn.getBlockState(p_180709_3_.add(1, j, 1)).getBlock();
-
- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves)
+ if (this.isAirLeaves(worldIn, p_180709_3_.add(1, j, 1)))
+ if (isAirLeaves(worldIn,p_180709_3_.add(1, j, 1)))
{
this.func_175905_a(worldIn, p_180709_3_.add(1, j, 1), Blocks.log, this.woodMetadata);
this.func_175903_a(worldIn, p_180709_3_.add(1, j, 1), this.woodMetadata);
}
- block = worldIn.getBlockState(p_180709_3_.add(0, j, 1)).getBlock();
-
- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves)
+ if (this.isAirLeaves(worldIn, p_180709_3_.add(0, j, 1)))
+ if (isAirLeaves(worldIn,p_180709_3_.add(0, j, 1)))
{
this.func_175905_a(worldIn, p_180709_3_.add(0, j, 1), Blocks.log, this.woodMetadata);
this.func_175903_a(worldIn, p_180709_3_.add(0, j, 1), this.woodMetadata);
}
++++ END PATCH
++++ REJECTED PATCH 2
BlockPos blockpos1 = p_175934_2_.up(i);
Block block = worldIn.getBlockState(blockpos1).getBlock();
@@ -133,16 +127,23 @@
BlockPos blockpos = p_175934_2_.up(i);
Block block = worldIn.getBlockState(blockpos).getBlock();
- if (block == Blocks.grass || block == Blocks.dirt)
+ if (block.canSustainPlant(worldIn, blockpos1, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling)))
+ if (block.canSustainPlant(worldIn, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling)))
{
this.func_175905_a(worldIn, blockpos1, Blocks.dirt, BlockDirt.DirtType.PODZOL.getMetadata());
this.func_175903_a(worldIn, blockpos, field_181635_g);
break;
}
- if (block.getMaterial() != Material.air && i < 0)
+ if (!block.isAir(worldIn, blockpos1) && i < 0)
+ if (!block.isAir(worldIn, blockpos) && i < 0)
{
break;
}
@ -62,4 +61,3 @@
+ return block.isAir(world, pos) || block.isLeaves(world, pos);
+ }
}
++++ END PATCH

View file

@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java
@@ -74,7 +74,7 @@
{
BlockPos blockpos = new BlockPos(l1, i2, j2);
- if (this.field_175919_c.apply(worldIn.getBlockState(blockpos)))
+ if (worldIn.getBlockState(blockpos).getBlock().isReplaceableOreGen(worldIn, blockpos, this.field_175919_c))
{
worldIn.setBlockState(blockpos, this.oreBlock, 2);
}

View file

@ -1,5 +1,14 @@
--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java
@@ -53,7 +53,7 @@
{
if (j >= 0 && j < 256)
{
- if (!this.func_150523_a(worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(l, j, i1)).getBlock()))
+ if (!this.isReplaceable(worldIn,blockpos$mutableblockpos.func_181079_c(l, j, i1)))
{
flag = false;
}
@@ -72,11 +72,13 @@
}
else
@ -17,6 +26,30 @@
EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.random(p_180709_2_);
int k2 = i - p_180709_2_.nextInt(4) - 1;
int l2 = 3 - p_180709_2_.nextInt(3);
@@ -96,9 +98,9 @@
}
BlockPos blockpos = new BlockPos(i3, i2, j1);
- Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial();
+ block = worldIn.getBlockState(blockpos).getBlock();
- if (material == Material.air || material == Material.leaves)
+ if (block.isAir(worldIn, blockpos) || block.isLeaves(worldIn, blockpos))
{
this.func_181642_b(worldIn, blockpos);
k1 = i2;
@@ -150,9 +152,9 @@
i3 += enumfacing1.getFrontOffsetX();
j1 += enumfacing1.getFrontOffsetZ();
BlockPos blockpos1 = new BlockPos(i3, j2, j1);
- Material material1 = worldIn.getBlockState(blockpos1).getBlock().getMaterial();
+ block = worldIn.getBlockState(blockpos1).getBlock();
- if (material1 == Material.air || material1 == Material.leaves)
+ if (block.isAir(worldIn, blockpos2) || block.isLeaves(worldIn, blockpos2))
{
this.func_181642_b(worldIn, blockpos1);
k1 = j2;
@@ -210,9 +212,9 @@
private void func_175924_b(World worldIn, BlockPos p_175924_2_)

View file

@ -20,3 +20,12 @@
{
p_180709_3_ = p_180709_3_.up();
this.func_175903_a(worldIn, p_180709_3_, this.field_150527_b);
@@ -54,7 +56,7 @@
{
BlockPos blockpos = new BlockPos(l, i, j1);
- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock())
+ if (worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos))
{
this.func_175903_a(worldIn, blockpos, this.field_150528_a);
}

View file

@ -1,18 +1,15 @@
++++ REJECTED PATCH 1
{
if (j >= 0 && j < 256)
--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java
@@ -61,7 +61,7 @@
{
- Block block = worldIn.getBlockState(new BlockPos(k, j, l)).getBlock();
+ BlockPos pos = new BlockPos(k, j, l);
+ Block block = worldIn.getBlockState(pos).getBlock();
Block block = worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(l, j, i1)).getBlock();
- if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves)
+ if (!block.isAir(worldIn, pos) && !block.isLeaves(worldIn, pos))
+ if (!block.isAir(worldIn, blockpos$mutableblockpos.func_181079_c(l, j, i1)) && !block.isLeaves(worldIn, blockpos$mutableblockpos.func_181079_c(l, j, i1)))
{
if (block != Blocks.water && block != Blocks.flowing_water)
{
++++ END PATCH
++++ REJECTED PATCH 2
@@ -87,11 +87,13 @@
}
else
{
@ -25,78 +22,73 @@
+ if (isSoil && p_180709_3_.getY() < 256 - i - 1)
{
- this.func_175921_a(worldIn, p_180709_3_.down());
+ block1.onPlantGrow(worldIn, down, p_180709_3_);
int i1;
BlockPos blockpos1;
int l1;
++++ END PATCH
++++ REJECTED PATCH 3
{
blockpos1 = new BlockPos(i2, l1, j1);
+ block1.onPlantGrow(worldIn, p_180709_3_.down(),p_180709_3_);
- if (!worldIn.getBlockState(blockpos1).getBlock().isFullBlock())
+ if (worldIn.getBlockState(blockpos1).getBlock().canBeReplacedByLeaves(worldIn, blockpos1))
{
this.func_175906_a(worldIn, blockpos1, Blocks.leaves);
}
++++ END PATCH
++++ REJECTED PATCH 4
for (l1 = 0; l1 < i; ++l1)
for (int l1 = p_180709_3_.getY() - 3 + i; l1 <= p_180709_3_.getY() + i; ++l1)
{
- Block block2 = worldIn.getBlockState(p_180709_3_.up(l1)).getBlock();
+ BlockPos upN = p_180709_3_.up(l1);
@@ -110,7 +112,7 @@
{
BlockPos blockpos = new BlockPos(k3, l1, j1);
- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock())
+ if (worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos))
{
this.func_175903_a(worldIn, blockpos, field_181649_b);
}
@@ -121,9 +123,10 @@
for (int i2 = 0; i2 < i; ++i2)
{
- Block block2 = worldIn.getBlockState(p_180709_3_.up(i2)).getBlock();
+ BlockPos upN = p_180709_3_.up(i2);
+ Block block2 = worldIn.getBlockState(upN).getBlock();
- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves || block2 == Blocks.flowing_water || block2 == Blocks.water)
+ if (block2.isAir(worldIn, upN) || block2.isLeaves(worldIn, upN) || block2 == Blocks.flowing_water || block2 == Blocks.water)
{
this.func_175906_a(worldIn, p_180709_3_.up(l1), Blocks.log);
this.func_175903_a(worldIn, p_180709_3_.up(i2), field_181648_a);
}
++++ END PATCH
++++ REJECTED PATCH 5
@@ -141,29 +144,29 @@
{
BlockPos blockpos4 = new BlockPos(i2, l1, i1);
blockpos$mutableblockpos1.func_181079_c(i4, j2, j4);
- if (worldIn.getBlockState(blockpos4).getBlock().getMaterial() == Material.leaves)
+ if (worldIn.getBlockState(blockpos4).getBlock().isLeaves(worldIn, blockpos4))
- if (worldIn.getBlockState(blockpos$mutableblockpos1).getBlock().getMaterial() == Material.leaves)
+ if (worldIn.getBlockState(blockpos$mutableblockpos1).getBlock().isLeaves(worldIn, blockpos$mutableblockpos1))
{
BlockPos blockpos5 = blockpos4.west();
blockpos1 = blockpos4.east();
BlockPos blockpos2 = blockpos4.north();
BlockPos blockpos3 = blockpos4.south();
BlockPos blockpos3 = blockpos$mutableblockpos1.west();
BlockPos blockpos4 = blockpos$mutableblockpos1.east();
BlockPos blockpos1 = blockpos$mutableblockpos1.north();
BlockPos blockpos2 = blockpos$mutableblockpos1.south();
- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos5).getBlock().getMaterial() == Material.air)
+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos5).getBlock().isAir(worldIn, blockpos5))
- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().getMaterial() == Material.air)
+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().isAir(worldIn,blockpos3))
{
this.func_175922_a(worldIn, blockpos5, BlockVine.EAST_FLAG);
this.func_181647_a(worldIn, blockpos3, BlockVine.EAST);
}
- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().getMaterial() == Material.air)
+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().isAir(worldIn,blockpos4))
{
this.func_181647_a(worldIn, blockpos4, BlockVine.WEST);
}
- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().getMaterial() == Material.air)
+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().isAir(worldIn, blockpos1))
+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().isAir(worldIn,blockpos1))
{
this.func_175922_a(worldIn, blockpos1, BlockVine.WEST_FLAG);
this.func_181647_a(worldIn, blockpos1, BlockVine.SOUTH);
}
- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().getMaterial() == Material.air)
+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().isAir(worldIn, blockpos2))
+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().isAir(worldIn,blockpos2))
{
this.func_175922_a(worldIn, blockpos2, BlockVine.SOUTH_FLAG);
this.func_181647_a(worldIn, blockpos2, BlockVine.NORTH);
}
@@ -192,7 +195,7 @@
this.func_175903_a(p_181647_1_, p_181647_2_, iblockstate);
int i = 4;
- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().getMaterial() == Material.air)
+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().isAir(worldIn, blockpos3))
{
this.func_175922_a(worldIn, blockpos3, BlockVine.NORTH_FLAG);
}
++++ END PATCH
++++ REJECTED PATCH 6
this.func_175905_a(worldIn, p_175922_2_, Blocks.vine, p_175922_3_);
int j = 4;
- for (p_175922_2_ = p_175922_2_.down(); worldIn.getBlockState(p_175922_2_).getBlock().getMaterial() == Material.air && j > 0; --j)
+ for (p_175922_2_ = p_175922_2_.down(); worldIn.getBlockState(p_175922_2_).getBlock().isAir(worldIn, p_175922_2_) && j > 0; --j)
- for (p_181647_2_ = p_181647_2_.down(); p_181647_1_.getBlockState(p_181647_2_).getBlock().getMaterial() == Material.air && i > 0; --i)
+ for (p_181647_2_ = p_181647_2_.down(); p_181647_1_.getBlockState(p_181647_2_).getBlock().isAir(p_181647_1_,p_181647_2_) && i > 0; --i)
{
this.func_175905_a(worldIn, p_175922_2_, Blocks.vine, p_175922_3_);
p_175922_2_ = p_175922_2_.down();
++++ END PATCH
this.func_175903_a(p_181647_1_, p_181647_2_, iblockstate);
p_181647_2_ = p_181647_2_.down();

View file

@ -1,14 +1,15 @@
++++ REJECTED PATCH 1
--- ../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.func_150523_a(worldIn.getBlockState(new BlockPos(j1, i1, k1)).getBlock()))
+ if (!this.isReplaceable(worldIn, new BlockPos(j1, i1, k1)))
- if (!this.func_150523_a(worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(k1, i1, l1)).getBlock()))
+ if (!this.isReplaceable(worldIn,blockpos$mutableblockpos.func_181079_c(k1, i1, l1)))
{
flag = false;
}
++++ END PATCH
++++ REJECTED PATCH 2
@@ -73,11 +73,13 @@
}
else
{
@ -22,31 +23,28 @@
{
- this.func_175921_a(worldIn, p_180709_3_.down());
+ block.onPlantGrow(worldIn, down, p_180709_3_);
k2 = 0;
int k2 = 0;
for (j1 = p_180709_3_.getY() + i; j1 >= p_180709_3_.getY() + j; --j1)
++++ END PATCH
++++ REJECTED PATCH 3
for (int l2 = p_180709_3_.getY() + i; l2 >= p_180709_3_.getY() + j; --l2)
@@ -94,7 +96,7 @@
{
BlockPos blockpos1 = new BlockPos(k1, j1, i2);
BlockPos blockpos = new BlockPos(j3, l2, i2);
- if (!worldIn.getBlockState(blockpos1).getBlock().isFullBlock())
+ if (worldIn.getBlockState(blockpos1).getBlock().canBeReplacedByLeaves(worldIn, blockpos1))
- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock())
+ if (!worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos))
{
this.func_175905_a(worldIn, blockpos1, Blocks.leaves, BlockPlanks.EnumType.SPRUCE.getMetadata());
this.func_175903_a(worldIn, blockpos, field_181637_b);
}
++++ END PATCH
++++ REJECTED PATCH 4
@@ -114,9 +116,10 @@
for (j1 = 0; j1 < i - 1; ++j1)
for (int i3 = 0; i3 < i - 1; ++i3)
{
- Block block1 = worldIn.getBlockState(p_180709_3_.up(j1)).getBlock();
+ BlockPos upN = p_180709_3_.up(j1);
- Block block1 = worldIn.getBlockState(p_180709_3_.up(i3)).getBlock();
+ BlockPos upN = p_180709_3_.up(i3);
+ Block block1 = worldIn.getBlockState(upN).getBlock();
- if (block1.getMaterial() == Material.air || block1.getMaterial() == Material.leaves)
+ if (block1.isAir(worldIn, upN) || block1.isLeaves(worldIn, upN))
{
this.func_175905_a(worldIn, p_180709_3_.up(j1), Blocks.log, BlockPlanks.EnumType.SPRUCE.getMetadata());
this.func_175903_a(worldIn, p_180709_3_.up(i3), field_181636_a);
}
++++ END PATCH

View file

@ -1,18 +1,15 @@
++++ REJECTED PATCH 1
{
if (i1 >= 0 && i1 < 256)
--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java
@@ -56,7 +56,7 @@
{
- Block block = worldIn.getBlockState(new BlockPos(j1, i1, k1)).getBlock();
+ BlockPos off = new BlockPos(j1, i1, k1);
+ Block block = worldIn.getBlockState(off).getBlock();
Block block = worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(k1, i1, l1)).getBlock();
- if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves)
+ if (!block.isAir(worldIn, off) && !block.isLeaves(worldIn, off))
+ if (block.isAir(worldIn, blockpos$mutableblockpos) && !block.isLeaves(worldIn, blockpos$mutableblockpos))
{
flag = false;
}
++++ END PATCH
++++ REJECTED PATCH 2
@@ -75,11 +75,13 @@
}
else
{
@ -26,31 +23,28 @@
{
- this.func_175921_a(worldIn, p_180709_3_.down());
+ block1.onPlantGrow(worldIn, down, p_180709_3_);
i3 = p_180709_2_.nextInt(2);
j1 = 1;
byte b0 = 0;
++++ END PATCH
++++ REJECTED PATCH 3
int i3 = p_180709_2_.nextInt(2);
int j3 = 1;
int k3 = 0;
@@ -100,7 +102,7 @@
{
BlockPos blockpos1 = new BlockPos(i2, l1, k2);
BlockPos blockpos = new BlockPos(i2, j4, k2);
- if (!worldIn.getBlockState(blockpos1).getBlock().isFullBlock())
+ if (worldIn.getBlockState(blockpos1).getBlock().canBeReplacedByLeaves(worldIn, blockpos1))
- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock())
+ if (worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos))
{
this.func_175905_a(worldIn, blockpos1, Blocks.leaves, BlockPlanks.EnumType.SPRUCE.getMetadata());
this.func_175903_a(worldIn, blockpos, field_181646_b);
}
++++ END PATCH
++++ REJECTED PATCH 4
@@ -129,9 +131,10 @@
for (l1 = 0; l1 < i - j3; ++l1)
for (int k4 = 0; k4 < i - i4; ++k4)
{
- Block block2 = worldIn.getBlockState(p_180709_3_.up(l1)).getBlock();
+ BlockPos upN = p_180709_3_.up(l1);
- Block block2 = worldIn.getBlockState(p_180709_3_.up(k4)).getBlock();
+ BlockPos upN = p_180709_3_.up(k4);
+ Block block2 = worldIn.getBlockState(upN).getBlock();
- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves)
+ if (block2.isAir(worldIn, upN) || block2.isLeaves(worldIn, upN))
{
this.func_175905_a(worldIn, p_180709_3_.up(l1), Blocks.log, BlockPlanks.EnumType.SPRUCE.getMetadata());
this.func_175903_a(worldIn, p_180709_3_.up(k4), field_181645_a);
}
++++ END PATCH

View file

@ -1,11 +1,94 @@
--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java
@@ -114,7 +114,7 @@
@@ -69,7 +69,7 @@
{
if (j >= 0 && j < 256)
{
- if (!this.func_150523_a(worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(l, j, i1)).getBlock()))
+ if (!this.isReplaceable(worldIn,blockpos$mutableblockpos.func_181079_c(l, j, i1)))
{
flag = false;
}
@@ -88,11 +88,13 @@
}
else
{
- Block block1 = worldIn.getBlockState(p_180709_3_.down()).getBlock();
+ BlockPos down = p_180709_3_.down();
+ Block block1 = worldIn.getBlockState(down).getBlock();
+ boolean isSoil = block1.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.sapling);
- if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) && p_180709_3_.getY() < 256 - i - 1)
+ if (isSoil && p_180709_3_.getY() < 256 - i - 1)
{
- this.func_175921_a(worldIn, p_180709_3_.down());
+ block1.onPlantGrow(worldIn, down, p_180709_3_);
int k2 = 3;
int l2 = 0;
@@ -114,7 +116,7 @@
BlockPos blockpos = new BlockPos(k1, i3, i2);
Block block = worldIn.getBlockState(blockpos).getBlock();
- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves || block.getMaterial() == Material.vine)
+ if (block.isAir(worldIn, blockpos1) || block.isLeaves(worldIn, blockpos1) || block.getMaterial() == Material.vine)
+ if (block.isAir(worldIn, blockpos) || block.isLeaves(worldIn, blockpos) || block.getMaterial() == Material.vine)
{
this.func_175903_a(worldIn, blockpos, this.metaLeaves);
}
@@ -125,9 +127,10 @@
for (int j3 = 0; j3 < i; ++j3)
{
- Block block2 = worldIn.getBlockState(p_180709_3_.up(j3)).getBlock();
+ BlockPos upN = p_180709_3_.up(j3);
+ Block block2 = worldIn.getBlockState(upN).getBlock();
- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves || block2.getMaterial() == Material.vine)
+ if (block2.isAir(worldIn, upN) || block2.isLeaves(worldIn, upN) || block2.getMaterial() == Material.vine)
{
this.func_175903_a(worldIn, p_180709_3_.up(j3), this.metaWood);
@@ -170,29 +173,29 @@
{
blockpos$mutableblockpos1.func_181079_c(l4, k3, i5);
- if (worldIn.getBlockState(blockpos$mutableblockpos1).getBlock().getMaterial() == Material.leaves)
+ if (worldIn.getBlockState(blockpos$mutableblockpos1).getBlock().isLeaves(worldIn,blockpos$mutableblockpos1))
{
BlockPos blockpos2 = blockpos$mutableblockpos1.west();
BlockPos blockpos3 = blockpos$mutableblockpos1.east();
BlockPos blockpos4 = blockpos$mutableblockpos1.north();
BlockPos blockpos1 = blockpos$mutableblockpos1.south();
- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().getMaterial() == Material.air)
+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().isAir(worldIn,blockpos2))
{
this.func_181650_b(worldIn, blockpos2, BlockVine.EAST);
}
- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().getMaterial() == Material.air)
+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().isAir(worldIn,blockpos3))
{
this.func_181650_b(worldIn, blockpos3, BlockVine.WEST);
}
- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().getMaterial() == Material.air)
+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().isAir(worldIn,blockpos4))
{
this.func_181650_b(worldIn, blockpos4, BlockVine.SOUTH);
}
- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().getMaterial() == Material.air)
+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().isAir(worldIn,blockpos1))
{
this.func_181650_b(worldIn, blockpos1, BlockVine.NORTH);
}
@@ -246,7 +249,7 @@
this.func_181651_a(p_181650_1_, p_181650_2_, p_181650_3_);
int i = 4;
- for (p_181650_2_ = p_181650_2_.down(); p_181650_1_.getBlockState(p_181650_2_).getBlock().getMaterial() == Material.air && i > 0; --i)
+ for (p_181650_2_ = p_181650_2_.down(); p_181650_1_.getBlockState(p_181650_2_).getBlock().isAir(p_181650_1_,p_181650_2_) && i > 0; --i)
{
this.func_181651_a(p_181650_1_, p_181650_2_, p_181650_3_);
p_181650_2_ = p_181650_2_.down();

View file

@ -1,7 +1,9 @@
++++ REJECTED PATCH 1
{
BiomeGenBase biomegenbase = abiomegenbase[j];
--- ../src-base/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java
+++ ../src-work/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java
@@ -29,11 +29,18 @@
for (BiomeGenBase biomegenbase : BiomeGenBase.getBiomeGenArray())
{
- if (biomegenbase != null && biomegenbase.minHeight > 0.0F)
+ if (biomegenbase != null && biomegenbase.minHeight > 0.0F && !net.minecraftforge.common.BiomeManager.strongHoldBiomesBlackList.contains(biomegenbase))
{
@ -17,5 +19,4 @@
+ }
}
public MapGenStronghold(Map p_i2068_1_)
++++ END PATCH
public MapGenStronghold(Map<String, String> p_i2068_1_)

View file

@ -18,3 +18,11 @@
}
this.func_175804_a(worldIn, p_74875_3_, 0, 6, 0, 4, 6, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
@@ -963,6 +963,7 @@
abstract static class Piece extends StructureComponent
{
protected static final List<WeightedRandomChestContent> field_111019_a = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 5), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 5), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 15), new WeightedRandomChestContent(Items.golden_sword, 0, 1, 1, 5), new WeightedRandomChestContent(Items.golden_chestplate, 0, 1, 1, 5), new WeightedRandomChestContent(Items.flint_and_steel, 0, 1, 1, 5), new WeightedRandomChestContent(Items.nether_wart, 0, 3, 7, 5), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 10), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 8), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 5), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 3), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.obsidian), 0, 2, 4, 2)});
+ static { net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, field_111019_a, 2, 5); }
private static final String __OBFID = "CL_00000466";
public Piece()

View file

@ -1,38 +0,0 @@
++++ REJECTED PATCH 1
{
if (k >= 0 && k < 256)
{
- Block block = worldIn.getBlockState(new BlockPos(l, k, i1)).getBlock();
+ BlockPos pos = new BlockPos(l, k, i1);
+ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(pos);
- if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves)
+ if (!state.getBlock().isAir(worldIn, pos) && !state.getBlock().isLeaves(worldIn, pos))
{
flag = false;
}
++++ END PATCH
++++ REJECTED PATCH 2
{
BlockPos blockpos1 = new BlockPos(i2, l, j1);
- if (!worldIn.getBlockState(blockpos1).getBlock().isFullBlock())
+ if (worldIn.getBlockState(blockpos1).getBlock().canBeReplacedByLeaves(worldIn, blockpos1))
{
this.func_175905_a(worldIn, blockpos1, Block.getBlockById(Block.getIdFromBlock(Blocks.brown_mushroom_block) + i), k1);
}
++++ END PATCH
++++ REJECTED PATCH 3
for (l = 0; l < j; ++l)
{
- Block block2 = worldIn.getBlockState(p_180709_3_.up(l)).getBlock();
+ BlockPos upN = p_180709_3_.up(l);
+ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(upN);
- if (!block2.isFullBlock())
+ if (state.getBlock().canBeReplacedByLeaves(worldIn, upN))
{
this.func_175905_a(worldIn, p_180709_3_.up(l), Block.getBlockById(Block.getIdFromBlock(Blocks.brown_mushroom_block) + i), 10);
}
++++ END PATCH

View file

@ -1,23 +0,0 @@
++++ REJECTED PATCH 1
if (Math.pow((double)Math.abs(j) + 0.5D, 2.0D) + Math.pow((double)Math.abs(k) + 0.5D, 2.0D) <= (double)(p_180712_2_ * p_180712_2_))
{
BlockPos blockpos1 = p_180712_1_.add(j, 0, k);
- Material material = this.world.getBlockState(blockpos1).getBlock().getMaterial();
+ net.minecraft.block.state.IBlockState state = this.world.getBlockState(blockpos1);
- if (material == Material.air || material == Material.leaves)
+ if (state.getBlock().isAir(this.world, blockpos1) || state.getBlock().isLeaves(this.world, blockpos1))
{
this.func_175905_a(this.world, blockpos1, p_180712_3_, 0);
}
++++ END PATCH
++++ REJECTED PATCH 2
{
BlockPos blockpos3 = p_175936_1_.add((double)(0.5F + (float)j * f), (double)(0.5F + (float)j * f1), (double)(0.5F + (float)j * f2));
- if (!this.func_150523_a(this.world.getBlockState(blockpos3).getBlock()))
+ if (!this.isReplaceable(world, blockpos3))
{
return j;
}
++++ END PATCH

View file

@ -1,69 +0,0 @@
++++ REJECTED PATCH 1
{
if (j >= 0 && j < 256)
{
- if (!this.func_150523_a(worldIn.getBlockState(new BlockPos(k, j, l)).getBlock()))
+ if (!this.isReplaceable(worldIn, new BlockPos(k, j, l)))
{
flag = false;
}
++++ END PATCH
++++ REJECTED PATCH 2
}
else
{
- Block block = worldIn.getBlockState(p_180709_3_.down()).getBlock();
+ BlockPos down = p_180709_3_.down();
+ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(down);
+ boolean isSoil = state.getBlock().canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling));
- if ((block == Blocks.grass || block == Blocks.dirt) && p_180709_3_.getY() < 256 - i - 1)
+ if (isSoil && p_180709_3_.getY() < 256 - i - 1)
{
- this.func_175921_a(worldIn, p_180709_3_.down());
- this.func_175921_a(worldIn, p_180709_3_.add(1, -1, 0));
- this.func_175921_a(worldIn, p_180709_3_.add(1, -1, 1));
- this.func_175921_a(worldIn, p_180709_3_.add(0, -1, 1));
+ this.onPlantGrow(worldIn, p_180709_3_.down(), p_180709_3_);
+ this.onPlantGrow(worldIn, p_180709_3_.add(1, -1, 0), p_180709_3_);
+ this.onPlantGrow(worldIn, p_180709_3_.add(1, -1, 1), p_180709_3_);
+ this.onPlantGrow(worldIn, p_180709_3_.add(0, -1, 1), p_180709_3_);
EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.random(p_180709_2_);
k = i - p_180709_2_.nextInt(4);
l = 2 - p_180709_2_.nextInt(3);
++++ END PATCH
++++ REJECTED PATCH 3
}
BlockPos blockpos1 = new BlockPos(i1, i2, j1);
- Material material = worldIn.getBlockState(blockpos1).getBlock().getMaterial();
+ state = worldIn.getBlockState(blockpos1);
- if (material == Material.air || material == Material.leaves)
+ if (state.getBlock().isAir(worldIn, blockpos1) || state.getBlock().isLeaves(worldIn, blockpos1))
{
this.func_175905_a(worldIn, blockpos1, Blocks.log2, BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4);
this.func_175905_a(worldIn, blockpos1.east(), Blocks.log2, BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4);
++++ END PATCH
++++ REJECTED PATCH 4
private void func_150526_a(World worldIn, int p_150526_2_, int p_150526_3_, int p_150526_4_)
{
- Block block = worldIn.getBlockState(new BlockPos(p_150526_2_, p_150526_3_, p_150526_4_)).getBlock();
+ BlockPos pos = new BlockPos(p_150526_2_, p_150526_3_, p_150526_4_);
+ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(pos);
- if (block.getMaterial() == Material.air)
+ if (state.getBlock().isAir(worldIn, pos))
{
this.func_175905_a(worldIn, new BlockPos(p_150526_2_, p_150526_3_, p_150526_4_), Blocks.leaves2, 1);
}
}
+
+ //Just a helper macro
+ private void onPlantGrow(World world, BlockPos pos, BlockPos source)
+ {
+ world.getBlockState(pos).getBlock().onPlantGrow(world, pos, source);
+ }
}
++++ END PATCH

View file

@ -1,42 +0,0 @@
++++ REJECTED PATCH 1
{
if (j >= 0 && j < 256)
{
- if (!this.func_150523_a(worldIn.getBlockState(new BlockPos(k, j, l)).getBlock()))
+ if (!this.isReplaceable(worldIn, new BlockPos(k, j, l)))
{
flag = false;
}
++++ END PATCH
++++ REJECTED PATCH 2
}
else
{
- Block block1 = worldIn.getBlockState(p_180709_3_.down()).getBlock();
+ BlockPos down = p_180709_3_.down();
+ Block block1 = worldIn.getBlockState(down).getBlock();
+ boolean isSoil = block1.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling));
- if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) && p_180709_3_.getY() < 256 - i - 1)
+ if (isSoil && p_180709_3_.getY() < 256 - i - 1)
{
- this.func_175921_a(worldIn, p_180709_3_.down());
+ block1.onPlantGrow(worldIn, down, p_180709_3_);
int i2;
for (i2 = p_180709_3_.getY() - 3 + i; i2 <= p_180709_3_.getY() + i; ++i2)
++++ END PATCH
++++ REJECTED PATCH 4
for (i2 = 0; i2 < i; ++i2)
{
- Block block2 = worldIn.getBlockState(p_180709_3_.up(i2)).getBlock();
+ BlockPos upN = p_180709_3_.up(i2);
+ Block block2 = worldIn.getBlockState(upN).getBlock();
- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves)
+ if (block2.isAir(worldIn, upN) || block2.isLeaves(worldIn, upN))
{
this.func_175905_a(worldIn, p_180709_3_.up(i2), Blocks.log, BlockPlanks.EnumType.BIRCH.getMetadata());
}
++++ END PATCH

View file

@ -1,57 +0,0 @@
++++ REJECTED PATCH 1
{
for (int l = -b0; l <= b0 && flag; ++l)
{
- if (p_175926_2_.getY() + j < 0 || p_175926_2_.getY() + j >= 256 || !this.func_150523_a(worldIn.getBlockState(p_175926_2_.add(k, j, l)).getBlock()))
+ if (p_175926_2_.getY() + j < 0 || p_175926_2_.getY() + j >= 256 || !this.isReplaceable(worldIn, p_175926_2_.add(k, j, l)))
{
flag = false;
}
++++ END PATCH
++++ REJECTED PATCH 2
{
BlockPos blockpos1 = p_175927_1_.down();
Block block = worldIn.getBlockState(blockpos1).getBlock();
+ boolean isSoil = block.canSustainPlant(worldIn, blockpos1, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling));
- if ((block == Blocks.grass || block == Blocks.dirt) && p_175927_1_.getY() >= 2)
+ if (isSoil && p_175927_1_.getY() >= 2)
{
- this.func_175921_a(worldIn, blockpos1);
- this.func_175921_a(worldIn, blockpos1.east());
- this.func_175921_a(worldIn, blockpos1.south());
- this.func_175921_a(worldIn, blockpos1.south().east());
+ this.onPlantGrow(worldIn, blockpos1, p_175927_1_);
+ this.onPlantGrow(worldIn, blockpos1.east(), p_175927_1_);
+ this.onPlantGrow(worldIn, blockpos1.south(), p_175927_1_);
+ this.onPlantGrow(worldIn, blockpos1.south().east(), p_175927_1_);
return true;
}
else
++++ END PATCH
++++ REJECTED PATCH 3
if (k * k + l * l <= j || i1 * i1 + j1 * j1 <= j || k * k + j1 * j1 <= j || i1 * i1 + l * l <= j)
{
BlockPos blockpos1 = p_175925_2_.add(k, 0, l);
- Material material = worldIn.getBlockState(blockpos1).getBlock().getMaterial();
+ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(blockpos1);
- if (material == Material.air || material == Material.leaves)
+ if (state.getBlock().isAir(worldIn, blockpos1) || state.getBlock().isLeaves(worldIn, blockpos1))
{
this.func_175905_a(worldIn, blockpos1, Blocks.leaves, this.leavesMetadata);
}
++++ END PATCH
++++ REJECTED PATCH 4
if (k * k + l * l <= j)
{
BlockPos blockpos1 = p_175928_2_.add(k, 0, l);
- Material material = worldIn.getBlockState(blockpos1).getBlock().getMaterial();
+ Block block = worldIn.getBlockState(blockpos1).getBlock();
- if (material == Material.air || material == Material.leaves)
+ if (block.isAir(worldIn, blockpos1) || block.isLeaves(worldIn, blockpos1))
{
this.func_175905_a(worldIn, blockpos1, Blocks.leaves, this.leavesMetadata);
}
++++ END PATCH

View file

@ -1,53 +0,0 @@
++++ REJECTED PATCH 1
{
BlockPos blockpos1 = p_180709_3_.up(i2);
- if (this.func_175931_a(worldIn.getBlockState(blockpos1).getBlock().getMaterial()))
+ if (this.isAirLeaves(worldIn, blockpos1))
{
this.func_175905_a(worldIn, blockpos1, Blocks.log, this.woodMetadata);
++++ END PATCH
++++ REJECTED PATCH 2
{
BlockPos blockpos2 = blockpos1.east();
- if (this.func_175931_a(worldIn.getBlockState(blockpos2).getBlock().getMaterial()))
+ if (this.isAirLeaves(worldIn, blockpos2))
{
this.func_175905_a(worldIn, blockpos2, Blocks.log, this.woodMetadata);
++++ END PATCH
++++ REJECTED PATCH 3
BlockPos blockpos3 = blockpos1.south().east();
- if (this.func_175931_a(worldIn.getBlockState(blockpos3).getBlock().getMaterial()))
+ if (this.isAirLeaves(worldIn, blockpos3))
{
this.func_175905_a(worldIn, blockpos3, Blocks.log, this.woodMetadata);
++++ END PATCH
++++ REJECTED PATCH 4
BlockPos blockpos4 = blockpos1.south();
- if (this.func_175931_a(worldIn.getBlockState(blockpos4).getBlock().getMaterial()))
+ if (this.isAirLeaves(worldIn, blockpos4))
{
this.func_175905_a(worldIn, blockpos4, Blocks.log, this.woodMetadata);
++++ END PATCH
++++ REJECTED PATCH 5
}
}
- private boolean func_175931_a(Material p_175931_1_)
- {
- return p_175931_1_ == Material.air || p_175931_1_ == Material.leaves;
- }
-
private void func_175932_b(World worldIn, Random p_175932_2_, BlockPos p_175932_3_, int p_175932_4_)
{
if (p_175932_2_.nextInt(3) > 0 && worldIn.isAirBlock(p_175932_3_))
++++ END PATCH

View file

@ -1,10 +0,0 @@
++++ REJECTED PATCH 1
{
BlockPos blockpos1 = new BlockPos(l1, i2, j2);
- if (this.field_175919_c.apply(worldIn.getBlockState(blockpos1)))
+ if (worldIn.getBlockState(blockpos1).getBlock().isReplaceableOreGen(worldIn, blockpos1, this.field_175919_c))
{
worldIn.setBlockState(blockpos1, this.oreBlock, 2);
}
++++ END PATCH

View file

@ -1,36 +0,0 @@
++++ REJECTED PATCH 1
{
if (j >= 0 && j < 256)
{
- if (!this.func_150523_a(worldIn.getBlockState(new BlockPos(k, j, l)).getBlock()))
+ if (!this.isReplaceable(worldIn, new BlockPos(k, j, l)))
{
flag = false;
}
++++ END PATCH
++++ REJECTED PATCH 3
}
BlockPos blockpos1 = new BlockPos(i1, i2, j1);
- Material material = worldIn.getBlockState(blockpos1).getBlock().getMaterial();
+ block = worldIn.getBlockState(blockpos1).getBlock();
- if (material == Material.air || material == Material.leaves)
+ if (block.isAir(worldIn, blockpos1) || block.isLeaves(worldIn, blockpos1))
{
this.func_175905_a(worldIn, blockpos1, Blocks.log2, BlockPlanks.EnumType.ACACIA.getMetadata() - 4);
k1 = i2;
++++ END PATCH
++++ REJECTED PATCH 4
i1 += enumfacing1.getFrontOffsetX();
j1 += enumfacing1.getFrontOffsetZ();
BlockPos blockpos2 = new BlockPos(i1, j2, j1);
- Material material1 = worldIn.getBlockState(blockpos2).getBlock().getMaterial();
+ block = worldIn.getBlockState(blockpos2).getBlock();
- if (material1 == Material.air || material1 == Material.leaves)
+ if (block.isAir(worldIn, blockpos2) || block.isLeaves(worldIn, blockpos2))
{
this.func_175905_a(worldIn, blockpos2, Blocks.log2, BlockPlanks.EnumType.ACACIA.getMetadata() - 4);
k1 = j2;
++++ END PATCH

View file

@ -1,10 +0,0 @@
++++ REJECTED PATCH 2
{
BlockPos blockpos1 = new BlockPos(l, i, j1);
- if (!worldIn.getBlockState(blockpos1).getBlock().isFullBlock())
+ if (worldIn.getBlockState(blockpos1).getBlock().canBeReplacedByLeaves(worldIn, blockpos1))
{
this.func_175905_a(worldIn, blockpos1, Blocks.leaves, this.field_150528_a);
}
++++ END PATCH

View file

@ -1,88 +0,0 @@
++++ REJECTED PATCH 1
{
if (j >= 0 && j < 256)
{
- if (!this.func_150523_a(worldIn.getBlockState(new BlockPos(k, j, l)).getBlock()))
+ if (!this.isReplaceable(worldIn, new BlockPos(k, j, l)))
{
flag = false;
}
++++ END PATCH
++++ REJECTED PATCH 2
}
else
{
- Block block1 = worldIn.getBlockState(p_180709_3_.down()).getBlock();
+ BlockPos down = p_180709_3_.down();
+ Block block1 = worldIn.getBlockState(down).getBlock();
+ boolean isSoil = block1.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.sapling);
- if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) && p_180709_3_.getY() < 256 - i - 1)
+ if (isSoil && p_180709_3_.getY() < 256 - i - 1)
{
- this.func_175921_a(worldIn, p_180709_3_.down());
+ block1.onPlantGrow(worldIn, down, p_180709_3_);
b0 = 3;
byte b1 = 0;
int i1;
++++ END PATCH
++++ REJECTED PATCH 4
for (l = 0; l < i; ++l)
{
- Block block2 = worldIn.getBlockState(p_180709_3_.up(l)).getBlock();
+ BlockPos upN = p_180709_3_.up(l);
+ Block block2 = worldIn.getBlockState(upN).getBlock();
- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves || block2.getMaterial() == Material.vine)
+ if (block2.isAir(worldIn, upN) || block2.isLeaves(worldIn, upN) || block2.getMaterial() == Material.vine)
{
this.func_175905_a(worldIn, p_180709_3_.up(l), Blocks.log, this.metaWood);
++++ END PATCH
++++ REJECTED PATCH 5
{
BlockPos blockpos3 = new BlockPos(k1, l, l1);
- if (worldIn.getBlockState(blockpos3).getBlock().getMaterial() == Material.leaves)
+ if (worldIn.getBlockState(blockpos3).getBlock().isLeaves(worldIn, blockpos3))
{
BlockPos blockpos4 = blockpos3.west();
blockpos1 = blockpos3.east();
BlockPos blockpos5 = blockpos3.north();
BlockPos blockpos2 = blockpos3.south();
- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().getMaterial() == Material.air)
+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().isAir(worldIn, blockpos4))
{
this.func_175923_a(worldIn, blockpos4, BlockVine.EAST_FLAG);
}
- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().getMaterial() == Material.air)
+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().isAir(worldIn, blockpos1))
{
this.func_175923_a(worldIn, blockpos1, BlockVine.WEST_FLAG);
}
- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos5).getBlock().getMaterial() == Material.air)
+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos5).getBlock().isAir(worldIn, blockpos5))
{
this.func_175923_a(worldIn, blockpos5, BlockVine.SOUTH_FLAG);
}
- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().getMaterial() == Material.air)
+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().isAir(worldIn, blockpos2))
{
this.func_175923_a(worldIn, blockpos2, BlockVine.NORTH_FLAG);
}
++++ END PATCH
++++ REJECTED PATCH 6
this.func_175905_a(worldIn, p_175923_2_, Blocks.vine, p_175923_3_);
int j = 4;
- for (p_175923_2_ = p_175923_2_.down(); worldIn.getBlockState(p_175923_2_).getBlock().getMaterial() == Material.air && j > 0; --j)
+ for (p_175923_2_ = p_175923_2_.down(); worldIn.getBlockState(p_175923_2_).getBlock().isAir(worldIn, p_175923_2_) && j > 0; --j)
{
this.func_175905_a(worldIn, p_175923_2_, Blocks.vine, p_175923_3_);
p_175923_2_ = p_175923_2_.down();
++++ END PATCH

View file

@ -1,9 +0,0 @@
++++ REJECTED PATCH 3
abstract static class Piece extends StructureComponent
{
protected static final List field_111019_a = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 5), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 5), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 15), new WeightedRandomChestContent(Items.golden_sword, 0, 1, 1, 5), new WeightedRandomChestContent(Items.golden_chestplate, 0, 1, 1, 5), new WeightedRandomChestContent(Items.flint_and_steel, 0, 1, 1, 5), new WeightedRandomChestContent(Items.nether_wart, 0, 3, 7, 5), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 10), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 8), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 5), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 3), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.obsidian), 0, 2, 4, 2)});
+ static { net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, field_111019_a, 2, 5); }
private static final String __OBFID = "CL_00000466";
public Piece() {}
++++ END PATCH

View file

@ -330,7 +330,7 @@ public class FMLClientHandler implements IFMLSidedHandler
// Reload resources
client.refreshResources();
RenderingRegistry.loadEntityRenderers((Map<Class<? extends Entity>, Render>)Minecraft.getMinecraft().getRenderManager().entityRenderMap);
RenderingRegistry.loadEntityRenderers(Minecraft.getMinecraft().getRenderManager().entityRenderMap);
guiFactories = HashBiMap.create();
for (ModContainer mc : Loader.instance().getActiveModList())
{
@ -825,7 +825,7 @@ public class FMLClientHandler implements IFMLSidedHandler
{
setupServerList();
OldServerPinger osp = new OldServerPinger();
ServerData serverData = new ServerData("Command Line", host+":"+port);
ServerData serverData = new ServerData("Command Line", host+":"+port,false);
try
{
osp.ping(serverData);

View file

@ -36,27 +36,27 @@ public class RenderingRegistry
* @param entityClass
* @param renderer
*/
public static void registerEntityRenderingHandler(Class<? extends Entity> entityClass, Render renderer)
public static void registerEntityRenderingHandler(Class<? extends Entity> entityClass, Render<? extends Entity> renderer)
{
INSTANCE.entityRenderers.add(new EntityRendererInfo(entityClass, renderer));
}
private static class EntityRendererInfo
{
public EntityRendererInfo(Class<? extends Entity> target, Render renderer)
public EntityRendererInfo(Class<? extends Entity> target, Render<? extends Entity> renderer)
{
this.target = target;
this.renderer = renderer;
}
private Class<? extends Entity> target;
private Render renderer;
private Render<? extends Entity> renderer;
}
public static void loadEntityRenderers(Map<Class<? extends Entity>, Render> rendererMap)
public static void loadEntityRenderers(Map<Class<? extends Entity>, Render<? extends Entity>> entityRenderMap)
{
for (EntityRendererInfo info : INSTANCE.entityRenderers)
{
rendererMap.put(info.target, info.renderer);
entityRenderMap.put(info.target, info.renderer);
}
}
}