Fix: Ensure spell properties are initialized before checking if the spell is enabled

This commit is contained in:
WinDanesz
2026-04-18 23:34:56 +02:00
parent cbe7353122
commit e753f4df32
@@ -907,7 +907,7 @@ public abstract class Spell extends IForgeRegistryEntry.Impl<Spell> implements C
* its JSON file using a resource pack. If called with no arguments, defaults to any context, i.e. only returns * its JSON file using a resource pack. If called with no arguments, defaults to any context, i.e. only returns
* false if the spell is completely disabled in all contexts. */ * false if the spell is completely disabled in all contexts. */
public final boolean isEnabled(SpellProperties.Context... contexts){ public final boolean isEnabled(SpellProperties.Context... contexts){
return enabled && (contexts.length == 0 || properties.isEnabled(contexts)); return enabled && (contexts.length == 0 || (arePropertiesInitialised() && properties.isEnabled(contexts)));
} }
/** Sets whether the spell is enabled or not. */ /** Sets whether the spell is enabled or not. */