Record Class CustomBlockMapping

java.lang.Object
java.lang.Record
org.geysermc.geyser.registry.mappings.util.CustomBlockMapping
Record Components:
data - The custom block data
states - The custom block state mappings
javaIdentifier - The java identifier of the block
overrideItem - Whether the custom block should override the java item

public record CustomBlockMapping(@NonNull org.geysermc.geyser.api.block.custom.CustomBlockData data, @NonNull Map<String,​CustomBlockStateMapping> states, @NonNull String javaIdentifier, boolean overrideItem) extends Record
This class is used to store a custom block mappings, which contain all of the data required to register a custom block that overrides a group of java block states.
  • Constructor Details

    • CustomBlockMapping

      public CustomBlockMapping(@NonNull org.geysermc.geyser.api.block.custom.CustomBlockData data, @NonNull Map<String,​CustomBlockStateMapping> states, @NonNull String javaIdentifier, boolean overrideItem)
      Creates an instance of a CustomBlockMapping record class.
      Parameters:
      data - the value for the data record component
      states - the value for the states record component
      javaIdentifier - the value for the javaIdentifier record component
      overrideItem - the value for the overrideItem record component
  • Method Details

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • data

      public @NonNull org.geysermc.geyser.api.block.custom.CustomBlockData data()
      Returns the value of the data record component.
      Returns:
      the value of the data record component
    • states

      public @NonNull Map<String,​CustomBlockStateMapping> states()
      Returns the value of the states record component.
      Returns:
      the value of the states record component
    • javaIdentifier

      public @NonNull String javaIdentifier()
      Returns the value of the javaIdentifier record component.
      Returns:
      the value of the javaIdentifier record component
    • overrideItem

      public boolean overrideItem()
      Returns the value of the overrideItem record component.
      Returns:
      the value of the overrideItem record component