From cd7e5cab5de4726efa925401a58cbc5bc53814a6 Mon Sep 17 00:00:00 2001 From: Brianna O'Keefe Date: Sun, 25 Nov 2018 00:07:58 -0500 Subject: [PATCH] added support for epicfarming. --- .../com/songoda/ultimatestacker/events/InteractListeners.java | 2 ++ .../java/com/songoda/ultimatestacker/tasks/StackingTask.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/main/java/com/songoda/ultimatestacker/events/InteractListeners.java b/src/main/java/com/songoda/ultimatestacker/events/InteractListeners.java index 338af82..1dfc2ff 100644 --- a/src/main/java/com/songoda/ultimatestacker/events/InteractListeners.java +++ b/src/main/java/com/songoda/ultimatestacker/events/InteractListeners.java @@ -26,6 +26,8 @@ public class InteractListeners implements Listener { @EventHandler public void onAccept(InventoryPickupItemEvent event) { ItemStack item = event.getItem().getItemStack(); + if (new ItemStack(item.getType()).getMaxStackSize() == item.getMaxStackSize()) return; + instance.getStackingTask().setMax(item, 0, true); int amt = item.getAmount(); int max = item.getMaxStackSize(); diff --git a/src/main/java/com/songoda/ultimatestacker/tasks/StackingTask.java b/src/main/java/com/songoda/ultimatestacker/tasks/StackingTask.java index 8cd63e2..9e76865 100644 --- a/src/main/java/com/songoda/ultimatestacker/tasks/StackingTask.java +++ b/src/main/java/com/songoda/ultimatestacker/tasks/StackingTask.java @@ -60,6 +60,8 @@ public class StackingTask extends BukkitRunnable { if (entityO instanceof Item && instance.getConfig().getBoolean("Main.Stack Items")) { ItemStack item = ((Item) entityO).getItemStack(); + if (entityO.hasMetadata("grabbed")) continue; + if (entityO.isCustomNameVisible() && !entityO.getCustomName().contains(TextComponent.convertToInvisibleString("IS")) || item.hasItemMeta() && item.getItemMeta().hasDisplayName()) continue;