Record Class PackMeta
java.lang.Object
java.lang.Record
kr.toxicity.model.api.pack.PackMeta
- Record Components:
pack- the main pack configurationoverlays- the optional overlays configuration
public record PackMeta(@NotNull PackMeta.Pack pack, @Nullable PackMeta.Overlay overlays)
extends Record
Represents the metadata (pack.mcmeta) of a resource pack.
This record handles the serialization and deserialization of the pack metadata, including pack format, description, and supported formats. It also supports overlays for multi-version support.
- Since:
- 1.15.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder forPackMeta.static final recordRepresents the 'overlays' section of the metadata.static final recordRepresents a single entry in the overlays list.static final recordRepresents the 'pack' section of the metadata.static final recordRepresents a pack version, consisting of major and minor numbers.static final recordRepresents a range of versions. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPackMeta(@NotNull PackMeta.Pack pack, @Nullable PackMeta.Overlay overlays) Creates an instance of aPackMetarecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull PackMeta.Builderbuilder()Creates a new builder forPackMeta.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable PackMeta.Overlayoverlays()Returns the value of theoverlaysrecord component.@NotNull PackMeta.Packpack()Returns the value of thepackrecord component.@NotNull com.google.gson.JsonElementtoJson()Converts this metadata to a JSON element.@NotNull PackResourceConverts this metadata to a pack resource.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
PATH
-
-
Constructor Details
-
PackMeta
public PackMeta(@NotNull @NotNull PackMeta.Pack pack, @Nullable @Nullable PackMeta.Overlay overlays) Creates an instance of aPackMetarecord class.
-
-
Method Details
-
builder
Creates a new builder forPackMeta.- Returns:
- a new builder instance
- Since:
- 1.15.2
-
toJson
@NotNull public @NotNull com.google.gson.JsonElement toJson()Converts this metadata to a JSON element.- Returns:
- the JSON representation
- Since:
- 1.15.2
-
toResource
Converts this metadata to a pack resource.- Returns:
- the pack resource containing the JSON data
- Since:
- 1.15.2
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
pack
-
overlays
-