This commit is contained in:
asiekierka 2015-07-01 09:54:52 +02:00
parent 5baf174193
commit 5c70242204

View file

@ -16,7 +16,9 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.util.IIcon;
import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.client.FMLClientHandler;
@ -65,11 +67,26 @@ public class BlockBuildCraftFluid extends BlockFluidClassic {
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
super.onNeighborBlockChange(world, x, y, z, block);
if (flammable && world.provider.dimensionId == -1) {
world.setBlockToAir(x, y, z);
world.setBlock(x, y, z, Blocks.air, 0, 2); // Do not cause block updates!
world.newExplosion(null, x, y, z, 4F, true, true);
}
}
@Override
public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {
world.setBlock(x, y, z, Blocks.air, 0, 2); // Do not cause block updates!
for (ForgeDirection fd : ForgeDirection.VALID_DIRECTIONS) {
Block block = world.getBlock(x + fd.offsetX, y + fd.offsetY, z + fd.offsetZ);
if (block instanceof BlockBuildCraftFluid) {
world.scheduleBlockUpdate(x + fd.offsetX, y + fd.offsetY, z + fd.offsetZ, block, 2);
} else {
world.notifyBlockOfNeighborChange(x + fd.offsetX, y + fd.offsetY, z + fd.offsetZ, block);
}
}
onBlockDestroyedByExplosion(world, x, y, z, explosion);
}
@Override
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
if (!dense || entity == null) {
@ -167,4 +184,9 @@ public class BlockBuildCraftFluid extends BlockFluidClassic {
public MapColor getMapColor(int meta) {
return mapColor;
}
@Override
public boolean canDropFromExplosion(Explosion p_149659_1_) {
return false;
}
}