Merge branch '6.4.x' of github.com:BuildCraft/BuildCraft into 6.5.x
This commit is contained in:
commit
e1c80c7ead
3 changed files with 14 additions and 8 deletions
|
@ -103,8 +103,9 @@ public class ZoneChunk implements ISerializable {
|
|||
z = bitPosition / 16;
|
||||
x = bitPosition - 16 * z;
|
||||
}
|
||||
int y = rand.nextInt(255);
|
||||
|
||||
return new BlockIndex(x, 0, z);
|
||||
return new BlockIndex(x, y, z);
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
|
|
|
@ -68,6 +68,8 @@ public class AIRobotLoad extends AIRobot {
|
|||
if (robot.getDockingStation() != null) {
|
||||
DockingStation station = (DockingStation) robot.getDockingStation();
|
||||
|
||||
int loaded = 0;
|
||||
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
TileEntity nearbyTile = robot.worldObj.getTileEntity(station.x() + dir.offsetX,
|
||||
station.y()
|
||||
|
@ -87,20 +89,22 @@ public class AIRobotLoad extends AIRobot {
|
|||
ITransactor t = Transactor.getTransactorFor(robot);
|
||||
|
||||
if (quantity == -1) {
|
||||
|
||||
ItemStack added = t.add(slot.getStackInSlot(), ForgeDirection.UNKNOWN, true);
|
||||
slot.decreaseStackInSlot(added.stackSize);
|
||||
return;
|
||||
} else {
|
||||
ItemStack toAdd = slot.getStackInSlot().copy();
|
||||
|
||||
if (toAdd.stackSize >= quantity) {
|
||||
toAdd.stackSize = quantity;
|
||||
if (toAdd.stackSize > quantity - loaded) {
|
||||
toAdd.stackSize = quantity - loaded;
|
||||
}
|
||||
|
||||
ItemStack added = t.add(toAdd, ForgeDirection.UNKNOWN, true);
|
||||
slot.decreaseStackInSlot(added.stackSize);
|
||||
return;
|
||||
loaded += added.stackSize;
|
||||
|
||||
if (quantity - loaded <= 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
package buildcraft.robotics.boards;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.passive.EntityWolf;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
|
||||
|
@ -48,7 +49,7 @@ public class BoardRobotKnight extends RedstoneBoardRobot {
|
|||
startDelegateAI(new AIRobotSearchEntity(robot, new IEntityFilter() {
|
||||
@Override
|
||||
public boolean matches(Entity entity) {
|
||||
return entity instanceof EntityMob;
|
||||
return (entity instanceof IMob) || (entity instanceof EntityWolf && ((EntityWolf) entity).isAngry());
|
||||
}
|
||||
}, 250, robot.getZoneToWork()));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue