parent
dadcd12874
commit
ea7cb8a9ec
|
@ -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;
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue