Merge branch 'mc1.15/dev' into mc1.16/dev

# Conflicts:
#	src/generated/resources/.cache/cache
#	src/main/java/com/simibubi/create/compat/jei/CreateJEI.java
#	src/main/java/com/simibubi/create/compat/jei/category/MechanicalCraftingCategory.java
#	src/main/java/com/simibubi/create/compat/jei/category/MixingCategory.java
This commit is contained in:
Zelophed 2020-10-16 19:11:29 +02:00
commit b5802bb0e8
16 changed files with 3329 additions and 139 deletions

File diff suppressed because it is too large Load diff

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,30 +14,25 @@ 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.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>() {
@ -64,20 +42,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() {
@ -92,13 +72,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
@ -108,10 +90,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
@ -120,36 +99,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()),
@ -157,13 +132,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());
}
@ -171,6 +144,9 @@ 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(Lang.translate("recipe.splashing.fan").formatted(TextFormatting.RESET));
@ -182,23 +158,39 @@ public class CreateJEI implements IModPlugin {
.setDisplayName(Lang.translate("recipe.blastingViaFan.fan").formatted(TextFormatting.RESET));
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
@ -211,30 +203,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) {
@ -242,15 +224,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

@ -9,7 +9,6 @@ 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 +28,16 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent;
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;
@ -79,10 +83,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

View file

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

@ -1,10 +1,5 @@
package com.simibubi.create.content.logistics.block.mechanicalArm;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nullable;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.logistics.block.mechanicalArm.ArmInteractionPoint.Jukebox;
import com.simibubi.create.content.logistics.block.mechanicalArm.ArmInteractionPoint.Mode;
@ -20,7 +15,6 @@ import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.foundation.utility.NBTHelper;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.BlockState;
import net.minecraft.block.JukeboxBlock;
import net.minecraft.item.ItemStack;
@ -33,6 +27,10 @@ import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraftforge.common.util.Constants.NBT;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
public class ArmTileEntity extends KineticTileEntity {
// Server
@ -70,6 +68,7 @@ public class ArmTileEntity extends KineticTileEntity {
super(typeIn);
inputs = new ArrayList<>();
outputs = new ArrayList<>();
interactionPointTag = new ListNBT();
heldItem = ItemStack.EMPTY;
phase = Phase.SEARCH_INPUTS;
baseAngle = new InterpolatedAngle();

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