From f258d5a6c7aaa4940f395f3f676b699507539012 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sat, 19 Dec 2020 19:34:11 +0000 Subject: [PATCH] Optimised force dropqueue --- .../ecoenchants/normal/Telekinesis.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Telekinesis.java b/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Telekinesis.java index cdba79f7..7a127c74 100644 --- a/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Telekinesis.java +++ b/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Telekinesis.java @@ -62,10 +62,11 @@ public class Telekinesis extends EcoEnchant { event.getItems().clear(); - new DropQueue(player) + DropQueue queue = new DropQueue(player) .setLocation(block.getLocation()) - .addItems(drops) - .push(); + .addItems(drops); + if(!always) queue.forceTelekinesis(); + queue.push(); } // For exp drops, blockdropitemevent doesn't cover xp @@ -87,10 +88,11 @@ public class Telekinesis extends EcoEnchant { if(block.getType().equals(Material.SPAWNER)) event.setExpToDrop(0); - new DropQueue(player) + DropQueue queue = new DropQueue(player) .setLocation(block.getLocation()) - .addXP(event.getExpToDrop()) - .push(); + .addXP(event.getExpToDrop()); + if(!always) queue.forceTelekinesis(); + queue.push(); event.setExpToDrop(0); }