fix #3497
This commit is contained in:
parent
9417e8a59b
commit
bfa69a2ef3
|
@ -64,12 +64,17 @@ public class BlockBuildCraftFluid extends BlockFluidClassic {
|
||||||
iconRegister.registerIcon(prefix + fluidName + "_flow")};
|
iconRegister.registerIcon(prefix + fluidName + "_flow")};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isFluidExplosive(World world, int x, int z) {
|
||||||
|
return world.provider.dimensionId == -1;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||||
super.onNeighborBlockChange(world, x, y, z, block);
|
if (flammable && isFluidExplosive(world, x, z)) {
|
||||||
if (flammable && world.provider.dimensionId == -1) {
|
|
||||||
world.setBlock(x, y, z, Blocks.air, 0, 2); // Do not cause block updates!
|
world.setBlock(x, y, z, Blocks.air, 0, 2); // Do not cause block updates!
|
||||||
world.newExplosion(null, x, y, z, 4F, true, true);
|
world.newExplosion(null, x, y, z, 4F, true, true);
|
||||||
|
} else {
|
||||||
|
super.updateTick(world, x, y, z, rand);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ import java.util.HashSet;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import buildcraft.core.lib.block.BlockBuildCraftFluid;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockFlower;
|
import net.minecraft.block.BlockFlower;
|
||||||
import net.minecraft.block.BlockStaticLiquid;
|
import net.minecraft.block.BlockStaticLiquid;
|
||||||
|
@ -65,7 +66,6 @@ public final class OilPopulate {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void generateOil(World world, Random rand, int chunkX, int chunkZ) {
|
public void generateOil(World world, Random rand, int chunkX, int chunkZ) {
|
||||||
|
|
||||||
// shift to world coordinates
|
// shift to world coordinates
|
||||||
int x = chunkX * 16 + 8 + rand.nextInt(16);
|
int x = chunkX * 16 + 8 + rand.nextInt(16);
|
||||||
int z = chunkZ * 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);
|
BiomeGenBase biome = world.getBiomeGenForCoords(x, z);
|
||||||
|
|
||||||
// Do not generate oil in the End or Nether
|
// 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue