From 1e7078fe5680297e62eca1cd8da7167b2398adfa Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Sun, 18 Jul 2021 17:37:14 +0200 Subject: [PATCH] One-liner marathon - Version bump - Implement #1969 - Guard emptying JEI integration from empty item outputs, addresses #1994 - Goggles icon no longer renders when menu button is set invisible, addresses #1979 - Fixed missing blaze burner in JEI's display of heated compacting recipes, addresses #1970 --- gradle.properties | 2 +- src/main/java/com/simibubi/create/Create.java | 2 +- .../jei/category/CreateRecipeCategory.java | 18 ++++++++++++------ .../compat/jei/category/DeployingCategory.java | 2 ++ .../compat/jei/category/ItemDrainCategory.java | 2 ++ .../compat/jei/category/PackingCategory.java | 9 ++++++++- .../jei/category/animations/AnimatedPress.java | 4 ++-- .../config/ui/OpenCreateMenuButton.java | 2 ++ src/main/resources/META-INF/mods.toml | 2 +- 9 files changed, 31 insertions(+), 12 deletions(-) diff --git a/gradle.properties b/gradle.properties index a7c03ba82..73f5b705b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ org.gradle.jvmargs = -Xmx3G org.gradle.daemon = false # mod version info -mod_version = 0.3.2b +mod_version = 0.3.2c minecraft_version = 1.16.5 forge_version = 36.1.32 diff --git a/src/main/java/com/simibubi/create/Create.java b/src/main/java/com/simibubi/create/Create.java index 952135f5b..22a229a9f 100644 --- a/src/main/java/com/simibubi/create/Create.java +++ b/src/main/java/com/simibubi/create/Create.java @@ -56,7 +56,7 @@ public class Create { public static final String ID = "create"; public static final String NAME = "Create"; - public static final String VERSION = "0.3.2b"; + public static final String VERSION = "0.3.2c"; public static final Logger LOGGER = LogManager.getLogger(); diff --git a/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java index 6bd5e69f8..359c4ee06 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java @@ -70,7 +70,7 @@ public abstract class CreateRecipeCategory> implements IRec return icon; } - protected static AllGuiTextures getRenderedSlot(IRecipe recipe, int index) { + public static AllGuiTextures getRenderedSlot(IRecipe recipe, int index) { AllGuiTextures jeiSlot = AllGuiTextures.JEI_SLOT; if (!(recipe instanceof ProcessingRecipe)) return jeiSlot; @@ -85,23 +85,29 @@ public abstract class CreateRecipeCategory> implements IRec return AllGuiTextures.JEI_CHANCE_SLOT; } - protected static IDrawable emptyBackground(int width, int height) { + public static IDrawable emptyBackground(int width, int height) { return new EmptyBackground(width, height); } - protected static IDrawable doubleItemIcon(IItemProvider item1, IItemProvider item2) { + public static IDrawable doubleItemIcon(IItemProvider item1, IItemProvider item2) { return new DoubleItemIcon(() -> new ItemStack(item1), () -> new ItemStack(item2)); } - protected static IDrawable itemIcon(IItemProvider item) { + public static IDrawable itemIcon(IItemProvider item) { return new DoubleItemIcon(() -> new ItemStack(item), () -> ItemStack.EMPTY); } - protected static void addStochasticTooltip(IGuiItemStackGroup itemStacks, List results) { + public static void addStochasticTooltip(IGuiItemStackGroup itemStacks, List results) { + addStochasticTooltip(itemStacks, results, 1); + } + + public static void addStochasticTooltip(IGuiItemStackGroup itemStacks, List results, int startIndex) { itemStacks.addTooltipCallback((slotIndex, input, ingredient, tooltip) -> { if (input) return; - ProcessingOutput output = results.get(slotIndex - 1); + if (slotIndex < startIndex) + return; + ProcessingOutput output = results.get(slotIndex - startIndex); float chance = output.getChance(); if (chance != 1) tooltip.add(1, Lang.translate("recipe.processing.chance", chance < 0.01 ? "<1" : (int) (chance * 100)) diff --git a/src/main/java/com/simibubi/create/compat/jei/category/DeployingCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/DeployingCategory.java index ce0a0748b..f3fc6ee9e 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/DeployingCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/DeployingCategory.java @@ -53,6 +53,8 @@ public class DeployingCategory extends CreateRecipeCategory { ItemStack result = handler.getContainer(); if (extracted.isEmpty()) return; + if (result.isEmpty()) + return; Ingredient ingredient = Ingredient.of(stack); ResourceLocation itemName = stack.getItem() diff --git a/src/main/java/com/simibubi/create/compat/jei/category/PackingCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/PackingCategory.java index 1e44ef274..dac7c0e38 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/PackingCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/PackingCategory.java @@ -4,8 +4,10 @@ import java.util.Arrays; import com.mojang.blaze3d.matrix.MatrixStack; import com.simibubi.create.AllBlocks; +import com.simibubi.create.compat.jei.category.animations.AnimatedBlazeBurner; import com.simibubi.create.compat.jei.category.animations.AnimatedPress; import com.simibubi.create.content.contraptions.processing.BasinRecipe; +import com.simibubi.create.content.contraptions.processing.HeatCondition; import com.simibubi.create.foundation.gui.AllGuiTextures; import mezz.jei.api.gui.IRecipeLayout; @@ -19,6 +21,7 @@ import net.minecraft.util.NonNullList; public class PackingCategory extends BasinCategory { private AnimatedPress press = new AnimatedPress(true); + private final AnimatedBlazeBurner heater = new AnimatedBlazeBurner(); private PackingType type; enum PackingType { @@ -80,7 +83,11 @@ public class PackingCategory extends BasinCategory { AllGuiTextures.JEI_SHADOW.draw(matrixStack, 81, 68); } - press.draw(matrixStack, getBackground().getWidth() / 2 + 6, 40); + HeatCondition requiredHeat = recipe.getRequiredHeat(); + if (requiredHeat != HeatCondition.NONE) + heater.withHeat(requiredHeat.visualizeAsBlazeBurner()) + .draw(matrixStack, getBackground().getWidth() / 2 + 3, 55); + press.draw(matrixStack, getBackground().getWidth() / 2 + 3, 34); } } diff --git a/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedPress.java b/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedPress.java index 98414e0da..ebfe6b88e 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedPress.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedPress.java @@ -19,10 +19,10 @@ public class AnimatedPress extends AnimatedKinetics { @Override public void draw(MatrixStack matrixStack, int xOffset, int yOffset) { matrixStack.pushPose(); - matrixStack.translate(xOffset, yOffset, 100); + matrixStack.translate(xOffset, yOffset, 200); matrixStack.mulPose(Vector3f.XP.rotationDegrees(-15.5f)); matrixStack.mulPose(Vector3f.YP.rotationDegrees(22.5f)); - int scale = basin ? 20 : 24; + int scale = basin ? 23 : 24; defaultBlockElement(shaft(Axis.Z)) .rotateBlock(0, 0, getCurrentAngle()) diff --git a/src/main/java/com/simibubi/create/foundation/config/ui/OpenCreateMenuButton.java b/src/main/java/com/simibubi/create/foundation/config/ui/OpenCreateMenuButton.java index a1f5ed7b2..bf5593471 100644 --- a/src/main/java/com/simibubi/create/foundation/config/ui/OpenCreateMenuButton.java +++ b/src/main/java/com/simibubi/create/foundation/config/ui/OpenCreateMenuButton.java @@ -34,6 +34,8 @@ public class OpenCreateMenuButton extends Button { @Override public void render(MatrixStack mstack, int mouseX, int mouseY, float pticks) { super.render(mstack, mouseX, mouseY, pticks); + if (!visible) + return; Minecraft.getInstance().getItemRenderer().renderGuiItem(icon, x + 2, y + 2); } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index ac2e2c277..123163fb6 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -5,7 +5,7 @@ license="MIT" [[mods]] modId="create" -version="v0.3.2b for 1.16.5" +version="v0.3.2c for 1.16.5" displayName="Create" #updateJSONURL="" displayURL="https://www.curseforge.com/minecraft/mc-mods/create"