This commit is contained in:
asiekierka 2016-03-18 13:20:31 +01:00
parent dadcd12874
commit ea7cb8a9ec
2 changed files with 13 additions and 9 deletions

View file

@ -33,14 +33,20 @@ public class AIRobotShutdown extends AIRobot {
robot.motionZ = motionZ;
}
private boolean isBlocked(float yOffset) {
return robot.worldObj.getCollidingBoundingBoxes(robot,
robot.getBoundingBox().addCoord(robot.motionX, yOffset, robot.motionZ)).size() > 0;
}
@Override
public void update() {
if (skip == 0) {
List<?> boxes = robot.worldObj.getCollidingBoundingBoxes(robot,
robot.getBoundingBox().addCoord(robot.motionX, -0.075f, robot.motionZ));
if (boxes.size() == 0) {
if (!isBlocked(-0.075f)) {
robot.motionY = -0.075f;
} else {
while (isBlocked(0)) {
robot.posY += 0.075f;
}
robot.motionY = 0f;
if (robot.motionX != 0 || robot.motionZ != 0) {
robot.motionX = 0f;

View file

@ -419,9 +419,8 @@ public class BlockGenericPipe extends BlockBuildCraft implements IColorRemovable
pipeRemoved.put(new BlockIndex(x, y, z), pipe);
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
TileEntity tile = world.getTileEntity(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
if (tile instanceof IPipeTile) {
Pipe<?> tpipe = (Pipe<?>) ((IPipeTile) tile).getPipe();
Pipe<?> tpipe = getPipe(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
if (tpipe != null) {
tpipe.scheduleWireUpdate();
}
}
@ -1091,9 +1090,8 @@ public class BlockGenericPipe extends BlockBuildCraft implements IColorRemovable
@Override
public IIcon getIcon(IBlockAccess world, int i, int j, int k, int side) {
TileEntity tile = world.getTileEntity(i, j, k);
if (tile instanceof TileGenericPipe) {
Pipe<?> pipe = (Pipe<?>) ((TileGenericPipe) tile).getPipe();
Pipe<?> pipe = getPipe(world, i, j, k);
if (pipe != null) {
return pipe.getIconProvider().getIcon(pipe.getIconIndexForItem());
}