Record Class BlueprintImage
java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.blueprint.BlueprintImage
- Record Components:
name- the name of the image file (including extension)image- the binary content of the imagemcmeta- the JSON object for the .mcmeta file, if any
public record BlueprintImage(@NotNull String name, byte[] image, @Nullable com.google.gson.JsonObject mcmeta)
extends Record
Represents an image file to be generated as part of the resource pack.
This record holds the image's name, its binary content, and an optional .mcmeta file for animations.
- Since:
- 1.15.2
-
Constructor Summary
ConstructorsConstructorDescriptionBlueprintImage(@NotNull String name, byte[] image, @Nullable com.google.gson.JsonObject mcmeta) Creates an instance of aBlueprintImagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.longReturns the estimated size of the image in bytes.final inthashCode()Returns a hash code value for this object.byte[]image()Returns the value of theimagerecord component.@Nullable com.google.gson.JsonObjectmcmeta()Returns the value of themcmetarecord component.@NotNull StringReturns the name of the metadata file associated with the png.@NotNull Stringname()Returns the value of thenamerecord component.@NotNull StringpngName()Returns the name of the image file with a .png extension.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
BlueprintImage
public BlueprintImage(@NotNull @NotNull String name, byte[] image, @Nullable @Nullable com.google.gson.JsonObject mcmeta) Creates an instance of aBlueprintImagerecord class.
-
-
Method Details
-
estimatedSize
public long estimatedSize()Returns the estimated size of the image in bytes.- Returns:
- the image size
- Since:
- 1.15.2
-
pngName
Returns the name of the image file with a .png extension.- Returns:
- the png file name
- Since:
- 2.0.1
-
mcmetaName
Returns the name of the metadata file associated with the png.- Returns:
- the mcmeta file name
- Since:
- 2.0.1
-
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
image
public byte[] image()Returns the value of theimagerecord component.- Returns:
- the value of the
imagerecord component
-
mcmeta
@Nullable public @Nullable com.google.gson.JsonObject mcmeta()Returns the value of themcmetarecord component.- Returns:
- the value of the
mcmetarecord component
-