From 6903a705cd2225af743062335d390434debda502 Mon Sep 17 00:00:00 2001 From: William278 Date: Wed, 22 Mar 2023 15:14:46 +0000 Subject: [PATCH] Fix wrong blue map icon path, missing public homes set --- .../java/net/william278/huskhomes/hook/BlueMapHook.java | 8 ++++---- .../main/java/net/william278/huskhomes/hook/MapHook.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/net/william278/huskhomes/hook/BlueMapHook.java b/common/src/main/java/net/william278/huskhomes/hook/BlueMapHook.java index b8062a17..9a8b39d4 100644 --- a/common/src/main/java/net/william278/huskhomes/hook/BlueMapHook.java +++ b/common/src/main/java/net/william278/huskhomes/hook/BlueMapHook.java @@ -48,8 +48,8 @@ public class BlueMapHook extends MapHook { final MarkerSet warpsMarkers = MarkerSet.builder().label(getWarpsMarkerSetName()).build(); for (BlueMapMap map : mapWorld.getMaps()) { - map.getMarkerSets().put(plugin.getKey(map.getId()).toString(), publicHomeMarkers); - map.getMarkerSets().put(plugin.getKey(map.getId()).toString(), warpsMarkers); + map.getMarkerSets().put(getPublicHomesKey(), publicHomeMarkers); + map.getMarkerSets().put(getWarpsKey(), warpsMarkers); } publicHomesMarkerSets.put(world.getName(), publicHomeMarkers); @@ -135,7 +135,7 @@ public class BlueMapHook extends MapHook { @Nullable private String getIcon(@NotNull String iconName) { return BlueMapAPI.getInstance().map(api -> { - final Path icons = api.getWebApp().getWebRoot().resolve("icons"); + final Path icons = api.getWebApp().getWebRoot().resolve("icons").resolve("huskhomes"); if (!icons.toFile().exists() && !icons.toFile().mkdirs()) { plugin.log(Level.WARNING, "Failed to create BlueMap icons directory"); } @@ -153,7 +153,7 @@ public class BlueMapHook extends MapHook { } } - return icons.resolve(iconFile.toPath()).toAbsolutePath().toString(); + return "icons/huskhomes/" + iconFileName; }).orElse(null); } diff --git a/common/src/main/java/net/william278/huskhomes/hook/MapHook.java b/common/src/main/java/net/william278/huskhomes/hook/MapHook.java index 3cb34e22..382a5ed7 100644 --- a/common/src/main/java/net/william278/huskhomes/hook/MapHook.java +++ b/common/src/main/java/net/william278/huskhomes/hook/MapHook.java @@ -95,12 +95,12 @@ public abstract class MapHook extends Hook { @NotNull protected final String getPublicHomesKey() { - return plugin.getKey(getName().toLowerCase(), "public_homes", "markers").toString(); + return plugin.getKey(getName().toLowerCase(), "public_home_markers").toString(); } @NotNull protected final String getWarpsKey() { - return plugin.getKey(getName().toLowerCase(), "warps", "markers").toString(); + return plugin.getKey(getName().toLowerCase(), "warp_markers").toString(); } @NotNull