From 34b8254e390a59fd5dd2fee1d90aee9fa5866c8e Mon Sep 17 00:00:00 2001 From: Zsolt Molnar Date: Sun, 8 Sep 2024 23:05:47 +0200 Subject: [PATCH] Update effects code --- src/main/java/net/wizards/effect/Effects.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/wizards/effect/Effects.java b/src/main/java/net/wizards/effect/Effects.java index 23314fb..1f510f7 100644 --- a/src/main/java/net/wizards/effect/Effects.java +++ b/src/main/java/net/wizards/effect/Effects.java @@ -17,7 +17,7 @@ import java.util.ArrayList; public class Effects { - private static ArrayList entries = new ArrayList<>(); + private static final ArrayList entries = new ArrayList<>(); public static class Entry { public final Identifier id; public final StatusEffect effect; @@ -32,6 +32,10 @@ public Entry(String name, StatusEffect effect) { public void register() { registryEntry = Registry.registerReference(Registries.STATUS_EFFECT, id, effect); } + + public Identifier modifierId() { + return Identifier.of(WizardsMod.ID, "effect." + id.getPath()); + } } public static Entry frozen = new Entry("frozen", @@ -67,7 +71,7 @@ public static void register() { /// Adding attribute modifier here due to relying on config value arcaneCharge.effect.addAttributeModifier( SpellSchools.ARCANE.attributeEntry, - Identifier.of(WizardsMod.ID, "effect.arcane_charge"), + arcaneCharge.modifierId(), WizardsMod.tweaksConfig.value.arcane_charge_damage_per_stack, EntityAttributeModifier.Operation.ADD_MULTIPLIED_TOTAL);