Drop blueprint if no space available in builder

This commit is contained in:
Prototik 2014-05-08 22:22:26 +08:00
parent 7bb2808ff0
commit 1c17929fa5

View file

@ -40,6 +40,7 @@ import buildcraft.core.blueprints.BptBuilderBase;
import buildcraft.core.blueprints.BptBuilderBlueprint;
import buildcraft.core.blueprints.BptBuilderTemplate;
import buildcraft.core.blueprints.BptContext;
import buildcraft.core.inventory.InvUtils;
import buildcraft.core.network.RPC;
import buildcraft.core.network.RPCHandler;
import buildcraft.core.network.RPCSide;
@ -397,12 +398,17 @@ public class TileBuilder extends TileAbstractBuilder implements IMachine {
}
if (done) {
boolean dropBlueprint = true;
for (int i = 1; i < items.length; ++i) {
if (items[i] == null) {
items[i] = items[0];
dropBlueprint = false;
break;
}
}
if (dropBlueprint) {
InvUtils.dropItems(getWorld(), items[0], xCoord, yCoord, zCoord);
}
items[0] = null;
box.reset();
@ -732,4 +738,4 @@ public class TileBuilder extends TileAbstractBuilder implements IMachine {
}
}
}
}