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

90 lines
2.9 KiB
Java
Raw Normal View History

2018-09-12 01:29:49 +02:00
package com.minelittlepony.unicopia;
2020-01-17 14:27:26 +01:00
import net.fabricmc.api.ModInitializer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
2019-01-29 14:22:36 +01:00
import net.minecraft.world.biome.Biome;
import java.util.Map;
import java.util.function.Function;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.google.gson.JsonObject;
2020-01-17 14:27:26 +01:00
import com.minelittlepony.unicopia.ability.PowersRegistry;
2018-09-12 01:29:49 +02:00
import com.minelittlepony.unicopia.command.Commands;
2019-02-08 16:56:28 +01:00
import com.minelittlepony.unicopia.enchanting.Pages;
2020-01-17 14:27:26 +01:00
import com.minelittlepony.unicopia.enchanting.recipe.AffineIngredients;
import com.minelittlepony.unicopia.enchanting.recipe.SpecialRecipe;
import com.minelittlepony.unicopia.enchanting.recipe.SpellRecipe;
2020-01-16 12:35:46 +01:00
import com.minelittlepony.unicopia.inventory.gui.SpellBookContainer;
import com.minelittlepony.unicopia.inventory.gui.GuiSpellBook;
2018-09-12 01:29:49 +02:00
import com.minelittlepony.unicopia.network.MsgPlayerAbility;
import com.minelittlepony.unicopia.network.MsgPlayerCapabilities;
import com.minelittlepony.unicopia.network.MsgRequestCapabilities;
import com.minelittlepony.unicopia.util.crafting.CraftingManager;
import com.minelittlepony.unicopia.world.UWorld;
2018-09-12 01:29:49 +02:00
2020-01-17 14:27:26 +01:00
public class Unicopia implements ModInitializer {
2018-09-12 01:29:49 +02:00
public static final String MODID = "unicopia";
public static final String NAME = "@NAME@";
public static final String VERSION = "@VERSION@";
2020-01-17 14:27:26 +01:00
public static final Logger LOGGER = LogManager.getLogger();
2018-09-12 01:29:49 +02:00
private static IChannel channel;
2019-03-05 11:45:56 +01:00
private static CraftingManager craftingManager = new CraftingManager(MODID, "enchanting") {
@Override
protected void registerRecipeTypes(Map<String, Function<JsonObject, IRecipe>> types) {
super.registerRecipeTypes(types);
types.put("unicopia:crafting_spell", SpellRecipe::deserialize);
types.put("unicopia:crafting_special", SpecialRecipe::deserialize);
2019-03-05 11:45:56 +01:00
AffineIngredients.instance().load();
}
};
2020-01-17 14:27:26 +01:00
@Deprecated
public static CraftingManager getCraftingManager() {
return craftingManager;
}
public static IChannel getConnection() {
return channel;
}
2019-02-16 16:49:55 +01:00
2020-01-17 14:27:26 +01:00
@Override
public void onInitialize() {
Config.init(event.getModConfigurationDirectory());
channel = JumpingCastle.subscribeTo(MODID, () -> {})
2018-09-20 22:49:10 +02:00
.listenFor(MsgRequestCapabilities.class)
.listenFor(MsgPlayerCapabilities.class)
.listenFor(MsgPlayerAbility.class);
2018-09-12 01:29:49 +02:00
PowersRegistry.instance().init();
2018-09-19 09:09:30 +02:00
UAdvancements.init();
2020-01-17 14:27:26 +01:00
craftingManager.load();
2020-01-17 14:27:26 +01:00
Pages.instance().load();
2020-01-17 14:27:26 +01:00
UBlocks.bootstrap();
UItems.bootstrap();
Commands.bootstrap();
2019-01-29 14:22:36 +01:00
2020-01-17 14:27:26 +01:00
UWorld.instance().init();
2019-02-08 16:56:28 +01:00
2020-01-17 14:27:26 +01:00
UClient.instance().preInit();
UClient.instance().init();
2019-03-18 15:02:06 +01:00
UClient.instance().postInit();
UItems.fixRecipes();
2018-09-12 01:29:49 +02:00
}
}