fix air checks in oil generation

This commit is contained in:
asiekierka 2014-10-30 09:41:11 +01:00
parent 11e8c06564
commit bf9bfc5c50
3 changed files with 6 additions and 17 deletions

View file

@ -97,7 +97,6 @@ public class BuildCraftEnergy extends BuildCraftMod {
public static Block blockOil;
public static Block blockFuel;
public static Block blockRedPlasma;
public static Block blockEnergyConverter;
public static Item bucketOil;
public static Item bucketFuel;
public static Item bucketRedPlasma;
@ -366,12 +365,6 @@ public class BuildCraftEnergy extends BuildCraftMod {
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 2),
"www", " g ", "GpG", 'w', Items.iron_ingot,
'g', Blocks.glass, 'G', BuildCraftCore.ironGearItem, 'p', Blocks.piston);
if (blockEnergyConverter != null) {
CoreProxy.proxy.addCraftingRecipe(new ItemStack(blockEnergyConverter, 1), "rcr", "sgs", "rcr",
'r', Items.redstone, 'c', BuildCraftTransport.pipePowerCobblestone,
's', BuildCraftTransport.pipePowerStone, 'g', Blocks.glass);
}
}
private int findUnusedBiomeID(String biomeName) {

View file

@ -48,11 +48,7 @@ public final class BlockUtil {
public static List<ItemStack> getItemStackFromBlock(WorldServer world, int i, int j, int k) {
Block block = world.getBlock(i, j, k);
if (block == null) {
return null;
}
if (block.isAir(world, i, j, k)) {
if (block == null || block.isAir(world, i, j, k)) {
return null;
}

View file

@ -267,12 +267,12 @@ public final class OilPopulate {
}
private boolean isReplaceableForLake(World world, BiomeGenBase biome, int x, int y, int z) {
Block block = world.getBlock(x, y, z);
if (block == null) {
if (world.isAirBlock(x, y, z)) {
return true;
}
Block block = world.getBlock(x, y, z);
if (block == biome.fillerBlock || block == biome.topBlock) {
return true;
}
@ -311,7 +311,7 @@ public final class OilPopulate {
}
private void setOilWithProba(World world, BiomeGenBase biome, Random rand, float proba, int x, int y, int z, int depth) {
if (rand.nextFloat() <= proba && world.getBlock(x, y - depth - 1, z) != null) {
if (rand.nextFloat() <= proba && !world.isAirBlock(x, y - depth - 1, z)) {
if (isOilAdjacent(world, x, y, z)) {
setOilColumnForLake(world, biome, x, y, z, depth, 3);
}
@ -351,7 +351,7 @@ public final class OilPopulate {
for (; y > 0; --y) {
Block block = chunk.getBlock(trimmedX, y, trimmedZ);
if (block == null) {
if (block.isAir(world, x, y, z)) {
continue;
}