Record Class SideChainPartBlock.SideChainNeighbor

java.lang.Object
java.lang.Record
net.minecraft.world.level.block.SideChainPartBlock.SideChainNeighbor
All Implemented Interfaces:
SideChainPartBlock.Neighbor
Enclosing interface:
SideChainPartBlock

public static record SideChainPartBlock.SideChainNeighbor(LevelAccessor level, SideChainPartBlock block, BlockPos pos, SideChainPart part) extends Record implements SideChainPartBlock.Neighbor
  • Field Details

    • level

      private final LevelAccessor level
      The field for the level record component.
    • block

      private final SideChainPartBlock block
      The field for the block record component.
    • pos

      private final BlockPos pos
      The field for the pos record component.
    • part

      private final SideChainPart part
      The field for the part record component.
  • Constructor Details

    • SideChainNeighbor

      public SideChainNeighbor(LevelAccessor level, SideChainPartBlock block, BlockPos pos, SideChainPart part)
      Creates an instance of a SideChainNeighbor record class.
      Parameters:
      level - the value for the level record component
      block - the value for the block record component
      pos - the value for the pos record component
      part - the value for the part record component
  • Method Details

    • isConnectable

      public boolean isConnectable()
      Specified by:
      isConnectable in interface SideChainPartBlock.Neighbor
    • isUnconnectableOrChainEnd

      public boolean isUnconnectableOrChainEnd()
      Specified by:
      isUnconnectableOrChainEnd in interface SideChainPartBlock.Neighbor
    • connectsTowards

      public boolean connectsTowards(SideChainPart p_434316_)
      Specified by:
      connectsTowards in interface SideChainPartBlock.Neighbor
    • connectToTheRight

      public void connectToTheRight()
      Specified by:
      connectToTheRight in interface SideChainPartBlock.Neighbor
    • connectToTheLeft

      public void connectToTheLeft()
      Specified by:
      connectToTheLeft in interface SideChainPartBlock.Neighbor
    • disconnectFromRight

      public void disconnectFromRight()
      Specified by:
      disconnectFromRight in interface SideChainPartBlock.Neighbor
    • disconnectFromLeft

      public void disconnectFromLeft()
      Specified by:
      disconnectFromLeft in interface SideChainPartBlock.Neighbor
    • 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.
    • level

      public LevelAccessor level()
      Returns the value of the level record component.
      Returns:
      the value of the level record component
    • block

      public SideChainPartBlock block()
      Returns the value of the block record component.
      Returns:
      the value of the block record component
    • pos

      public BlockPos pos()
      Returns the value of the pos record component.
      Specified by:
      pos in interface SideChainPartBlock.Neighbor
      Returns:
      the value of the pos record component
    • part

      public SideChainPart part()
      Returns the value of the part record component.
      Returns:
      the value of the part record component