Record Class IAnimatedBlockRecoveryData.AnimatedBlockRecoveryData
java.lang.Object
java.lang.Record
nl.pim16aap2.animatedarchitecture.spigot.core.animation.recovery.IAnimatedBlockRecoveryData.AnimatedBlockRecoveryData
- Record Components:
world- The world the block exists in.position- The position of the block.data- The recovery data.
- All Implemented Interfaces:
IAnimatedBlockRecoveryData
- Enclosing interface:
IAnimatedBlockRecoveryData
public static record IAnimatedBlockRecoveryData.AnimatedBlockRecoveryData(org.bukkit.World world, Vector3Di position, org.bukkit.block.data.BlockData data)
extends Record
implements IAnimatedBlockRecoveryData
Represents an object that stores recovery data for an animated block.
The recovery data consists of the world, position, and block data of the block that needs to be recovered.
The recovery action is performed by placing the block data at the specified position in the specified world.
-
Nested Class Summary
Nested classes/interfaces inherited from interface nl.pim16aap2.animatedarchitecture.spigot.core.animation.recovery.IAnimatedBlockRecoveryData
IAnimatedBlockRecoveryData.AnimatedBlockRecoveryData, IAnimatedBlockRecoveryData.EmptyRecoveryData -
Field Summary
Fields inherited from interface nl.pim16aap2.animatedarchitecture.spigot.core.animation.recovery.IAnimatedBlockRecoveryData
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionAnimatedBlockRecoveryData(org.bukkit.World world, Vector3Di position, org.bukkit.block.data.BlockData data) Creates an instance of aAnimatedBlockRecoveryDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.block.data.BlockDatadata()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.position()Returns the value of thepositionrecord component.booleanrecover()Attempts recovery of the animated block display.final StringtoString()Returns a string representation of this record class.org.bukkit.Worldworld()Returns the value of theworldrecord component.
-
Constructor Details
-
AnimatedBlockRecoveryData
public AnimatedBlockRecoveryData(org.bukkit.World world, Vector3Di position, org.bukkit.block.data.BlockData data) Creates an instance of aAnimatedBlockRecoveryDatarecord class.
-
-
Method Details
-
recover
public boolean recover()Description copied from interface:IAnimatedBlockRecoveryDataAttempts recovery of the animated block display.This method gives the animated block the opportunity to recover from a crash or other unexpected event.
No guarantees are made about the exact behavior of this method, but as long as any kind of recovery action is performed, this method should return true. Only when this method is a no-op should it return false.
- Specified by:
recoverin interfaceIAnimatedBlockRecoveryData- Returns:
- True if a recovery action was performed, false otherwise.
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
world
public org.bukkit.World world()Returns the value of theworldrecord component.- Returns:
- the value of the
worldrecord component
-
position
Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-
data
public org.bukkit.block.data.BlockData data()Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-