-
Notifications
You must be signed in to change notification settings - Fork 0
/
WikiLink.java
79 lines (61 loc) · 2.35 KB
/
WikiLink.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package wikilink;
import net.minecraft.command.ICommandManager;
import net.minecraft.command.ServerCommandManager;
import net.minecraft.server.MinecraftServer;
import wikilink.commands.CommandWiki;
import wikilink.handlers.ConfigHandler;
import wikilink.handlers.PacketHandler;
import wikilink.handlers.StringHandler;
import wikilink.proxies.CommonProxy;
import wikilink.plugin.PluginManager;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
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.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.network.NetworkMod;
/**
* WikiLink Main Class
*
* @author Slimedog007
*/
@Mod(modid = WikiLinkReference.MOD_ID, name = WikiLinkReference.MOD_NAME, version = WikiLinkReference.MOD_VERSION)
@NetworkMod(channels = {WikiLinkReference.MOD_CHANNEL}, clientSideRequired = true, serverSideRequired = true, packetHandler = PacketHandler.class)
public class WikiLink
{
public static final boolean wikiDebugMode = true;
@Instance(WikiLinkReference.MOD_ID)
public static WikiLink instance;
@SidedProxy(clientSide = "wikilink.proxies.ClientProxy", serverSide = "wikilink.proxies.CommonProxy")
public static CommonProxy proxy;
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
ConfigHandler.init(event.getSuggestedConfigurationFile());
PluginManager.INSTANCE.loadPlugins(event.getSourceFile());
}
@EventHandler
public void mainInit(FMLInitializationEvent event)
{
PluginManager.INSTANCE.listDefaults();
PluginManager.INSTANCE.initPlugins();
}
@EventHandler
public void postInit(FMLPostInitializationEvent event)
{
//NEIWikiLinkConfig.init();
}
@EventHandler
public void serverStart(FMLServerStartingEvent event)
{
MinecraftServer server = MinecraftServer.getServer();
ICommandManager command = server.getCommandManager();
ServerCommandManager serverCommand = ((ServerCommandManager) command);
// Register Commands
serverCommand.registerCommand(new CommandWiki());
System.out.println(WikiLinkReference.MOD_NAME + " " + WikiLinkReference.MOD_VERSION + " has registered the /wiki command.");
}
}