Skip to content

Instantly share code, notes, and snippets.

Created Mar 28, 2016
Embed
What would you like to do?
package com.koopamillion.Main;
import com.koopamillion.biome.BiomeRegistry;
import com.koopamillion.biome.WorldTypeKoops;
import com.koopamillion.blocks.MBlocks;
import com.koopamillion.creativetabs.MCreativeTabs;
import com.koopamillion.enchantments.EnchantmentJumpBoost;
import com.koopamillion.enchantments.EnchantmentSpeedBoost;
import com.koopamillion.handler.MGuiHandler;
import com.koopamillion.item.Mitems;
import com.koopamillion.lib.RefStrings;
import com.koopamillion.mob.EntityKoops;
import com.koopamillion.tile_entity.MTileEntity;
import com.koopamillion.tile_entity.TileEntityPoundingMachine;
import com.koopamillion.util.LogHelper;
import com.koopamillion.world.MWorld;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
import net.minecraft.world.WorldType;
import net.minecraftforge.common.AchievementPage;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
@Mod(modid = RefStrings.MODID , name = RefStrings.NAME, version = RefStrings.VERSION)
public class MainRegistry {
public static SimpleNetworkWrapper network;
@SidedProxy(clientSide = RefStrings.CLIENTSIDE , serverSide = RefStrings.SERVERSIDE)
public static ServerProxy proxy;
@EventHandler
public static void PreLoad(FMLPreInitializationEvent PreEvent){
MCreativeTabs.initializeTabs();
MTileEntity.mainRegistery();
MBlocks.mainRegistry();
Mitems.mainRegistry();
MWorld.mainRegistry();
CraftingManager.mainRegistry();
BiomeRegistry.initalizeBiome();
BiomeRegistry.registerBiome();
EntityKoops.MainRegistry();
proxy.registerRenderInfo();
proxy.registerTileEntities();
MGuiHandler.register();
LogHelper.info("You are running " + RefStrings.MODID + ", version " + RefStrings.VERSION);
network = NetworkRegistry.INSTANCE.newSimpleChannel(RefStrings.MODID);
network.registerMessage(JetpackHandler.class, JetpackMessage.class, 0, Side.CLIENT);
}
@EventHandler
public static void load(FMLInitializationEvent event){
proxy.registerNetworkStuff();
achievementCopper = new Achievement("achievement.mineCopper", "mineCopper", 0, 0, new ItemStack(MBlocks.CuOre), (Achievement)null).initIndependentStat().registerStat();
achievementCuCable = new Achievement("achievement.craftCable", "craftCable", 1, 0, Mitems.uninsulatedCopperCable, achievementCopper).registerStat();
achievementTungsten = new Achievement("achievement.mineTungsten", "mineTungsten", 0, -1, MBlocks.WolfOre, (Achievement)null).initIndependentStat().registerStat();
achievementLightCube = new Achievement("achievement.craftLightCube", "craftLightCube", 1, -1, MBlocks.LightCube, achievementTungsten).registerStat();
achievementGenerator = new Achievement("achievement.craftGenerator", "craftGenerator", 2, 0, MBlocks.BlockEnergyGeneratorCoal, achievementCuCable).registerStat();
achievementEFurnace = new Achievement("achievement.craftEFurnace", "craftEFurnace", 3, 0, new ItemStack(MBlocks.Machines, 1, 0), achievementGenerator).registerStat();
achievementEStorage = new Achievement("achievement.craftEStorage", "craftEStorage", 2, 1, new ItemStack(MBlocks.EnergyStorage, 1, 0), achievementGenerator).registerStat();
oreRegistration();
addOreRecipes();
AchievementPage.registerAchievementPage(new AchievementPage("eKoop - Achievements", new Achievement[]{achievementEStorage, achievementCopper, achievementCuCable, achievementTungsten, achievementLightCube, achievementGenerator, achievementEFurnace}));
FMLCommonHandler.instance().bus().register(new eKoopOnMineEvent());
FMLCommonHandler.instance().bus().register(new eKoopOnCraftEvent());
}
public static void oreRegistration()
{
OreDictionary.registerOre("ingotCopper", new ItemStack(Mitems.CuIngot));
OreDictionary.registerOre("ingotSteel", new ItemStack(Mitems.steelIngot));
OreDictionary.registerOre("ingotSilver", new ItemStack(Mitems.sIngot));
OreDictionary.registerOre("ingotTungsten", new ItemStack(Mitems.tIngot));
OreDictionary.registerOre("ingotUranium", new ItemStack(Mitems.uranium));
OreDictionary.registerOre("circuitBasic", new ItemStack(Mitems.CuCableConnector));
OreDictionary.registerOre("wireCopper", new ItemStack(Mitems.uninsulatedCopperCable));
}
public static void addOreRecipes()
{
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Mitems.uninsulatedCopperCable, 6), new Object[]{" X"," X ","X ", 'X', "ingotCopper"}));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Mitems.CuCableConnector, 6), new Object[]{"RXR","XXX","CNC", 'X', "wireCopper", 'R', Items.redstone, 'C', "ingotCopper", 'N', "ingotSteel"}));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack (Mitems.sStick, 1), new Object[]{" "," X ","X ", 'X', "ingotSilver"}));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack (MBlocks.pounderMachine, 1), new Object[]{"SGS","RDR","SGS", 'G', Blocks.glass, 'S', "ingotSteel", 'D', Mitems.diamondPoundHead, 'R', Items.redstone}));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack (MBlocks.LightCube, 1), new Object[]{"XYX","YSY","XYX", 'X', Blocks.glass, 'S', "ingotTungsten", 'Y', Items.redstone}));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack (Mitems.tPick, 1), new Object[]{"XXX"," S "," S ", 'X', "ingotTungsten", 'S', Mitems.rStick}));
}
@EventHandler
public static void PostLoad(FMLPostInitializationEvent PostEvent){
WorldType KOOPS = new WorldTypeKoops(3, "koops");
}
@Instance(RefStrings.MODID)
public static MainRegistry modInstance;
public static Achievement achievementCuCable;
public static Achievement achievementCopper;
public static Achievement achievementTungsten;
public static Achievement achievementLightCube;
public static Achievement achievementGenerator;
public static Achievement achievementEFurnace;
public static Achievement achievementEStorage;
public static final Enchantment speedBoost = new EnchantmentSpeedBoost(84, 5);
public static final Enchantment jumpBoost = new EnchantmentJumpBoost(85, 5);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment