From a2e4cfb66d79870ec5b7f9ec7a2eca00267ce28f Mon Sep 17 00:00:00 2001 From: Zelophed Date: Fri, 16 Oct 2020 18:58:35 +0200 Subject: [PATCH] fixup! Split mixing and mechanical crafting categories --- src/generated/resources/.cache/cache | 20 +- .../resources/assets/create/lang/en_us.json | 4 +- .../assets/create/lang/unfinished/de_de.json | 6 +- .../assets/create/lang/unfinished/fr_fr.json | 4 +- .../assets/create/lang/unfinished/it_it.json | 4 +- .../assets/create/lang/unfinished/ja_jp.json | 4 +- .../assets/create/lang/unfinished/ko_kr.json | 4 +- .../assets/create/lang/unfinished/nl_nl.json | 6 +- .../assets/create/lang/unfinished/pt_br.json | 6 +- .../assets/create/lang/unfinished/ru_ru.json | 6 +- .../assets/create/lang/unfinished/zh_cn.json | 4 +- .../simibubi/create/compat/jei/CreateJEI.java | 193 ++++++++---------- .../category/MechanicalCraftingCategory.java | 32 +-- .../compat/jei/category/MixingCategory.java | 14 +- .../assets/create/lang/default/messages.json | 4 +- 15 files changed, 153 insertions(+), 158 deletions(-) diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 660f7e6b4..7b3af88bc 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -368,16 +368,16 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j 7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json 82524600ca83a766522129634a44b47a277a4b71 assets/create/lang/en_ud.json -ba57282598aa07f9729bf0a7f3072b468fa07fc3 assets/create/lang/en_us.json -84125f41ff3c49ddc9a168afbff3b5827d553ed4 assets/create/lang/unfinished/de_de.json -430e73280908926c3871d563dfd5198af51fa5b1 assets/create/lang/unfinished/fr_fr.json -2c3d9087b1647bf1e942d6ad9de2dbd6e070c9d6 assets/create/lang/unfinished/it_it.json -4018abe8126f2b6cb26f9a315c5debb2bf1c7e4b assets/create/lang/unfinished/ja_jp.json -2d5e80a3d4a44c15f521087e47b02d4384ea89c1 assets/create/lang/unfinished/ko_kr.json -2f4807c936b523f475061fee23b84d627f9b0187 assets/create/lang/unfinished/nl_nl.json -0bc87fc63139aad54909d0a3aa57f9acfcf52940 assets/create/lang/unfinished/pt_br.json -0e980ae9ee05fd260e11c09cbe46f300194adc77 assets/create/lang/unfinished/ru_ru.json -ed4dcf4372f1b2a88474ef35fd4ab062978c708e assets/create/lang/unfinished/zh_cn.json +ceb95c9ec33c0fd8d377a6b7589948d7a2c307b5 assets/create/lang/en_us.json +34e9e276f2e082bb20f3f78662d4ba2d77b2a41d assets/create/lang/unfinished/de_de.json +c7dcd1eea54c09dd0433eb92a529ac99551b29be assets/create/lang/unfinished/fr_fr.json +2cdedaba849e30ed2237f02d36b135f41800119e assets/create/lang/unfinished/it_it.json +665ae9fa760c7cef399e962c6f8c4eedd018c91f assets/create/lang/unfinished/ja_jp.json +4171e22d172669d2d484c4dcbf585cc8c45a15b5 assets/create/lang/unfinished/ko_kr.json +3d82d42dba4d700d1a95b48390c25aa07d4a0939 assets/create/lang/unfinished/nl_nl.json +e848ccedee3b2df7830736055808e84a0b26bbb8 assets/create/lang/unfinished/pt_br.json +ebd0aa7eced5d3f87e541f61d589220a147c6fae assets/create/lang/unfinished/ru_ru.json +8373638521a2e51ed52ff055c7b0f60795411c08 assets/create/lang/unfinished/zh_cn.json 846200eb548d3bfa2e77b41039de159b4b6cfb45 assets/create/models/block/acacia_window.json 1930fa3a3c98d53dd19e4ee7f55bc27fd47aa281 assets/create/models/block/acacia_window_pane_noside.json 1763ea2c9b981d187f5031ba608f3d5d3be3986a assets/create/models/block/acacia_window_pane_noside_alt.json diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index 6264cf5f4..622a30a18 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -547,9 +547,11 @@ "create.recipe.blasting_via_fan.fan": "Fan behind Lava", "create.recipe.pressing": "Pressing", "create.recipe.mixing": "Mixing", + "create.recipe.shapeless_mixing": "Shapeless Crafting", "create.recipe.packing": "Compacting", "create.recipe.sawing": "Sawing", - "create.recipe.mechanical_crafting": "Mechanical Crafting", + "create.recipe.mechanical_crafting": "Crafting", + "create.recipe.mechanical_crafting_exclusive": "Mechanical Crafting", "create.recipe.block_cutting": "Block Cutting", "create.recipe.blockzapper_upgrade": "Handheld Blockzapper", "create.recipe.sandpaper_polishing": "Sandpaper Polishing", diff --git a/src/generated/resources/assets/create/lang/unfinished/de_de.json b/src/generated/resources/assets/create/lang/unfinished/de_de.json index 4d7ef58e6..4c1a02534 100644 --- a/src/generated/resources/assets/create/lang/unfinished/de_de.json +++ b/src/generated/resources/assets/create/lang/unfinished/de_de.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 918", + "_": "Missing Localizations: 920", "_": "->------------------------] Game Elements [------------------------<-", @@ -548,9 +548,11 @@ "create.recipe.blasting_via_fan.fan": "Propeller hinter Lava", "create.recipe.pressing": "Mechanische Presse", "create.recipe.mixing": "UNLOCALIZED: Mixing", + "create.recipe.shapeless_mixing": "UNLOCALIZED: Shapeless Crafting", "create.recipe.packing": "UNLOCALIZED: Compacting", "create.recipe.sawing": "UNLOCALIZED: Sawing", - "create.recipe.mechanical_crafting": "UNLOCALIZED: Mechanical Crafting", + "create.recipe.mechanical_crafting": "UNLOCALIZED: Crafting", + "create.recipe.mechanical_crafting_exclusive": "UNLOCALIZED: Mechanical Crafting", "create.recipe.block_cutting": "UNLOCALIZED: Block Cutting", "create.recipe.blockzapper_upgrade": "Blockpistole", "create.recipe.sandpaper_polishing": "UNLOCALIZED: Sandpaper Polishing", diff --git a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json index 580c2bff4..a1f01ad5d 100644 --- a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json +++ b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 543", + "_": "Missing Localizations: 545", "_": "->------------------------] Game Elements [------------------------<-", @@ -548,9 +548,11 @@ "create.recipe.blasting_via_fan.fan": "Ventilateur derrière de la lave", "create.recipe.pressing": "Pressage", "create.recipe.mixing": "Mixage", + "create.recipe.shapeless_mixing": "UNLOCALIZED: Shapeless Crafting", "create.recipe.packing": "Compactage", "create.recipe.sawing": "UNLOCALIZED: Sawing", "create.recipe.mechanical_crafting": "Fabrication mécanique", + "create.recipe.mechanical_crafting_exclusive": "UNLOCALIZED: Mechanical Crafting", "create.recipe.block_cutting": "Coupe de bloc", "create.recipe.blockzapper_upgrade": "Blockzappeur portable", "create.recipe.sandpaper_polishing": "Polissage au papier de verre", diff --git a/src/generated/resources/assets/create/lang/unfinished/it_it.json b/src/generated/resources/assets/create/lang/unfinished/it_it.json index f2e87ffb7..d08c73d2e 100644 --- a/src/generated/resources/assets/create/lang/unfinished/it_it.json +++ b/src/generated/resources/assets/create/lang/unfinished/it_it.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 531", + "_": "Missing Localizations: 533", "_": "->------------------------] Game Elements [------------------------<-", @@ -548,9 +548,11 @@ "create.recipe.blasting_via_fan.fan": "UNLOCALIZED: Fan behind Lava", "create.recipe.pressing": "Pressatura", "create.recipe.mixing": "Mescolamento", + "create.recipe.shapeless_mixing": "UNLOCALIZED: Shapeless Crafting", "create.recipe.packing": "Compattazione", "create.recipe.sawing": "UNLOCALIZED: Sawing", "create.recipe.mechanical_crafting": "Creazione Meccanico", + "create.recipe.mechanical_crafting_exclusive": "UNLOCALIZED: Mechanical Crafting", "create.recipe.block_cutting": "Taglio Blocco", "create.recipe.blockzapper_upgrade": "UNLOCALIZED: Handheld Blockzapper", "create.recipe.sandpaper_polishing": "Carta Vetrata Levigata", diff --git a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json index d9a3a643c..3bf076f8e 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json +++ b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 526", + "_": "Missing Localizations: 528", "_": "->------------------------] Game Elements [------------------------<-", @@ -548,9 +548,11 @@ "create.recipe.blasting_via_fan.fan": "溶岩の後ろにファンを置く", "create.recipe.pressing": "押しつぶし", "create.recipe.mixing": "混合", + "create.recipe.shapeless_mixing": "UNLOCALIZED: Shapeless Crafting", "create.recipe.packing": "圧縮", "create.recipe.sawing": "UNLOCALIZED: Sawing", "create.recipe.mechanical_crafting": "メカニカルクラフト", + "create.recipe.mechanical_crafting_exclusive": "UNLOCALIZED: Mechanical Crafting", "create.recipe.block_cutting": "ブロックカット", "create.recipe.blockzapper_upgrade": "携帯型ブロックザッパー", "create.recipe.sandpaper_polishing": "紙やすりでの研磨", diff --git a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json index e00f3297e..e4d28985c 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json +++ b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 531", + "_": "Missing Localizations: 533", "_": "->------------------------] Game Elements [------------------------<-", @@ -548,9 +548,11 @@ "create.recipe.blasting_via_fan.fan": "UNLOCALIZED: Fan behind Lava", "create.recipe.pressing": "압착", "create.recipe.mixing": "혼합", + "create.recipe.shapeless_mixing": "UNLOCALIZED: Shapeless Crafting", "create.recipe.packing": "압축", "create.recipe.sawing": "UNLOCALIZED: Sawing", "create.recipe.mechanical_crafting": "기계 조합", + "create.recipe.mechanical_crafting_exclusive": "UNLOCALIZED: Mechanical Crafting", "create.recipe.block_cutting": "블럭 절단", "create.recipe.blockzapper_upgrade": "UNLOCALIZED: Handheld Blockzapper", "create.recipe.sandpaper_polishing": "사포 연마", diff --git a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json index b22bc0d58..b8ce77f30 100644 --- a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json +++ b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 857", + "_": "Missing Localizations: 859", "_": "->------------------------] Game Elements [------------------------<-", @@ -548,9 +548,11 @@ "create.recipe.blasting_via_fan.fan": "Ventilator achter Lava", "create.recipe.pressing": "Persen", "create.recipe.mixing": "Mengen", + "create.recipe.shapeless_mixing": "UNLOCALIZED: Shapeless Crafting", "create.recipe.packing": "Compressen", "create.recipe.sawing": "UNLOCALIZED: Sawing", - "create.recipe.mechanical_crafting": "UNLOCALIZED: Mechanical Crafting", + "create.recipe.mechanical_crafting": "UNLOCALIZED: Crafting", + "create.recipe.mechanical_crafting_exclusive": "UNLOCALIZED: Mechanical Crafting", "create.recipe.block_cutting": "Blok Zagen", "create.recipe.blockzapper_upgrade": "Blokzapper", "create.recipe.sandpaper_polishing": "UNLOCALIZED: Sandpaper Polishing", diff --git a/src/generated/resources/assets/create/lang/unfinished/pt_br.json b/src/generated/resources/assets/create/lang/unfinished/pt_br.json index c06d01224..609f87712 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pt_br.json +++ b/src/generated/resources/assets/create/lang/unfinished/pt_br.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 925", + "_": "Missing Localizations: 927", "_": "->------------------------] Game Elements [------------------------<-", @@ -548,9 +548,11 @@ "create.recipe.blasting_via_fan.fan": "Ventilador atras de Lava", "create.recipe.pressing": "Prensa Mecânica", "create.recipe.mixing": "UNLOCALIZED: Mixing", + "create.recipe.shapeless_mixing": "UNLOCALIZED: Shapeless Crafting", "create.recipe.packing": "UNLOCALIZED: Compacting", "create.recipe.sawing": "UNLOCALIZED: Sawing", - "create.recipe.mechanical_crafting": "UNLOCALIZED: Mechanical Crafting", + "create.recipe.mechanical_crafting": "UNLOCALIZED: Crafting", + "create.recipe.mechanical_crafting_exclusive": "UNLOCALIZED: Mechanical Crafting", "create.recipe.block_cutting": "UNLOCALIZED: Block Cutting", "create.recipe.blockzapper_upgrade": "Blockzapper Portátil", "create.recipe.sandpaper_polishing": "UNLOCALIZED: Sandpaper Polishing", diff --git a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json index 92a5c796d..fa50db719 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json +++ b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 919", + "_": "Missing Localizations: 921", "_": "->------------------------] Game Elements [------------------------<-", @@ -548,9 +548,11 @@ "create.recipe.blasting_via_fan.fan": "Вентелятор за лавой", "create.recipe.pressing": "Механический пресс", "create.recipe.mixing": "UNLOCALIZED: Mixing", + "create.recipe.shapeless_mixing": "UNLOCALIZED: Shapeless Crafting", "create.recipe.packing": "UNLOCALIZED: Compacting", "create.recipe.sawing": "UNLOCALIZED: Sawing", - "create.recipe.mechanical_crafting": "UNLOCALIZED: Mechanical Crafting", + "create.recipe.mechanical_crafting": "UNLOCALIZED: Crafting", + "create.recipe.mechanical_crafting_exclusive": "UNLOCALIZED: Mechanical Crafting", "create.recipe.block_cutting": "UNLOCALIZED: Block Cutting", "create.recipe.blockzapper_upgrade": "Портативный размещатель блоков", "create.recipe.sandpaper_polishing": "UNLOCALIZED: Sandpaper Polishing", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json index 981a35b91..ef32d87f1 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 213", + "_": "Missing Localizations: 215", "_": "->------------------------] Game Elements [------------------------<-", @@ -548,9 +548,11 @@ "create.recipe.blasting_via_fan.fan": "UNLOCALIZED: Fan behind Lava", "create.recipe.pressing": "金属压片", "create.recipe.mixing": "混合搅拌", + "create.recipe.shapeless_mixing": "UNLOCALIZED: Shapeless Crafting", "create.recipe.packing": "压块塑形", "create.recipe.sawing": "UNLOCALIZED: Sawing", "create.recipe.mechanical_crafting": "自动合成", + "create.recipe.mechanical_crafting_exclusive": "UNLOCALIZED: Mechanical Crafting", "create.recipe.block_cutting": "方块切割", "create.recipe.blockzapper_upgrade": "UNLOCALIZED: Handheld Blockzapper", "create.recipe.sandpaper_polishing": "砂纸抛光", diff --git a/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java b/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java index 815a5aa09..5514ed8d1 100644 --- a/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java +++ b/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java @@ -1,28 +1,11 @@ package com.simibubi.create.compat.jei; -import java.util.List; -import java.util.stream.Collectors; - -import com.google.common.base.Predicate; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllItems; import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.Create; -import com.simibubi.create.compat.jei.category.BlastingViaFanCategory; -import com.simibubi.create.compat.jei.category.BlockCuttingCategory; +import com.simibubi.create.compat.jei.category.*; import com.simibubi.create.compat.jei.category.BlockCuttingCategory.CondensedBlockCuttingRecipe; -import com.simibubi.create.compat.jei.category.BlockzapperUpgradeCategory; -import com.simibubi.create.compat.jei.category.CrushingCategory; -import com.simibubi.create.compat.jei.category.MechanicalCraftingCategory; -import com.simibubi.create.compat.jei.category.MillingCategory; -import com.simibubi.create.compat.jei.category.MixingCategory; -import com.simibubi.create.compat.jei.category.MysteriousItemConversionCategory; -import com.simibubi.create.compat.jei.category.PackingCategory; -import com.simibubi.create.compat.jei.category.PolishingCategory; -import com.simibubi.create.compat.jei.category.PressingCategory; -import com.simibubi.create.compat.jei.category.SawingCategory; -import com.simibubi.create.compat.jei.category.SmokingViaFanCategory; -import com.simibubi.create.compat.jei.category.SplashingCategory; import com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity; import com.simibubi.create.content.contraptions.processing.BasinRecipe; import com.simibubi.create.content.logistics.block.inventories.AdjustableCrateScreen; @@ -31,31 +14,26 @@ import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.config.CRecipes; import com.simibubi.create.foundation.fluid.FluidIngredient; import com.simibubi.create.foundation.utility.Lang; - import mezz.jei.api.IModPlugin; import mezz.jei.api.JeiPlugin; import mezz.jei.api.ingredients.IIngredientType; -import mezz.jei.api.registration.IGuiHandlerRegistration; -import mezz.jei.api.registration.IRecipeCatalystRegistration; -import mezz.jei.api.registration.IRecipeCategoryRegistration; -import mezz.jei.api.registration.IRecipeRegistration; -import mezz.jei.api.registration.ISubtypeRegistration; +import mezz.jei.api.registration.*; import net.minecraft.block.Blocks; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.ICraftingRecipe; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.item.crafting.IRecipeSerializer; -import net.minecraft.item.crafting.IRecipeType; -import net.minecraft.item.crafting.ShapedRecipe; +import net.minecraft.item.crafting.*; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TextFormatting; +import java.util.List; +import java.util.function.Predicate; +import java.util.stream.Collectors; + @JeiPlugin public class CreateJEI implements IModPlugin { - private static ResourceLocation ID = new ResourceLocation(Create.ID, "jei_plugin"); + private static final ResourceLocation ID = new ResourceLocation(Create.ID, "jei_plugin"); public static final IIngredientType FLUIDS = new IIngredientType() { @@ -65,20 +43,22 @@ public class CreateJEI implements IModPlugin { } }; - private MillingCategory millingCategory; - private CrushingCategory crushingCategory; - private SplashingCategory splashingCategory; - private SmokingViaFanCategory smokingCategory; - private PressingCategory pressingCategory; - private BlastingViaFanCategory blastingCategory; - private BlockzapperUpgradeCategory blockzapperCategory; - private MixingCategory mixingCategory; - private SawingCategory sawingCategory; - private BlockCuttingCategory blockCuttingCategory; - private PackingCategory packingCategory; - private PolishingCategory polishingCategory; - private MysteriousItemConversionCategory mysteryConversionCategory; - private MechanicalCraftingCategory mechanicalCraftingCategory; + private final MillingCategory millingCategory; + private final CrushingCategory crushingCategory; + private final SplashingCategory splashingCategory; + private final SmokingViaFanCategory smokingCategory; + private final PressingCategory pressingCategory; + private final BlastingViaFanCategory blastingCategory; + private final BlockzapperUpgradeCategory blockzapperCategory; + private final MixingCategory shapelessMixingCategory; + private final MixingCategory mixingCategory; + private final SawingCategory sawingCategory; + private final BlockCuttingCategory blockCuttingCategory; + private final PackingCategory packingCategory; + private final PolishingCategory polishingCategory; + private final MysteriousItemConversionCategory mysteryConversionCategory; + private final MechanicalCraftingCategory mechanicalCraftingCategory; + private final MechanicalCraftingCategory mechanicalCraftingExclusiveCategory; @Override public ResourceLocation getPluginUid() { @@ -93,13 +73,15 @@ public class CreateJEI implements IModPlugin { smokingCategory = new SmokingViaFanCategory(); blastingCategory = new BlastingViaFanCategory(); blockzapperCategory = new BlockzapperUpgradeCategory(); - mixingCategory = new MixingCategory(); + shapelessMixingCategory = new MixingCategory(true); + mixingCategory = new MixingCategory(false); sawingCategory = new SawingCategory(); blockCuttingCategory = new BlockCuttingCategory(); packingCategory = new PackingCategory(); polishingCategory = new PolishingCategory(); mysteryConversionCategory = new MysteriousItemConversionCategory(); - mechanicalCraftingCategory = new MechanicalCraftingCategory(); + mechanicalCraftingCategory = new MechanicalCraftingCategory(true); + mechanicalCraftingExclusiveCategory = new MechanicalCraftingCategory(false); } @Override @@ -109,10 +91,7 @@ public class CreateJEI implements IModPlugin { @Override public void registerCategories(IRecipeCategoryRegistration registration) { - registration.addRecipeCategories(millingCategory, crushingCategory, splashingCategory, pressingCategory, - smokingCategory, blastingCategory, blockzapperCategory, mixingCategory, sawingCategory, - blockCuttingCategory, packingCategory, polishingCategory, mysteryConversionCategory, - mechanicalCraftingCategory); + registration.addRecipeCategories(millingCategory, crushingCategory, splashingCategory, pressingCategory, smokingCategory, blastingCategory, blockzapperCategory, mixingCategory, shapelessMixingCategory, sawingCategory, blockCuttingCategory, packingCategory, polishingCategory, mysteryConversionCategory, mechanicalCraftingCategory, mechanicalCraftingExclusiveCategory); } @Override @@ -121,83 +100,89 @@ public class CreateJEI implements IModPlugin { registration.addRecipes(findRecipes(AllRecipeTypes.MILLING), millingCategory.getUid()); registration.addRecipes(findRecipes(AllRecipeTypes.CRUSHING), crushingCategory.getUid()); - registration.addRecipes( - findRecipesByTypeExcluding(AllRecipeTypes.MILLING.getType(), AllRecipeTypes.CRUSHING.getType()), - crushingCategory.getUid()); + registration.addRecipes(findRecipesByTypeExcluding(AllRecipeTypes.MILLING.getType(), AllRecipeTypes.CRUSHING.getType()), crushingCategory.getUid()); registration.addRecipes(findRecipes(AllRecipeTypes.SPLASHING), splashingCategory.getUid()); registration.addRecipes(findRecipes(AllRecipeTypes.PRESSING), pressingCategory.getUid()); - registration.addRecipes(findRecipesById(AllRecipeTypes.BLOCKZAPPER_UPGRADE.serializer.getRegistryName()), - blockzapperCategory.getUid()); + registration.addRecipes(findRecipesById(AllRecipeTypes.BLOCKZAPPER_UPGRADE.serializer.getRegistryName()), blockzapperCategory.getUid()); registration.addRecipes(findRecipesByType(IRecipeType.SMOKING), smokingCategory.getUid()); - registration.addRecipes(findRecipesByTypeExcluding(IRecipeType.SMELTING, IRecipeType.SMOKING), - blastingCategory.getUid()); + registration.addRecipes(findRecipesByTypeExcluding(IRecipeType.SMELTING, IRecipeType.SMOKING), blastingCategory.getUid()); registration.addRecipes(findRecipes(AllRecipeTypes.MIXING), mixingCategory.getUid()); if (recipeConfig.allowShapelessInMixer.get()) - registration.addRecipes(findRecipes(r -> r.getSerializer() == IRecipeSerializer.CRAFTING_SHAPELESS - && !MechanicalPressTileEntity.canCompress(r.getIngredients())).stream() - .map(BasinRecipe::convert) - .collect(Collectors.toList()), - mixingCategory.getUid()); + registration.addRecipes( + findRecipes(r -> r.getSerializer() == IRecipeSerializer.CRAFTING_SHAPELESS && !MechanicalPressTileEntity.canCompress(r.getIngredients())) + .stream() + .map(BasinRecipe::convert) + .collect(Collectors.toList()), + shapelessMixingCategory.getUid()); registration.addRecipes(findRecipes(AllRecipeTypes.CUTTING), sawingCategory.getUid()); if (recipeConfig.allowStonecuttingOnSaw.get()) - registration.addRecipes( - CondensedBlockCuttingRecipe.condenseRecipes(findRecipesByType(IRecipeType.STONECUTTING)), - blockCuttingCategory.getUid()); + registration.addRecipes(CondensedBlockCuttingRecipe.condenseRecipes(findRecipesByType(IRecipeType.STONECUTTING)), blockCuttingCategory.getUid()); registration.addRecipes(findRecipes(AllRecipeTypes.COMPACTING), packingCategory.getUid()); + if (recipeConfig.allowShapedSquareInPress.get()) - registration.addRecipes(findRecipes( - r -> (r instanceof ICraftingRecipe) && MechanicalPressTileEntity.canCompress(r.getIngredients())) - .stream() - .map(BasinRecipe::convert) - .collect(Collectors.toList()), - packingCategory.getUid()); + registration.addRecipes( + findRecipes(r -> (r instanceof ICraftingRecipe) && MechanicalPressTileEntity.canCompress(r.getIngredients())) + .stream() + .map(BasinRecipe::convert) + .collect(Collectors.toList()), + packingCategory.getUid()); registration.addRecipes(findRecipes(AllRecipeTypes.SANDPAPER_POLISHING), polishingCategory.getUid()); registration.addRecipes(MysteriousItemConversionCategory.getRecipes(), mysteryConversionCategory.getUid()); - registration.addRecipes(findRecipes(r -> (r.getType() == AllRecipeTypes.MECHANICAL_CRAFTING.type)), - mechanicalCraftingCategory.getUid()); + registration.addRecipes(findRecipes(r -> (r.getType() == AllRecipeTypes.MECHANICAL_CRAFTING.type)), mechanicalCraftingExclusiveCategory.getUid()); if (recipeConfig.allowRegularCraftingInCrafter.get()) - registration.addRecipes(findRecipes( - r -> (r.getType() == IRecipeType.CRAFTING && r.getType() != AllRecipeTypes.MECHANICAL_CRAFTING.type) - && (r instanceof ShapedRecipe)), - mechanicalCraftingCategory.getUid()); + registration.addRecipes( + findRecipes(r -> (r.getType() == IRecipeType.CRAFTING && r.getType() != AllRecipeTypes.MECHANICAL_CRAFTING.type) && (r instanceof ShapedRecipe)), + mechanicalCraftingCategory.getUid()); } @Override public void registerRecipeCatalysts(IRecipeCatalystRegistration registration) { ItemStack fan = new ItemStack(AllBlocks.ENCASED_FAN.get()); - ItemStack splashingFan = fan.copy() - .setDisplayName(new StringTextComponent(TextFormatting.RESET + Lang.translate("recipe.splashing.fan"))); - ItemStack smokingFan = fan.copy() - .setDisplayName(new StringTextComponent(TextFormatting.RESET + Lang.translate("recipe.smokingViaFan.fan"))); - ItemStack blastingFan = fan.copy() - .setDisplayName( - new StringTextComponent(TextFormatting.RESET + Lang.translate("recipe.blastingViaFan.fan"))); + ItemStack splashingFan = fan.copy().setDisplayName(new StringTextComponent(TextFormatting.RESET + Lang.translate("recipe.splashing.fan"))); + ItemStack smokingFan = fan.copy().setDisplayName(new StringTextComponent(TextFormatting.RESET + Lang.translate("recipe.smokingViaFan.fan"))); + ItemStack blastingFan = fan.copy().setDisplayName(new StringTextComponent(TextFormatting.RESET + Lang.translate("recipe.blastingViaFan.fan"))); registration.addRecipeCatalyst(new ItemStack(AllBlocks.MILLSTONE.get()), millingCategory.getUid()); + registration.addRecipeCatalyst(new ItemStack(AllBlocks.CRUSHING_WHEEL.get()), crushingCategory.getUid()); + registration.addRecipeCatalyst(splashingFan, splashingCategory.getUid()); + registration.addRecipeCatalyst(smokingFan, smokingCategory.getUid()); + registration.addRecipeCatalyst(blastingFan, blastingCategory.getUid()); + registration.addRecipeCatalyst(new ItemStack(AllBlocks.MECHANICAL_PRESS.get()), pressingCategory.getUid()); + registration.addRecipeCatalyst(new ItemStack(AllItems.BLOCKZAPPER.get()), blockzapperCategory.getUid()); + + registration.addRecipeCatalyst(new ItemStack(AllBlocks.MECHANICAL_MIXER.get()), shapelessMixingCategory.getUid()); + registration.addRecipeCatalyst(new ItemStack(AllBlocks.BASIN.get()), shapelessMixingCategory.getUid()); + registration.addRecipeCatalyst(new ItemStack(AllBlocks.MECHANICAL_MIXER.get()), mixingCategory.getUid()); registration.addRecipeCatalyst(new ItemStack(AllBlocks.BASIN.get()), mixingCategory.getUid()); + registration.addRecipeCatalyst(new ItemStack(AllBlocks.MECHANICAL_SAW.get()), sawingCategory.getUid()); + registration.addRecipeCatalyst(new ItemStack(AllBlocks.MECHANICAL_SAW.get()), blockCuttingCategory.getUid()); registration.addRecipeCatalyst(new ItemStack(Blocks.STONECUTTER), blockCuttingCategory.getUid()); + registration.addRecipeCatalyst(new ItemStack(AllBlocks.MECHANICAL_PRESS.get()), packingCategory.getUid()); registration.addRecipeCatalyst(new ItemStack(AllBlocks.BASIN.get()), packingCategory.getUid()); + registration.addRecipeCatalyst(AllItems.SAND_PAPER.asStack(), polishingCategory.getUid()); registration.addRecipeCatalyst(AllItems.RED_SAND_PAPER.asStack(), polishingCategory.getUid()); - registration.addRecipeCatalyst(new ItemStack(AllBlocks.MECHANICAL_CRAFTER.get()), - mechanicalCraftingCategory.getUid()); + + registration.addRecipeCatalyst(new ItemStack(AllBlocks.MECHANICAL_CRAFTER.get()), mechanicalCraftingCategory.getUid()); + + registration.addRecipeCatalyst(new ItemStack(AllBlocks.MECHANICAL_CRAFTER.get()), mechanicalCraftingExclusiveCategory.getUid()); } @Override @@ -210,30 +195,20 @@ public class CreateJEI implements IModPlugin { return findRecipesByType(recipe.type); } - private static List> findRecipes(Predicate> pred) { + private static List> findRecipes(Predicate> predicate) { return Minecraft.getInstance().world.getRecipeManager() - .getRecipes() - .stream() - .filter(pred) - .collect(Collectors.toList()); + .getRecipes() + .stream() + .filter(predicate) + .collect(Collectors.toList()); } private static List> findRecipesByType(IRecipeType type) { - return Minecraft.getInstance().world.getRecipeManager() - .getRecipes() - .stream() - .filter(r -> r.getType() == type) - .collect(Collectors.toList()); + return findRecipes(r -> r.getType() == type); } private static List> findRecipesById(ResourceLocation id) { - return Minecraft.getInstance().world.getRecipeManager() - .getRecipes() - .stream() - .filter(r -> r.getSerializer() - .getRegistryName() - .equals(id)) - .collect(Collectors.toList()); + return findRecipes(r -> r.getSerializer().getRegistryName().equals(id)); } private static List> findRecipesByTypeExcluding(IRecipeType type, IRecipeType excludingType) { @@ -241,15 +216,9 @@ public class CreateJEI implements IModPlugin { List> byExcludingType = findRecipesByType(excludingType); byType.removeIf(recipe -> { for (IRecipe r : byExcludingType) { - ItemStack[] matchingStacks = recipe.getIngredients() - .get(0) - .getMatchingStacks(); - if (matchingStacks.length == 0) - return true; - if (r.getIngredients() - .get(0) - .test(matchingStacks[0])) - return true; + ItemStack[] matchingStacks = recipe.getIngredients().get(0).getMatchingStacks(); + if (matchingStacks.length == 0) return true; + if (r.getIngredients().get(0).test(matchingStacks[0])) return true; } return false; }); diff --git a/src/main/java/com/simibubi/create/compat/jei/category/MechanicalCraftingCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/MechanicalCraftingCategory.java index 8f93ffa81..3b38e6d70 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/MechanicalCraftingCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/MechanicalCraftingCategory.java @@ -1,15 +1,9 @@ package com.simibubi.create.compat.jei.category; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - import com.mojang.blaze3d.systems.RenderSystem; import com.simibubi.create.AllBlocks; import com.simibubi.create.compat.jei.category.animations.AnimatedCrafter; import com.simibubi.create.foundation.gui.AllGuiTextures; - import mezz.jei.api.constants.VanillaTypes; import mezz.jei.api.gui.IRecipeLayout; import mezz.jei.api.gui.ingredient.IGuiItemStackGroup; @@ -29,11 +23,16 @@ import net.minecraft.util.NonNullList; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextFormatting; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + public class MechanicalCraftingCategory extends CreateRecipeCategory { - private final class CrafterIngredientRenderer implements IIngredientRenderer { + private static final class CrafterIngredientRenderer implements IIngredientRenderer { - private ShapedRecipe recipe; + private final ShapedRecipe recipe; public CrafterIngredientRenderer(ShapedRecipe recipe) { this.recipe = recipe; @@ -57,7 +56,7 @@ public class MechanicalCraftingCategory extends CreateRecipeCategory