Package tschipp.carryon.common.scripting
Record Class CarryOnScript.ScriptObject.ScriptObjectBlock
java.lang.Object
java.lang.Record
tschipp.carryon.common.scripting.CarryOnScript.ScriptObject.ScriptObjectBlock
- Enclosing class:
CarryOnScript.ScriptObject
public static record CarryOnScript.ScriptObject.ScriptObjectBlock(Optional<net.minecraft.resources.ResourceKey<net.minecraft.world.level.block.Block>> typeNameBlock, Matchables.NumberBoundCondition typeHardness, Matchables.NumberBoundCondition typeResistance, Matchables.NBTCondition typeBlockTag)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<CarryOnScript.ScriptObject.ScriptObjectBlock> static final CarryOnScript.ScriptObject.ScriptObjectBlock -
Constructor Summary
ConstructorsConstructorDescriptionScriptObjectBlock(Optional<net.minecraft.resources.ResourceKey<net.minecraft.world.level.block.Block>> typeNameBlock, Matchables.NumberBoundCondition typeHardness, Matchables.NumberBoundCondition typeResistance, Matchables.NBTCondition typeBlockTag) Creates an instance of aScriptObjectBlockrecord 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.final StringtoString()Returns a string representation of this record class.Returns the value of thetypeBlockTagrecord component.Returns the value of thetypeHardnessrecord component.Optional<net.minecraft.resources.ResourceKey<net.minecraft.world.level.block.Block>> Returns the value of thetypeNameBlockrecord component.Returns the value of thetypeResistancerecord component.
-
Field Details
-
EMPTY
-
CODEC
public static final com.mojang.serialization.Codec<CarryOnScript.ScriptObject.ScriptObjectBlock> CODEC
-
-
Constructor Details
-
ScriptObjectBlock
public ScriptObjectBlock(Optional<net.minecraft.resources.ResourceKey<net.minecraft.world.level.block.Block>> typeNameBlock, Matchables.NumberBoundCondition typeHardness, Matchables.NumberBoundCondition typeResistance, Matchables.NBTCondition typeBlockTag) Creates an instance of aScriptObjectBlockrecord class.- Parameters:
typeNameBlock- the value for thetypeNameBlockrecord componenttypeHardness- the value for thetypeHardnessrecord componenttypeResistance- the value for thetypeResistancerecord componenttypeBlockTag- the value for thetypeBlockTagrecord 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). -
typeNameBlock
public Optional<net.minecraft.resources.ResourceKey<net.minecraft.world.level.block.Block>> typeNameBlock()Returns the value of thetypeNameBlockrecord component.- Returns:
- the value of the
typeNameBlockrecord component
-
typeHardness
Returns the value of thetypeHardnessrecord component.- Returns:
- the value of the
typeHardnessrecord component
-
typeResistance
Returns the value of thetypeResistancerecord component.- Returns:
- the value of the
typeResistancerecord component
-
typeBlockTag
Returns the value of thetypeBlockTagrecord component.- Returns:
- the value of the
typeBlockTagrecord component
-