diff --git a/gradle.properties b/gradle.properties index 3a1b999f9..21a221310 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,23 +7,23 @@ org.gradle.daemon = false # Fabric Properties # check these on https://modmuss50.me/fabric.html -minecraft_version=26.2 -loader_version=0.19.3 -loom_version=1.16-SNAPSHOT +minecraft_version=26.3 +loader_version=0.19.5 +loom_version=1.17-SNAPSHOT # Fabric API -fabric_api_version=0.152.2+26.2 -sodium_version_modrinth=mc26.2-0.9.2-fabric +fabric_api_version=0.161.0+26.3 +sodium_version_modrinth=mc26.3-0.9.2-fabric #sodium_version=0.9.0-beta.3+mc26.2r1 -sodium_extra_allows=0.9.1 +sodium_extra_allows=0.9.4 #Following modifiers are accepted: compileOnly, runtime modmenu_version=20.0.0 -lithium_version=mc26.2-0.25.1-fabric +lithium_version=mc26.3-0.26.1-fabric -compileOnly.iris_version=1.11.2+26.2-fabric +compileOnly.iris_version=1.11.6+26.3-fabric chunky_version=DCgX52a5 vivecraft_version=26.2-1.3.12-fabric diff --git a/src/main/java/me/cortex/voxy/client/core/RenderProperties.java b/src/main/java/me/cortex/voxy/client/core/RenderProperties.java index 85a93cef2..b5247a1a3 100644 --- a/src/main/java/me/cortex/voxy/client/core/RenderProperties.java +++ b/src/main/java/me/cortex/voxy/client/core/RenderProperties.java @@ -1,7 +1,7 @@ package me.cortex.voxy.client.core; -import com.mojang.blaze3d.pipeline.DepthStencilState; -import com.mojang.blaze3d.platform.CompareOp; +import com.mojang.renderpearl.api.pipeline.DepthStencilState; +import com.mojang.renderpearl.api.pipeline.CompareOp; import com.mojang.blaze3d.systems.RenderSystem; import me.cortex.voxy.client.core.gl.shader.Shader; import me.cortex.voxy.client.core.util.IrisUtil; diff --git a/src/main/java/me/cortex/voxy/client/core/VoxyRenderSystem.java b/src/main/java/me/cortex/voxy/client/core/VoxyRenderSystem.java index aede085f7..009939312 100644 --- a/src/main/java/me/cortex/voxy/client/core/VoxyRenderSystem.java +++ b/src/main/java/me/cortex/voxy/client/core/VoxyRenderSystem.java @@ -1,7 +1,7 @@ package me.cortex.voxy.client.core; -import com.mojang.blaze3d.opengl.GlConst; -import com.mojang.blaze3d.opengl.GlStateManager; +import com.mojang.renderpearl.backend.opengl.GlConst; +import com.mojang.renderpearl.backend.opengl.GlStateManager; import me.cortex.voxy.client.TimingStatistics; import me.cortex.voxy.client.VoxyClient; import me.cortex.voxy.client.config.VoxyConfig; diff --git a/src/main/java/me/cortex/voxy/client/core/model/bakery/ReuseVertexConsumer.java b/src/main/java/me/cortex/voxy/client/core/model/bakery/ReuseVertexConsumer.java index 73002be2a..eb0369d49 100644 --- a/src/main/java/me/cortex/voxy/client/core/model/bakery/ReuseVertexConsumer.java +++ b/src/main/java/me/cortex/voxy/client/core/model/bakery/ReuseVertexConsumer.java @@ -82,6 +82,11 @@ public ReuseVertexConsumer setUv2(int u, int v) { return this; } + @Override + public ReuseVertexConsumer setUv3(float u, float v) { + return this; + } + @Override public ReuseVertexConsumer setNormal(float x, float y, float z) { return this; @@ -104,7 +109,7 @@ public ReuseVertexConsumer quad(BakedQuad quad, boolean forceSolid) { } public ReuseVertexConsumer quad(BakedQuad quad, int metadata) { - this.anyShaded |= quad.materialInfo().shade(); + this.anyShaded |= quad.materialInfo().lightEmission() == 0; this.anyDarkendTex |= quad.materialInfo().sprite().contents().mipmapStrategy == MipmapStrategy.DARK_CUTOUT; this.ensureCanPut(); for (int i = 0; i < 4; i++) { diff --git a/src/main/java/me/cortex/voxy/client/core/model/bakery/SoftwareModelTextureBakery.java b/src/main/java/me/cortex/voxy/client/core/model/bakery/SoftwareModelTextureBakery.java index 68677078f..ebe1cdbb3 100644 --- a/src/main/java/me/cortex/voxy/client/core/model/bakery/SoftwareModelTextureBakery.java +++ b/src/main/java/me/cortex/voxy/client/core/model/bakery/SoftwareModelTextureBakery.java @@ -1,7 +1,7 @@ package me.cortex.voxy.client.core.model.bakery; -import com.mojang.blaze3d.GpuFormat; -import com.mojang.blaze3d.opengl.GlTexture; +import com.mojang.renderpearl.api.GpuFormat; +import com.mojang.renderpearl.backend.opengl.GlTexture; import com.mojang.blaze3d.vertex.PoseStack; import me.cortex.voxy.client.core.model.ModelFactory; import me.cortex.voxy.common.util.UnsafeUtil; @@ -293,9 +293,9 @@ public int renderToOutput(BlockState state, long outputBuffer, boolean rasterAsU private static void addView(int i, float pitch, float yaw, float rotation, int flip) { var stack = new PoseStack(); stack.translate(0.5f,0.5f,0.5f); - stack.mulPose(makeQuatFromAxisExact(new Vector3f(0,0,1), rotation)); - stack.mulPose(makeQuatFromAxisExact(new Vector3f(1,0,0), pitch)); - stack.mulPose(makeQuatFromAxisExact(new Vector3f(0,1,0), yaw)); + stack.rotate(makeQuatFromAxisExact(new Vector3f(0,0,1), rotation)); + stack.rotate(makeQuatFromAxisExact(new Vector3f(1,0,0), pitch)); + stack.rotate(makeQuatFromAxisExact(new Vector3f(0,1,0), yaw)); stack.mulPose(new Matrix4f().scale(1-2*(flip&1), 1-(flip&2), 1-((flip>>1)&2))); stack.translate(-0.5f,-0.5f,-0.5f); var mat = new Matrix4f(stack.last().pose()); diff --git a/src/main/java/me/cortex/voxy/client/core/rendering/util/LightMapHelper.java b/src/main/java/me/cortex/voxy/client/core/rendering/util/LightMapHelper.java index 60d08f002..e73fb5f69 100644 --- a/src/main/java/me/cortex/voxy/client/core/rendering/util/LightMapHelper.java +++ b/src/main/java/me/cortex/voxy/client/core/rendering/util/LightMapHelper.java @@ -27,6 +27,6 @@ public static void bind(int lightingIndex) { } public static int getLightmapTextureId() { - return ((com.mojang.blaze3d.opengl.GlTexture)(Minecraft.getInstance().gameRenderer.levelLightmap().texture())).glId(); + return ((com.mojang.renderpearl.backend.opengl.GlTexture)(Minecraft.getInstance().gameRenderer.levelLightmap().texture())).glId(); } } \ No newline at end of file diff --git a/src/main/java/me/cortex/voxy/client/mixin/iris/MixinLevelRenderer.java b/src/main/java/me/cortex/voxy/client/mixin/iris/MixinLevelRenderer.java index 4efd3efa8..87e392811 100644 --- a/src/main/java/me/cortex/voxy/client/mixin/iris/MixinLevelRenderer.java +++ b/src/main/java/me/cortex/voxy/client/mixin/iris/MixinLevelRenderer.java @@ -1,6 +1,6 @@ package me.cortex.voxy.client.mixin.iris; -import com.mojang.blaze3d.buffers.GpuBufferSlice; +import com.mojang.renderpearl.api.buffers.GpuBufferSlice; import com.mojang.blaze3d.resource.GraphicsResourceAllocator; import me.cortex.voxy.client.core.IVoxyRenderSystemHolder; import me.cortex.voxy.client.core.util.IrisUtil; @@ -30,7 +30,7 @@ public class MixinLevelRenderer { private GameRenderer gameRenderer; @Inject(method = "render", at = @At("HEAD"), order = 100) - private void voxy$injectIrisCompat(GraphicsResourceAllocator resourceAllocator, DeltaTracker deltaTracker, boolean renderOutline, CameraRenderState cameraState, Matrix4fc modelViewMatrix, GpuBufferSlice terrainFog, Vector4f fogColor, boolean shouldRenderSky, CallbackInfo ci) { + private void voxy$injectIrisCompat(GraphicsResourceAllocator resourceAllocator, boolean renderOutline, CameraRenderState cameraState, GpuBufferSlice terrainFog, Vector4f fogColor, boolean shouldRenderSky, boolean flag2, CallbackInfo ci) { if (IrisUtil.irisShaderPackEnabled()) { var renderer = IVoxyRenderSystemHolder.getNullableHolder(); if (renderer != null) { diff --git a/src/main/java/me/cortex/voxy/client/mixin/minecraft/MixinRenderSystem.java b/src/main/java/me/cortex/voxy/client/mixin/minecraft/MixinRenderSystem.java index 744703418..be7abf4f5 100644 --- a/src/main/java/me/cortex/voxy/client/mixin/minecraft/MixinRenderSystem.java +++ b/src/main/java/me/cortex/voxy/client/mixin/minecraft/MixinRenderSystem.java @@ -1,7 +1,7 @@ package me.cortex.voxy.client.mixin.minecraft; -import com.mojang.blaze3d.systems.GpuDevice; +import com.mojang.renderpearl.api.device.GpuDevice; import com.mojang.blaze3d.systems.RenderSystem; import me.cortex.voxy.client.VoxyClient; import org.spongepowered.asm.mixin.Mixin; diff --git a/src/main/java/me/cortex/voxy/client/mixin/minecraft/util/MixinGlDebug.java b/src/main/java/me/cortex/voxy/client/mixin/minecraft/util/MixinGlDebug.java index 156960f0a..6a404448d 100644 --- a/src/main/java/me/cortex/voxy/client/mixin/minecraft/util/MixinGlDebug.java +++ b/src/main/java/me/cortex/voxy/client/mixin/minecraft/util/MixinGlDebug.java @@ -2,7 +2,7 @@ import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; -import com.mojang.blaze3d.opengl.GlDebug; +import com.mojang.renderpearl.backend.opengl.GlDebug; import me.cortex.voxy.client.core.gl.Capabilities; import org.slf4j.Logger; import org.spongepowered.asm.mixin.Mixin; @@ -16,14 +16,14 @@ public class MixinGlDebug { @WrapOperation(method = "printDebugLog", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;info(Ljava/lang/String;Ljava/lang/Object;)V", remap = false)) private void voxy$wrapDebug(Logger instance, String base, Object msgObj, Operation original) { - if (msgObj instanceof GlDebug.LogEntry msg) { - var throwable = new Throwable(msg.toString()); + if (msgObj != null) { + var throwable = new Throwable(msgObj.toString()); if (isCausedByVoxy(throwable.getStackTrace())) { if (!isCausedByShaderCompileTest(throwable.getStackTrace())) { original.call(instance, base + "\n" + getStackTraceAsString(throwable), throwable); } } else { - original.call(instance, base, msg); + original.call(instance, base, msgObj); } } else { original.call(instance, base, msgObj); diff --git a/src/main/java/me/cortex/voxy/client/mixin/nvidium/MixinRenderPipeline.java b/src/main/java/me/cortex/voxy/client/mixin/nvidium/MixinRenderPipeline.java index 36f124b46..95e7c01bb 100644 --- a/src/main/java/me/cortex/voxy/client/mixin/nvidium/MixinRenderPipeline.java +++ b/src/main/java/me/cortex/voxy/client/mixin/nvidium/MixinRenderPipeline.java @@ -1,7 +1,7 @@ package me.cortex.voxy.client.mixin.nvidium; -import com.mojang.blaze3d.opengl.GlTextureView; -import com.mojang.blaze3d.textures.GpuSampler; +import com.mojang.renderpearl.backend.opengl.GlTextureView; +import com.mojang.renderpearl.api.textures.GpuSampler; import me.cortex.nvidium.RenderPipeline; import me.cortex.voxy.client.core.IVoxyRenderSystemHolder; import net.caffeinemc.mods.sodium.client.render.chunk.ChunkRenderMatrices; diff --git a/src/main/java/me/cortex/voxy/client/mixin/sodium/MixinDefaultChunkRenderer.java b/src/main/java/me/cortex/voxy/client/mixin/sodium/MixinDefaultChunkRenderer.java index 19056d94f..ce754a4bd 100644 --- a/src/main/java/me/cortex/voxy/client/mixin/sodium/MixinDefaultChunkRenderer.java +++ b/src/main/java/me/cortex/voxy/client/mixin/sodium/MixinDefaultChunkRenderer.java @@ -1,9 +1,10 @@ package me.cortex.voxy.client.mixin.sodium; -import com.mojang.blaze3d.buffers.GpuBuffer; -import com.mojang.blaze3d.buffers.GpuBufferSlice; -import com.mojang.blaze3d.opengl.GlTextureView; -import com.mojang.blaze3d.textures.GpuSampler; +import com.mojang.renderpearl.api.buffers.GpuBuffer; +import com.mojang.renderpearl.api.buffers.GpuBufferSlice; +import com.mojang.renderpearl.backend.opengl.GlTextureView; +import com.mojang.renderpearl.api.textures.GpuSampler; +import com.mojang.renderpearl.api.commands.RenderPass; import me.cortex.voxy.client.VoxyClient; import me.cortex.voxy.client.core.IVoxyRenderSystemHolder; import me.cortex.voxy.client.core.rendering.Viewport; @@ -17,6 +18,7 @@ import net.caffeinemc.mods.sodium.client.render.chunk.vertex.format.ChunkVertexType; import net.caffeinemc.mods.sodium.client.render.viewport.CameraTransform; import net.caffeinemc.mods.sodium.client.util.FogParameters; +import net.minecraft.client.renderer.oit.OitStage; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; @@ -31,9 +33,9 @@ public MixinDefaultChunkRenderer(ChunkVertexType vertexType) { } @Inject(method = "render", at = @At(value = "HEAD"), cancellable = true) - private void voxy$cancelThingie(ChunkRenderMatrices matrices, ChunkRenderListIterable renderLists, TerrainRenderPass renderPass, CameraTransform camera, FogParameters parameters, boolean indexedRenderingEnabled, GpuSampler terrainSampler, GpuBufferSlice uniformData, GpuBuffer sectionTimeInfo, CallbackInfo ci) { + private void voxy$cancelThingie(ChunkRenderMatrices matrices, ChunkRenderListIterable renderLists, TerrainRenderPass renderPass, CameraTransform camera, FogParameters parameters, boolean indexedRenderingEnabled, RenderPass renderPassCmd, GpuSampler terrainSampler, GpuBufferSlice uniformData, GpuBuffer sectionTimeInfo, OitStage oitStage, CallbackInfo ci) { if (VoxyClient.disableSodiumChunkRender()) { - super.begin(renderPass, parameters, terrainSampler); + super.begin(renderPass, parameters, terrainSampler, oitStage); this.doRender(matrices, renderPass, camera, parameters); super.end(renderPass); ci.cancel(); @@ -41,7 +43,7 @@ public MixinDefaultChunkRenderer(ChunkVertexType vertexType) { } @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/caffeinemc/mods/sodium/client/render/chunk/ShaderChunkRenderer;end(Lnet/caffeinemc/mods/sodium/client/render/chunk/terrain/TerrainRenderPass;)V", shift = At.Shift.BEFORE)) - private void voxy$injectRender(ChunkRenderMatrices matrices, ChunkRenderListIterable renderLists, TerrainRenderPass renderPass, CameraTransform camera, FogParameters parameters, boolean indexedRenderingEnabled, GpuSampler terrainSampler, GpuBufferSlice uniformData, GpuBuffer sectionTimeInfo, CallbackInfo ci) { + private void voxy$injectRender(ChunkRenderMatrices matrices, ChunkRenderListIterable renderLists, TerrainRenderPass renderPass, CameraTransform camera, FogParameters parameters, boolean indexedRenderingEnabled, RenderPass renderPassCmd, GpuSampler terrainSampler, GpuBufferSlice uniformData, GpuBuffer sectionTimeInfo, OitStage oitStage, CallbackInfo ci) { this.doRender(matrices, renderPass, camera, parameters); } diff --git a/src/main/java/me/cortex/voxy/client/taskbar/WindowsTaskbar.java b/src/main/java/me/cortex/voxy/client/taskbar/WindowsTaskbar.java index 9c4e49171..634fe7eec 100644 --- a/src/main/java/me/cortex/voxy/client/taskbar/WindowsTaskbar.java +++ b/src/main/java/me/cortex/voxy/client/taskbar/WindowsTaskbar.java @@ -4,7 +4,8 @@ import com.sun.jna.platform.win32.COM.COMInvoker; import com.sun.jna.platform.win32.*; import com.sun.jna.ptr.PointerByReference; -import org.lwjgl.glfw.GLFWNativeWin32; +import org.lwjgl.sdl.SDLProperties; +import org.lwjgl.sdl.SDLVideo; public class WindowsTaskbar extends COMInvoker implements Taskbar.ITaskbar { private final WinDef.HWND hwnd; @@ -20,7 +21,8 @@ public class WindowsTaskbar extends COMInvoker implements Taskbar.ITaskbar { } this.setPointer(itaskbar3res.getValue()); - this.hwnd = new WinDef.HWND(new Pointer(GLFWNativeWin32.glfwGetWin32Window(windowId))); + long hwndPtr = SDLProperties.SDL_GetPointerProperty(SDLVideo.SDL_GetWindowProperties(windowId), SDLVideo.SDL_PROP_WINDOW_WIN32_HWND_POINTER, 0L); + this.hwnd = new WinDef.HWND(new Pointer(hwndPtr)); this.invokeNative(3); // HrInit } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 942cce402..5f39b104e 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -40,7 +40,7 @@ "depends": { "minecraft": "${allowed_mc_version}", "fabricloader": ">=0.14.22", - "fabric-api": ">=0.91.1", + "fabric-api": ">=0.161.0", "sodium": "${allowed_sodium_versions}" }, "breaks": { diff --git a/src/main/resources/voxy.accesswidener b/src/main/resources/voxy.accesswidener index bb001c74a..475a23660 100644 --- a/src/main/resources/voxy.accesswidener +++ b/src/main/resources/voxy.accesswidener @@ -1,13 +1,7 @@ accessWidener v1 official accessible class net/minecraft/client/multiplayer/ClientChunkCache$Storage -accessible class com/mojang/blaze3d/opengl/GlDebug$LogEntry -accessible class com/mojang/blaze3d/opengl/GlRenderPass -accessible method com/mojang/blaze3d/opengl/GlCommandEncoder trySetup (Lcom/mojang/blaze3d/opengl/GlRenderPass;Ljava/util/Collection;)Z -accessible method com/mojang/blaze3d/opengl/GlCommandEncoder applyPipelineState (Lcom/mojang/blaze3d/pipeline/RenderPipeline;)V - -accessible field com/mojang/blaze3d/opengl/GlBuffer handle I accessible field net/minecraft/client/renderer/texture/TextureAtlas maxMipLevel I accessible field net/minecraft/client/gui/components/BossHealthOverlay events Ljava/util/Map; accessible field net/minecraft/client/multiplayer/MultiPlayerGameMode connection Lnet/minecraft/client/multiplayer/ClientPacketListener;