Record Class CompositeDirection

java.lang.Object
java.lang.Record
net.minecraft.core.CompositeDirection
All Implemented Interfaces:
Directional

public record CompositeDirection(Set<Direction> directions, Vec3i step) extends Record implements Directional
  • Field Details

  • Constructor Details

    • CompositeDirection

      public CompositeDirection(Set<Direction> directions, Vec3i step)
      Creates an instance of a CompositeDirection record class.
      Parameters:
      directions - the value for the directions record component
      step - the value for the step record component
    • CompositeDirection

      CompositeDirection(Direction... directions)
  • Method Details

    • compose

      public CompositeDirection compose(CompositeDirection other)
    • getStepX

      public int getStepX()
      Specified by:
      getStepX in interface Directional
    • getStepY

      public int getStepY()
      Specified by:
      getStepY in interface Directional
    • getStepZ

      public int getStepZ()
      Specified by:
      getStepZ in interface Directional
    • getStep

      public Vec3i getStep()
      Specified by:
      getStep in interface Directional
    • 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.
    • directions

      public Set<Direction> directions()
      Returns the value of the directions record component.
      Returns:
      the value of the directions record component
    • step

      public Vec3i step()
      Returns the value of the step record component.
      Returns:
      the value of the step record component