/
JustEnoughItems.java
63 lines (51 loc) · 1.81 KB
/
JustEnoughItems.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
package mezz.jei;
import javax.annotation.Nonnull;
import java.util.Map;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLModIdMappingEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkCheckHandler;
import net.minecraftforge.fml.relauncher.Side;
import mezz.jei.config.Config;
import mezz.jei.config.Constants;
import mezz.jei.network.PacketHandler;
@Mod(modid = Constants.MOD_ID,
name = Constants.NAME,
version = Constants.VERSION,
guiFactory = "mezz.jei.config.JEIModGuiFactory",
dependencies = "required-after:Forge@[11.14.0.1269,);")
public class JustEnoughItems {
@SidedProxy(clientSide = "mezz.jei.ProxyCommonClient", serverSide = "mezz.jei.ProxyCommon")
private static ProxyCommon proxy;
private static PacketHandler packetHandler;
public static PacketHandler getPacketHandler() {
return packetHandler;
}
public static ProxyCommon getProxy() {
return proxy;
}
@NetworkCheckHandler
public boolean checkModLists(Map<String, String> modList, Side side) {
if (side == Side.SERVER) {
boolean jeiOnServer = modList.containsKey(Constants.MOD_ID);
Config.setRecipeTransferEnabled(jeiOnServer);
}
return true;
}
@Mod.EventHandler
public void preInit(@Nonnull FMLPreInitializationEvent event) {
packetHandler = new PacketHandler();
Internal.setHelpers(new JeiHelpers());
proxy.preInit(event);
}
@Mod.EventHandler
public void init(@Nonnull FMLInitializationEvent event) {
proxy.init(event);
}
@Mod.EventHandler
public void startJEI(@Nonnull FMLModIdMappingEvent event) {
proxy.startJEI();
}
}