From 8a3f426576ae80a81c48723989e0dedfddadc824 Mon Sep 17 00:00:00 2001 From: unilock Date: Wed, 6 Dec 2023 14:51:28 -0500 Subject: [PATCH 1/3] Update dependencies for Minecraft 1.19.2 Signed-off-by: unilock --- gradle.properties | 12 ++++++------ src/main/resources/fabric.mod.json | 5 ++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/gradle.properties b/gradle.properties index 988628c..60d2e93 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,11 +3,11 @@ org.gradle.jvmargs=-Xmx2G # Fabric Properties # check these on https://fabricmc.net/use -minecraft_version=1.19 -yarn_mappings=1.19+build.2 -loader_version=0.14.7 +minecraft_version=1.19.2 +yarn_mappings=1.19.2+build.28 +loader_version=0.14.25 #Fabric api -fabric_version=0.50.0+1.19 +fabric_version=0.77.0+1.19.2 # Mod Properties mod_version = 1.9.0 @@ -19,8 +19,8 @@ archives_base_name = satin findbugs_version = 3.0.2 jb_annotations_version = 18.0.0 apiguardian_version = 1.0.0 -modmenu_version = 4.0.0 -iris_version = mc1.18.1-1.1.3 +modmenu_version = 4.1.2 +iris_version = 1.6.11+1.19.2 #Publishing display_name = Satin diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index cd58666..bf34efc 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -30,11 +30,10 @@ ], "accessWidener": "satin.accesswidener", "depends": { - "fabricloader": ">=0.11.3", + "fabricloader": "*", "fabric-api-base": "*", "fabric-resource-loader-v0": "*", - "minecraft": ">=1.18-", - "java": ">=16" + "minecraft": ">=1.19.2" }, "conflicts": { "optifabric": "*" From a1811ad0dcf630d870b715c0267c244c32e2a8fb Mon Sep 17 00:00:00 2001 From: Pyrofab Date: Sat, 18 Mar 2023 20:32:25 -0400 Subject: [PATCH 2/3] Fix incompatibility with fabric core shader API Signed-off-by: unilock --- .../impl/ResettableManagedCoreShader.java | 4 ++- .../mixin/client/gl/CoreShaderMixin.java | 32 ++----------------- 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/src/main/java/ladysnake/satin/impl/ResettableManagedCoreShader.java b/src/main/java/ladysnake/satin/impl/ResettableManagedCoreShader.java index 0c0dc3f..9aea869 100644 --- a/src/main/java/ladysnake/satin/impl/ResettableManagedCoreShader.java +++ b/src/main/java/ladysnake/satin/impl/ResettableManagedCoreShader.java @@ -21,6 +21,7 @@ import ladysnake.satin.Satin; import ladysnake.satin.api.managed.ManagedCoreShader; import ladysnake.satin.api.managed.uniform.SamplerUniform; +import net.fabricmc.fabric.impl.client.rendering.FabricShader; import net.minecraft.client.MinecraftClient; import net.minecraft.client.render.RenderLayer; import net.minecraft.client.render.Shader; @@ -54,7 +55,8 @@ public ResettableManagedCoreShader(Identifier location, VertexFormat vertexForma @Override protected Shader parseShader(ResourceManager resourceManager, MinecraftClient mc, Identifier location) throws IOException { - return new Shader(resourceManager, this.getLocation().toString(), this.vertexFormat); + // Easiest way of getting modded shader locations to work + return new FabricShader(resourceManager, this.getLocation(), this.vertexFormat); } @Override diff --git a/src/main/java/ladysnake/satin/mixin/client/gl/CoreShaderMixin.java b/src/main/java/ladysnake/satin/mixin/client/gl/CoreShaderMixin.java index a0c59fd..6010a9f 100644 --- a/src/main/java/ladysnake/satin/mixin/client/gl/CoreShaderMixin.java +++ b/src/main/java/ladysnake/satin/mixin/client/gl/CoreShaderMixin.java @@ -18,19 +18,11 @@ package ladysnake.satin.mixin.client.gl; import ladysnake.satin.impl.SamplerAccess; -import net.minecraft.client.gl.Program; import net.minecraft.client.render.Shader; -import net.minecraft.client.render.VertexFormat; -import net.minecraft.resource.ResourceFactory; -import net.minecraft.resource.ResourceManager; -import net.minecraft.util.Identifier; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.gen.Accessor; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.ModifyVariable; -import org.spongepowered.asm.mixin.injection.Redirect; import java.util.List; import java.util.Map; @@ -49,31 +41,11 @@ public abstract class CoreShaderMixin implements SamplerAccess { return this.samplers.containsKey(name); } + @Override @Accessor("samplerNames") public abstract List satin$getSamplerNames(); + @Override @Accessor("loadedSamplerIds") public abstract List satin$getSamplerShaderLocs(); - - /** - * @see JsonEffectGlShaderMixin#constructProgramIdentifier(String, ResourceManager, String) - */ - @Redirect(method = "", at = @At(value = "NEW", target = "net/minecraft/util/Identifier", ordinal = 0)) - private Identifier fixId(String arg, ResourceFactory factory, String name, VertexFormat format) { - if (!name.contains(":")) { - return new Identifier(arg); - } - Identifier split = new Identifier(name); - return new Identifier(split.getNamespace(), "shaders/core/" + split.getPath() + ".json"); - } - - @ModifyVariable(method = "loadProgram", at = @At("STORE"), ordinal = 1) - private static String fixPath(String path, final ResourceFactory factory, Program.Type type, String name) { - if (!name.contains(":")) { - return path; - } - Identifier split = new Identifier(name); - return split.getNamespace() + ":shaders/core/" + split.getPath() + type.getFileExtension(); - } - } From 4fe1033d336d7b1edb440984d2a7c7a328f868a8 Mon Sep 17 00:00:00 2001 From: Pyrofab Date: Mon, 29 May 2023 12:23:53 -0400 Subject: [PATCH 3/3] 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