JEI Traveling down the Recipe Chain

- Added JEI integration for polishing and the chromatic compound shenanigans
- Added more missing recipes
- Added some machine-specific ingredients
This commit is contained in:
simibubi 2020-01-27 23:25:59 +01:00
parent 5ecfa7792c
commit 8259a0c275
63 changed files with 737 additions and 40 deletions

View file

@ -88,6 +88,8 @@ public enum AllItems {
FLOUR(ingredient()),
DOUGH(ingredient()),
PROPELLER(ingredient()),
WHISK(ingredient()),
BRASS_HAND(ingredient()),
WRENCH(new WrenchItem(standardItemProperties().setTEISR(() -> () -> renderUsing(AllItemRenderers.WRENCH))), true),
GOGGLES(new GogglesItem(standardItemProperties()), true),

View file

@ -2,6 +2,7 @@ package com.simibubi.create;
import java.util.function.Supplier;
import com.simibubi.create.compat.jei.ConversionRecipe;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.modules.contraptions.components.crafter.MechanicalCraftingRecipe;
import com.simibubi.create.modules.contraptions.components.crusher.CrushingRecipe;
@ -34,6 +35,7 @@ public enum AllRecipes {
CUTTING(processingSerializer(CuttingRecipe::new)),
MIXING(processingSerializer(MixingRecipe::new)),
SANDPAPER_POLISHING(processingSerializer(SandPaperPolishingRecipe::new)),
CONVERSION(processingSerializer(ConversionRecipe::new)),
;

View file

@ -73,6 +73,7 @@ public enum ScreenResources {
JEI_LONG_ARROW("jei/widgets.png", 19, 0, 71, 10),
JEI_DOWN_ARROW("jei/widgets.png", 0, 21, 18, 14),
JEI_LIGHT("jei/widgets.png", 0, 42, 52, 11),
JEI_QUESTION_MARK("jei/widgets.png", 0, 178, 12, 16),
JEI_SHADOW("jei/widgets.png", 0, 56, 52, 11),
BLOCKZAPPER_UPGRADE_RECIPE("jei/widgets.png", 0, 75, 144, 66),

View file

@ -0,0 +1,49 @@
package com.simibubi.create.compat.jei;
import java.util.Arrays;
import java.util.List;
import com.simibubi.create.AllRecipes;
import com.simibubi.create.Create;
import com.simibubi.create.modules.contraptions.processing.ProcessingIngredient;
import com.simibubi.create.modules.contraptions.processing.ProcessingOutput;
import com.simibubi.create.modules.contraptions.processing.ProcessingRecipe;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.items.wrapper.RecipeWrapper;
/**
* Helper recipe type for displaying an item relationship in JEI
*
* @author simibubi
*
*/
public class ConversionRecipe extends ProcessingRecipe<RecipeWrapper> {
public ConversionRecipe(ResourceLocation id, String group, List<ProcessingIngredient> ingredients,
List<ProcessingOutput> results, int processingDuration) {
super(AllRecipes.CONVERSION, id, group, ingredients, results, processingDuration);
}
static int counter = 0;
public static ConversionRecipe create(ItemStack from, ItemStack to) {
List<ProcessingIngredient> ingredients = Arrays.asList(new ProcessingIngredient(Ingredient.fromStacks(from)));
List<ProcessingOutput> outputs = Arrays.asList(new ProcessingOutput(to, 1));
return new ConversionRecipe(new ResourceLocation(Create.ID, "conversion_" + counter++), ingredients, outputs);
}
public ConversionRecipe(ResourceLocation id, List<ProcessingIngredient> ingredients,
List<ProcessingOutput> results) {
this(id, "conversions", ingredients, results, -1);
}
@Override
public boolean matches(RecipeWrapper inv, World worldIn) {
return false;
}
}

View file

@ -9,7 +9,19 @@ import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllItems;
import com.simibubi.create.AllRecipes;
import com.simibubi.create.Create;
import com.simibubi.create.compat.jei.BlockCuttingCategory.CondensedBlockCuttingRecipe;
import com.simibubi.create.compat.jei.category.BlastingViaFanCategory;
import com.simibubi.create.compat.jei.category.BlockCuttingCategory;
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.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.foundation.utility.Lang;
import com.simibubi.create.modules.contraptions.components.mixer.MixingRecipe;
import com.simibubi.create.modules.contraptions.components.press.MechanicalPressTileEntity;
@ -50,6 +62,8 @@ public class CreateJEI implements IModPlugin {
private SawingCategory sawingCategory;
private BlockCuttingCategory blockCuttingCategory;
private PackingCategory packingCategory;
private PolishingCategory polishingCategory;
private MysteriousItemConversionCategory mysteryConversionCategory;
@Override
public ResourceLocation getPluginUid() {
@ -67,6 +81,8 @@ public class CreateJEI implements IModPlugin {
sawingCategory = new SawingCategory();
blockCuttingCategory = new BlockCuttingCategory();
packingCategory = new PackingCategory();
polishingCategory = new PolishingCategory();
mysteryConversionCategory = new MysteriousItemConversionCategory();
}
@Override
@ -78,7 +94,7 @@ public class CreateJEI implements IModPlugin {
public void registerCategories(IRecipeCategoryRegistration registration) {
registration.addRecipeCategories(crushingCategory, splashingCategory, pressingCategory, smokingCategory,
blastingCategory, blockzapperCategory, mixingCategory, sawingCategory, blockCuttingCategory,
packingCategory);
packingCategory, polishingCategory, mysteryConversionCategory);
}
@Override
@ -103,6 +119,8 @@ public class CreateJEI implements IModPlugin {
registration.addRecipes(findRecipes(
r -> (r instanceof ICraftingRecipe) && MechanicalPressTileEntity.canCompress(r.getIngredients())),
packingCategory.getUid());
registration.addRecipes(findRecipes(AllRecipes.SANDPAPER_POLISHING), polishingCategory.getUid());
registration.addRecipes(MysteriousItemConversionCategory.getRecipes(), mysteryConversionCategory.getUid());
}
@Override
@ -129,6 +147,8 @@ public class CreateJEI implements IModPlugin {
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());
}
@Override
@ -172,7 +192,7 @@ public class CreateJEI implements IModPlugin {
return byType;
}
static void addStochasticTooltip(IGuiItemStackGroup itemStacks, List<ProcessingOutput> results) {
public static void addStochasticTooltip(IGuiItemStackGroup itemStacks, List<ProcessingOutput> results) {
itemStacks.addTooltipCallback((slotIndex, input, ingredient, tooltip) -> {
if (input)
return;
@ -183,7 +203,7 @@ public class CreateJEI implements IModPlugin {
});
}
static void addCatalystTooltip(IGuiItemStackGroup itemStacks, Map<Integer, Float> catalystIndices) {
public static void addCatalystTooltip(IGuiItemStackGroup itemStacks, Map<Integer, Float> catalystIndices) {
itemStacks.addTooltipCallback((slotIndex, input, ingredient, tooltip) -> {
if (!input)
return;

View file

@ -1,8 +1,9 @@
package com.simibubi.create.compat.jei;
package com.simibubi.create.compat.jei.category;
import com.mojang.blaze3d.platform.GlStateManager;
import com.simibubi.create.AllItems;
import com.simibubi.create.Create;
import com.simibubi.create.compat.jei.DoubleItemIcon;
import com.simibubi.create.foundation.gui.ScreenElementRenderer;
import com.simibubi.create.foundation.utility.Lang;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.compat.jei;
package com.simibubi.create.compat.jei.category;
import java.util.ArrayList;
import java.util.Arrays;
@ -7,7 +7,10 @@ import java.util.List;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.Create;
import com.simibubi.create.ScreenResources;
import com.simibubi.create.compat.jei.BlockCuttingCategory.CondensedBlockCuttingRecipe;
import com.simibubi.create.compat.jei.DoubleItemIcon;
import com.simibubi.create.compat.jei.EmptyBackground;
import com.simibubi.create.compat.jei.category.BlockCuttingCategory.CondensedBlockCuttingRecipe;
import com.simibubi.create.compat.jei.category.animations.AnimatedSaw;
import com.simibubi.create.foundation.item.ItemHelper;
import com.simibubi.create.foundation.utility.Lang;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.compat.jei;
package com.simibubi.create.compat.jei.category;
import static com.simibubi.create.ScreenResources.BLOCKZAPPER_UPGRADE_RECIPE;
@ -10,6 +10,8 @@ import java.util.stream.Collectors;
import com.mojang.blaze3d.platform.GlStateManager;
import com.simibubi.create.AllItems;
import com.simibubi.create.Create;
import com.simibubi.create.compat.jei.DoubleItemIcon;
import com.simibubi.create.compat.jei.ScreenResourceWrapper;
import com.simibubi.create.foundation.gui.ScreenElementRenderer;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.modules.curiosities.blockzapper.BlockzapperUpgradeRecipe;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.compat.jei;
package com.simibubi.create.compat.jei.category;
import java.util.Arrays;
import java.util.List;
@ -7,6 +7,10 @@ import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllItems;
import com.simibubi.create.Create;
import com.simibubi.create.ScreenResources;
import com.simibubi.create.compat.jei.CreateJEI;
import com.simibubi.create.compat.jei.DoubleItemIcon;
import com.simibubi.create.compat.jei.EmptyBackground;
import com.simibubi.create.compat.jei.category.animations.AnimatedCrushingWheels;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.modules.contraptions.components.crusher.CrushingRecipe;
import com.simibubi.create.modules.contraptions.processing.ProcessingOutput;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.compat.jei;
package com.simibubi.create.compat.jei.category;
import java.util.Arrays;
import java.util.HashMap;
@ -12,6 +12,10 @@ import org.apache.commons.lang3.tuple.Pair;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.Create;
import com.simibubi.create.ScreenResources;
import com.simibubi.create.compat.jei.CreateJEI;
import com.simibubi.create.compat.jei.DoubleItemIcon;
import com.simibubi.create.compat.jei.EmptyBackground;
import com.simibubi.create.compat.jei.category.animations.AnimatedMixer;
import com.simibubi.create.foundation.item.ItemHelper;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.modules.contraptions.components.mixer.MixingRecipe;

View file

@ -0,0 +1,95 @@
package com.simibubi.create.compat.jei.category;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.simibubi.create.AllItems;
import com.simibubi.create.Create;
import com.simibubi.create.ScreenResources;
import com.simibubi.create.compat.jei.ConversionRecipe;
import com.simibubi.create.compat.jei.CreateJEI;
import com.simibubi.create.compat.jei.DoubleItemIcon;
import com.simibubi.create.compat.jei.EmptyBackground;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.modules.contraptions.processing.ProcessingOutput;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.drawable.IDrawable;
import mezz.jei.api.gui.ingredient.IGuiItemStackGroup;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.category.IRecipeCategory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
public class MysteriousItemConversionCategory implements IRecipeCategory<ConversionRecipe> {
private static ResourceLocation ID = new ResourceLocation(Create.ID, "mystery_conversion");
private IDrawable icon;
private IDrawable background = new EmptyBackground(177, 50);
public static List<ConversionRecipe> getRecipes() {
List<ConversionRecipe> recipes = new ArrayList<>();
recipes.add(ConversionRecipe.create(AllItems.CHROMATIC_COMPOUND.asStack(), AllItems.SHADOW_STEEL.asStack()));
recipes.add(ConversionRecipe.create(AllItems.CHROMATIC_COMPOUND.asStack(), AllItems.REFINED_RADIANCE.asStack()));
return recipes;
}
public MysteriousItemConversionCategory() {
icon = new DoubleItemIcon(() -> AllItems.CHROMATIC_COMPOUND.asStack(), () -> ItemStack.EMPTY);
}
@Override
public IDrawable getIcon() {
return icon;
}
@Override
public ResourceLocation getUid() {
return ID;
}
@Override
public Class<? extends ConversionRecipe> getRecipeClass() {
return ConversionRecipe.class;
}
@Override
public String getTitle() {
return Lang.translate("recipe.mystery_conversion");
}
@Override
public IDrawable getBackground() {
return background;
}
@Override
public void setIngredients(ConversionRecipe recipe, IIngredients ingredients) {
ingredients.setInputIngredients(recipe.getIngredients());
ingredients.setOutputs(VanillaTypes.ITEM, recipe.getPossibleOutputs());
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, ConversionRecipe recipe, IIngredients ingredients) {
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
List<ProcessingOutput> results = recipe.getRollableResults();
itemStacks.init(0, true, 26, 16);
itemStacks.set(0, Arrays.asList(recipe.getIngredients().get(0).getMatchingStacks()));
itemStacks.init(1, false, 131, 16);
itemStacks.set(1, results.get(0).getStack());
CreateJEI.addStochasticTooltip(itemStacks, results);
}
@Override
public void draw(ConversionRecipe recipe, double mouseX, double mouseY) {
ScreenResources.JEI_SLOT.draw(26, 16);
ScreenResources.JEI_SLOT.draw(131, 16);
ScreenResources.JEI_LONG_ARROW.draw(52, 20);
ScreenResources.JEI_QUESTION_MARK.draw(77, 5);
}
}

View file

@ -1,10 +1,13 @@
package com.simibubi.create.compat.jei;
package com.simibubi.create.compat.jei.category;
import java.util.Arrays;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.Create;
import com.simibubi.create.ScreenResources;
import com.simibubi.create.compat.jei.DoubleItemIcon;
import com.simibubi.create.compat.jei.EmptyBackground;
import com.simibubi.create.compat.jei.category.animations.AnimatedPress;
import com.simibubi.create.foundation.utility.Lang;
import mezz.jei.api.constants.VanillaTypes;

View file

@ -0,0 +1,109 @@
package com.simibubi.create.compat.jei.category;
import java.util.Arrays;
import java.util.List;
import com.mojang.blaze3d.platform.GlStateManager;
import com.simibubi.create.AllItems;
import com.simibubi.create.Create;
import com.simibubi.create.ScreenResources;
import com.simibubi.create.compat.jei.CreateJEI;
import com.simibubi.create.compat.jei.DoubleItemIcon;
import com.simibubi.create.compat.jei.EmptyBackground;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.modules.contraptions.processing.ProcessingOutput;
import com.simibubi.create.modules.curiosities.tools.SandPaperPolishingRecipe;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.drawable.IDrawable;
import mezz.jei.api.gui.ingredient.IGuiItemStackGroup;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.category.IRecipeCategory;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
public class PolishingCategory implements IRecipeCategory<SandPaperPolishingRecipe> {
private static ResourceLocation ID = new ResourceLocation(Create.ID, "sandpaper_polishing");
private IDrawable icon;
private IDrawable background = new EmptyBackground(177, 55);
private ItemStack renderedSandpaper;
public PolishingCategory() {
icon = new DoubleItemIcon(() -> AllItems.SAND_PAPER.asStack(), () -> ItemStack.EMPTY);
renderedSandpaper = AllItems.SAND_PAPER.asStack();
}
@Override
public IDrawable getIcon() {
return icon;
}
@Override
public ResourceLocation getUid() {
return ID;
}
@Override
public Class<? extends SandPaperPolishingRecipe> getRecipeClass() {
return SandPaperPolishingRecipe.class;
}
@Override
public String getTitle() {
return Lang.translate("recipe.sandpaper_polishing");
}
@Override
public IDrawable getBackground() {
return background;
}
@Override
public void setIngredients(SandPaperPolishingRecipe recipe, IIngredients ingredients) {
ingredients.setInputIngredients(recipe.getIngredients());
ingredients.setOutputs(VanillaTypes.ITEM, recipe.getPossibleOutputs());
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, SandPaperPolishingRecipe recipe, IIngredients ingredients) {
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
List<ProcessingOutput> results = recipe.getRollableResults();
itemStacks.init(0, true, 26, 28);
itemStacks.set(0, Arrays.asList(recipe.getIngredients().get(0).getMatchingStacks()));
itemStacks.init(1, false, 131, 28);
itemStacks.set(1, results.get(0).getStack());
CreateJEI.addStochasticTooltip(itemStacks, results);
}
@Override
public void draw(SandPaperPolishingRecipe recipe, double mouseX, double mouseY) {
ScreenResources.JEI_SLOT.draw(26, 28);
ScreenResources.JEI_SLOT.draw(131, 28);
ScreenResources.JEI_SHADOW.draw(61, 21);
ScreenResources.JEI_LONG_ARROW.draw(52, 32);
NonNullList<Ingredient> ingredients = recipe.getIngredients();
ItemStack[] matchingStacks = ingredients.get(0).getMatchingStacks();
if (matchingStacks.length == 0)
return;
GlStateManager.pushMatrix();
CompoundNBT tag = renderedSandpaper.getOrCreateTag();
tag.put("Polishing", matchingStacks[0].serializeNBT());
tag.putBoolean("JEI", true);
ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer();
GlStateManager.scaled(2, 2, 2);
itemRenderer.renderItemIntoGUI(renderedSandpaper, getBackground().getWidth() / 4 - 8, 1);
GlStateManager.popMatrix();
}
}

View file

@ -1,4 +1,4 @@
package com.simibubi.create.compat.jei;
package com.simibubi.create.compat.jei.category;
import java.util.Arrays;
import java.util.List;
@ -7,6 +7,10 @@ import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllItems;
import com.simibubi.create.Create;
import com.simibubi.create.ScreenResources;
import com.simibubi.create.compat.jei.CreateJEI;
import com.simibubi.create.compat.jei.DoubleItemIcon;
import com.simibubi.create.compat.jei.EmptyBackground;
import com.simibubi.create.compat.jei.category.animations.AnimatedPress;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.modules.contraptions.components.press.PressingRecipe;
import com.simibubi.create.modules.contraptions.processing.ProcessingOutput;

View file

@ -1,10 +1,12 @@
package com.simibubi.create.compat.jei;
package com.simibubi.create.compat.jei.category;
import java.util.Arrays;
import com.mojang.blaze3d.platform.GlStateManager;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.ScreenResources;
import com.simibubi.create.compat.jei.EmptyBackground;
import com.simibubi.create.compat.jei.category.animations.AnimatedKinetics;
import com.simibubi.create.foundation.gui.ScreenElementRenderer;
import mezz.jei.api.constants.VanillaTypes;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.compat.jei;
package com.simibubi.create.compat.jei.category;
import java.util.Arrays;
import java.util.List;
@ -6,6 +6,10 @@ import java.util.List;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.Create;
import com.simibubi.create.ScreenResources;
import com.simibubi.create.compat.jei.CreateJEI;
import com.simibubi.create.compat.jei.DoubleItemIcon;
import com.simibubi.create.compat.jei.EmptyBackground;
import com.simibubi.create.compat.jei.category.animations.AnimatedSaw;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.modules.contraptions.components.saw.CuttingRecipe;
import com.simibubi.create.modules.contraptions.processing.ProcessingOutput;

View file

@ -1,7 +1,8 @@
package com.simibubi.create.compat.jei;
package com.simibubi.create.compat.jei.category;
import com.simibubi.create.AllItems;
import com.simibubi.create.Create;
import com.simibubi.create.compat.jei.DoubleItemIcon;
import com.simibubi.create.foundation.gui.ScreenElementRenderer;
import com.simibubi.create.foundation.utility.Lang;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.compat.jei;
package com.simibubi.create.compat.jei.category;
import java.util.Arrays;
import java.util.List;
@ -7,6 +7,9 @@ import com.mojang.blaze3d.platform.GlStateManager;
import com.simibubi.create.AllItems;
import com.simibubi.create.Create;
import com.simibubi.create.ScreenResources;
import com.simibubi.create.compat.jei.CreateJEI;
import com.simibubi.create.compat.jei.DoubleItemIcon;
import com.simibubi.create.compat.jei.EmptyBackground;
import com.simibubi.create.foundation.gui.ScreenElementRenderer;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.modules.contraptions.components.fan.SplashingRecipe;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.compat.jei;
package com.simibubi.create.compat.jei.category.animations;
import com.mojang.blaze3d.platform.GlStateManager;
import com.simibubi.create.AllBlocks;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.compat.jei;
package com.simibubi.create.compat.jei.category.animations;
import com.simibubi.create.foundation.utility.AnimationTickHolder;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.compat.jei;
package com.simibubi.create.compat.jei.category.animations;
import com.mojang.blaze3d.platform.GlStateManager;
import com.simibubi.create.AllBlocks;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.compat.jei;
package com.simibubi.create.compat.jei.category.animations;
import static com.simibubi.create.foundation.utility.AnimationTickHolder.ticks;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.compat.jei;
package com.simibubi.create.compat.jei.category.animations;
import com.mojang.blaze3d.platform.GlStateManager;
import com.simibubi.create.AllBlocks;

View file

@ -6,6 +6,7 @@ import org.apache.commons.lang3.tuple.Pair;
import com.mojang.blaze3d.platform.GlStateManager;
import com.simibubi.create.foundation.block.render.CustomRenderItemBakedModel;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.player.ClientPlayerEntity;
@ -35,9 +36,11 @@ public class SandPaperItemRenderer extends ItemStackTileEntityRenderer {
GlStateManager.translatef(.5f, .5f, .5f);
CompoundNBT tag = stack.getOrCreateTag();
boolean jeiMode = tag.contains("JEI");
if (tag.contains("Polishing")) {
GlStateManager.pushMatrix();
if (mainModel.transformType == TransformType.GUI) {
GlStateManager.translatef(0.0F, .2f, 1.0F);
GlStateManager.scalef(.75f, .75f, .75f);
@ -45,18 +48,19 @@ public class SandPaperItemRenderer extends ItemStackTileEntityRenderer {
int modifier = leftHand ? -1 : 1;
GlStateManager.rotatef(modifier * 40, 0, 1, 0);
}
// Reverse bobbing
float time = (float) player.getItemInUseCount() - partialTicks + 1.0F;
float time = (float) (!jeiMode ? player.getItemInUseCount()
: (-AnimationTickHolder.ticks) % stack.getUseDuration()) - partialTicks + 1.0F;
if (time / (float) stack.getUseDuration() < 0.8F) {
float bobbing = -MathHelper.abs(MathHelper.cos(time / 4.0F * (float) Math.PI) * 0.1F);
if (mainModel.transformType == TransformType.GUI)
if (mainModel.transformType == TransformType.GUI)
GlStateManager.translatef(bobbing, bobbing, 0.0F);
else
else
GlStateManager.translatef(0.0f, bobbing, 0.0F);
}
ItemStack toPolish = ItemStack.read(tag.getCompound("Polishing"));
itemRenderer.renderItem(toPolish, itemRenderer.getModelWithOverrides(toPolish).getBakedModel());

View file

@ -24,6 +24,8 @@
"item.create.lapis_plate": "Lapis Plating",
"item.create.obsidian_dust": "Powdered Obsidian",
"item.create.propeller": "Propeller",
"item.create.whisk": "Whisk",
"item.create.brass_hand": "Hand",
"item.create.flour": "Wheat Flour",
"item.create.dough": "Dough",
"item.create.wrench": "Wrench",
@ -228,6 +230,8 @@
"create.recipe.sawing": "Sawing",
"create.recipe.block_cutting": "Block Cutting",
"create.recipe.blockzapperUpgrade": "Handheld Blockzapper",
"create.recipe.sandpaper_polishing": "Sandpaper Polishing",
"create.recipe.mystery_conversion": "Chromatic Metamorphosis",
"create.recipe.processing.catalyst": "Catalyst",
"create.recipe.processing.chance": "%1$s%% Chance",
"create.recipe.processing.chanceToReturn": "%1$s%% Chance to return",

View file

@ -1,4 +1,5 @@
{
"credit": "Made with Blockbench",
"textures": {
"axis_top": "create:block/axis_top",
"fan_blades": "create:block/fan_blades",
@ -24,8 +25,7 @@
"to": [15, 15, 12],
"rotation": {"angle": 22.5, "axis": "z", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [1, 1, 15, 15], "texture": "#fan_blades"},
"south": {"uv": [1, 1, 15, 15], "texture": "#fan_blades"}
"north": {"uv": [1, 1, 15, 15], "texture": "#fan_blades"}
}
}
]

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "create:item/brass_hand"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "create:item/whisk"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 515 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 B

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

View file

@ -0,0 +1,9 @@
{
"type": "minecraft:blasting",
"ingredient": {
"tag": "forge:ores/copper"
},
"result": "create:copper_ingot",
"experience": 0.1,
"cookingtime": 100
}

View file

@ -0,0 +1,9 @@
{
"type": "minecraft:blasting",
"ingredient": {
"tag": "forge:ores/zinc"
},
"result": "create:zinc_ingot",
"experience": 0.1,
"cookingtime": 100
}

View file

@ -0,0 +1,29 @@
{
"type": "crafting_shaped",
"pattern": [
"EG",
"EO",
" O"
],
"key": {
"E": {
"item": "create:refined_radiance"
},
"O": {
"item": "minecraft:obsidian"
},
"G": {
"item": "create:cogwheel"
}
},
"result": {
"item": "create:deforester",
"count": 1
},
"conditions": [
{
"type": "create:module",
"module": "curiosities"
}
]
}

View file

@ -0,0 +1,24 @@
{
"type": "crafting_shaped",
"pattern": [
"NWN"
],
"key": {
"N": {
"tag": "forge:nuggets/iron"
},
"W": {
"tag": "minecraft:wool"
}
},
"result": {
"item": "create:filter",
"count": 1
},
"conditions": [
{
"type": "create:module",
"module": "curiosities"
}
]
}

View file

@ -0,0 +1,28 @@
{
"type": "crafting_shaped",
"pattern": [
" S ",
"GPG"
],
"key": {
"S": {
"tag": "forge:string"
},
"G": {
"tag": "forge:glass"
},
"P": {
"tag": "forge:plates/gold"
}
},
"result": {
"item": "create:goggles",
"count": 1
},
"conditions": [
{
"type": "create:module",
"module": "curiosities"
}
]
}

View file

@ -2,8 +2,8 @@
"type": "crafting_shaped",
"pattern": [
" E",
" A ",
"AO "
" O ",
"OA "
],
"key": {
"E": {

View file

@ -0,0 +1,24 @@
{
"type": "crafting_shaped",
"pattern": [
"NWN"
],
"key": {
"N": {
"tag": "forge:nuggets/copper"
},
"W": {
"tag": "minecraft:wool"
}
},
"result": {
"item": "create:property_filter",
"count": 1
},
"conditions": [
{
"type": "create:module",
"module": "curiosities"
}
]
}

View file

@ -0,0 +1,29 @@
{
"type": "crafting_shaped",
"pattern": [
"PP",
"PG",
" S"
],
"key": {
"S": {
"tag": "forge:rods/wooden"
},
"G": {
"item": "create:cogwheel"
},
"P": {
"tag": "forge:plates/gold"
}
},
"result": {
"item": "create:wrench",
"count": 1
},
"conditions": [
{
"type": "create:module",
"module": "curiosities"
}
]
}

View file

@ -2,7 +2,7 @@
"type": "crafting_shaped",
"pattern": [
"AAA",
"ASA",
"CSC",
"AAA"
],
"key": {
@ -10,8 +10,11 @@
"tag": "minecraft:planks"
},
"S": {
"item": "create:andesite_alloy"
}
"tag": "minecraft:logs"
},
"C": {
"item": "create:andesite_alloy"
}
},
"result": {
"item": "create:andesite_casing",

View file

@ -2,7 +2,7 @@
"type": "crafting_shaped",
"pattern": [
"AAA",
"SSS",
"CSC",
"AAA"
],
"key": {
@ -10,8 +10,11 @@
"tag": "minecraft:planks"
},
"S": {
"tag": "forge:plates/brass"
}
"tag": "minecraft:logs"
},
"C": {
"tag": "forge:plates/brass"
}
},
"result": {
"item": "create:brass_casing",

View file

@ -0,0 +1,22 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"###",
"###",
"###"
],
"key": {
"#": {
"tag": "forge:nuggets/brass"
}
},
"result": {
"item": "create:brass_ingot"
},
"conditions": [
{
"type": "create:module",
"module": "contraptions"
}
]
}

View file

@ -0,0 +1,22 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"###",
"###",
"###"
],
"key": {
"#": {
"tag": "forge:nuggets/copper"
}
},
"result": {
"item": "create:copper_ingot"
},
"conditions": [
{
"type": "create:module",
"module": "contraptions"
}
]
}

View file

@ -0,0 +1,22 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"###",
"###",
"###"
],
"key": {
"#": {
"tag": "forge:nuggets/zinc"
}
},
"result": {
"item": "create:zinc_ingot"
},
"conditions": [
{
"type": "create:module",
"module": "contraptions"
}
]
}

View file

@ -0,0 +1,12 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"tag": "forge:ingots/brass"
}
],
"result": {
"item": "create:brass_nugget",
"count": 9
}
}

View file

@ -0,0 +1,12 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"tag": "forge:ingots/copper"
}
],
"result": {
"item": "create:copper_nugget",
"count": 9
}
}

View file

@ -0,0 +1,12 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"tag": "forge:ingots/zinc"
}
],
"result": {
"item": "create:zinc_nugget",
"count": 9
}
}

View file

@ -0,0 +1,26 @@
{
"type": "create:crushing",
"group": "minecraft:misc",
"ingredients": [
{
"tag": "forge:ores/copper"
}
],
"results": [
{
"item": "create:crushed_copper",
"count": 1
},
{
"item": "create:crushed_copper",
"count": 2,
"chance": 0.3
},
{
"item": "minecraft:cobblestone",
"count": 1,
"chance": 0.125
}
],
"processingTime": 350
}

View file

@ -3,7 +3,7 @@
"group": "minecraft:misc",
"ingredients": [
{
"item": "minecraft:gold_ore"
"tag": "forge:ores/gold"
}
],
"results": [

View file

@ -3,7 +3,7 @@
"group": "minecraft:misc",
"ingredients": [
{
"item": "minecraft:iron_ore"
"tag": "forge:ores/iron"
}
],
"results": [

View file

@ -0,0 +1,26 @@
{
"type": "create:crushing",
"group": "minecraft:misc",
"ingredients": [
{
"tag": "forge:ores/zinc"
}
],
"results": [
{
"item": "create:crushed_zinc",
"count": 1
},
{
"item": "create:crushed_zinc",
"count": 2,
"chance": 0.3
},
{
"item": "minecraft:cobblestone",
"count": 1,
"chance": 0.125
}
],
"processingTime": 350
}

View file

@ -0,0 +1,9 @@
{
"type": "minecraft:smelting",
"ingredient": {
"tag": "forge:ores/copper"
},
"result": "create:copper_ingot",
"experience": 0.1,
"cookingtime": 200
}

View file

@ -0,0 +1,9 @@
{
"type": "minecraft:smelting",
"ingredient": {
"tag": "forge:ores/zinc"
},
"result": "create:zinc_ingot",
"experience": 0.1,
"cookingtime": 200
}

View file

@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"#forge:ores/copper",
"#forge:ores/zinc"
]
}

View file

@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"create:copper_ore"
]
}

View file

@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"create:zinc_ore"
]
}

View file

@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"#forge:ores/copper",
"#forge:ores/zinc"
]
}

View file

@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"create:copper_ore"
]
}

View file

@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"create:zinc_ore"
]
}