From 7645e71a6b5304a545bc3200ee2a25f744c5c004 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Mon, 11 Oct 2021 09:50:44 +0100 Subject: [PATCH] Updated tornado to improve anticheat compatibility and updated to 8.13.5 --- .../enchantments/ecoenchants/normal/Tornado.java | 14 ++++++++++++++ gradle.properties | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) 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 a038668b..3afc824c 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,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); } } diff --git a/gradle.properties b/gradle.properties index 48835aa1..fa5c1c0a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -version = 8.13.4 +version = 8.13.5 plugin-name = EcoEnchants \ No newline at end of file