Merge branch '6.4.x' of github.com:BuildCraft/BuildCraft into 6.4.x

This commit is contained in:
asiekierka 2015-03-09 21:21:46 +01:00
commit d4a66f73eb
3 changed files with 14 additions and 8 deletions

View file

@ -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() {

View file

@ -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;
}
}
}
}

View file

@ -9,7 +9,8 @@
package buildcraft.robots.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()));
}