This commit is contained in:
SeanOMik 2020-07-08 13:09:13 -05:00
parent 4059644144
commit dc1297306f
No known key found for this signature in database
GPG Key ID: FA4D55AC05268A88
1 changed files with 15 additions and 0 deletions

View File

@ -330,6 +330,21 @@ public class ESTerminalGUI implements InventoryHolder, Listener {
break; break;
case INTO_HALF: case INTO_HALF:
if (Utils.isItemValid(cursor)) {
// Only put one item into the system when the player right clicks with the stack.
// if we don't do this, the user can duplicate stacks of items.
ItemStack itemStack = cursor.clone();
itemStack.setAmount(1);
if (openSystem.addItem(itemStack)) {
event.setCancelled(false);
Bukkit.getScheduler().runTaskLater(EnergeticStorage.getPlugin(), () -> {
initializeItems(player, openSystem);
}, (long) 0.1);
}
}
break;
case INTO: case INTO:
if (Utils.isItemValid(cursor)) { if (Utils.isItemValid(cursor)) {
if (openSystem.addItem(cursor)) { if (openSystem.addItem(cursor)) {