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 f6e810f5..fbaba21c 100644 --- a/common/src/main/java/net/william278/huskhomes/hook/BlueMapHook.java +++ b/common/src/main/java/net/william278/huskhomes/hook/BlueMapHook.java @@ -36,8 +36,8 @@ public class BlueMapHook extends MapHook { for (World world : plugin.getWorlds()) { getMapWorld(world).ifPresent(mapWorld -> { - final MarkerSet publicHomeMarkers = MarkerSet.builder().label("Public Homes").build(); - final MarkerSet warpsMarkers = MarkerSet.builder().label("Warps").build(); + final MarkerSet publicHomeMarkers = MarkerSet.builder().label(getPublicHomesMarkerSetName()).build(); + final MarkerSet warpsMarkers = MarkerSet.builder().label(getWarpsMarkerSetName()).build(); for (BlueMapMap map : mapWorld.getMaps()) { map.getMarkerSets().put(plugin.getKey(map.getId()).toString(), publicHomeMarkers); diff --git a/common/src/main/java/net/william278/huskhomes/hook/DynmapHook.java b/common/src/main/java/net/william278/huskhomes/hook/DynmapHook.java index 0b7b26c9..4ce741df 100644 --- a/common/src/main/java/net/william278/huskhomes/hook/DynmapHook.java +++ b/common/src/main/java/net/william278/huskhomes/hook/DynmapHook.java @@ -39,23 +39,19 @@ public class DynmapHook extends MapHook { @Override public void apiEnabled(@NotNull DynmapCommonAPI dynmapCommonAPI) { dynmapApi = dynmapCommonAPI; - populateMap(); - } - }); - } - @Override - protected void populateMap() { - getDynmap().ifPresent(api -> { - if (plugin.getSettings().isPublicHomesOnMap()) { - getMarkerIcon(PUBLIC_HOME_MARKER_IMAGE_NAME).orElseThrow(); - api.getMarkerAPI().createMarkerSet(getPublicHomesKey(), - "Public Homes", api.getMarkerAPI().getMarkerIcons(), false); - } - if (plugin.getSettings().isWarpsOnMap()) { - getMarkerIcon(WARP_MARKER_IMAGE_NAME).orElseThrow(); - api.getMarkerAPI().createMarkerSet(getPublicHomesKey(), - "Public Homes", api.getMarkerAPI().getMarkerIcons(), false); + if (plugin.getSettings().isPublicHomesOnMap()) { + getMarkerIcon(PUBLIC_HOME_MARKER_IMAGE_NAME).orElseThrow(); + dynmapApi.getMarkerAPI().createMarkerSet(getPublicHomesKey(), + getPublicHomesMarkerSetName(), dynmapApi.getMarkerAPI().getMarkerIcons(), false); + } + if (plugin.getSettings().isWarpsOnMap()) { + getMarkerIcon(WARP_MARKER_IMAGE_NAME).orElseThrow(); + dynmapApi.getMarkerAPI().createMarkerSet(getWarpsKey(), + getWarpsMarkerSetName(), dynmapApi.getMarkerAPI().getMarkerIcons(), false); + } + + populateMap(); } }); } @@ -150,10 +146,10 @@ public class DynmapHook extends MapHook { return getDynmap().map(api -> { warpsMarkers = api.getMarkerAPI().getMarkerSet(getWarpsKey()); if (warpsMarkers == null) { - warpsMarkers = api.getMarkerAPI().createMarkerSet(getWarpsKey(), "Warps", + warpsMarkers = api.getMarkerAPI().createMarkerSet(getWarpsKey(), getWarpsMarkerSetName(), api.getMarkerAPI().getMarkerIcons(), false); } else { - warpsMarkers.setMarkerSetLabel("Warps"); + warpsMarkers.setMarkerSetLabel(getWarpsMarkerSetName()); } return warpsMarkers; }); @@ -163,10 +159,10 @@ public class DynmapHook extends MapHook { return getDynmap().map(api -> { publicHomesMarkers = api.getMarkerAPI().getMarkerSet(getPublicHomesKey()); if (publicHomesMarkers == null) { - publicHomesMarkers = api.getMarkerAPI().createMarkerSet(getPublicHomesKey(), "Public Homes", + publicHomesMarkers = api.getMarkerAPI().createMarkerSet(getPublicHomesKey(), getPublicHomesMarkerSetName(), api.getMarkerAPI().getMarkerIcons(), false); } else { - publicHomesMarkers.setMarkerSetLabel("Public Homes"); + publicHomesMarkers.setMarkerSetLabel(getPublicHomesMarkerSetName()); } return publicHomesMarkers; }); 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 67ec641c..3cb34e22 100644 --- a/common/src/main/java/net/william278/huskhomes/hook/MapHook.java +++ b/common/src/main/java/net/william278/huskhomes/hook/MapHook.java @@ -7,8 +7,6 @@ import net.william278.huskhomes.position.Warp; import net.william278.huskhomes.user.User; import org.jetbrains.annotations.NotNull; -import java.util.concurrent.CompletableFuture; - /** * A hook for a mapping plugin, such as Dynmap */ @@ -105,6 +103,18 @@ public abstract class MapHook extends Hook { return plugin.getKey(getName().toLowerCase(), "warps", "markers").toString(); } + @NotNull + protected final String getPublicHomesMarkerSetName() { + return plugin.getLocales().getRawLocale("map_hook_public_homes_marker_set_name") + .orElse("Public Homes"); + } + + @NotNull + protected final String getWarpsMarkerSetName() { + return plugin.getLocales().getRawLocale("map_hook_warps_marker_set_name") + .orElse("Warps"); + } + /** * Identifies types of supported Map plugins */ diff --git a/common/src/main/resources/locales/bg-bg.yml b/common/src/main/resources/locales/bg-bg.yml index 7baf9119..80bfed56 100644 --- a/common/src/main/resources/locales/bg-bg.yml +++ b/common/src/main/resources/locales/bg-bg.yml @@ -94,6 +94,8 @@ economy_action_make_home_public: '[ℹ Spent %1% to make your home public.](gray economy_action_random_teleport: '[ℹ Spent %1% to randomly teleport.](gray)' economy_action_back_command: '[ℹ Spent %1% to return to your last position.](gray)' return_by_death_notification: '[Return to where you died?](gray) [[⏪ Teleport…]](#00fb9a show_text=�fb9a&Click to teleport\n&7Return to where you died run_command=/huskhomes:back)' +map_hook_public_homes_marker_set_name: 'Public Homes' +map_hook_warps_marker_set_name: 'Warps' up_to_date: '[HuskHomes](#00fb9a bold) [| You are running the latest version of HuskHomes (v%1%).](#00fb9a)' update_available: '[HuskHomes](#ff7e5e bold) [| A new version of HuskHomes is available: v%1% (running: v%2%).](#ff7e5e)' error_home_name_taken: '[Error:](#ff3300) [You already have a home set with that name.](#ff7e5e)' diff --git a/common/src/main/resources/locales/de-de.yml b/common/src/main/resources/locales/de-de.yml index 875cb6d7..c9780906 100644 --- a/common/src/main/resources/locales/de-de.yml +++ b/common/src/main/resources/locales/de-de.yml @@ -94,6 +94,8 @@ economy_action_make_home_public: '[ℹ %1% für das Setzen deines Homes auf öff economy_action_random_teleport: '[ℹ %1% ausgegeben, um zufällig teleportiert zu werden.](gray)' economy_action_back_command: '[ℹ %1% ausgegeben, um zu deiner letzten Position zurückzukehren.](gray)' return_by_death_notification: '[Dorthin zurückkehren, wo du gestorben bist?](gray) [[⏪ Teleportieren…]](#00fb9a show_text=�fb9a&Klicke, um dich zu teleportieren\n&7Kehre dorthin zurück, wo du gestorben bist run_command=/huskhomes:back)' +map_hook_public_homes_marker_set_name: 'Public Homes' +map_hook_warps_marker_set_name: 'Warps' up_to_date: '[HuskHomes](#00fb9a bold) [| You are running the latest version of HuskHomes (v%1%).](#00fb9a)' update_available: '[HuskHomes](#ff7e5e bold) [| A new version of HuskHomes is available: v%1% (running: v%2%).](#ff7e5e)' error_home_name_taken: '[Fehler:](#ff3300) [Du hast bereits ein Home mit diesem Namen gesetzt.](#ff7e5e)' diff --git a/common/src/main/resources/locales/en-gb.yml b/common/src/main/resources/locales/en-gb.yml index a531859f..b24d600e 100644 --- a/common/src/main/resources/locales/en-gb.yml +++ b/common/src/main/resources/locales/en-gb.yml @@ -94,6 +94,8 @@ economy_action_make_home_public: '[ℹ Spent %1% to make your home public.](gray economy_action_random_teleport: '[ℹ Spent %1% to randomly teleport.](gray)' economy_action_back_command: '[ℹ Spent %1% to return to your last position.](gray)' return_by_death_notification: '[Return to where you died?](gray) [[⏪ Teleport…]](#00fb9a show_text=�fb9a&Click to teleport\n&7Return to where you died run_command=/huskhomes:back)' +map_hook_public_homes_marker_set_name: 'Public Homes' +map_hook_warps_marker_set_name: 'Warps' up_to_date: '[HuskHomes](#00fb9a bold) [| You are running the latest version of HuskHomes (v%1%).](#00fb9a)' update_available: '[HuskHomes](#ff7e5e bold) [| A new version of HuskHomes is available: v%1% (running: v%2%).](#ff7e5e)' error_home_name_taken: '[Error:](#ff3300) [You already have a home set with that name.](#ff7e5e)' diff --git a/common/src/main/resources/locales/es-es.yml b/common/src/main/resources/locales/es-es.yml index c7cb0942..f4c0d66b 100644 --- a/common/src/main/resources/locales/es-es.yml +++ b/common/src/main/resources/locales/es-es.yml @@ -94,6 +94,8 @@ economy_action_make_home_public: '[ℹ Paga %1% Para hacer tu casa pública.](gr economy_action_random_teleport: '[ℹ Paga %1% para teletransportarse aleatoriamente.](gray)' economy_action_back_command: '[ℹ Paga %1% para volver a su última posición.](gray)' return_by_death_notification: '[¿Regresar al lugar donde murió?](gray) [[⏪ Teletransportar…]](#00fb9a show_text=�fb9a&Clic para teletransportarte\n&7Regresa al lugar donde moriste run_command=/huskhomes:back)' +map_hook_public_homes_marker_set_name: 'Public Homes' +map_hook_warps_marker_set_name: 'Warps' up_to_date: '[HuskHomes](#00fb9a bold) [| You are running the latest version of HuskHomes (v%1%).](#00fb9a)' update_available: '[HuskHomes](#ff7e5e bold) [| A new version of HuskHomes is available: v%1% (running: v%2%).](#ff7e5e)' error_home_name_taken: '[Error:](#ff3300) [Ya tienes una casa con ese nombre.](#ff7e5e)' diff --git a/common/src/main/resources/locales/it-it.yml b/common/src/main/resources/locales/it-it.yml index 818abea9..30e95a4c 100644 --- a/common/src/main/resources/locales/it-it.yml +++ b/common/src/main/resources/locales/it-it.yml @@ -94,6 +94,8 @@ economy_action_make_home_public: '[ℹ Hai pagato %1% per impostare la tua home economy_action_random_teleport: '[ℹ Hai pagato %1% per teletrasportarti randomicamente.](gray)' economy_action_back_command: '[ℹ Hai pagato %1% per tornare alla posizione precedente.](gray)' return_by_death_notification: '[Vuoi ritornare dove sei morto?](gray) [[⏪ Teletrasportati…]](#00fb9a show_text=�fb9a&Clicca per teletrasportarti\n&7e tornare dove sei morto run_command=/huskhomes:back)' +map_hook_public_homes_marker_set_name: 'Public Homes' +map_hook_warps_marker_set_name: 'Warps' up_to_date: '[HuskHomes](#00fb9a bold) [| You are running the latest version of HuskHomes (v%1%).](#00fb9a)' update_available: '[HuskHomes](#ff7e5e bold) [| A new version of HuskHomes is available: v%1% (running: v%2%).](#ff7e5e)' error_home_name_taken: '[Errore:](#ff3300) [Hai già una home impostata con quel nome.](#ff7e5e)' diff --git a/common/src/main/resources/locales/pl.yml b/common/src/main/resources/locales/pl.yml index c61f96be..74765ade 100644 --- a/common/src/main/resources/locales/pl.yml +++ b/common/src/main/resources/locales/pl.yml @@ -94,6 +94,8 @@ economy_action_make_home_public: '[ℹ Spent %1% to make your home public.](gray economy_action_random_teleport: '[ℹ Spent %1% to randomly teleport.](gray)' economy_action_back_command: '[ℹ Spent %1% to return to your last position.](gray)' return_by_death_notification: '[Return to where you died?](gray) [[⏪ Teleport…]](#00fb9a show_text=�fb9a&Click to teleport\n&7Return to where you died run_command=/huskhomes:back)' +map_hook_public_homes_marker_set_name: 'Public Homes' +map_hook_warps_marker_set_name: 'Warps' up_to_date: '[HuskHomes](#00fb9a bold) [| You are running the latest version of HuskHomes (v%1%).](#00fb9a)' update_available: '[HuskHomes](#ff7e5e bold) [| A new version of HuskHomes is available: v%1% (running: v%2%).](#ff7e5e)' error_home_name_taken: '[Error:](#ff3300) [You already have a home set with that name.](#ff7e5e)' diff --git a/common/src/main/resources/locales/tr-tr.yml b/common/src/main/resources/locales/tr-tr.yml index 79a9890b..509a880b 100644 --- a/common/src/main/resources/locales/tr-tr.yml +++ b/common/src/main/resources/locales/tr-tr.yml @@ -94,6 +94,8 @@ economy_action_make_home_public: '[ℹ Evinizi herkese açık hale getirmek içi economy_action_random_teleport: '[ℹ Rastgele ışınlanmak için %1% harcadınız.](gray)' economy_action_back_command: '[ℹ Son konumunuza dönmek için %1% harcadınız.](gray)' return_by_death_notification: '[Öldüğün yere dön?](gray) [[⏪ Işınlanma…]](#00fb9a show_text=�fb9a&Işınlanmak için tıklayın\n&7Öldüğün yere dön run_command=/huskhomes:back)' +map_hook_public_homes_marker_set_name: 'Public Homes' +map_hook_warps_marker_set_name: 'Warps' up_to_date: '[HuskHomes](#00fb9a bold) [| You are running the latest version of HuskHomes (v%1%).](#00fb9a)' update_available: '[HuskHomes](#ff7e5e bold) [| A new version of HuskHomes is available: v%1% (running: v%2%).](#ff7e5e)' error_home_name_taken: '[Hata:](#ff3300) [Bu ada sahip bir eviniz zaten var.](#ff7e5e)' diff --git a/common/src/main/resources/locales/uk-ua.yml b/common/src/main/resources/locales/uk-ua.yml index 3e3d41ae..79fcfb91 100644 --- a/common/src/main/resources/locales/uk-ua.yml +++ b/common/src/main/resources/locales/uk-ua.yml @@ -94,6 +94,8 @@ economy_action_make_home_public: '[ℹ Spent %1% to make your home public.](gray economy_action_random_teleport: '[ℹ Spent %1% to randomly teleport.](gray)' economy_action_back_command: '[ℹ Spent %1% to return to your last position.](gray)' return_by_death_notification: '[Return to where you died?](gray) [[⏪ Teleport…]](#00fb9a show_text=�fb9a&Click to teleport\n&7Return to where you died run_command=/huskhomes:back)' +map_hook_public_homes_marker_set_name: 'Public Homes' +map_hook_warps_marker_set_name: 'Warps' up_to_date: '[HuskHomes](#00fb9a bold) [| You are running the latest version of HuskHomes (v%1%).](#00fb9a)' update_available: '[HuskHomes](#ff7e5e bold) [| A new version of HuskHomes is available: v%1% (running: v%2%).](#ff7e5e)' error_home_name_taken: '[Error:](#ff3300) [You already have a home set with that name.](#ff7e5e)' diff --git a/common/src/main/resources/locales/zh-cn.yml b/common/src/main/resources/locales/zh-cn.yml index 149e61c6..8c1e94d3 100644 --- a/common/src/main/resources/locales/zh-cn.yml +++ b/common/src/main/resources/locales/zh-cn.yml @@ -94,6 +94,8 @@ economy_action_make_home_public: '[ℹ 花费 %1% 将家设为公开.](gray)' economy_action_random_teleport: '[ℹ 花费 %1% 使用随机传送.](gray)' economy_action_back_command: '[ℹ 花费 %1% 回到上一位置.](gray)' return_by_death_notification: '[回到上一个位置?](gray) [[⏪ 点击传送…]](#00fb9a show_text=�fb9a&点击传送\n&7返回上一位置 run_command=/huskhomes:back)' +map_hook_public_homes_marker_set_name: 'Public Homes' +map_hook_warps_marker_set_name: 'Warps' up_to_date: '[HuskHomes](#00fb9a bold) [| You are running the latest version of HuskHomes (v%1%).](#00fb9a)' update_available: '[HuskHomes](#ff7e5e bold) [| A new version of HuskHomes is available: v%1% (running: v%2%).](#ff7e5e)' error_home_name_taken: '[错误:](#ff3300) [已有一个相同名称的家.](#ff7e5e)' diff --git a/common/src/main/resources/locales/zh-tw.yml b/common/src/main/resources/locales/zh-tw.yml index b066e08d..2fd678f5 100644 --- a/common/src/main/resources/locales/zh-tw.yml +++ b/common/src/main/resources/locales/zh-tw.yml @@ -94,6 +94,8 @@ economy_action_make_home_public: '[ℹ 花費 %1% 將家設為公開.](gray)' economy_action_random_teleport: '[ℹ 花費 %1% 使用隨機傳送.](gray)' economy_action_back_command: '[ℹ 花費 %1% 回到上一位置.](gray)' return_by_death_notification: '[回到上一個位置?](gray) [[⏪ 傳送…]](#00fb9a show_text=�fb9a&點擊傳送\n&7返回上一位置 run_command=/huskhomes:back)' +map_hook_public_homes_marker_set_name: 'Public Homes' +map_hook_warps_marker_set_name: 'Warps' up_to_date: '[HuskHomes](#00fb9a bold) [| You are running the latest version of HuskHomes (v%1%).](#00fb9a)' update_available: '[HuskHomes](#ff7e5e bold) [| A new version of HuskHomes is available: v%1% (running: v%2%).](#ff7e5e)' error_home_name_taken: '[錯誤:](#ff3300) [已有一個相同名稱的家.](#ff7e5e)'