修复在没有dynmap下无法加载的问题。
All checks were successful
Java CI-CD with Maven / build (push) Successful in 10m7s

This commit is contained in:
zhangyuheng 2024-07-18 14:40:35 +08:00
parent 4d1325a126
commit 1297f0cb34
4 changed files with 7 additions and 7 deletions

View File

@ -6,7 +6,7 @@
<groupId>cn.lunadeer</groupId>
<artifactId>Dominion</artifactId>
<version>1.38.0-beta</version>
<version>1.38.1-beta</version>
<packaging>jar</packaging>
<name>Dominion</name>

View File

@ -5,7 +5,6 @@ import cn.lunadeer.dominion.events.PlayerEvents;
import cn.lunadeer.dominion.events.SelectPointEvents;
import cn.lunadeer.dominion.managers.ConfigManager;
import cn.lunadeer.dominion.managers.DatabaseTables;
import cn.lunadeer.dominion.utils.BlueMapConnect;
import cn.lunadeer.dominion.utils.DynmapConnect;
import cn.lunadeer.dominion.utils.MapRender;
import cn.lunadeer.minecraftpluginutils.*;
@ -15,7 +14,6 @@ import cn.lunadeer.minecraftpluginutils.scui.CuiManager;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.plugin.java.JavaPlugin;
import org.dynmap.DynmapCommonAPIListener;
import java.util.HashMap;
import java.util.Map;
@ -75,7 +73,7 @@ public final class Dominion extends JavaPlugin {
XLogger.info(" |_____/ \\___/|_| |_| |_|_|_| |_|_|\\___/|_| |_|");
XLogger.info(" ");
if (config.getDynmap()) DynmapCommonAPIListener.register(new DynmapConnect()); // 注册 Dynmap API
if (config.getDynmap()) new DynmapConnect(); // 注册 Dynmap API
Scheduler.runTaskLaterAsync(MapRender::render, 40 * 20);
}

View File

@ -1,7 +1,6 @@
package cn.lunadeer.dominion.utils;
import cn.lunadeer.dominion.Cache;
import cn.lunadeer.dominion.Dominion;
import cn.lunadeer.dominion.dtos.DominionDTO;
import cn.lunadeer.minecraftpluginutils.Scheduler;
import cn.lunadeer.minecraftpluginutils.XLogger;

View File

@ -16,10 +16,11 @@ public class DynmapConnect extends DynmapCommonAPIListener {
public static DynmapConnect instance;
private MarkerSet markerSet_dominion;
private MarkerSet markerSet_mca;
private MarkerSet markerSet_dominion = null;
private MarkerSet markerSet_mca = null;
public DynmapConnect() {
DynmapCommonAPIListener.register(this);
instance = this;
}
@ -30,9 +31,11 @@ public class DynmapConnect extends DynmapCommonAPIListener {
if (this.markerSet_dominion == null) {
this.markerSet_dominion = markerAPI.createMarkerSet("dominion", "Dominion领地", null, false);
}
this.markerSet_mca = markerAPI.getMarkerSet("mca");
if (this.markerSet_mca == null) {
this.markerSet_mca = markerAPI.createMarkerSet("mca", "MCA文件", null, false);
}
XLogger.info("Dynmap 成功注册");
}
private void setDominionMarker(DominionDTO dominion) {