Record Class DioBlockStateVariant
java.lang.Object
java.lang.Record
fr.alasdiablo.diolib.api.data.blockstate.DioBlockStateVariant
public record DioBlockStateVariant(String key, String model, int x, int y, boolean uvlock)
extends Record
Class used to create single block-state variant
-
Constructor Summary
ConstructorsConstructorDescriptionDioBlockStateVariant(String key, String model, int x, int y, boolean uvlock) Creates an instance of aDioBlockStateVariantrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull com.google.gson.JsonObjectjson()Create the json of the blockstate variantkey()Returns the value of thekeyrecord component.model()Returns the value of themodelrecord component.static @NotNull DioBlockStateVariantStatic factory of BlockStateVariantfinal StringtoString()Returns a string representation of this record class.booleanuvlock()Returns the value of theuvlockrecord component.intx()Returns the value of thexrecord component.inty()Returns the value of theyrecord component.
-
Constructor Details
-
DioBlockStateVariant
Creates an instance of aDioBlockStateVariantrecord class.- Parameters:
key- the value for thekeyrecord componentmodel- the value for themodelrecord componentx- the value for thexrecord componenty- the value for theyrecord componentuvlock- the value for theuvlockrecord component
-
-
Method Details
-
of
@Contract("_, _, _, _, _ -> new") @NotNull public static @NotNull DioBlockStateVariant of(String key, String model, int x, int y, boolean uvlock) Static factory of BlockStateVariant- Parameters:
key- Name of the statemodel- Model use by the statex- Rotation on x of the statey- Rotation on y of the stateuvlock- UVLock of the state- Returns:
- Instance of a BlockStateVariant
-
json
@NotNull public @NotNull com.google.gson.JsonObject json()Create the json of the blockstate variant- Returns:
- Json representation of a blockstate variant
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
model
Returns the value of themodelrecord component.- Returns:
- the value of the
modelrecord component
-
x
public int x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public int y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
uvlock
public boolean uvlock()Returns the value of theuvlockrecord component.- Returns:
- the value of the
uvlockrecord component
-