From 445ad5bb185c642355e8c92a1411e39740ebc5df Mon Sep 17 00:00:00 2001 From: _OfTeN_ Date: Mon, 11 Oct 2021 11:44:35 +0300 Subject: [PATCH] Added time-to-exempt config option for Tornado enchantment and started exempting players that were hit by Tornado from being detectedf by AntiCheats. --- .../enchantments/ecoenchants/normal/Tornado.java | 14 -------------- .../src/main/resources/enchants/normal/tornado.yml | 3 ++- 2 files changed, 2 insertions(+), 15 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 3afc824c..a038668b 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 @@ -1,11 +1,9 @@ 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; @@ -27,18 +25,6 @@ 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); } } diff --git a/eco-core/core-plugin/src/main/resources/enchants/normal/tornado.yml b/eco-core/core-plugin/src/main/resources/enchants/normal/tornado.yml index 3dcc58cc..d6383875 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/normal/tornado.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/normal/tornado.yml @@ -29,4 +29,5 @@ general-config: maximum-level: 2 config: - velocity-per-level: 0.25 \ No newline at end of file + velocity-per-level: 0.25 + time-to-exempt: 60 #In ticks. Time to exempt hit player from being detected by your Anti-Cheat for flying (The higher max velocity is - the higher should be this value) \ No newline at end of file