Merge branch '6.4.x' of github.com:BuildCraft/BuildCraft into 6.4.x
This commit is contained in:
commit
7bf6f02da3
5 changed files with 32 additions and 21 deletions
|
@ -508,7 +508,7 @@ public class BuildCraftTransport extends BuildCraftMod {
|
|||
// Add base recipe for pipe waterproof.
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(pipeWaterproof, 1), new ItemStack(Items.dye, 1, 2));
|
||||
if (additionalWaterproofingRecipe) {
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(pipeWaterproof, 1), new ItemStack(Items.slime_ball, 1, 2));
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(pipeWaterproof, 1), new ItemStack(Items.slime_ball, 1));
|
||||
}
|
||||
|
||||
// Add pipe recipes
|
||||
|
|
|
@ -363,9 +363,9 @@ public class Box implements IBox, ISerializable {
|
|||
|
||||
@Override
|
||||
public BlockIndex getRandomBlockIndex(Random rand) {
|
||||
int x = (xMax > xMin) ? xMin + rand.nextInt(xMax - xMin) : xMin;
|
||||
int y = (yMax > yMin) ? yMin + rand.nextInt(yMax - yMin) : yMin;
|
||||
int z = (zMax > zMin) ? zMin + rand.nextInt(zMax - zMin) : zMin;
|
||||
int x = (xMax > xMin) ? xMin + rand.nextInt(xMax - xMin + 1) : xMin;
|
||||
int y = (yMax > yMin) ? yMin + rand.nextInt(yMax - yMin + 1) : yMin;
|
||||
int z = (zMax > zMin) ? zMin + rand.nextInt(zMax - zMin + 1) : zMin;
|
||||
|
||||
return new BlockIndex(x, y, z);
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ public class ZoneChunk implements ISerializable {
|
|||
while (bitId > 0) {
|
||||
bitId--;
|
||||
|
||||
bitPosition = property.nextSetBit(bitPosition);
|
||||
bitPosition = property.nextSetBit(bitPosition + 1);
|
||||
}
|
||||
|
||||
z = bitPosition / 16;
|
||||
|
|
|
@ -56,6 +56,11 @@ public class AIRobotBreak extends AIRobot {
|
|||
|
||||
@Override
|
||||
public void update() {
|
||||
|
||||
if (block == null || block.isAir(robot.worldObj, blockToBreak.x, blockToBreak.y, blockToBreak.z)) {
|
||||
terminate();
|
||||
}
|
||||
|
||||
if (hardness != 0) {
|
||||
blockDamage += speed / hardness / 30F;
|
||||
} else {
|
||||
|
|
|
@ -87,8 +87,7 @@ public class BoardRobotPlanter extends RedstoneBoardRobot {
|
|||
blockFilter = new IBlockFilter() {
|
||||
@Override
|
||||
public boolean matches(World world, int x, int y, int z) {
|
||||
return world.getBlock(x, y, z).canSustainPlant(world, x, y, z, ForgeDirection.UP, (IPlantable) Blocks.reeds)
|
||||
&& world.getBlock(x, y, z) != Blocks.reeds
|
||||
return isPlantable((IPlantable) Blocks.reeds, Blocks.reeds, world, x, y, z)
|
||||
&& !robot.getRegistry().isTaken(new ResourceIdBlock(x, y, z))
|
||||
&& isAirAbove(world, x, y, z);
|
||||
}
|
||||
|
@ -98,17 +97,17 @@ public class BoardRobotPlanter extends RedstoneBoardRobot {
|
|||
blockFilter = new IBlockFilter() {
|
||||
@Override
|
||||
public boolean matches(World world, int x, int y, int z) {
|
||||
return world.getBlock(x, y, z).canSustainPlant(world, x, y, z, ForgeDirection.UP, (IPlantable) plantBlock)
|
||||
&& world.getBlock(x, y, z) != plantBlock
|
||||
return isPlantable((IPlantable) plantBlock, plantBlock, world, x, y, z)
|
||||
&& !robot.getRegistry().isTaken(new ResourceIdBlock(x, y, z))
|
||||
&& isAirAbove(world, x, y, z);
|
||||
}
|
||||
|
||||
};
|
||||
} else {
|
||||
blockFilter = new IBlockFilter() {
|
||||
@Override
|
||||
public boolean matches(World world, int x, int y, int z) {
|
||||
return world.getBlock(x, y, z).canSustainPlant(world, x, y, z, ForgeDirection.UP, (IPlantable) itemStack.getItem())
|
||||
return isPlantable((IPlantable) itemStack.getItem(), null, world, x, y, z)
|
||||
&& !robot.getRegistry().isTaken(new ResourceIdBlock(x, y, z))
|
||||
&& isAirAbove(world, x, y, z);
|
||||
}
|
||||
|
@ -172,6 +171,13 @@ public class BoardRobotPlanter extends RedstoneBoardRobot {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean isPlantable(IPlantable plant, Block block, World world, int x, int y, int z) {
|
||||
synchronized (world) {
|
||||
return world.getBlock(x, y, z).canSustainPlant(world, x, y, z, ForgeDirection.UP, plant)
|
||||
&& (block == null || world.getBlock(x, y, z) != block);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isAirAbove(World world, int x, int y, int z) {
|
||||
synchronized (world) {
|
||||
return world.isAirBlock(x, y + 1, z);
|
||||
|
|
Loading…
Reference in a new issue