From ec51983b415609e50d786fab582a8c7bb60b5be5 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Wed, 1 Jul 2020 10:48:29 +1000 Subject: [PATCH] SPIGOT-5908: CompassMeta for new lodestone compass data By: md_5 --- .../bukkit/inventory/meta/CompassMeta.java | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 paper-api/src/main/java/org/bukkit/inventory/meta/CompassMeta.java diff --git a/paper-api/src/main/java/org/bukkit/inventory/meta/CompassMeta.java b/paper-api/src/main/java/org/bukkit/inventory/meta/CompassMeta.java new file mode 100644 index 0000000000..5040ab6190 --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/inventory/meta/CompassMeta.java @@ -0,0 +1,57 @@ +package org.bukkit.inventory.meta; + +import org.bukkit.Location; +import org.jetbrains.annotations.Nullable; + +/** + * Represents a compass that can track a specific location. + */ +public interface CompassMeta extends ItemMeta { + + /** + * Checks if this compass has been paired to a lodestone. + * + * @return paired status + */ + boolean hasLodestone(); + + /** + * Gets the location that this compass will point to. + * + * Check {@link #hasLodestone()} first! + * + * @return lodestone location + */ + @Nullable + Location getLodestone(); + + /** + * Sets the location this lodestone compass will point to. + * + * @param lodestone new location or null to clear + */ + void setLodestone(@Nullable Location lodestone); + + /** + * Gets if this compass is tracking a specific lodestone. + * + * If true the compass will only work if there is a lodestone at the tracked + * location. + * + * @return lodestone tracked + */ + boolean isLodestoneTracked(); + + /** + * Sets if this compass is tracking a specific lodestone. + * + * If true the compass will only work if there is a lodestone at the tracked + * location. + * + * @param tracked new tracked status + */ + void setLodestoneTracked(boolean tracked); + + @Override + CompassMeta clone(); +}