Record Class PaperItemBehavior.Use
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.paper.PaperItemBehavior.Use
- Record Components:
player- who clickeditem- the item in the main hand (the live stack: changing it changes the player's item)block- the block clicked,nullin the airface- the face clicked,nullin the airsneaking- whether the player sneaks
- Enclosing class:
PaperItemBehavior
public static record PaperItemBehavior.Use(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.inventory.ItemStack item, @Nullable org.bukkit.block.Block block, @Nullable org.bukkit.block.BlockFace face, boolean sneaking)
extends Record
A right-click with the item.
-
Constructor Summary
ConstructorsConstructorDescriptionUse(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.inventory.ItemStack item, @Nullable org.bukkit.block.Block block, @Nullable org.bukkit.block.BlockFace face, boolean sneaking) Creates an instance of aUserecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable org.bukkit.block.Blockblock()Returns the value of theblockrecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable org.bukkit.block.BlockFaceface()Returns the value of thefacerecord component.final inthashCode()Returns a hash code value for this object.@NotNull org.bukkit.inventory.ItemStackitem()Returns the value of theitemrecord component.booleanonBlock()@NotNull org.bukkit.entity.Playerplayer()Returns the value of theplayerrecord component.booleansneaking()Returns the value of thesneakingrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Use
public Use(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.inventory.ItemStack item, @Nullable @Nullable org.bukkit.block.Block block, @Nullable @Nullable org.bukkit.block.BlockFace face, boolean sneaking) Creates an instance of aUserecord class.
-
-
Method Details
-
onBlock
public boolean onBlock() -
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. -
player
-
item
-
block
-
face
-
sneaking
-