Record Class Block

java.lang.Object
java.lang.Record
com.zenith.mc.block.Block
All Implemented Interfaces:
RegistryData

public record Block(int id, String name, int minStateId, int maxStateId, int mapColorId, BlockOffsetType offsetType, float maxHorizontalOffset, float maxVerticalOffset, boolean solidBlock, float destroySpeed, boolean requiresCorrectToolForDrops, EnumSet<BlockTags> blockTags, boolean replaceable, float friction, float speedFactor, float jumpFactor, boolean isAir, @Nullable BlockEntityType blockEntityType) extends Record implements RegistryData
  • Constructor Summary

    Constructors
    Constructor
    Description
    Block(int id, String name, int minStateId, int maxStateId, int mapColorId, BlockOffsetType offsetType, float maxHorizontalOffset, float maxVerticalOffset, boolean solidBlock, float destroySpeed, boolean requiresCorrectToolForDrops, EnumSet<BlockTags> blockTags, boolean replaceable, float friction, float speedFactor, float jumpFactor, boolean isAir, @Nullable BlockEntityType blockEntityType)
    Creates an instance of a Block record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable BlockEntityType
    Returns the value of the blockEntityType record component.
    Returns the value of the blockTags record component.
    float
    Returns the value of the destroySpeed record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    float
    Returns the value of the friction record component.
    final int
    Returns a hash code value for this object.
    int
    id()
    Returns the value of the id record component.
    boolean
    Returns the value of the isAir record component.
    float
    Returns the value of the jumpFactor record component.
    int
    Returns the value of the mapColorId record component.
    float
    Returns the value of the maxHorizontalOffset record component.
    int
    Returns the value of the maxStateId record component.
    float
    Returns the value of the maxVerticalOffset record component.
    int
    Returns the value of the minStateId record component.
    Returns the value of the name record component.
    Returns the value of the offsetType record component.
    boolean
    Returns the value of the replaceable record component.
    boolean
    Returns the value of the requiresCorrectToolForDrops record component.
    boolean
    Returns the value of the solidBlock record component.
    float
    Returns the value of the speedFactor record component.
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • Block

      public Block(int id, String name, int minStateId, int maxStateId, int mapColorId, BlockOffsetType offsetType, float maxHorizontalOffset, float maxVerticalOffset, boolean solidBlock, float destroySpeed, boolean requiresCorrectToolForDrops, EnumSet<BlockTags> blockTags, boolean replaceable, float friction, float speedFactor, float jumpFactor, boolean isAir, @Nullable BlockEntityType blockEntityType)
      Creates an instance of a Block record class.
      Parameters:
      id - the value for the id record component
      name - the value for the name record component
      minStateId - the value for the minStateId record component
      maxStateId - the value for the maxStateId record component
      mapColorId - the value for the mapColorId record component
      offsetType - the value for the offsetType record component
      maxHorizontalOffset - the value for the maxHorizontalOffset record component
      maxVerticalOffset - the value for the maxVerticalOffset record component
      solidBlock - the value for the solidBlock record component
      destroySpeed - the value for the destroySpeed record component
      requiresCorrectToolForDrops - the value for the requiresCorrectToolForDrops record component
      blockTags - the value for the blockTags record component
      replaceable - the value for the replaceable record component
      friction - the value for the friction record component
      speedFactor - the value for the speedFactor record component
      jumpFactor - the value for the jumpFactor record component
      isAir - the value for the isAir record component
      blockEntityType - the value for the blockEntityType record component
  • Method Details

    • toString

      public 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • id

      public int id()
      Returns the value of the id record component.
      Specified by:
      id in interface RegistryData
      Returns:
      the value of the id record component
    • name

      public String name()
      Returns the value of the name record component.
      Specified by:
      name in interface RegistryData
      Returns:
      the value of the name record component
    • minStateId

      public int minStateId()
      Returns the value of the minStateId record component.
      Returns:
      the value of the minStateId record component
    • maxStateId

      public int maxStateId()
      Returns the value of the maxStateId record component.
      Returns:
      the value of the maxStateId record component
    • mapColorId

      public int mapColorId()
      Returns the value of the mapColorId record component.
      Returns:
      the value of the mapColorId record component
    • offsetType

      public BlockOffsetType offsetType()
      Returns the value of the offsetType record component.
      Returns:
      the value of the offsetType record component
    • maxHorizontalOffset

      public float maxHorizontalOffset()
      Returns the value of the maxHorizontalOffset record component.
      Returns:
      the value of the maxHorizontalOffset record component
    • maxVerticalOffset

      public float maxVerticalOffset()
      Returns the value of the maxVerticalOffset record component.
      Returns:
      the value of the maxVerticalOffset record component
    • solidBlock

      public boolean solidBlock()
      Returns the value of the solidBlock record component.
      Returns:
      the value of the solidBlock record component
    • destroySpeed

      public float destroySpeed()
      Returns the value of the destroySpeed record component.
      Returns:
      the value of the destroySpeed record component
    • requiresCorrectToolForDrops

      public boolean requiresCorrectToolForDrops()
      Returns the value of the requiresCorrectToolForDrops record component.
      Returns:
      the value of the requiresCorrectToolForDrops record component
    • blockTags

      public EnumSet<BlockTags> blockTags()
      Returns the value of the blockTags record component.
      Returns:
      the value of the blockTags record component
    • replaceable

      public boolean replaceable()
      Returns the value of the replaceable record component.
      Returns:
      the value of the replaceable record component
    • friction

      public float friction()
      Returns the value of the friction record component.
      Returns:
      the value of the friction record component
    • speedFactor

      public float speedFactor()
      Returns the value of the speedFactor record component.
      Returns:
      the value of the speedFactor record component
    • jumpFactor

      public float jumpFactor()
      Returns the value of the jumpFactor record component.
      Returns:
      the value of the jumpFactor record component
    • isAir

      public boolean isAir()
      Returns the value of the isAir record component.
      Returns:
      the value of the isAir record component
    • blockEntityType

      public @Nullable BlockEntityType blockEntityType()
      Returns the value of the blockEntityType record component.
      Returns:
      the value of the blockEntityType record component