From 8e92d0494cdc7a72bbc4ba4754a2f68981056d36 Mon Sep 17 00:00:00 2001 From: CovertJaguar Date: Tue, 15 Oct 2013 10:41:04 -0700 Subject: [PATCH] Fuel/Oil should explode when placed in the nether --- .../energy/BlockBuildcraftFluid.java | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/common/buildcraft/energy/BlockBuildcraftFluid.java b/common/buildcraft/energy/BlockBuildcraftFluid.java index 37fca7fc..b2fe7b3b 100644 --- a/common/buildcraft/energy/BlockBuildcraftFluid.java +++ b/common/buildcraft/energy/BlockBuildcraftFluid.java @@ -49,7 +49,16 @@ public class BlockBuildcraftFluid extends BlockFluidClassic { @Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister iconRegister) { - this.theIcon = new Icon[]{iconRegister.registerIcon("buildcraft:" + fluidName + "_still"), iconRegister.registerIcon("buildcraft:" + fluidName + "_flow")}; + this.theIcon = new Icon[] { iconRegister.registerIcon("buildcraft:" + fluidName + "_still"), iconRegister.registerIcon("buildcraft:" + fluidName + "_flow") }; + } + + @Override + public void onNeighborBlockChange(World world, int x, int y, int z, int blockId) { + super.onNeighborBlockChange(world, x, y, z, blockId); + if (flammable && world.provider.dimensionId == -1) { + world.newExplosion(null, x, y, z, 4F, true, true); + world.setBlockToAir(x, y, z); + } } public BlockBuildcraftFluid setFlammable(boolean flammable) { @@ -82,13 +91,13 @@ public class BlockBuildcraftFluid extends BlockFluidClassic { return flammable && flammability == 0; } - public BlockBuildcraftFluid setParticleColor(float particleRed, float particleGreen, float particleBlue){ + public BlockBuildcraftFluid setParticleColor(float particleRed, float particleGreen, float particleBlue) { this.particleRed = particleRed; this.particleGreen = particleGreen; this.particleBlue = particleBlue; return this; } - + @Override @SideOnly(Side.CLIENT) public void randomDisplayTick(World world, int x, int y, int z, Random rand) { @@ -98,21 +107,23 @@ public class BlockBuildcraftFluid extends BlockFluidClassic { double px = (double) ((float) x + rand.nextFloat()); double py = (double) y - 1.05D; double pz = (double) ((float) z + rand.nextFloat()); - + EntityFX fx = new EntityDropParticleFX(world, px, py, pz, particleRed, particleGreen, particleBlue); FMLClientHandler.instance().getClient().effectRenderer.addEffect(fx); } } - + @Override public boolean canDisplace(IBlockAccess world, int x, int y, int z) { - if (world.getBlockMaterial(x, y, z).isLiquid()) return false; + if (world.getBlockMaterial(x, y, z).isLiquid()) + return false; return super.canDisplace(world, x, y, z); } - + @Override public boolean displaceIfPossible(World world, int x, int y, int z) { - if (world.getBlockMaterial(x, y, z).isLiquid()) return false; + if (world.getBlockMaterial(x, y, z).isLiquid()) + return false; return super.displaceIfPossible(world, x, y, z); } }