updated some stuff

This commit is contained in:
2016-04-29 20:47:43 +02:00
parent 15465862a8
commit 69854318ee
2 changed files with 11 additions and 2 deletions

View File

@@ -16,9 +16,12 @@ public class Generator {
}
public static void generateNetherOre(IBlockState state, Random random, int x, int z, World world, int chance, int minY, int maxY, int minSize, int maxSize) {
generateOre(state, Blocks.NETHERRACK.getDefaultState(),null, null, random, x, z, world, chance, minY, maxY, minSize, maxSize);
generateOre(state, Blocks.NETHERRACK.getDefaultState(), null, null, random, x, z, world, chance, minY, maxY, minSize, maxSize);
}
public static void generateOre(IBlockState state, IBlockState replace, Random random, int chunkX, int chunkZ, World world, int chance, int minY, int maxY, int minSize, int maxSize) {
generateOre(state, replace, null, null, random, chunkX, chunkZ, world, chance, minY, maxY, minSize, maxSize);
}
public static void generateOre(IBlockState state, IBlockState replace, IProperty property, Comparable comparable, Random random, int chunkX, int chunkZ, World world, int chance, int minY, int maxY, int minSize, int maxSize) {
int size = minSize + random.nextInt(maxSize - minSize);

View File

@@ -21,6 +21,12 @@ public class StateMatcher implements Predicate<IBlockState> {
}
public boolean apply(IBlockState state) {
return state != null && state.getBlock() == this.state.getBlock() && state.getValue(property) == value;
if (state != null) {
if (property != null && value != null)
return state.getBlock() == this.state.getBlock() && state.getValue(property) == value;
else
return state.getBlock() == this.state.getBlock();
}
return false;
}
}