Record Class BlockPlacementRule.PlacementState
java.lang.Object
java.lang.Record
net.minestom.server.instance.block.rule.BlockPlacementRule.PlacementState
- Enclosing class:
BlockPlacementRule
-
Constructor Summary
ConstructorDescriptionPlacementState
(Block.Getter instance, @NotNull Block block, @Nullable BlockFace blockFace, @NotNull Point placePosition, @Nullable Point cursorPosition, @Nullable Pos playerPosition, @Nullable ItemMeta usedItemMeta, boolean isPlayerShifting) Creates an instance of aPlacementState
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull Block
block()
Returns the value of theblock
record component.@Nullable BlockFace
Returns the value of theblockFace
record component.@Nullable Point
Returns the value of thecursorPosition
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.instance()
Returns the value of theinstance
record component.boolean
Returns the value of theisPlayerShifting
record component.@NotNull Point
Returns the value of theplacePosition
record component.@Nullable Pos
Returns the value of theplayerPosition
record component.final String
toString()
Returns a string representation of this record class.@Nullable ItemMeta
Returns the value of theusedItemMeta
record component.
-
Constructor Details
-
PlacementState
public PlacementState(@NotNull Block.Getter instance, @NotNull @NotNull Block block, @Nullable @Nullable BlockFace blockFace, @NotNull @NotNull Point placePosition, @Nullable @Nullable Point cursorPosition, @Nullable @Nullable Pos playerPosition, @Nullable @Nullable ItemMeta usedItemMeta, boolean isPlayerShifting) Creates an instance of aPlacementState
record class.- Parameters:
instance
- the value for theinstance
record componentblock
- the value for theblock
record componentblockFace
- the value for theblockFace
record componentplacePosition
- the value for theplacePosition
record componentcursorPosition
- the value for thecursorPosition
record componentplayerPosition
- the value for theplayerPosition
record componentusedItemMeta
- the value for theusedItemMeta
record componentisPlayerShifting
- the value for theisPlayerShifting
record component
-
-
Method Details
-
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 '=='. -
instance
Returns the value of theinstance
record component.- Returns:
- the value of the
instance
record component
-
block
Returns the value of theblock
record component.- Returns:
- the value of the
block
record component
-
blockFace
Returns the value of theblockFace
record component.- Returns:
- the value of the
blockFace
record component
-
placePosition
Returns the value of theplacePosition
record component.- Returns:
- the value of the
placePosition
record component
-
cursorPosition
Returns the value of thecursorPosition
record component.- Returns:
- the value of the
cursorPosition
record component
-
playerPosition
Returns the value of theplayerPosition
record component.- Returns:
- the value of the
playerPosition
record component
-
usedItemMeta
Returns the value of theusedItemMeta
record component.- Returns:
- the value of the
usedItemMeta
record component
-
isPlayerShifting
public boolean isPlayerShifting()Returns the value of theisPlayerShifting
record component.- Returns:
- the value of the
isPlayerShifting
record component
-