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;
|
||||
@ -100,13 +101,16 @@ 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...");
|
||||
|
@ -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,13 +101,16 @@ 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...");
|
||||
|
@ -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;
|
||||
@ -108,7 +109,10 @@ public void onServerStarting(FMLServerStartingEvent event) {
|
||||
|
||||
//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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user