Updated existing talismans to work with ranged attacks
This commit is contained in:
@@ -2,9 +2,11 @@ package com.willfp.talismans.talismans.talismans;
|
||||
|
||||
import com.willfp.talismans.talismans.Talisman;
|
||||
import com.willfp.talismans.talismans.Talismans;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Creeper;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Trident;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -23,4 +25,28 @@ public class CreeperTalisman extends Talisman {
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArrowDamage(@NotNull final Player attacker,
|
||||
@NotNull final LivingEntity victim,
|
||||
@NotNull final Arrow arrow,
|
||||
@NotNull final EntityDamageByEntityEvent event) {
|
||||
if (!(victim instanceof Creeper)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTridentDamage(@NotNull final Player attacker,
|
||||
@NotNull final LivingEntity victim,
|
||||
@NotNull final Trident trident,
|
||||
@NotNull final EntityDamageByEntityEvent event) {
|
||||
if (!(victim instanceof Creeper)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,10 @@ package com.willfp.talismans.talismans.talismans;
|
||||
import com.willfp.talismans.talismans.Talisman;
|
||||
import com.willfp.talismans.talismans.Talismans;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Trident;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -23,4 +25,28 @@ public class EndTalisman extends Talisman {
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArrowDamage(@NotNull final Player attacker,
|
||||
@NotNull final LivingEntity victim,
|
||||
@NotNull final Arrow arrow,
|
||||
@NotNull final EntityDamageByEntityEvent event) {
|
||||
if (attacker.getWorld().getEnvironment() != World.Environment.THE_END) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTridentDamage(@NotNull final Player attacker,
|
||||
@NotNull final LivingEntity victim,
|
||||
@NotNull final Trident trident,
|
||||
@NotNull final EntityDamageByEntityEvent event) {
|
||||
if (attacker.getWorld().getEnvironment() != World.Environment.THE_END) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,10 @@ package com.willfp.talismans.talismans.talismans;
|
||||
import com.willfp.talismans.talismans.Talisman;
|
||||
import com.willfp.talismans.talismans.Talismans;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Trident;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -23,4 +25,28 @@ public class NetherTalisman extends Talisman {
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArrowDamage(@NotNull final Player attacker,
|
||||
@NotNull final LivingEntity victim,
|
||||
@NotNull final Arrow arrow,
|
||||
@NotNull final EntityDamageByEntityEvent event) {
|
||||
if (attacker.getWorld().getEnvironment() != World.Environment.NETHER) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTridentDamage(@NotNull final Player attacker,
|
||||
@NotNull final LivingEntity victim,
|
||||
@NotNull final Trident trident,
|
||||
@NotNull final EntityDamageByEntityEvent event) {
|
||||
if (attacker.getWorld().getEnvironment() != World.Environment.NETHER) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@ package com.willfp.talismans.talismans.talismans;
|
||||
|
||||
import com.willfp.talismans.talismans.Talisman;
|
||||
import com.willfp.talismans.talismans.Talismans;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Illager;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Trident;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -23,4 +25,28 @@ public class RaidTalisman extends Talisman {
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArrowDamage(@NotNull final Player attacker,
|
||||
@NotNull final LivingEntity victim,
|
||||
@NotNull final Arrow arrow,
|
||||
@NotNull final EntityDamageByEntityEvent event) {
|
||||
if (!(victim instanceof Illager)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTridentDamage(@NotNull final Player attacker,
|
||||
@NotNull final LivingEntity victim,
|
||||
@NotNull final Trident trident,
|
||||
@NotNull final EntityDamageByEntityEvent event) {
|
||||
if (!(victim instanceof Illager)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@ package com.willfp.talismans.talismans.talismans;
|
||||
|
||||
import com.willfp.talismans.talismans.Talisman;
|
||||
import com.willfp.talismans.talismans.Talismans;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Skeleton;
|
||||
import org.bukkit.entity.Trident;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -23,4 +25,28 @@ public class SkeletonTalisman extends Talisman {
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArrowDamage(@NotNull final Player attacker,
|
||||
@NotNull final LivingEntity victim,
|
||||
@NotNull final Arrow arrow,
|
||||
@NotNull final EntityDamageByEntityEvent event) {
|
||||
if (!(victim instanceof Skeleton)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTridentDamage(@NotNull final Player attacker,
|
||||
@NotNull final LivingEntity victim,
|
||||
@NotNull final Trident trident,
|
||||
@NotNull final EntityDamageByEntityEvent event) {
|
||||
if (!(victim instanceof Skeleton)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@ package com.willfp.talismans.talismans.talismans;
|
||||
|
||||
import com.willfp.talismans.talismans.Talisman;
|
||||
import com.willfp.talismans.talismans.Talismans;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Spider;
|
||||
import org.bukkit.entity.Trident;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -23,4 +25,28 @@ public class SpiderTalisman extends Talisman {
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArrowDamage(@NotNull final Player attacker,
|
||||
@NotNull final LivingEntity victim,
|
||||
@NotNull final Arrow arrow,
|
||||
@NotNull final EntityDamageByEntityEvent event) {
|
||||
if (!(victim instanceof Spider)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTridentDamage(@NotNull final Player attacker,
|
||||
@NotNull final LivingEntity victim,
|
||||
@NotNull final Trident trident,
|
||||
@NotNull final EntityDamageByEntityEvent event) {
|
||||
if (!(victim instanceof Spider)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,10 @@ package com.willfp.talismans.talismans.talismans;
|
||||
|
||||
import com.willfp.talismans.talismans.Talisman;
|
||||
import com.willfp.talismans.talismans.Talismans;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Trident;
|
||||
import org.bukkit.entity.Zombie;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -23,4 +25,28 @@ public class ZombieTalisman extends Talisman {
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArrowDamage(@NotNull final Player attacker,
|
||||
@NotNull final LivingEntity victim,
|
||||
@NotNull final Arrow arrow,
|
||||
@NotNull final EntityDamageByEntityEvent event) {
|
||||
if (!(victim instanceof Zombie)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTridentDamage(@NotNull final Player attacker,
|
||||
@NotNull final LivingEntity victim,
|
||||
@NotNull final Trident trident,
|
||||
@NotNull final EntityDamageByEntityEvent event) {
|
||||
if (!(victim instanceof Zombie)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user