Modern toolstation behavior (#294)

This commit is contained in:
FrostyFire1 authored and GitHub committed 2026-06-04 14:45:56 +02:00
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);