diff --git a/eco-core/core-plugin/src/main/java/com/willfp/talismans/talismans/talismans/NetherTalisman.java b/eco-core/core-plugin/src/main/java/com/willfp/talismans/talismans/talismans/NetherTalisman.java new file mode 100644 index 0000000..97672f0 --- /dev/null +++ b/eco-core/core-plugin/src/main/java/com/willfp/talismans/talismans/talismans/NetherTalisman.java @@ -0,0 +1,26 @@ +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.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.event.entity.EntityDamageByEntityEvent; +import org.jetbrains.annotations.NotNull; + +public class NetherTalisman extends Talisman { + public NetherTalisman() { + super("nether_talisman"); + } + + @Override + public void onMeleeAttack(@NotNull final Player attacker, + @NotNull final LivingEntity victim, + @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)); + } +} diff --git a/eco-core/core-plugin/src/main/resources/talismans/nethertalisman.yml b/eco-core/core-plugin/src/main/resources/talismans/nethertalisman.yml new file mode 100644 index 0000000..4f18aad --- /dev/null +++ b/eco-core/core-plugin/src/main/resources/talismans/nethertalisman.yml @@ -0,0 +1,27 @@ +name: "Nether Talisman" +description: Deal 10% more damage in the nether. +enabled: true + +obtaining: + # Recipes are left-right, top-bottom + # The first item is the top left, the second is top middle, and so on. The last is bottom right. + recipe: + - netherrack + - netherrack + - netherrack + + - netherrack + - gold_block + - netherrack + + - netherrack + - netherrack + - netherrack + +general-config: + disabled-in-worlds: [] + # Texture is base64, https://minecraft-heads.com has a list of skulls. + texture: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDUwMDI5MmY0YWZlNTJkMTBmMjk5ZGZiMjYwMzYzMjI4MzA0NTAzMzFlMDAzMDg0YmIyMjAzMzM1MzA2NjRlMSJ9fX0= + +config: + percent-more-damage: 10 \ No newline at end of file