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.

  • Constructor Details

    • AnimatedBlockRecoveryData

      public AnimatedBlockRecoveryData(org.bukkit.World world, Vector3Di position, org.bukkit.block.data.BlockData data)
      Creates an instance of a AnimatedBlockRecoveryData record class.
      Parameters:
      world - the value for the world record component
      position - the value for the position record component
      data - the value for the data record component
  • Method Details

    • recover

      public boolean recover()
      Description copied from interface: IAnimatedBlockRecoveryData
      Attempts 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:
      recover in interface IAnimatedBlockRecoveryData
      Returns:
      True if a recovery action was performed, false otherwise.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • world

      public org.bukkit.World world()
      Returns the value of the world record component.
      Returns:
      the value of the world record component
    • position

      public Vector3Di position()
      Returns the value of the position record component.
      Returns:
      the value of the position record component
    • data

      public org.bukkit.block.data.BlockData data()
      Returns the value of the data record component.
      Returns:
      the value of the data record component