Class SpellCastResult
java.lang.Object
at.minecraftschurli.mods.arsmagicalegacy.api.spell.SpellCastResult
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable net.minecraft.network.chat.ComponentgetSpell()booleansetMessage(net.minecraft.network.chat.Component message) Sets the given error message if none was recorded yet.Marks theSpellcast as successful.
-
Constructor Details
-
SpellCastResult
-
-
Method Details
-
isSuccess
public boolean isSuccess()- Returns:
- Whether the
Spellcast was successful. A successful result triggers behavior such as mana consumption or affinity awarding.
-
setSuccess
Marks theSpellcast as successful. A successful result triggers behavior such as mana consumption or affinity awarding. This is not reversible.- Returns:
- This object, for chaining.
-
getSpell
-
setSpell
- Parameters:
spell- TheSpellto set on the result.- Returns:
- This object, for chaining.
-
getMessage
public @Nullable net.minecraft.network.chat.Component getMessage()- Returns:
- The error message. May be null, which indicates that no error message was recorded.
-
setMessage
Sets the given error message if none was recorded yet. This behavior is to ensure that the earliest error message is returned.- Parameters:
message- The error message to set.- Returns:
- This object, for chaining.
-