From ad5fc136d5aa8cf68bc0c8fa4d6775be5edf909b Mon Sep 17 00:00:00 2001 From: xGinko Date: Fri, 12 May 2023 20:25:04 +0200 Subject: [PATCH] fix nbtapi shade in as well as pistonaura --- pom.xml | 4 +++- .../modules/combat/PreventPistonAura.java | 15 +++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index f8fb02ce5..0b5b81788 100644 --- a/pom.xml +++ b/pom.xml @@ -60,9 +60,12 @@ *:* + LICENSE META-INF/MANIFEST.MF META-INF/LICENSE.txt META-INF/NOTICE.txt + META-INF/maven/de.tr7zw/functional-annotations/pom.properties + META-INF/maven/de.tr7zw/functional-annotations/pom.xml com/cryptomorin/xseries/XBiome* com/cryptomorin/xseries/XEntity* com/cryptomorin/xseries/XPotion* @@ -146,7 +149,6 @@ de.tr7zw item-nbt-api 2.11.2 - provided diff --git a/src/main/java/me/moomoo/anarchyexploitfixes/modules/combat/PreventPistonAura.java b/src/main/java/me/moomoo/anarchyexploitfixes/modules/combat/PreventPistonAura.java index 3f972b09a..91dddf50a 100644 --- a/src/main/java/me/moomoo/anarchyexploitfixes/modules/combat/PreventPistonAura.java +++ b/src/main/java/me/moomoo/anarchyexploitfixes/modules/combat/PreventPistonAura.java @@ -25,7 +25,7 @@ public PreventPistonAura() { this.plugin = AnarchyExploitFixes.getInstance(); Config config = AnarchyExploitFixes.getConfiguration(); config.addComment("combat.prevent-piston-aura.enable", "Prevents crystals from dealing damage for a short time if they have been moved."); - this.keepPlacedEndcrystalInMemoryTime = config.getInt("combat.prevent-piston-aura.moved-crystals-cant-do-damage-for-x-ticks", 60); + this.keepPlacedEndcrystalInMemoryTime = config.getInt("combat.prevent-piston-aura.moved-crystals-cant-do-damage-for-x-ticks", 40); } @Override @@ -49,21 +49,20 @@ public boolean shouldEnable() { return AnarchyExploitFixes.getConfiguration().getBoolean("combat.prevent-piston-aura.enable", false); } - @EventHandler(ignoreCancelled = true, priority = EventPriority.NORMAL) + @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) private void onEntitySpawn(EntitySpawnEvent event) { if (event.getEntity() instanceof EnderCrystal) { UUID endCrystal = event.getEntity().getUniqueId(); - endcrystals.put(endCrystal, event.getEntity().getLocation()); + endcrystals.put(endCrystal, event.getLocation()); plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () -> endcrystals.remove(endCrystal), keepPlacedEndcrystalInMemoryTime); } } - @EventHandler(ignoreCancelled = true, priority = EventPriority.NORMAL) + @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) private void onCrystalExplode(EntityDamageByEntityEvent event) { - UUID damagingEntityId = event.getDamager().getUniqueId(); - if (endcrystals.containsKey(damagingEntityId) && !endcrystals.get(damagingEntityId).equals(event.getDamager().getLocation())) { - event.setDamage(0); - endcrystals.remove(damagingEntityId); + UUID endCrystal = event.getEntity().getUniqueId(); + if (endcrystals.containsKey(endCrystal) && !endcrystals.get(endCrystal).equals(event.getDamager().getLocation())) { + event.setCancelled(true); } } }