Unicopia/src/main/java/com/minelittlepony/unicopia/Unicopia.java

57 lines
2.1 KiB
Java
Raw Normal View History

package com.minelittlepony.unicopia;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
import net.minecraft.resource.ResourceType;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.minelittlepony.common.util.GamePaths;
import com.minelittlepony.jumpingcastle.api.Channel;
import com.minelittlepony.jumpingcastle.api.JumpingCastle;
2020-04-15 17:22:29 +02:00
import com.minelittlepony.unicopia.ability.Abilities;
2020-04-15 19:06:45 +02:00
import com.minelittlepony.unicopia.block.UBlocks;
import com.minelittlepony.unicopia.command.Commands;
2020-04-15 19:06:45 +02:00
import com.minelittlepony.unicopia.container.UContainers;
import com.minelittlepony.unicopia.enchanting.Pages;
import com.minelittlepony.unicopia.enchanting.recipe.AffineIngredients;
import com.minelittlepony.unicopia.item.UItems;
import com.minelittlepony.unicopia.network.MsgPlayerAbility;
import com.minelittlepony.unicopia.network.MsgPlayerCapabilities;
import com.minelittlepony.unicopia.network.MsgRequestCapabilities;
import com.minelittlepony.unicopia.structure.UStructures;
2020-04-16 00:44:58 +02:00
public class Unicopia implements ModInitializer {
public static final String MODID = "unicopia";
public static final Logger LOGGER = LogManager.getLogger();
private static Channel channel;
public static Channel getConnection() {
return channel;
}
@Override
public void onInitialize() {
Config.init(GamePaths.getConfigDirectory());
channel = JumpingCastle.subscribeTo(MODID, () -> {})
.listenFor(MsgRequestCapabilities.class)
.listenFor(MsgPlayerCapabilities.class)
.listenFor(MsgPlayerAbility.class);
UTags.bootstrap();
Commands.bootstrap();
UBlocks.bootstrap();
UItems.bootstrap();
UContainers.bootstrap();
UStructures.bootstrap();
2020-04-15 17:22:29 +02:00
Abilities.getInstance().init();
ResourceManagerHelper.get(ResourceType.SERVER_DATA).registerReloadListener(Pages.instance());
2020-04-15 18:36:59 +02:00
ResourceManagerHelper.get(ResourceType.CLIENT_RESOURCES).registerReloadListener(AffineIngredients.instance());
}
}