Updated tornado to improve anticheat compatibility and updated to 8.13.5

This commit is contained in:
Auxilor 2021-10-11 09:50:44 +01:00
parent ff31c177b7
commit 7645e71a6b
2 changed files with 15 additions and 1 deletions

View File

@ -1,9 +1,11 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.core.integrations.anticheat.AnticheatManager;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.util.Vector;
import org.jetbrains.annotations.NotNull;
@ -25,6 +27,18 @@ public class Tornado extends EcoEnchant {
Vector toAdd = new Vector(0, yVelocity, 0);
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));
});
this.getPlugin().getScheduler().runLater(() -> victim.setVelocity(victim.getVelocity().clone().add(toAdd)), 1);
}
}

View File

@ -1,2 +1,2 @@
version = 8.13.4
version = 8.13.5
plugin-name = EcoEnchants