From 4fe1033d336d7b1edb440984d2a7c7a328f868a8 Mon Sep 17 00:00:00 2001 From: Pyrofab Date: Mon, 29 May 2023 12:23:53 -0400 Subject: [PATCH] Remove derelict Iris compatibility Better late than never amirite Signed-off-by: unilock --- .../satin/mixin/SatinMixinPlugin.java | 10 ++-- .../iris/IrisRenderLayerWrapperMixin.java | 48 ------------------- .../satin/mixin/client/iris/package-info.java | 27 ----------- 3 files changed, 4 insertions(+), 81 deletions(-) delete mode 100644 src/main/java/ladysnake/satin/mixin/client/iris/IrisRenderLayerWrapperMixin.java delete mode 100644 src/main/java/ladysnake/satin/mixin/client/iris/package-info.java diff --git a/src/main/java/ladysnake/satin/mixin/SatinMixinPlugin.java b/src/main/java/ladysnake/satin/mixin/SatinMixinPlugin.java index 5ebd07e..b19aa3c 100644 --- a/src/main/java/ladysnake/satin/mixin/SatinMixinPlugin.java +++ b/src/main/java/ladysnake/satin/mixin/SatinMixinPlugin.java @@ -24,7 +24,6 @@ import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; import org.spongepowered.asm.mixin.extensibility.IMixinInfo; -import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -37,6 +36,9 @@ public final class SatinMixinPlugin implements IMixinConfigPlugin { if (loader.isModLoaded("canvas")) { LOGGER.warn("[Satin] Canvas is present, custom block renders will not work"); ALLOW_RENDER_LAYER_MIXINS = false; + } else if (loader.isModLoaded("iris")) { + LOGGER.warn("[Satin] Iris is present, custom block renders will not work"); + ALLOW_RENDER_LAYER_MIXINS = false; } else { if (loader.isModLoaded("sodium")) { LOGGER.warn("[Satin] Sodium is present, custom block renders may not work"); @@ -70,11 +72,7 @@ public void acceptTargets(Set myTargets, Set otherTargets) { @Override public List getMixins() { - List compatMixins = new ArrayList<>(); - if (FabricLoader.getInstance().isModLoaded("iris")) { - compatMixins.add("iris.IrisRenderLayerWrapperMixin"); - } - return compatMixins; + return List.of(); } @Override diff --git a/src/main/java/ladysnake/satin/mixin/client/iris/IrisRenderLayerWrapperMixin.java b/src/main/java/ladysnake/satin/mixin/client/iris/IrisRenderLayerWrapperMixin.java deleted file mode 100644 index 3a5f785..0000000 --- a/src/main/java/ladysnake/satin/mixin/client/iris/IrisRenderLayerWrapperMixin.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Satin - * Copyright (C) 2019-2022 Ladysnake - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; If not, see . - */ -package ladysnake.satin.mixin.client.iris; - -import ladysnake.satin.impl.RenderLayerDuplicator; -import net.coderbot.iris.layer.IrisRenderTypeWrapper; -import net.coderbot.iris.layer.UseProgramRenderStateShard; -import net.minecraft.client.render.RenderLayer; -import net.minecraft.client.render.VertexFormat; -import org.jetbrains.annotations.Nullable; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; - -import java.util.function.Consumer; - -@SuppressWarnings({"UnusedMixin", "unused"}) // added through mixin plugin -@Mixin(IrisRenderTypeWrapper.class) -public abstract class IrisRenderLayerWrapperMixin implements RenderLayerDuplicator.SatinRenderLayer { - @Shadow public abstract RenderLayer unwrap(); - - @Shadow @Final private UseProgramRenderStateShard useProgram; - - @Override - public RenderLayer satin$copy(String newName, @Nullable VertexFormat vertexFormat, Consumer op) { - return new IrisRenderTypeWrapper(newName, RenderLayerDuplicator.copy(this.unwrap(), newName + "_wrapped", vertexFormat, op), this.useProgram); - } - - @Override - public RenderLayer.MultiPhaseParameters satin$copyPhaseParameters(Consumer op) { - return RenderLayerDuplicator.copyPhaseParameters(this.unwrap(), op); - } -} diff --git a/src/main/java/ladysnake/satin/mixin/client/iris/package-info.java b/src/main/java/ladysnake/satin/mixin/client/iris/package-info.java deleted file mode 100644 index 42afaae..0000000 --- a/src/main/java/ladysnake/satin/mixin/client/iris/package-info.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Satin - * Copyright (C) 2019-2022 Ladysnake - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; If not, see . - */ -/** - * Implementation classes - */ -@ApiStatus.Internal -@ParametersAreNonnullByDefault -package ladysnake.satin.mixin.client.iris; - -import org.jetbrains.annotations.ApiStatus; - -import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file