From 69a14fe08ecae53838d69cdc7c8a52013a85ee74 Mon Sep 17 00:00:00 2001 From: mDiyo Date: Thu, 20 Mar 2014 03:19:41 -0800 Subject: [PATCH] Unmerged 1.6.4 commit: Fix slime island grass weirdness #921 --- .../tconstruct/blocks/slime/SlimeGrass.java | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/main/java/tconstruct/blocks/slime/SlimeGrass.java b/src/main/java/tconstruct/blocks/slime/SlimeGrass.java index 091a307f883..eb58ca4c5e7 100644 --- a/src/main/java/tconstruct/blocks/slime/SlimeGrass.java +++ b/src/main/java/tconstruct/blocks/slime/SlimeGrass.java @@ -17,10 +17,13 @@ import net.minecraftforge.common.EnumPlantType; import net.minecraftforge.common.IPlantable; import net.minecraftforge.common.util.ForgeDirection; +import tconstruct.TConstruct; import tconstruct.library.TConstructRegistry; +import tconstruct.smeltery.TinkerSmeltery; import tconstruct.tools.TinkerTools; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import tconstruct.world.TinkerWorld; public class SlimeGrass extends MantleBlock { @@ -103,36 +106,37 @@ public void onPlantGrow (World world, int x, int y, int z, int sourceX, int sour } @Override - public void updateTick (World par1World, int par2, int par3, int par4, Random par5Random) + public void updateTick (World world, int x, int y, int z, Random random) { - if (!par1World.isRemote) + if (!world.isRemote) { - if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && par1World.getBlockLightOpacity(par2, par3 + 1, par4) > 2) + if (world.getBlockLightValue(x, y + 1, z) < 4 && world.getBlockLightOpacity(x, y + 1, z) > 2) { - par1World.setBlock(par2, par3, par4, TinkerTools.craftedSoil, 5, 3); + world.setBlock(x, y, z, TinkerTools.craftedSoil, 5, 3); } - else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) + else if (world.getBlockLightValue(x, y + 1, z) >= 9) { for (int l = 0; l < 4; ++l) { - int posX = par2 + par5Random.nextInt(3) - 1; - int posY = par3 + par5Random.nextInt(5) - 3; - int posZ = par4 + par5Random.nextInt(3) - 1; - Block l1 = par1World.getBlock(posX, posY + 1, posZ); + int posX = x + random.nextInt(3) - 1; + int posY = y + random.nextInt(5) - 3; + int posZ = z + random.nextInt(3) - 1; + Block blockAbove = world.getBlock(posX, posY + 1, posZ); - if (par1World.getBlockLightValue(posX, posY + 1, posZ) >= 4 && par1World.getBlockLightOpacity(posX, posY + 1, posZ) <= 2) + if (world.getBlockLightValue(posX, posY + 1, posZ) >= 4 && world.getBlockLightOpacity(posX, posY + 1, posZ) <= 2 + && blockAbove != TinkerTools.craftedSoil && blockAbove != this) { - Block block = par1World.getBlock(posX, posY, posZ); + Block block = world.getBlock(posX, posY, posZ); if (block == Blocks.dirt) { - par1World.setBlock(posX, posY, posZ, (Block) this, 1, 3); + world.setBlock(posX, posY, posZ, (Block) this, 1, 3); return; } - int blockMeta = par1World.getBlockMetadata(posX, posY, posZ); + int blockMeta = world.getBlockMetadata(posX, posY, posZ); if (block == TinkerTools.craftedSoil) { if (blockMeta == 5) - par1World.setBlock(posX, posY, posZ, (Block) this, 0, 3); + world.setBlock(posX, posY, posZ, (Block) this, 0, 3); } } }