Record Class MovementItemComponent
java.lang.Object
java.lang.Record
petrolpark.mc.petrolsparts.content.kinetics.movement.MovementItemComponent
- All Implemented Interfaces:
net.minecraft.world.item.component.TooltipProvider
public record MovementItemComponent(net.minecraft.world.item.ItemStack weightStack, float storedRotations)
extends Record
implements net.minecraft.world.item.component.TooltipProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<MovementItemComponent> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, MovementItemComponent> -
Constructor Summary
ConstructorsConstructorDescriptionMovementItemComponent(net.minecraft.world.item.ItemStack weightStack, float storedRotations) Creates an instance of aMovementItemComponentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToTooltip(net.minecraft.world.item.Item.TooltipContext context, Consumer<net.minecraft.network.chat.Component> tooltipAdder, net.minecraft.world.item.TooltipFlag tooltipFlag) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static final voidonAddToTooltip(net.neoforged.neoforge.event.entity.player.ItemTooltipEvent event) floatReturns the value of thestoredRotationsrecord component.final StringtoString()Returns a string representation of this record class.net.minecraft.world.item.ItemStackReturns the value of theweightStackrecord component.
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,MovementItemComponent> STREAM_CODEC
-
-
Constructor Details
-
MovementItemComponent
public MovementItemComponent(net.minecraft.world.item.ItemStack weightStack, float storedRotations) Creates an instance of aMovementItemComponentrecord class.- Parameters:
weightStack- the value for theweightStackrecord componentstoredRotations- the value for thestoredRotationsrecord component
-
-
Method Details
-
addToTooltip
public void addToTooltip(net.minecraft.world.item.Item.TooltipContext context, Consumer<net.minecraft.network.chat.Component> tooltipAdder, net.minecraft.world.item.TooltipFlag tooltipFlag) - Specified by:
addToTooltipin interfacenet.minecraft.world.item.component.TooltipProvider
-
onAddToTooltip
public static final void onAddToTooltip(net.neoforged.neoforge.event.entity.player.ItemTooltipEvent event) -
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 '=='. -
weightStack
public net.minecraft.world.item.ItemStack weightStack()Returns the value of theweightStackrecord component.- Returns:
- the value of the
weightStackrecord component
-
storedRotations
public float storedRotations()Returns the value of thestoredRotationsrecord component.- Returns:
- the value of the
storedRotationsrecord component
-