Fix Paper startup before worlds load and add 0.5.0 artifacts
This commit is contained in:
1 parent
c0daa0507a
commit
434ed5338a
21 files changed
+60
-17
No files matched your search
@@ -24,6 +24,6 @@ jar {
|
||||
from project(':common').sourceSets.main.output
|
||||
from project(':api').sourceSets.main.output
|
||||
from project(':bluemap').sourceSets.main.output
|
||||
from { configurations.runtimeClasspath.findAll { it.name.endsWith('.jar') && !it.name.startsWith('common-') }.collect { zipTree(it) } }
|
||||
from { configurations.runtimeClasspath.findAll { it.name.endsWith('.jar') && !it.name.startsWith('common-') && !it.name.startsWith('api-') && !it.name.startsWith('bluemap-') }.collect { zipTree(it) } }
|
||||
exclude 'META-INF/*.SF', 'META-INF/*.RSA', 'META-INF/*.DSA'
|
||||
}
|
||||
@@ -27,6 +27,7 @@ public final class ScopenetPlugin extends JavaPlugin implements Listener {
|
||||
private ClientLinkBridge clientLink;
|
||||
private EssentialsHandler essentialsHandler;
|
||||
private GuildHandler guildHandler;
|
||||
private boolean liveMapStarted;
|
||||
|
||||
@Override public void onEnable() {
|
||||
// Install the deny-by-default listener even if configuration is invalid.
|
||||
@@ -52,7 +53,9 @@ public final class ScopenetPlugin extends JavaPlugin implements Listener {
|
||||
|
||||
// Central Live Map: mirror chunks and player positions to the panel.
|
||||
if (getConfig().getBoolean("livemap.enabled", true)) {
|
||||
integration.enableLiveMap(Bukkit.getWorlds().get(0).getWorldFolder().toPath());
|
||||
// STARTUP plugins enable before Paper loads any worlds. WorldLoadEvent starts
|
||||
// the map on a fresh boot; this also handles enabling after worlds exist.
|
||||
for (World world : Bukkit.getWorlds()) startLiveMap(world);
|
||||
Bukkit.getScheduler().runTaskTimer(this, this::snapshotPlayers, 40, 20);
|
||||
}
|
||||
|
||||
@@ -118,11 +121,23 @@ public final class ScopenetPlugin extends JavaPlugin implements Listener {
|
||||
getLogger().info(" - Essentials: " + (settings.essentialsEnabled() ? "ENABLED" : "DISABLED"));
|
||||
getLogger().info(" - Economy: " + (settings.economyEnabled() ? "ENABLED" : "DISABLED"));
|
||||
} catch (Exception e) {
|
||||
getLogger().severe("SCOPENET is blocking joins: " + e.getMessage());
|
||||
getLogger().log(java.util.logging.Level.SEVERE, "SCOPENET is blocking joins", e);
|
||||
for (Player player : Bukkit.getOnlinePlayers()) player.kickPlayer(Integration.UNAVAILABLE);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void worldLoaded(org.bukkit.event.world.WorldLoadEvent event) {
|
||||
startLiveMap(event.getWorld());
|
||||
}
|
||||
|
||||
private void startLiveMap(World world) {
|
||||
if (liveMapStarted || integration == null || world.getEnvironment() != World.Environment.NORMAL
|
||||
|| !getConfig().getBoolean("livemap.enabled", true)) return;
|
||||
integration.enableLiveMap(world.getWorldFolder().toPath());
|
||||
liveMapStarted = true;
|
||||
}
|
||||
|
||||
private Settings readSettings() {
|
||||
return Settings.of(
|
||||
getConfig().getString("panel-url", ""),
|
||||
|
||||
Reference in new issue
Block a user