fixup! Split mixing and mechanical crafting categories

This commit is contained in:
Zelophed 2020-10-16 18:58:35 +02:00
parent 022bcdd620
commit a2e4cfb66d
15 changed files with 153 additions and 158 deletions

View file

@ -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

View file

@ -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",

View file

@ -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",

View file

@ -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",

View file

@ -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",

View file

@ -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": "紙やすりでの研磨",

View file

@ -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": "사포 연마",

View file

@ -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",

View file

@ -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",

View file

@ -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",

View file

@ -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": "砂纸抛光",

View file

@ -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<FluidIngredient> FLUIDS = new IIngredientType<FluidIngredient>() {
@ -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,36 +100,32 @@ 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()
registration.addRecipes(
findRecipes(r -> r.getSerializer() == IRecipeSerializer.CRAFTING_SHAPELESS && !MechanicalPressTileEntity.canCompress(r.getIngredients()))
.stream()
.map(BasinRecipe::convert)
.collect(Collectors.toList()),
mixingCategory.getUid());
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()))
registration.addRecipes(
findRecipes(r -> (r instanceof ICraftingRecipe) && MechanicalPressTileEntity.canCompress(r.getIngredients()))
.stream()
.map(BasinRecipe::convert)
.collect(Collectors.toList()),
@ -158,13 +133,11 @@ public class CreateJEI implements IModPlugin {
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)),
registration.addRecipes(
findRecipes(r -> (r.getType() == IRecipeType.CRAFTING && r.getType() != AllRecipeTypes.MECHANICAL_CRAFTING.type) && (r instanceof ShapedRecipe)),
mechanicalCraftingCategory.getUid());
}
@ -172,32 +145,44 @@ public class CreateJEI implements IModPlugin {
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<IRecipe<?>> findRecipes(Predicate<IRecipe<?>> pred) {
private static List<IRecipe<?>> findRecipes(Predicate<IRecipe<?>> predicate) {
return Minecraft.getInstance().world.getRecipeManager()
.getRecipes()
.stream()
.filter(pred)
.filter(predicate)
.collect(Collectors.toList());
}
private static List<IRecipe<?>> 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<IRecipe<?>> 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<IRecipe<?>> findRecipesByTypeExcluding(IRecipeType<?> type, IRecipeType<?> excludingType) {
@ -241,15 +216,9 @@ public class CreateJEI implements IModPlugin {
List<IRecipe<?>> 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;
});

View file

@ -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<ShapedRecipe> {
private final class CrafterIngredientRenderer implements IIngredientRenderer<ItemStack> {
private static final class CrafterIngredientRenderer implements IIngredientRenderer<ItemStack> {
private ShapedRecipe recipe;
private final ShapedRecipe recipe;
public CrafterIngredientRenderer(ShapedRecipe recipe) {
this.recipe = recipe;
@ -95,10 +94,13 @@ public class MechanicalCraftingCategory extends CreateRecipeCategory<ShapedRecip
}
}
private AnimatedCrafter crafter = new AnimatedCrafter();
private final AnimatedCrafter crafter = new AnimatedCrafter();
public MechanicalCraftingCategory() {
super("mechanical_crafting", itemIcon(AllBlocks.MECHANICAL_CRAFTER.get()), emptyBackground(177, 107));
public MechanicalCraftingCategory(boolean isForNormalCraftingOnly) {
super(
isForNormalCraftingOnly ? "mechanical_crafting" : "mechanical_crafting_exclusive",
itemIcon(AllBlocks.MECHANICAL_CRAFTER.get()),
emptyBackground(177, 107));
}
@Override
@ -158,7 +160,7 @@ public class MechanicalCraftingCategory extends CreateRecipeCategory<ShapedRecip
for (int col = 0; col < recipe.getWidth(); col++)
if (!recipe.getIngredients().get(row * recipe.getWidth() + col).hasNoMatchingItems()) {
RenderSystem.pushMatrix();
RenderSystem.translated((int) col * 19 * scale, (int) row * 19 * scale, 0);
RenderSystem.translated(col * 19 * scale, row * 19 * scale, 0);
RenderSystem.scaled(scale, scale, scale);
AllGuiTextures.JEI_SLOT.draw(0, 0);
RenderSystem.popMatrix();

View file

@ -8,11 +8,13 @@ import com.simibubi.create.content.contraptions.processing.HeatCondition;
public class MixingCategory extends BasinCategory {
private AnimatedMixer mixer = new AnimatedMixer();
private AnimatedBlazeBurner heater = new AnimatedBlazeBurner();
private final AnimatedMixer mixer = new AnimatedMixer();
private final AnimatedBlazeBurner heater = new AnimatedBlazeBurner();
public MixingCategory() {
super("mixing", doubleItemIcon(AllBlocks.MECHANICAL_MIXER.get(), AllBlocks.BASIN.get()),
public MixingCategory(boolean isForShapelessCraftingOnly) {
super(
isForShapelessCraftingOnly ? "shapeless_mixing" : "mixing",
doubleItemIcon(AllBlocks.MECHANICAL_MIXER.get(), AllBlocks.BASIN.get()),
emptyBackground(177, 103));
}

View file

@ -22,9 +22,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",