Record Class PrefabSpell
java.lang.Object
java.lang.Record
com.github.minecraftschurlimods.arsmagicalegacy.api.spell.PrefabSpell
- All Implemented Interfaces:
IPrefabSpell
public record PrefabSpell(net.minecraft.network.chat.Component name, ISpell spell, net.minecraft.resources.ResourceLocation icon)
extends Record
implements IPrefabSpell
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<PrefabSpell>static final com.mojang.serialization.Codec<net.minecraft.core.HolderSet<PrefabSpell>>static final com.mojang.serialization.Codec<net.minecraft.core.Holder<PrefabSpell>>static final net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<PrefabSpell>>static final String -
Constructor Summary
ConstructorsConstructorDescriptionPrefabSpell(net.minecraft.network.chat.Component name, ISpell spell, net.minecraft.resources.ResourceLocation icon) Creates an instance of aPrefabSpellrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.resources.ResourceLocationicon()Returns the value of theiconrecord component.net.minecraft.world.item.ItemStacknet.minecraft.network.chat.Componentname()Returns the value of thenamerecord component.spell()Returns the value of thespellrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
SPELL_PREFAB_NAME
- See Also:
-
REGISTRY_KEY
public static final net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<PrefabSpell>> REGISTRY_KEY -
DIRECT_CODEC
-
REFERENCE_CODEC
public static final com.mojang.serialization.Codec<net.minecraft.core.Holder<PrefabSpell>> REFERENCE_CODEC -
LIST_CODEC
public static final com.mojang.serialization.Codec<net.minecraft.core.HolderSet<PrefabSpell>> LIST_CODEC
-
-
Constructor Details
-
PrefabSpell
public PrefabSpell(net.minecraft.network.chat.Component name, ISpell spell, net.minecraft.resources.ResourceLocation icon) Creates an instance of aPrefabSpellrecord class.- Parameters:
name- the value for thenamerecord componentspell- the value for thespellrecord componenticon- the value for theiconrecord component
-
-
Method Details
-
makeSpell
public net.minecraft.world.item.ItemStack makeSpell()- Specified by:
makeSpellin interfaceIPrefabSpell- Returns:
- A spell item stack built from this prefab spell.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
name
public net.minecraft.network.chat.Component name()Returns the value of thenamerecord component.- Specified by:
namein interfaceIPrefabSpell- Returns:
- the value of the
namerecord component
-
spell
Returns the value of thespellrecord component.- Specified by:
spellin interfaceIPrefabSpell- Returns:
- the value of the
spellrecord component
-
icon
public net.minecraft.resources.ResourceLocation icon()Returns the value of theiconrecord component.- Specified by:
iconin interfaceIPrefabSpell- Returns:
- the value of the
iconrecord component
-