diff --git a/build.gradle b/build.gradle index d2c82c20..5f1a9129 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version "1.5.7" + id 'fabric-loom' version "1.7.1" id 'maven-publish' } @@ -49,15 +49,15 @@ dependencies { modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" //TODO: this is to eventually not need sodium installed as atm its just used for parsing shaders - modRuntimeOnly "maven.modrinth:sodium:mc1.20.4-0.5.8" - modCompileOnly "maven.modrinth:sodium:mc1.20.4-0.5.8" + modRuntimeOnly "maven.modrinth:sodium:mc1.21-0.5.9" + modCompileOnly "maven.modrinth:sodium:mc1.21-0.5.9" //modRuntimeOnly "maven.modrinth:nvidium:0.2.6-beta" - modCompileOnly "maven.modrinth:nvidium:0.2.6-beta" + modCompileOnly "maven.modrinth:nvidium:0.2.8-beta" modImplementation("maven.modrinth:cloth-config:13.0.121+fabric") - modImplementation("maven.modrinth:modmenu:9.0.0") - modCompileOnly("maven.modrinth:iris:1.6.17+1.20.4") + modImplementation("maven.modrinth:modmenu:11.0.1") + modCompileOnly("maven.modrinth:iris:1.7.1+1.21") //modRuntimeOnly("maven.modrinth:iris:1.6.17+1.20.4") modCompileOnly("maven.modrinth:starlight:1.1.3+1.20.4") //modCompileOnly("maven.modrinth:immersiveportals:v5.1.7-mc1.20.4") @@ -67,7 +67,7 @@ dependencies { } -def targetJavaVersion = 17 +def targetJavaVersion = 21 tasks.withType(JavaCompile).configureEach { // ensure that the encoding is set to UTF-8, no matter what the system default is // this fixes some edge cases with special characters not displaying correctly diff --git a/gradle.properties b/gradle.properties index 16ba9e96..902e4d22 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,13 +3,13 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://modmuss50.me/fabric.html -minecraft_version=1.20.4 -yarn_mappings=1.20.4+build.1 -loader_version=0.15.1 +minecraft_version=1.21 +yarn_mappings=1.21+build.2 +loader_version=0.15.11 # Mod Properties -mod_version = 0.1.5-alpha +mod_version = 0.1.6-alpha maven_group = me.cortex archives_base_name = voxy -fabric_version=0.91.1+1.20.4 +fabric_version=0.100.1+1.21 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c30b486a..2617362f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/me/cortex/voxy/client/core/VoxelCore.java b/src/main/java/me/cortex/voxy/client/core/VoxelCore.java index 515b7376..00a9d051 100644 --- a/src/main/java/me/cortex/voxy/client/core/VoxelCore.java +++ b/src/main/java/me/cortex/voxy/client/core/VoxelCore.java @@ -1,25 +1,21 @@ package me.cortex.voxy.client.core; -import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.systems.RenderSystem; import me.cortex.voxy.client.Voxy; import me.cortex.voxy.client.config.VoxyConfig; import me.cortex.voxy.client.core.rendering.*; import me.cortex.voxy.client.core.rendering.building.RenderGenerationService; import me.cortex.voxy.client.core.rendering.post.PostProcessing; -import me.cortex.voxy.client.core.util.DebugUtil; import me.cortex.voxy.client.core.util.IrisUtil; import me.cortex.voxy.client.saver.ContextSelectionSystem; import me.cortex.voxy.common.world.WorldEngine; import me.cortex.voxy.client.importers.WorldImporter; import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gui.hud.BossBarHud; import net.minecraft.client.gui.hud.ClientBossBar; import net.minecraft.client.render.Camera; import net.minecraft.client.render.Frustum; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.boss.BossBar; -import net.minecraft.entity.boss.ServerBossBar; import net.minecraft.registry.RegistryKeys; import net.minecraft.text.Text; import net.minecraft.util.math.MathHelper; @@ -32,7 +28,6 @@ import java.io.File; import java.util.*; import static org.lwjgl.opengl.GL30C.GL_DRAW_FRAMEBUFFER_BINDING; -import static org.lwjgl.opengl.GL30C.GL_FRAMEBUFFER; //Core class that ingests new data from sources and updates the required systems @@ -156,9 +151,9 @@ public class VoxelCore { var projection = new Matrix4f(); var client = MinecraftClient.getInstance(); - var gameRenderer = client.gameRenderer; + var gameRenderer = client.gameRenderer;//tickCounter.getTickDelta(true); - float fov = (float) gameRenderer.getFov(gameRenderer.getCamera(), client.getTickDelta(), true); + float fov = (float) gameRenderer.getFov(gameRenderer.getCamera(), client.getRenderTickCounter().getTickDelta(true), true); projection.setPerspective(fov * 0.01745329238474369f, (float) client.getWindow().getFramebufferWidth() / (float)client.getWindow().getFramebufferHeight(), @@ -178,7 +173,6 @@ public class VoxelCore { } matrices.push(); matrices.translate(-cameraX, -cameraY, -cameraZ); - DebugUtil.setPositionMatrix(matrices); matrices.pop(); //this.renderer.getModelManager().updateEntry(0, Blocks.DIRT_PATH.getDefaultState()); diff --git a/src/main/java/me/cortex/voxy/client/core/model/BakedBlockEntityModel.java b/src/main/java/me/cortex/voxy/client/core/model/BakedBlockEntityModel.java index e974d959..9b34a6d7 100644 --- a/src/main/java/me/cortex/voxy/client/core/model/BakedBlockEntityModel.java +++ b/src/main/java/me/cortex/voxy/client/core/model/BakedBlockEntityModel.java @@ -18,6 +18,7 @@ import static org.lwjgl.opengl.GL11.glBindTexture; public class BakedBlockEntityModel { private static final class BakedVertices implements VertexConsumer { + private boolean makingVertex = false; public final RenderLayer layer; private float cX, cY, cZ; private int cR, cG, cB, cA; @@ -30,10 +31,12 @@ public class BakedBlockEntityModel { } @Override - public VertexConsumer vertex(double x, double y, double z) { - this.cX = (float) x; - this.cY = (float) y; - this.cZ = (float) z; + public VertexConsumer vertex(float x, float y, float z) { + this.next(); + this.cX = x; + this.cY = y; + this.cZ = z; + this.makingVertex = true; return this; } @@ -68,30 +71,22 @@ public class BakedBlockEntityModel { return this; } - @Override - public void fixedColor(int red, int green, int blue, int alpha) { - - } - - @Override - public void unfixColor() { - - } - - @Override - public void next() { - this.vertices.add(new int[]{ - Float.floatToIntBits(this.cX), Float.floatToIntBits(this.cY), Float.floatToIntBits(this.cZ), - this.cR, this.cG, this.cB, this.cA, - Float.floatToIntBits(this.cU), Float.floatToIntBits(this.cV)}); + private void next() { + if (this.makingVertex) { + this.makingVertex = false; + this.vertices.add(new int[]{ + Float.floatToIntBits(this.cX), Float.floatToIntBits(this.cY), Float.floatToIntBits(this.cZ), + this.cR, this.cG, this.cB, this.cA, + Float.floatToIntBits(this.cU), Float.floatToIntBits(this.cV)}); + } } public void putInto(VertexConsumer vc) { + this.next(); for (var vert : this.vertices) { vc.vertex(Float.intBitsToFloat(vert[0]), Float.intBitsToFloat(vert[1]), Float.intBitsToFloat(vert[2])) .color(vert[3], vert[4], vert[5], vert[6]) - .texture(Float.intBitsToFloat(vert[7]), Float.intBitsToFloat(vert[8])) - .next(); + .texture(Float.intBitsToFloat(vert[7]), Float.intBitsToFloat(vert[8])); } } } @@ -102,9 +97,9 @@ public class BakedBlockEntityModel { } public void renderOut() { - var vc = Tessellator.getInstance().getBuffer(); + var vc = Tessellator.getInstance(); for (var layer : this.layers) { - vc.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR_TEXTURE); + var bb = vc.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR); if (layer.layer instanceof RenderLayer.MultiPhase mp) { Identifier textureId = mp.phases.texture.getId().orElse(null); if (textureId == null) { @@ -114,8 +109,8 @@ public class BakedBlockEntityModel { glBindTexture(GL_TEXTURE_2D, texture.getGlId()); } } - layer.putInto(vc); - BufferRenderer.draw(vc.end()); + layer.putInto(bb); + BufferRenderer.draw(bb.end()); } } diff --git a/src/main/java/me/cortex/voxy/client/core/model/ModelTextureBakery.java b/src/main/java/me/cortex/voxy/client/core/model/ModelTextureBakery.java index 1cae6127..63b534a7 100644 --- a/src/main/java/me/cortex/voxy/client/core/model/ModelTextureBakery.java +++ b/src/main/java/me/cortex/voxy/client/core/model/ModelTextureBakery.java @@ -171,7 +171,7 @@ public class ModelTextureBakery { this.rasterShader.bind(); glActiveTexture(GL_TEXTURE0); - int texId = MinecraftClient.getInstance().getTextureManager().getTexture(new Identifier("minecraft", "textures/atlas/blocks.png")).getGlId(); + int texId = MinecraftClient.getInstance().getTextureManager().getTexture(Identifier.of("minecraft", "textures/atlas/blocks.png")).getGlId(); GlUniform.uniform1(0, 0); var faces = new ColourDepthTextureData[FACE_VIEWS.size()]; @@ -196,7 +196,7 @@ public class ModelTextureBakery { private ColourDepthTextureData captureView(BlockState state, BakedModel model, BakedBlockEntityModel blockEntityModel, MatrixStack stack, long randomValue, int face, boolean renderFluid, int textureId) { - var vc = Tessellator.getInstance().getBuffer(); + var vc = Tessellator.getInstance(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); float[] mat = new float[4*4]; @@ -208,9 +208,9 @@ public class ModelTextureBakery { blockEntityModel.renderOut(); } - vc.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR_TEXTURE); + var bb = vc.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR); if (!renderFluid) { - renderQuads(vc, state, model, new MatrixStack(), randomValue); + renderQuads(bb, state, model, new MatrixStack(), randomValue); } else { MinecraftClient.getInstance().getBlockRenderManager().renderFluid(BlockPos.ORIGIN, new BlockRenderView() { @Override @@ -277,12 +277,15 @@ public class ModelTextureBakery { public int getBottomY() { return 0; } - }, vc, state, state.getFluidState()); + }, bb, state, state.getFluidState()); } glBindTexture(GL_TEXTURE_2D, textureId); - BufferRenderer.draw(vc.end()); - + try { + BufferRenderer.draw(bb.end()); + } catch (IllegalStateException e) { + System.err.println("Got empty buffer builder! for block " + state); + } glMemoryBarrier(GL_FRAMEBUFFER_BARRIER_BIT); int[] colourData = new int[this.width*this.height]; @@ -298,7 +301,7 @@ public class ModelTextureBakery { for (var quad : quads) { //TODO: mark pixels that have int meta = quad.hasColor()?1:0; - builder.quad(stack.peek(), quad, (meta>>16)&0xff, (meta>>8)&0xff, meta&0xff, 0, 0); + builder.quad(stack.peek(), quad, 255f/((meta>>16)&0xff), 255f/((meta>>8)&0xff), 255f/(meta&0xff), 1.0f, 0, 0); } } } diff --git a/src/main/java/me/cortex/voxy/client/core/rendering/AbstractFarWorldRenderer.java b/src/main/java/me/cortex/voxy/client/core/rendering/AbstractFarWorldRenderer.java index 411bd876..2416c227 100644 --- a/src/main/java/me/cortex/voxy/client/core/rendering/AbstractFarWorldRenderer.java +++ b/src/main/java/me/cortex/voxy/client/core/rendering/AbstractFarWorldRenderer.java @@ -106,7 +106,7 @@ public abstract class AbstractFarWorldRenderer >>24)/255, (float)((colour>>>16)&0xFF)/255, (float)((colour>>>8)&0xFF)/255, (float)(colour&0xFF)/255); - } - - public static void renderBox(int x, int y, int z, int size, float r, float g, float b) { - renderAABB(new Box(x, y, z, x+size, y+size, z+size), r, g, b, 1.0f); - } - public static void renderAABB(Box aabb, float r, float g, float b, float a) { - RenderSystem.setShaderFogEnd(9999999); - RenderSystem.setShader(GameRenderer::getPositionProgram); - RenderSystem.setShaderColor(r, g, b, a); - RenderSystem.enableBlend(); - RenderSystem.disableCull(); - RenderSystem.enableDepthTest(); - //RenderSystem.depthMask(false); - - var tessellator = RenderSystem.renderThreadTesselator(); - var builder = tessellator.getBuffer(); - builder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); - - builder.vertex(positionMatrix, (float) aabb.minX, (float) aabb.minY, (float) aabb.minZ).next(); - builder.vertex(positionMatrix, (float) aabb.maxX, (float) aabb.minY, (float) aabb.minZ).next(); - builder.vertex(positionMatrix, (float) aabb.maxX, (float) aabb.minY, (float) aabb.maxZ).next(); - builder.vertex(positionMatrix, (float) aabb.minX, (float) aabb.minY, (float) aabb.maxZ).next(); - - builder.vertex(positionMatrix, (float) aabb.minX, (float) aabb.maxY, (float) aabb.minZ).next(); - builder.vertex(positionMatrix, (float) aabb.maxX, (float) aabb.maxY, (float) aabb.minZ).next(); - builder.vertex(positionMatrix, (float) aabb.maxX, (float) aabb.maxY, (float) aabb.maxZ).next(); - builder.vertex(positionMatrix, (float) aabb.minX, (float) aabb.maxY, (float) aabb.maxZ).next(); - - builder.vertex(positionMatrix, (float) aabb.minX, (float) aabb.minY, (float) aabb.minZ).next(); - builder.vertex(positionMatrix, (float) aabb.maxX, (float) aabb.minY, (float) aabb.minZ).next(); - builder.vertex(positionMatrix, (float) aabb.maxX, (float) aabb.maxY, (float) aabb.minZ).next(); - builder.vertex(positionMatrix, (float) aabb.minX, (float) aabb.maxY, (float) aabb.minZ).next(); - - builder.vertex(positionMatrix, (float) aabb.minX, (float) aabb.minY, (float) aabb.maxZ).next(); - builder.vertex(positionMatrix, (float) aabb.maxX, (float) aabb.minY, (float) aabb.maxZ).next(); - builder.vertex(positionMatrix, (float) aabb.maxX, (float) aabb.maxY, (float) aabb.maxZ).next(); - builder.vertex(positionMatrix, (float) aabb.minX, (float) aabb.maxY, (float) aabb.maxZ).next(); - - builder.vertex(positionMatrix, (float) aabb.minX, (float) aabb.minY, (float) aabb.minZ).next(); - builder.vertex(positionMatrix, (float) aabb.minX, (float) aabb.maxY, (float) aabb.minZ).next(); - builder.vertex(positionMatrix, (float) aabb.minX, (float) aabb.maxY, (float) aabb.maxZ).next(); - builder.vertex(positionMatrix, (float) aabb.minX, (float) aabb.minY, (float) aabb.maxZ).next(); - - builder.vertex(positionMatrix, (float) aabb.maxX, (float) aabb.minY, (float) aabb.minZ).next(); - builder.vertex(positionMatrix, (float) aabb.maxX, (float) aabb.maxY, (float) aabb.minZ).next(); - builder.vertex(positionMatrix, (float) aabb.maxX, (float) aabb.maxY, (float) aabb.maxZ).next(); - builder.vertex(positionMatrix, (float) aabb.maxX, (float) aabb.minY, (float) aabb.maxZ).next(); - - tessellator.draw(); - - RenderSystem.disableBlend(); - RenderSystem.enableCull(); - RenderSystem.disableDepthTest(); - RenderSystem.setShaderColor(1,1,1,1); - RenderSystem.depthMask(true); - } -} diff --git a/src/main/java/me/cortex/voxy/client/core/util/IrisUtil.java b/src/main/java/me/cortex/voxy/client/core/util/IrisUtil.java index 5e737ba0..8c1f255f 100644 --- a/src/main/java/me/cortex/voxy/client/core/util/IrisUtil.java +++ b/src/main/java/me/cortex/voxy/client/core/util/IrisUtil.java @@ -1,7 +1,7 @@ package me.cortex.voxy.client.core.util; -import net.coderbot.iris.pipeline.ShadowRenderer; import net.fabricmc.loader.api.FabricLoader; +import net.irisshaders.iris.shadows.ShadowRenderer; import org.spongepowered.asm.mixin.Unique; public class IrisUtil { diff --git a/src/main/java/me/cortex/voxy/client/importers/WorldImporter.java b/src/main/java/me/cortex/voxy/client/importers/WorldImporter.java index ef9d4401..aeea3ff2 100644 --- a/src/main/java/me/cortex/voxy/client/importers/WorldImporter.java +++ b/src/main/java/me/cortex/voxy/client/importers/WorldImporter.java @@ -20,7 +20,7 @@ import net.minecraft.world.biome.BiomeKeys; import net.minecraft.world.chunk.ChunkNibbleArray; import net.minecraft.world.chunk.PalettedContainer; import net.minecraft.world.chunk.ReadableContainer; -import net.minecraft.world.storage.ChunkStreamVersion; +import net.minecraft.world.storage.ChunkCompressionFormat; import org.lwjgl.system.MemoryUtil; import java.io.*; @@ -94,7 +94,9 @@ public class WorldImporter { } }; - this.biomeCodec = PalettedContainer.createReadableContainerCodec(biomeRegistry.getIndexedEntries(), biomeRegistry.createEntryCodec(), PalettedContainer.PaletteProvider.BIOME, biomeRegistry.entryOf(BiomeKeys.PLAINS)); + this.biomeCodec = PalettedContainer.createReadableContainerCodec( + biomeRegistry.getIndexedEntries(), biomeRegistry.getEntryCodec(), PalettedContainer.PaletteProvider.BIOME, biomeRegistry.entryOf(BiomeKeys.PLAINS) + ); } @@ -206,7 +208,7 @@ public class WorldImporter { } private DataInputStream decompress(byte flags, InputStream stream) throws IOException { - ChunkStreamVersion chunkStreamVersion = ChunkStreamVersion.get(flags); + ChunkCompressionFormat chunkStreamVersion = ChunkCompressionFormat.get(flags); if (chunkStreamVersion == null) { System.err.println("Chunk has invalid chunk stream version"); return null; diff --git a/src/main/java/me/cortex/voxy/client/mixin/minecraft/MixinMinecraftClient.java b/src/main/java/me/cortex/voxy/client/mixin/minecraft/MixinMinecraftClient.java index 8c3f0159..7d611b1f 100644 --- a/src/main/java/me/cortex/voxy/client/mixin/minecraft/MixinMinecraftClient.java +++ b/src/main/java/me/cortex/voxy/client/mixin/minecraft/MixinMinecraftClient.java @@ -11,6 +11,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; public class MixinMinecraftClient { @Inject(method = "", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/resource/PeriodicNotificationManager;(Lnet/minecraft/util/Identifier;Lit/unimi/dsi/fastutil/objects/Object2BooleanFunction;)V", shift = At.Shift.AFTER)) private void injectRenderDoc(RunArgs args, CallbackInfo ci) { - //System.load("C:\\Program Files\\RenderDoc\\renderdoc.dll"); + System.load("C:\\Program Files\\RenderDoc\\renderdoc.dll"); } } diff --git a/src/main/java/me/cortex/voxy/client/mixin/minecraft/MixinWorldRenderer.java b/src/main/java/me/cortex/voxy/client/mixin/minecraft/MixinWorldRenderer.java index b3b08c8b..ff669896 100644 --- a/src/main/java/me/cortex/voxy/client/mixin/minecraft/MixinWorldRenderer.java +++ b/src/main/java/me/cortex/voxy/client/mixin/minecraft/MixinWorldRenderer.java @@ -25,14 +25,14 @@ public abstract class MixinWorldRenderer implements IGetVoxelCore { @Unique private VoxelCore core; @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/WorldRenderer;setupTerrain(Lnet/minecraft/client/render/Camera;Lnet/minecraft/client/render/Frustum;ZZ)V", shift = At.Shift.AFTER)) - private void injectSetup(MatrixStack matrices, float tickDelta, long limitTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f projectionMatrix, CallbackInfo ci) { + private void injectSetup(RenderTickCounter tickCounter, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f matrix4f, Matrix4f matrix4f2, CallbackInfo ci) { if (this.core != null) { this.core.renderSetup(this.frustum, camera); } } - @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/WorldRenderer;renderLayer(Lnet/minecraft/client/render/RenderLayer;Lnet/minecraft/client/util/math/MatrixStack;DDDLorg/joml/Matrix4f;)V", ordinal = 2, shift = At.Shift.AFTER)) - private void injectOpaqueRender(MatrixStack matrices, float tickDelta, long limitTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f projectionMatrix, CallbackInfo ci) { + @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/WorldRenderer;renderLayer(Lnet/minecraft/client/render/RenderLayer;DDDLorg/joml/Matrix4f;Lorg/joml/Matrix4f;)V", ordinal = 2, shift = At.Shift.AFTER)) + private void injectOpaqueRender(RenderTickCounter tickCounter, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f matrix4f, Matrix4f matrix4f2, CallbackInfo ci) { if (this.core != null) { var cam = camera.getPos(); //this.core.renderOpaque(matrices, cam.x, cam.y, cam.z); 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 94dcb352..5772bf60 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 @@ -9,7 +9,6 @@ import me.jellysquid.mods.sodium.client.render.chunk.lists.ChunkRenderListIterab import me.jellysquid.mods.sodium.client.render.chunk.terrain.DefaultTerrainRenderPasses; import me.jellysquid.mods.sodium.client.render.chunk.terrain.TerrainRenderPass; import me.jellysquid.mods.sodium.client.render.viewport.CameraTransform; -import net.coderbot.iris.pipeline.ShadowRenderer; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.client.MinecraftClient; import net.minecraft.client.util.math.MatrixStack; diff --git a/src/main/java/me/cortex/voxy/client/mixin/sodium/MixinSodiumWorldRender.java b/src/main/java/me/cortex/voxy/client/mixin/sodium/MixinSodiumWorldRender.java index 7bf9baee..a0ce727c 100644 --- a/src/main/java/me/cortex/voxy/client/mixin/sodium/MixinSodiumWorldRender.java +++ b/src/main/java/me/cortex/voxy/client/mixin/sodium/MixinSodiumWorldRender.java @@ -1,6 +1,7 @@ package me.cortex.voxy.client.mixin.sodium; import me.jellysquid.mods.sodium.client.render.SodiumWorldRenderer; +import me.jellysquid.mods.sodium.client.render.chunk.ChunkRenderMatrices; import net.minecraft.client.render.RenderLayer; import net.minecraft.client.util.math.MatrixStack; import org.spongepowered.asm.mixin.Mixin; @@ -11,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(value = SodiumWorldRenderer.class, remap = false) public class MixinSodiumWorldRender { @Inject(method = "drawChunkLayer", at = @At("HEAD"), cancellable = true, require = 0) - private void cancelRender(RenderLayer renderLayer, MatrixStack matrixStack, double x, double y, double z, CallbackInfo ci) { + private void cancelRender(RenderLayer renderLayer, ChunkRenderMatrices matrices, double x, double y, double z, CallbackInfo ci) { //ci.cancel(); } } diff --git a/src/main/java/me/cortex/voxy/common/world/other/Mapper.java b/src/main/java/me/cortex/voxy/common/world/other/Mapper.java index cfb52069..a5fa762e 100644 --- a/src/main/java/me/cortex/voxy/common/world/other/Mapper.java +++ b/src/main/java/me/cortex/voxy/common/world/other/Mapper.java @@ -8,7 +8,7 @@ import net.minecraft.block.Blocks; import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.NbtIo; import net.minecraft.nbt.NbtOps; -import net.minecraft.nbt.NbtTagSizeTracker; +import net.minecraft.nbt.NbtSizeTracker; import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.util.Pair; import net.minecraft.world.biome.Biome; @@ -290,11 +290,11 @@ public class Mapper { public static StateEntry deserialize(int id, byte[] data) { try { - var compound = NbtIo.readCompressed(new ByteArrayInputStream(data), NbtTagSizeTracker.ofUnlimitedBytes()); + var compound = NbtIo.readCompressed(new ByteArrayInputStream(data), NbtSizeTracker.ofUnlimitedBytes()); if (compound.getInt("id") != id) { throw new IllegalStateException("Encoded id != expected id"); } - BlockState state = BlockState.CODEC.parse(NbtOps.INSTANCE, compound.getCompound("block_state")).get().orThrow(); + BlockState state = BlockState.CODEC.parse(NbtOps.INSTANCE, compound.getCompound("block_state")).getOrThrow(); return new StateEntry(id, state); } catch (IOException e) { throw new RuntimeException(e); @@ -326,7 +326,7 @@ public class Mapper { public static BiomeEntry deserialize(int id, byte[] data) { try { - var compound = NbtIo.readCompressed(new ByteArrayInputStream(data), NbtTagSizeTracker.ofUnlimitedBytes()); + var compound = NbtIo.readCompressed(new ByteArrayInputStream(data), NbtSizeTracker.ofUnlimitedBytes()); if (compound.getInt("id") != id) { throw new IllegalStateException("Encoded id != expected id"); } diff --git a/src/main/resources/assets/voxy/shaders/bakery/position_tex.vsh b/src/main/resources/assets/voxy/shaders/bakery/position_tex.vsh index 21f8d4d7..a3397d6d 100644 --- a/src/main/resources/assets/voxy/shaders/bakery/position_tex.vsh +++ b/src/main/resources/assets/voxy/shaders/bakery/position_tex.vsh @@ -1,8 +1,8 @@ #version 430 layout(location=0) in vec3 pos; -layout(location=1) in vec4 _metadata; -layout(location=2) in vec2 uv; +layout(location=1) in vec2 uv; +layout(location=2) in vec4 _metadata; layout(location=1) uniform mat4 transform; out vec2 texCoord; diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index c60d2192..7f8d11b4 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -27,7 +27,7 @@ "voxy.mixins.json" ], "depends": { - "minecraft": "1.20.4", + "minecraft": "1.21", "fabricloader": ">=0.14.22", "fabric-api": ">=0.91.1", "cloth-config": ">=13",