1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 11:45:51 +00:00

Call ChestManipulator on withdraw()

This commit is contained in:
TheBusyBiscuit 2017-01-23 12:55:58 +01:00
parent b08f5b9892
commit e731bf20aa

View File

@ -56,11 +56,11 @@ public class CargoManager {
final ItemStack is = inv.getContents()[slot]; final ItemStack is = inv.getContents()[slot];
if (SlimefunManager.isItemSimiliar(is, template, true, DataType.ALWAYS) && matchesFilter(node, is, -1)) { if (SlimefunManager.isItemSimiliar(is, template, true, DataType.ALWAYS) && matchesFilter(node, is, -1)) {
if (is.getAmount() > template.getAmount()) { if (is.getAmount() > template.getAmount()) {
inv.setItem(slot, new CustomItem(is, is.getAmount() - template.getAmount())); inv.setItem(slot, ChestManipulator.trigger(target, slot, is, new CustomItem(is, is.getAmount() - template.getAmount())));
return template; return template;
} }
else { else {
inv.setItem(slot, null); inv.setItem(slot, ChestManipulator.trigger(target, slot, is, new CustomItem(is, is.getAmount() - template.getAmount())));
return is.clone(); return is.clone();
} }
} }
@ -95,7 +95,7 @@ public class CargoManager {
for (int slot = 0; slot < inv.getContents().length; slot++) { for (int slot = 0; slot < inv.getContents().length; slot++) {
ItemStack is = inv.getContents()[slot]; ItemStack is = inv.getContents()[slot];
if (matchesFilter(node, is, index)) { if (matchesFilter(node, is, index)) {
inv.setItem(slot, null); inv.setItem(slot, ChestManipulator.trigger(target, slot, is, null));
return new ItemSlot(is.clone(), slot); return new ItemSlot(is.clone(), slot);
} }
} }