mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
fix: inconsistencies with Pl3xMap loading, close #570
This commit is contained in:
4 files changed
+39
-10
No files matched your search
+1
-1
@@ -26,7 +26,7 @@ dependencies {
|
||||
compileOnly 'com.github.plan-player-analytics:Plan:5.5.2391'
|
||||
compileOnly 'com.github.BlueMap-Minecraft:BlueMapAPI:2.6.0'
|
||||
compileOnly 'us.dynmap:DynmapCoreAPI:3.4'
|
||||
compileOnly 'maven.modrinth:pl3xmap:1.20.2-475'
|
||||
compileOnly 'maven.modrinth:pl3xmap:1.20.4-489'
|
||||
compileOnly 'org.projectlombok:lombok:1.18.32'
|
||||
|
||||
testImplementation 'com.github.plan-player-analytics:Plan:5.5.2391'
|
||||
|
||||
@@ -176,37 +176,43 @@ public abstract class MapHook extends Hook {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected static DynmapHook.MarkerInformationPopup warp(@NotNull Warp warp, @NotNull String thumbnail) {
|
||||
return MarkerInformationPopup.create(warp.getName())
|
||||
protected static MarkerInformationPopup warp(@NotNull Warp warp, @NotNull String thumbnail) {
|
||||
final MarkerInformationPopup popup = MarkerInformationPopup.create(warp.getName())
|
||||
.thumbnail(thumbnail)
|
||||
.field("Description", warp.getMeta().getDescription())
|
||||
.field("Location", warp.toString())
|
||||
.field("Command", "/warp " + warp.getSafeIdentifier());
|
||||
if (!warp.getMeta().getDescription().isBlank()) {
|
||||
popup.field("Description", warp.getMeta().getDescription());
|
||||
}
|
||||
return popup;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected static DynmapHook.MarkerInformationPopup publicHome(@NotNull Home home, @NotNull String thumbnail) {
|
||||
return MarkerInformationPopup.create(home.getName())
|
||||
protected static MarkerInformationPopup publicHome(@NotNull Home home, @NotNull String thumbnail) {
|
||||
final MarkerInformationPopup popup = MarkerInformationPopup.create(home.getName())
|
||||
.thumbnail(thumbnail)
|
||||
.field("Owner", home.getOwner().getUsername())
|
||||
.field("Description", home.getMeta().getDescription())
|
||||
.field("Location", home.toString())
|
||||
.field("Command", "/phome " + home.getSafeIdentifier());
|
||||
if (!home.getMeta().getDescription().isBlank()) {
|
||||
popup.field("Description", home.getMeta().getDescription());
|
||||
}
|
||||
return popup;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected static DynmapHook.MarkerInformationPopup create(@NotNull String title) {
|
||||
protected static MarkerInformationPopup create(@NotNull String title) {
|
||||
return new MarkerInformationPopup(title);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected DynmapHook.MarkerInformationPopup thumbnail(@NotNull String thumbnail) {
|
||||
protected MarkerInformationPopup thumbnail(@NotNull String thumbnail) {
|
||||
this.thumbnail = thumbnail;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected DynmapHook.MarkerInformationPopup field(@NotNull String key, @NotNull String value) {
|
||||
protected MarkerInformationPopup field(@NotNull String key, @NotNull String value) {
|
||||
fields.put(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ package net.william278.huskhomes.hook;
|
||||
import net.pl3x.map.core.Pl3xMap;
|
||||
import net.pl3x.map.core.event.EventHandler;
|
||||
import net.pl3x.map.core.event.EventListener;
|
||||
import net.pl3x.map.core.event.server.Pl3xMapDisabledEvent;
|
||||
import net.pl3x.map.core.event.server.Pl3xMapEnabledEvent;
|
||||
import net.pl3x.map.core.event.world.WorldLoadedEvent;
|
||||
import net.pl3x.map.core.event.world.WorldUnloadedEvent;
|
||||
@@ -51,6 +52,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.logging.Level;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class Pl3xMapHook extends MapHook implements EventListener {
|
||||
|
||||
private static final String ICON_PATH = "/images/icon/registered/";
|
||||
@@ -66,6 +68,9 @@ public class Pl3xMapHook extends MapHook implements EventListener {
|
||||
@Override
|
||||
public void initialize() {
|
||||
Pl3xMap.api().getEventRegistry().register(this);
|
||||
if (Pl3xMap.api().isEnabled()) {
|
||||
onPl3xMapEnabled(new Pl3xMapEnabledEvent());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -159,6 +164,14 @@ public class Pl3xMapHook extends MapHook implements EventListener {
|
||||
});
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPl3xMapDisabled(@NotNull Pl3xMapDisabledEvent event) {
|
||||
Pl3xMap.api().getWorldRegistry().forEach(world -> {
|
||||
world.getLayerRegistry().unregister(WARPS_LAYER);
|
||||
world.getLayerRegistry().unregister(PUBLIC_HOMES_LAYER);
|
||||
});
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onWorldLoaded(@NotNull WorldLoadedEvent event) {
|
||||
registerLayers(event.getWorld());
|
||||
|
||||
@@ -48,5 +48,15 @@ shadowJar {
|
||||
tasks {
|
||||
runServer {
|
||||
minecraftVersion('1.20.4')
|
||||
|
||||
downloadPlugins {
|
||||
url("https://download.luckperms.net/1526/bukkit/loader/LuckPerms-Bukkit-5.4.113.jar")
|
||||
url("https://ci.lucko.me/job/spark/399/artifact/spark-bukkit/build/libs/spark-1.10.58-bukkit.jar")
|
||||
hangar("Plan-Player-Analytics", "5.6+build.2614")
|
||||
|
||||
// modrinth("dynmap", "5F9fwzR1")
|
||||
modrinth("pl3xmap", "1.20.4-489")
|
||||
// modrinth("bluemap", "3.20-paper")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user