mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-24 17:47:40 +01:00
Shift CommonAPI initialization forward to ServerAboutToStart
This commit is contained in:
parent
7268db3ed2
commit
75789b29a6
@ -21,6 +21,7 @@ import net.minecraftforge.fml.common.SidedProxy;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartedEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent;
|
||||
@ -108,7 +109,7 @@ public class DynmapMod
|
||||
|
||||
private MinecraftServer server;
|
||||
@EventHandler
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
public void serverStarting(FMLServerAboutToStartEvent event) {
|
||||
server = event.getServer();
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@ import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStoppingEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerAboutToStartEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStartedEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import net.minecraftforge.fml.network.FMLNetworkConstants;
|
||||
@ -111,13 +112,17 @@ public class DynmapMod
|
||||
private MinecraftServer server;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStarting(FMLServerStartingEvent event) {
|
||||
public void onServerAboutToStartStarting(FMLServerAboutToStartEvent event) {
|
||||
server = event.getServer();
|
||||
if(plugin == null)
|
||||
plugin = proxy.startServer(server);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStarting(FMLServerStartingEvent event) {
|
||||
plugin.onStarting(event.getCommandDispatcher());
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStarted(FMLServerStartedEvent event) {
|
||||
DynmapCommonAPIListener.register(new APICallback());
|
||||
|
@ -21,6 +21,7 @@ import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStoppingEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerAboutToStartEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStartedEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import net.minecraftforge.fml.network.FMLNetworkConstants;
|
||||
@ -112,13 +113,17 @@ public class DynmapMod
|
||||
private MinecraftServer server;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStarting(FMLServerStartingEvent event) {
|
||||
public void onServerAboutToStart(FMLServerAboutToStartEvent event) {
|
||||
server = event.getServer();
|
||||
if(plugin == null)
|
||||
plugin = proxy.startServer(server);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStarting(FMLServerStartingEvent event) {
|
||||
plugin.onStarting(event.getCommandDispatcher());
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStarted(FMLServerStartedEvent event) {
|
||||
DynmapCommonAPIListener.register(new APICallback());
|
||||
|
@ -20,6 +20,7 @@ import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStoppingEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerAboutToStartEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStartedEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import net.minecraftforge.fml.network.FMLNetworkConstants;
|
||||
@ -111,7 +112,7 @@ public class DynmapMod
|
||||
private MinecraftServer server;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStarting(FMLServerStartingEvent event) {
|
||||
public void onServerStarting(FMLServerAboutToStartEvent event) {
|
||||
server = event.getServer();
|
||||
if(plugin == null)
|
||||
plugin = proxy.startServer(server);
|
||||
|
@ -21,6 +21,7 @@ import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import net.minecraftforge.fmllegacy.network.FMLNetworkConstants;
|
||||
import net.minecraftforge.fmlserverevents.FMLServerAboutToStartEvent;
|
||||
import net.minecraftforge.fmlserverevents.FMLServerStartedEvent;
|
||||
import net.minecraftforge.fmlserverevents.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fmlserverevents.FMLServerStoppingEvent;
|
||||
@ -113,7 +114,7 @@ public class DynmapMod
|
||||
private MinecraftServer server;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStarting(FMLServerStartingEvent event) {
|
||||
public void onServerStarting(FMLServerAboutToStartEvent event) {
|
||||
server = event.getServer();
|
||||
if(plugin == null)
|
||||
plugin = proxy.startServer(server);
|
||||
|
@ -11,6 +11,7 @@ import org.dynmap.forge_1_18_2.DynmapPlugin.OurLog;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.server.ServerAboutToStartEvent;
|
||||
import net.minecraftforge.event.server.ServerStartedEvent;
|
||||
import net.minecraftforge.event.server.ServerStartingEvent;
|
||||
import net.minecraftforge.event.server.ServerStoppingEvent;
|
||||
@ -113,7 +114,7 @@ public class DynmapMod
|
||||
private MinecraftServer server;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStarting(ServerStartingEvent event) {
|
||||
public void onServerStarting(ServerAboutToStartEvent event) {
|
||||
server = event.getServer();
|
||||
if(plugin == null)
|
||||
plugin = proxy.startServer(server);
|
||||
|
@ -11,6 +11,7 @@ import org.dynmap.forge_1_18.DynmapPlugin.OurLog;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.server.ServerAboutToStartEvent;
|
||||
import net.minecraftforge.event.server.ServerStartedEvent;
|
||||
import net.minecraftforge.event.server.ServerStartingEvent;
|
||||
import net.minecraftforge.event.server.ServerStoppingEvent;
|
||||
@ -113,7 +114,7 @@ public class DynmapMod
|
||||
private MinecraftServer server;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStarting(ServerStartingEvent event) {
|
||||
public void onServerStarting(ServerAboutToStartEvent event) {
|
||||
server = event.getServer();
|
||||
if(plugin == null)
|
||||
plugin = proxy.startServer(server);
|
||||
|
Loading…
Reference in New Issue
Block a user