Class HoneypotBlockObject
java.lang.Object
org.reprogle.honeypot.common.storageproviders.HoneypotBlockObject
- All Implemented Interfaces:
org.bukkit.persistence.PersistentDataType<String,HoneypotBlockObject>
public class HoneypotBlockObject
extends Object
implements org.bukkit.persistence.PersistentDataType<String,HoneypotBlockObject>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bukkit.persistence.PersistentDataType
org.bukkit.persistence.PersistentDataType.BooleanPersistentDataType, org.bukkit.persistence.PersistentDataType.PrimitivePersistentDataType<P> -
Field Summary
Fields inherited from interface org.bukkit.persistence.PersistentDataType
BOOLEAN, BYTE, BYTE_ARRAY, DOUBLE, FLOAT, INTEGER, INTEGER_ARRAY, LIST, LONG, LONG_ARRAY, SHORT, STRING, TAG_CONTAINER, TAG_CONTAINER_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionHoneypotBlockObject(String worldName, int x, int y, int z, String action) Used for Database, create a Honeypot based off of individual coordinates and not one big stringHoneypotBlockObject(String worldName, String coordinates, String action) Used for GUI, create a Honeypot based off of strings and not Block objectsHoneypotBlockObject(org.bukkit.block.Block block, String action) Create a HoneypotBlockObject -
Method Summary
Modifier and TypeMethodDescriptionboolean@NotNull HoneypotBlockObjectfromPrimitive(String primitive, @NotNull org.bukkit.persistence.PersistentDataAdapterContext context) Get the action of the Honeypotorg.bukkit.block.BlockgetBlock()Get the Block object of the Honeypot@NotNull Class<HoneypotBlockObject> Get the String formatted coordinates of the Honeypotorg.bukkit.LocationGet the Location object of the HoneypotgetWorld()Get the world of the HoneypotinthashCode()@NotNull StringtoPrimitive(@NotNull HoneypotBlockObject complex, @NotNull org.bukkit.persistence.PersistentDataAdapterContext context) toString()
-
Constructor Details
-
HoneypotBlockObject
Create a HoneypotBlockObject- Parameters:
block- The Block object of the Honeypotaction- The action of the Honeypot
-
HoneypotBlockObject
Used for GUI, create a Honeypot based off of strings and not Block objects- Parameters:
worldName- The world the block is incoordinates- The coordinates of the blockaction- The action of the Honeypot
-
HoneypotBlockObject
Used for Database, create a Honeypot based off of individual coordinates and not one big string- Parameters:
worldName- The world the block is inx- The x coordinate of the blocky- The y coordinate of the blockz- The z coordinate of the blockaction- The action of the Honeypot
-
-
Method Details
-
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
Get the action of the Honeypot- Returns:
- action
-
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
-
hashCode
public int hashCode() -
getPrimitiveType
- Specified by:
getPrimitiveTypein interfaceorg.bukkit.persistence.PersistentDataType<String,HoneypotBlockObject>
-
getComplexType
- Specified by:
getComplexTypein interfaceorg.bukkit.persistence.PersistentDataType<String,HoneypotBlockObject>
-
toPrimitive
@NotNull public @NotNull String toPrimitive(@NotNull @NotNull HoneypotBlockObject complex, @NotNull @NotNull org.bukkit.persistence.PersistentDataAdapterContext context) - Specified by:
toPrimitivein interfaceorg.bukkit.persistence.PersistentDataType<String,HoneypotBlockObject>
-
fromPrimitive
@NotNull public @NotNull HoneypotBlockObject fromPrimitive(String primitive, @NotNull @NotNull org.bukkit.persistence.PersistentDataAdapterContext context) - Specified by:
fromPrimitivein interfaceorg.bukkit.persistence.PersistentDataType<String,HoneypotBlockObject>
-
toString
-