From 737b9002ac536c68367743ea0e815d49051a25bb Mon Sep 17 00:00:00 2001 From: rfresh2 <89827146+rfresh2@users.noreply.github.com> Date: Mon, 21 Oct 2024 16:22:38 -0700 Subject: [PATCH] remove unneeded context mixins --- .../extensions/IScreenRadarRenderContext.java | 8 ----- .../client/MixinMapElementRenderHandler.java | 27 ----------------- .../MixinMinimapElementRendererHandler.java | 30 ------------------- .../mixin/client/MixinRadarRenderContext.java | 21 ------------- .../src/main/resources/xaeroplus.mixins.json | 3 -- 5 files changed, 89 deletions(-) delete mode 100644 common/src/main/java/xaeroplus/feature/extensions/IScreenRadarRenderContext.java delete mode 100644 common/src/main/java/xaeroplus/mixin/client/MixinMapElementRenderHandler.java delete mode 100644 common/src/main/java/xaeroplus/mixin/client/MixinMinimapElementRendererHandler.java delete mode 100644 common/src/main/java/xaeroplus/mixin/client/MixinRadarRenderContext.java diff --git a/common/src/main/java/xaeroplus/feature/extensions/IScreenRadarRenderContext.java b/common/src/main/java/xaeroplus/feature/extensions/IScreenRadarRenderContext.java deleted file mode 100644 index 53a0c8d4..00000000 --- a/common/src/main/java/xaeroplus/feature/extensions/IScreenRadarRenderContext.java +++ /dev/null @@ -1,8 +0,0 @@ -package xaeroplus.feature.extensions; - -public interface IScreenRadarRenderContext { - - boolean isWorldMap(); - - void setIsWorldMap(boolean isWorldMap); -} diff --git a/common/src/main/java/xaeroplus/mixin/client/MixinMapElementRenderHandler.java b/common/src/main/java/xaeroplus/mixin/client/MixinMapElementRenderHandler.java deleted file mode 100644 index 84f63501..00000000 --- a/common/src/main/java/xaeroplus/mixin/client/MixinMapElementRenderHandler.java +++ /dev/null @@ -1,27 +0,0 @@ -package xaeroplus.mixin.client; - -import com.llamalad7.mixinextras.injector.wrapoperation.Operation; -import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; -import com.llamalad7.mixinextras.sugar.Local; -import com.llamalad7.mixinextras.sugar.ref.LocalRef; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import xaero.common.minimap.render.radar.element.RadarRenderContext; -import xaero.map.element.MapElementRenderHandler; -import xaero.map.element.MapElementRenderer; -import xaeroplus.feature.extensions.IScreenRadarRenderContext; - -@Mixin(value = MapElementRenderHandler.class, remap = false) -public class MixinMapElementRenderHandler { - @WrapOperation(method = "renderWithRenderer", at = @At( - value = "INVOKE", - target = "Lxaero/map/element/MapElementRenderer;shouldBeDimScaled()Z" - )) - public boolean captureRenderContextType(final MapElementRenderer instance, final Operation original, - @Local(name = "context") LocalRef contextRef) { - if (contextRef.get() instanceof RadarRenderContext) { - ((IScreenRadarRenderContext) contextRef.get()).setIsWorldMap(true); - } - return original.call(instance); - } -} diff --git a/common/src/main/java/xaeroplus/mixin/client/MixinMinimapElementRendererHandler.java b/common/src/main/java/xaeroplus/mixin/client/MixinMinimapElementRendererHandler.java deleted file mode 100644 index 650b81ca..00000000 --- a/common/src/main/java/xaeroplus/mixin/client/MixinMinimapElementRendererHandler.java +++ /dev/null @@ -1,30 +0,0 @@ -package xaeroplus.mixin.client; - -import com.llamalad7.mixinextras.injector.wrapoperation.Operation; -import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; -import com.llamalad7.mixinextras.sugar.Local; -import com.llamalad7.mixinextras.sugar.ref.LocalRef; -import net.minecraft.client.renderer.MultiBufferSource; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import xaero.common.graphics.renderer.multitexture.MultiTextureRenderTypeRendererProvider; -import xaero.common.minimap.render.radar.element.RadarRenderContext; -import xaero.hud.minimap.element.render.MinimapElementRenderInfo; -import xaero.hud.minimap.element.render.MinimapElementRenderer; -import xaero.hud.minimap.element.render.MinimapElementRendererHandler; -import xaeroplus.feature.extensions.IScreenRadarRenderContext; - -@Mixin(value = MinimapElementRendererHandler.class, remap = false) -public class MixinMinimapElementRendererHandler { - @WrapOperation(method = "renderForRenderer", at = @At( - value = "INVOKE", - target = "Lxaero/hud/minimap/element/render/MinimapElementRenderer;preRender(Lxaero/hud/minimap/element/render/MinimapElementRenderInfo;Lnet/minecraft/client/renderer/MultiBufferSource$BufferSource;Lxaero/common/graphics/renderer/multitexture/MultiTextureRenderTypeRendererProvider;)V" - ), remap = true) // $REMAP - public void captureRenderContext(final MinimapElementRenderer instance, final MinimapElementRenderInfo minimapElementRenderInfo, final MultiBufferSource.BufferSource bufferSource, final MultiTextureRenderTypeRendererProvider multiTextureRenderTypeRendererProvider, final Operation original, - @Local(name = "context") LocalRef contextRef) { - if (contextRef.get() instanceof RadarRenderContext) { - ((IScreenRadarRenderContext) contextRef.get()).setIsWorldMap(false); - } - original.call(instance, minimapElementRenderInfo, bufferSource, multiTextureRenderTypeRendererProvider); - } -} diff --git a/common/src/main/java/xaeroplus/mixin/client/MixinRadarRenderContext.java b/common/src/main/java/xaeroplus/mixin/client/MixinRadarRenderContext.java deleted file mode 100644 index 4a3b682b..00000000 --- a/common/src/main/java/xaeroplus/mixin/client/MixinRadarRenderContext.java +++ /dev/null @@ -1,21 +0,0 @@ -package xaeroplus.mixin.client; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Unique; -import xaero.common.minimap.render.radar.element.RadarRenderContext; -import xaeroplus.feature.extensions.IScreenRadarRenderContext; - -@Mixin(value = RadarRenderContext.class, remap = false) -public class MixinRadarRenderContext implements IScreenRadarRenderContext { - @Unique private boolean isWorldMap = false; - - @Override - public boolean isWorldMap() { - return isWorldMap; - } - - @Override - public void setIsWorldMap(final boolean isWorldMap) { - this.isWorldMap = isWorldMap; - } -} diff --git a/common/src/main/resources/xaeroplus.mixins.json b/common/src/main/resources/xaeroplus.mixins.json index b03dbd93..17f167ff 100644 --- a/common/src/main/resources/xaeroplus.mixins.json +++ b/common/src/main/resources/xaeroplus.mixins.json @@ -36,7 +36,6 @@ "MixinImprovedFramebuffer", "MixinKeyEventHandler", "MixinLeveledRegion", - "MixinMapElementRenderHandler", "MixinMapPixel", "MixinMapProcessor", "MixinMapSaveLoad", @@ -45,7 +44,6 @@ "MixinMapWriter", "MixinMinimap", "MixinMinimapElementMapRendererHandler", - "MixinMinimapElementRendererHandler", "MixinMinimapFBORenderer", "MixinMinimapModSettings", "MixinMinimapOption", @@ -57,7 +55,6 @@ "MixinModClientEvents", "MixinOverlay", "MixinPatreon", - "MixinRadarRenderContext", "MixinRadarRenderProvider", "MixinSupportXaeroMinimap", "MixinSupportXaeroWorldmap",