From 1c17929fa5206450d080e9f2ad72ca759ddb3f5b Mon Sep 17 00:00:00 2001 From: Prototik Date: Thu, 8 May 2014 22:22:26 +0800 Subject: [PATCH] Drop blueprint if no space available in builder --- common/buildcraft/builders/TileBuilder.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/buildcraft/builders/TileBuilder.java b/common/buildcraft/builders/TileBuilder.java index 1e3da21b..ad7c492b 100644 --- a/common/buildcraft/builders/TileBuilder.java +++ b/common/buildcraft/builders/TileBuilder.java @@ -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 { } } -} \ No newline at end of file +}