Record Class SMetadata
java.lang.Object
java.lang.Record
net.lcc.sollib.api.common.data.runtime.metadata.SMetadata
public record SMetadata(com.google.gson.JsonObject condition, com.google.gson.JsonObject remaps)
extends Record
Any data/resource pack file can be given additional metadata by putting a file with the same name and an added .sol next to it
For example, yourmod:random/path/awesomefile.json reads its metadata from yourmod:random/path/awesomefile.json.sol in the same pack
This metadata file allows defining things such as load conditions or dynamic remaps
For example, yourmod:random/path/awesomefile.json reads its metadata from yourmod:random/path/awesomefile.json.sol in the same pack
This metadata file allows defining things such as load conditions or dynamic remaps
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTo add load conditions to a data/resource pack file, add a "load_condition" object to its metadata
There currently are 5 types of conditions:
- "dependency": Takes an extra mod argument.static class -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSMetadata(com.google.gson.JsonObject condition, com.google.gson.JsonObject remaps) Creates an instance of aSMetadatarecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.gson.JsonObjectReturns the value of theconditionrecord component.final booleanIndicates whether some other object is "equal to" this one.static SMetadatagetFor(net.minecraft.resources.ResourceLocation id, net.minecraft.server.packs.PackResources pack, net.minecraft.server.packs.PackType type) final inthashCode()Returns a hash code value for this object.com.google.gson.JsonObjectremaps()Returns the value of theremapsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
EMPTY
-
-
Constructor Details
-
SMetadata
public SMetadata(com.google.gson.JsonObject condition, com.google.gson.JsonObject remaps) Creates an instance of aSMetadatarecord class.- Parameters:
condition- the value for theconditionrecord componentremaps- the value for theremapsrecord component
-
-
Method Details
-
getFor
public static SMetadata getFor(net.minecraft.resources.ResourceLocation id, net.minecraft.server.packs.PackResources pack, net.minecraft.server.packs.PackType type) -
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. -
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. -
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). -
condition
public com.google.gson.JsonObject condition()Returns the value of theconditionrecord component.- Returns:
- the value of the
conditionrecord component
-
remaps
public com.google.gson.JsonObject remaps()Returns the value of theremapsrecord component.- Returns:
- the value of the
remapsrecord component
-