Record Class MachineInteractions.Click
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.paper.MachineInteractions.Click
- Enclosing class:
MachineInteractions
public static record MachineInteractions.Click(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.inventory.ItemStack item, @NotNull MachineInstance machine, @NotNull org.bukkit.block.Block block, @Nullable org.bukkit.block.BlockFace face, boolean sneaking)
extends Record
A click on a machine's block with the main hand.
-
Constructor Summary
ConstructorsConstructorDescriptionClick(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.inventory.ItemStack item, @NotNull MachineInstance machine, @NotNull org.bukkit.block.Block block, @Nullable org.bukkit.block.BlockFace face, boolean sneaking) Creates an instance of aClickrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull 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.@NotNull MachineInstancemachine()Returns the value of themachinerecord component.@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
-
Click
public Click(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull MachineInstance machine, @NotNull @NotNull org.bukkit.block.Block block, @Nullable @Nullable org.bukkit.block.BlockFace face, boolean sneaking) Creates an instance of aClickrecord class.- Parameters:
player- the value for theplayerrecord componentitem- the value for theitemrecord componentmachine- the value for themachinerecord componentblock- the value for theblockrecord componentface- the value for thefacerecord componentsneaking- the value for thesneakingrecord component
-
-
Method Details
-
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
@NotNull public @NotNull org.bukkit.entity.Player player()Returns the value of theplayerrecord component.- Returns:
- the value of the
playerrecord component
-
item
@NotNull public @NotNull org.bukkit.inventory.ItemStack item()Returns the value of theitemrecord component.- Returns:
- the value of the
itemrecord component
-
machine
Returns the value of themachinerecord component.- Returns:
- the value of the
machinerecord component
-
block
@NotNull public @NotNull org.bukkit.block.Block block()Returns the value of theblockrecord component.- Returns:
- the value of the
blockrecord component
-
face
@Nullable public @Nullable org.bukkit.block.BlockFace face()Returns the value of thefacerecord component.- Returns:
- the value of the
facerecord component
-
sneaking
public boolean sneaking()Returns the value of thesneakingrecord component.- Returns:
- the value of the
sneakingrecord component
-