Package kr.toxicity.model.api.data.raw
Record Class ModelData
java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.raw.ModelData
- Record Components:
meta- metaresolution- resolutionelements- elementsoutliner- childrentextures- texturesanimations- animationsgroups- groups (>=BlockBench 5.0.0)placeholder- placeholder
@Internal
public record ModelData(@NotNull ModelMeta meta, @NotNull ModelResolution resolution, @NotNull List<ModelElement> elements, @NotNull List<ModelChildren> outliner, @NotNull List<ModelTexture> textures, @Nullable List<ModelAnimation> animations, @Nullable List<ModelGroup> groups, @Nullable ModelPlaceholder placeholder)
extends Record
Raw BlockBench model's data.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionModelData(@NotNull ModelMeta meta, @NotNull ModelResolution resolution, @NotNull List<ModelElement> elements, @NotNull List<ModelChildren> outliner, @NotNull List<ModelTexture> textures, @Nullable List<ModelAnimation> animations, @Nullable List<ModelGroup> groups, @Nullable ModelPlaceholder placeholder) Creates an instance of aModelDatarecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull List<ModelAnimation> Gets animationvoidAsserts this model@NotNull List<ModelElement> elements()Returns the value of theelementsrecord component.final booleanIndicates whether some other object is "equal to" this one.@NotNull List<ModelGroup> groups()Gets groupsfinal inthashCode()Returns a hash code value for this object.@NotNull ModelLoadResultloadBlueprint(@NotNull String name) Converts model data to blueprint@NotNull ModelLoadResultloadBlueprint(@NotNull String name, boolean strict) Converts model data to blueprint@NotNull ModelMetameta()Returns the value of themetarecord component.@NotNull List<ModelChildren> outliner()Returns the value of theoutlinerrecord component.@NotNull ModelPlaceholderGets placeholder@NotNull ModelResolutionReturns the value of theresolutionrecord component.@NotNull List<ModelTexture> textures()Returns the value of thetexturesrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
GSON
public static final com.google.gson.Gson GSONGson parser
-
-
Constructor Details
-
ModelData
public ModelData(@NotNull @NotNull ModelMeta meta, @NotNull @NotNull ModelResolution resolution, @NotNull @NotNull List<ModelElement> elements, @NotNull @NotNull List<ModelChildren> outliner, @NotNull @NotNull List<ModelTexture> textures, @Nullable @Nullable List<ModelAnimation> animations, @Nullable @Nullable List<ModelGroup> groups, @Nullable @Nullable ModelPlaceholder placeholder) Creates an instance of aModelDatarecord class.- Parameters:
meta- the value for themetarecord componentresolution- the value for theresolutionrecord componentelements- the value for theelementsrecord componentoutliner- the value for theoutlinerrecord componenttextures- the value for thetexturesrecord componentanimations- the value for theanimationsrecord componentgroups- the value for thegroupsrecord componentplaceholder- the value for theplaceholderrecord component
-
-
Method Details
-
loadBlueprint
Converts model data to blueprint- Parameters:
name- blueprint name- Returns:
- blueprint
-
loadBlueprint
@NotNull public @NotNull ModelLoadResult loadBlueprint(@NotNull @NotNull String name, boolean strict) Converts model data to blueprint- Parameters:
name- blueprint namestrict- strict- Returns:
- blueprint
-
assertSupported
public void assertSupported()Asserts this model -
placeholder
Gets placeholder- Returns:
- placeholder
-
animations
Gets animation- Returns:
- animation
-
groups
Gets groups- Returns:
- groups
-
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). -
meta
Returns the value of themetarecord component.- Returns:
- the value of the
metarecord component
-
resolution
Returns the value of theresolutionrecord component.- Returns:
- the value of the
resolutionrecord component
-
elements
Returns the value of theelementsrecord component.- Returns:
- the value of the
elementsrecord component
-
outliner
Returns the value of theoutlinerrecord component.- Returns:
- the value of the
outlinerrecord component
-
textures
Returns the value of thetexturesrecord component.- Returns:
- the value of the
texturesrecord component
-