From 07e69a8b80a8fed6be814aa113cb5d084dd2c5f9 Mon Sep 17 00:00:00 2001 From: MrMelon54 Date: Wed, 27 Aug 2025 13:01:48 +0100 Subject: [PATCH] Fix build issues with 1.21.6 --- .../mrmelon54/DraggableLists/DragManager.java | 10 ++++------ .../packs/TransferableSelectionListMixin.java | 1 - ...nsferableSelectionList_PackEntryMixin.java | 20 +++++++++---------- .../mixin/server/OnlineServerEntryMixin.java | 18 ++++++++--------- .../server/ServerSelectionListMixin.java | 4 ---- 5 files changed, 22 insertions(+), 31 deletions(-) diff --git a/common/src/main/java/com/mrmelon54/DraggableLists/DragManager.java b/common/src/main/java/com/mrmelon54/DraggableLists/DragManager.java index e8ae2ec..b708aa3 100644 --- a/common/src/main/java/com/mrmelon54/DraggableLists/DragManager.java +++ b/common/src/main/java/com/mrmelon54/DraggableLists/DragManager.java @@ -1,9 +1,9 @@ package com.mrmelon54.DraggableLists; -import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.Util; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.ObjectSelectionList; +import net.minecraft.util.ARGB; import net.minecraft.util.Mth; public class DragManager> { @@ -114,13 +114,11 @@ public class DragManager> { int entryHeight = dragList.draggable_lists$getItemHeight() - 4; int entryWidth = dragList.draggable_lists$getRowWidth(); - guiGraphics.pose().pushPose(); + guiGraphics.pose().pushMatrix(); float shaderColorValue = 191f / 255f; - RenderSystem.setShaderColor(shaderColorValue, shaderColorValue, shaderColorValue, 0.5f); - guiGraphics.fill(x - 1, y - 1, x + entryWidth - 2, y + entryHeight + 1, 0xbfbfbfff); + guiGraphics.fill(x - 1, y - 1, x + entryWidth - 2, y + entryHeight + 1, ARGB.colorFromFloat(0.5f, shaderColorValue, shaderColorValue, shaderColorValue)); selectedItem.draggable_lists$render(guiGraphics, 0, y, x, entryWidth, entryHeight, mouseX, mouseY, false, delta); - RenderSystem.setShaderColor(1, 1, 1, 1); - guiGraphics.pose().popPose(); + guiGraphics.pose().popMatrix(); if (y < z) { if (softScrollingTimer == 0) { diff --git a/common/src/main/java/com/mrmelon54/DraggableLists/mixin/packs/TransferableSelectionListMixin.java b/common/src/main/java/com/mrmelon54/DraggableLists/mixin/packs/TransferableSelectionListMixin.java index 97198c1..edd4d6b 100644 --- a/common/src/main/java/com/mrmelon54/DraggableLists/mixin/packs/TransferableSelectionListMixin.java +++ b/common/src/main/java/com/mrmelon54/DraggableLists/mixin/packs/TransferableSelectionListMixin.java @@ -4,7 +4,6 @@ import com.mrmelon54.DraggableLists.DragItem; import com.mrmelon54.DraggableLists.DragList; import com.mrmelon54.DraggableLists.DragManager; import com.mrmelon54.DraggableLists.DraggableLists; -import com.mrmelon54.DraggableLists.config.ConfigStructure; import com.mrmelon54.DraggableLists.duck.AbstractPackDuckProvider; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; diff --git a/common/src/main/java/com/mrmelon54/DraggableLists/mixin/packs/TransferableSelectionList_PackEntryMixin.java b/common/src/main/java/com/mrmelon54/DraggableLists/mixin/packs/TransferableSelectionList_PackEntryMixin.java index 3c333a5..c06570e 100644 --- a/common/src/main/java/com/mrmelon54/DraggableLists/mixin/packs/TransferableSelectionList_PackEntryMixin.java +++ b/common/src/main/java/com/mrmelon54/DraggableLists/mixin/packs/TransferableSelectionList_PackEntryMixin.java @@ -1,13 +1,13 @@ package com.mrmelon54.DraggableLists.mixin.packs; import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; +import com.mojang.blaze3d.pipeline.RenderPipeline; import com.mrmelon54.DraggableLists.DragItem; import com.mrmelon54.DraggableLists.DraggableLists; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.ObjectSelectionList; import net.minecraft.client.gui.screens.packs.PackSelectionModel; import net.minecraft.client.gui.screens.packs.TransferableSelectionList; -import net.minecraft.client.renderer.RenderType; import net.minecraft.resources.ResourceLocation; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -17,8 +17,6 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import java.util.function.Function; - @Mixin(TransferableSelectionList.PackEntry.class) public abstract class TransferableSelectionList_PackEntryMixin extends ObjectSelectionList.Entry implements DragItem { @Shadow @@ -32,23 +30,23 @@ public abstract class TransferableSelectionList_PackEntryMixin extends ObjectSel @Unique private boolean draggable_lists$isBeingDragged = false; - @WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blitSprite(Ljava/util/function/Function;Lnet/minecraft/resources/ResourceLocation;IIII)V", ordinal = 4)) - public boolean removeOnUpArrowButtons(GuiGraphics instance, Function function, ResourceLocation resourceLocation, int i, int j, int k, int l) { + @WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blitSprite(Lcom/mojang/blaze3d/pipeline/RenderPipeline;Lnet/minecraft/resources/ResourceLocation;IIII)V", ordinal = 4)) + public boolean removeOnUpArrowButtons(GuiGraphics instance, RenderPipeline renderPipeline, ResourceLocation resourceLocation, int i, int j, int k, int l) { return !DraggableLists.CONFIG.disableResourcePackArrows; } - @WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blitSprite(Ljava/util/function/Function;Lnet/minecraft/resources/ResourceLocation;IIII)V", ordinal = 5)) - public boolean removeOffUpArrowButtons(GuiGraphics instance, Function function, ResourceLocation resourceLocation, int i, int j, int k, int l) { + @WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blitSprite(Lcom/mojang/blaze3d/pipeline/RenderPipeline;Lnet/minecraft/resources/ResourceLocation;IIII)V", ordinal = 5)) + public boolean removeOffUpArrowButtons(GuiGraphics instance, RenderPipeline renderPipeline, ResourceLocation resourceLocation, int i, int j, int k, int l) { return !DraggableLists.CONFIG.disableResourcePackArrows; } - @WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blitSprite(Ljava/util/function/Function;Lnet/minecraft/resources/ResourceLocation;IIII)V", ordinal = 6)) - public boolean removeOnDownArrowButtons(GuiGraphics instance, Function function, ResourceLocation resourceLocation, int i, int j, int k, int l) { + @WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blitSprite(Lcom/mojang/blaze3d/pipeline/RenderPipeline;Lnet/minecraft/resources/ResourceLocation;IIII)V", ordinal = 6)) + public boolean removeOnDownArrowButtons(GuiGraphics instance, RenderPipeline renderPipeline, ResourceLocation resourceLocation, int i, int j, int k, int l) { return !DraggableLists.CONFIG.disableResourcePackArrows; } - @WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blitSprite(Ljava/util/function/Function;Lnet/minecraft/resources/ResourceLocation;IIII)V", ordinal = 7)) - public boolean removeOffDownArrowButtons(GuiGraphics instance, Function function, ResourceLocation resourceLocation, int i, int j, int k, int l) { + @WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blitSprite(Lcom/mojang/blaze3d/pipeline/RenderPipeline;Lnet/minecraft/resources/ResourceLocation;IIII)V", ordinal = 7)) + public boolean removeOffDownArrowButtons(GuiGraphics instance, RenderPipeline renderPipeline, ResourceLocation resourceLocation, int i, int j, int k, int l) { return !DraggableLists.CONFIG.disableResourcePackArrows; } diff --git a/common/src/main/java/com/mrmelon54/DraggableLists/mixin/server/OnlineServerEntryMixin.java b/common/src/main/java/com/mrmelon54/DraggableLists/mixin/server/OnlineServerEntryMixin.java index 05bfc9b..6dc4fb6 100644 --- a/common/src/main/java/com/mrmelon54/DraggableLists/mixin/server/OnlineServerEntryMixin.java +++ b/common/src/main/java/com/mrmelon54/DraggableLists/mixin/server/OnlineServerEntryMixin.java @@ -1,13 +1,13 @@ package com.mrmelon54.DraggableLists.mixin.server; import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; +import com.mojang.blaze3d.pipeline.RenderPipeline; import com.mrmelon54.DraggableLists.DragItem; import com.mrmelon54.DraggableLists.DraggableLists; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.ObjectSelectionList; import net.minecraft.client.gui.screens.multiplayer.ServerSelectionList; import net.minecraft.client.multiplayer.ServerData; -import net.minecraft.client.renderer.RenderType; import net.minecraft.resources.ResourceLocation; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -38,23 +38,23 @@ public abstract class OnlineServerEntryMixin extends ObjectSelectionList.Entry function, ResourceLocation resourceLocation, int i, int j, int k, int l) { + @WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blitSprite(Lcom/mojang/blaze3d/pipeline/RenderPipeline;Lnet/minecraft/resources/ResourceLocation;IIII)V", ordinal = 3)) + public boolean removeUpOnButton(GuiGraphics instance, RenderPipeline renderPipeline, ResourceLocation resourceLocation, int i, int j, int k, int l) { return !DraggableLists.CONFIG.disableServerArrows; } - @WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blitSprite(Ljava/util/function/Function;Lnet/minecraft/resources/ResourceLocation;IIII)V", ordinal = 4)) - public boolean removeUpButton(GuiGraphics instance, Function function, ResourceLocation resourceLocation, int i, int j, int k, int l) { + @WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blitSprite(Lcom/mojang/blaze3d/pipeline/RenderPipeline;Lnet/minecraft/resources/ResourceLocation;IIII)V", ordinal = 4)) + public boolean removeUpButton(GuiGraphics instance, RenderPipeline renderPipeline, ResourceLocation resourceLocation, int i, int j, int k, int l) { return !DraggableLists.CONFIG.disableServerArrows; } - @WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blitSprite(Ljava/util/function/Function;Lnet/minecraft/resources/ResourceLocation;IIII)V", ordinal = 5)) - public boolean removeDownOnButton(GuiGraphics instance, Function function, ResourceLocation resourceLocation, int i, int j, int k, int l) { + @WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blitSprite(Lcom/mojang/blaze3d/pipeline/RenderPipeline;Lnet/minecraft/resources/ResourceLocation;IIII)V", ordinal = 5)) + public boolean removeDownOnButton(GuiGraphics instance, RenderPipeline renderPipeline, ResourceLocation resourceLocation, int i, int j, int k, int l) { return !DraggableLists.CONFIG.disableServerArrows; } - @WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blitSprite(Ljava/util/function/Function;Lnet/minecraft/resources/ResourceLocation;IIII)V", ordinal = 6)) - public boolean removeDownButton(GuiGraphics instance, Function function, ResourceLocation resourceLocation, int i, int j, int k, int l) { + @WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blitSprite(Lcom/mojang/blaze3d/pipeline/RenderPipeline;Lnet/minecraft/resources/ResourceLocation;IIII)V", ordinal = 6)) + public boolean removeDownButton(GuiGraphics instance, RenderPipeline renderPipeline, ResourceLocation resourceLocation, int i, int j, int k, int l) { return !DraggableLists.CONFIG.disableServerArrows; } diff --git a/common/src/main/java/com/mrmelon54/DraggableLists/mixin/server/ServerSelectionListMixin.java b/common/src/main/java/com/mrmelon54/DraggableLists/mixin/server/ServerSelectionListMixin.java index 02e6bb3..10e2fc3 100644 --- a/common/src/main/java/com/mrmelon54/DraggableLists/mixin/server/ServerSelectionListMixin.java +++ b/common/src/main/java/com/mrmelon54/DraggableLists/mixin/server/ServerSelectionListMixin.java @@ -7,7 +7,6 @@ import com.mrmelon54.DraggableLists.DraggableLists; import com.mrmelon54.DraggableLists.duck.ServerListDuckProvider; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.Util; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.ObjectSelectionList; @@ -28,9 +27,6 @@ public abstract class ServerSelectionListMixin extends ObjectSelectionList