java.lang.Object
java.lang.Record
com.github.minecraftschurlimods.arsmagicalegacy.api.ritual.Ritual

public record Ritual(RitualTrigger trigger, List<RitualRequirement> requirements, RitualEffect effect, net.minecraft.core.BlockPos offset) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<Ritual>
     
    static final com.mojang.serialization.Codec<net.minecraft.core.HolderSet<Ritual>>
     
    static final com.mojang.serialization.Codec<net.minecraft.core.Holder<Ritual>>
     
    static final net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<Ritual>>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Ritual(RitualTrigger trigger, List<RitualRequirement> requirements, RitualEffect effect, net.minecraft.core.BlockPos offset)
    Creates an instance of a Ritual record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the effect record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    net.minecraft.core.BlockPos
    Returns the value of the offset record component.
    boolean
    perform(net.minecraft.world.entity.player.Player player, net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos, Context ctx)
     
    Returns the value of the requirements record component.
    final String
    Returns a string representation of this record class.
    Returns the value of the trigger record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • REGISTRY_KEY

      public static final net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<Ritual>> REGISTRY_KEY
    • DIRECT_CODEC

      public static final com.mojang.serialization.Codec<Ritual> DIRECT_CODEC
    • REFERENCE_CODEC

      public static final com.mojang.serialization.Codec<net.minecraft.core.Holder<Ritual>> REFERENCE_CODEC
    • LIST_CODEC

      public static final com.mojang.serialization.Codec<net.minecraft.core.HolderSet<Ritual>> LIST_CODEC
  • Constructor Details

    • Ritual

      public Ritual(RitualTrigger trigger, List<RitualRequirement> requirements, RitualEffect effect, net.minecraft.core.BlockPos offset)
      Creates an instance of a Ritual record class.
      Parameters:
      trigger - the value for the trigger record component
      requirements - the value for the requirements record component
      effect - the value for the effect record component
      offset - the value for the offset record component
  • Method Details

    • perform

      public boolean perform(net.minecraft.world.entity.player.Player player, net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos, Context ctx)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • trigger

      public RitualTrigger trigger()
      Returns the value of the trigger record component.
      Returns:
      the value of the trigger record component
    • requirements

      public List<RitualRequirement> requirements()
      Returns the value of the requirements record component.
      Returns:
      the value of the requirements record component
    • effect

      public RitualEffect effect()
      Returns the value of the effect record component.
      Returns:
      the value of the effect record component
    • offset

      public net.minecraft.core.BlockPos offset()
      Returns the value of the offset record component.
      Returns:
      the value of the offset record component