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

Merge pull request #935 from BluGhostYT/patch-1

Fix for issue #879
This commit is contained in:
TheBusyBiscuit 2019-06-13 08:19:46 +02:00 committed by GitHub
commit 6d7b7253a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,6 +46,7 @@ public class CargoNet extends Network {
// Chest Terminal Stuff
private static final ChestTerminalSorter sorter = new ChestTerminalSorter();
public static final int[] terminal_slots = new int[] {0, 1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15, 18, 19, 20, 21, 22, 23, 24, 27, 28, 29, 30, 31, 32, 33, 36, 37, 38, 39, 40, 41, 42};
private static final int TERMINAL_OUT_SLOT = 17;
private static final ItemStack terminal_noitem_item = new CustomItem(new ItemStack(Material.BARRIER), "&4No Item cached");
private static final MenuClickHandler terminal_noitem_handler = (p, slot, item, action) -> false;
@ -238,6 +239,15 @@ public class CargoNet extends Network {
}
}
}
for (final Location terminal : terminals) {
BlockMenu menu = BlockStorage.getInventory(terminal);
ItemStack sending_item = menu.getItemInSlot(TERMINAL_OUT_SLOT);
if (sending_item != null) {
requests.add(new ItemRequest(terminal, TERMINAL_OUT_SLOT, sending_item, ItemTransportFlow.INSERT));
}
}
Iterator<ItemRequest> iterator = requests.iterator();
while (iterator.hasNext()) {
@ -507,11 +517,6 @@ public class CargoNet extends Network {
menu.addMenuClickHandler(slot, terminal_noitem_handler);
}
}
ItemStack sent_item = menu.getItemInSlot(17);
if (sent_item != null) {
requests.add(new ItemRequest(l, 17, sent_item, ItemTransportFlow.INSERT));
}
}
}
});