From bfa69a2ef354c70534343df7c7c0450ac061687e Mon Sep 17 00:00:00 2001 From: Adrian Siekierka Date: Sat, 8 Apr 2017 10:01:59 +0200 Subject: [PATCH] fix #3497 --- .../core/lib/block/BlockBuildCraftFluid.java | 11 ++++++++--- common/buildcraft/energy/worldgen/OilPopulate.java | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/common/buildcraft/core/lib/block/BlockBuildCraftFluid.java b/common/buildcraft/core/lib/block/BlockBuildCraftFluid.java index 43e84699..c3bccd9e 100644 --- a/common/buildcraft/core/lib/block/BlockBuildCraftFluid.java +++ b/common/buildcraft/core/lib/block/BlockBuildCraftFluid.java @@ -64,12 +64,17 @@ public class BlockBuildCraftFluid extends BlockFluidClassic { iconRegister.registerIcon(prefix + fluidName + "_flow")}; } + public static boolean isFluidExplosive(World world, int x, int z) { + return world.provider.dimensionId == -1; + } + @Override - 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) { + public void updateTick(World world, int x, int y, int z, Random rand) { + if (flammable && isFluidExplosive(world, x, z)) { world.setBlock(x, y, z, Blocks.air, 0, 2); // Do not cause block updates! world.newExplosion(null, x, y, z, 4F, true, true); + } else { + super.updateTick(world, x, y, z, rand); } } diff --git a/common/buildcraft/energy/worldgen/OilPopulate.java b/common/buildcraft/energy/worldgen/OilPopulate.java index 3e8182d4..3a685f6f 100644 --- a/common/buildcraft/energy/worldgen/OilPopulate.java +++ b/common/buildcraft/energy/worldgen/OilPopulate.java @@ -12,6 +12,7 @@ import java.util.HashSet; import java.util.Random; import java.util.Set; +import buildcraft.core.lib.block.BlockBuildCraftFluid; import net.minecraft.block.Block; import net.minecraft.block.BlockFlower; import net.minecraft.block.BlockStaticLiquid; @@ -65,7 +66,6 @@ public final class OilPopulate { } public void generateOil(World world, Random rand, int chunkX, int chunkZ) { - // shift to world coordinates int x = chunkX * 16 + 8 + rand.nextInt(16); int z = chunkZ * 16 + 8 + rand.nextInt(16); @@ -73,7 +73,7 @@ public final class OilPopulate { BiomeGenBase biome = world.getBiomeGenForCoords(x, z); // Do not generate oil in the End or Nether - if (excludedBiomes.contains(biome.biomeID)) { + if (excludedBiomes.contains(biome.biomeID) || BlockBuildCraftFluid.isFluidExplosive(world, x, z)) { return; }