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, boolean isBlock, int minStateId, int maxStateId, int mapColorId, BlockOffsetType offsetType, float maxHorizontalOffset, float maxVerticalOffset, float destroySpeed, boolean requiresCorrectToolForDrops, EnumSet<BlockTags> blockTags, @Nullable BlockEntityType blockEntityType) extends Record implements RegistryData
  • Constructor Summary

    Constructors
    Constructor
    Description
    Block(int id, String name, boolean isBlock, int minStateId, int maxStateId, int mapColorId, BlockOffsetType offsetType, float maxHorizontalOffset, float maxVerticalOffset, float destroySpeed, boolean requiresCorrectToolForDrops)
     
    Block(int id, String name, boolean isBlock, int minStateId, int maxStateId, int mapColorId, BlockOffsetType offsetType, float maxHorizontalOffset, float maxVerticalOffset, float destroySpeed, boolean requiresCorrectToolForDrops, EnumSet<BlockTags> blockTags)
     
    Block(int id, String name, boolean isBlock, int minStateId, int maxStateId, int mapColorId, BlockOffsetType offsetType, float maxHorizontalOffset, float maxVerticalOffset, float destroySpeed, boolean requiresCorrectToolForDrops, EnumSet<BlockTags> blockTags, @Nullable BlockEntityType blockEntityType)
    Creates an instance of a Block record class.
    Block(int id, String name, boolean isBlock, int minStateId, int maxStateId, int mapColorId, BlockOffsetType offsetType, float maxHorizontalOffset, float maxVerticalOffset, float destroySpeed, boolean requiresCorrectToolForDrops, BlockEntityType blockEntityType)
     
  • 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.
    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 isBlock 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 requiresCorrectToolForDrops record component.
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • Block

      public Block(int id, String name, boolean isBlock, int minStateId, int maxStateId, int mapColorId, BlockOffsetType offsetType, float maxHorizontalOffset, float maxVerticalOffset, float destroySpeed, boolean requiresCorrectToolForDrops)
    • Block

      public Block(int id, String name, boolean isBlock, int minStateId, int maxStateId, int mapColorId, BlockOffsetType offsetType, float maxHorizontalOffset, float maxVerticalOffset, float destroySpeed, boolean requiresCorrectToolForDrops, BlockEntityType blockEntityType)
    • Block

      public Block(int id, String name, boolean isBlock, int minStateId, int maxStateId, int mapColorId, BlockOffsetType offsetType, float maxHorizontalOffset, float maxVerticalOffset, float destroySpeed, boolean requiresCorrectToolForDrops, EnumSet<BlockTags> blockTags)
    • Block

      public Block(int id, String name, boolean isBlock, int minStateId, int maxStateId, int mapColorId, BlockOffsetType offsetType, float maxHorizontalOffset, float maxVerticalOffset, float destroySpeed, boolean requiresCorrectToolForDrops, EnumSet<BlockTags> blockTags, @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
      isBlock - the value for the isBlock 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
      destroySpeed - the value for the destroySpeed record component
      requiresCorrectToolForDrops - the value for the requiresCorrectToolForDrops record component
      blockTags - the value for the blockTags 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
    • isBlock

      public boolean isBlock()
      Returns the value of the isBlock record component.
      Returns:
      the value of the isBlock 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
    • 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
    • blockEntityType

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