Skip to content

Commit

Permalink
fix nbtapi shade in as well as pistonaura
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed May 12, 2023
1 parent d127065 commit ad5fc13
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 3 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,12 @@
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>LICENSE</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF/LICENSE.txt</exclude>
<exclude>META-INF/NOTICE.txt</exclude>
<exclude>META-INF/maven/de.tr7zw/functional-annotations/pom.properties</exclude>
<exclude>META-INF/maven/de.tr7zw/functional-annotations/pom.xml</exclude>
<exclude>com/cryptomorin/xseries/XBiome*</exclude>
<exclude>com/cryptomorin/xseries/XEntity*</exclude>
<exclude>com/cryptomorin/xseries/XPotion*</exclude>
Expand Down Expand Up @@ -146,7 +149,6 @@
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api</artifactId>
<version>2.11.2</version>
<scope>provided</scope>
</dependency>
<!-- ConfigurationMaster for enhanced config.yml management -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
}
}

0 comments on commit ad5fc13

Please sign in to comment.