Package codechicken.microblock.item
Record Class SawComponent.Rule
java.lang.Object
java.lang.Record
codechicken.microblock.item.SawComponent.Rule
- Enclosing class:
SawComponent
public static record SawComponent.Rule(net.minecraft.core.HolderSet<net.minecraft.world.level.block.Block> blocks, boolean allowCut)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<SawComponent.Rule> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, SawComponent.Rule> -
Constructor Summary
ConstructorsConstructorDescriptionRule(net.minecraft.core.HolderSet<net.minecraft.world.level.block.Block> blocks, boolean allowCut) Creates an instance of aRulerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanallowCut()Returns the value of theallowCutrecord component.static SawComponent.Rulestatic SawComponent.RuleallowsCut(net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> tag) net.minecraft.core.HolderSet<net.minecraft.world.level.block.Block> blocks()Returns the value of theblocksrecord component.static SawComponent.Rulestatic SawComponent.RuledeniesCut(net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> tag) 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
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,SawComponent.Rule> STREAM_CODEC
-
-
Constructor Details
-
Rule
public Rule(net.minecraft.core.HolderSet<net.minecraft.world.level.block.Block> blocks, boolean allowCut) Creates an instance of aRulerecord class.- Parameters:
blocks- the value for theblocksrecord componentallowCut- the value for theallowCutrecord component
-
-
Method Details
-
allowsCut
public static SawComponent.Rule allowsCut(net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> tag) -
allowsCut
-
deniesCut
public static SawComponent.Rule deniesCut(net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> tag) -
deniesCut
-
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 '=='. -
blocks
public net.minecraft.core.HolderSet<net.minecraft.world.level.block.Block> blocks()Returns the value of theblocksrecord component.- Returns:
- the value of the
blocksrecord component
-
allowCut
public boolean allowCut()Returns the value of theallowCutrecord component.- Returns:
- the value of the
allowCutrecord component
-