Record Class PhysicalItemUse
java.lang.Object
java.lang.Record
com.viaversion.viafabricplus.bedrock.movement.replay.PhysicalItemUse
public record PhysicalItemUse(boolean active, net.minecraft.world.InteractionHand hand, int remaining, byte flags, net.minecraft.world.item.ItemStack item)
extends Record
Movement observes item use; replay never rewinds the live consumption cycle or its inventory.
-
Constructor Summary
ConstructorsConstructorDescriptionPhysicalItemUse(boolean active, net.minecraft.world.InteractionHand hand, int remaining, byte flags, net.minecraft.world.item.ItemStack item) Creates an instance of aPhysicalItemUserecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanactive()Returns the value of theactiverecord component.final booleanIndicates whether some other object is "equal to" this one.byteflags()Returns the value of theflagsrecord component.net.minecraft.world.InteractionHandhand()Returns the value of thehandrecord component.final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.ItemStackitem()Returns the value of theitemrecord component.intReturns the value of theremainingrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PhysicalItemUse
public PhysicalItemUse(boolean active, net.minecraft.world.InteractionHand hand, int remaining, byte flags, net.minecraft.world.item.ItemStack item) Creates an instance of aPhysicalItemUserecord class.- Parameters:
active- the value for theactiverecord componenthand- the value for thehandrecord componentremaining- the value for theremainingrecord componentflags- the value for theflagsrecord componentitem- the value for theitemrecord component
-
-
Method Details
-
item
public net.minecraft.world.item.ItemStack item()Returns the value of theitemrecord component.- Returns:
- the value of the
itemrecord component
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
active
public boolean active()Returns the value of theactiverecord component.- Returns:
- the value of the
activerecord component
-
hand
public net.minecraft.world.InteractionHand hand()Returns the value of thehandrecord component.- Returns:
- the value of the
handrecord component
-
remaining
public int remaining()Returns the value of theremainingrecord component.- Returns:
- the value of the
remainingrecord component
-
flags
public byte flags()Returns the value of theflagsrecord component.- Returns:
- the value of the
flagsrecord component
-