diff --git a/src/main/java/net/Indyuce/mmoitems/ability/list/location/Snowman_Turret.java b/src/main/java/net/Indyuce/mmoitems/ability/list/location/Snowman_Turret.java index b34ce7fb..f3d60a94 100644 --- a/src/main/java/net/Indyuce/mmoitems/ability/list/location/Snowman_Turret.java +++ b/src/main/java/net/Indyuce/mmoitems/ability/list/location/Snowman_Turret.java @@ -95,5 +95,10 @@ public class Snowman_Turret extends LocationAbility { if (entities.contains(event.getDamager().getUniqueId())) event.setDamage(damage); } - } + + @Override + public void whenClosed() { + // Nothing + } + } } diff --git a/src/main/java/net/Indyuce/mmoitems/ability/list/simple/Blizzard.java b/src/main/java/net/Indyuce/mmoitems/ability/list/simple/Blizzard.java index a0036f3e..bc3c54fa 100644 --- a/src/main/java/net/Indyuce/mmoitems/ability/list/simple/Blizzard.java +++ b/src/main/java/net/Indyuce/mmoitems/ability/list/simple/Blizzard.java @@ -74,5 +74,10 @@ public class Blizzard extends SimpleAbility { if (entities.contains(event.getDamager().getUniqueId())) event.setDamage(damage); } - } + + @Override + public void whenClosed() { + // Nothing + } + } } diff --git a/src/main/java/net/Indyuce/mmoitems/ability/list/simple/Bunny_Mode.java b/src/main/java/net/Indyuce/mmoitems/ability/list/simple/Bunny_Mode.java index a07d9b36..b43eadb3 100644 --- a/src/main/java/net/Indyuce/mmoitems/ability/list/simple/Bunny_Mode.java +++ b/src/main/java/net/Indyuce/mmoitems/ability/list/simple/Bunny_Mode.java @@ -73,5 +73,10 @@ public class Bunny_Mode extends SimpleAbility { if (event.getEntity().equals(player) && event.getCause() == DamageCause.FALL) event.setCancelled(true); } - } + + @Override + public void whenClosed() { + // Nothing + } + } } diff --git a/src/main/java/net/Indyuce/mmoitems/ability/list/simple/Chicken_Wraith.java b/src/main/java/net/Indyuce/mmoitems/ability/list/simple/Chicken_Wraith.java index 3c7c9cee..72bb69d0 100644 --- a/src/main/java/net/Indyuce/mmoitems/ability/list/simple/Chicken_Wraith.java +++ b/src/main/java/net/Indyuce/mmoitems/ability/list/simple/Chicken_Wraith.java @@ -72,9 +72,8 @@ public class Chicken_Wraith extends SimpleAbility { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void a(PlayerEggThrowEvent event) { - if (entities.contains(event.getEgg().getEntityId())) { + if (entities.contains(event.getEgg().getEntityId())) event.setHatching(false); - } } @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @@ -82,5 +81,10 @@ public class Chicken_Wraith extends SimpleAbility { if (entities.contains(event.getDamager().getEntityId())) event.setDamage(damage); } - } + + @Override + public void whenClosed() { + // Nothing + } + } } diff --git a/src/main/java/net/Indyuce/mmoitems/ability/list/vector/Corrupted_Fangs.java b/src/main/java/net/Indyuce/mmoitems/ability/list/vector/Corrupted_Fangs.java index ee6670a8..ccc43bfd 100644 --- a/src/main/java/net/Indyuce/mmoitems/ability/list/vector/Corrupted_Fangs.java +++ b/src/main/java/net/Indyuce/mmoitems/ability/list/vector/Corrupted_Fangs.java @@ -76,5 +76,10 @@ public class Corrupted_Fangs extends VectorAbility implements Listener { attackMeta.damage((LivingEntity) event.getEntity()); } } + + @Override + public void whenClosed() { + // Nothing + } } } diff --git a/src/main/java/net/Indyuce/mmoitems/ability/list/vector/Explosive_Turkey.java b/src/main/java/net/Indyuce/mmoitems/ability/list/vector/Explosive_Turkey.java index 849ea76b..cbab9ad6 100644 --- a/src/main/java/net/Indyuce/mmoitems/ability/list/vector/Explosive_Turkey.java +++ b/src/main/java/net/Indyuce/mmoitems/ability/list/vector/Explosive_Turkey.java @@ -116,16 +116,9 @@ public class Explosive_Turkey extends VectorAbility implements Listener { this.chicken = chicken; } - /* - * Make sure the chicken is ALWAYS killed, this class really uses - * overkill methods but there are plently issues with chickens remaining - */ @Override - public boolean close() { - boolean b = super.close(); - if (b) - chicken.remove(); - return b; + public void whenClosed() { + chicken.remove(); } @EventHandler diff --git a/src/main/java/net/Indyuce/mmoitems/ability/list/vector/TNT_Throw.java b/src/main/java/net/Indyuce/mmoitems/ability/list/vector/TNT_Throw.java index 76da1782..461ab9e3 100644 --- a/src/main/java/net/Indyuce/mmoitems/ability/list/vector/TNT_Throw.java +++ b/src/main/java/net/Indyuce/mmoitems/ability/list/vector/TNT_Throw.java @@ -37,8 +37,8 @@ public class TNT_Throw extends VectorAbility implements Listener { attack.getPlayer().getWorld().spawnParticle(Particle.EXPLOSION_NORMAL, attack.getPlayer().getLocation().add(0, 1, 0), 12, 0, 0, 0, .1); } - /* - * used to cancel team damage and other things + /** + * Used to cancel team damage and other things */ public static class CancelTeamDamage extends TemporaryListener { private final Player player; @@ -58,5 +58,10 @@ public class TNT_Throw extends VectorAbility implements Listener { if (event.getDamager().equals(tnt) && !MMOUtils.canTarget(player, event.getEntity())) event.setCancelled(true); } + + @Override + public void whenClosed() { + // Nothing + } } } diff --git a/src/main/java/net/Indyuce/mmoitems/listener/ItemUse.java b/src/main/java/net/Indyuce/mmoitems/listener/ItemUse.java index f6514c7b..7b34ee30 100644 --- a/src/main/java/net/Indyuce/mmoitems/listener/ItemUse.java +++ b/src/main/java/net/Indyuce/mmoitems/listener/ItemUse.java @@ -143,11 +143,6 @@ public class ItemUse implements Listener { new ItemAttackMetadata(event.getAttack()).applyEffects(item, event.getEntity()); } - private ItemAttackMetadata getAttack(PlayerData playerData, EntityDamageByEntityEvent event) { - StatMap.CachedStatMap cachedStatMap = playerData.getMMOPlayerData().getStatMap().cache(EquipmentSlot.MAIN_HAND); - return new ItemAttackMetadata(new DamageMetadata(event.getDamage(), DamageType.WEAPON, DamageType.PHYSICAL), cachedStatMap); - } - /** * Event priority set to LOW to fix an infinite-exp glitch with * MMOCore. MMOCore experience source listens on HIGH and must be diff --git a/src/main/java/net/Indyuce/mmoitems/stat/type/DoubleStat.java b/src/main/java/net/Indyuce/mmoitems/stat/type/DoubleStat.java index 0431165e..ca0514e5 100644 --- a/src/main/java/net/Indyuce/mmoitems/stat/type/DoubleStat.java +++ b/src/main/java/net/Indyuce/mmoitems/stat/type/DoubleStat.java @@ -293,7 +293,7 @@ public class DoubleStat extends ItemStat implements Upgradable, Previewable { */ if (message.contains("->")) { String[] split = message.replace(" ", "").split(Pattern.quote("->")); - Validate.isTrue(split.length > 1, "You must specif two (both min and max) values"); + Validate.isTrue(split.length > 1, "You must specify two (both min and max) values"); double min = Double.parseDouble(split[0]), max = Double.parseDouble(split[1]); Validate.isTrue(max > min, "Max value must be greater than min value");