diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/McObjectConverter.java b/common/src/main/java/com/seibel/lod/common/wrappers/McObjectConverter.java index 48ea3ef6d..ca3c1717a 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/McObjectConverter.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/McObjectConverter.java @@ -48,6 +48,10 @@ public class McObjectConverter } /** Taken from Minecraft's com.mojang.math.Matrix4f class from 1.18.2 */ public static void storeMatrix(Matrix4f matrix, FloatBuffer buffer) { + #if PRE_MC_1_19_3 + matrix.store(buffer); + #else + // Mojang starts to use joml's Matrix4f libary in 1.19.3 so we copy their store method and use it here if its newer than 1.19.3 buffer.put(bufferIndex(0, 0), matrix.m00()); buffer.put(bufferIndex(0, 1), matrix.m01()); buffer.put(bufferIndex(0, 2), matrix.m02()); @@ -64,6 +68,7 @@ public class McObjectConverter buffer.put(bufferIndex(3, 1), matrix.m31()); buffer.put(bufferIndex(3, 2), matrix.m32()); buffer.put(bufferIndex(3, 3), matrix.m33()); + #endif } @@ -74,7 +79,9 @@ public class McObjectConverter FloatBuffer buffer = FloatBuffer.allocate(16); storeMatrix(mcMatrix, buffer); Mat4f matrix = new Mat4f(buffer); - matrix.transpose(); + #if PRE_MC_1_19_3 + matrix.transpose(); // In 1.19.3 and later, we no longer need to transpose it + #endif return matrix; } diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/block/TextureAtlasSpriteWrapper.java b/common/src/main/java/com/seibel/lod/common/wrappers/block/TextureAtlasSpriteWrapper.java index b441bfec0..05bc84d69 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/block/TextureAtlasSpriteWrapper.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/block/TextureAtlasSpriteWrapper.java @@ -41,7 +41,7 @@ public class TextureAtlasSpriteWrapper { return sprite.mainImage[0].getPixelRGBA( x + sprite.framesX[frameIndex] * sprite.getWidth(), y + sprite.framesY[frameIndex] * sprite.getHeight()); - #elif PRE_MC_19_3 + #elif PRE_MC_1_19_3 if (sprite.animatedTexture != null) { x += sprite.animatedTexture.getFrameX(frameIndex) * sprite.width; y += sprite.animatedTexture.getFrameY(frameIndex) * sprite.height; diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/GlobalParameters.java b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/GlobalParameters.java index 4f00cde77..800e76baf 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/GlobalParameters.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/GlobalParameters.java @@ -86,11 +86,12 @@ public final class GlobalParameters #if PRE_MC_1_19_3 worldGenSettings = worldData.worldGenSettings(); biomes = registry.registryOrThrow(Registry.BIOME_REGISTRY); + worldSeed = worldGenSettings.seed(); #else worldOptions = worldData.worldGenOptions(); biomes = registry.registryOrThrow(Registries.BIOME); - #endif worldSeed = worldOptions.seed(); + #endif #if POST_MC_1_18_1 biomeManager = new BiomeManager(level, BiomeManager.obfuscateSeed(worldSeed)); chunkScanner = level.getChunkSource().chunkScanner();