forked from mirror/BlueMap
Improve startup on forge to be more stable with other mods
This commit is contained in:
parent
e071ed83fa
commit
86b8deb3f3
@ -37,6 +37,7 @@
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import net.minecraftforge.fml.event.server.FMLServerStartedEvent;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
@ -97,20 +98,23 @@ public ForgeMod() {
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStarting(FMLServerStartingEvent event) {
|
||||
this.worldUUIDs.clear();
|
||||
|
||||
//save worlds to generate level.dat files
|
||||
event.getServer().save(false, true, true);
|
||||
@SubscribeEvent
|
||||
public void onServerStarting(FMLServerStartingEvent event) {
|
||||
this.serverInstance = event.getServer();
|
||||
|
||||
//register commands
|
||||
new Commands<>(pluginInstance, event.getServer().getCommandManager().getDispatcher(), forgeSource -> new ForgeCommandSource(this, pluginInstance, forgeSource));
|
||||
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStarted(FMLServerStartedEvent event) {
|
||||
//save worlds to generate level.dat files
|
||||
serverInstance.save(false, true, true);
|
||||
|
||||
new Thread(() -> {
|
||||
Logger.global.logInfo("Loading...");
|
||||
|
||||
|
||||
try {
|
||||
pluginInstance.load();
|
||||
if (pluginInstance.isLoaded()) Logger.global.logInfo("Loaded!");
|
||||
@ -119,7 +123,7 @@ public void onServerStarting(FMLServerStartingEvent event) {
|
||||
pluginInstance.unload();
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStopping(FMLServerStoppingEvent event) {
|
||||
|
@ -37,6 +37,7 @@
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import net.minecraftforge.fml.event.server.FMLServerStartedEvent;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
@ -100,17 +101,20 @@ public ForgeMod() {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStarting(FMLServerStartingEvent event) {
|
||||
this.worldUUIDs.clear();
|
||||
|
||||
//save worlds to generate level.dat files
|
||||
event.getServer().save(false, true, true);
|
||||
this.serverInstance = event.getServer();
|
||||
|
||||
//register commands
|
||||
new Commands<>(pluginInstance, event.getServer().getCommandManager().getDispatcher(), forgeSource -> new ForgeCommandSource(this, pluginInstance, forgeSource));
|
||||
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStarted(FMLServerStartedEvent event) {
|
||||
//save worlds to generate level.dat files
|
||||
serverInstance.save(false, true, true);
|
||||
|
||||
new Thread(() -> {
|
||||
Logger.global.logInfo("Loading...");
|
||||
|
||||
|
||||
try {
|
||||
pluginInstance.load();
|
||||
if (pluginInstance.isLoaded()) Logger.global.logInfo("Loaded!");
|
||||
@ -119,7 +123,7 @@ public void onServerStarting(FMLServerStartingEvent event) {
|
||||
pluginInstance.unload();
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStopping(FMLServerStoppingEvent event) {
|
||||
|
@ -37,6 +37,7 @@
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import net.minecraftforge.fml.event.server.FMLServerStartedEvent;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
@ -101,20 +102,23 @@ public ForgeMod() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStarting(FMLServerStartingEvent event) {
|
||||
public void onServerStarting(FMLServerStartingEvent event) {
|
||||
this.serverInstance = event.getServer();
|
||||
|
||||
//register commands
|
||||
new Commands<>(pluginInstance, event.getServer().getCommandManager().getDispatcher(), forgeSource -> new ForgeCommandSource(this, pluginInstance, forgeSource));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStarted(FMLServerStartedEvent event) {
|
||||
//save worlds to generate level.dat files
|
||||
serverInstance.save(false, true, true);
|
||||
|
||||
|
||||
new Thread(() -> {
|
||||
Logger.global.logInfo("Loading...");
|
||||
|
||||
|
||||
try {
|
||||
pluginInstance.load();
|
||||
if (pluginInstance.isLoaded()) Logger.global.logInfo("Loaded!");
|
||||
@ -123,7 +127,7 @@ public void onServerStarting(FMLServerStartingEvent event) {
|
||||
pluginInstance.unload();
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStopping(FMLServerStoppingEvent event) {
|
||||
|
Loading…
Reference in New Issue
Block a user