java.lang.Object
java.lang.Record
nl.pim16aap2.animatedarchitecture.spigot.util.implementations.WorldSpigot
All Implemented Interfaces:
IWorld

public record WorldSpigot(String worldName, @Nullable org.bukkit.World world) extends Record implements IWorld
Represents an implementation of IWorld for the Spigot platform.
  • Constructor Details

    • WorldSpigot

      public WorldSpigot(String worldName)
    • WorldSpigot

      public WorldSpigot(org.bukkit.World world)
    • WorldSpigot

      public WorldSpigot(String worldName, @Nullable @Nullable org.bukkit.World world)
      Creates an instance of a WorldSpigot record class.
      Parameters:
      worldName - the value for the worldName record component
      world - the value for the world record component
  • Method Details

    • exists

      public boolean exists()
      Description copied from interface: IWorld
      Checks if this is a valid world in the current IAnimatedArchitecturePlatform.
      Specified by:
      exists in interface IWorld
      Returns:
      True if this is a valid world in the current IAnimatedArchitecturePlatform.
    • getBukkitWorld

      @Nullable public @Nullable org.bukkit.World getBukkitWorld()
      Gets the bukkit world represented by this IWorld
      Returns:
      The Bukkit world.
    • getTime

      public WorldTime getTime()
      Description copied from interface: IWorld
      Gets the time in this world.
      Specified by:
      getTime in interface IWorld
      Returns:
      Gets the time in this world.
    • 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.
    • worldName

      public String worldName()
      Returns the value of the worldName record component.
      Specified by:
      worldName in interface IWorld
      Returns:
      the value of the worldName record component
    • world

      @Nullable public @Nullable org.bukkit.World world()
      Returns the value of the world record component.
      Returns:
      the value of the world record component