Package tschipp.carryon.common.scripting
Record Class CarryOnScript.ScriptObject
java.lang.Object
java.lang.Record
tschipp.carryon.common.scripting.CarryOnScript.ScriptObject
- Enclosing class:
- CarryOnScript
public static record CarryOnScript.ScriptObject(CarryOnScript.ScriptObject.ScriptObjectBlock block, CarryOnScript.ScriptObject.ScriptObjectEntity entity)
extends Record
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<CarryOnScript.ScriptObject> -
Constructor Summary
ConstructorsConstructorDescriptionScriptObject(CarryOnScript.ScriptObject.ScriptObjectBlock block, CarryOnScript.ScriptObject.ScriptObjectEntity entity) Creates an instance of aScriptObjectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionblock()Returns the value of theblockrecord component.entity()Returns the value of theentityrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
ScriptObject
public ScriptObject(CarryOnScript.ScriptObject.ScriptObjectBlock block, CarryOnScript.ScriptObject.ScriptObjectEntity entity) Creates an instance of aScriptObjectrecord class.- Parameters:
block- the value for theblockrecord componententity- the value for theentityrecord component
-
-
Method Details
-
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). -
block
Returns the value of theblockrecord component.- Returns:
- the value of the
blockrecord component
-
entity
Returns the value of theentityrecord component.- Returns:
- the value of the
entityrecord component
-