diff options
author | Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> | 2024-02-04 17:35:52 -0500 |
---|---|---|
committer | Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> | 2024-05-24 19:51:46 -0400 |
commit | f6ba429409ac73ee45992fd80e527c96b39e52e3 (patch) | |
tree | dc09bed30f44a984e972ec0f5b1a42664256bc74 /src/main/java/de/hysky/skyblocker/utils/waypoint | |
parent | d84b0ce5169c1aea99c6e4842665c6e3598e97d8 (diff) | |
download | Skyblocker-f6ba429409ac73ee45992fd80e527c96b39e52e3.tar.gz Skyblocker-f6ba429409ac73ee45992fd80e527c96b39e52e3.tar.bz2 Skyblocker-f6ba429409ac73ee45992fd80e527c96b39e52e3.zip |
Add waypoint deleting
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/utils/waypoint')
-rw-r--r-- | src/main/java/de/hysky/skyblocker/utils/waypoint/WaypointCategory.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/de/hysky/skyblocker/utils/waypoint/WaypointCategory.java b/src/main/java/de/hysky/skyblocker/utils/waypoint/WaypointCategory.java index 16a22796..d31455f6 100644 --- a/src/main/java/de/hysky/skyblocker/utils/waypoint/WaypointCategory.java +++ b/src/main/java/de/hysky/skyblocker/utils/waypoint/WaypointCategory.java @@ -5,6 +5,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; +import java.util.ArrayList; import java.util.List; public record WaypointCategory(String name, String island, List<NamedWaypoint> waypoints) { @@ -14,6 +15,10 @@ public record WaypointCategory(String name, String island, List<NamedWaypoint> w NamedWaypoint.CODEC.listOf().fieldOf("waypoints").forGetter(WaypointCategory::waypoints) ).apply(instance, WaypointCategory::new)); + public WaypointCategory(WaypointCategory waypointCategory) { + this(waypointCategory.name(), waypointCategory.island(), new ArrayList<>(waypointCategory.waypoints())); + } + public static WaypointCategory fromSkytilsJson(JsonObject waypointCategory) { return new WaypointCategory( waypointCategory.get("name").getAsString(), |