Merge pull request #1747 from Prototik/drop-blueprint

Drop blueprint if no space available in builder
This commit is contained in:
SpaceToad 2014-05-08 18:18:39 +02:00
commit 0eb0b01cbf

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 {
}
}
}
}