diff options
author | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2019-04-09 17:55:01 +0200 |
---|---|---|
committer | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2019-04-09 17:55:01 +0200 |
commit | 9b71ae54da263e6c5d0e808f847f8ba8fe6c891a (patch) | |
tree | 7be3b1218654844980e812a243e3c6c045635800 /src/main | |
parent | 1ed85c72f194d996ad3a1b44c0e74c9597b5326e (diff) | |
download | GT5-Unofficial-9b71ae54da263e6c5d0e808f847f8ba8fe6c891a.tar.gz GT5-Unofficial-9b71ae54da263e6c5d0e808f847f8ba8fe6c891a.tar.bz2 GT5-Unofficial-9b71ae54da263e6c5d0e808f847f8ba8fe6c891a.zip |
fixes
+refractored code,
+restored compability to vanilla ore gen,
+moved GC and Forrestry code to own classes to prevent crashes inDev
+implemented equals and hashcode on NearbySeeds class
+added an information line to the Implosion Compressor tooltip
Diffstat (limited to 'src/main')
9 files changed, 267 insertions, 165 deletions
diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index c4c014a78b..03f4398393 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -5,9 +5,6 @@ import cpw.mods.fml.common.event.*; import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.recipes.ICentrifugeRecipe; -import forestry.api.recipes.ISqueezerRecipe; -import forestry.api.recipes.RecipeManagers; import gregtech.api.GregTech_API; import gregtech.api.enchants.Enchantment_EnderDamage; import gregtech.api.enchants.Enchantment_Radioactivity; @@ -563,36 +560,36 @@ public class GT_Mod implements IGT_Mod { } /* if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.gregtechrecipes, "SolarPanel", true)) { - GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SGS", "CPC", 'C', OrePrefixes.circuit.get(Materials.Basic), 'G', new ItemStack(Blocks.glass_pane, 1), 'P', OrePrefixes.plateAlloy.get(Materials.Carbon), 'S', ItemList.Circuit_Silicon_Wafer}); - GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_8V.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SGS", "CPC","R R", 'C', OrePrefixes.circuit.get(Materials.Advanced), 'G', new ItemStack(Blocks.glass_pane, 1), 'P', OrePrefixes.wireGt04.get(Materials.Graphene), 'S', ItemList.Circuit_Silicon_Wafer2,'R', OrePrefixes.plate.get(Materials.GalliumArsenide)}); - GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SGS", "CPC","R R", 'C', OrePrefixes.circuit.get(Materials.Master), 'G', GT_ModHandler.getIC2Item("reinforcedGlass", 1L), 'P', OrePrefixes.wireGt16.get(Materials.Graphene), 'S', ItemList.Circuit_Silicon_Wafer3,'R', OrePrefixes.plate.get(Materials.IndiumGalliumPhosphide)}); + GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SGS", "CPC", 'C', OrePrefixes.circuit.get(Materials.Basic), 'G', new ItemStack(Blocks.glass_pane, 1), 'P', OrePrefixes.plateAlloy.get(Materials.Carbon), 'S', ItemList.Circuit_Silicon_Wafer}); + GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_8V.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SGS", "CPC","R R", 'C', OrePrefixes.circuit.get(Materials.Advanced), 'G', new ItemStack(Blocks.glass_pane, 1), 'P', OrePrefixes.wireGt04.get(Materials.Graphene), 'S', ItemList.Circuit_Silicon_Wafer2,'R', OrePrefixes.plate.get(Materials.GalliumArsenide)}); + GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_LV.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SGS", "CPC","R R", 'C', OrePrefixes.circuit.get(Materials.Master), 'G', GT_ModHandler.getIC2Item("reinforcedGlass", 1L), 'P', OrePrefixes.wireGt16.get(Materials.Graphene), 'S', ItemList.Circuit_Silicon_Wafer3,'R', OrePrefixes.plate.get(Materials.IndiumGalliumPhosphide)}); } if (GregTech_API.sOPStuff.get(ConfigCategories.Recipes.gregtechrecipes, "SolarPanel8V", false)) { - GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_8V.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSS", "STS", "SSS", 'S', ItemList.Cover_SolarPanel, 'T', OrePrefixes.circuit.get(Materials.Advanced)}); + GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_8V.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSS", "STS", "SSS", 'S', ItemList.Cover_SolarPanel, 'T', OrePrefixes.circuit.get(Materials.Advanced)}); } if (GregTech_API.sOPStuff.get(ConfigCategories.Recipes.gregtechrecipes, "SolarPanelLV", false)) { - GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" S ", "STS", " S ", 'S', ItemList.Cover_SolarPanel_8V, 'T', ItemList.Transformer_LV_ULV}); + GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_LV.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" S ", "STS", " S ", 'S', ItemList.Cover_SolarPanel_8V, 'T', ItemList.Transformer_LV_ULV}); } if (GregTech_API.sOPStuff.get(ConfigCategories.Recipes.gregtechrecipes, "SolarPanelMV", false)) { - GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_MV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" S ", "STS", " S ", 'S', ItemList.Cover_SolarPanel_LV, 'T', ItemList.Transformer_MV_LV}); + GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_MV.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" S ", "STS", " S ", 'S', ItemList.Cover_SolarPanel_LV, 'T', ItemList.Transformer_MV_LV}); } if (GregTech_API.sOPStuff.get(ConfigCategories.Recipes.gregtechrecipes, "SolarPanelHV", false)) { - GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_HV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" S ", "STS", " S ", 'S', ItemList.Cover_SolarPanel_MV, 'T', ItemList.Transformer_HV_MV}); + GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_HV.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" S ", "STS", " S ", 'S', ItemList.Cover_SolarPanel_MV, 'T', ItemList.Transformer_HV_MV}); } if (GregTech_API.sOPStuff.get(ConfigCategories.Recipes.gregtechrecipes, "SolarPanelEV", false)) { - GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_EV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" S ", "STS", " S ", 'S', ItemList.Cover_SolarPanel_HV, 'T', ItemList.Transformer_EV_HV}); + GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_EV.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" S ", "STS", " S ", 'S', ItemList.Cover_SolarPanel_HV, 'T', ItemList.Transformer_EV_HV}); } if (GregTech_API.sOPStuff.get(ConfigCategories.Recipes.gregtechrecipes, "SolarPanelIV", false)) { - GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_IV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" S ", "STS", " S ", 'S', ItemList.Cover_SolarPanel_EV, 'T', ItemList.Transformer_IV_EV}); + GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_IV.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" S ", "STS", " S ", 'S', ItemList.Cover_SolarPanel_EV, 'T', ItemList.Transformer_IV_EV}); } if (GregTech_API.sOPStuff.get(ConfigCategories.Recipes.gregtechrecipes, "SolarPanelLuV", false)) { - GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_LuV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" S ", "STS", " S ", 'S', ItemList.Cover_SolarPanel_IV, 'T', ItemList.Transformer_LuV_IV}); + GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_LuV.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" S ", "STS", " S ", 'S', ItemList.Cover_SolarPanel_IV, 'T', ItemList.Transformer_LuV_IV}); } if (GregTech_API.sOPStuff.get(ConfigCategories.Recipes.gregtechrecipes, "SolarPanelZPM", false)) { - GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_ZPM.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" S ", "STS", " S ", 'S', ItemList.Cover_SolarPanel_LuV, 'T', ItemList.Transformer_ZPM_LuV}); + GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_ZPM.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" S ", "STS", " S ", 'S', ItemList.Cover_SolarPanel_LuV, 'T', ItemList.Transformer_ZPM_LuV}); } if (GregTech_API.sOPStuff.get(ConfigCategories.Recipes.gregtechrecipes, "SolarPanelUV", false)) { - GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_UV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" S ", "STS", " S ", 'S', ItemList.Cover_SolarPanel_ZPM, 'T', ItemList.Transformer_UV_ZPM}); + GT_ModHandler.addCraftingRecipe(ItemList.Cover_SolarPanel_UV.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" S ", "STS", " S ", 'S', ItemList.Cover_SolarPanel_ZPM, 'T', ItemList.Transformer_UV_ZPM}); } */ double outputMultiplier = Math.min(GregTech_API.sOPStuff.get(ConfigCategories.Recipes.gregtechrecipes, "StoneDustOutputMultiplier", 0.6), 1.0); @@ -673,7 +670,8 @@ public class GT_Mod implements IGT_Mod { } } catch (Throwable e) {e.printStackTrace(GT_Log.err);} - new GT_Bees(); + if (Loader.isModLoaded("forestry")) + new GT_Bees(); //Disable Low Grav regardless of config if Cleanroom is disabled. if (!gregtechproxy.mEnableCleanroom){ @@ -752,9 +750,9 @@ public class GT_Mod implements IGT_Mod { Map<IRecipeInput, RecipeOutput> aThermalCentrifugeRecipeList = GT_ModHandler.getThermalCentrifugeRecipeList(); GT_Log.out.println("GT_Mod: Activating OreDictionary Handler, this can take some time, as it scans the whole OreDictionary"); - GT_FML_LOGGER.info("If your Log stops here, you were too impatient. Wait a bit more next time, before killing Minecraft with the Task Manager.", new Object[0]); + GT_FML_LOGGER.info("If your Log stops here, you were too impatient. Wait a bit more next time, before killing Minecraft with the Task Manager."); gregtechproxy.activateOreDictHandler(); - GT_FML_LOGGER.info("Congratulations, you have been waiting long enough. Have a Cake.", new Object[0]); + GT_FML_LOGGER.info("Congratulations, you have been waiting long enough. Have a Cake."); GT_Log.out.println("GT_Mod: List of Lists of Tool Recipes: "+GT_ModHandler.sSingleNonBlockDamagableRecipeList_list.toString()); GT_Log.out.println("GT_Mod: Vanilla Recipe List -> Outputs null or stackSize <=0: " + GT_ModHandler.sVanillaRecipeList_warntOutput.toString()); GT_Log.out.println("GT_Mod: Single Non Block Damagable Recipe List -> Outputs null or stackSize <=0: " + GT_ModHandler.sSingleNonBlockDamagableRecipeList_warntOutput.toString()); @@ -775,12 +773,12 @@ public class GT_Mod implements IGT_Mod { } new GT_CraftingRecipeLoader().run(); if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2forgehammer", true)) { - GT_ModHandler.removeRecipeByOutput(ItemList.IC2_ForgeHammer.getWildcard(1L, new Object[0])); + GT_ModHandler.removeRecipeByOutput(ItemList.IC2_ForgeHammer.getWildcard(1L)); } GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item("machine", 1L)); GT_ModHandler.addCraftingRecipe(GT_ModHandler.getIC2Item("machine", 1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "RwR", "RRR", 'R', OrePrefixes.plate.get(Materials.Iron)}); ItemStack ISdata0 = new ItemStack(Items.potionitem, 1, 0); - ItemStack ILdata0 = ItemList.Bottle_Empty.get(1L, new Object[0]); + ItemStack ILdata0 = ItemList.Bottle_Empty.get(1L); for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { if ((tData.filledContainer.getItem() == Items.potionitem) && (tData.filledContainer.getItemDamage() == 0)) { GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes.addRecipe(true, new ItemStack[]{ILdata0}, new ItemStack[]{ISdata0}, null, new FluidStack[]{Materials.Water.getFluid(250L)}, null, 4, 1, 0); @@ -790,35 +788,12 @@ public class GT_Mod implements IGT_Mod { GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes.addRecipe(true, new ItemStack[]{tData.filledContainer}, new ItemStack[]{GT_Utility.getContainerItem(tData.filledContainer, true)}, null, null, new FluidStack[]{tData.fluid}, tData.fluid.amount / 62, 1, 0); } } - try { - for (ICentrifugeRecipe tRecipe : RecipeManagers.centrifugeManager.recipes()) { - Map<ItemStack, Float> outputs = tRecipe.getAllProducts(); - ItemStack[] tOutputs = new ItemStack[outputs.size()]; - int[] tChances = new int[outputs.size()]; - int i = 0; - for (Map.Entry<ItemStack, Float> entry : outputs.entrySet()) { - tChances[i] = (int) (entry.getValue() * 10000); - tOutputs[i] = entry.getKey().copy(); - i++; - } - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(true, new ItemStack[]{tRecipe.getInput()}, tOutputs, null, tChances, null, null, 128, 5, 0); - } - } catch (Throwable e) { - if (GT_Values.D1) { - e.printStackTrace(GT_Log.err); - } - } - try { - for (ISqueezerRecipe tRecipe : RecipeManagers.squeezerManager.recipes()) { - if ((tRecipe.getResources().length == 1) && (tRecipe.getFluidOutput() != null)) { - GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(true, new ItemStack[]{tRecipe.getResources()[0]}, new ItemStack[]{tRecipe.getRemnants()}, null, new int[]{(int) (tRecipe.getRemnantsChance() * 10000)}, null, new FluidStack[]{tRecipe.getFluidOutput()}, 32, 8, 0); - } - } - } catch (Throwable e) { - if (GT_Values.D1) { - e.printStackTrace(GT_Log.err); - } + + if (Loader.isModLoaded("forestry")) { + GT_Forestry_Compat.transferCentrifugeRecipes(); + GT_Forestry_Compat.transferSqueezerRecipes(); } + String tName = ""; if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + (tName = "blastfurnace"), true)) { GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item(tName, 1L)); @@ -920,68 +895,45 @@ public class GT_Mod implements IGT_Mod { } } catch (Throwable e) {e.printStackTrace(GT_Log.err);} GT_Log.out.println("GT_Mod: Adding Fake Recipes for NEI"); - if (ItemList.FR_Bee_Drone.get(1L, new Object[0]) != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Bee_Drone.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Bee_Drone.getWithName(1L, "Scanned Drone", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); - } - if (ItemList.FR_Bee_Princess.get(1L, new Object[0]) != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Bee_Princess.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Bee_Princess.getWithName(1L, "Scanned Princess", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); - } - if (ItemList.FR_Bee_Queen.get(1L, new Object[0]) != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Bee_Queen.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Bee_Queen.getWithName(1L, "Scanned Queen", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); - } - if (ItemList.FR_Tree_Sapling.get(1L, new Object[0]) != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Tree_Sapling.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Tree_Sapling.getWithName(1L, "Scanned Sapling", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); - } - if (ItemList.FR_Butterfly.get(1L, new Object[0]) != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Butterfly.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Butterfly.getWithName(1L, "Scanned Butterfly", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); - } - if (ItemList.FR_Larvae.get(1L, new Object[0]) != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Larvae.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Larvae.getWithName(1L, "Scanned Larvae", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); - } - if (ItemList.FR_Serum.get(1L, new Object[0]) != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Serum.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Serum.getWithName(1L, "Scanned Serum", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); - } - if (ItemList.FR_Caterpillar.get(1L, new Object[0]) != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Caterpillar.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Caterpillar.getWithName(1L, "Scanned Caterpillar", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); - } - if (ItemList.FR_PollenFertile.get(1L, new Object[0]) != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_PollenFertile.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_PollenFertile.getWithName(1L, "Scanned Pollen", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); - } - if (ItemList.IC2_Crop_Seeds.get(1L, new Object[0]) != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.IC2_Crop_Seeds.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.IC2_Crop_Seeds.getWithName(1L, "Scanned Seeds", new Object[0])}, null, null, null, 160, 8, 0); - } - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{new ItemStack(Items.written_book, 1, 32767)}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Scanned Book Data", new Object[0])}, ItemList.Tool_DataStick.getWithName(1L, "Stick to save it to", new Object[0]), null, null, 128, 30, 0); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{new ItemStack(Items.filled_map, 1, 32767)}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Scanned Map Data", new Object[0])}, ItemList.Tool_DataStick.getWithName(1L, "Stick to save it to", new Object[0]), null, null, 128, 30, 0); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.Tool_DataOrb.getWithName(1L, "Orb to overwrite", new Object[0])}, new ItemStack[]{ItemList.Tool_DataOrb.getWithName(1L, "Copy of the Orb", new Object[0])}, ItemList.Tool_DataOrb.getWithName(0L, "Orb to copy", new Object[0]), null, null, 512, 30, 0); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Stick to overwrite", new Object[0])}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Copy of the Stick", new Object[0])}, ItemList.Tool_DataStick.getWithName(0L, "Stick to copy", new Object[0]), null, null, 128, 30, 0); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Raw Prospection Data", new Object[0])}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Analyzed Prospection Data", new Object[0])}, null, null, null, 1000, 30, 0); - if (Loader.isModLoaded("GalacticraftCore")) - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{GT_ModHandler.getModItem("GalacticraftCore","item.schematic",1).setStackDisplayName("Any Schematic")}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Scanned Schematic", new Object[0])}, ItemList.Tool_DataStick.getWithName(1L, "Stick to save it to", new Object[0]), null, null, 36000, 480, 0); + + if (Loader.isModLoaded("forestry")) + GT_Forestry_Compat.populateFakeNeiRecipes(); + + if (ItemList.IC2_Crop_Seeds.get(1L) != null) { + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.IC2_Crop_Seeds.getWildcard(1L)}, new ItemStack[]{ItemList.IC2_Crop_Seeds.getWithName(1L, "Scanned Seeds")}, null, null, null, 160, 8, 0); + } + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{new ItemStack(Items.written_book, 1, 32767)}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Scanned Book Data")}, ItemList.Tool_DataStick.getWithName(1L, "Stick to save it to"), null, null, 128, 30, 0); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{new ItemStack(Items.filled_map, 1, 32767)}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Scanned Map Data")}, ItemList.Tool_DataStick.getWithName(1L, "Stick to save it to"), null, null, 128, 30, 0); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.Tool_DataOrb.getWithName(1L, "Orb to overwrite")}, new ItemStack[]{ItemList.Tool_DataOrb.getWithName(1L, "Copy of the Orb")}, ItemList.Tool_DataOrb.getWithName(0L, "Orb to copy"), null, null, 512, 30, 0); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Stick to overwrite")}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Copy of the Stick")}, ItemList.Tool_DataStick.getWithName(0L, "Stick to copy"), null, null, 128, 30, 0); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Raw Prospection Data")}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Analyzed Prospection Data")}, null, null, null, 1000, 30, 0); + if (Loader.isModLoaded("GalacticraftCore")) + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{GT_ModHandler.getModItem("GalacticraftCore","item.schematic",1).setStackDisplayName("Any Schematic")}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Scanned Schematic")}, ItemList.Tool_DataStick.getWithName(1L, "Stick to save it to"), null, null, 36000, 480, 0); for (Materials tMaterial : Materials.values()) { if ((tMaterial.mElement != null) && (!tMaterial.mElement.mIsIsotope) && (tMaterial != Materials.Magic) && (tMaterial.getMass() > 0L)) { - ItemStack tOutput = ItemList.Tool_DataOrb.get(1L, new Object[0]); + ItemStack tOutput = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(tOutput, "Elemental-Scan"); Behaviour_DataOrb.setDataName(tOutput, tMaterial.mElement.name()); ItemStack tInput = GT_OreDictUnificator.get(OrePrefixes.dust, tMaterial, 1L); ItemStack[] ISmat0 = new ItemStack[]{tInput}; ItemStack[] ISmat1 = new ItemStack[]{tOutput}; if (tInput != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, ISmat0, ISmat1, ItemList.Tool_DataOrb.get(1L, new Object[0]), null, null, (int) (tMaterial.getMass() * 8192L), 30, 0); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, ISmat0, ISmat1, ItemList.Tool_DataOrb.get(1L), null, null, (int) (tMaterial.getMass() * 8192L), 30, 0); GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, null, ISmat0, ISmat1, new FluidStack[]{Materials.UUMatter.getFluid(tMaterial.getMass())}, null, (int) (tMaterial.getMass() * 512L), 30, 0); } tInput = GT_OreDictUnificator.get(OrePrefixes.cell, tMaterial, 1L); ISmat0 = new ItemStack[]{tInput}; if (tInput != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, ISmat0, ISmat1, ItemList.Tool_DataOrb.get(1L, new Object[0]), null, null, (int) (tMaterial.getMass() * 8192L), 30, 0); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, ISmat0, ISmat1, ItemList.Tool_DataOrb.get(1L), null, null, (int) (tMaterial.getMass() * 8192L), 30, 0); GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, null, ISmat0, ISmat1, new FluidStack[]{Materials.UUMatter.getFluid(tMaterial.getMass())}, null, (int) (tMaterial.getMass() * 512L), 30, 0); } } } if (!GT_MetaTileEntity_Massfabricator.sRequiresUUA) GT_Recipe.GT_Recipe_Map.sMassFabFakeRecipes.addFakeRecipe(false, null, null, null, null, new FluidStack[]{Materials.UUMatter.getFluid(1L)}, GT_MetaTileEntity_Massfabricator.sDurationMultiplier, 256, 0); GT_Recipe.GT_Recipe_Map.sMassFabFakeRecipes.addFakeRecipe(false, null, null, null, new FluidStack[]{Materials.UUAmplifier.getFluid(GT_MetaTileEntity_Massfabricator.sUUAperUUM)}, new FluidStack[]{Materials.UUMatter.getFluid(1L)}, GT_MetaTileEntity_Massfabricator.sDurationMultiplier / GT_MetaTileEntity_Massfabricator.sUUASpeedBonus, 256, 0); - GT_Recipe.GT_Recipe_Map.sRockBreakerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.Display_ITS_FREE.getWithName(0L, "Place Lava on Side", new Object[0])}, new ItemStack[]{new ItemStack(Blocks.cobblestone, 1)}, null, null, null, 16, 30, 0); - GT_Recipe.GT_Recipe_Map.sRockBreakerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.Display_ITS_FREE.getWithName(0L, "Place Lava on Top", new Object[0])}, new ItemStack[]{new ItemStack(Blocks.stone, 1)}, null, null, null, 16, 30, 0); + GT_Recipe.GT_Recipe_Map.sRockBreakerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.Display_ITS_FREE.getWithName(0L, "Place Lava on Side")}, new ItemStack[]{new ItemStack(Blocks.cobblestone, 1)}, null, null, null, 16, 30, 0); + GT_Recipe.GT_Recipe_Map.sRockBreakerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.Display_ITS_FREE.getWithName(0L, "Place Lava on Top")}, new ItemStack[]{new ItemStack(Blocks.stone, 1)}, null, null, null, 16, 30, 0); GT_Recipe.GT_Recipe_Map.sRockBreakerFakeRecipes.addFakeRecipe(false, new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L)}, new ItemStack[]{new ItemStack(Blocks.obsidian, 1)}, null, null, null, 128, 30, 0); if(GregTech_API.mOutputRF||GregTech_API.mInputRF){ @@ -1160,21 +1112,21 @@ public class GT_Mod implements IGT_Mod { } for (ItemStack tOutput : tStacks) { if (gregtechproxy.mRegisteredOres.contains(tOutput)) { - GT_FML_LOGGER.error("GT-ERR-01: @ " + tOutput.getUnlocalizedName() + " " + tOutput.getDisplayName(), new Object[0]); - GT_FML_LOGGER.error("A Recipe used an OreDict Item as Output directly, without copying it before!!! This is a typical CallByReference/CallByValue Error", new Object[0]); - GT_FML_LOGGER.error("Said Item will be renamed to make the invalid Recipe visible, so that you can report it properly.", new Object[0]); - GT_FML_LOGGER.error("Please check all Recipes outputting this Item, and report the Recipes to their Owner.", new Object[0]); - GT_FML_LOGGER.error("The Owner of the ==>RECIPE<==, NOT the Owner of the Item, which has been mentioned above!!!", new Object[0]); - GT_FML_LOGGER.error("And ONLY Recipes which are ==>OUTPUTTING<== the Item, sorry but I don't want failed Bug Reports.", new Object[0]); - GT_FML_LOGGER.error("GregTech just reports this Error to you, so you can report it to the Mod causing the Problem.", new Object[0]); - GT_FML_LOGGER.error("Even though I make that Bug visible, I can not and will not fix that for you, that's for the causing Mod to fix.", new Object[0]); - GT_FML_LOGGER.error("And speaking of failed Reports:", new Object[0]); - GT_FML_LOGGER.error("Both IC2 and GregTech CANNOT be the CAUSE of this Problem, so don't report it to either of them.", new Object[0]); - GT_FML_LOGGER.error("I REPEAT, BOTH, IC2 and GregTech CANNOT be the source of THIS BUG. NO MATTER WHAT.", new Object[0]); - GT_FML_LOGGER.error("Asking in the IC2 Forums, which Mod is causing that, won't help anyone, since it is not possible to determine, which Mod it is.", new Object[0]); - GT_FML_LOGGER.error("If it would be possible, then I would have had added the Mod which is causing it to the Message already. But it is not possible.", new Object[0]); - GT_FML_LOGGER.error("Sorry, but this Error is serious enough to justify this Wall-O-Text and the partially allcapsed Language.", new Object[0]); - GT_FML_LOGGER.error("Also it is a Ban Reason on the IC2-Forums to post this seriously.", new Object[0]); + GT_FML_LOGGER.error("GT-ERR-01: @ " + tOutput.getUnlocalizedName() + " " + tOutput.getDisplayName()); + GT_FML_LOGGER.error("A Recipe used an OreDict Item as Output directly, without copying it before!!! This is a typical CallByReference/CallByValue Error"); + GT_FML_LOGGER.error("Said Item will be renamed to make the invalid Recipe visible, so that you can report it properly."); + GT_FML_LOGGER.error("Please check all Recipes outputting this Item, and report the Recipes to their Owner."); + GT_FML_LOGGER.error("The Owner of the ==>RECIPE<==, NOT the Owner of the Item, which has been mentioned above!!!"); + GT_FML_LOGGER.error("And ONLY Recipes which are ==>OUTPUTTING<== the Item, sorry but I don't want failed Bug Reports."); + GT_FML_LOGGER.error("GregTech just reports this Error to you, so you can report it to the Mod causing the Problem."); + GT_FML_LOGGER.error("Even though I make that Bug visible, I can not and will not fix that for you, that's for the causing Mod to fix."); + GT_FML_LOGGER.error("And speaking of failed Reports:"); + GT_FML_LOGGER.error("Both IC2 and GregTech CANNOT be the CAUSE of this Problem, so don't report it to either of them."); + GT_FML_LOGGER.error("I REPEAT, BOTH, IC2 and GregTech CANNOT be the source of THIS BUG. NO MATTER WHAT."); + GT_FML_LOGGER.error("Asking in the IC2 Forums, which Mod is causing that, won't help anyone, since it is not possible to determine, which Mod it is."); + GT_FML_LOGGER.error("If it would be possible, then I would have had added the Mod which is causing it to the Message already. But it is not possible."); + GT_FML_LOGGER.error("Sorry, but this Error is serious enough to justify this Wall-O-Text and the partially allcapsed Language."); + GT_FML_LOGGER.error("Also it is a Ban Reason on the IC2-Forums to post this seriously."); tOutput.setStackDisplayName("ERROR! PLEASE CHECK YOUR LOG FOR 'GT-ERR-01'!"); } else { GT_OreDictUnificator.setStack(tOutput); @@ -1344,8 +1296,8 @@ public class GT_Mod implements IGT_Mod { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Lithium, 1), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Caesium, 1), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sulfur, 1), - GT_OreDictUnificator.get(ItemList.Block_SSFUEL.get(1, new Object[0])), - GT_OreDictUnificator.get(ItemList.Block_MSSFUEL.get(1, new Object[0])), + GT_OreDictUnificator.get(ItemList.Block_SSFUEL.get(1)), + GT_OreDictUnificator.get(ItemList.Block_MSSFUEL.get(1)), GT_OreDictUnificator.get(OrePrefixes.rod, Materials.Blaze, 1)); if (Loader.isModLoaded("Thaumcraft")) { GT_Recipe.GT_Recipe_Map.sLargeBoilerFakeFuels.addSolidRecipe(GT_ModHandler.getModItem("Thaumcraft", "ItemResource", 1)); diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java index 5d672547d8..267287c430 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java @@ -2,6 +2,7 @@ package gregtech.api.metatileentity.implementations; import cofh.api.energy.IEnergyReceiver;
import com.google.common.collect.Sets;
+import cpw.mods.fml.common.Loader;
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Dyes;
@@ -17,6 +18,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseMetaPipeEntity;
import gregtech.api.metatileentity.MetaPipeEntity;
import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_GC_Compat;
import gregtech.api.util.GT_CoverBehavior;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
@@ -29,12 +31,7 @@ import ic2.api.energy.tile.IEnergySink; import ic2.api.energy.tile.IEnergySource;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.reactor.IReactorChamber;
-import micdoodle8.mods.galacticraft.api.power.EnergySource;
-import micdoodle8.mods.galacticraft.api.power.EnergySource.EnergySourceAdjacent;
-import micdoodle8.mods.galacticraft.api.power.IEnergyHandlerGC;
-import micdoodle8.mods.galacticraft.api.transmission.NetworkType;
-import micdoodle8.mods.galacticraft.api.transmission.tile.IConnector;
-import micdoodle8.mods.galacticraft.core.energy.EnergyConfigHandler;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -242,6 +239,8 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile return rUsedAmperes;
}
+
+
private long insertEnergyInto(TileEntity tTileEntity, byte tSide, long aVoltage, long aAmperage) {
if (aAmperage == 0 || tTileEntity == null) return 0;
@@ -264,26 +263,10 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile return 0;
}
- // GC Compat
- if (GregTech_API.mGalacticraft && tTileEntity instanceof IEnergyHandlerGC) {
- if (!(tTileEntity instanceof IConnector) || ((IConnector)tTileEntity).canConnect(tDirection, NetworkType.POWER)) {
- EnergySource eSource = new EnergySourceAdjacent(tDirection);
-
- float tSizeToReceive = aVoltage * EnergyConfigHandler.IC2_RATIO, tStored = ((IEnergyHandlerGC)tTileEntity).getEnergyStoredGC(eSource);
- if (tSizeToReceive >= tStored || tSizeToReceive <= ((IEnergyHandlerGC)tTileEntity).getMaxEnergyStoredGC(eSource) - tStored) {
- float tReceived = ((IEnergyHandlerGC)tTileEntity).receiveEnergyGC(eSource, tSizeToReceive, false);
- if (tReceived > 0) {
- tSizeToReceive -= tReceived;
- while (tSizeToReceive > 0) {
- tReceived = ((IEnergyHandlerGC)tTileEntity).receiveEnergyGC(eSource, tSizeToReceive, false);
- if (tReceived < 1) break;
- tSizeToReceive -= tReceived;
- }
- return 1;
- }
- }
- }
- return 0;
+ if (Loader.isModLoaded("GalacticraftCore")) {
+ long gc = GT_GC_Compat.insertEnergyInto(tTileEntity, aVoltage, tDirection);
+ if (gc != 2)
+ return gc;
}
// IC2 Compat
@@ -464,9 +447,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile if (coverBehavior instanceof GT_Cover_SolarPanel) return true;
// ((tIsGregTechTileEntity && tIsTileEntityCable) && (tAlwaysLookConnected || tLetEnergyIn || tLetEnergyOut) ) --> Not needed
-
- // GC Compat
- if (GregTech_API.mGalacticraft && tTileEntity instanceof IEnergyHandlerGC && (!(tTileEntity instanceof IConnector) || ((IConnector)tTileEntity).canConnect(tDir, NetworkType.POWER)))
+ if (Loader.isModLoaded("GalacticraftCore") && GT_GC_Compat.canConnect(tTileEntity,tDir))
return true;
// AE2-p2p Compat
diff --git a/src/main/java/gregtech/api/util/GT_Forestry_Compat.java b/src/main/java/gregtech/api/util/GT_Forestry_Compat.java new file mode 100644 index 0000000000..c59e551373 --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_Forestry_Compat.java @@ -0,0 +1,80 @@ +package gregtech.api.util; + +import forestry.api.recipes.ICentrifugeRecipe; +import forestry.api.recipes.ISqueezerRecipe; +import forestry.api.recipes.RecipeManagers; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import java.util.Map; + +public class GT_Forestry_Compat { + + public static void populateFakeNeiRecipes(){ + if (ItemList.FR_Bee_Drone.get(1L) != null) { + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Bee_Drone.getWildcard(1L)}, new ItemStack[]{ItemList.FR_Bee_Drone.getWithName(1L, "Scanned Drone")}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); + } + if (ItemList.FR_Bee_Princess.get(1L) != null) { + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Bee_Princess.getWildcard(1L)}, new ItemStack[]{ItemList.FR_Bee_Princess.getWithName(1L, "Scanned Princess")}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); + } + if (ItemList.FR_Bee_Queen.get(1L) != null) { + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Bee_Queen.getWildcard(1L)}, new ItemStack[]{ItemList.FR_Bee_Queen.getWithName(1L, "Scanned Queen")}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); + } + if (ItemList.FR_Tree_Sapling.get(1L) != null) { + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Tree_Sapling.getWildcard(1L)}, new ItemStack[]{ItemList.FR_Tree_Sapling.getWithName(1L, "Scanned Sapling")}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); + } + if (ItemList.FR_Butterfly.get(1L) != null) { + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Butterfly.getWildcard(1L)}, new ItemStack[]{ItemList.FR_Butterfly.getWithName(1L, "Scanned Butterfly")}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); + } + if (ItemList.FR_Larvae.get(1L) != null) { + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Larvae.getWildcard(1L)}, new ItemStack[]{ItemList.FR_Larvae.getWithName(1L, "Scanned Larvae")}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); + } + if (ItemList.FR_Serum.get(1L) != null) { + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Serum.getWildcard(1L)}, new ItemStack[]{ItemList.FR_Serum.getWithName(1L, "Scanned Serum")}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); + } + if (ItemList.FR_Caterpillar.get(1L) != null) { + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Caterpillar.getWildcard(1L)}, new ItemStack[]{ItemList.FR_Caterpillar.getWithName(1L, "Scanned Caterpillar")}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); + } + if (ItemList.FR_PollenFertile.get(1L) != null) { + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_PollenFertile.getWildcard(1L)}, new ItemStack[]{ItemList.FR_PollenFertile.getWithName(1L, "Scanned Pollen")}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); + } + } + + public static void transferCentrifugeRecipes(){ + try { + for (ICentrifugeRecipe tRecipe : RecipeManagers.centrifugeManager.recipes()) { + Map<ItemStack, Float> outputs = tRecipe.getAllProducts(); + ItemStack[] tOutputs = new ItemStack[outputs.size()]; + int[] tChances = new int[outputs.size()]; + int i = 0; + for (Map.Entry<ItemStack, Float> entry : outputs.entrySet()) { + tChances[i] = (int) (entry.getValue() * 10000); + tOutputs[i] = entry.getKey().copy(); + i++; + } + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(true, new ItemStack[]{tRecipe.getInput()}, tOutputs, null, tChances, null, null, 128, 5, 0); + } + } catch (Throwable e) { + if (GT_Values.D1) { + e.printStackTrace(GT_Log.err); + } + } + } + + public static void transferSqueezerRecipes(){ + try { + for (ISqueezerRecipe tRecipe : RecipeManagers.squeezerManager.recipes()) { + if ((tRecipe.getResources().length == 1) && (tRecipe.getFluidOutput() != null)) { + GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(true, new ItemStack[]{tRecipe.getResources()[0]}, new ItemStack[]{tRecipe.getRemnants()}, null, new int[]{(int) (tRecipe.getRemnantsChance() * 10000)}, null, new FluidStack[]{tRecipe.getFluidOutput()}, 32, 8, 0); + } + } + } catch (Throwable e) { + if (GT_Values.D1) { + e.printStackTrace(GT_Log.err); + } + } + } +} diff --git a/src/main/java/gregtech/api/util/GT_GC_Compat.java b/src/main/java/gregtech/api/util/GT_GC_Compat.java new file mode 100644 index 0000000000..8131e3affb --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_GC_Compat.java @@ -0,0 +1,47 @@ +package gregtech.api.util; + +import gregtech.api.GregTech_API; +import micdoodle8.mods.galacticraft.api.power.EnergySource; +import micdoodle8.mods.galacticraft.api.power.EnergySource.EnergySourceAdjacent; +import micdoodle8.mods.galacticraft.api.power.IEnergyHandlerGC; +import micdoodle8.mods.galacticraft.api.transmission.NetworkType; +import micdoodle8.mods.galacticraft.api.transmission.tile.IConnector; +import micdoodle8.mods.galacticraft.core.energy.EnergyConfigHandler; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +public class GT_GC_Compat { + + public static long insertEnergyInto(TileEntity tTileEntity, long aVoltage, ForgeDirection tDirection) { + // GC Compat + if (GregTech_API.mGalacticraft && tTileEntity instanceof IEnergyHandlerGC) { + if (!(tTileEntity instanceof IConnector) || ((IConnector)tTileEntity).canConnect(tDirection, NetworkType.POWER)) { + EnergySource eSource = new EnergySourceAdjacent(tDirection); + + float tSizeToReceive = aVoltage * EnergyConfigHandler.IC2_RATIO, tStored = ((IEnergyHandlerGC)tTileEntity).getEnergyStoredGC(eSource); + if (tSizeToReceive >= tStored || tSizeToReceive <= ((IEnergyHandlerGC)tTileEntity).getMaxEnergyStoredGC(eSource) - tStored) { + float tReceived = ((IEnergyHandlerGC)tTileEntity).receiveEnergyGC(eSource, tSizeToReceive, false); + if (tReceived > 0) { + tSizeToReceive -= tReceived; + while (tSizeToReceive > 0) { + tReceived = ((IEnergyHandlerGC)tTileEntity).receiveEnergyGC(eSource, tSizeToReceive, false); + if (tReceived < 1) break; + tSizeToReceive -= tReceived; + } + return 1; + } + } + } + return 0; + } + return 2; + } + + public static boolean canConnect(TileEntity tTileEntity,ForgeDirection tDirection){ + // GC Compat + if (GregTech_API.mGalacticraft && tTileEntity instanceof IEnergyHandlerGC && (!(tTileEntity instanceof IConnector) || ((IConnector)tTileEntity).canConnect(tDirection, NetworkType.POWER))) + return true; + return false; + } + +} diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java index f26df767b8..462211c110 100644 --- a/src/main/java/gregtech/api/util/GT_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Recipe.java @@ -275,7 +275,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public static void reInit() {
GT_Log.out.println("GT_Mod: Re-Unificating Recipes.");
- for (GT_Recipe_Map tMapEntry : GT_Recipe_Map.sMappings) tMapEntry.reInit();
+ for (GT_Recipe_Map tMapEntry : GT_Recipe_Map.sMappings)
+ tMapEntry.reInit();
}
// -----
diff --git a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java index 18a5a01c93..0a481abb48 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java +++ b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java @@ -51,6 +51,28 @@ public class GT_Worldgen_GT_Ore_Layer //public final boolean mAsteroid;
public final String aTextWorldgen = "worldgen.";
+ @Deprecated
+ public GT_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, boolean aOverworld, boolean aNether, boolean aEnd, boolean aMoon, boolean aMars, boolean aAsteroid, Materials aPrimary, Materials aSecondary, Materials aBetween, Materials aSporadic) {
+ super(aName, sList, aDefault);
+ this.mOverworld = false;
+ this.mNether = false;
+ this.mEnd = false;
+ this.mEndAsteroid = false;
+ this.mMinY = (short) aMinY;
+ this.mMaxY = (short) aMaxY;
+ this.mWeight = (short)aWeight;
+ this.mDensity = (short) aDensity;
+ this.mSize = (short) Math.max(1, aSize);
+ this.mPrimaryMeta = (short) aPrimary.mMetaItemSubID;
+ this.mSecondaryMeta = (short) aSecondary.mMetaItemSubID;
+ this.mBetweenMeta = (short) aBetween.mMetaItemSubID;
+ this.mSporadicMeta = (short) aSporadic.mMetaItemSubID;
+ this.mRestrictBiome = "None";
+ if (mEnabled)
+ sWeight += this.mWeight;
+ }
+
+
public GT_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, boolean aOverworld, boolean aNether, boolean aEnd, Materials aPrimary, Materials aSecondary, Materials aBetween, Materials aSporadic) {
super(aName, sList, aDefault);
this.mOverworld = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld);
diff --git a/src/main/java/gregtech/common/GT_Worldgenerator.java b/src/main/java/gregtech/common/GT_Worldgenerator.java index f87ac9bc98..06e8697d3c 100644 --- a/src/main/java/gregtech/common/GT_Worldgenerator.java +++ b/src/main/java/gregtech/common/GT_Worldgenerator.java @@ -118,8 +118,6 @@ implements IWorldGenerator { // Local class to track which orevein seeds must be checked when doing chunkified worldgen
-
-
class NearbySeeds {
public int mX;
public int mZ;
@@ -127,8 +125,25 @@ implements IWorldGenerator { this.mX = x;
this.mZ = z;
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof GT_Worldgenerator.WorldGenContainer.NearbySeeds)) return false;
+ GT_Worldgenerator.WorldGenContainer.NearbySeeds that = (GT_Worldgenerator.WorldGenContainer.NearbySeeds) o;
+ if (this.mX != that.mX) return false;
+ return this.mZ == that.mZ;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = this.mX;
+ result = 31 * result + this.mZ;
+ return result;
+ }
};
- public static ArrayList<NearbySeeds> seedList = new ArrayList();
+
+ public static ArrayList<GT_Worldgenerator.WorldGenContainer.NearbySeeds> seedList = new ArrayList();
// aX and aZ are now the by-chunk X and Z for the chunk of interest
public WorldGenContainer(Random aRandom, int aX, int aZ, int aDimensionType, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider, String aBiome) {
@@ -144,7 +159,7 @@ implements IWorldGenerator { // How to evaluate oregen distribution
// - Enable debugOreveins
- // - Fly around for a while, or teleport jumping ~320 blocks at a time, with
+ // - Fly around for a while, or teleport jumping ~320 blocks at a time, with
// a 15-30s pause for worldgen to catch up
// - Do this across a large area, at least 2000x2000 blocks for good numbers
// - Open logs\gregtech.log
@@ -152,18 +167,18 @@ implements IWorldGenerator { // - Select Find All In Current Document
// - In the Search window, right-click and Select All
// - Copy and paste to a new file
- // - Delete extraneous stuff at top, and blank line at bottom. Line count is
+ // - Delete extraneous stuff at top, and blank line at bottom. Line count is
// # of total oreveins
- // - For simple spot checks, use Find All in Current Document for specific
+ // - For simple spot checks, use Find All in Current Document for specific
// oremixes, ie ore.mix.diamond, to check how many appear in the list.
- // - For more complex work, import file into Excel, and sort based on oremix
- // column. Drag select the oremix names, in the bottom right will be how many
+ // - For more complex work, import file into Excel, and sort based on oremix
+ // column. Drag select the oremix names, in the bottom right will be how many
// entries to add in a seperate tab to calculate %ages.
//
// When using the ore weights, discount or remove the high altitude veins since
// their high weight are offset by their rareness. I usually just use zero for them.
// Actual spawn rates will vary based upon the average height of the stone layers
- // in the dimension. For example veins that range above and below the average height
+ // in the dimension. For example veins that range above and below the average height
// will be less, and veins that are completely above the average height will be much less.
public void worldGenFindVein( int oreseedX, int oreseedZ) {
@@ -172,17 +187,17 @@ implements IWorldGenerator { // ((this.mWorld.provider.dimensionId & 0xffL)<<56) Puts the dimension in the top bits of the hash, to make sure to get unique hashes per dimension
// ((long)oreseedX & 0x000000000fffffffL) << 28) Puts the chunk X in the bits 29-55. Cuts off the top few bits of the chunk so we have bits for dimension.
// ( (long)oreseedZ & 0x000000000fffffffL )) Puts the chunk Z in the bits 0-27. Cuts off the top few bits of the chunk so we have bits for dimension.
- long oreveinSeed = ((long)this.mWorld.getSeed()<<16) ^ ((long)((this.mWorld.provider.dimensionId & 0xffL)<<56) |( ((long)oreseedX & 0x000000000fffffffL) << 28) | ( (long)oreseedZ & 0x000000000fffffffL )); // Use an RNG that is identical every time it is called for this oreseed.
- XSTR oreveinRNG = new XSTR( oreveinSeed );
+ long oreveinSeed = ((long)this.mWorld.getSeed()<<16) ^ ((long)((this.mWorld.provider.dimensionId & 0xffL)<<56) |( ((long)oreseedX & 0x000000000fffffffL) << 28) | ( (long)oreseedZ & 0x000000000fffffffL )); // Use an RNG that is identical every time it is called for this oreseed.
+ XSTR oreveinRNG = new XSTR( oreveinSeed );
int oreveinPercentageRoll = oreveinRNG.nextInt(100); // Roll the dice, see if we get an orevein here at all
int noOrePlacedCount=0;
String tDimensionName = "";
if (debugOrevein) { tDimensionName = this.mWorld.provider.getDimensionName(); }
-
+
if (debugOrevein) GT_Log.out.println(
" Finding oreveins for oreveinSeed="+ oreveinSeed +
" mX="+ this.mX +
- " mZ="+ this.mZ +
+ " mZ="+ this.mZ +
" oreseedX="+ oreseedX +
" oreseedZ="+ oreseedZ +
" worldSeed="+this.mWorld.getSeed()
@@ -201,7 +216,7 @@ implements IWorldGenerator { {
test = 1;
GT_Log.out.println(
- "sWeight = " + GT_Worldgen_GT_Ore_Layer.sWeight
+ "sWeight = " + GT_Worldgen_GT_Ore_Layer.sWeight
);
for (GT_Worldgen_GT_Ore_Layer tWorldGen : GT_Worldgen_GT_Ore_Layer.sList) {
GT_Log.out.println(
@@ -215,8 +230,8 @@ implements IWorldGenerator { for (GT_Worldgen_GT_Ore_Layer tWorldGen : GT_Worldgen_GT_Ore_Layer.sList) {
tRandomWeight -= ( tWorldGen).mWeight;
if (tRandomWeight <= 0) {
- try {
- // Adjust the seed so that this layer has a series of unique random numbers. Otherwise multiple attempts at this same oreseed will get the same offset and X/Z values. If an orevein failed, any orevein with the
+ try {
+ // Adjust the seed so that this layer has a series of unique random numbers. Otherwise multiple attempts at this same oreseed will get the same offset and X/Z values. If an orevein failed, any orevein with the
// same minimum heights would fail as well. This prevents that, giving each orevein a unique height each pass through here.
int placementResult = tWorldGen.executeWorldgenChunkified(this.mWorld, new XSTR( oreveinSeed ^ (tWorldGen.mPrimaryMeta)), this.mBiome, this.mDimensionType, this.mX*16, this.mZ*16, oreseedX*16, oreseedZ*16, this.mChunkGenerator, this.mChunkProvider);
switch(placementResult) {
@@ -264,7 +279,7 @@ implements IWorldGenerator { "Exception occurred on oreVein" + tWorldGen +
" oreveinSeed="+ oreveinSeed +
" mX="+ this.mX +
- " mZ="+ this.mZ +
+ " mZ="+ this.mZ +
" oreseedX="+ oreseedX +
" oreseedZ="+ oreseedZ
);
@@ -278,9 +293,9 @@ implements IWorldGenerator { if (debugOrevein) GT_Log.out.println(
" Empty oreveinSeed="+ oreveinSeed +
" mX="+ this.mX +
- " mZ="+ this.mZ +
+ " mZ="+ this.mZ +
" oreseedX="+ oreseedX +
- " oreseedZ="+ oreseedZ +
+ " oreseedZ="+ oreseedZ +
" tries at oremix=" + i +
" placementAttempts=" + placementAttempts +
" dimensionName=" + tDimensionName
@@ -293,9 +308,9 @@ implements IWorldGenerator { " mX="+ this.mX +
" mZ="+ this.mZ +
" oreseedX=" + oreseedX +
- " oreseedZ="+ oreseedZ +
+ " oreseedZ=" + oreseedZ +
" RNG=" + oreveinPercentageRoll +
- " %=" + oreveinPercentage+
+ " %=" + oreveinPercentage+
" dimensionName=" + tDimensionName
);
validOreveins.put(oreveinSeed, noOresInVein);
@@ -303,7 +318,7 @@ implements IWorldGenerator { }else {
// oreseed is located in the previously processed table
if (debugOrevein) GT_Log.out.print(
- " Valid oreveinSeed="+ oreveinSeed +
+ " Valid oreveinSeed="+ oreveinSeed +
" validOreveins.size()=" + validOreveins.size() + " "
);
GT_Worldgen_GT_Ore_Layer tWorldGen = validOreveins.get(oreveinSeed);
@@ -323,7 +338,7 @@ implements IWorldGenerator { }
}
}
-
+
public void run() {
long startTime = System.nanoTime();
int oreveinMaxSize;
@@ -350,7 +365,7 @@ implements IWorldGenerator { } else {
oreveinMaxSize=32;
}
-
+
int wXbox = this.mX - (oreveinMaxSize/16);
int eXbox = this.mX + (oreveinMaxSize/16 + 1); // Need to add 1 since it is compared using a <
int nZbox = this.mZ - (oreveinMaxSize/16);
@@ -365,7 +380,7 @@ implements IWorldGenerator { "Adding seed x="+x+
" z="+z
);
- seedList.add( new NearbySeeds(x,z) );
+ seedList.add( new GT_Worldgenerator.WorldGenContainer.NearbySeeds(x,z) );
}
}
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java index ffbfa048de..8cf775bfe5 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java @@ -41,6 +41,7 @@ public class GT_MetaTileEntity_ImplosionCompressor "1x Muffler Hatch (Any casing)",
"1x Energy Hatch (Any casing)",
"Solid Steel Machine Casings for the rest (16 at least!)",
+ "Casings can be replaced with Explosion Warning Signs",
"Causes " + 20 * getPollutionPerTick(null) + " Pollution per second"};
}
diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java index 99cf2e6366..4530023908 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java @@ -29,7 +29,8 @@ public class ProcessingOre implements gregtech.api.interfaces.IOreRecipeRegistra } private boolean registerStandardOreRecipes(OrePrefixes aPrefix, Materials aMaterial, ItemStack aOreStack, int aMultiplier) { - if ((aOreStack == null) || (aMaterial == null)) return false; + if ((aOreStack == null) || (aMaterial == null)) + return false; GT_ModHandler.addValuableOre(GT_Utility.getBlockFromStack(aOreStack), aOreStack.getItemDamage(), aMaterial.mOreValue); Materials tMaterial = aMaterial.mOreReplacement; Materials tPrimaryByMaterial = null; @@ -71,8 +72,10 @@ public class ProcessingOre implements gregtech.api.interfaces.IOreRecipeRegistra gregtech.api.util.GT_Recipe.GT_Recipe_Map.sByProductList.addFakeRecipe(false, new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.ore, aMaterial, aOreStack, 1L)}, (ItemStack[]) tByProductStacks.toArray(new ItemStack[tByProductStacks.size()]), null, null, null, null, 0, 0, 0); } - if (tPrimaryByMaterial == null) tPrimaryByMaterial = tMaterial; - if (tPrimaryByProduct == null) tPrimaryByProduct = tDust; + if (tPrimaryByMaterial == null) + tPrimaryByMaterial = tMaterial; + if (tPrimaryByProduct == null) + tPrimaryByProduct = tDust; boolean tHasSmelting = false; if (tSmeltInto != null) { |