Record Class FacingFixer

java.lang.Object
java.lang.Record
com.ldtteam.structurize.blueprints.FacingFixer

public record FacingFixer(Predicate<net.minecraft.world.level.block.state.BlockState> test, net.minecraft.world.level.block.state.properties.DirectionProperty property, Function<net.minecraft.core.Direction,net.minecraft.core.Direction> mapping) extends Record
Used during mirroring of blueprint palette
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final FacingFixer
     
    static final FacingFixer
     
    static final List<FacingFixer>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    FacingFixer(Predicate<net.minecraft.world.level.block.state.BlockState> test, net.minecraft.world.level.block.state.properties.DirectionProperty property, Function<net.minecraft.core.Direction,net.minecraft.core.Direction> mapping)
    Creates an instance of a FacingFixer record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    static net.minecraft.world.level.block.state.BlockState
    fixMirroredFacing(net.minecraft.world.level.block.state.BlockState blockstate, net.minecraft.world.level.block.state.BlockState unmirrored)
     
    final int
    Returns a hash code value for this object.
    Function<net.minecraft.core.Direction,net.minecraft.core.Direction>
    Returns the value of the mapping record component.
    mirrorFixer(Predicate<net.minecraft.world.level.block.state.BlockState> test, net.minecraft.world.level.block.state.properties.DirectionProperty property, Function<net.minecraft.core.Direction,net.minecraft.core.Direction> mapping)
     
    net.minecraft.world.level.block.state.properties.DirectionProperty
    Returns the value of the property record component.
    Predicate<net.minecraft.world.level.block.state.BlockState>
    Returns the value of the test record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • MIRROR_FIXERS

      public static final List<FacingFixer> MIRROR_FIXERS
    • GLAZED_TERRACOTA_SPECIAL

      public static final FacingFixer GLAZED_TERRACOTA_SPECIAL
    • GLAZED_TERRACOTA_MAJORITY

      public static final FacingFixer GLAZED_TERRACOTA_MAJORITY
  • Constructor Details

    • FacingFixer

      public FacingFixer(Predicate<net.minecraft.world.level.block.state.BlockState> test, net.minecraft.world.level.block.state.properties.DirectionProperty property, Function<net.minecraft.core.Direction,net.minecraft.core.Direction> mapping)
      Creates an instance of a FacingFixer record class.
      Parameters:
      test - the value for the test record component
      property - the value for the property record component
      mapping - the value for the mapping record component
  • Method Details

    • mirrorFixer

      public static FacingFixer mirrorFixer(Predicate<net.minecraft.world.level.block.state.BlockState> test, net.minecraft.world.level.block.state.properties.DirectionProperty property, Function<net.minecraft.core.Direction,net.minecraft.core.Direction> mapping)
      Parameters:
      test - to which blocks should fixer apply
      property - which property is being fixed
      mapping - fix function
      Returns:
      fixer registered as mirror fixer
      See Also:
    • fixMirroredFacing

      public static net.minecraft.world.level.block.state.BlockState fixMirroredFacing(net.minecraft.world.level.block.state.BlockState blockstate, net.minecraft.world.level.block.state.BlockState unmirrored)
      Parameters:
      blockstate - after applying mirror
      unmirrored - before applying mirror
      Returns:
      using first matching fixer fixes the blockstate property
      See Also:
    • 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.
    • test

      public Predicate<net.minecraft.world.level.block.state.BlockState> test()
      Returns the value of the test record component.
      Returns:
      the value of the test record component
    • property

      public net.minecraft.world.level.block.state.properties.DirectionProperty property()
      Returns the value of the property record component.
      Returns:
      the value of the property record component
    • mapping

      public Function<net.minecraft.core.Direction,net.minecraft.core.Direction> mapping()
      Returns the value of the mapping record component.
      Returns:
      the value of the mapping record component