fix not found hander inserting disks into itself fixes #2528 fixes #2190 (#2548)

* fix not found hander inserting disks into itself fixes #2528 fixes #2190

* fix formatting
This commit is contained in:
Darkere
2020-06-07 12:16:57 +02:00
committed by GitHub
parent d4994193b0
commit 0341e6a79b

View File

@@ -72,7 +72,11 @@ public class GridContainer extends BaseContainer implements ICraftingGridListene
transferManager.setNotFoundHandler(slotIndex -> { transferManager.setNotFoundHandler(slotIndex -> {
if (!getPlayer().getEntityWorld().isRemote) { if (!getPlayer().getEntityWorld().isRemote) {
Slot slot = inventorySlots.get(slotIndex); Slot slot = inventorySlots.get(slotIndex);
if (grid instanceof IPortableGrid && slot instanceof SlotItemHandler) {
if (((SlotItemHandler) slot).getItemHandler().equals(((IPortableGrid) grid).getDisk())) {
return ItemStack.EMPTY;
}
}
if (slot.getHasStack()) { if (slot.getHasStack()) {
if (slot == craftingResultSlot) { if (slot == craftingResultSlot) {
grid.onCraftedShift(getPlayer()); grid.onCraftedShift(getPlayer());