Record Class Datapack

java.lang.Object
java.lang.Record
fr.fidorial.world.structure.Datapack
Record Components:
id - the identifier of the pack, e.g. fidorial:my_pack
source - the folder or zip the pack was read from
descriptionJson - the raw JSON description found in pack.mcmeta
templates - the number of structure templates (.nbt) it provides
structures - the number of worldgen structures it provides
structureSets - the number of structure sets it provides

public record Datapack(String id, Path source, String descriptionJson, int templates, int structures, int structureSets) extends Record
A datapack loaded from the datapacks folder of the main world.
Since:
0.1.0
  • Constructor Details

    • Datapack

      public Datapack(String id, Path source, String descriptionJson, int templates, int structures, int structureSets)
      Creates an instance of a Datapack record class.
      Parameters:
      id - the value for the id record component
      source - the value for the source record component
      descriptionJson - the value for the descriptionJson record component
      templates - the value for the templates record component
      structures - the value for the structures record component
      structureSets - the value for the structureSets 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 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 String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • source

      public Path source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component
    • descriptionJson

      public String descriptionJson()
      Returns the value of the descriptionJson record component.
      Returns:
      the value of the descriptionJson record component
    • templates

      public int templates()
      Returns the value of the templates record component.
      Returns:
      the value of the templates record component
    • structures

      public int structures()
      Returns the value of the structures record component.
      Returns:
      the value of the structures record component
    • structureSets

      public int structureSets()
      Returns the value of the structureSets record component.
      Returns:
      the value of the structureSets record component