From a3d167a958148c09f8f1879aa1b73dc00a4c45c4 Mon Sep 17 00:00:00 2001 From: coolGi Date: Wed, 15 Mar 2023 21:45:57 +1030 Subject: [PATCH] Fixed up the build, buildsystem and the transparent lod button. --- 1.19.4.properties | 2 +- build.gradle | 20 ++++----- common/build.gradle | 26 +++++------ .../wrappers/config/TexturedButtonWidget.java | 27 ++++++++++-- .../main/resources/1_19_4.lod.accesswidener | 44 ------------------- fabric/build.gradle | 18 ++++---- forge/build.gradle | 24 +++++----- gradle.properties | 2 +- 8 files changed, 70 insertions(+), 93 deletions(-) delete mode 100644 common/src/main/resources/1_19_4.lod.accesswidener diff --git a/1.19.4.properties b/1.19.4.properties index 34496a0c4..13c92715f 100644 --- a/1.19.4.properties +++ b/1.19.4.properties @@ -2,7 +2,7 @@ java_version = 17 minecraft_version=1.19.4 -#parchment_version=2022.03.13 +parchment_version=2022.03.13 compatible_minecraft_versions=["1.19.4"] # Fabric loader diff --git a/build.gradle b/build.gradle index c6339d80d..a32bd21b4 100644 --- a/build.gradle +++ b/build.gradle @@ -89,7 +89,7 @@ def loadProperties() { "1.19.1" : "1_19", "1.19.2" : "1_19", "1.19.3" : "1_19_3", - "1.19.4" : "1_19_4" + "1.19.4" : "1_19_3" ] // Use this as sometimes multiple versions use the same access wideners rootProject.ext.set("acsessWidenerVersion", mcVersionToAcsessWidenerVersion.get(mcVersion)) @@ -242,18 +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" + && rootProject.minecraft_version != "1.19.1" + && rootProject.minecraft_version != "1.19.2" + && rootProject.minecraft_version != "1.19.3" + && rootProject.minecraft_version != "1.19.4" ) // 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 + // Note: parchment may have later mappings at the time you are reading this, but at the time this was written, it didnt + // Check the main branch for the new build system, with the working mappings } //Manifold diff --git a/common/build.gradle b/common/build.gradle index 35ff043bb..29a63420b 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -33,18 +33,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" - ) // 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 - */ + 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.4" + ) // 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 + // Note: parchment may have later mappings at the time you are reading this, but at the time this was written, it didnt + // Check the main branch for the new build system, with the working mappings } //Manifold @@ -223,4 +223,4 @@ sourcesJar { } runClient.enabled = false -runServer.enabled = false +runServer.enabled = false \ No newline at end of file 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 be146af7b..48fb571f9 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,8 +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); // } - - /* + + #if PRE_MC_1_19_4 @Override public void renderButton(PoseStack matrices, int mouseX, int mouseY, float delta) { #if PRE_MC_1_17_1 @@ -74,5 +74,26 @@ public class TexturedButtonWidget extends ImageButton { #endif super.renderButton(matrices, mouseX, mouseY, delta); - }*/ + } + #else + @Override + public void renderWidget(PoseStack matrices, int mouseX, int mouseY, float delta) { + RenderSystem.setShader(GameRenderer::getPositionTexShader); + RenderSystem.setShaderTexture(0, WIDGETS_LOCATION); + RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, this.alpha); + + int i = 1; + if (!this.active) + i = 0; + else if (this.isHovered) + i = 2; + RenderSystem.enableBlend(); + RenderSystem.defaultBlendFunc(); + RenderSystem.enableDepthTest(); + this.blit(matrices, this.getX(), this.getY(), 0, 46 + i * 20, this.getWidth() / 2, this.getHeight()); + this.blit(matrices, this.getX() + this.getWidth() / 2, this.getY(), 200 - this.width / 2, 46 + i * 20, this.getWidth() / 2, this.getHeight()); + + super.renderWidget(matrices, mouseX, mouseY, delta); + } + #endif } diff --git a/common/src/main/resources/1_19_4.lod.accesswidener b/common/src/main/resources/1_19_4.lod.accesswidener deleted file mode 100644 index f3a62f9bd..000000000 --- a/common/src/main/resources/1_19_4.lod.accesswidener +++ /dev/null @@ -1,44 +0,0 @@ -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 b56e1481f..99e33459a 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -107,18 +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" + && rootProject.minecraft_version != "1.19.4" ) // 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 + // Note: parchment may have later mappings at the time you are reading this, but at the time this was written, it didnt + // Check the main branch for the new build system, with the working mappings } //Manifold diff --git a/forge/build.gradle b/forge/build.gradle index 681bc17bb..a53d13ad5 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -61,18 +61,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" - ) // 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 - */ + 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.4" + ) // 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 + // Note: parchment may have later mappings at the time you are reading this, but at the time this was written, it didnt + // Check the main branch for the new build system, with the working mappings } //Manifold diff --git a/gradle.properties b/gradle.properties index 845fdf3d4..70ee9e7e5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,4 +20,4 @@ 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,1.19.4 ##### FOR IDE SUPPORT AND TELL IDE TO USE CERTIAN MC VERSION: SWITCH THIS: -mcVer=1.19.3 +mcVer=1.19.4