From dd91508c104e93d0ff6735d9e99d0122c82fd21c Mon Sep 17 00:00:00 2001 From: Mysticdrew Date: Mon, 24 Jun 2024 11:30:27 -0500 Subject: [PATCH] added customdata methods to Waypoint and WaypointGroups --- .../api/v2/common/waypoint/Waypoint.java | 15 +++++++++++++++ .../api/v2/common/waypoint/WaypointGroup.java | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/common/src/main/java/journeymap/api/v2/common/waypoint/Waypoint.java b/common/src/main/java/journeymap/api/v2/common/waypoint/Waypoint.java index 9ef91bcfb..372f49a85 100644 --- a/common/src/main/java/journeymap/api/v2/common/waypoint/Waypoint.java +++ b/common/src/main/java/journeymap/api/v2/common/waypoint/Waypoint.java @@ -4,6 +4,7 @@ import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.Level; +import org.jetbrains.annotations.Nullable; import java.util.Collection; import java.util.TreeSet; @@ -209,4 +210,18 @@ default void setIconTextureSize(int width, int height) setIconTextureWidth(width); setIconTextureHeight(height); } + + /** + * Allows add-on devs to set custom data on their waypoints for use, this is not used by journeymap. + * + * @param data - String + */ + void setCustomData(@Nullable String data); + + /** + * Gets the custom data stored on a waypoint + * @return + */ + @Nullable + String getCustomData(); } diff --git a/common/src/main/java/journeymap/api/v2/common/waypoint/WaypointGroup.java b/common/src/main/java/journeymap/api/v2/common/waypoint/WaypointGroup.java index 679c1c770..a0f25ee81 100644 --- a/common/src/main/java/journeymap/api/v2/common/waypoint/WaypointGroup.java +++ b/common/src/main/java/journeymap/api/v2/common/waypoint/WaypointGroup.java @@ -1,6 +1,7 @@ package journeymap.api.v2.common.waypoint; import net.minecraft.resources.ResourceLocation; +import org.jetbrains.annotations.Nullable; import java.util.List; @@ -173,4 +174,18 @@ default void setIconTextureSize(int width, int height) setIconTextureWidth(width); setIconTextureHeight(height); } + + /** + * Allows add-on devs to set custom data on their waypoint groups for use, this is not used by journeymap. + * + * @param data - String + */ + void setCustomData(@Nullable String data); + + /** + * Gets the custom data stored on a waypoint group + * @return + */ + @Nullable + String getCustomData(); }