blob: 38aa9c1e13c685ef7284fe49b091c68d3fc7ad61 (
plain)
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
|
package com.anthonyhilyard.iceberg;
import com.anthonyhilyard.iceberg.network.IcebergNetworkProtocol;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.ExtensionPoint;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.loading.FMLEnvironment;
import net.minecraftforge.fml.network.FMLNetworkConstants;
@Mod(Loader.MODID)
public class Loader
{
public static final String MODID = "iceberg";
public static final Logger LOGGER = LogManager.getLogger(MODID);
public Loader()
{
if (FMLEnvironment.dist == Dist.CLIENT)
{
IcebergClient mod = new IcebergClient();
FMLJavaModLoadingContext.get().getModEventBus().addListener(mod::onClientSetup);
}
else
{
new IcebergServer();
}
// Register the network protocol.
IcebergNetworkProtocol.register();
ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.DISPLAYTEST, () -> Pair.of(() -> FMLNetworkConstants.IGNORESERVERONLY, (a, b) -> true));
}
@SubscribeEvent
public void onCommonSetup(FMLCommonSetupEvent event)
{
}
// Event testing.
//
// @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.FORGE)
// public static class AdvancementEvents
// {
// @SubscribeEvent
// public static void onCriterion(final CriterionEvent event)
// {
// LOGGER.info("{} gained {} for {}!", event.getPlayer().getName().getString(), event.getCriterionKey(), event.getAdvancement().getId().toString());
// }
// @SubscribeEvent
// public static void onFluidEntered(final EntityFluidEvent.Entered event)
// {
// LOGGER.info("{} entered {}!", event.getEntity().getName().getString(), event.getFluid().getRegistryName().toString());
// }
// @SubscribeEvent
// public static void onFluidExited(final EntityFluidEvent.Exited event)
// {
// LOGGER.info("{} exited {}!", event.getEntity().getName().getString(), event.getFluid().getRegistryName().toString());
// }
// }
}
|