mirror of
https://github.com/GTNewHorizons/JustEnoughCalculation.git
synced 2026-11-13 00:37:46 +00:00
Fix: server cann't stated
This commit is contained in:
1 parent
d15ceed3d9
commit
ca3aefd62f
4 files changed
+131
-52
No files matched your search
@@ -1,14 +1,10 @@
|
||||
package me.towdium.jecalculation;
|
||||
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.*;
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import me.towdium.jecalculation.nei.NEIPlugin;
|
||||
import me.towdium.jecalculation.network.ClientHandler;
|
||||
import me.towdium.jecalculation.network.CommonProxy;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -17,30 +13,61 @@ import org.apache.logging.log4j.Logger;
|
||||
*/
|
||||
@ParametersAreNonnullByDefault
|
||||
@SuppressWarnings("unused")
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Mod(modid = Tags.MODID, name = Tags.MODNAME, version = Tags.VERSION, dependencies = "required-after:NotEnoughItems")
|
||||
@Mod(
|
||||
modid = Tags.MODID,
|
||||
name = Tags.MODNAME,
|
||||
version = Tags.VERSION,
|
||||
dependencies = "required-after:NotEnoughItems",
|
||||
acceptedMinecraftVersions = "[1.7.10]")
|
||||
public class JustEnoughCalculation {
|
||||
public static Logger logger = LogManager.getLogger(Tags.MODID);
|
||||
|
||||
@SidedProxy(
|
||||
clientSide = Tags.GROUPNAME + ".network.ClientProxy",
|
||||
serverSide = Tags.GROUPNAME + ".network.CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
|
||||
@Mod.Instance(Tags.MODID)
|
||||
public static JustEnoughCalculation INSTANCE;
|
||||
|
||||
public static ClientHandler handler = new ClientHandler();
|
||||
|
||||
public static Logger logger = LogManager.getLogger(Tags.MODID);
|
||||
|
||||
@Mod.EventHandler
|
||||
public static void initPre(FMLPreInitializationEvent event) {
|
||||
JecaConfig.preInit(event);
|
||||
handler.initPre();
|
||||
public static void preInit(FMLPreInitializationEvent event) {
|
||||
proxy.preInit(event);
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public static void init(FMLInitializationEvent event) {
|
||||
handler.init();
|
||||
proxy.init(event);
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public static void postInit(FMLPostInitializationEvent event) {
|
||||
handler.initPost();
|
||||
NEIPlugin.init();
|
||||
proxy.postInit(event);
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void serverAboutToStart(FMLServerAboutToStartEvent event) {
|
||||
proxy.serverAboutToStart(event);
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
// register server commands in this event handler
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
proxy.serverStarting(event);
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void serverStarted(FMLServerStartedEvent event) {
|
||||
proxy.serverStarted(event);
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void serverStopping(FMLServerStoppingEvent event) {
|
||||
proxy.serverStopping(event);
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void serverStopped(FMLServerStoppedEvent event) {
|
||||
proxy.serverStopped(event);
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package me.towdium.jecalculation.network;
|
||||
|
||||
import static me.towdium.jecalculation.gui.JecaGui.keyOpenGuiCraft;
|
||||
import static me.towdium.jecalculation.gui.JecaGui.keyOpenGuiMath;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import me.towdium.jecalculation.command.JecaCommand;
|
||||
import me.towdium.jecalculation.data.Controller;
|
||||
import me.towdium.jecalculation.data.label.ILabel;
|
||||
import me.towdium.jecalculation.event.Handlers;
|
||||
import net.minecraftforge.client.ClientCommandHandler;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ClientHandler {
|
||||
|
||||
public void initPre() {
|
||||
Handlers.register();
|
||||
}
|
||||
|
||||
public void initPost() {
|
||||
ILabel.initServer();
|
||||
ClientCommandHandler.instance.registerCommand(new JecaCommand());
|
||||
ILabel.initClient();
|
||||
Controller.loadFromLocal();
|
||||
}
|
||||
|
||||
public void init() {
|
||||
ClientRegistry.registerKeyBinding(keyOpenGuiCraft);
|
||||
ClientRegistry.registerKeyBinding(keyOpenGuiMath);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package me.towdium.jecalculation.network;
|
||||
|
||||
import static me.towdium.jecalculation.gui.JecaGui.keyOpenGuiCraft;
|
||||
import static me.towdium.jecalculation.gui.JecaGui.keyOpenGuiMath;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.common.event.*;
|
||||
import me.towdium.jecalculation.JecaConfig;
|
||||
import me.towdium.jecalculation.command.JecaCommand;
|
||||
import me.towdium.jecalculation.data.Controller;
|
||||
import me.towdium.jecalculation.data.label.ILabel;
|
||||
import me.towdium.jecalculation.event.Handlers;
|
||||
import me.towdium.jecalculation.nei.NEIPlugin;
|
||||
import net.minecraftforge.client.ClientCommandHandler;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class ClientProxy extends CommonProxy {
|
||||
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
JecaConfig.preInit(event);
|
||||
Handlers.register();
|
||||
}
|
||||
|
||||
public void init(FMLInitializationEvent event) {
|
||||
ClientRegistry.registerKeyBinding(keyOpenGuiCraft);
|
||||
ClientRegistry.registerKeyBinding(keyOpenGuiMath);
|
||||
}
|
||||
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
ILabel.initServer();
|
||||
ClientCommandHandler.instance.registerCommand(new JecaCommand());
|
||||
ILabel.initClient();
|
||||
Controller.loadFromLocal();
|
||||
|
||||
NEIPlugin.init();
|
||||
}
|
||||
|
||||
public void serverAboutToStart(FMLServerAboutToStartEvent event) {
|
||||
super.serverAboutToStart(event);
|
||||
}
|
||||
|
||||
// register server commands in this event handler
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
super.serverStarting(event);
|
||||
}
|
||||
|
||||
public void serverStarted(FMLServerStartedEvent event) {
|
||||
super.serverStarted(event);
|
||||
}
|
||||
|
||||
public void serverStopping(FMLServerStoppingEvent event) {
|
||||
super.serverStopping(event);
|
||||
}
|
||||
|
||||
public void serverStopped(FMLServerStoppedEvent event) {
|
||||
super.serverStopped(event);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package me.towdium.jecalculation.network;
|
||||
|
||||
import cpw.mods.fml.common.event.*;
|
||||
|
||||
public class CommonProxy {
|
||||
|
||||
// preInit "Run before anything else. Read your config, create blocks, items,
|
||||
// etc, and register them with the GameRegistry."
|
||||
public void preInit(FMLPreInitializationEvent event) {}
|
||||
|
||||
// load "Do your mod setup. Build whatever data structures you care about. Register recipes."
|
||||
public void init(FMLInitializationEvent event) {}
|
||||
|
||||
// postInit "Handle interaction with other mods, complete your setup based on this."
|
||||
public void postInit(FMLPostInitializationEvent event) {}
|
||||
|
||||
public void serverAboutToStart(FMLServerAboutToStartEvent event) {}
|
||||
|
||||
// register server commands in this event handler
|
||||
public void serverStarting(FMLServerStartingEvent event) {}
|
||||
|
||||
public void serverStarted(FMLServerStartedEvent event) {}
|
||||
|
||||
public void serverStopping(FMLServerStoppingEvent event) {}
|
||||
|
||||
public void serverStopped(FMLServerStoppedEvent event) {}
|
||||
}
|
||||
Reference in new issue
Block a user