From 717c2a87baf93eaa80c06552ab63b1c8ebc047c6 Mon Sep 17 00:00:00 2001 From: _OfTeN_ Date: Mon, 18 Oct 2021 20:01:43 +0300 Subject: [PATCH] Fixed grindstone dupe bug --- .../ecoenchants/normal/Tornado.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Tornado.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Tornado.java index c2f83953..2d3cdd91 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Tornado.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Tornado.java @@ -27,12 +27,18 @@ public class Tornado extends EcoEnchant { Vector toAdd = new Vector(0, yVelocity, 0); - this.getPlugin().getScheduler().runLater(() -> { - if (victim instanceof Player player) { - AnticheatManager.exemptPlayer(player); - this.getPlugin().getScheduler().runLater(() -> AnticheatManager.unexemptPlayer(player), this.getConfig().getInt("time-to-exempt")); - } + if (victim instanceof Player pVictim) { + AnticheatManager.exemptPlayer(pVictim); + + this.getPlugin().getScheduler().runLater(() -> { + AnticheatManager.unexemptPlayer(pVictim); + }, 40); + } + + this.getPlugin().getScheduler().run(() -> { victim.setVelocity(victim.getVelocity().clone().add(toAdd)); - }, 1); + }); + + this.getPlugin().getScheduler().runLater(() -> victim.setVelocity(victim.getVelocity().clone().add(toAdd)), 1); } -} +} \ No newline at end of file