temporaryListener MythicLib change

This commit is contained in:
Indyuce 2021-11-01 11:58:24 +01:00
parent 7b150ba47f
commit 220594a8eb
9 changed files with 40 additions and 23 deletions

View File

@ -95,5 +95,10 @@ public class Snowman_Turret extends LocationAbility {
if (entities.contains(event.getDamager().getUniqueId()))
event.setDamage(damage);
}
}
@Override
public void whenClosed() {
// Nothing
}
}
}

View File

@ -74,5 +74,10 @@ public class Blizzard extends SimpleAbility {
if (entities.contains(event.getDamager().getUniqueId()))
event.setDamage(damage);
}
}
@Override
public void whenClosed() {
// Nothing
}
}
}

View File

@ -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
}
}
}

View File

@ -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
}
}
}

View File

@ -76,5 +76,10 @@ public class Corrupted_Fangs extends VectorAbility implements Listener {
attackMeta.damage((LivingEntity) event.getEntity());
}
}
@Override
public void whenClosed() {
// Nothing
}
}
}

View File

@ -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

View File

@ -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
}
}
}

View File

@ -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

View File

@ -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");