Skip to content

Commit

Permalink
Mistakes
Browse files Browse the repository at this point in the history
It's running now.
  • Loading branch information
dima-dencep committed Dec 8, 2023
1 parent 61f3de9 commit 0574b50
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 19 deletions.
16 changes: 16 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
}
Expand All @@ -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")
Expand All @@ -82,6 +90,14 @@ processResources {
}
}

jar {
from sourceSets.sodiumCompatibility.output
from sourceSets.sodiumCompatibility.output

from sourceSets.vendored.output
from sourceSets.vendored.output
}

java {
withSourcesJar()
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ChunkBuildOutput> cir,
BuiltSectionInfo.Builder renderData, VisGraph occluder, ChunkBuildBuffers buffers,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<SortedSet<BlockDestructionProgress>> 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<SortedSet<BlockDestructionProgress>> 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<SortedSet<BlockDestructionProgress>> 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<Boolean> cir) {
if (ShadowRenderingState.areShadowsCurrentlyBeingRendered()) cir.setReturnValue(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit 0574b50

Please sign in to comment.