diff --git a/build.gradle b/build.gradle index b62b06f..e60da66 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ apply plugin: 'net.minecraftforge.gradle.forge' //Only edit below this line, the above code adds and enables the nessasary things for Forge to be setup. -version = "1.10.2-2.7" +version = "1.10.2-2.8" group= "wanion.unidict" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "UniDict" @@ -21,7 +21,7 @@ compileJava { } minecraft { - version = "1.10.2-12.18.3.2185" + version = "1.10.2-12.18.3.2254" runDir = "run" // the mappings can be changed at any time, and must be in the following format. diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9397848..e18cba7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip diff --git a/libs/AbyssalCraft-1.10.2-1.9.3.9.jar b/libs/AbyssalCraft-1.10.2-1.9.3.10.jar similarity index 88% rename from libs/AbyssalCraft-1.10.2-1.9.3.9.jar rename to libs/AbyssalCraft-1.10.2-1.9.3.10.jar index 71e11eb..d45c3ce 100644 Binary files a/libs/AbyssalCraft-1.10.2-1.9.3.9.jar and b/libs/AbyssalCraft-1.10.2-1.9.3.10.jar differ diff --git a/libs/Advanced Solar Panels-4.0.4.jar b/libs/Advanced Solar Panels-4.0.4-dev.jar similarity index 63% rename from libs/Advanced Solar Panels-4.0.4.jar rename to libs/Advanced Solar Panels-4.0.4-dev.jar index 153675c..51d4bd8 100644 Binary files a/libs/Advanced Solar Panels-4.0.4.jar and b/libs/Advanced Solar Panels-4.0.4-dev.jar differ diff --git a/libs/AdvancedRocketry-1.10.2-1.0.3.jar b/libs/AdvancedRocketry-1.10.2-1.0.13.jar similarity index 93% rename from libs/AdvancedRocketry-1.10.2-1.0.3.jar rename to libs/AdvancedRocketry-1.10.2-1.0.13.jar index 652f351..6afbd99 100644 Binary files a/libs/AdvancedRocketry-1.10.2-1.0.3.jar and b/libs/AdvancedRocketry-1.10.2-1.0.13.jar differ diff --git a/libs/BloodMagic-1.9.4-2.1.0-69.jar b/libs/BloodMagic-1.10.2-2.1.7-76.jar similarity index 87% rename from libs/BloodMagic-1.9.4-2.1.0-69.jar rename to libs/BloodMagic-1.10.2-2.1.7-76.jar index 579f0a7..3d621b3 100644 Binary files a/libs/BloodMagic-1.9.4-2.1.0-69.jar and b/libs/BloodMagic-1.10.2-2.1.7-76.jar differ diff --git a/libs/Calculator-1.9.4-3.1.2.jar b/libs/Calculator-1.10.2-3.2.0.jar similarity index 58% rename from libs/Calculator-1.9.4-3.1.2.jar rename to libs/Calculator-1.10.2-3.2.0.jar index 52a912b..124f589 100644 Binary files a/libs/Calculator-1.9.4-3.1.2.jar and b/libs/Calculator-1.10.2-3.2.0.jar differ diff --git a/libs/CoFHCore-1.10.2-4.0.0.127-universal.jar b/libs/CoFHCore-1.10.2-4.1.0.155-universal.jar similarity index 59% rename from libs/CoFHCore-1.10.2-4.0.0.127-universal.jar rename to libs/CoFHCore-1.10.2-4.1.0.155-universal.jar index 791faaf..105e17f 100644 Binary files a/libs/CoFHCore-1.10.2-4.0.0.127-universal.jar and b/libs/CoFHCore-1.10.2-4.1.0.155-universal.jar differ diff --git a/libs/EnderCore-1.10.2-0.4.1.61-beta.jar b/libs/EnderCore-1.10.2-0.4.1.61-beta.jar deleted file mode 100644 index 3855103..0000000 Binary files a/libs/EnderCore-1.10.2-0.4.1.61-beta.jar and /dev/null differ diff --git a/libs/EnderCore-1.10.2-0.4.1.65-beta.jar b/libs/EnderCore-1.10.2-0.4.1.65-beta.jar new file mode 100644 index 0000000..c0f20f5 Binary files /dev/null and b/libs/EnderCore-1.10.2-0.4.1.65-beta.jar differ diff --git a/libs/EnderIO-1.10.2-3.0.1.145_beta.jar b/libs/EnderIO-1.10.2-3.1.156.jar similarity index 64% rename from libs/EnderIO-1.10.2-3.0.1.145_beta.jar rename to libs/EnderIO-1.10.2-3.1.156.jar index 6e5b811..4642ffd 100644 Binary files a/libs/EnderIO-1.10.2-3.0.1.145_beta.jar and b/libs/EnderIO-1.10.2-3.1.156.jar differ diff --git a/libs/Guide-API-1.10.2-2.0.2-45.jar b/libs/Guide-API-1.10.2-2.0.3-46.jar similarity index 83% rename from libs/Guide-API-1.10.2-2.0.2-45.jar rename to libs/Guide-API-1.10.2-2.0.3-46.jar index 2d70c6b..95bdb87 100644 Binary files a/libs/Guide-API-1.10.2-2.0.2-45.jar and b/libs/Guide-API-1.10.2-2.0.3-46.jar differ diff --git a/libs/ImmersiveEngineering-0.10-53-deobf.jar b/libs/ImmersiveEngineering-0.10-57-deobf.jar similarity index 71% rename from libs/ImmersiveEngineering-0.10-53-deobf.jar rename to libs/ImmersiveEngineering-0.10-57-deobf.jar index bd2ee19..ccb824b 100644 Binary files a/libs/ImmersiveEngineering-0.10-53-deobf.jar and b/libs/ImmersiveEngineering-0.10-57-deobf.jar differ diff --git a/libs/LibVulpes-1.10.2-0.1.11-universal.jar b/libs/LibVulpes-1.10.2-0.1.16-universal.jar similarity index 65% rename from libs/LibVulpes-1.10.2-0.1.11-universal.jar rename to libs/LibVulpes-1.10.2-0.1.16-universal.jar index c9e369a..712be67 100644 Binary files a/libs/LibVulpes-1.10.2-0.1.11-universal.jar and b/libs/LibVulpes-1.10.2-0.1.16-universal.jar differ diff --git a/libs/MCMultiPart-1.3.0-universal.jar b/libs/MCMultiPart-1.3.0-universal.jar deleted file mode 100644 index a62206c..0000000 Binary files a/libs/MCMultiPart-1.3.0-universal.jar and /dev/null differ diff --git a/libs/MCMultiPart-1.4.0-deobf.jar b/libs/MCMultiPart-1.4.0-deobf.jar new file mode 100644 index 0000000..173c36b Binary files /dev/null and b/libs/MCMultiPart-1.4.0-deobf.jar differ diff --git a/libs/Mantle-1.10.2-1.1.3.jar b/libs/Mantle-1.10.2-1.1.5.jar similarity index 93% rename from libs/Mantle-1.10.2-1.1.3.jar rename to libs/Mantle-1.10.2-1.1.5.jar index 13791a6..df5035e 100644 Binary files a/libs/Mantle-1.10.2-1.1.3.jar and b/libs/Mantle-1.10.2-1.1.5.jar differ diff --git a/libs/Mekanism-1.10.2-9.2.1.295.jar b/libs/Mekanism-1.10.2-9.2.1.300.jar similarity index 98% rename from libs/Mekanism-1.10.2-9.2.1.295.jar rename to libs/Mekanism-1.10.2-9.2.1.300.jar index 16f9464..037763b 100644 Binary files a/libs/Mekanism-1.10.2-9.2.1.295.jar and b/libs/Mekanism-1.10.2-9.2.1.300.jar differ diff --git a/libs/MoreChickens-1.10.2-1.0.11.jar b/libs/MoreChickens-1.10.2-1.0.11.jar new file mode 100644 index 0000000..29b5a8a Binary files /dev/null and b/libs/MoreChickens-1.10.2-1.0.11.jar differ diff --git a/libs/RebornCore-1.10.2-2.13.5.136-dev.jar b/libs/RebornCore-1.10.2-2.13.5.136-dev.jar new file mode 100644 index 0000000..0eff1e8 Binary files /dev/null and b/libs/RebornCore-1.10.2-2.13.5.136-dev.jar differ diff --git a/libs/RebornCore-1.10.2-2.8.4.78-dev.jar b/libs/RebornCore-1.10.2-2.8.4.78-dev.jar deleted file mode 100644 index fbd7f7a..0000000 Binary files a/libs/RebornCore-1.10.2-2.8.4.78-dev.jar and /dev/null differ diff --git a/libs/SonarCore-1.9.4-3.1.6.jar b/libs/SonarCore-1.10.2-3.2.6.jar similarity index 59% rename from libs/SonarCore-1.9.4-3.1.6.jar rename to libs/SonarCore-1.10.2-3.2.6.jar index 4bb7972..ce30a78 100644 Binary files a/libs/SonarCore-1.9.4-3.1.6.jar and b/libs/SonarCore-1.10.2-3.2.6.jar differ diff --git a/libs/TConstruct-1.10.2-2.6.1.jar b/libs/TConstruct-1.10.2-2.6.3.jar similarity index 81% rename from libs/TConstruct-1.10.2-2.6.1.jar rename to libs/TConstruct-1.10.2-2.6.3.jar index ab7adb9..df68b34 100644 Binary files a/libs/TConstruct-1.10.2-2.6.1.jar and b/libs/TConstruct-1.10.2-2.6.3.jar differ diff --git a/libs/TechReborn-1.10.2-1.4.16.133-dev.jar b/libs/TechReborn-1.10.2-1.4.16.133-dev.jar deleted file mode 100644 index daf760e..0000000 Binary files a/libs/TechReborn-1.10.2-1.4.16.133-dev.jar and /dev/null differ diff --git a/libs/TechReborn-1.10.2-2.1.10.207-dev.jar b/libs/TechReborn-1.10.2-2.1.10.207-dev.jar new file mode 100644 index 0000000..a35e785 Binary files /dev/null and b/libs/TechReborn-1.10.2-2.1.10.207-dev.jar differ diff --git a/libs/ThermalExpansion-1.10.2-2.0.0.64-universal.jar b/libs/ThermalExpansion-1.10.2-5.0.3.86-universal.jar similarity index 65% rename from libs/ThermalExpansion-1.10.2-2.0.0.64-universal.jar rename to libs/ThermalExpansion-1.10.2-5.0.3.86-universal.jar index 1a66854..0445915 100644 Binary files a/libs/ThermalExpansion-1.10.2-2.0.0.64-universal.jar and b/libs/ThermalExpansion-1.10.2-5.0.3.86-universal.jar differ diff --git a/libs/ThermalFoundation-1.10.2-2.0.0.64-universal.jar b/libs/ThermalFoundation-1.10.2-2.0.3.77-universal.jar similarity index 80% rename from libs/ThermalFoundation-1.10.2-2.0.0.64-universal.jar rename to libs/ThermalFoundation-1.10.2-2.0.3.77-universal.jar index 41edbea..202938e 100644 Binary files a/libs/ThermalFoundation-1.10.2-2.0.0.64-universal.jar and b/libs/ThermalFoundation-1.10.2-2.0.3.77-universal.jar differ diff --git a/libs/chickens-4.3.2.jar b/libs/chickens-4.3.2.jar new file mode 100644 index 0000000..057773c Binary files /dev/null and b/libs/chickens-4.3.2.jar differ diff --git a/libs/embers-0.016.jar b/libs/embers-0.016.jar deleted file mode 100644 index 84e4c80..0000000 Binary files a/libs/embers-0.016.jar and /dev/null differ diff --git a/libs/embers-0.104.jar b/libs/embers-0.104.jar new file mode 100644 index 0000000..16d3729 Binary files /dev/null and b/libs/embers-0.104.jar differ diff --git a/libs/forestry_1.10.2-5.2.16.346.jar b/libs/forestry_1.10.2-5.2.17.368.jar similarity index 88% rename from libs/forestry_1.10.2-5.2.16.346.jar rename to libs/forestry_1.10.2-5.2.17.368.jar index b130fb4..8772046 100644 Binary files a/libs/forestry_1.10.2-5.2.16.346.jar and b/libs/forestry_1.10.2-5.2.17.368.jar differ diff --git a/libs/industrialcraft-2-2.6.134-ex110-dev.jar b/libs/industrialcraft-2-2.6.173-ex110-dev.jar similarity index 81% rename from libs/industrialcraft-2-2.6.134-ex110-dev.jar rename to libs/industrialcraft-2-2.6.173-ex110-dev.jar index 1b75283..2c9dade 100644 Binary files a/libs/industrialcraft-2-2.6.134-ex110-dev.jar and b/libs/industrialcraft-2-2.6.173-ex110-dev.jar differ diff --git a/libs/jei_1.10.2-3.13.6.387.jar b/libs/jei_1.10.2-3.14.7.416.jar similarity index 61% rename from libs/jei_1.10.2-3.13.6.387.jar rename to libs/jei_1.10.2-3.14.7.416.jar index 2762c8c..edbe709 100644 Binary files a/libs/jei_1.10.2-3.13.6.387.jar and b/libs/jei_1.10.2-3.14.7.416.jar differ diff --git a/libs/refinedstorage-1.2.12.jar b/libs/refinedstorage-1.2.24.jar similarity index 74% rename from libs/refinedstorage-1.2.12.jar rename to libs/refinedstorage-1.2.24.jar index 064b8a2..248b23d 100644 Binary files a/libs/refinedstorage-1.2.12.jar and b/libs/refinedstorage-1.2.24.jar differ diff --git a/src/main/java/wanion/unidict/Config.java b/src/main/java/wanion/unidict/Config.java index afc7570..5f67206 100644 --- a/src/main/java/wanion/unidict/Config.java +++ b/src/main/java/wanion/unidict/Config.java @@ -13,9 +13,7 @@ import gnu.trove.map.hash.THashMap; import gnu.trove.map.hash.TObjectIntHashMap; import net.minecraftforge.common.config.Configuration; -import org.apache.commons.lang3.text.WordUtils; import wanion.unidict.common.Reference; -import wanion.unidict.resource.Resource; import java.io.File; import java.util.*; @@ -32,7 +30,8 @@ public final class Config implements UniDict.IDependency public final boolean registerNewCraftingIngredientsAsItemStacks; public final Set keepOneEntryModBlackSet; public final boolean autoHideInJEI; - public final Set hideInJEIBlackSet; + public final Set hideInJEIKindBlackSet; + public final Set hideInJEIEntryBlackSet; // dumps public final boolean kindsDump; public final boolean entriesDump; @@ -75,7 +74,8 @@ private Config() keepOneEntryModBlackSet = Collections.unmodifiableSet(Sets.newLinkedHashSet(Arrays.asList(config.getStringList("keepOneEntryModBlackList", general, new String[]{}, "mods listed here will be blacklisted in keepOneEntry.\nmust be the exact modID.")))); registerNewCraftingIngredientsAsItemStacks = config.getBoolean("registerNewCraftingIngredientsAsItemStacks", general, false, "If Enabled, the ingredients of all the new recipes created by Crafting Integration will be registered as ItemStacks.\nEnable this if you don't like the cycling through the possibilities of JEI."); autoHideInJEI = config.getBoolean("autoHideInJEI", general, true, "auto hide items in JEI?") && isModLoaded("JEI"); - hideInJEIBlackSet = Collections.unmodifiableSet(Sets.newLinkedHashSet(Arrays.asList(config.getStringList("autoHideInJEIBlackList", general, new String[]{"ore"}, "put here things that you don't want to hide in JEI.\nonly works if keepOneEntry is false.")))); + hideInJEIKindBlackSet = Collections.unmodifiableSet(Sets.newLinkedHashSet(Arrays.asList(config.getStringList("autoHideInJEIKindBlackList", general, new String[]{"ore"}, "put here kinds that you don't want to hide in JEI.\nonly works if keepOneEntry is false.")))); + hideInJEIEntryBlackSet = Collections.unmodifiableSet(Sets.newLinkedHashSet(Arrays.asList(config.getStringList("autoHideInJEIEntryBlackList", general, new String[]{}, "put here entries that you don't want to hide in JEI.\nonly works if keepOneEntry is false.")))); // dumps kindsDump = config.getBoolean("kindsDump", "dump", false, "Enable this to keep track of all the kinds.\nthe output file will be saved on \"config\\unidict\\dump\" folder.\nonce the file is generated, you must delete it to re-generate."); entriesDump = config.getBoolean("entriesDump", "dump", false, "Enable this to keep track of all the entries.\nthe output file will be saved on \"config\\unidict\\dump\" folder.\nonce the file is generated, you must delete it to re-generate."); diff --git a/src/main/java/wanion/unidict/UniDict.java b/src/main/java/wanion/unidict/UniDict.java index a45aaaf..3bd64cb 100644 --- a/src/main/java/wanion/unidict/UniDict.java +++ b/src/main/java/wanion/unidict/UniDict.java @@ -96,12 +96,6 @@ public void postInit(final FMLPostInitializationEvent event) { uniResourceHandler.postInit(); moduleHandler.startModules(event); - } - - @Mod.EventHandler - public void loadComplete(final FMLLoadCompleteEvent event) - { - moduleHandler.startModules(event); uniResourceHandler = null; moduleHandler = null; dependencies = null; @@ -114,8 +108,6 @@ private ModuleHandler populateModules(final ModuleHandler moduleHandler) final Config config = getConfig(); if (!config.libraryMode && config.integrationModule) moduleHandler.addModule(new IntegrationModule()); - //if (config.processingModule) - // moduleHandler.addModule(new ProcessingModule()); return moduleHandler; } diff --git a/src/main/java/wanion/unidict/common/Reference.java b/src/main/java/wanion/unidict/common/Reference.java index d0d79d5..b431f4d 100644 --- a/src/main/java/wanion/unidict/common/Reference.java +++ b/src/main/java/wanion/unidict/common/Reference.java @@ -14,7 +14,7 @@ public final class Reference { public static final String MOD_ID = "unidict"; public static final String MOD_NAME = "UniDict"; - public static final String MOD_VERSION = "1.10.2-2.7"; + public static final String MOD_VERSION = "1.10.2-2.8"; public static final String DEPENDENCIES = "required-after:wanionlib@[1.10.2-1.3,);after:*"; public static final char SLASH = separatorChar; public static final String MC_VERSION = "[1.10.2]"; diff --git a/src/main/java/wanion/unidict/integration/AE2Integration.java b/src/main/java/wanion/unidict/integration/AE2Integration.java index 8c3902f..13bf9c7 100644 --- a/src/main/java/wanion/unidict/integration/AE2Integration.java +++ b/src/main/java/wanion/unidict/integration/AE2Integration.java @@ -34,9 +34,7 @@ public String call() { try { fixGrindStoneRecipes(); - } catch (Exception e) { - UniDict.getLogger().error(threadName + e); - } + } catch (Exception e) { UniDict.getLogger().error(threadName + e); } return threadName + "The world of energistics has never been so powerful."; } diff --git a/src/main/java/wanion/unidict/integration/BloodMagicIntegration.java b/src/main/java/wanion/unidict/integration/BloodMagicIntegration.java index 380d01e..f1ada1c 100644 --- a/src/main/java/wanion/unidict/integration/BloodMagicIntegration.java +++ b/src/main/java/wanion/unidict/integration/BloodMagicIntegration.java @@ -35,7 +35,7 @@ public String call() try { fixAlchemyTableRecipes(); } catch (Exception e) { UniDict.getLogger().error(threadName + e); } - return threadName + "It is bleeding..."; + return threadName + "It's bleeding..."; } private void fixAlchemyTableRecipes() diff --git a/src/main/java/wanion/unidict/integration/CalculatorIntegration.java b/src/main/java/wanion/unidict/integration/CalculatorIntegration.java index 32cf599..100cfd2 100644 --- a/src/main/java/wanion/unidict/integration/CalculatorIntegration.java +++ b/src/main/java/wanion/unidict/integration/CalculatorIntegration.java @@ -8,8 +8,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -import sonar.calculator.mod.common.recipes.machines.AlgorithmSeparatorRecipes; -import sonar.calculator.mod.common.recipes.machines.StoneSeparatorRecipes; import wanion.unidict.UniDict; final class CalculatorIntegration extends AbstractIntegrationThread @@ -31,11 +29,11 @@ public String call() private void fixStoneSeparatorRecipes() { - StoneSeparatorRecipes.instance().getRecipes().values().forEach(resourceHandler::setMainItemStacks); + //StoneSeparatorRecipes.instance().getRecipes().values().forEach(resourceHandler::setMainItemStacks); } private void fixAlgorithmSeparatorRecipes() { - AlgorithmSeparatorRecipes.instance().getRecipes().values().forEach(resourceHandler::setMainItemStacks); + //AlgorithmSeparatorRecipes.instance().getRecipes().forEach(resourceHandler::setMainItemStacks); } } \ No newline at end of file diff --git a/src/main/java/wanion/unidict/integration/ChickensIntegration.java b/src/main/java/wanion/unidict/integration/ChickensIntegration.java new file mode 100644 index 0000000..4b9830f --- /dev/null +++ b/src/main/java/wanion/unidict/integration/ChickensIntegration.java @@ -0,0 +1,34 @@ +package wanion.unidict.integration; + +/* + * Created by WanionCane(https://github.com/WanionCane). + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +import com.setycz.chickens.ChickensRegistry; +import wanion.unidict.UniDict; + +final class ChickensIntegration extends AbstractIntegrationThread +{ + ChickensIntegration() + { + super("Chickens"); + } + + @Override + public String call() + { + try { + ChickensRegistry.getItems().forEach(chickensRegistryItem -> { + chickensRegistryItem.setLayItem(resourceHandler.getMainItemStack(chickensRegistryItem.createLayItem())); + chickensRegistryItem.setDropItem(resourceHandler.getMainItemStack(chickensRegistryItem.createDropItem())); + }); + } catch (Exception e) { + UniDict.getLogger().error(threadName + e); + } + return threadName + "changed Chicken's DNA to eggs give the right things when hatched."; + } +} \ No newline at end of file diff --git a/src/main/java/wanion/unidict/integration/IntegrationModule.java b/src/main/java/wanion/unidict/integration/IntegrationModule.java index 10070fe..df6fb00 100644 --- a/src/main/java/wanion/unidict/integration/IntegrationModule.java +++ b/src/main/java/wanion/unidict/integration/IntegrationModule.java @@ -48,7 +48,8 @@ private enum Integration APPLIED_ENERGISTICS_2("appliedenergistics2", AE2Integration.class), BASE_METALS("basemetals", BaseMetalsIntegration.class), BLOOD_MAGIC("BloodMagic", BloodMagicIntegration.class), - CALCULATOR("Calculator", CalculatorIntegration.class, false), + //CALCULATOR("calculator", CalculatorIntegration.class, false), + CHICKENS("chickens", ChickensIntegration.class), EMBERS("embers", EmbersIntegration.class), ENDER_IO("EnderIO", EnderIOIntegration.class), FORESTRY("forestry", ForestryIntegration.class), diff --git a/src/main/java/wanion/unidict/integration/TEIntegration.java b/src/main/java/wanion/unidict/integration/TEIntegration.java index cec84b7..a4bb0de 100644 --- a/src/main/java/wanion/unidict/integration/TEIntegration.java +++ b/src/main/java/wanion/unidict/integration/TEIntegration.java @@ -8,12 +8,11 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -import cofh.thermalexpansion.util.crafting.CompactorManager; -import cofh.thermalexpansion.util.crafting.FurnaceManager; -import cofh.thermalexpansion.util.crafting.PulverizerManager; -import cofh.thermalexpansion.util.crafting.SmelterManager; -import com.google.common.collect.Lists; +import cofh.thermalexpansion.util.crafting.*; +import gnu.trove.map.TIntObjectMap; +import gnu.trove.map.hash.TIntObjectHashMap; import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; import wanion.lib.common.Util; import wanion.unidict.UniDict; @@ -35,9 +34,10 @@ public String call() { try { fixCompactorRecipes(); + fixRefineryRecipes(); + fixInductionSmelterRecipes(); fixRedstoneFurnaceRecipes(); fixPulverizerRecipes(); - fixInductionSmelterRecipes(); } catch (Exception e) { UniDict.getLogger().error(threadName + e); } @@ -76,9 +76,64 @@ private void fixCompactorRecipes() } } + private void fixInductionSmelterRecipes() + { + final Map, SmelterManager.RecipeSmelter> recipeMap = Util.getField(SmelterManager.class, "recipeMap", null, Map.class); + if (recipeMap == null) + return; + Constructor smelterRecipeConstructor = null; + try { + smelterRecipeConstructor = SmelterManager.RecipeSmelter.class.getDeclaredConstructor(ItemStack.class, ItemStack.class, ItemStack.class, ItemStack.class, int.class, int.class); + smelterRecipeConstructor.setAccessible(true); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } + if (smelterRecipeConstructor == null) + return; + for (final List recipeMapKey : recipeMap.keySet()) { + final SmelterManager.RecipeSmelter smelterRecipe = recipeMap.get(recipeMapKey); + final ItemStack correctOutput = resourceHandler.getMainItemStack(smelterRecipe.getPrimaryOutput()); + final ItemStack correctSecondaryOutput = resourceHandler.getMainItemStack(smelterRecipe.getSecondaryOutput()); + if (correctOutput == smelterRecipe.getPrimaryOutput() && correctSecondaryOutput == smelterRecipe.getSecondaryOutput()) + continue; + try { + recipeMap.put(recipeMapKey, smelterRecipeConstructor.newInstance(smelterRecipe.getPrimaryInput(), smelterRecipe.getSecondaryInput(), correctOutput, correctSecondaryOutput, smelterRecipe.getSecondaryOutputChance(), smelterRecipe.getEnergy())); + } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { + e.printStackTrace(); + } + } + } + + private void fixRefineryRecipes() + { + final TIntObjectHashMap recipeMap = Util.getField(RefineryManager.class, "recipeMap", null, TIntObjectMap.class); + if (recipeMap == null) + return; + Constructor refineryRecipeConstructor = null; + try { + refineryRecipeConstructor = RefineryManager.RecipeRefinery.class.getDeclaredConstructor(FluidStack.class, FluidStack.class, ItemStack.class, int.class); + refineryRecipeConstructor.setAccessible(true); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } + if (refineryRecipeConstructor == null) + return; + for (final int recipeMapKey : recipeMap.keys()) { + final RefineryManager.RecipeRefinery refineryRecipe = recipeMap.get(recipeMapKey); + final ItemStack correctOutput = resourceHandler.getMainItemStack(refineryRecipe.getOutputItem()); + if (correctOutput == refineryRecipe.getOutputItem()) + continue; + try { + recipeMap.put(recipeMapKey, refineryRecipeConstructor.newInstance(refineryRecipe.getInput(), refineryRecipe.getOutputFluid(), correctOutput, refineryRecipe.getEnergy())); + } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { + e.printStackTrace(); + } + } + } + private void fixRedstoneFurnaceRecipes() { - final Map recipeMap = wanion.lib.common.Util.getField(FurnaceManager.class, "recipeMap", null, Map.class); + final Map recipeMap = Util.getField(FurnaceManager.class, "recipeMap", null, Map.class); if (recipeMap == null) return; Constructor redstoneFurnaceRecipeConstructor = null; @@ -105,7 +160,7 @@ private void fixRedstoneFurnaceRecipes() private void fixPulverizerRecipes() { - final Map recipeMap = wanion.lib.common.Util.getField(PulverizerManager.class, "recipeMap", null, Map.class); + final Map recipeMap = Util.getField(PulverizerManager.class, "recipeMap", null, Map.class); if (recipeMap == null) return; Constructor pulverizerRecipeConstructor = null; @@ -130,32 +185,4 @@ private void fixPulverizerRecipes() } } } - - private void fixInductionSmelterRecipes() - { - final Map, SmelterManager.RecipeSmelter> recipeMap = Util.getField(SmelterManager.class, "recipeMap", null, Map.class); - if (recipeMap == null) - return; - Constructor smelterRecipeConstructor = null; - try { - smelterRecipeConstructor = SmelterManager.RecipeSmelter.class.getDeclaredConstructor(ItemStack.class, ItemStack.class, ItemStack.class, ItemStack.class, int.class, int.class); - smelterRecipeConstructor.setAccessible(true); - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } - if (smelterRecipeConstructor == null) - return; - for (final List recipeMapKey : recipeMap.keySet()) { - final SmelterManager.RecipeSmelter smelterRecipe = recipeMap.get(recipeMapKey); - final ItemStack correctOutput = resourceHandler.getMainItemStack(smelterRecipe.getPrimaryOutput()); - final ItemStack correctSecondaryOutput = resourceHandler.getMainItemStack(smelterRecipe.getSecondaryOutput()); - if (correctOutput == smelterRecipe.getPrimaryOutput() && correctSecondaryOutput == smelterRecipe.getSecondaryOutput()) - continue; - try { - recipeMap.put(recipeMapKey, smelterRecipeConstructor.newInstance(smelterRecipe.getPrimaryInput(), smelterRecipe.getSecondaryInput(), correctOutput, correctSecondaryOutput, smelterRecipe.getSecondaryOutputChance(), smelterRecipe.getEnergy())); - } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { - e.printStackTrace(); - } - } - } } \ No newline at end of file diff --git a/src/main/java/wanion/unidict/integration/TechRebornIntegration.java b/src/main/java/wanion/unidict/integration/TechRebornIntegration.java index 446bb55..41bf550 100644 --- a/src/main/java/wanion/unidict/integration/TechRebornIntegration.java +++ b/src/main/java/wanion/unidict/integration/TechRebornIntegration.java @@ -31,7 +31,7 @@ private void fixTechRebornRecipes() { RecipeHandler.recipeList.forEach(recipe -> { if (!recipe.useOreDic()) - resourceHandler.setMainItemStacks(recipe.getInputs()); + resourceHandler.setMainObjects(recipe.getInputs()); resourceHandler.setMainItemStacks(recipe.getOutputs()); }); } diff --git a/src/main/java/wanion/unidict/resource/ResourceHandler.java b/src/main/java/wanion/unidict/resource/ResourceHandler.java index 2f1daf0..30595ba 100644 --- a/src/main/java/wanion/unidict/resource/ResourceHandler.java +++ b/src/main/java/wanion/unidict/resource/ResourceHandler.java @@ -103,6 +103,13 @@ public void setMainItemStacks(@Nonnull final List thingList) thingList.set(i, getMainItemStack(thingList.get(i))); } + public void setMainObjects(@Nonnull final List thingList) + { + for (int i = 0; i < thingList.size(); i++) + if (thingList.get(i) instanceof ItemStack) + thingList.set(i, getMainItemStack((ItemStack) thingList.get(i))); + } + public ItemStack[] getMainItemStacks(@Nonnull final ItemStack[] things) { for (int i = 0; i < things.length; i++) diff --git a/src/main/java/wanion/unidict/resource/UniResourceContainer.java b/src/main/java/wanion/unidict/resource/UniResourceContainer.java index 9663bc7..2b6a78f 100644 --- a/src/main/java/wanion/unidict/resource/UniResourceContainer.java +++ b/src/main/java/wanion/unidict/resource/UniResourceContainer.java @@ -96,7 +96,7 @@ private void keepOneEntry() return; final Set keepOneEntryBlackSet = ResourceHandler.keepOneEntryBlackSet; if (!keepOneEntryBlackSet.isEmpty()) { - for (Iterator keepOneEntryIterator = entries.subList(1, entries.size()).iterator(); keepOneEntryIterator.hasNext(); ) + for (final Iterator keepOneEntryIterator = entries.subList(1, entries.size()).iterator(); keepOneEntryIterator.hasNext(); ) if (!keepOneEntryBlackSet.contains(keepOneEntryIterator.next())) keepOneEntryIterator.remove(); } else entries.subList(1, entries.size()).clear(); @@ -107,7 +107,7 @@ private void removeBadEntriesFromJEI() if (entries.size() > 1) if (UniDict.getConfig().keepOneEntry) entries.subList(1, entries.size()).forEach(UniJEIPlugin::hide); - else if (!UniResourceHandler.getKindBlackSet().contains(kind)) + else if (!UniResourceHandler.getEntryJEIBlackSet().contains(name) || !UniResourceHandler.getKindJEIBlackSet().contains(kind)) entries.subList(1, entries.size()).forEach(UniJEIPlugin::hide); } diff --git a/src/main/java/wanion/unidict/resource/UniResourceHandler.java b/src/main/java/wanion/unidict/resource/UniResourceHandler.java index aa3ae88..87ae430 100644 --- a/src/main/java/wanion/unidict/resource/UniResourceHandler.java +++ b/src/main/java/wanion/unidict/resource/UniResourceHandler.java @@ -12,8 +12,8 @@ import gnu.trove.list.TIntList; import gnu.trove.map.hash.THashMap; import gnu.trove.map.hash.TIntObjectHashMap; -import gnu.trove.set.TLongSet; -import gnu.trove.set.hash.TLongHashSet; +import gnu.trove.set.TIntSet; +import gnu.trove.set.hash.TIntHashSet; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; @@ -25,7 +25,6 @@ import wanion.unidict.UniDict; import wanion.unidict.UniOreDictionary; import wanion.unidict.api.UniDictAPI; -import wanion.unidict.common.Reference; import javax.annotation.Nonnull; import java.io.BufferedWriter; @@ -40,7 +39,8 @@ public final class UniResourceHandler { - private static final TLongSet kindBlackSet = new TLongHashSet(); + private static final TIntSet kindJEIBlackSet = new TIntHashSet(); + private static final Set entryJEIBlackSet = new HashSet<>(); private static boolean hasInit; private final Map apiResourceMap = new THashMap<>(); private final Map resourceMap = new THashMap<>(); @@ -78,11 +78,16 @@ public static UniResourceHandler create() return new UniResourceHandler(); } - static TLongSet getKindBlackSet() + static synchronized TIntSet getKindJEIBlackSet() { - if (kindBlackSet.isEmpty()) - UniDict.getConfig().hideInJEIBlackSet.forEach(blackKind -> kindBlackSet.add(Resource.getKindOfName(blackKind))); - return kindBlackSet; + if (kindJEIBlackSet.isEmpty()) + UniDict.getConfig().hideInJEIKindBlackSet.forEach(blackKind -> kindJEIBlackSet.add(Resource.getKindOfName(blackKind))); + return kindJEIBlackSet; + } + + static Set getEntryJEIBlackSet() + { + return UniDict.getConfig().hideInJEIEntryBlackSet; } public void init() @@ -188,7 +193,7 @@ private void createAdditionalFiles() bw.newLine(); bw.write("\t\t["); bw.newLine(); - bw.write("\t\t\t\"minecraft\",");; + bw.write("\t\t\t\"minecraft\","); bw.newLine(); bw.write("\t\t\t\"thermalfoundation\","); bw.newLine(); @@ -214,7 +219,7 @@ private void createAdditionalFiles() bw.newLine(); bw.write("\t\t["); bw.newLine(); - bw.write("\t\t\t\"minecraft\",");; + bw.write("\t\t\t\"minecraft\","); bw.newLine(); bw.write("\t\t\t\"thermalfoundation\","); bw.newLine(); diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index d561f06..8ff224b 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modId": "unidict", "name": "UniDict", "description": "a mod about unifying all the things.", - "version": "2.7", + "version": "2.8", "mcversion": "${mcversion}", "url": "http://minecraft.curseforge.com/projects/unidict", "updateUrl": "",