mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 11:59:14 +00:00
Modern toolstation behavior (#294)
This commit is contained in:
1 parent
c422066a0f
commit
73ccdde0ee
16 files changed
+241
-61
No files matched your search
@@ -124,8 +124,23 @@ public class ToolStationContainer extends ActiveContainer {
|
||||
if (stack.getItem() instanceof IModifyable) {
|
||||
NBTTagCompound tags = stack.getTagCompound()
|
||||
.getCompoundTag(((IModifyable) stack.getItem()).getBaseTagName());
|
||||
int[] toRemoveArray = tags.hasKey("ToRemove") ? tags.getIntArray("ToRemove") : null;
|
||||
int toRemoveIndex = 0;
|
||||
|
||||
boolean full = (logic.getStackInSlot(2) != null || logic.getStackInSlot(3) != null);
|
||||
for (int i = 2; i <= 3; i++) logic.decrStackSize(i, 1);
|
||||
for (int i = 2; i <= 3; i++) {
|
||||
ItemStack item = logic.getStackInSlot(i);
|
||||
if (item == null) {
|
||||
continue;
|
||||
}
|
||||
if (toRemoveArray == null) {
|
||||
logic.decrStackSize(i, 1);
|
||||
} else {
|
||||
logic.decrStackSize(i, toRemoveArray[toRemoveIndex]);
|
||||
toRemoveIndex++;
|
||||
}
|
||||
}
|
||||
tags.removeTag("ToRemove");
|
||||
ItemStack compare = logic.getStackInSlot(1);
|
||||
int amount = compare.getItem() instanceof IModifyable ? compare.stackSize : 1;
|
||||
logic.decrStackSize(1, amount);
|
||||
|
||||
Reference in new issue
Block a user