Fixed grindstone dupe bug

This commit is contained in:
_OfTeN_ 2021-10-18 20:01:43 +03:00
parent e55ba7d6c1
commit 717c2a87ba

View File

@ -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);
}
}
}