From 9bb1a044027b8e4eca13c82af3c9ea5146e4c8f6 Mon Sep 17 00:00:00 2001 From: JupiterSky11 Date: Wed, 15 Mar 2023 05:38:20 -0400 Subject: [PATCH] Made building for 1.19.4 function. --- 1.19.4.properties | 43 ++++++++++++++++++ build.gradle | 14 +++--- common/build.gradle | 23 +++++----- .../wrappers/config/TexturedButtonWidget.java | 5 ++- .../main/resources/1_19_4.lod.accesswidener | 44 +++++++++++++++++++ fabric/build.gradle | 15 ++++--- forge/build.gradle | 21 +++++---- gradle.properties | 4 +- 8 files changed, 135 insertions(+), 34 deletions(-) create mode 100644 1.19.4.properties create mode 100644 common/src/main/resources/1_19_4.lod.accesswidener diff --git a/1.19.4.properties b/1.19.4.properties new file mode 100644 index 000000000..34496a0c4 --- /dev/null +++ b/1.19.4.properties @@ -0,0 +1,43 @@ +# 1.18.2 version based stuff + +java_version = 17 +minecraft_version=1.19.4 +#parchment_version=2022.03.13 +compatible_minecraft_versions=["1.19.4"] + +# Fabric loader +fabric_loader_version=0.14.17 +fabric_api_version=0.75.3+1.19.4 + # Fabric mod versions + modmenu_version=6.1.0-rc.1 + starlight_version_fabric=0 + phosphor_version_fabric=0 + lithium_version=0 + sodium_version=4145281 + iris_version=1.19.x-v1.2.6 + immersive_portals_version = 0 + bclib_version=0 + + # Fabric mod run + # 0 = Don't enable and don't run + # 1 = Can be referenced in code but doesn't run + # 2 = Can be referenced in code and runs in client + enable_starlight=0 + enable_phosphor=0 + enable_sodium=1 + enable_lithium=0 + enable_iris=0 + enable_bclib=0 + +# Forge loader +forge_version=45.0.0 + # Forge mod versions + starlight_version_forge=0 + terraforged_version= + + # Forge mod run + # 0 = Don't enable and don't run + # 1 = Can be referenced in code but doesn't run + # 2 = Can be referenced in code and runs in client + enable_starlight_forge=0 + enable_terraforged=0 diff --git a/build.gradle b/build.gradle index 88d5f8979..c6339d80d 100644 --- a/build.gradle +++ b/build.gradle @@ -88,7 +88,8 @@ def loadProperties() { "1.18.2": "1_18", "1.19.1" : "1_19", "1.19.2" : "1_19", - "1.19.3" : "1_19_3" + "1.19.3" : "1_19_3", + "1.19.4" : "1_19_4" ] // Use this as sometimes multiple versions use the same access wideners rootProject.ext.set("acsessWidenerVersion", mcVersionToAcsessWidenerVersion.get(mcVersion)) @@ -241,15 +242,18 @@ subprojects { p -> // Mojmap mappings officialMojangMappings() // Parchment mappings (it adds parameter mappings & javadoc) + parchment("org.parchmentmc.data:parchment-1.19.3:2023.03.12@zip") + /* Hack fix, cleans up some errors. Parchment now has more versions, but this is designed for 1.19.3 and hopefully works in 1.19.4. if ( rootProject.minecraft_version != "1.19" && rootProject.minecraft_version != "1.19.1" && rootProject.minecraft_version != "1.19.2" && rootProject.minecraft_version != "1.19.3" ) // We are not gonna use this build script anymore so dont bother fixing this - parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip") - else - parchment("org.parchmentmc.data:parchment-1.18.2:${rootProject.parchment_version}@zip") // As 1.19.x or higher doesnt have parchment mappings yet, we use 1.18.2 mapping + parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip") + else + parchment("org.parchmentmc.data:parchment-1.18.2:${rootProject.parchment_version}@zip") // As 1.19.x or higher doesnt have parchment mappings yet, we use 1.18.2 mapping + */ } //Manifold @@ -407,4 +411,4 @@ subprojects { p -> p.runClient.enabled = false p.runServer.enabled = false } -} \ No newline at end of file +} diff --git a/common/build.gradle b/common/build.gradle index 5b1702d8f..35ff043bb 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -33,15 +33,18 @@ dependencies { // Mojmap mappings officialMojangMappings() // Parchment mappings (it adds parameter mappings & javadoc) - if ( - rootProject.minecraft_version != "1.19" - && rootProject.minecraft_version != "1.19.1" - && rootProject.minecraft_version != "1.19.2" - && rootProject.minecraft_version != "1.19.3" - ) // We are not gonna use this build script anymore so dont bother fixing this - parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip") - else - parchment("org.parchmentmc.data:parchment-1.18.2:${rootProject.parchment_version}@zip") // As 1.19.x or higher doesnt have parchment mappings yet, we use 1.18.2 mapping + parchment("org.parchmentmc.data:parchment-1.19.3:2023.03.12@zip") + /* Hack fix, cleans up some errors. Parchment now has more versions, but this is designed for 1.19.3 and hopefully works in 1.19.4. + if ( + rootProject.minecraft_version != "1.19" + && rootProject.minecraft_version != "1.19.1" + && rootProject.minecraft_version != "1.19.2" + && rootProject.minecraft_version != "1.19.3" + ) // We are not gonna use this build script anymore so dont bother fixing this + parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip") + else + parchment("org.parchmentmc.data:parchment-1.18.2:${rootProject.parchment_version}@zip") // As 1.19.x or higher doesnt have parchment mappings yet, we use 1.18.2 mapping + */ } //Manifold @@ -220,4 +223,4 @@ sourcesJar { } runClient.enabled = false -runServer.enabled = false \ No newline at end of file +runServer.enabled = false diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/config/TexturedButtonWidget.java b/common/src/main/java/com/seibel/lod/common/wrappers/config/TexturedButtonWidget.java index 507ebf868..be146af7b 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/config/TexturedButtonWidget.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/config/TexturedButtonWidget.java @@ -48,7 +48,8 @@ public class TexturedButtonWidget extends ImageButton { // public TexturedButtonWidget(int x, int y, int width, int height, int u, int v, int hoveredVOffset, ResourceLocation texture, int textureWidth, int textureHeight, OnPress pressAction, OnTooltip tooltipSupplier, Component text) { // super(x, y, width, height, u, v, hoveredVOffset, texture, textureWidth, textureHeight, pressAction, tooltipSupplier, text); // } - + + /* @Override public void renderButton(PoseStack matrices, int mouseX, int mouseY, float delta) { #if PRE_MC_1_17_1 @@ -73,5 +74,5 @@ public class TexturedButtonWidget extends ImageButton { #endif super.renderButton(matrices, mouseX, mouseY, delta); - } + }*/ } diff --git a/common/src/main/resources/1_19_4.lod.accesswidener b/common/src/main/resources/1_19_4.lod.accesswidener new file mode 100644 index 000000000..f3a62f9bd --- /dev/null +++ b/common/src/main/resources/1_19_4.lod.accesswidener @@ -0,0 +1,44 @@ +accessWidener v1 named + + +# used when determining where to save files to +accessible field net/minecraft/world/level/storage/DimensionDataStorage dataFolder Ljava/io/File; + +# used when rendering +accessible field com/mojang/blaze3d/vertex/VertexBuffer indexCount I +accessible method net/minecraft/client/renderer/GameRenderer getFov (Lnet/minecraft/client/Camera;FZ)D + +# used for grabbing vanilla rendered chunks +accessible field net/minecraft/client/renderer/LevelRenderer renderChunkStorage Ljava/util/concurrent/atomic/AtomicReference; +accessible class net/minecraft/client/renderer/LevelRenderer$RenderChunkStorage +accessible class net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo +accessible field net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo chunk Lnet/minecraft/client/renderer/chunk/ChunkRenderDispatcher$RenderChunk; + +# lighting +accessible field net/minecraft/client/renderer/LightTexture lightPixels Lcom/mojang/blaze3d/platform/NativeImage; +accessible field net/minecraft/client/renderer/LightTexture lightTexture Lnet/minecraft/client/renderer/texture/DynamicTexture; +accessible field net/minecraft/world/level/lighting/LevelLightEngine blockEngine Lnet/minecraft/world/level/lighting/LayerLightEngine; +accessible field net/minecraft/world/level/lighting/LevelLightEngine skyEngine Lnet/minecraft/world/level/lighting/LayerLightEngine; + +# world generation +accessible method net/minecraft/world/level/levelgen/Heightmap setHeight (III)V +accessible field net/minecraft/world/level/biome/Biome generationSettings Lnet/minecraft/world/level/biome/BiomeGenerationSettings; +# accessible field net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator settings Lnet/minecraft/core/Holder; +accessible method net/minecraft/world/level/lighting/LayerLightEngine queueSectionData (JLnet/minecraft/world/level/chunk/DataLayer;Z)V +accessible method net/minecraft/server/level/ChunkMap readChunk (Lnet/minecraft/world/level/ChunkPos;)Ljava/util/concurrent/CompletableFuture; + + +# lod generation from save file +accessible field net/minecraft/server/level/ChunkMap mainThreadExecutor Lnet/minecraft/util/thread/BlockableEventLoop; + + +# grabbing textures +accessible class net/minecraft/client/renderer/texture/SpriteContents$AnimatedTexture +accessible method net/minecraft/client/renderer/texture/SpriteContents$AnimatedTexture getFrameX (I)I +accessible method net/minecraft/client/renderer/texture/SpriteContents$AnimatedTexture getFrameY (I)I +accessible field net/minecraft/client/renderer/texture/SpriteContents animatedTexture Lnet/minecraft/client/renderer/texture/SpriteContents$AnimatedTexture; +accessible field net/minecraft/client/renderer/texture/SpriteContents originalImage Lcom/mojang/blaze3d/platform/NativeImage; + +# hacky stuff +accessible field net/minecraft/util/ThreadingDetector lock Ljava/util/concurrent/Semaphore; +mutable field net/minecraft/util/ThreadingDetector lock Ljava/util/concurrent/Semaphore; \ No newline at end of file diff --git a/fabric/build.gradle b/fabric/build.gradle index f49d46c4e..b56e1481f 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -107,15 +107,18 @@ dependencies { // Mojmap mappings officialMojangMappings() // Parchment mappings (it adds parameter mappings & javadoc) + parchment("org.parchmentmc.data:parchment-1.19.3:2023.03.12@zip") + /* Hack fix, cleans up some errors. Parchment now has more versions, but this is designed for 1.19.3 and hopefully works in 1.19.4. if ( rootProject.minecraft_version != "1.19" - && rootProject.minecraft_version != "1.19.1" - && rootProject.minecraft_version != "1.19.2" - && rootProject.minecraft_version != "1.19.3" + && rootProject.minecraft_version != "1.19.1" + && rootProject.minecraft_version != "1.19.2" + && rootProject.minecraft_version != "1.19.3" ) // We are not gonna use this build script anymore so dont bother fixing this - parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip") - else - parchment("org.parchmentmc.data:parchment-1.18.2:${rootProject.parchment_version}@zip") // As 1.19.x or higher doesnt have parchment mappings yet, we use 1.18.2 mapping + parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip") + else + parchment("org.parchmentmc.data:parchment-1.18.2:${rootProject.parchment_version}@zip") // As 1.19.x or higher doesnt have parchment mappings yet, we use 1.18.2 mapping + */ } //Manifold diff --git a/forge/build.gradle b/forge/build.gradle index 78e567c85..681bc17bb 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -61,15 +61,18 @@ dependencies { // Mojmap mappings officialMojangMappings() // Parchment mappings (it adds parameter mappings & javadoc) - if ( - rootProject.minecraft_version != "1.19" - && rootProject.minecraft_version != "1.19.1" - && rootProject.minecraft_version != "1.19.2" - && rootProject.minecraft_version != "1.19.3" - ) // We are not gonna use this build script anymore so dont bother fixing this - parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip") - else - parchment("org.parchmentmc.data:parchment-1.18.2:${rootProject.parchment_version}@zip") // As 1.19.x or higher doesnt have parchment mappings yet, we use 1.18.2 mapping + parchment("org.parchmentmc.data:parchment-1.19.3:2023.03.12@zip") + /* Hack fix, cleans up some errors. Parchment now has more versions, but this is designed for 1.19.3 and hopefully works in 1.19.4. + if ( + rootProject.minecraft_version != "1.19" + && rootProject.minecraft_version != "1.19.1" + && rootProject.minecraft_version != "1.19.2" + && rootProject.minecraft_version != "1.19.3" + ) // We are not gonna use this build script anymore so dont bother fixing this + parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip") + else + parchment("org.parchmentmc.data:parchment-1.18.2:${rootProject.parchment_version}@zip") // As 1.19.x or higher doesnt have parchment mappings yet, we use 1.18.2 mapping + */ } //Manifold diff --git a/gradle.properties b/gradle.properties index bf7f96dd2..845fdf3d4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ mod_issues=https://gitlab.com/jeseibel/minecraft-lod-mod/-/issues toml_version=3.6.4 manifold_version=2022.1.18 enabled_platforms=fabric,forge -mcVersions=1.16.5,1.17.1,1.18.1,1.18.2,1.19,1.19.1,1.19.2,1.19.3 +mcVersions=1.16.5,1.17.1,1.18.1,1.18.2,1.19,1.19.1,1.19.2,1.19.3,1.19.4 ##### FOR IDE SUPPORT AND TELL IDE TO USE CERTIAN MC VERSION: SWITCH THIS: -mcVer=1.19.3 \ No newline at end of file +mcVer=1.19.3