From 1255c576eddb4ab7281d542a818c66048ecb7010 Mon Sep 17 00:00:00 2001 From: iron431 <34083081+iron431@users.noreply.github.com> Date: Sat, 10 Aug 2024 16:50:50 -0500 Subject: [PATCH] port 1.20.1 --- .../jei/AlchemistCauldronRecipeCategory.java | 16 +++++++++------- .../registries/CreativeTabRegistry.java | 3 +++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/main/java/io/redspace/ironsspellbooks/jei/AlchemistCauldronRecipeCategory.java b/src/main/java/io/redspace/ironsspellbooks/jei/AlchemistCauldronRecipeCategory.java index 61c01d124..74d7f0d5a 100644 --- a/src/main/java/io/redspace/ironsspellbooks/jei/AlchemistCauldronRecipeCategory.java +++ b/src/main/java/io/redspace/ironsspellbooks/jei/AlchemistCauldronRecipeCategory.java @@ -17,8 +17,10 @@ import mezz.jei.api.recipe.category.IRecipeCategory; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.world.item.ItemStack; +import org.jetbrains.annotations.NotNull; import java.util.List; import java.util.Optional; @@ -90,7 +92,7 @@ public void setRecipe(IRecipeLayoutBuilder builder, AlchemistCauldronJeiRecipe r } @Override - public void draw(AlchemistCauldronJeiRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack stack, double mouseX, double mouseY) { + public void draw(@NotNull AlchemistCauldronJeiRecipe recipe, IRecipeSlotsView recipeSlotsView, @NotNull GuiGraphics guiHelper, double mouseX, double mouseY) { Optional leftStack = recipeSlotsView.findSlotByName(inputSlotName) .flatMap(IRecipeSlotView::getDisplayedItemStack); @@ -100,13 +102,13 @@ public void draw(AlchemistCauldronJeiRecipe recipe, IRecipeSlotsView recipeSlots Optional outputStack = recipeSlotsView.findSlotByName(outputSlotName) .flatMap(IRecipeSlotView::getDisplayedItemStack); - stack.pushPose(); + guiHelper.pose().pushPose(); { - stack.translate((getWidth() / 2) - 8 * 1.4f, (getHeight() / 2) - 2, 0); - stack.scale(1.4f, 1.4f, 1.4f); - cauldron_block_icon.draw(stack); + guiHelper.pose().translate((getWidth() / 2) - 8 * 1.4f, (getHeight() / 2) - 2, 0); + guiHelper.pose().scale(1.4f, 1.4f, 1.4f); + cauldron_block_icon.draw(guiHelper); } - stack.popPose(); + guiHelper.pose().popPose(); if (leftStack.isPresent() && leftStack.get().is(ItemRegistry.SCROLL.get())) { var inputText = String.format("%s%%", (int) (ServerConfigs.SCROLL_RECYCLE_CHANCE.get() * 100)); @@ -114,7 +116,7 @@ public void draw(AlchemistCauldronJeiRecipe recipe, IRecipeSlotsView recipeSlots var font = Minecraft.getInstance().font; int y = (getHeight() / 2); int x = (getWidth() - font.width(inputText)) * 3 / 4; - font.drawShadow(stack, inputText, x, y, Math.min(ServerConfigs.SCROLL_RECYCLE_CHANCE.get(), 1d) == 1d ? ChatFormatting.GREEN.getColor() : ChatFormatting.RED.getColor()); + guiHelper.drawString(font, inputText, x, y, Math.min(ServerConfigs.SCROLL_RECYCLE_CHANCE.get(), 1d) == 1d ? ChatFormatting.GREEN.getColor() : ChatFormatting.RED.getColor()); } } } diff --git a/src/main/java/io/redspace/ironsspellbooks/registries/CreativeTabRegistry.java b/src/main/java/io/redspace/ironsspellbooks/registries/CreativeTabRegistry.java index 7ac77ffb0..6c9a98385 100644 --- a/src/main/java/io/redspace/ironsspellbooks/registries/CreativeTabRegistry.java +++ b/src/main/java/io/redspace/ironsspellbooks/registries/CreativeTabRegistry.java @@ -50,6 +50,8 @@ public static void register(IEventBus eventBus) { entries.accept(ItemRegistry.LIGHTNING_ROD_STAFF.get()); entries.accept(ItemRegistry.MAGEHUNTER.get()); entries.accept(ItemRegistry.KEEPER_FLAMBERGE.get()); + entries.accept(ItemRegistry.SPELLBREAKER.get()); + entries.accept(ItemRegistry.AMETHYST_RAPIER.get()); entries.accept(ItemRegistry.WAYWARD_COMPASS.get()); entries.accept(ItemRegistry.WANDERING_MAGICIAN_HELMET.get()); @@ -162,6 +164,7 @@ public static void register(IEventBus eventBus) { entries.accept(ItemRegistry.FROSTED_HELVE.get()); entries.accept(ItemRegistry.ENERGIZED_CORE.get()); entries.accept(ItemRegistry.FURLED_MAP.get()); + entries.accept(ItemRegistry.WEAPON_PARTS.get()); entries.accept(ItemRegistry.BLANK_RUNE.get()); entries.accept(ItemRegistry.FIRE_RUNE.get());