Class HoneypotBlockObject

java.lang.Object
org.reprogle.honeypot.common.storagemanager.HoneypotBlockObject
All Implemented Interfaces:
org.bukkit.persistence.PersistentDataType<String,HoneypotBlockObject>

public class HoneypotBlockObject extends Object implements org.bukkit.persistence.PersistentDataType<String,HoneypotBlockObject>
  • Constructor Details

    • HoneypotBlockObject

      public HoneypotBlockObject(org.bukkit.block.Block block, String action)
      Create a HoneypotBlockObject
      Parameters:
      block - The Block object of the Honeypot
      action - The action of the Honeypot
    • HoneypotBlockObject

      public HoneypotBlockObject(String worldName, String coordinates, String action)
      Used for GUI, create a Honeypot based off of strings and not Block objects
      Parameters:
      worldName - The world the block is in
      coordinates - The coordinates of the block
      action - The action of the Honeypot
  • Method Details

    • getCoordinates

      public String getCoordinates()
      Get the String formatted coordinates of the Honeypot
      Returns:
      Coordinates
    • getLocation

      public org.bukkit.Location getLocation()
      Get the Location object of the Honeypot
      Returns:
      Location
    • getAction

      public String getAction()
      Get the action of the Honeypot
      Returns:
      action
    • getWorld

      public String getWorld()
      Get the world of the Honeypot
      Returns:
      world
    • getBlock

      public org.bukkit.block.Block getBlock()
      Get the Block object of the Honeypot
      Returns:
      Honeypot Block object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getPrimitiveType

      @NotNull public Class<String> getPrimitiveType()
      Specified by:
      getPrimitiveType in interface org.bukkit.persistence.PersistentDataType<String,HoneypotBlockObject>
    • getComplexType

      @NotNull public Class<HoneypotBlockObject> getComplexType()
      Specified by:
      getComplexType in interface org.bukkit.persistence.PersistentDataType<String,HoneypotBlockObject>
    • toPrimitive

      public String toPrimitive(@NotNull HoneypotBlockObject complex, @NotNull org.bukkit.persistence.PersistentDataAdapterContext context)
      Specified by:
      toPrimitive in interface org.bukkit.persistence.PersistentDataType<String,HoneypotBlockObject>
    • fromPrimitive

      @NotNull public HoneypotBlockObject fromPrimitive(String primitive, @NotNull org.bukkit.persistence.PersistentDataAdapterContext context)
      Specified by:
      fromPrimitive in interface org.bukkit.persistence.PersistentDataType<String,HoneypotBlockObject>
    • toString

      public String toString()
      Overrides:
      toString in class Object