2018-10-13 20:35:18 +02:00
|
|
|
package de.ellpeck.naturesaura;
|
|
|
|
|
2018-11-11 13:26:19 +01:00
|
|
|
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
|
|
|
import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk;
|
|
|
|
import de.ellpeck.naturesaura.api.aura.container.IAuraContainer;
|
|
|
|
import de.ellpeck.naturesaura.api.aura.item.IAuraRecharge;
|
2018-10-13 23:46:30 +02:00
|
|
|
import de.ellpeck.naturesaura.blocks.ModBlocks;
|
2018-11-07 13:33:49 +01:00
|
|
|
import de.ellpeck.naturesaura.blocks.multi.Multiblocks;
|
2018-11-13 11:39:28 +01:00
|
|
|
import de.ellpeck.naturesaura.chunk.effect.DrainSpotEffects;
|
2018-10-25 18:49:42 +02:00
|
|
|
import de.ellpeck.naturesaura.commands.CommandAura;
|
2018-10-19 14:35:25 +02:00
|
|
|
import de.ellpeck.naturesaura.compat.Compat;
|
2018-10-21 12:51:13 +02:00
|
|
|
import de.ellpeck.naturesaura.events.CommonEvents;
|
2018-10-14 17:46:00 +02:00
|
|
|
import de.ellpeck.naturesaura.items.ModItems;
|
2018-10-14 14:27:18 +02:00
|
|
|
import de.ellpeck.naturesaura.packet.PacketHandler;
|
2018-11-29 17:58:47 +01:00
|
|
|
import de.ellpeck.naturesaura.potion.ModPotions;
|
2018-10-13 20:35:18 +02:00
|
|
|
import de.ellpeck.naturesaura.proxy.IProxy;
|
2018-10-16 01:36:30 +02:00
|
|
|
import de.ellpeck.naturesaura.recipes.ModRecipes;
|
2018-10-13 20:35:18 +02:00
|
|
|
import de.ellpeck.naturesaura.reg.ModRegistry;
|
|
|
|
import net.minecraft.creativetab.CreativeTabs;
|
2018-10-28 16:21:43 +01:00
|
|
|
import net.minecraft.init.Items;
|
2018-10-13 20:35:18 +02:00
|
|
|
import net.minecraft.item.ItemStack;
|
2018-10-16 11:49:30 +02:00
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
2018-10-13 20:35:18 +02:00
|
|
|
import net.minecraftforge.fml.common.Mod;
|
|
|
|
import net.minecraftforge.fml.common.Mod.EventHandler;
|
|
|
|
import net.minecraftforge.fml.common.SidedProxy;
|
2018-10-20 21:19:08 +02:00
|
|
|
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
|
|
|
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
|
|
|
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
2018-10-25 18:49:42 +02:00
|
|
|
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
2018-10-13 20:35:18 +02:00
|
|
|
import org.apache.logging.log4j.LogManager;
|
|
|
|
import org.apache.logging.log4j.Logger;
|
|
|
|
|
2018-10-22 21:07:21 +02:00
|
|
|
@Mod(modid = NaturesAura.MOD_ID, name = NaturesAura.MOD_NAME, version = NaturesAura.VERSION, dependencies = NaturesAura.DEPS)
|
2018-10-13 20:35:18 +02:00
|
|
|
public final class NaturesAura {
|
|
|
|
|
2018-11-12 01:29:33 +01:00
|
|
|
public static final String MOD_ID = NaturesAuraAPI.MOD_ID;
|
2018-10-13 20:35:18 +02:00
|
|
|
public static final String PROXY_LOCATION = "de.ellpeck." + MOD_ID + ".proxy.";
|
|
|
|
public static final String MOD_NAME = "Nature's Aura";
|
|
|
|
public static final String VERSION = "@VERSION@";
|
2018-10-26 12:03:42 +02:00
|
|
|
public static final String DEPS = "required-after:patchouli;";
|
2018-10-13 20:35:18 +02:00
|
|
|
|
|
|
|
public static final Logger LOGGER = LogManager.getLogger(MOD_NAME);
|
|
|
|
|
|
|
|
@SidedProxy(modId = MOD_ID, clientSide = PROXY_LOCATION + "ClientProxy", serverSide = PROXY_LOCATION + "ServerProxy")
|
|
|
|
public static IProxy proxy;
|
|
|
|
|
|
|
|
public static final CreativeTabs CREATIVE_TAB = new CreativeTabs(MOD_ID) {
|
|
|
|
@Override
|
|
|
|
public ItemStack createIcon() {
|
2018-11-21 14:10:07 +01:00
|
|
|
return new ItemStack(ModItems.GOLD_LEAF);
|
2018-10-13 20:35:18 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
public void preInit(FMLPreInitializationEvent event) {
|
2018-11-11 13:26:19 +01:00
|
|
|
NaturesAuraAPI.setInstance(new InternalHooks());
|
2018-11-12 22:04:40 +01:00
|
|
|
Helper.registerCap(IAuraContainer.class);
|
|
|
|
Helper.registerCap(IAuraRecharge.class);
|
|
|
|
Helper.registerCap(IAuraChunk.class);
|
2018-10-20 21:19:08 +02:00
|
|
|
|
2018-10-13 23:46:30 +02:00
|
|
|
new ModBlocks();
|
2018-10-14 17:46:00 +02:00
|
|
|
new ModItems();
|
2018-11-29 17:58:47 +01:00
|
|
|
new ModPotions();
|
2018-10-16 01:36:30 +02:00
|
|
|
|
2018-11-11 16:50:51 +01:00
|
|
|
Compat.preInit();
|
2018-10-14 14:27:18 +02:00
|
|
|
PacketHandler.init();
|
2018-10-13 20:35:18 +02:00
|
|
|
ModRegistry.preInit(event);
|
2018-10-27 01:49:57 +02:00
|
|
|
new Multiblocks();
|
2018-10-16 01:36:30 +02:00
|
|
|
|
2018-10-21 12:51:13 +02:00
|
|
|
MinecraftForge.EVENT_BUS.register(new CommonEvents());
|
2018-10-16 01:36:30 +02:00
|
|
|
|
2018-10-13 20:35:18 +02:00
|
|
|
proxy.preInit(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
public void init(FMLInitializationEvent event) {
|
2018-11-20 19:59:18 +01:00
|
|
|
ModConfig.initOrReload(false);
|
2018-10-16 01:36:30 +02:00
|
|
|
ModRecipes.init();
|
2018-10-13 20:35:18 +02:00
|
|
|
ModRegistry.init(event);
|
2018-11-13 11:39:28 +01:00
|
|
|
DrainSpotEffects.init();
|
2018-10-16 01:36:30 +02:00
|
|
|
|
2018-10-13 20:35:18 +02:00
|
|
|
proxy.init(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
public void postInit(FMLPostInitializationEvent event) {
|
|
|
|
ModRegistry.postInit(event);
|
2018-11-11 16:50:51 +01:00
|
|
|
Compat.postInit();
|
2018-10-13 20:35:18 +02:00
|
|
|
proxy.postInit(event);
|
2018-10-28 16:21:43 +01:00
|
|
|
|
2018-11-13 19:15:24 +01:00
|
|
|
if (ModConfig.enabledFeatures.removeDragonBreathContainerItem) {
|
2018-10-28 16:21:43 +01:00
|
|
|
Items.DRAGON_BREATH.setContainerItem(null);
|
|
|
|
}
|
2018-10-13 20:35:18 +02:00
|
|
|
}
|
2018-10-25 18:49:42 +02:00
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
public void serverStarting(FMLServerStartingEvent event) {
|
|
|
|
event.registerServerCommand(new CommandAura());
|
|
|
|
}
|
2018-10-13 20:35:18 +02:00
|
|
|
}
|