diff --git a/build.gradle b/build.gradle index 3b8dff20a6..6e48091c47 100644 --- a/build.gradle +++ b/build.gradle @@ -56,6 +56,13 @@ sourceSets { repositories { + maven { + name = "Modrinth" + url = "https://api.modrinth.com/maven" + content { + includeGroup "maven.modrinth" + } + } maven { url "https://maven.blamejared.com/" } @@ -68,6 +75,7 @@ dependencies { forge "net.minecraftforge:forge:${minecraft_version}-${forge_version}" modCompileOnly "org.embeddedt:embeddium-${minecraft_version}:${embeddium_version}" + compileOnly "maven.modrinth:distanthorizons:2.0.1-a-1.20.1" implementation include("io.github.douira:glsl-transformer:2.0.0") implementation include("org.antlr:antlr4-runtime:4.11.1") @@ -82,6 +90,14 @@ processResources { } } +jar { + from sourceSets.sodiumCompatibility.output + from sourceSets.sodiumCompatibility.output + + from sourceSets.vendored.output + from sourceSets.vendored.output +} + java { withSourcesJar() } diff --git a/gradle.properties b/gradle.properties index 366760cbe8..063e179349 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ loom.platform = forge forge_version= 47.2.0 # Mod Properties - mod_version = 1.6.9 + mod_version = 1.6.13 maven_group = net.coderbot archives_base_name = oculus diff --git a/src/main/java/net/coderbot/iris/compat/dh/mixin/IrisDHCompatMixinPlugin.java b/src/main/java/net/coderbot/iris/compat/dh/mixin/IrisDHCompatMixinPlugin.java index 6d7cc93e14..d7e39b6728 100644 --- a/src/main/java/net/coderbot/iris/compat/dh/mixin/IrisDHCompatMixinPlugin.java +++ b/src/main/java/net/coderbot/iris/compat/dh/mixin/IrisDHCompatMixinPlugin.java @@ -1,6 +1,6 @@ package net.coderbot.iris.compat.dh.mixin; -import net.fabricmc.loader.api.FabricLoader; +import net.minecraftforge.fml.loading.FMLLoader; import org.objectweb.asm.tree.ClassNode; import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; import org.spongepowered.asm.mixin.extensibility.IMixinInfo; @@ -25,7 +25,7 @@ public String getRefMapperConfig() { @Override public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { - return FabricLoader.getInstance().isModLoaded("distanthorizons"); + return FMLLoader.getLoadingModList().getModFileById("distanthorizons") != null; } @Override diff --git a/src/main/java/net/coderbot/iris/shaderpack/ShaderProperties.java b/src/main/java/net/coderbot/iris/shaderpack/ShaderProperties.java index 6276c953e3..094b1e5989 100644 --- a/src/main/java/net/coderbot/iris/shaderpack/ShaderProperties.java +++ b/src/main/java/net/coderbot/iris/shaderpack/ShaderProperties.java @@ -29,7 +29,7 @@ import net.coderbot.iris.shaderpack.preprocessor.PropertiesPreprocessor; import net.coderbot.iris.shaderpack.texture.TextureStage; import net.coderbot.iris.uniforms.custom.CustomUniforms; -import net.fabricmc.loader.api.FabricLoader; +import net.minecraftforge.fml.loading.FMLPaths; import java.io.IOException; import java.io.StringReader; @@ -118,8 +118,8 @@ public ShaderProperties(String contents, ShaderPackOptions shaderPackOptions, It if (Iris.getIrisConfig().areDebugOptionsEnabled()) { try { - Files.writeString(FabricLoader.getInstance().getGameDir().resolve("preprocessed.properties"), preprocessedContents); - Files.writeString(FabricLoader.getInstance().getGameDir().resolve("original.properties"), contents); + Files.writeString(FMLPaths.GAMEDIR.get().resolve("preprocessed.properties"), preprocessedContents); + Files.writeString(FMLPaths.GAMEDIR.get().resolve("original.properties"), contents); } catch (IOException e) { throw new RuntimeException(e); } diff --git a/src/main/resources/mixins.iris.compat.dh.json b/src/main/resources/mixins.oculus.compat.dh.json similarity index 100% rename from src/main/resources/mixins.iris.compat.dh.json rename to src/main/resources/mixins.oculus.compat.dh.json diff --git a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/block_id/MixinChunkRenderRebuildTask.java b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/block_id/MixinChunkRenderRebuildTask.java index 6e2ece1bad..ffae9d4e86 100644 --- a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/block_id/MixinChunkRenderRebuildTask.java +++ b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/block_id/MixinChunkRenderRebuildTask.java @@ -88,7 +88,7 @@ public class MixinChunkRenderRebuildTask { } @Inject(method = "execute(Lme/jellysquid/mods/sodium/client/render/chunk/compile/ChunkBuildContext;Lme/jellysquid/mods/sodium/client/util/task/CancellationToken;)Lme/jellysquid/mods/sodium/client/render/chunk/compile/ChunkBuildOutput;", at = @At(value = "INVOKE", - target = "Lme/jellysquid/mods/sodium/client/render/chunk/compile/pipeline/FluidRenderer;render(Lme/jellysquid/mods/sodium/client/world/WorldSlice;Lnet/minecraft/world/level/material/FluidState;Lnet/minecraft/core/BlockPos;Lnet/minecraft/core/BlockPos;Lme/jellysquid/mods/sodium/client/render/chunk/compile/ChunkBuildBuffers;)V"), locals = LocalCapture.CAPTURE_FAILHARD) + target = "Lme/jellysquid/mods/sodium/client/render/chunk/compile/pipeline/FluidRenderer;render(Lme/jellysquid/mods/sodium/client/world/WorldSlice;Lnet/minecraft/world/level/material/FluidState;Lnet/minecraft/core/BlockPos;Lnet/minecraft/core/BlockPos;Lme/jellysquid/mods/sodium/client/render/chunk/compile/ChunkBuildBuffers;)V"), locals = LocalCapture.CAPTURE_FAILHARD, remap = false) private void iris$wrapGetFluidLayer(ChunkBuildContext context, CancellationToken cancellationSource, CallbackInfoReturnable cir, BuiltSectionInfo.Builder renderData, VisGraph occluder, ChunkBuildBuffers buffers, diff --git a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/clouds/MixinCloudRenderer.java b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/clouds/MixinCloudRenderer.java index 72b84b0ba4..8dd40149be 100644 --- a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/clouds/MixinCloudRenderer.java +++ b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/clouds/MixinCloudRenderer.java @@ -56,7 +56,7 @@ public abstract class MixinCloudRenderer { @Unique private int prevCenterCellXIris, prevCenterCellYIris, cachedRenderDistanceIris; - @Inject(method = "render", at = @At(value = "HEAD"), cancellable = true) + @Inject(method = "render", at = @At(value = "HEAD"), cancellable = true, remap = false) private void buildIrisVertexBuffer(ClientLevel world, LocalPlayer player, PoseStack matrices, Matrix4f projectionMatrix, float ticks, float tickDelta, double cameraX, double cameraY, double cameraZ, CallbackInfo ci) { if (IrisApi.getInstance().isShaderPackInUse()) { ci.cancel(); @@ -169,7 +169,7 @@ public void renderIris(@Nullable ClientLevel world, LocalPlayer player, PoseStac RenderSystem.setShaderFogStart(previousStart); } - @ModifyArg(method = "rebuildGeometry", at = @At(value = "INVOKE", target = "Lorg/lwjgl/system/MemoryStack;nmalloc(I)J")) + @ModifyArg(method = "rebuildGeometry", at = @At(value = "INVOKE", target = "Lorg/lwjgl/system/MemoryStack;nmalloc(I)J"), remap = false) private int allocateNewSize(int size) { return IrisApi.getInstance().isShaderPackInUse() ? 480 : size; } @@ -182,7 +182,7 @@ private static void writeIrisVertex(long buffer, float x, float y, float z, int } } - @ModifyArg(method = "rebuildGeometry", at = @At(value = "INVOKE", target = "Lnet/caffeinemc/mods/sodium/api/vertex/buffer/VertexBufferWriter;push(Lorg/lwjgl/system/MemoryStack;JILnet/caffeinemc/mods/sodium/api/vertex/format/VertexFormatDescription;)V"), index = 3) + @ModifyArg(method = "rebuildGeometry", at = @At(value = "INVOKE", target = "Lnet/caffeinemc/mods/sodium/api/vertex/buffer/VertexBufferWriter;push(Lorg/lwjgl/system/MemoryStack;JILnet/caffeinemc/mods/sodium/api/vertex/format/VertexFormatDescription;)V"), index = 3, remap = false) private VertexFormatDescription modifyArgIris(VertexFormatDescription vertexFormatDescription) { if (IrisApi.getInstance().isShaderPackInUse()) { return CloudVertex.FORMAT; diff --git a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/directional_shading/MixinSmoothLightPipeline.java b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/directional_shading/MixinSmoothLightPipeline.java index 0d65071bfe..39ed530a89 100644 --- a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/directional_shading/MixinSmoothLightPipeline.java +++ b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/directional_shading/MixinSmoothLightPipeline.java @@ -11,7 +11,7 @@ @Mixin(SmoothLightPipeline.class) public class MixinSmoothLightPipeline { - @Inject(method = "applySidedBrightness", at = @At("HEAD"), cancellable = true) + @Inject(method = "applySidedBrightness", at = @At("HEAD"), cancellable = true, remap = false) private void iris$disableDirectionalShading(QuadLightData out, Direction face, boolean shade, CallbackInfo ci) { if (BlockRenderingSettings.INSTANCE.shouldDisableDirectionalShading()) { ci.cancel(); diff --git a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/shadow_map/MixinRenderSectionManager.java b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/shadow_map/MixinRenderSectionManager.java index 6384c5f732..6517120f9a 100644 --- a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/shadow_map/MixinRenderSectionManager.java +++ b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/shadow_map/MixinRenderSectionManager.java @@ -20,7 +20,7 @@ public class MixinRenderSectionManager { @Unique private @NotNull SortedRenderLists shadowRenderLists = SortedRenderLists.empty(); - @Redirect(method = "createTerrainRenderList", at = @At(value = "FIELD", target = "Lme/jellysquid/mods/sodium/client/render/chunk/RenderSectionManager;renderLists:Lme/jellysquid/mods/sodium/client/render/chunk/lists/SortedRenderLists;")) + @Redirect(method = "createTerrainRenderList", at = @At(value = "FIELD", target = "Lme/jellysquid/mods/sodium/client/render/chunk/RenderSectionManager;renderLists:Lme/jellysquid/mods/sodium/client/render/chunk/lists/SortedRenderLists;"), remap = false) private void useShadowRenderList(RenderSectionManager instance, SortedRenderLists value) { if (ShadowRenderingState.areShadowsCurrentlyBeingRendered()) { shadowRenderLists = value; @@ -29,7 +29,7 @@ private void useShadowRenderList(RenderSectionManager instance, SortedRenderList } } - @Inject(method = "update", at = @At(value = "INVOKE", target = "Lme/jellysquid/mods/sodium/client/render/chunk/RenderSectionManager;createTerrainRenderList(Lnet/minecraft/client/Camera;Lme/jellysquid/mods/sodium/client/render/viewport/Viewport;IZ)V", shift = At.Shift.AFTER), cancellable = true) + @Inject(method = "update", at = @At(value = "INVOKE", target = "Lme/jellysquid/mods/sodium/client/render/chunk/RenderSectionManager;createTerrainRenderList(Lnet/minecraft/client/Camera;Lme/jellysquid/mods/sodium/client/render/viewport/Viewport;IZ)V", shift = At.Shift.AFTER), cancellable = true, remap = false) private void cancelIfShadow(Camera camera, Viewport viewport, int frame, boolean spectator, CallbackInfo ci) { if (ShadowRenderingState.areShadowsCurrentlyBeingRendered()) ci.cancel(); } diff --git a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/shadow_map/MixinSodiumWorldRenderer.java b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/shadow_map/MixinSodiumWorldRenderer.java index c807a7ae68..89ad894fd7 100644 --- a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/shadow_map/MixinSodiumWorldRenderer.java +++ b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/shadow_map/MixinSodiumWorldRenderer.java @@ -34,22 +34,22 @@ */ @Mixin(SodiumWorldRenderer.class) public class MixinSodiumWorldRenderer { - @Inject(method = "renderBlockEntities(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/RenderBuffers;Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;FLnet/minecraft/client/renderer/MultiBufferSource$BufferSource;DDDLnet/minecraft/client/renderer/blockentity/BlockEntityRenderDispatcher;)V", at = @At("HEAD")) + @Inject(method = "renderBlockEntities(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/RenderBuffers;Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;FLnet/minecraft/client/renderer/MultiBufferSource$BufferSource;DDDLnet/minecraft/client/renderer/blockentity/BlockEntityRenderDispatcher;)V", at = @At("HEAD"), remap = false) private void resetEntityList(PoseStack matrices, RenderBuffers bufferBuilders, Long2ObjectMap> blockBreakingProgressions, float tickDelta, MultiBufferSource.BufferSource immediate, double x, double y, double z, BlockEntityRenderDispatcher blockEntityRenderer, CallbackInfo ci) { beList = 0; } - @Inject(method = "renderBlockEntities(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/RenderBuffers;Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;FLnet/minecraft/client/renderer/MultiBufferSource$BufferSource;DDDLnet/minecraft/client/renderer/blockentity/BlockEntityRenderDispatcher;)V", at = @At(value = "INVOKE", target = "Lme/jellysquid/mods/sodium/client/render/SodiumWorldRenderer;renderBlockEntity(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/RenderBuffers;Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;FLnet/minecraft/client/renderer/MultiBufferSource$BufferSource;DDDLnet/minecraft/client/renderer/blockentity/BlockEntityRenderDispatcher;Lnet/minecraft/world/level/block/entity/BlockEntity;)V")) + @Inject(method = "renderBlockEntities(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/RenderBuffers;Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;FLnet/minecraft/client/renderer/MultiBufferSource$BufferSource;DDDLnet/minecraft/client/renderer/blockentity/BlockEntityRenderDispatcher;)V", at = @At(value = "INVOKE", target = "Lme/jellysquid/mods/sodium/client/render/SodiumWorldRenderer;renderBlockEntity(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/RenderBuffers;Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;FLnet/minecraft/client/renderer/MultiBufferSource$BufferSource;DDDLnet/minecraft/client/renderer/blockentity/BlockEntityRenderDispatcher;Lnet/minecraft/world/level/block/entity/BlockEntity;)V"), remap = false) private void addToList(PoseStack matrices, RenderBuffers bufferBuilders, Long2ObjectMap> blockBreakingProgressions, float tickDelta, MultiBufferSource.BufferSource immediate, double x, double y, double z, BlockEntityRenderDispatcher blockEntityRenderer, CallbackInfo ci) { beList++; } - @Inject(method = "renderGlobalBlockEntities", at = @At(value = "INVOKE", target = "Lme/jellysquid/mods/sodium/client/render/SodiumWorldRenderer;renderBlockEntity(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/RenderBuffers;Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;FLnet/minecraft/client/renderer/MultiBufferSource$BufferSource;DDDLnet/minecraft/client/renderer/blockentity/BlockEntityRenderDispatcher;Lnet/minecraft/world/level/block/entity/BlockEntity;)V")) + @Inject(method = "renderGlobalBlockEntities", at = @At(value = "INVOKE", target = "Lme/jellysquid/mods/sodium/client/render/SodiumWorldRenderer;renderBlockEntity(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/RenderBuffers;Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;FLnet/minecraft/client/renderer/MultiBufferSource$BufferSource;DDDLnet/minecraft/client/renderer/blockentity/BlockEntityRenderDispatcher;Lnet/minecraft/world/level/block/entity/BlockEntity;)V"), remap = false) private void addToList2(PoseStack matrices, RenderBuffers bufferBuilders, Long2ObjectMap> blockBreakingProgressions, float tickDelta, MultiBufferSource.BufferSource immediate, double x, double y, double z, BlockEntityRenderDispatcher blockEntityRenderer, CallbackInfo ci) { beList++; } - @Inject(method = "isEntityVisible", at = @At("HEAD"), cancellable = true) + @Inject(method = "isEntityVisible", at = @At("HEAD"), cancellable = true, remap = false) private void iris$overrideEntityCulling(Entity entity, CallbackInfoReturnable cir) { if (ShadowRenderingState.areShadowsCurrentlyBeingRendered()) cir.setReturnValue(true); } diff --git a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/vertex_format/entity/MixinModelVertex.java b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/vertex_format/entity/MixinModelVertex.java index f70778713e..2d01da3279 100644 --- a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/vertex_format/entity/MixinModelVertex.java +++ b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/vertex_format/entity/MixinModelVertex.java @@ -24,7 +24,7 @@ @Mixin(BakedModelEncoder.class) public class MixinModelVertex { - @Inject(method = "writeQuadVertices(Lnet/caffeinemc/mods/sodium/api/vertex/buffer/VertexBufferWriter;Lcom/mojang/blaze3d/vertex/PoseStack$Pose;Lme/jellysquid/mods/sodium/client/model/quad/ModelQuadView;III)V", at = @At("HEAD"), cancellable = true) + @Inject(method = "writeQuadVertices(Lnet/caffeinemc/mods/sodium/api/vertex/buffer/VertexBufferWriter;Lcom/mojang/blaze3d/vertex/PoseStack$Pose;Lme/jellysquid/mods/sodium/client/model/quad/ModelQuadView;III)V", at = @At("HEAD"), cancellable = true, remap = false) private static void redirect2(VertexBufferWriter writer, PoseStack.Pose matrices, ModelQuadView quad, int color, int light, int overlay, CallbackInfo ci) { if (shouldBeExtended()) { ci.cancel(); @@ -36,7 +36,7 @@ private static void redirect2(VertexBufferWriter writer, PoseStack.Pose matrices * @author IMS * @reason Rewrite */ - @Overwrite + @Overwrite(remap = false) public static void writeQuadVertices(VertexBufferWriter writer, PoseStack.Pose matrices, ModelQuadView quad, float r, float g, float b, float[] brightnessTable, boolean colorize, int[] light, int overlay) { Matrix3f matNormal = matrices.normal(); Matrix4f matPosition = matrices.pose();