Fuel/Oil should explode when placed in the nether

This commit is contained in:
CovertJaguar 2013-10-15 10:41:04 -07:00
parent 3438566406
commit 8e92d0494c

View file

@ -49,7 +49,16 @@ public class BlockBuildcraftFluid extends BlockFluidClassic {
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) { 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) { public BlockBuildcraftFluid setFlammable(boolean flammable) {
@ -82,13 +91,13 @@ public class BlockBuildcraftFluid extends BlockFluidClassic {
return flammable && flammability == 0; 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.particleRed = particleRed;
this.particleGreen = particleGreen; this.particleGreen = particleGreen;
this.particleBlue = particleBlue; this.particleBlue = particleBlue;
return this; return this;
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random rand) { 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 px = (double) ((float) x + rand.nextFloat());
double py = (double) y - 1.05D; double py = (double) y - 1.05D;
double pz = (double) ((float) z + rand.nextFloat()); double pz = (double) ((float) z + rand.nextFloat());
EntityFX fx = new EntityDropParticleFX(world, px, py, pz, particleRed, particleGreen, particleBlue); EntityFX fx = new EntityDropParticleFX(world, px, py, pz, particleRed, particleGreen, particleBlue);
FMLClientHandler.instance().getClient().effectRenderer.addEffect(fx); FMLClientHandler.instance().getClient().effectRenderer.addEffect(fx);
} }
} }
@Override @Override
public boolean canDisplace(IBlockAccess world, int x, int y, int z) { 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); return super.canDisplace(world, x, y, z);
} }
@Override @Override
public boolean displaceIfPossible(World world, int x, int y, int z) { 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); return super.displaceIfPossible(world, x, y, z);
} }
} }