Jump to content

abused_master

Members
  • Posts

    235
  • Joined

  • Last visited

Everything posted by abused_master

  1. *booooo upload to github, upload to github booooo*
  2. Also i strongly suggest using GitHub as if you do need help/ something isnt working correctly, someone can easily create a Pull Request and you can see what they changed/added, and learn greatly from it
  3. all right so im pretty sure i fixed all of that copy paste code, the problem however still consists, but looking through console i cant directly tell the reason. http://pastebin.com/aWiiQ6pf
  4. Lines 267-269 of SuperOresGeneration : if(Config.SapphireOre) { this.runGenerator(this.UraniumOre, world, random, chunkX, chunkZ, Config.SapphireRate, 0, 54); } this.UraniumOre is almost certainly the wrong field to use here. oh wow, did not see that, yeah just copied - pasted for times sake, silly mistakes
  5. post your json code, item class, registry class,proxy class, and main class
  6. Some code would help us better ya know, how you are rendering it, your json code, ETC
  7. I appreciate the suggestion! I'll try that if I can't figure it out with 'ModelLoader.setCustomModelResourceLocation(...)'. In a previous thread earlier today, I was told to use that rather than getItemModelMesher(). I don't know if this is the "new" way or what, but if it continues to not work, I'll definitely be going back to that. haha Its just the way i use to register my block and item renders and never had a problem with it ;p
  8. Personally id just use this method public static String modid = ModInfo.MODID; public static void reg(Item item) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher() .register(item, 0, new net.minecraft.client.renderer.block.model.ModelResourceLocation(modid + ":" + item.getUnlocalizedName().substring(5), "inventory")); } ModInfo.MODID is just where my modid is located, and then have a second method like: public static void registerItemRenders() { } then register that in the client proxy, and just register the item in that method as such: public static void registerItemRenders() { reg(ModItems.testItem); } this is just a suggestion, you dont have to do anything i have stated above
  9. Hello, so im working on a mod of mine adding support for a few other mods, i added support for tech reborn's ores (20 of them) but whenever the mod is added my game loads just fine, but when i load a world it errors other mods aswell and says: 19:56:13] [server thread/ERROR] [reborncore]: Skipping event FMLServerStoppedEvent and marking errored mod reborncore since required dependency Forge has errored [19:56:13] [server thread/ERROR] [techreborn]: Skipping event FMLServerStoppedEvent and marking errored mod techreborn since required dependency Forge has errored it was working fine before that, and when ic2 is installed the game just crashes because of the error ModBlocks: package abused_master.SuperOres; import abused_master.Config.Config; import abused_master.Ores.ModSupport; import abused_master.Ores.blockSuperCoal; import abused_master.Ores.blockSuperDiamond; import abused_master.Ores.blockSuperGold; import abused_master.Ores.blockSuperIron; import abused_master.Ores.blockSuperLapis; import abused_master.Ores.blockSuperRedstone; import abused_master.itemOres.ItemBlockSuperOre; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.OreDictionary; public class ModBlocks { public static Block blockSuperCoal = new blockSuperCoal("blockSuperCoal"); public static Block blockSuperIron = new blockSuperIron("blockSuperIron"); public static Block blockSuperGold = new blockSuperGold("blockSuperGold"); public static Block blockSuperDiamond = new blockSuperDiamond("blockSuperDiamond"); public static Block blockSuperRedstone = new blockSuperRedstone("blockSuperRedstone"); public static Block blockSuperLapis = new blockSuperLapis("blockSuperLapis"); public static Block SuperAluminumOre; public static Block SuperCopperOre; public static Block SuperNickelOre; public static Block SuperSteelOre; public static Block SuperLeadOre; public static Block SuperSilverOre; public static Block SuperTinOre; public static Block SuperUraniumOre; public static Block SuperOsmiumOre; public static Block ZincOre; public static Block MercuryOre; public static Block PlatinumOre; public static Block CadmiumOre; public static Block ChromiumOre; public static Block MaganeseOre; public static Block NichromeOre; public static Block PlutoniumOre; public static Block RutileOre; public static Block TantalumOre; public static Block TitaniumOre; public static Block ZirconiumOre; public static Block RubyOre; public static Block SapphireOre; public static Block PyriteOre; public static Block CinnabarOre; public static Block SphaleriteOre; public static Block SodaliteOre; public static Block PeridotOre; public static Block TungstenOre; public static Block AnglesiteOre; public static Block BenitoiteOre; public static Block YelloriteOre; public static Block compressedStone; public static void init() { //TO-DO, change the registry of the vanilla resources if (Config.SuperCoalOre) { GameRegistry.register(blockSuperCoal.setRegistryName("blockSuperCoal")); GameRegistry.register(new ItemBlockSuperOre(blockSuperCoal).setRegistryName(blockSuperCoal.getRegistryName())); } if (Config.SuperIronOre) { GameRegistry.register(blockSuperIron.setRegistryName("blockSuperIron")); GameRegistry.register(new ItemBlockSuperOre(blockSuperIron).setRegistryName(blockSuperIron.getRegistryName())); } if (Config.SuperGoldOre) { GameRegistry.register(blockSuperGold.setRegistryName("blockSuperGold")); GameRegistry.register(new ItemBlockSuperOre(blockSuperGold).setRegistryName(blockSuperGold.getRegistryName())); } if (Config.SuperDiamondOre) { GameRegistry.register(blockSuperDiamond.setRegistryName("blockSuperDiamond")); GameRegistry.register(new ItemBlockSuperOre(blockSuperDiamond).setRegistryName(blockSuperDiamond.getRegistryName())); } if (Config.SuperRedstoneOre) { GameRegistry.register(blockSuperRedstone.setRegistryName("blockSuperRedstone")); GameRegistry.register(new ItemBlockSuperOre(blockSuperRedstone).setRegistryName(blockSuperRedstone.getRegistryName())); } if (Config.SuperLapisOre) { GameRegistry.register(blockSuperLapis.setRegistryName("blockSuperLapis")); GameRegistry.register(new ItemBlockSuperOre(blockSuperLapis).setRegistryName(blockSuperLapis.getRegistryName())); } /** * Mod Support */ if(Loader.isModLoaded("immersiveengineering") || Loader.isModLoaded("IC2")) { if (Config.SuperLeadOre) { SuperLeadOre = regOreBlock("LeadOre", 2.5F, 2); } if (Config.SuperSilverOre) { SuperSilverOre = regOreBlock("SilverOre", 2.5F, 3); } if (Config.SuperSteelOre) { SuperSteelOre = regOreBlock("SteelOre", 2.5F, 2); } if (Config.SuperUraniumOre) { SuperUraniumOre = regOreBlock("UraniumOre", 2.0F, 3); } } /* if (Loader.isModLoaded("Mekanism")) { if (Config.SuperOsmiumOre) { SuperOsmiumOre = regOreBlock("OsmiumOre", 2.0F, 2); } } */ if (Loader.isModLoaded("immersiveengineering")) { if (Config.SuperNickelOre) { SuperNickelOre = regOreBlock("NickelOre", 2.0F, 1); } if (Config.SuperAluminumOre) { SuperAluminumOre = regOreBlock("AluminumOre", 2.0F, 1); } } if(Loader.isModLoaded("immersiveengineering") || Loader.isModLoaded("IC2") || Loader.isModLoaded("forestry") || Loader.isModLoaded("Mekanism")) { if(Config.SuperCopperOre) { SuperCopperOre = regOreBlock("CopperOre", 2.0F, 1); } if (Config.SuperTinOre) { SuperTinOre = regOreBlock("TinOre", 1.5F, 1); } } if (Loader.isModLoaded("bigreactors")) { if(Config.YelloriteOre) { YelloriteOre = regOreBlock("YelloriteOre", 1.5F, 1); } if(Config.BenitoiteOre) { BenitoiteOre = regOreBlock("BenitoiteOre", 1.5F, 2); } if(Config.AnglesiteOre) { AnglesiteOre = regOreBlock("AnglesiteOre", 1.5F, 2); } } if (Loader.isModLoaded("techreborn")) { if(Config.RubyOre) { RubyOre = regOreBlock("RubyOre", 1.5F, 2); } if(Config.SapphireOre) { SapphireOre = regOreBlock("SapphireOre", 1.5F, 2); } if(Config.CinnabarOre) { CinnabarOre = regOreBlock("CinnabarOre", 1.5F, 2); } if(Config.PyriteOre) { PyriteOre = regOreBlock("PyriteOre", 1.5F, 2); } if(Config.SphaleriteOre) { SphaleriteOre = regOreBlock("SphaleriteOre", 1.5F, 2); } if(Config.SodaliteOre) { SodaliteOre = regOreBlock("SodaliteOre", 1.5F, 2); } if(Config.PeridotOre) { PeridotOre = regOreBlock("PeridotOre", 1.5F, 2); } if(Config.TungstenOre) { TungstenOre = regOreBlock("TungstenOre", 1.5F, 2); } if(Config.MercuryOre) { MercuryOre = regOreBlock("MercuryOre", 1.5F, 2); } if(Config.PlatinumOre) { PlatinumOre = regOreBlock("PlatinumOre", 1.5F, 2); } if(Config.CadmiumOre) { CadmiumOre = regOreBlock("CadmiumOre", 1.5F, 2); } if(Config.ChromiumOre) { ChromiumOre = regOreBlock("ChromiumOre", 1.5F, 2); } if(Config.MaganeseOre) { MaganeseOre = regOreBlock("MaganeseOre", 1.5F, 2); } if(Config.NichromeOre) { NichromeOre = regOreBlock("NichromeOre", 1.5F, 2); } if(Config.PlutoniumOre) { PlutoniumOre = regOreBlock("PlutoniumOre", 1.5F, 2); } if(Config.RutileOre) { RutileOre = regOreBlock("RutileOre", 1.5F, 2); } if(Config.TantalumOre) { TantalumOre = regOreBlock("TantalumOre", 1.5F, 2); } if(Config.TitaniumOre) { TitaniumOre = regOreBlock("TitaniumOre", 1.5F, 2); } if(Config.ZirconiumOre) { ZirconiumOre = regOreBlock("ZirconiumOre", 1.5F, 2); } if(Config.ZincOre) { ZincOre = regOreBlock("ZincOre", 1.5F, 2); } } } private static Block regOreBlock(String regName, float hardness, int level) { final Block oreBlock = new ModSupport(regName, hardness, level); final ItemBlock itemBlock = new ItemBlock(oreBlock); return regBlock(regName, itemBlock, oreBlock); } private static Block regBlock(String regName, ItemBlock itemBlock, Block block) { block.setRegistryName(regName); GameRegistry.register(block); itemBlock.setRegistryName(regName); GameRegistry.register(itemBlock); return block; } } Block Render Registry: package abused_master.SuperOres; import abused_master.Config.Config; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.fml.common.Loader; import net.minecraftforge.oredict.OreDictionary; public class BlockRenderRegister { public static void registerBlockRenderer() { if(Config.SuperCoalOre) { reg(ModBlocks.blockSuperCoal); } if (Config.SuperDiamondOre) { reg(ModBlocks.blockSuperDiamond); } if (Config.SuperGoldOre) { reg(ModBlocks.blockSuperGold); } if (Config.SuperIronOre) { reg(ModBlocks.blockSuperIron); } if (Config.SuperLapisOre) { reg(ModBlocks.blockSuperLapis); } if (Config.SuperRedstoneOre) { reg(ModBlocks.blockSuperRedstone); } //Mod Support //if (Loader.isModLoaded("Mekanism")) { //if (Config.SuperOsmiumOre) { //reg(ModBlocks.SuperOsmiumOre); //} //} if (Loader.isModLoaded("immersiveengineering")) { if (Config.SuperNickelOre) { reg(ModBlocks.SuperNickelOre); } if (Config.SuperAluminumOre) { reg(ModBlocks.SuperAluminumOre); } } if(Loader.isModLoaded("immersiveengineering") || Loader.isModLoaded("IC2") || Loader.isModLoaded("forestry") || Loader.isModLoaded("Mekanism")) { if(Config.SuperCopperOre) { reg(ModBlocks.SuperCopperOre); } if (Config.SuperTinOre) { reg(ModBlocks.SuperTinOre); } } if(Loader.isModLoaded("immersiveengineering") || Loader.isModLoaded("IC2")) { if (Config.SuperLeadOre) { reg(ModBlocks.SuperLeadOre); } if (Config.SuperSilverOre) { reg(ModBlocks.SuperSilverOre); } if (Config.SuperSteelOre) { reg(ModBlocks.SuperSteelOre); } if (Config.SuperUraniumOre) { reg(ModBlocks.SuperUraniumOre); } } if (Loader.isModLoaded("bigreactors")) { if(Config.YelloriteOre) { reg(ModBlocks.YelloriteOre); } if(Config.BenitoiteOre) { reg(ModBlocks.BenitoiteOre); } if(Config.AnglesiteOre) { reg(ModBlocks.AnglesiteOre); } } if (Loader.isModLoaded("techreborn")) { if(Config.RubyOre) { reg(ModBlocks.RubyOre); } if(Config.SapphireOre) { reg(ModBlocks.SapphireOre); } if(Config.CinnabarOre) { reg(ModBlocks.CinnabarOre); } if(Config.PyriteOre) { reg(ModBlocks.PyriteOre); } if(Config.SphaleriteOre) { reg(ModBlocks.SphaleriteOre); } if(Config.SodaliteOre) { reg(ModBlocks.SodaliteOre); } if(Config.PeridotOre) { reg(ModBlocks.PeridotOre); } if(Config.TungstenOre) { reg(ModBlocks.TungstenOre); } if(Config.ZincOre) { reg(ModBlocks.ZincOre); } if(Config.MercuryOre) { reg(ModBlocks.MercuryOre); } if(Config.CadmiumOre) { reg(ModBlocks.CadmiumOre); } if(Config.ChromiumOre) { reg(ModBlocks.ChromiumOre); } if(Config.NichromeOre) { reg(ModBlocks.NichromeOre); } if(Config.PlutoniumOre) { reg(ModBlocks.PlutoniumOre); } if(Config.RutileOre) { reg(ModBlocks.RutileOre); } if(Config.ZirconiumOre) { reg(ModBlocks.ZirconiumOre); } if(Config.PlatinumOre) { reg(ModBlocks.PlatinumOre); } if(Config.PlatinumOre) { reg(ModBlocks.PlatinumOre); } if(Config.TantalumOre) { reg(ModBlocks.TantalumOre); } if(Config.TitaniumOre) { reg(ModBlocks.TitaniumOre); } } } public static void reg(Block block) { Item item = Item.getItemFromBlock(block); Minecraft.getMinecraft().getRenderItem().getItemModelMesher() .register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); } } ModCrafting: package abused_master.SuperOres; import java.util.List; import abused_master.Config.Config; import net.minecraft.block.Block; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; public class ModCrafting { public static void initCrafting() { if (Config.SuperCoalOre) { GameRegistry.addSmelting(ModBlocks.blockSuperCoal, new ItemStack(Items.COAL, 12), 3.0F); } if (Config.SuperIronOre) { GameRegistry.addSmelting(ModBlocks.blockSuperIron, new ItemStack(Items.IRON_INGOT, 6), 3.0F); } if (Config.SuperGoldOre) { GameRegistry.addSmelting(ModBlocks.blockSuperGold, new ItemStack(Items.GOLD_INGOT, 6), 4.0F); } if (Config.SuperDiamondOre) { GameRegistry.addSmelting(ModBlocks.blockSuperDiamond, new ItemStack(Items.DIAMOND, 5), 5.0F); } if (Config.SuperLapisOre) { GameRegistry.addSmelting(ModBlocks.blockSuperLapis, new ItemStack(Items.DYE, 22, 4), 4.0F); } if (Config.SuperRedstoneOre) { GameRegistry.addSmelting(ModBlocks.blockSuperRedstone, new ItemStack(Items.REDSTONE, 18), 4.0F); } if(Loader.isModLoaded("immersiveengineering") || Loader.isModLoaded("IC2")) { if (Config.SuperLeadOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.SuperLeadOre), getOreDictItemWithMeta("ingotLead", 4), 4.0F); } if (Config.SuperSilverOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.SuperSilverOre), getOreDictItemWithMeta("ingotSilver", 4), 4.0F); } if (Config.SuperSteelOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.SuperSteelOre), getOreDictItemWithMeta("ingotSteel", 3), 4.0F); } if (Config.SuperUraniumOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.SuperUraniumOre), getOreDictItemWithMeta("oreUranium", 3), 4.0F); } } /** if (Loader.isModLoaded("Mekanism")) { if (Config.SuperOsmiumOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.SuperOsmiumOre), getOreDictItemWithMeta("ingotOsmium", 4), 4.0F); } } */ if (Loader.isModLoaded("immersiveengineering")) { if (Config.SuperNickelOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.SuperNickelOre), getOreDictItemWithMeta("ingotNickel", 3), 4.0F); } if (Config.SuperAluminumOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.SuperAluminumOre), getOreDictItemWithMeta("ingotAluminum", 4), 4.0F); } } if(Loader.isModLoaded("immersiveengineering") || Loader.isModLoaded("IC2") || Loader.isModLoaded("forestry") || Loader.isModLoaded("Mekanism")) { if(Config.SuperCopperOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.SuperCopperOre), getOreDictItemWithMeta("ingotCopper", 4), 4.0F); } if (Config.SuperTinOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.SuperTinOre), getOreDictItemWithMeta("ingotTin", 6), 4.0F); } } /* if (Loader.isModLoaded("bigreactors")) { if(Config.YelloriteOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.YelloriteOre), getOreDictItemWithMeta("ingotYellorium", 3), 2.0F); } if(Config.BenitoiteOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.BenitoiteOre), getOreDictItemWithMeta("oreBenitoite", 2), 2.0F); } if(Config.AnglesiteOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.AnglesiteOre), getOreDictItemWithMeta("oreAnglesite", 2), 2.0F); } } */ if (Loader.isModLoaded("techreborn")) { if(Config.RubyOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.RubyOre), getOreDictItemWithMeta("oreRuby", 2), 2.0F); } if(Config.SapphireOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.SapphireOre), getOreDictItemWithMeta("oreSapphire", 3), 2.0F); } if(Config.CinnabarOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.CinnabarOre), getOreDictItemWithMeta("oreCinnabar", 3), 2.0F); } if(Config.PyriteOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.PyriteOre), getOreDictItemWithMeta("orePyrite", 2), 2.0F); } if(Config.SphaleriteOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.SphaleriteOre), getOreDictItemWithMeta("oreSphalerite", 2), 2.0F); } if(Config.SodaliteOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.SodaliteOre), getOreDictItemWithMeta("oreSodalite", 4), 2.0F); } if(Config.PeridotOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.PeridotOre), getOreDictItemWithMeta("orePeridot", 4), 2.0F); } if(Config.TungstenOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.TungstenOre), getOreDictItemWithMeta("oreTungsten", 4), 2.0F); } if(Config.ZincOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.ZincOre), getOreDictItemWithMeta("oreZinc", 4), 2.0F); } if(Config.MercuryOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.MercuryOre), getOreDictItemWithMeta("oreMercury", 4), 2.0F); } if(Config.PlatinumOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.PlatinumOre), getOreDictItemWithMeta("orePlatinum", 4), 2.0F); } if(Config.CadmiumOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.CadmiumOre), getOreDictItemWithMeta("oreCadmium", 4), 2.0F); } if(Config.ChromiumOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.ChromiumOre), getOreDictItemWithMeta("oreChromium", 4), 2.0F); } if(Config.MaganeseOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.MaganeseOre), getOreDictItemWithMeta("oreMaganese", 4), 2.0F); } if(Config.NichromeOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.NichromeOre), getOreDictItemWithMeta("oreNichrome", 4), 2.0F); } if(Config.PlutoniumOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.PlutoniumOre), getOreDictItemWithMeta("orePlutonium", 4), 2.0F); } if(Config.RutileOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.RutileOre), getOreDictItemWithMeta("oreRutile", 4), 2.0F); } if(Config.TantalumOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.TantalumOre), getOreDictItemWithMeta("oreTantalum", 4), 2.0F); } if(Config.TitaniumOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.TitaniumOre), getOreDictItemWithMeta("oreTitanium", 4), 2.0F); } if(Config.ZirconiumOre) { registerSmelting(Item.getItemFromBlock(ModBlocks.ZirconiumOre), getOreDictItemWithMeta("oreZirconium", 4), 2.0F); } } } public static ItemStack getOreDictItemWithMeta(String oreIdName, int num) { List<ItemStack> res = OreDictionary.getOres(oreIdName); if (res != null) { ItemStack[] res2 = res.toArray(new ItemStack[res.size()]); for (int i = 0; i < res.size(); ++i) { return new ItemStack(res2[i].getItem(), num, res2[i].getItemDamage()); } } return null; } public static ItemStack OreDictName(String oreIdName, int num) { List<ItemStack> res = OreDictionary.getOres(oreIdName); return null; } private static void registerSmelting(Item item, ItemStack stack, float xp) { FurnaceRecipes.instance().addSmelting(item, stack, xp); } } Config: package abused_master.Config; import java.io.File; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; public class Config { private static final String MOD_ORES = "Super Ores"; private static final String MOD_SUPPORT = "Modded Ores"; private static final String MOD_GENERATION = "Mod Generation"; public static String configpath; public static Configuration config; public static boolean SuperDiamondOre; public static boolean SuperGoldOre; public static boolean SuperIronOre; public static boolean SuperLapisOre; public static boolean SuperRedstoneOre; public static boolean SuperCoalOre; public static int SuperDiamondRate; public static int SuperGoldRate; public static int SuperIronRate; public static int SuperLapisRate; public static int SuperCoalRate; public static int SuperRedstoneRate; //Mod Support: public static boolean SuperCopperOre; public static boolean SuperLeadOre; public static boolean SuperTinOre; public static boolean SuperSilverOre; public static boolean SuperSteelOre; public static boolean SuperUraniumOre; public static boolean SuperOsmiumOre; public static boolean SuperAluminumOre; public static boolean SuperNickelOre; public static int SuperCopperRate; public static int SuperLeadRate; public static int SuperTinRate; public static int SuperSilverRate; public static int SuperSteelRate; public static int SuperUraniumRate; public static int SuperOsmiumRate; public static int SuperAluminumRate; public static int SuperNickelRate; public static boolean ZincOre; public static boolean MercuryOre; public static boolean PlatinumOre; public static boolean CadmiumOre; public static boolean ChromiumOre; public static boolean MaganeseOre; public static boolean NichromeOre; public static boolean PlutoniumOre; public static boolean RutileOre; public static boolean TantalumOre; public static boolean TitaniumOre; public static boolean TungstenOre; public static boolean ZirconiumOre; public static boolean RubyOre; public static boolean SapphireOre; public static boolean PyriteOre; public static boolean CinnabarOre; public static boolean SphaleriteOre; public static boolean SodaliteOre; public static boolean PeridotOre; public static boolean AnglesiteOre; public static boolean BenitoiteOre; public static boolean YelloriteOre; public static int ZincRate; public static int MercuryRate; public static int PlatinumRate; public static int CadmiumRate; public static int ChromiumRate; public static int MaganeseRate; public static int NichromeRate; public static int PlutoniumRate; public static int RutileRate; public static int TantalumRate; public static int TitaniumRate; public static int TungstenRate; public static int ZirconiumRate; public static int RubyRate; public static int SapphireRate; public static int PyriteRate; public static int CinnabarRate; public static int SphaleriteRate; public static int SodaliteRate; public static int PeridotRate; //public static int AnglesiteRate; //public static int BenitoiteRate; //public static int YelloriteRate; public static void init(FMLPreInitializationEvent event) { configpath = event.getModConfigurationDirectory().getAbsolutePath() + File.separator; config = new Configuration(new File(configpath + "SuperOres.cfg")); try { config.load(); Config.configure(config); } catch (Exception e1) { System.out.println("Error Loading Config File: SuperOres.cfg"); } finally { if (config.hasChanged()) { config.save(); } } } public static void configure(Configuration config) { config.addCustomCategoryComment(MOD_ORES, "Super Ores Mod Ores"); SuperDiamondOre = config.getBoolean("SuperDiamondOre", MOD_ORES, true, "Set to false if you want Super Diamond Ore Disabled"); SuperGoldOre = config.getBoolean("SuperGoldOre", MOD_ORES, true, "Set to false if you want Super Gold Ore Disabled"); SuperIronOre = config.getBoolean("SuperIronOre", MOD_ORES, true, "Set to false if you want Super Iron Ore Disabled"); SuperRedstoneOre = config.getBoolean("SuperRedstoneOre", MOD_ORES, true, "Set to false if you want Super Redstone Ore Disabled"); SuperCoalOre = config.getBoolean("SuperCoalOre", MOD_ORES, true, "Set to false if you want Super Coal Ore Disabled"); SuperLapisOre = config.getBoolean("SuperLapisOre", MOD_ORES, true, "Set to false if you want Super Lapis Ore Disabled"); //Mod Support if (Loader.isModLoaded("IC2") || Loader.isModLoaded("immersiveengineering") || Loader.isModLoaded("forestry") || Loader.isModLoaded("Mekanism")) { config.addCustomCategoryComment(MOD_SUPPORT, "Mod Support"); } if(Loader.isModLoaded("immersiveengineering") || Loader.isModLoaded("IC2")) { SuperSilverOre = config.getBoolean("SuperSilverOre", MOD_SUPPORT, true, "Set to false if you want Super Silver Ore Disabled"); SuperLeadOre = config.getBoolean("SuperLeadOre", MOD_SUPPORT, true, "Set to false if you want Super Lead Ore Disabled"); SuperUraniumOre = config.getBoolean("SuperUraniumOre", MOD_SUPPORT, true, "Set to false if you want Super Uranium Ore Disabled"); SuperSteelOre = config.getBoolean("SuperSteelOre", MOD_SUPPORT, true, "Set to false if you want Super Steel Ore Disabled"); } if (Loader.isModLoaded("immersiveengineering") || Loader.isModLoaded("IC2") || Loader.isModLoaded("forestry") || Loader.isModLoaded("Mekanism")) { SuperCopperOre = config.getBoolean("SuperCopperOre", MOD_SUPPORT, true, "Set to false if you want Super Copper Ore Disabled"); SuperTinOre = config.getBoolean("SuperTinOre", MOD_SUPPORT, true, "Set to false if you want Super Tin Ore Disabled"); } //if (Loader.isModLoaded("Mekanism")) { //SuperOsmiumOre = config.getBoolean("SuperOsmiumOre", MOD_SUPPORT, true, "Set to false if you want Super Osmium Ore Disabled"); //} if (Loader.isModLoaded("immersiveengineering")) { SuperAluminumOre = config.getBoolean("SuperAluminumOre", MOD_SUPPORT, true, "Set to false if you want Super Aluminum Ore Disabled"); SuperNickelOre = config.getBoolean("SuperNickelOre", MOD_SUPPORT, true, "Set to false if you want Super Nickel Ore Disabled"); } if (Loader.isModLoaded("bigreactors")) { AnglesiteOre = config.getBoolean("AnglesiteOre", MOD_SUPPORT, true, "Set to false to disable Super Anglesite Ore"); BenitoiteOre = config.getBoolean("BenitoiteOre", MOD_SUPPORT, true, "Set to false to disable Super BenitoiteOre Ore"); YelloriteOre = config.getBoolean("YelloriteOre", MOD_SUPPORT, true, "Set to false to disable Super Yellorite Ore"); } if (Loader.isModLoaded("techreborn")) { RubyOre = config.getBoolean("RubyOre", MOD_SUPPORT, true, "Set to false to disable Super Ruby Ore"); SapphireOre = config.getBoolean("SapphireOre", MOD_SUPPORT, true, "Set to false to disable Super Sapphire Ore"); PyriteOre = config.getBoolean("PyriteOre", MOD_SUPPORT, true, "Set to false to disable Super Pyrite Ore"); CinnabarOre = config.getBoolean("CinnabarOre", MOD_SUPPORT, true, "Set to false to disable Super Chromium Ore"); SphaleriteOre = config.getBoolean("SphaleriteOre", MOD_SUPPORT, true, "Set to false to disable Super Sphalerite Ore"); SodaliteOre = config.getBoolean("Sodalite", MOD_SUPPORT, true, "Set to false to disable Super Sodalite Ore"); PeridotOre = config.getBoolean("PeridotOre", MOD_SUPPORT, true, "Set to false to disable Super Peridot Ore"); TungstenOre = config.getBoolean("TungstenOre", MOD_SUPPORT, true, "Set to false to disable Super Tungsten Ore"); ZincOre = config.getBoolean("ZincOre", MOD_SUPPORT, true, "Set to false to disable Super Zinc Ore"); MercuryOre = config.getBoolean("MercuryOre", MOD_SUPPORT, true, "Set to false to disable Super Mercury Ore"); PlatinumOre = config.getBoolean("PlatinumOre", MOD_SUPPORT, true, "Set to false to disable Super Platinum Ore"); CadmiumOre = config.getBoolean("CadmiumOre", MOD_SUPPORT, true, "Set to false to disable Super Cadmium Ore"); ChromiumOre = config.getBoolean("ChromiumOre", MOD_SUPPORT, true, "Set to false to disable Super Chromium Ore"); MaganeseOre = config.getBoolean("MaganeseOre", MOD_SUPPORT, true, "Set to false to disable Super Maganese Ore"); NichromeOre = config.getBoolean("NichromeOre", MOD_SUPPORT, true, "Set to false to disable Super Nichrome Ore"); PlutoniumOre = config.getBoolean("PlutoniumOre", MOD_SUPPORT, true, "Set to false to disable Super Plutonium Ore"); RutileOre = config.getBoolean("RutileOre", MOD_SUPPORT, true, "Set to false to disable Super Rutile Ore"); TantalumOre = config.getBoolean("TantalumOre", MOD_SUPPORT, true, "Set to false to disable Super Tantalum Ore"); TitaniumOre = config.getBoolean("TitaniumOre", MOD_SUPPORT, true, "Set to false to disable Super Titanium Ore"); ZirconiumOre = config.getBoolean("ZirconiumOre", MOD_SUPPORT, true, "Set to false to disable Super Zirconium Ore"); } config.addCustomCategoryComment(MOD_GENERATION, "Mod Generation"); SuperDiamondRate = config.getInt("SuperDiamondRate", MOD_GENERATION, 20, 0, 100, "Set the spawn rate for Super Diamond Ore (DO NOT GO OVER 100) (ignore if ore is disabled)"); SuperGoldRate = config.getInt("SuperGoldRate", MOD_GENERATION, 20, 0, 100, "Set the spawn rate for Super Gold Ore (DO NOT GO OVER 100) (ignore if ore is disabled)"); SuperIronRate = config.getInt("SuperIronRate", MOD_GENERATION, 20, 0, 100, "Set the spawn rate for Super Iron Ore (DO NOT GO OVER 100) (ignore if ore is disabled)"); SuperCoalRate = config.getInt("SuperCoalRate", MOD_GENERATION, 20, 0, 100, "Set the spawn rate for Super Coal Ore (DO NOT GO OVER 100) (ignore if ore is disabled)"); SuperLapisRate = config.getInt("SuperLapisRate", MOD_GENERATION, 20, 0, 100, "Set the spawn rate for Super Lapis Ore (DO NOT GO OVER 100) (ignore if ore is disabled)"); SuperRedstoneRate = config.getInt("SuperRedstoneRate", MOD_GENERATION, 20, 0, 100, "Set the spawn rate for Super Redstone Ore (DO NOT GO OVER 100) (ignore if ore is disabled)"); if(Loader.isModLoaded("immersiveengineering") || Loader.isModLoaded("IC2")) { SuperSilverRate = config.getInt("SuperSilverRate", MOD_GENERATION, 10, 0, 100, "Set the spawn rate for Super Silver Ore (DO NOT GO OVER 100) (ignore if ore is disabled)"); SuperLeadRate = config.getInt("SuperLeadRate", MOD_GENERATION, 10, 0, 100, "Set the spawn rate for Super Lead Ore (DO NOT GO OVER 100) (ignore if ore is disabled)"); SuperUraniumRate = config.getInt("SuperUraniumRate", MOD_GENERATION, 10, 0, 100, "Set the spawn rate for Super Uranium Ore (DO NOT GO OVER 100) (ignore if ore is disabled)"); SuperSteelRate = config.getInt("SuperSteelRate", MOD_GENERATION, 10, 0, 100, "Set the spawn rate for Super Steel Ore (DO NOT GO OVER 100) (ignore if ore is disabled)"); } if(Loader.isModLoaded("immersiveengineering") || Loader.isModLoaded("IC2") || Loader.isModLoaded("forestry") || Loader.isModLoaded("Mekanism")) { SuperCopperRate = config.getInt("SuperCopperRate", MOD_GENERATION, 10, 0, 100, "Set the spawn rate for Super Silver Ore (DO NOT GO OVER 100) (ignore if ore is disabled)"); SuperTinRate = config.getInt("SuperTinRate", MOD_GENERATION, 10, 0, 100, "Set the spawn rate for Super Tin Ore (DO NOT GO OVER 100) (ignore if ore is disabled)"); } //if (Loader.isModLoaded("Mekanism")) { //SuperOsmiumRate = config.getInt("SuperOsmiumRate", MOD_GENERATION, 10, 0, 100, "Set the spawn rate for Super Osmium Ore (DO NOT GO OVER 100) (ignore if ore is disabled)"); //} if (Loader.isModLoaded("immersiveengineering")) { SuperAluminumRate = config.getInt("SuperAluminumRate", MOD_GENERATION, 10, 0, 100, "Set the spawn rate for Super Aluminum Ore (DO NOT GO OVER 100) (ignore if ore is disabled)"); SuperNickelRate = config.getInt("SuperNickelRate", MOD_GENERATION, 10, 0, 100, "Set the spawn rate for Super Nickel Ore (DO NOT GO OVER 100) (ignore if ore is disabled)"); } /** if (Loader.isModLoaded("bigreactors")) { AnglesiteRate = config.getInt("AnglesiteRate", MOD_GENERATION, true, "Set to false to disable Super Anglesite Rate"); BenitoiteRate = config.getInt("BenitoiteRate", MOD_GENERATION, true, "Set to false to disable Super BenitoiteRate Rate"); YelloriteRate = config.getInt("YelloriteRate", MOD_GENERATION, true, "Set to false to disable Super Yellorite Rate"); } */ if (Loader.isModLoaded("techreborn")) { RubyRate = config.getInt("RubyRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Ruby Ore (DO NOT GO OVER 100) (ignore if ore is disabled"); SapphireRate = config.getInt("SapphireRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Sapphire Ore (DO NOT GO OVER 100) (ignore if ore is disabled"); PyriteRate = config.getInt("PyriteRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Pyrite Ore (DO NOT GO OVER 100) (ignore if ore is disabled"); CinnabarRate = config.getInt("CinnabarRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Cinnabar Ore (DO NOT GO OVER 100) (ignore if ore is disabled"); SphaleriteRate = config.getInt("SphaleriteRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Sphalerite Ore (DO NOT GO OVER 100) (ignore if ore is disabled"); SodaliteRate = config.getInt("SodaliteRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Sodalite Ore (DO NOT GO OVER 100) (ignore if ore is disabled"); PeridotRate = config.getInt("PeridotRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Peridot Ore (DO NOT GO OVER 100) (ignore if ore is disabled"); TungstenRate = config.getInt("TungstenRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Tungsten Ore (DO NOT GO OVER 100) (ignore if ore is disabled"); ZincRate = config.getInt("ZincRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Zinc Ore (DO NOT GO OVER 100) (ignore if Ore is disabled"); MercuryRate = config.getInt("MercuryRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Mercury Ore (DO NOT GO OVER 100) (ignore if Ore is disabled"); PlatinumRate = config.getInt("PlatinumRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Platinum Ore (DO NOT GO OVER 100) (ignore if Ore is disabled"); CadmiumRate = config.getInt("CadmiumRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Cadmium Ore (DO NOT GO OVER 100) (ignore if Ore is disabled"); ChromiumRate = config.getInt("ChromiumRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Chromium Ore (DO NOT GO OVER 100) (ignore if Ore is disabled"); MaganeseRate = config.getInt("MaganeseRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Maganese Ore (DO NOT GO OVER 100) (ignore if Ore is disabled"); NichromeRate = config.getInt("NichromeRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Nichrome Ore (DO NOT GO OVER 100) (ignore if Ore is disabled"); PlutoniumRate = config.getInt("PlutoniumRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Plutonium Ore (DO NOT GO OVER 100) (ignore if Ore is disabled"); RutileRate = config.getInt("RutileRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Rutile Ore (DO NOT GO OVER 100) (ignore if Ore is disabled"); TantalumRate = config.getInt("TantalumRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Tantalum Ore (DO NOT GO OVER 100) (ignore if Ore is disabled"); TitaniumRate = config.getInt("TitaniumRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Titanium Ore (DO NOT GO OVER 100) (ignore if Ore is disabled"); ZirconiumRate = config.getInt("ZirconiumRate", MOD_GENERATION, 15, 0, 100, "Set the spawn rate for Super Zirconium Ore (DO NOT GO OVER 100) (ignore if Ore is disabled"); } } } WorldGen: package abused_master.worldgen; import java.util.Random; import abused_master.Config.Config; import abused_master.SuperOres.ModBlocks; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkGenerator; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.fml.common.IWorldGenerator; import net.minecraftforge.fml.common.Loader; import net.minecraftforge.oredict.OreDictionary; public class SuperOresGeneration implements IWorldGenerator { private WorldGenerator BlockSuperCoal; private WorldGenerator BlockSuperDiamond; private WorldGenerator BlockSuperGold; private WorldGenerator BlockSuperIron; private WorldGenerator BlockSuperLapis; private WorldGenerator BlockSuperRedstone; private WorldGenerator CopperOre; private WorldGenerator SteelOre; private WorldGenerator TinOre; private WorldGenerator LeadOre; private WorldGenerator NickelOre; private WorldGenerator OsmiumOre; private WorldGenerator AluminumOre; private WorldGenerator UraniumOre; private WorldGenerator SilverOre; private WorldGenerator ZincOre; private WorldGenerator MercuryOre; private WorldGenerator PlatinumOre; private WorldGenerator CadmiumOre; private WorldGenerator ChromiumOre; private WorldGenerator MaganeseOre; private WorldGenerator NichromeOre; private WorldGenerator PlutoniumOre; private WorldGenerator RutileOre; private WorldGenerator TantalumOre; private WorldGenerator TitaniumOre; private WorldGenerator TungstenOre; private WorldGenerator ZirconiumOre; private WorldGenerator RubyOre; private WorldGenerator SapphireOre; private WorldGenerator PyriteOre; private WorldGenerator CinnabarOre; private WorldGenerator SphaleriteOre; private WorldGenerator SodaliteOre; private WorldGenerator PeridotOre; public SuperOresGeneration() { if(Config.SuperCoalOre) { this.BlockSuperCoal = new WorldGenMinable(ModBlocks.blockSuperCoal.getDefaultState(), 7); } if(Config.SuperDiamondOre) { this.BlockSuperDiamond = new WorldGenMinable(ModBlocks.blockSuperDiamond.getDefaultState(), 4); } if(Config.SuperGoldOre) { this.BlockSuperGold = new WorldGenMinable(ModBlocks.blockSuperGold.getDefaultState(), 5); } if(Config.SuperIronOre) { this.BlockSuperIron = new WorldGenMinable(ModBlocks.blockSuperIron.getDefaultState(), 6); } if(Config.SuperLapisOre) { this.BlockSuperLapis = new WorldGenMinable(ModBlocks.blockSuperLapis.getDefaultState(), 6); } if(Config.SuperRedstoneOre) { this.BlockSuperRedstone = new WorldGenMinable(ModBlocks.blockSuperRedstone.getDefaultState(), 6); } //if (Loader.isModLoaded("Mekanism")) { //if (Config.SuperOsmiumOre) { //this.OsmiumOre = new WorldGenMinable(ModBlocks.SuperOsmiumOre.getDefaultState(), 6); //} //} if (Loader.isModLoaded("immersiveengineering")) { if (Config.SuperNickelOre) { this.NickelOre = new WorldGenMinable(ModBlocks.SuperNickelOre.getDefaultState(), 6); } if (Config.SuperAluminumOre) { this.AluminumOre = new WorldGenMinable(ModBlocks.SuperAluminumOre.getDefaultState(), 6); } } if(Loader.isModLoaded("immersiveengineering") || Loader.isModLoaded("IC2") || Loader.isModLoaded("forestry") || Loader.isModLoaded("Mekanism")) { if(Config.SuperCopperOre) { this.CopperOre = new WorldGenMinable(ModBlocks.SuperCopperOre.getDefaultState(), 6); } if (Config.SuperTinOre) { this.TinOre = new WorldGenMinable(ModBlocks.SuperTinOre.getDefaultState(), 6); } } if(Loader.isModLoaded("immersiveengineering") || Loader.isModLoaded("IC2")) { if (Config.SuperLeadOre) { this.LeadOre = new WorldGenMinable(ModBlocks.SuperLeadOre.getDefaultState(), 6); } if (Config.SuperSilverOre) { this.SilverOre = new WorldGenMinable(ModBlocks.SuperSilverOre.getDefaultState(), 6); } if (Config.SuperSteelOre) { this.SteelOre = new WorldGenMinable(ModBlocks.SuperSteelOre.getDefaultState(), 6); } if (Config.SuperUraniumOre) { this.UraniumOre = new WorldGenMinable(ModBlocks.SuperUraniumOre.getDefaultState(), 6); } } if (Loader.isModLoaded("techreborn")) { if(Config.RubyOre) { this.RubyOre = new WorldGenMinable(ModBlocks.RubyOre.getDefaultState(), 6); } if(Config.SapphireOre) { this.SapphireOre = new WorldGenMinable(ModBlocks.SapphireOre.getDefaultState(), 6); } if(Config.CinnabarOre) { this.CinnabarOre = new WorldGenMinable(ModBlocks.CinnabarOre.getDefaultState(), 6); } if(Config.PyriteOre) { this.PyriteOre = new WorldGenMinable(ModBlocks.PyriteOre.getDefaultState(), 6); } if(Config.SphaleriteOre) { this.SphaleriteOre = new WorldGenMinable(ModBlocks.SphaleriteOre.getDefaultState(), 6); } if(Config.SodaliteOre) { this.SodaliteOre = new WorldGenMinable(ModBlocks.SodaliteOre.getDefaultState(), 6); } if(Config.PeridotOre) { this.PeridotOre = new WorldGenMinable(ModBlocks.PeridotOre.getDefaultState(), 6); } if(Config.TungstenOre) { this.TungstenOre = new WorldGenMinable(ModBlocks.TungstenOre.getDefaultState(), 6); } } } private void runGenerator(WorldGenerator generator, World world, Random rand, int chunk_X, int chunk_Z, int chancesToSpawn, int minHeight, int maxHeight) { if (minHeight < 0 || maxHeight > 256 || minHeight > maxHeight) throw new IllegalArgumentException("Illegal Height Arguments for WorldGenerator"); int heightDiff = maxHeight - minHeight + 1; for (int i = 0; i < chancesToSpawn; i ++) { int x = chunk_X * 16 + rand.nextInt(16); int y = minHeight + rand.nextInt(heightDiff); int z = chunk_Z * 16 + rand.nextInt(16); generator.generate(world, rand, new BlockPos(x, y, z)); } } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { switch (world.provider.getDimension()) { case 0: //Overworld if(Config.SuperCoalOre) { this.runGenerator(this.BlockSuperCoal, world, random, chunkX, chunkZ, Config.SuperCoalRate, 0, 64); } if(Config.SuperDiamondOre) { this.runGenerator(this.BlockSuperDiamond, world, random, chunkX, chunkZ, Config.SuperDiamondRate, 0, 16); } if(Config.SuperGoldOre) { this.runGenerator(this.BlockSuperGold, world, random, chunkX, chunkZ, Config.SuperGoldRate, 0, 32); } if(Config.SuperIronOre) { this.runGenerator(this.BlockSuperIron, world, random, chunkX, chunkZ, Config.SuperIronRate, 0, 64); } if(Config.SuperLapisOre) { this.runGenerator(this.BlockSuperLapis, world, random, chunkX, chunkZ, Config.SuperLapisRate, 0, 32); } if(Config.SuperRedstoneOre) { this.runGenerator(this.BlockSuperRedstone, world, random, chunkX, chunkZ, Config.SuperRedstoneRate, 0, 32); } /** * Modded Gen */ //if (Loader.isModLoaded("Mekanism")) { //if (Config.SuperOsmiumOre) { //this.runGenerator(this.OsmiumOre, world, random, chunkX, chunkZ, Config.SuperOsmiumRate, 0, 36); //} //} if (Loader.isModLoaded("immersiveengineering")) { if (Config.SuperNickelOre) { this.runGenerator(this.NickelOre, world, random, chunkX, chunkZ, Config.SuperNickelRate, 0, 54); } if (Config.SuperAluminumOre) { this.runGenerator(this.AluminumOre, world, random, chunkX, chunkZ, Config.SuperAluminumRate, 0, 54); } } if(Loader.isModLoaded("immersiveengineering") || Loader.isModLoaded("IC2") || Loader.isModLoaded("forestry") || Loader.isModLoaded("Mekanism")) { if(Config.SuperCopperOre) { this.runGenerator(this.CopperOre, world, random, chunkX, chunkZ, Config.SuperCopperRate, 0, 54); } if (Config.SuperTinOre) { this.runGenerator(this.TinOre, world, random, chunkX, chunkZ, Config.SuperTinRate, 0, 54); } } if(Loader.isModLoaded("immersiveengineering") || Loader.isModLoaded("IC2")) { if (Config.SuperLeadOre) { this.runGenerator(this.LeadOre, world, random, chunkX, chunkZ, Config.SuperLeadRate, 0, 43); } if (Config.SuperSilverOre) { this.runGenerator(this.SilverOre, world, random, chunkX, chunkZ, Config.SuperSilverRate, 0, 35); } if (Config.SuperSteelOre) { this.runGenerator(this.SteelOre, world, random, chunkX, chunkZ, Config.SuperSteelRate, 0, 24); } if (Config.SuperUraniumOre) { this.runGenerator(this.UraniumOre, world, random, chunkX, chunkZ, Config.SuperUraniumRate, 0, 54); } } if (Loader.isModLoaded("techreborn")) { if(Config.RubyOre) { this.runGenerator(this.RubyOre, world, random, chunkX, chunkZ, Config.RubyRate, 0, 54); } if(Config.SapphireOre) { this.runGenerator(this.UraniumOre, world, random, chunkX, chunkZ, Config.SapphireRate, 0, 54); } if(Config.CinnabarOre) { this.runGenerator(this.UraniumOre, world, random, chunkX, chunkZ, Config.CinnabarRate, 0, 54); if(Config.PyriteOre) { this.runGenerator(this.UraniumOre, world, random, chunkX, chunkZ, Config.PyriteRate, 0, 54); } if(Config.SphaleriteOre) { this.runGenerator(this.UraniumOre, world, random, chunkX, chunkZ, Config.SphaleriteRate, 0, 54); } if(Config.SodaliteOre) { this.runGenerator(this.UraniumOre, world, random, chunkX, chunkZ, Config.SodaliteRate, 0, 54); } if(Config.PeridotOre) { this.runGenerator(this.UraniumOre, world, random, chunkX, chunkZ, Config.PeridotRate, 0, 54); } if(Config.TungstenOre) { this.runGenerator(this.UraniumOre, world, random, chunkX, chunkZ, Config.TungstenRate, 0, 54); } } } break; case -1: //Nether break; case 1: //End break; } } } Console Log: http://pastebin.com/C2HmwZih
  10. Thank you didnt know that was even the cause
  11. Hello Everyone, so today I was working on a new mod of mine, creating a new GUI, I added the slots, as well as the inventory slots, registered my GUI on the server and client, but for some reason whenever I have an item in my inventory and I open the GUI, i'm not able to move it around, as soon as I click it, it hops back right into that slot, and I have not been able to figure out a fix for this. Yes I have registered my TE Yes i'm registering the Guihandler class in the CommonProxy if you need anything else just ask GUI Code: package abused_master.JATMA.GUI; import abused_master.JATMA.Info; import abused_master.JATMA.TE.PulverizerContainer; import abused_master.JATMA.TE.TilePulverizer; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.ContainerFurnace; import net.minecraft.inventory.IInventory; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.translation.I18n; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class GuiPulverizer extends GuiContainer { private static final ResourceLocation Pulverizer = new ResourceLocation(Info.MODID, "textures/gui/Pulverizer.png"); public static final int WIDTH = 176; public static final int HEIGHT = 166; public GuiPulverizer(TilePulverizer tileEntity, PulverizerContainer container) { super(container); xSize = WIDTH; ySize = HEIGHT; } @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { mc.getTextureManager().bindTexture(Pulverizer); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); } } Pulverizer Code: package abused_master.JATMA.Blocks; import abused_master.JATMA.JATMA; import abused_master.JATMA.GUI.GuiHandler; import abused_master.JATMA.TE.TilePulverizer; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ActionResult; import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class Pulverizer extends BlockContainer { public Pulverizer(Material material) { super(material); this.setCreativeTab(JATMA.JATMA); this.setUnlocalizedName("Pulverizer"); this.setHardness(2.0F); } @Override public EnumBlockRenderType getRenderType(IBlockState state) { return EnumBlockRenderType.MODEL; } @Override public TileEntity createNewTileEntity(World worldIn, int meta) { return new TilePulverizer(); } @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (world.isRemote) { player.openGui(JATMA.instance, 0, world, pos.getX(), pos.getY(), pos.getZ()); } return true; } } Container Code: package abused_master.JATMA.TE; import javax.annotation.Nullable; import abused_master.JATMA.GUI.RemoveOnlySlot; import abused_master.JATMA.GUI.SlotValidated; import abused_master.JATMA.GUI.SlotValidator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.SlotItemHandler; public class PulverizerContainer extends Container implements SlotValidator { TilePulverizer TP; public PulverizerContainer(InventoryPlayer inventory, TileEntity tile) { super(); TP = (TilePulverizer) tile; addSlotToContainer(new SlotValidated(this, TP, 0, 56, 26)); addSlotToContainer(new RemoveOnlySlot(TP, 1, 116, 26)); for (int y = 0; y < 3; ++y) { for (int x = 0; x < 9; ++x) { this.addSlotToContainer(new Slot(inventory, x + y * 9 + 9, 8 + x * 18, 84 + y * 18)); } } for (int x = 0; x < 9; ++x) { this.addSlotToContainer(new Slot(inventory, x, 8 + x * 18, 142)); } } @Override public boolean isItemValid(ItemStack stack) { return false; } @Override public boolean canInteractWith(EntityPlayer playerIn) { return TP.canInteractWith(playerIn); } @Override public ItemStack transferStackInSlot(EntityPlayer entityPlayer, int slot) { Slot slotObject = (Slot) inventorySlots.get(slot); if(slotObject != null && slotObject.getHasStack()) { ItemStack stackInSlot = slotObject.getStack(); ItemStack stack = stackInSlot.copy(); if(slot <= 1) { if(!mergeItemStack(stackInSlot, 2, inventorySlots.size(), true)) return null; } else { return null; } if(stackInSlot.stackSize == 0) slotObject.putStack(null); else slotObject.onSlotChanged(); return stack; } return null; } } TE Code: package abused_master.JATMA.TE; import javax.annotation.Nullable; import cofh.api.energy.EnergyStorage; import cofh.api.energy.TileEnergyHandler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ItemStackHelper; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.ItemStackHandler; public class TilePulverizer extends TileEnergyHandler implements IInventory { protected EnergyStorage storage = new EnergyStorage(50000); public static final int SIZE = 9; @Override public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); storage.readFromNBT(nbt); if (nbt.hasKey("items")) { itemStackHandler.deserializeNBT((NBTTagCompound) nbt.getTag("items")); } } @Override public NBTTagCompound writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); nbt.setTag("items", itemStackHandler.serializeNBT()); return storage.writeToNBT(nbt); } /* IEnergyConnection */ @Override public boolean canConnectEnergy(EnumFacing from) { return true; } /* IEnergyReceiver */ @Override public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate) { return storage.receiveEnergy(maxReceive, simulate); } /* IEnergyProvider */ @Override public int extractEnergy(EnumFacing from, int maxExtract, boolean simulate) { return 0; //return storage.extractEnergy(maxExtract, simulate); } /* IEnergyHandler */ @Override public int getEnergyStored(EnumFacing from) { return storage.getEnergyStored(); } @Override public int getMaxEnergyStored(EnumFacing from) { return storage.getMaxEnergyStored(); } private ItemStackHandler itemStackHandler = new ItemStackHandler(SIZE) { @Override protected void onContentsChanged(int slot) { // We need to tell the tile entity that something has changed so // that the chest contents is persisted TilePulverizer.this.markDirty(); } }; public boolean canInteractWith(EntityPlayer playerIn) { // If we are too far away from this tile entity you cannot use it return !isInvalid() && playerIn.getDistanceSq(pos.add(0.5D, 0.5D, 0.5D)) <= 64D; } @Override public boolean hasCapability(Capability<?> capability, EnumFacing facing) { if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { return true; } return super.hasCapability(capability, facing); } @Override public <T> T getCapability(Capability<T> capability, EnumFacing facing) { if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { return (T) itemStackHandler; } return super.getCapability(capability, facing); } @Override public String getName() { // TODO Auto-generated method stub return null; } @Override public boolean hasCustomName() { // TODO Auto-generated method stub return false; } @Override public int getSizeInventory() { // TODO Auto-generated method stub return 0; } @Override public ItemStack getStackInSlot(int index) { // TODO Auto-generated method stub return null; } @Override public ItemStack decrStackSize(int index, int count) { // TODO Auto-generated method stub return null; } @Override public ItemStack removeStackFromSlot(int index) { // TODO Auto-generated method stub return null; } @Override public void setInventorySlotContents(int index, ItemStack stack) { // TODO Auto-generated method stub } @Override public int getInventoryStackLimit() { // TODO Auto-generated method stub return 0; } @Override public boolean isUseableByPlayer(EntityPlayer player) { // TODO Auto-generated method stub return false; } @Override public void openInventory(EntityPlayer player) { // TODO Auto-generated method stub } @Override public void closeInventory(EntityPlayer player) { // TODO Auto-generated method stub } @Override public boolean isItemValidForSlot(int index, ItemStack stack) { // TODO Auto-generated method stub return false; } @Override public int getField(int id) { // TODO Auto-generated method stub return 0; } @Override public void setField(int id, int value) { // TODO Auto-generated method stub } @Override public int getFieldCount() { // TODO Auto-generated method stub return 0; } @Override public void clear() { // TODO Auto-generated method stub } public Object getChargeSlot() { // TODO Auto-generated method stub return null; } } GuiHandler Code: package abused_master.JATMA.GUI; import abused_master.JATMA.TE.PulverizerContainer; import abused_master.JATMA.TE.TilePulverizer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.common.network.IGuiHandler; public class GuiHandler implements IGuiHandler { public static final int GUI_Pulverizer = 0; @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { BlockPos pos = new BlockPos(x, y, z); TileEntity te = world.getTileEntity(pos); if (te instanceof TilePulverizer) { return new PulverizerContainer(player.inventory, (TilePulverizer) te); } return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { BlockPos pos = new BlockPos(x, y, z); TileEntity te = world.getTileEntity(pos); if (te instanceof TilePulverizer) { TilePulverizer containerTileEntity = (TilePulverizer) te; return new GuiPulverizer(containerTileEntity, new PulverizerContainer(player.inventory, containerTileEntity)); } return null; } }
  12. All right then, if i wanted to set it to output power from the Top, and bottom sides, and leave the other sides to input, how would i go about doing that?
  13. This sounds like a terrible idea. Why would you say that? I mean i know myself it isnt gonna work out well and its just a temporary solution for now until i finish mostly everything else then ill go back to it and change it up for players to set their own input/output sides
  14. Well my energy system is going to push and pull depending on the setting of the pipe/block, and how would i go about accessing other TE's to transfer the energy
  15. If packets are not needed, what is, i have looked at other mods codes such as EnderIO and RFTools, and i cant seem to find how they are making the energy transfer work, unless i am missing something
  16. I have seemed to solve the problem with the storing energy, the only problem left is the transferring of energy, would i have to fix this with packets? if so do you know of any good up to date tutorials on packets?
  17. With an item selected in my inventory, the chat message only appears once. With no item in the inventory slot, it appears twice as if pinging the logical server twice for some reason. When I added in another conditional to check for a specific item, when it wasn't that item it would return a null pointer. Not one severe enough to crash the client, but null pointers are never a good thing.
  18. Well when I tried it using: if(!world.isRemote) { It only pinged server side only in chat when the item in my inventory slot wasn't empty. Otherwise, it pinged twice.
  19. I have managed to make the chat message only show on the logical server side I think. By utilising: @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if(world.isRemote) { TileEntity te = world.getTileEntity(pos); TileEnergyBankT1 ebt1 = (TileEnergyBankT1) te; player.addChatMessage(new TextComponentString("Energy Stored: " + ebt1.getEnergyStored(side) + "/" + ebt1.getMaxEnergyStored(side) + " RF")); return true; } return false; } } I believe it is now only sending the message server side. If that is the case, it returns 0/500000RF every time I click which confirms my suspicions that it wasn't actually storing the energy and therefore explains why it can not be extracted. Although that being said, I do not understand how the logical client component can be charged by the EnderIO conduits yet not drained by them client side...
  20. There is no need to have any packets here at all, the client does not need to know. Simply add a chat message serverside. I feel really stupid that i forgot to register the TE anyways do I call it server side with @SideOnly or is there a better way?
  21. Sorry, a what? How does that have anything to do with NBT? What do you mean by "write to the server"? That depends. Does the client need to always know the value? Only when the player is viewing the GUI? Other conditions? And again, NBT has exactly nothing to do with this. During testing, I left an instance of my TileEnergBankT1 receiving energy and attempting to extract energy in world. After exiting, I tried to re-enter that world just for it to crash my client very time. According to my console log, the TileEntity was missing a mapping which was ultimately causing a ticking world error. Is this due to the fact I'm not handling packets server side? If I seem a bit unsure, I apologise. Back in 1.7.10, the writeToNBT method just worked and some of the new methods escape me due to that. Any explanation as to how to implement the server packets would be appreciated Also currently, the only instance I have of needing to know the energy stored is during a player right click. It shows me the current energy stored, and the maximum it can hold. In that instance; yes. The client needs to read from the TileEntity the energy stored, so to output the information into the chat console. I plan to make most of this GUI free
  22. Well the reason I mention the writing to NBT is because the method seems to cause a ticking world error... not because I thought it was why I couldn't write it to the server. My question was how do I write the packets and store it to NBT for recall.
  23. it isnt hmm, did not know, the reason i was thinking that was because in the block class I read the energy stored and output as a chat componenent. It's been outputting 2 values when i fill it up with energy, one that just says 0/500000 RF and the other one says 500000/500000 RF, hence my reasoning to think it was erroring on client side, it could also be that since it doesnt call on client side then its erroring on writing on server side
  24. I think its best if i rephrase my question, Basically the TileEntity method for writeToNBT isnt working correctly, it writes on the client side but does not on server side, some help with the correct implementation would be greatly appreciated.
  25. Hello everyone, im currently working on a power storage block which im calling EnergyBankT1, im running into a problem where it is able to store power easily with no problems but when i try to transfer it doesn't work, im using EnderIO for power transfer, I have the cables set to extract and all that but the EnergyBank is only storing not transfering, im trying to make it so that all sides can input and output energy EnergyBankT1 public class EnergyBankT1 extends BlockContainer { public EnergyBankT1(Material material, String unlocalizedName) { super(material); this.setHardness(3.0F); this.setUnlocalizedName(unlocalizedName); this.setCreativeTab(EnergyPlus.EnergyPlus); } public EnergyBankT1(String unlocalisedName) { this(Material.IRON, unlocalisedName); } @Override public boolean isOpaqueCube(IBlockState state) { return false; } @Override public EnumBlockRenderType getRenderType(IBlockState state) { return EnumBlockRenderType.MODEL; } public TileEntity createNewTileEntity(World worldIn, int meta) { return new TileEnergyBankT1(); } @Override public boolean hasTileEntity() { return true; } @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { TileEntity te = world.getTileEntity(pos); TileEnergyBankT1 ebt1 = (TileEnergyBankT1)te; player.addChatMessage(new TextComponentString("Energy Stored: " + ebt1.getEnergyStored(side) + "/" + ebt1.getMaxEnergyStored(side) + " RF") ); return true; } } TileEnergyBankT1 public class TileEnergyBankT1 extends TileEntity implements IEnergyProvider, IEnergyReceiver { protected EnergyStorage capacity = new EnergyStorage(500000); private int maxReceive = 5000; private int maxExtract = 5000; public TileEnergyBankT1(int maxReceive, int maxExtract) { this.maxReceive = maxReceive; this.maxExtract = maxExtract; } public TileEnergyBankT1() { } @Override public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); this.readFromNBT(nbt); capacity.readFromNBT(nbt); } @Override public NBTTagCompound writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); this.writeToNBT(nbt); capacity.writeToNBT(nbt); return nbt; } @Override public int getEnergyStored(EnumFacing from) { return capacity.getEnergyStored(); } @Override public int getMaxEnergyStored(EnumFacing from) { return capacity.getMaxEnergyStored(); } @Override public boolean canConnectEnergy(EnumFacing from) { return true; } @Override public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate) { return capacity.receiveEnergy(this.maxReceive, simulate); } @Override public int extractEnergy(EnumFacing from, int maxExtract, boolean simulate) { return capacity.extractEnergy(this.maxExtract, simulate); } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.