diff --git a/src/main/java/electroblob/wizardry/registry/WizardrySounds.java b/src/main/java/electroblob/wizardry/registry/WizardrySounds.java index 8aefe1e9..a0353429 100644 --- a/src/main/java/electroblob/wizardry/registry/WizardrySounds.java +++ b/src/main/java/electroblob/wizardry/registry/WizardrySounds.java @@ -133,10 +133,17 @@ public final class WizardrySounds { public static final SoundEvent MISC_PAGE_TURN = createSound("misc.page_turn"); public static final SoundEvent MISC_FREEZE = createSound("misc.freeze"); - /** Trick borrowed from the Twilight Forest, makes things neater. */ + // Trick borrowed from the Twilight Forest, makes things neater. + + /** Overload for {@link WizardrySounds#createSound(String, String)} which assigns wizardry's mod ID automatically. */ public static SoundEvent createSound(String name){ + return createSound(Wizardry.MODID, name); + } + + /** Creates a sound with the given name, to be read from {@code assets/[modID]/sounds.json}. */ + public static SoundEvent createSound(String modID, String name){ // All the setRegistryName methods delegate to this one, it doesn't matter which you use. - return new SoundEvent(new ResourceLocation(Wizardry.MODID, name)).setRegistryName(name); + return new SoundEvent(new ResourceLocation(modID, name)).setRegistryName(name); } // For some reason, sound events seem to work even when they aren't registered, without even so much as a warning. diff --git a/src/main/java/electroblob/wizardry/spell/Spell.java b/src/main/java/electroblob/wizardry/spell/Spell.java index fb4fd3dd..047680c8 100644 --- a/src/main/java/electroblob/wizardry/spell/Spell.java +++ b/src/main/java/electroblob/wizardry/spell/Spell.java @@ -294,7 +294,7 @@ public abstract class Spell extends IForgeRegistryEntry.Impl implements C * @see Spell#createSoundsWithSuffixes(String[]) */ public final SoundEvent createSoundWithSuffix(String suffix){ - return WizardrySounds.createSound("spell." + this.getRegistryName().getPath() + "." + suffix); + return WizardrySounds.createSound(this.getRegistryName().getNamespace(), "spell." + this.getRegistryName().getPath() + "." + suffix); } /**