diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..f811f6ae6 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# Disable autocrlf on generated files, they always generate with LF +# Add any extra files or paths here to make git stop saying they +# are changed when only line endings change. +src/generated/**/.cache/cache text eol=lf +src/generated/**/*.json text eol=lf diff --git a/.gitignore b/.gitignore index 028e1e40f..12f864471 100644 --- a/.gitignore +++ b/.gitignore @@ -19,8 +19,7 @@ build # other eclipse +run -# minecraft run folder, -# ignore everything but the mods folder -run/* -!run/mods \ No newline at end of file +# Files from Forge MDK +forge*changelog.txt diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 2b91bc8d5..000000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "ASMHelper"] - path = ASMHelper - url = https://github.com/squeek502/ASMHelper.git - branch = 1.12.x diff --git a/CREDITS.txt b/CREDITS.txt index 589f482ef..a70c53d5a 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -10,7 +10,7 @@ alpha. Eloraam of RedPower, and SpaceToad of Buildcraft, without their acceptian of me taking over the project, who knows what Minecraft modding would be today. Secondly, someone who has worked with me, and developed some of the core features -that allow modding to he as functional, and as simple as it is, cpw. For developing +that allow modding to be as functional, and as simple as it is, cpw. For developing FML, which stabelized the client and server modding ecosystem. As well as the base loading system that allows us to modify Minecraft's code as elegently as possible. diff --git a/LICENSE-Paulscode IBXM Library.txt b/LICENSE-Paulscode IBXM Library.txt deleted file mode 100644 index d4884b071..000000000 --- a/LICENSE-Paulscode IBXM Library.txt +++ /dev/null @@ -1,10 +0,0 @@ -IBXM is copyright (c) 2007, Martin Cameron, and is licensed under the BSD License. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -Neither the name of mumart nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/LICENSE-Paulscode SoundSystem CodecIBXM.txt b/LICENSE-Paulscode SoundSystem CodecIBXM.txt deleted file mode 100644 index a68a49478..000000000 --- a/LICENSE-Paulscode SoundSystem CodecIBXM.txt +++ /dev/null @@ -1,40 +0,0 @@ -SoundSystem CodecIBXM Class License: - -You are free to use this class for any purpose, commercial or otherwise. -You may modify this class or source code, and distribute it any way you -like, provided the following conditions are met: - -1) You may not falsely claim to be the author of this class or any - unmodified portion of it. -2) You may not copyright this class or a modified version of it and then - sue me for copyright infringement. -3) If you modify the source code, you must clearly document the changes - made before redistributing the modified source code, so other users know - it is not the original code. -4) You are not required to give me credit for this class in any derived - work, but if you do, you must also mention my website: - http://www.paulscode.com -5) I the author will not be responsible for any damages (physical, - financial, or otherwise) caused by the use if this class or any - portion of it. -6) I the author do not guarantee, warrant, or make any representations, - either expressed or implied, regarding the use of this class or any - portion of it. - -Author: Paul Lamb -http://www.paulscode.com - - -This software is based on or using the IBXM library available from -http://www.geocities.com/sunet2000/ - - -IBXM is copyright (c) 2007, Martin Cameron, and is licensed under the BSD License. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -Neither the name of mumart nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/LICENSE.txt b/LICENSE.txt index 97b081bab..b0cbe2b39 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -3,8 +3,8 @@ parts herein are licensed under the terms of the LGPL 2.1 found here http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt and copied below. -Homepage: http://MinecraftForge.net/ - http://github.com/MinecraftForge/MinecraftForge +Homepage: http://minecraftforge.net/ + https://github.com/MinecraftForge/MinecraftForge A note on authorship: @@ -57,12 +57,6 @@ This software contains a partial repackaging of javaxdelta, a BSD licensed progr binary differences and applying them, sourced from the subversion at http://sourceforge.net/projects/javaxdelta/ authored by genman, heikok, pivot. The only changes are to replace some Trove collection types with standard Java collections, and repackaged. - -This software contains potions of Paulscodee IBXM library, a BSD liceensed library for -loading and playing IBXM formated auto. No modifications havee beeen made. The associated -licenses can be found along side this one, or at -https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/LICENSE-Paulscode%20IBXM%20Library.txt -https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/LICENSE-Paulscode%20SoundSystem%20CodecIBXM.txt ========================================================================= diff --git a/OptiFine_1.12.2_HD_U_F5_src.zip b/OptiFine_1.12.2_HD_U_F5_src.zip deleted file mode 100644 index 9885114a2..000000000 Binary files a/OptiFine_1.12.2_HD_U_F5_src.zip and /dev/null differ diff --git a/_notes/storage solution.png b/_notes/storage solution.png deleted file mode 100644 index 84f6fced8..000000000 Binary files a/_notes/storage solution.png and /dev/null differ diff --git a/_notes/storage test.xlsx b/_notes/storage test.xlsx deleted file mode 100644 index d58c3d03c..000000000 Binary files a/_notes/storage test.xlsx and /dev/null differ diff --git a/_tools/ASM/MCPMappingViewer_1.0.1.jar b/_tools/ASM/MCPMappingViewer_1.0.1.jar deleted file mode 100644 index 7a8eecf36..000000000 Binary files a/_tools/ASM/MCPMappingViewer_1.0.1.jar and /dev/null differ diff --git a/_tools/ASM/readme.txt b/_tools/ASM/readme.txt deleted file mode 100644 index 824c2d222..000000000 --- a/_tools/ASM/readme.txt +++ /dev/null @@ -1 +0,0 @@ -these are tools needed for looking at obfuscated minecraft code. \ No newline at end of file diff --git a/_tools/optifine/OptiFine_1.12.2_HD_U_F5.jar b/_tools/optifine/OptiFine_1.12.2_HD_U_F5.jar deleted file mode 100644 index eb37d8edc..000000000 Binary files a/_tools/optifine/OptiFine_1.12.2_HD_U_F5.jar and /dev/null differ diff --git a/_tools/optifine/OptiFine_1.12.2_HD_U_F5_deobfuscated.jar b/_tools/optifine/OptiFine_1.12.2_HD_U_F5_deobfuscated.jar deleted file mode 100644 index 98c638629..000000000 Binary files a/_tools/optifine/OptiFine_1.12.2_HD_U_F5_deobfuscated.jar and /dev/null differ diff --git a/_tools/optifine/java_decompiler-gui-1.6.6.jar b/_tools/optifine/java_decompiler-gui-1.6.6.jar deleted file mode 100644 index 58fd0da25..000000000 Binary files a/_tools/optifine/java_decompiler-gui-1.6.6.jar and /dev/null differ diff --git a/_tools/optifine/readme.txt b/_tools/optifine/readme.txt deleted file mode 100644 index 5c3989c91..000000000 --- a/_tools/optifine/readme.txt +++ /dev/null @@ -1 +0,0 @@ -these are tools needed for deobfuscating and looking at the code of optifine. \ No newline at end of file diff --git a/_tools/optifine/simple deob.bat b/_tools/optifine/simple deob.bat deleted file mode 100644 index 828a59527..000000000 --- a/_tools/optifine/simple deob.bat +++ /dev/null @@ -1,3 +0,0 @@ -java -jar ./simpledeobf-0.6.jar --input ./OptiFine_1.12.2_HD_U_F5.jar --output ./OptiFine_1.12.2_HD_U_F5_dev.jar --mapFile C:/Users/James_Seibel/.gradle/caches/minecraft/de/oceanlabs/mcp/mcp_snapshot/20171003/1.12.2/srgs/notch-mcp.srg --ref C:/Users/James_Seibel/.gradle/caches/minecraft/net/minecraft/minecraft/1.12.2/minecraft-1.12.2.jar - -pause \ No newline at end of file diff --git a/_tools/optifine/simpledeobf-0.6.jar b/_tools/optifine/simpledeobf-0.6.jar deleted file mode 100644 index 5938d21d6..000000000 Binary files a/_tools/optifine/simpledeobf-0.6.jar and /dev/null differ diff --git a/build.bat b/build.bat deleted file mode 100644 index 6c1fb2cba..000000000 --- a/build.bat +++ /dev/null @@ -1 +0,0 @@ -./gradlew build \ No newline at end of file diff --git a/build.gradle b/build.gradle index aaa59bca6..92179d2e9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,77 +1,162 @@ buildscript { repositories { + maven { url = 'https://files.minecraftforge.net/maven' } jcenter() - maven { url = "https://files.minecraftforge.net/maven" } + mavenCentral() + maven { url='https://dist.creeper.host/Sponge/maven' } } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' + classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true + classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT' } } -apply plugin: 'net.minecraftforge.gradle.forge' -//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. +apply plugin: 'net.minecraftforge.gradle' +apply plugin: 'org.spongepowered.mixin' +// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. +apply plugin: 'eclipse' +apply plugin: 'maven-publish' +version = '1.0' +group = 'com.backsun.lod' +archivesBaseName = 'lod' -version = "1.0" -group = "com.backsun.lod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html -archivesBaseName = "lod" - -sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. -compileJava { - sourceCompatibility = targetCompatibility = '1.8' -} +sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. +println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) minecraft { - version = "1.12.2-14.23.5.2847" - runDir = "run" - - // the mappings can be changed at any time, and must be in the following format. - // snapshot_YYYYMMDD snapshot are built nightly. - // stable_# stables are built at the discretion of the MCP team. + // The mappings can be changed at any time, and must be in the following format. + // snapshot_YYYYMMDD Snapshot are built nightly. + // stable_# Stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not always work. - // simply re-run your setup task after changing the mappings to update your workspace. - mappings = "snapshot_20171003" + // Simply re-run your setup task after changing the mappings to update your workspace. + mappings channel: 'snapshot', version: '20201028-1.16.3' + // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. + + accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') + + // Default run configurations. + // These can be tweaked, removed, or duplicated as needed. + runs { + client { + workingDirectory project.file('run') + arg "-mixin.config=lod.mixins.json" + + // Recommended logging data for a userdev environment + property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' + + // Recommended logging level for the console + property 'forge.logging.console.level', 'debug' + + mods { + examplemod { + source sourceSets.main + } + } + } + + server { + workingDirectory project.file('run') + arg "-mixin.config=lod.mixins.json" + + // Recommended logging data for a userdev environment + property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' + + // Recommended logging level for the console + property 'forge.logging.console.level', 'debug' + + mods { + examplemod { + source sourceSets.main + } + } + } + + data { + workingDirectory project.file('run') + + // Recommended logging data for a userdev environment + property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' + + // Recommended logging level for the console + property 'forge.logging.console.level', 'debug' + + // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. + args '--mod', 'lod', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') + + mods { + examplemod { + source sourceSets.main + } + } + } + } } +// Include resources generated by data generators. +sourceSets.main.resources { srcDir 'src/generated/resources' } + dependencies { - // you may put jars on which you depend on in ./libs - // or you may define them like so.. - //compile "some.group:artifact:version:classifier" - //compile "some.group:artifact:version" - - // real examples - //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env - //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env + // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed + // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. + // The userdev artifact is a special name and will get all sorts of transformations applied to it. + minecraft 'net.minecraftforge:forge:1.16.4-35.1.4' - // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. - //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' + // You may put jars on which you depend on in ./libs or you may define them like so.. + // compile "some.group:artifact:version:classifier" + // compile "some.group:artifact:version" - // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided, - // except that these dependencies get remapped to your current MCP mappings - //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev' - //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev' + // Real examples + // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env + // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env - // for more info... + // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. + // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' + + // These dependencies get remapped to your current MCP mappings + // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev' + + // For more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } -processResources { - // this will ensure that this task is redone when the versions change. - inputs.property "version", project.version - inputs.property "mcversion", project.minecraft.version - - // replace stuff in mcmod.info, nothing else - from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' - - // replace version and mcversion - expand 'version':project.version, 'mcversion':project.minecraft.version - } - - // copy everything else except the mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' +// Example for how to get properties into the manifest for reading by the runtime.. +jar { + manifest { + attributes([ + "Specification-Title": "Levels of Detail", + "Specification-Vendor": "examplemodsareus", + "Specification-Version": "1", // We are version 1 of ourselves + "Implementation-Title": project.name, + "Implementation-Version": "${version}", + "Implementation-Vendor" :"examplemodsareus", + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), + "MixinConfigs": "lod.mixins.json", + ]) } } + +// Example configuration to allow publishing using the maven-publish task +// This is the preferred method to reobfuscate your jar file +jar.finalizedBy('reobfJar') +// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing +//publish.dependsOn('reobfJar') + +publishing { + publications { + mavenJava(MavenPublication) { + artifact jar + } + } + repositories { + maven { + url "file:///${project.projectDir}/mcmodsrepo" + } + } +} + +mixin { + add sourceSets.main, "lod.refmap.json" +} diff --git a/build.gradle.bak b/build.gradle.bak new file mode 100644 index 000000000..35eca8bd2 --- /dev/null +++ b/build.gradle.bak @@ -0,0 +1,165 @@ +buildscript { + repositories { + maven { url = 'https://files.minecraftforge.net/maven' } + jcenter() + mavenCentral() + maven { url='https://dist.creeper.host/Sponge/maven' } + } + dependencies { + classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true + classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT' + } +} +apply plugin: 'net.minecraftforge.gradle' +apply plugin: 'org.spongepowered.mixin' +// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. +apply plugin: 'eclipse' +apply plugin: 'maven-publish' + +version = '1.0' +group = 'com.backsun.lod' +archivesBaseName = 'lod' + +sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. + +println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) +minecraft { + // The mappings can be changed at any time, and must be in the following format. + // snapshot_YYYYMMDD Snapshot are built nightly. + // stable_# Stables are built at the discretion of the MCP team. + // Use non-default mappings at your own risk. they may not always work. + // Simply re-run your setup task after changing the mappings to update your workspace. + mappings channel: 'snapshot', version: '20201028-1.16.3' + + minecraft { + mappings = 'snapshot_20210218' +} + // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. + + accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') + + // Default run configurations. + // These can be tweaked, removed, or duplicated as needed. + runs { + client { + workingDirectory project.file('run') + arg "-mixin.config=lod.mixins.json" + + // Recommended logging data for a userdev environment + property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' + + // Recommended logging level for the console + property 'forge.logging.console.level', 'debug' + + mods { + examplemod { + source sourceSets.main + } + } + } + + server { + workingDirectory project.file('run') + arg "-mixin.config=lod.mixins.json" + + // Recommended logging data for a userdev environment + property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' + + // Recommended logging level for the console + property 'forge.logging.console.level', 'debug' + + mods { + examplemod { + source sourceSets.main + } + } + } + + data { + workingDirectory project.file('run') + + // Recommended logging data for a userdev environment + property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' + + // Recommended logging level for the console + property 'forge.logging.console.level', 'debug' + + // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. + args '--mod', 'lod', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') + + mods { + examplemod { + source sourceSets.main + } + } + } + } +} + +// Include resources generated by data generators. +sourceSets.main.resources { srcDir 'src/generated/resources' } + +dependencies { + // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed + // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. + // The userdev artifact is a special name and will get all sorts of transformations applied to it. + minecraft 'net.minecraftforge:forge:1.16.4-35.1.36' + + // You may put jars on which you depend on in ./libs or you may define them like so.. + // compile "some.group:artifact:version:classifier" + // compile "some.group:artifact:version" + + // Real examples + // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env + // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env + + // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. + // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' + + // These dependencies get remapped to your current MCP mappings + // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev' + + // For more info... + // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html + // http://www.gradle.org/docs/current/userguide/dependency_management.html + +} + +// Example for how to get properties into the manifest for reading by the runtime.. +jar { + manifest { + attributes([ + "Specification-Title": "Levels of Detail", + "Specification-Vendor": "examplemodsareus", + "Specification-Version": "1", // We are version 1 of ourselves + "Implementation-Title": project.name, + "Implementation-Version": "${version}", + "Implementation-Vendor" :"examplemodsareus", + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), + "MixinConfigs": "lod.mixins.json", + ]) + } +} + +// Example configuration to allow publishing using the maven-publish task +// This is the preferred method to reobfuscate your jar file +jar.finalizedBy('reobfJar') +// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing +//publish.dependsOn('reobfJar') + +publishing { + publications { + mavenJava(MavenPublication) { + artifact jar + } + } + repositories { + maven { + url "file:///${project.projectDir}/mcmodsrepo" + } + } +} + +mixin { + add sourceSets.main, "lod.refmap.json" +} \ No newline at end of file diff --git a/changelog.txt b/changelog.txt index d15515960..09e033b80 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,467 +1,1664 @@ -========= -Build: 1.12.2-14.23.5.2846 - Tue Sep 03 21:22:46 GMT 2019 - ichttt: - Fix CME when removing ticket managers (#5861) +Build: 1.16.4-35.1.36 - Thu Jan 07 20:24:49 GMT 2021 + ian.rehwinkel: + Added IWeatherParticleRenderHandler to allow a mod to take control over weather particles and sounds. (#7522) ========= -Build: 1.12.2-14.23.5.2844 - Thu Aug 29 02:33:00 GMT 2019 - Barteks2x: - Fix client sometimes generating biomes, causing incorrect biome - generation on integrated server (#5720) - - bs2609: - Add checks for tile entities in now-unloaded chunks (#5724) +Build: 1.16.4-35.1.35 - Thu Jan 07 20:16:03 GMT 2021 + Laughlan Coventry: + Allow Chunk loading Tickets to opt-into forcing chunk ticks. (#7525) ========= -Build: 1.12.2-14.23.5.2843 - Thu Aug 29 02:23:04 GMT 2019 - bs2609: - Fix invalid placeholder entity attributes (MC-150405) (#5718) +Build: 1.16.4-35.1.34 - Thu Jan 07 20:10:18 GMT 2021 + malte0811: + Fix crash when mods add goals to skeleton horses (MC-206338) (#7509) ========= -Build: 1.12.2-14.23.5.2842 - Thu Aug 29 02:08:57 GMT 2019 - bs2609: - Allow conditional loading of advancements (#5255) +Build: 1.16.4-35.1.33 - Thu Jan 07 20:03:59 GMT 2021 + diesieben07: + Set WM_CLASS and WM_INSTANCE_NAME for early progress window (#7534) ========= -Build: 1.12.2-14.23.5.2841 - Thu Aug 29 01:58:50 GMT 2019 - bs2609: - Improve performance of persistent chunk checks (#5706) - - jensen.derik: - Fix lightning not triggering EntityJoinWorldEvent (#5290) +Build: 1.16.4-35.1.32 - Wed Jan 06 03:17:35 GMT 2021 + 35673674+alcatrazEscapee: + Make UnboundedMapCodec more lenient in decoding dimensions. Fixes MC-197860 (#7527) ========= -Build: 1.12.2-14.23.5.2840 - Thu Aug 29 01:19:55 GMT 2019 +Build: 1.16.4-35.1.31 - Tue Jan 05 19:59:52 GMT 2021 lex: - Fix copy paste derp + Prevent NPE and deprecated MissingMappings.getMappings function. Closes #6252 + lex: + Fix FML's Config Sync packet not allowing same length filenames in encoder and decoder. Closes #7584 -Build 2838: - bs2609: Fix vanilla handling of options file (MC-117449, MC-151173) (#5725) +========= +Build: 1.16.4-35.1.29 - Sun Jan 03 11:02:59 GMT 2021 + lex: + Fix entities not correctly being able to be ridden under water. -Build 2837: - clienthax: Update EnumHelper to be compatible with Eclipse's OpenJ9 JVM. (#5712) +========= +Build: 1.16.4-35.1.28 - Mon Dec 28 21:56:51 GMT 2020 + git: + Fix crash when beehive is broken by fake player (#7566) -Build 2836: +========= +Build: 1.16.4-35.1.27 - Mon Dec 28 21:46:04 GMT 2020 + 35673674+alcatrazEscapee: + Add supplier variant to `AbstractBlock.Properties#lootFrom` (#7563) + +========= +Build: 1.16.4-35.1.26 - Mon Dec 28 21:40:18 GMT 2020 + diesieben07: + Fix missing serializers when deserializing global loot modifiers (#7561) + + diesieben07: + Fix ModFileResourcePack.getAllResourceLocations ignoring resourceNamespace. (#7562) + + Fixes #7405 + +========= +Build: 1.16.4-35.1.24 - Mon Dec 28 21:34:39 GMT 2020 + diesieben07: + Fix VanillaConnectionNetworkFilter sending out invalid entity properties packets without an entity ID (#7560) + +========= +Build: 1.16.4-35.1.23 - Mon Dec 28 21:17:01 GMT 2020 + richard: + Make shear interactions extend to subclasses (#7544) + +========= +Build: 1.16.4-35.1.22 - Mon Dec 28 21:09:38 GMT 2020 + sciwhiz12: + Add a SoundType subclass that uses suppliers (#7538) + +========= +Build: 1.16.4-35.1.21 - Mon Dec 28 21:03:56 GMT 2020 + sciwhiz12: + Fix compound ingredient in shapeless recipes (#7537) Fixes #7530 + +========= +Build: 1.16.4-35.1.20 - Mon Dec 28 20:19:04 GMT 2020 + matthrewp: + Fix modded PointOfInterestType's not populating blockstate map when registered (#7503) + + 35673674+alcatrazEscapee: + Fix potential NPE in ForgeHooks.onItemPlaceIntoWorld when passing in null player. (#7505) + +========= +Build: 1.16.4-35.1.18 - Mon Dec 28 20:13:15 GMT 2020 + 48399898+poopoodice: + Add new LivingConversionEvent to control mobs turning into other mobs. (#7386) + +========= +Build: 1.16.4-35.1.17 - Mon Dec 28 20:01:42 GMT 2020 + knightminer4: + Add ItemAttributeModifierEvent (#7484) + +========= +Build: 1.16.4-35.1.16 - Mon Dec 28 19:54:38 GMT 2020 + Bward7864: + Fix RightClickBlock ALLOW not being implemented (#7426) + +========= +Build: 1.16.4-35.1.15 - Sat Dec 26 19:39:35 GMT 2020 + lex: + Make mod data packs able to be disabled. It'll break things, but that's on you. Closes #6776 + + lex: + Quiet down errors related to modders not changing their update urls from the default. + +========= +Build: 1.16.4-35.1.13 - Sat Dec 12 17:34:07 GMT 2020 tterrag: - Revert "Invalidate tile entities that are queued for removal (#5512)" - This reverts commit 75788f63eea6c33ccef7e5cbcab27ad9ad2c2a04. - This solution is invalid as TEs are free to modify the world - tileEntities list, usually indirectly via chunkloading, from inside - invalidate(). - This happens in vanilla, in TileEntityChest#invalidate, where it calls - checkForAdjacentChests(), which has the potential to load neighboring - chunks and cause a CME. - A more sophisticated solution is needed. + Add generated resource tracking to ExistingFileHelper -Build 2835: - bs2609: Fix some vertex format changes not being handled correctly (#5368) +========= +Build: 1.16.4-35.1.12 - Fri Dec 11 02:39:41 GMT 2020 + tterrag: + Fix BlockStateProvider item models not knowing about block models + + Add tests for this case -Build 2834: - bs2609: - Transform vertex normals as well as positions when generating quads - (#5242) +========= +Build: 1.16.4-35.1.11 - Tue Dec 08 19:54:40 GMT 2020 + richard: + Override invalidateCaps instead of remove for vanilla TE capability invalidation (#7536) + + Properly invalidate patched in vanilla TE caps in invalidateCaps instead of remove so that they get invalidated on chunk unload -Build 2833: - rseifert.phone: Fix for SidedInvWrapper isItemValid using wrong slot (#5642) +========= +Build: 1.16.4-35.1.10 - Sat Dec 05 20:07:14 GMT 2020 + richard: + Make TEs invalidate capabilities when the chunk they are in unloads (#7529) + + Fixed LazyOptional potentially notifying invalidation listeners multiple times. -Build 2832: - bs2609: Invalidate tile entities that are queued for removal (#5512) +========= +Build: 1.16.4-35.1.9 - Sat Dec 05 20:01:00 GMT 2020 + Cordonfreeman: + Fixed entity navigation to stop entities spinning - MC-94054 (#7520) -Build 2831: - lclc98: Added Wool to OreDictionary (#5414) +========= +Build: 1.16.4-35.1.8 - Sat Dec 05 19:52:56 GMT 2020 + 20846147+Unbekannt1998: + Fix wrong function call in BlockStateProvider::horizontalFaceBlock (#7514) -Build 2830: - CreativeMD: Fixed boat not taking care of block-liquid hooks (#5086) +========= +Build: 1.16.4-35.1.7 - Sun Nov 29 02:11:08 GMT 2020 + tterrag: + Fix datagen order of multipart conditions being unstable -Build 2829: - bs2609: Add Forge dimension-changing hooks to spectator handling code (#5212) +========= +Build: 1.16.4-35.1.6 - Sat Nov 28 02:56:55 GMT 2020 + 35673674+alcatrazEscapee: + Fix forge config option for default world type not applying unless you change the default world type (#7521) -Build 2828: - ichttt: - Minor performace improvement when building chunks and rendering blocks - (#5286) +========= +Build: 1.16.4-35.1.5 - Fri Nov 27 23:57:23 GMT 2020 + David Quintana: + Implement feature for mods to define new world types (#7448) + + * Mods can now register world types via a new forge registry, and optionally register a settings screen to tweak them. + * The default world type for dedicated servers and singleplayer world creation is configurable via forge's common config. -Build 2827: - bs2609: Catch json parsing errors from constants/factories files (#5258) +========= +Build: 1.16.4-35.1.4 - Tue Nov 24 17:14:21 GMT 2020 + csh2001331: + Fix dimType not encode to registries (#7513) -Build 2826: - bs2609: Allow custom DataSerializers to be registered safely (#5245) +========= +Build: 1.16.4-35.1.3 - Mon Nov 23 03:45:21 GMT 2020 + richard: + Add support for referencing forge's resources and specifying existing mods to data generators (#7456) -Build 2825: +========= +Build: 1.16.4-35.1.2 - Sun Nov 22 22:01:29 GMT 2020 cpw: - Try and make 1.13 mods more obviously wrong in 1.12.. + Fix #6692 + + Thanks @AterAnimAvis for help and suggestions + Signed-off-by: cpw -Build 2824: - tterrag: Fix #5651 Re-add canPlaceBlockOnSide check in World#mayPlace +========= +Build: 1.16.4-35.1.1 - Sat Nov 21 19:57:45 GMT 2020 + cyborgmas18: + Fix translucent blocks not rendering properly when moved by pistons on fabulous (#7441) -Build 2823: - Pokechu022: - Fail fast when null is used with setTag instead of crashing in - writeEntry (#5257) +========= +Build: 1.16.4-35.1.0 - Fri Nov 20 20:54:30 GMT 2020 + lex: + Bump version for RB. -Build 2822: - tterrag: Fix block placement not checking for player collision +========= +Build: 1.16.4-35.0.22 - Fri Nov 20 18:24:46 GMT 2020 + 35673674+alcatrazEscapee: + Fix MC-194811 - Removing structures causes chunk save errors. -Build 2821: - wynprice999: Added more Constants (#5323) + diesieben07: + Fix food bar not rendering when non-living entities are mounted (#7446) -Build 2820: - python0429: [1.12.2] Add a few events pertaining to villages (#5302) +========= +Build: 1.16.4-35.0.20 - Fri Nov 20 18:18:37 GMT 2020 + diesieben07: + Fix concurrency issue in StartupMessageManager (#7483) -Build 2819: - Tyler Hancock: [1.12] Fix special spawn event not firing in many cases. (#5389) +========= +Build: 1.16.4-35.0.19 - Fri Nov 20 18:11:25 GMT 2020 + 35673674+alcatrazEscapee: + Fix forge registry types that have private constructors (BlockStateProviderType, BlockPlacerType, FoliagePlacerType, TreeDecoratorType) (#7482) -Build 2818: - bs2609: Only prompt for missing registries on local worlds (#5348) - -Build 2817: - ckrier.3000: Add EntityPlaceEvent (#5057) - -Build 2816: - bs2609: Generalise EnumRarity to an interface (#5182) - -Build 2815: - bs2609: Apply access-level changes to inner class attributes (#5468) - -Build 2814: - bs2609: Fix small logic error in ItemTextureQuadConverter (#5463) - -Build 2813: - bs2609: Better support for custom bows (#5209) - -Build 2812: - CovertJaguar: Remove FluidStack amount from hashcode calculation (#5272) - molecularphylo: - Fixed incorrect string representation of string list config property - default values in their comments. - bs2609: - Improve tracking of used dimension IDs (#5249) - Closes #5378 Large dimension IDs bloat level.data - -Build 2811: - bs2609: - Fix up torch placement logic to handle more vanilla special-casing - (#5426) - -Build 2810: - LexManos: Written size does not include int bytes. - -Build 2809: - LexManos: - Extend Region files to support >1MB per chunk. If the 'sector count' is - 255, ask the compressed data header for the proper length. - -Build 2808: - tterrag1098: Add default impl to IConfigElement#getValidValuesDisplay - -Build 2807: - tterrag: Simplify custom item rendering by removing GL emissivity hacks - -Build 2806: - tterrag: Support diffuse lighting flag in item rendering - -Build 2805: - bs2609: - Add a hook to allow continuously using items through stack changes - (#4834) - * Add a hook to allow continuously using items through stack changes +========= +Build: 1.16.4-35.0.18 - Sun Nov 15 16:08:55 GMT 2020 + cpw: + Fix problem where the absence of forge and MC in later loading triggered a weird crash. - * Update licences + Signed-off-by: cpw -Build 2804: - oOMitchOo: - Added an additional constructor to every implementation of IFluidBlock. - It is now possible to create a fluid block with a Fluid, Material and - MapColor, so that the Material's MapColor isn't used for the blocks - MapColor. (#5293) +========= +Build: 1.16.4-35.0.17 - Sat Nov 14 01:41:38 GMT 2020 + cpw: + Fix NPE problem when modid is mismatched. + + Signed-off-by: cpw -Build 2803: - bs2609: Add redirects to PotionEffect to respect registry replacement (#5213) +========= +Build: 1.16.4-35.0.16 - Sat Nov 14 00:18:29 GMT 2020 + cpw: + Return the processed modlist data to the upstream system, not the raw unprocessed data. Should resolve the problem + that mixin complains about missing info when it's in a "crashed" situation. + + Signed-off-by: cpw -Build 2802: - alexiy.ov: - Add an annotation for @Config elements which will automatically create a - slider control (#5026) +========= +Build: 1.16.4-35.0.15 - Wed Nov 11 09:09:45 GMT 2020 + cyborgmas18: + Fix dims on servers not loading the first run (#7445) -Build 2801: - bs2609: Fix small logic error in emissive item rendering code (#5320) +========= +Build: 1.16.4-35.0.14 - Tue Nov 10 20:24:33 GMT 2020 + diesieben07: + Allow for custom argument types by filtering them on vanilla connections (#7463) -Build 2800: - molecularphylo: - Allow config GUI cycling button elements generated from enums to display - toString return values, rather than actual values. (#5125) +========= +Build: 1.16.4-35.0.13 - Tue Nov 10 20:13:34 GMT 2020 + Bward7864: + Add Player context to AnvilUpdateEvent (#7442) -Build 2799: - bs2609: Fix incorrect indexing in mipmap generation code (#5201) +========= +Build: 1.16.4-35.0.12 - Tue Nov 10 20:02:33 GMT 2020 + git: + Don't overwrite PlayerAdvancement's player with a fake one (#7454) + + If a FakePlayer is constructed with the same UUID/GameProfile as a + currently active player, the player object within PlayerAdvancement is + set to the fake player. + + As fake players cannot receive advancements (see grantCriterion), this + prevents the actual player from receiving any advancements until they + change dimension/relog. -Build 2798: - bs2609: - Ensure slave maps are cleaned up when handling registry overrides - (#5250) +========= +Build: 1.16.4-35.0.11 - Tue Nov 10 19:46:01 GMT 2020 + curle: + Add BannerBlock.forColor to SAS to fix banner.toItem() on servers. -Build 2797: - d_scalzi: Fix issue with --modListFile. (#5316) +========= +Build: 1.16.4-35.0.10 - Tue Nov 10 19:36:40 GMT 2020 + Boy132: + Call Harvest check event even if the block doesn't require any tool (#7414) -Build 2796: - LexManos: - Fix potential issues with the Minecraft FakePlayer lingering around - after world unloads. +========= +Build: 1.16.4-35.0.9 - Tue Nov 10 19:25:26 GMT 2020 + lex: + Use linked collections to stabilize order when adding new registry entries. -Build 2795: - tterrag: Fix potion remove event not always firing, add expiry event + xfacthd: + Render local player when the renderViewEntity is not the local player (#7216) -Build 2794: - tterrag: Clean up CraftingHelper constants loading API +========= +Build: 1.16.4-35.0.7 - Sun Nov 08 04:12:02 GMT 2020 + cpw: + Some help in ExtensionPoint regarding DISPLAYTEST. Let's improve those tick rates! + + Signed-off-by: cpw -Build 2793: - tterrag: Fix crash from CraftingHelper due to FileSystem being closed early +========= +Build: 1.16.4-35.0.6 - Sun Nov 08 03:30:37 GMT 2020 + cpw: + Handle erroring during early mod construction phases, and actually report that into the error UI + by doing armslength exception handling and propagation. + + Signed-off-by: cpw -Build 2792: +========= +Build: 1.16.4-35.0.5 - Sun Nov 08 01:48:22 GMT 2020 + cpw: + Support backwards loading 1.16.3 mods in 1.16.4, because we are able to do that. Tweak loading a bit to be smarter about dependency errors of various kinds. + + Signed-off-by: cpw + +========= +Build: 1.16.4-35.0.4 - Sat Nov 07 20:10:44 GMT 2020 + David Quintana: + Add FluidStack codec, and a test mod that verifies its behaviour matches the existing write/read logic. + Add missing license headers. + +========= +Build: 1.16.4-35.0.3 - Sat Nov 07 02:11:47 GMT 2020 + cpw: + Update event bus version (should be 3.0.5) + + Tweak MDK to automatically populate recommended values for things like forge version, loader version and minecraft version. + + Signed-off-by: cpw + +========= +Build: 1.16.4-35.0.2 - Wed Nov 04 00:07:58 GMT 2020 + diesieben07: + Workaround for modded attributes on vanilla entities logging warnings on vanilla clients + + Switch to a handler-based approach per packet class, simplify patch, add some docs + + Add license header and docs + + Switch to a network handler based approach + + Switch to a network handler based approach + + revert build gradle change + + Simplify Packet patch + + Add license header to IForgePacket + + Revert ForgeHooks changes + + Less hacky and more generic way to filter packets for vanilla connections + + _Actually_ Order SAS. + It's early + + Order SAS + + simplify vanilla connection check + + Remove unneeded import change + +========= +Build: 1.16.4-35.0.1 - Mon Nov 02 19:57:45 GMT 2020 + cpw: + Fix early sorting bug that meant the file deduping was causing an error, to, well, not cause it, so we can get to an error screen. + + Signed-off-by: cpw + +========= +Build: 1.16.4-35.0.0 - Mon Nov 02 19:15:50 GMT 2020 + lex: + 1.16.4 Initial Update + +========= +Build: 1.16.3-34.1.42 - Mon Nov 02 04:30:53 GMT 2020 + lex: + Fix Biomes not properly copying over ids loaded from the save to the new Dynamic Registry. + +========= +Build: 1.16.3-34.1.41 - Mon Nov 02 01:09:57 GMT 2020 + David Quintana: + Introduce custom loader additions to the model data generators. (#7450) + + Currently implemented loaders: + * OBJ + * Composite + * Multi-layer + * Item layers (vanilla item/generated but with fullbright texture support) + * Bucket + * Separate Perspective + +========= +Build: 1.16.3-34.1.40 - Mon Nov 02 00:52:12 GMT 2020 + cpw: + actually rollback on error in registry events. + + Signed-off-by: cpw + +========= +Build: 1.16.3-34.1.39 - Sun Nov 01 22:09:32 GMT 2020 + cpw: + Update modlauncher. fixes #7452 + + Signed-off-by: cpw + + cpw: + Return client resources even if no data pack found on server. Closes #6225 (Pull request) + + Signed-off-by: cpw + + tobias.hotz: + Auto-detect ansi support for log4j2 + + move to fml.loading subpackage + + Add license header + + cpw: + Fix config parse failure causing crash in building exception message. fixes #7438 + + Signed-off-by: cpw + +========= +Build: 1.16.3-34.1.35 - Thu Oct 29 17:09:31 GMT 2020 + malte0811: + Fix (NonNull)Lazy.Concurrent using a global lock (#7403) + + * Fix Lazy.Concurrent using a global lock, thus preventing multiple threads from resolving independent Lazy's at the same time + * Use Lazy with an added null check to implement NonNullLazy + +========= +Build: 1.16.3-34.1.34 - Thu Oct 29 00:12:09 GMT 2020 + David Quintana: + Update forge mappings to 20201028-1.16.3 (#7435) + +========= +Build: 1.16.3-34.1.33 - Tue Oct 27 16:01:02 GMT 2020 + 35673674+alcatrazEscapee: + Fix breaking changes from the Biome rename PR #7434 (#7439) + +========= +Build: 1.16.3-34.1.32 - Mon Oct 26 23:52:47 GMT 2020 + sciwhiz12: + Reimplement nametag distance attribute, fix attribute translation keys (#7387) + +========= +Build: 1.16.3-34.1.31 - Mon Oct 26 22:07:02 GMT 2020 + 35673674+alcatrazEscapee: + Fix data pack biomes failing to load in SingleBiomeProvider (#7434) + +========= +Build: 1.16.3-34.1.30 - Mon Oct 26 22:00:28 GMT 2020 + cpw: + Add in proper handling of equals and hashcode for modjar urls. Fixes very slow loading on windows. + + Signed-off-by: cpw + +========= +Build: 1.16.3-34.1.29 - Mon Oct 26 12:51:24 GMT 2020 + cpw: + Force 8.0.5 ML + + Signed-off-by: cpw + +========= +Build: 1.16.3-34.1.28 - Mon Oct 26 11:32:40 GMT 2020 + cpw: + Restore FingerprintViolationEvent with appropriate THIS IS F*CKING DEAD DELET WARNINGS. + Also, notify in UI if using legacy JDK without capability to read out security data from mod jars. + + Signed-off-by: cpw + +========= +Build: 1.16.3-34.1.27 - Mon Oct 26 02:27:48 GMT 2020 + cpw: + Rollback registries to vanilla state if something happens during loading, so subsequent activities can still run and not generate false reports.. + + Signed-off-by: cpw + + cpw: + Add signature reporting for mods, using new signature capture from ModLauncher. Need to figure out + how to reflect Minecraft's JAR signatures into here. + + Signed-off-by: cpw + +========= +Build: 1.16.3-34.1.25 - Tue Oct 20 19:32:40 GMT 2020 + lex: + Fix mcp_snapshot mapping issue causing unneeded patches. Closes #7424 + +========= +Build: 1.16.3-34.1.24 - Tue Oct 20 11:26:03 GMT 2020 + David Quintana: + Fix resource leak in the OBJ loader. + +========= +Build: 1.16.3-34.1.23 - Fri Oct 16 19:10:02 GMT 2020 + djbake101: + Fix issue with ITeleporter allowing easier use of vanilla logic. (#7317) + +========= +Build: 1.16.3-34.1.22 - Thu Oct 15 19:49:26 GMT 2020 + richard: + Adds tag support for Enchantments, Potions, and TileEntityTypes (#7379) + +========= +Build: 1.16.3-34.1.21 - Thu Oct 15 19:43:33 GMT 2020 + lex: + Resuscitate BiomeDictionary using RegistryKeys instead of biome references. + +========= +Build: 1.16.3-34.1.20 - Thu Oct 15 17:15:15 GMT 2020 + FinntheRaider: + Add event for player changing game mode (#7355) + +========= +Build: 1.16.3-34.1.19 - Mon Oct 12 18:11:22 GMT 2020 + cpw: + Fix RCON multipacket responses not actually understanding UTF8. + + Signed-off-by: cpw + +========= +Build: 1.16.3-34.1.18 - Mon Oct 12 01:49:09 GMT 2020 + cpw: + Fix RCON not sending newlines in output for multiline. Fixes https://bugs.mojang.com/browse/MC-7569, a very old bug that is really annoying if you use RCON. + + Signed-off-by: cpw + +========= +Build: 1.16.3-34.1.17 - Sat Oct 10 16:45:26 GMT 2020 + championash5357: + Fix Texture Presence String (#7408) + +========= +Build: 1.16.3-34.1.16 - Fri Oct 09 19:57:26 GMT 2020 + lex: + Fix typo causing potential error in vine growth. Closes #7406 + Sort missing registry dumps by name, making it easier to read. + +========= +Build: 1.16.3-34.1.15 - Fri Oct 09 13:58:36 GMT 2020 + David Quintana: + Fixed conditional advancement loading when using the "advancements" array. + Added automatic generation of conditional advancements from the criteria in the conditional recipe entries. + Added advancement name calculation from the recipe ID. + +========= +Build: 1.16.3-34.1.14 - Thu Oct 08 21:08:45 GMT 2020 + 32142731+Flanks255: + Additions to the mdk build.gradle to accommodate datagens. (#7398) + +========= +Build: 1.16.3-34.1.13 - Thu Oct 08 21:02:59 GMT 2020 + Colby Prince: + Added Basic Class-Level SAS Capability to checkSAS, added Vector4f to SAS (#7385) + +========= +Build: 1.16.3-34.1.12 - Wed Oct 07 20:04:11 GMT 2020 + richard: + Add hooks to allow modification of structures spawn lists (#7344) + +========= +Build: 1.16.3-34.1.11 - Tue Oct 06 19:38:36 GMT 2020 + richard: + Add back patches to Screen allowing for item tooltips to be auto wrapped again (#7378) + + Only deals with the methods receiving an ItemStack or ITextComponent(s), the methods that take IReorderingProcessor(s) are left alone. + +========= +Build: 1.16.3-34.1.10 - Mon Oct 05 14:34:56 GMT 2020 + adam: + Bump mixin version to 0.8.2 + +========= +Build: 1.16.3-34.1.9 - Mon Oct 05 10:30:12 GMT 2020 + cpw: + Remove redundant call to CrashReport generator - Vanilla is doing a crashreport for itself at startup now. + + Add a UUID into crashreport that is also logged in all channels at crash report generation time. This will allow to associate crash reports and the logs. + + Signed-off-by: cpw + + cpw: + Add in extra debug logging + + Signed-off-by: cpw + +========= +Build: 1.16.3-34.1.7 - Sun Oct 04 19:51:37 GMT 2020 + cpw: + Modify how ModLoadingStage handles dispatch to Registry Events. Stops the objectholder spam and generally improves performance on larger packs. + + Signed-off-by: cpw + + cpw: + Fix doc README and answer lex's question + + Signed-off-by: cpw + +========= +Build: 1.16.3-34.1.5 - Fri Oct 02 23:40:14 GMT 2020 + Colby Prince: + Added "Bukkit Plugin" to InvalidModIdentifier (#7384) + +========= +Build: 1.16.3-34.1.4 - Fri Oct 02 23:34:26 GMT 2020 + richard: + Fix vanilla Campfire smoke bug. MC-201374 (#7381) + +========= +Build: 1.16.3-34.1.3 - Fri Oct 02 23:28:31 GMT 2020 + sciwhiz12: + Fix toggleable keybindings still being active while in GUI Fixes #7370 (#7373) + +========= +Build: 1.16.3-34.1.2 - Fri Oct 02 22:06:59 GMT 2020 + dev: + Fix modded EntityClassifications not being useable in the codec. (#7337) + +========= +Build: 1.16.3-34.1.1 - Mon Sep 28 18:02:11 GMT 2020 + cech12: + Support effective materials of vanilla AxeItem (#7351) + +========= +Build: 1.16.3-34.1.0 - Thu Sep 24 07:05:13 GMT 2020 + lex: + Prep new RB. + +========= +Build: 1.16.3-34.0.21 - Thu Sep 24 06:46:57 GMT 2020 + ichttt: + Fix grass disappearing when alwaysSetupTerrainOffThread is true (#7291) + +========= +Build: 1.16.3-34.0.20 - Thu Sep 24 06:41:41 GMT 2020 + 35673674+alcatrazEscapee: + Accessors for inspecting and removal of biome generation settings. Fixed carvers still being immutable. (#7339) + +========= +Build: 1.16.3-34.0.19 - Thu Sep 24 06:36:25 GMT 2020 + lex: + Revive BiomeManager and BiomeLayer hooks. + +========= +Build: 1.16.3-34.0.18 - Thu Sep 24 03:12:19 GMT 2020 + richard: + Fix a few minor issues with custom tag types and fix OptionalNamedTags (#7316) + +========= +Build: 1.16.3-34.0.17 - Wed Sep 23 22:10:11 GMT 2020 + diesieben07: + Fix ToggleableKeyBinding differences to vanilla. (#7338) + +========= +Build: 1.16.3-34.0.16 - Wed Sep 23 21:34:47 GMT 2020 + Yunus1903: + Updated build badge versions to 1.16.3 in readme (#7325) + + diesieben07: + Fix forge light pipeline applying block offsets twice (#7323) + +========= +Build: 1.16.3-34.0.14 - Wed Sep 23 21:16:46 GMT 2020 + ichttt: + Add a better license error screen (#7350) + +========= +Build: 1.16.3-34.0.13 - Tue Sep 22 19:14:17 GMT 2020 + darklime: + Fixed container item being consumed in brewing stand. #7307 (#7314) + +========= +Build: 1.16.3-34.0.12 - Tue Sep 22 19:06:10 GMT 2020 + sciwhiz12: + Fix parse results of CommandEvent being disregarded (#7303) + +========= +Build: 1.16.3-34.0.11 - Tue Sep 22 18:58:28 GMT 2020 + 17338378+Nightenom: + [1.16] Fix possible crash when using rendering regionCache (#7207) + +========= +Build: 1.16.3-34.0.10 - Tue Sep 22 18:41:16 GMT 2020 + 35673674+alcatrazEscapee: + [1.16] Reimplement ICloudRenderHandler, ISkyRenderHandler and IWeatherRenderHandler (#6994) + +========= +Build: 1.16.3-34.0.9 - Fri Sep 18 00:58:08 GMT 2020 + 35673674+alcatrazEscapee: + Make Biome.Climate and BiomeAmbiance fields accessible (#7336) + +========= +Build: 1.16.3-34.0.8 - Thu Sep 17 20:42:53 GMT 2020 + cpw: + Use mixin 0.8.1. Should fix problems with mixin not working properly with latest modlauncher. + + Signed-off-by: cpw + +========= +Build: 1.16.3-34.0.7 - Tue Sep 15 20:07:25 GMT 2020 + sebastian: + Sets the empty/fill sounds for vanilla fluids. + Use Fluid's fillSound rather than emptySound when filling buckets. + +========= +Build: 1.16.3-34.0.6 - Tue Sep 15 19:47:08 GMT 2020 + cyborgmas18: + Add MatrixStack-aware alternatives to the methods in GuiUtils (#7127) + +========= +Build: 1.16.3-34.0.5 - Tue Sep 15 16:51:58 GMT 2020 + justin_wiblin: + Fix json biomes not setting registry name correctly for the BiomeLoadingEvent. (#7329) + +========= +Build: 1.16.3-34.0.4 - Tue Sep 15 14:18:16 GMT 2020 + David Quintana: + Fix inconsistencies in how the values from the model are passed into the baked model. + This puts them in line with vanilla, as intended. + +========= +Build: 1.16.3-34.0.3 - Tue Sep 15 13:23:05 GMT 2020 + Yunus1903: + Reimplemented drawHoveringText (#7268) + +========= +Build: 1.16.3-34.0.2 - Tue Sep 15 00:43:19 GMT 2020 + lex: + New BiomeLoadingEvent that allows modders to edit biomes as they are being deserialized. + +========= +Build: 1.16.3-34.0.1 - Fri Sep 11 15:55:28 GMT 2020 + lex: + Bump MCP version for lambda issue. + +========= +Build: 1.16.3-34.0.0 - Thu Sep 10 19:10:33 GMT 2020 + lex: + 1.16.3 Update + Also included a bunch of warning cleanups. + +========= +Build: 1.16.2-33.0.61 - Thu Sep 10 18:54:56 GMT 2020 + 42962686+RedstoneDubstep: + Fix tile entities being replaced when not needed. (#7318) + +========= +Build: 1.16.2-33.0.60 - Thu Sep 10 18:02:15 GMT 2020 + malte0811: + Fix exception when getting rendering box for tile entities with no collision boxes. (#7301) + +========= +Build: 1.16.2-33.0.59 - Wed Sep 09 23:05:21 GMT 2020 + cpw: + More crash reporting tweaks. Don't crash when trying to show warnings. Also, put the exception name in the error screen on the second line! + + Signed-off-by: cpw + +========= +Build: 1.16.2-33.0.58 - Wed Sep 09 17:09:09 GMT 2020 + diesieben07: + Fix Minecart speed cap on rail being initialized to 0 (#7315) + +========= +Build: 1.16.2-33.0.57 - Wed Sep 09 02:10:45 GMT 2020 + richard: + Add support for custom tag types (#7289) + +========= +Build: 1.16.2-33.0.56 - Wed Sep 09 00:06:22 GMT 2020 + cpw: + More crash report tweaks. Put a button to open the generated crash report on the error screen, tweak formatting of crash report, and add the enhanced stack trace data (transformers et al) + + Signed-off-by: cpw + +========= +Build: 1.16.2-33.0.55 - Tue Sep 08 21:00:19 GMT 2020 + championash5357: + New hook for better custom scaffolding movement (#7261) + +========= +Build: 1.16.2-33.0.54 - Tue Sep 08 20:47:48 GMT 2020 + mrtschipp: + Add partialTicks to RenderNameplateEvent (#7277) + + cyborgmas18: + Prevent duplicate wrapper tags from crashing (#7283) + + matthrewp: + Fix custom teleporters NPE (#7296) + + cyborgmas18: + Fixed crash with zip paths (#7300) + +========= +Build: 1.16.2-33.0.50 - Tue Sep 08 20:23:27 GMT 2020 + nrbeech: + Fixing logic in getCurrentRailPosition to correctly identify the rail… (#7276) + +========= +Build: 1.16.2-33.0.49 - Tue Sep 08 20:14:58 GMT 2020 + sciwhiz12: + Remove dead ForgeHooks.canToolHarvestBlock function. (#7262) + + sciwhiz12: + Bump resource pack version to 6 (#7299) + + Edwin.mindcraft: + [1.16.x] Fixes for Bamboo, Enchantments and Conduits, small adjustments to bring some patches closer to the vanilla code. (#7239) + +========= +Build: 1.16.2-33.0.46 - Tue Sep 08 19:50:14 GMT 2020 + championash5357: + Re-implement DrawHighlightEvent$HighlightEntity Firing (#7233) + +========= +Build: 1.16.2-33.0.45 - Tue Sep 08 19:25:58 GMT 2020 + ichttt: + Reimplement FarmlandWaterManager (#7213) + +========= +Build: 1.16.2-33.0.44 - Tue Sep 08 19:11:16 GMT 2020 + cyborgmas18: + Add dataprovider for Global Loot Modifiers (#6960) + +========= +Build: 1.16.2-33.0.43 - Tue Sep 08 19:01:09 GMT 2020 + ichttt: + Fix crash when dumping crash report for an exception that has a null cause (#7308) + +========= +Build: 1.16.2-33.0.42 - Mon Sep 07 01:29:40 GMT 2020 + cpw: + Tweak crash report dump to visit all the causes up to the top. + + Signed-off-by: cpw + +========= +Build: 1.16.2-33.0.41 - Sun Sep 06 23:39:13 GMT 2020 + cpw: + Fix ExplodedDirectoryLocator visiting non-existent paths. Closes #7203 + + Also, bump modlauncher to 7.0.1 to fix resources. + + Signed-off-by: cpw + +========= +Build: 1.16.2-33.0.40 - Sun Sep 06 22:08:22 GMT 2020 + cpw: + Use new enumeration mechanism in ModLauncher, to allow getResources to work. This enables serviceloader-in-mods, and other stuff that might need to visit multiple mod jars. Also, tweaked the visitor code slightly, may result in a trivial performance change. Closing #7302 as it's not really relevant any more. + + Signed-off-by: cpw + + cpw: + Park the polling thread for a bit, if we're not the one driving the task list forwards. This allows for the actual driver to work on low cpu count machines. + + Signed-off-by: cpw + + cpw: + Fix some potential issues in crash dumping during mod loading + + Signed-off-by: cpw + +========= +Build: 1.16.2-33.0.37 - Thu Sep 03 16:37:38 GMT 2020 + cpw: + Fix compiler issue in eclipse properly + + Signed-off-by: cpw + +========= +Build: 1.16.2-33.0.36 - Thu Sep 03 12:40:52 GMT 2020 + sciwhiz12: + Fix crash caused by previous commit (#7298) + +========= +Build: 1.16.2-33.0.35 - Thu Sep 03 04:15:27 GMT 2020 + lex: + Dirty casting hacks to fix eclipse compiler inference issue. I'm sorry cpw. + +========= +Build: 1.16.2-33.0.34 - Thu Sep 03 03:38:16 GMT 2020 tterrag: - added PotionHooks, closes #3867, #4375 (#4614) - * solved merge confilct + Fix broken ExistingFileHelper import - * improved var names & removed tabs - - * Added spaces around != - - * fixed typo + Add licenses to some new files -Build 2791: tterrag: - Add a hook for farmland watering (#4891) - * Add a FarmlandWaterCheckEvent to allow mods to override when Farmland - is watered or not + Add validation via resources for tag providers (#7271) - * revert 1.12.2 json - - * Move the farmland patch to a ticket based instead of a event based - system - - * Minor changes - - * Faster isValid checks, faster validation/invalidation if the state did - not change, expand test mod to include a test for the validation system - - * remove isValid boolean flag, we can express it with the tick counter - - * Fix test mod resource warnings - - * Remove tick timeout, add a javadoc note to invalidate on chunk unload, - cleaned up test mod - - * Allow mods to provide custom handling to determine if a pos is valid - or not - - * Make SimpleTicket more simple, make register public so custom tickets - can be registered - - * Fixes for review - - * Add missing license headers - - * Use a weak hash set - - * Split up the map into smaller chunk based maps - - * Add missing license headers - - * Make MultiTicketManager more universal for custom implementations, - cleanup imports + BREAKING CHANGE: Moved ExistingFileHelper to common package + Remove various workarounds from forge tag providers -Build 2790: +========= +Build: 1.16.2-33.0.32 - Tue Sep 01 18:36:21 GMT 2020 + cpw: + Move the "modloading" thread activity onto _our_ worker pool. It turns out that the vanilla worker pool can deadlock during stitching if it's insufficiently large, if modloader "waitForTransition" is also a worker member of that pool. + + Closes #7293 (to reproduce issue easily, modify Util.func_240979_a_ and change the values in the MathHelper.clamp call). I've verified that 3 and below for "max" cause the problem. (I didn't test a whole range of values, just sufficient to reproduce problem and verify fix). Note that setting it to zero (and using the "direct executor" that's inaccessible in normal operation) works as well with this fix. + + Signed-off-by: cpw + +========= +Build: 1.16.2-33.0.31 - Tue Sep 01 02:27:07 GMT 2020 + cpw: + Fix missed debugging code. Read the config from the config. + + Signed-off-by: cpw + +========= +Build: 1.16.2-33.0.30 - Tue Sep 01 01:31:57 GMT 2020 + cpw: + Revert "Shut down all other mod handlers if the loading cycle errors. This prevents other mods from throwing errors and being blamed for initial cause. This is a temporary hack until cpw re-writes the mod event dispatcher." + + This reverts commit 7592bbe8 + + Signed-off-by: cpw + + cpw: + Revert "Properly shutdown FMLModContainer's event bus when an error in a lifecycle event is detected." + + This reverts commit 30bad1e2 + + Signed-off-by: cpw + + cpw: + Redo event dispatch, removes a bunch of nonsense, and tries to integrate with the vanilla CF system where possible + + Signed-off-by: cpw + + cpw: + Fix up all the things. Removed SidedProvider because it served no real purpose anymore. + + Signed-off-by: cpw + + cpw: + Fix up slight registry change and other 1.16.2 stuffs. + + Signed-off-by: cpw + +========= +Build: 1.16.2-33.0.23 - Sun Aug 30 23:05:24 GMT 2020 + ichttt: + Add particle culling (#6981) + +========= +Build: 1.16.2-33.0.22 - Wed Aug 26 16:50:02 GMT 2020 + lex: + Wrap vanilla's 'default' biome registry in ForgeRegistry. + This should allow registering mod dimensions like in 1.16.1, while the data driven system is fleshed out. + +========= +Build: 1.16.2-33.0.21 - Tue Aug 25 01:11:38 GMT 2020 + David Quintana: + Clarify in the LazyOptional which methods carry the lazyness over to the returned value and which don't. (#6750) + + For consistency, this meant making a few changes: + - Renamed the existing lazy mapping method to lazyMap, to indicate that it doesn't run the mapping immediately. + - Added a new implementation of map(), which returns Optional, and resolves the value in the process. + - Changed filter() to return Optional, since there's no way to filter lazily. + - Added a new method resolve(), which helps convert the custom LazyOptional class into a standard Optional, for use + with library methods that expect Optional. + + * Update License headers. + +========= +Build: 1.16.2-33.0.20 - Fri Aug 21 21:27:21 GMT 2020 + sciwhiz12: + Add user-friendly exceptions when config loading fails (#7214) + +========= +Build: 1.16.2-33.0.19 - Fri Aug 21 18:53:46 GMT 2020 + dev: + Replace EntityHeight event with EntitySize event (#6858) + +========= +Build: 1.16.2-33.0.18 - Fri Aug 21 18:38:31 GMT 2020 + davide2910: + [1.16] ForgeEventFactory#canCreateFluidSource reintroduced (#7181) + +========= +Build: - Fri Aug 21 18:31:19 GMT 2020 + cyborgmas18: + Cleanup and expand Forge tags (#7004) + +========= +Build: 1.16.2-33.0.16 - Fri Aug 21 18:25:49 GMT 2020 + sciwhiz12: + Fix modproperties property in mods.toml causing exception (#7192) + +========= +Build: 1.16.2-33.0.15 - Fri Aug 21 18:15:53 GMT 2020 + me: + Log info about server list warning (#7209) + + Make it easier to figure out what mods are missing or have to be marked as client/server side only. + +========= +Build: 1.16.2-33.0.14 - Fri Aug 21 18:06:47 GMT 2020 + goto.minecraft: + Fix ItemStack#isDamageable is not calling Item#isDamagable (#7221) + +========= +Build: 1.16.2-33.0.13 - Fri Aug 21 17:48:58 GMT 2020 + diesieben07: + Improve performance and cleanup code for DelegatingResourcePack (#7228) + +========= +Build: 1.16.2-33.0.12 - Fri Aug 21 17:29:33 GMT 2020 + cyborgmas18: + Fix small logging issues with loading pack.png for mods (#7265) + +========= +Build: 1.16.2-33.0.11 - Fri Aug 21 17:23:30 GMT 2020 + diesieben07: + Fix config iteration order (#7230) + +========= +Build: 1.16.2-33.0.10 - Fri Aug 21 09:47:23 GMT 2020 + lex: + Cleanup Forge's build script, fix some unneeded patches. + Add checkExcscheckAll tasks. + +========= +Build: 1.16.2-33.0.9 - Fri Aug 21 04:35:17 GMT 2020 + championash5357: + Readding DifficultyChangeEvent hooks (#7240) + +========= +Build: 1.16.2-33.0.8 - Fri Aug 21 04:29:10 GMT 2020 + malte0811: + Improve startup time by caching the manifest data for mod jars (#7256) + +========= +Build: 1.16.2-33.0.7 - Wed Aug 19 05:47:46 GMT 2020 + Yunus1903: + Removed HarvestDropsEvent (#7193) + +========= +Build: 1.16.2-33.0.6 - Wed Aug 19 05:22:45 GMT 2020 + cyborgmas18: + Remove forge optional tags in favor of Vanilla's new system. (#7246) + +========= +Build: 1.16.2-33.0.5 - Fri Aug 14 19:05:15 GMT 2020 + lex: + Fix creating nether portals. + + lex: + New method for creating modded tag references, fix connecting to vanilla servers. + +========= +Build: 1.16.2-33.0.3 - Fri Aug 14 02:17:01 GMT 2020 + 43609023+spnda: + Print mod file name on InvalidModFileException (#7241) + +========= +Build: 1.16.2-33.0.2 - Thu Aug 13 19:26:22 GMT 2020 + cyborgmas18: + Fix server connection, misapplied patch (#7245) + + Yunus1903: + Updated MDK and README for 1.16.2 (#7243) + +========= +Build: 1.16.2-33.0.0 - Thu Aug 13 07:37:04 GMT 2020 + lex: + Initial 1.16.2 Update + +========= +Build: 1.16.1-32.0.108 - Sun Aug 09 20:05:01 GMT 2020 + David Quintana: + Fix ModelRegistryEvent firing every time resources reload instead of just once. + +========= +Build: 1.16.1-32.0.107 - Sat Aug 08 01:00:42 GMT 2020 + David Quintana: + Move ModelRegistryEvent invocation to when the model loading is about to start. + Freeze the ModelLoaderRegistry right after this event happens, just before model loading actually begins. + This means ModelRegistryEvent is now the correct place to register loaders, as it was intended. + This is a slight breaking change, but any mod that used FMLClientSetupEvent before will need to be updated regardless due to the existing race condition. + +========= +Build: 1.16.1-32.0.106 - Tue Aug 04 00:19:22 GMT 2020 + diesieben07: + Fix wrong BlockState param passed into canSustainPlant from FarmlandBlock (#7212) + +========= +Build: 1.16.1-32.0.105 - Tue Aug 04 00:06:45 GMT 2020 + sciwhiz12: + Add harvest levels for hoes and new 1.16 blocks for pickaxes Fixes #7187 (#7189) + +========= +Build: 1.16.1-32.0.104 - Tue Aug 04 00:00:40 GMT 2020 + sciwhiz12: + Fix debug world not generating modded blocks (#6926) + + championash5357: + New IForgeBlock#getToolModifiedState hook allow better control over tools interacting with blocks. (#7176) + + email.squishling: + Added new hook to allow Biomes to control their Edge biomes (#7000) + +========= +Build: 1.16.1-32.0.101 - Mon Aug 03 22:55:18 GMT 2020 + diesieben07: + Re-introduce "outdated" notification on Mods button in main menu (#7123) + + brandon4261: + Add support for custom elytra (#7202) + +========= +Build: 1.16.1-32.0.99 - Mon Aug 03 18:53:31 GMT 2020 + sciwhiz12: + Fix RenderTickEvent using wrong partial ticks value when game is paused. Fixes #6991 (#7208) + +========= +Build: 1.16.1-32.0.98 - Thu Jul 30 03:18:00 GMT 2020 tterrag: - Add methods to allow loading json constants outside of _constants - (#4975) - * add interface methods for loading json constants from an arbitary file - - - * use try-with-resources - - * don't make modders create jsoncontext, clean up resource use - - * very minor cleanup + Implement forge IBakedModel methods in vanilla wrapper models -Build 2789: +========= +Build: 1.16.1-32.0.97 - Tue Jul 28 23:44:41 GMT 2020 + lex: + Fix another case of swallowed errors not shutting down mods. + +========= +Build: 1.16.1-32.0.96 - Tue Jul 28 21:40:06 GMT 2020 + lex: + Shut down all other mod handlers if the loading cycle errors. + This prevents other mods from throwing errors and being blamed for initial cause. + This is a temporary hack until cpw re-writes the mod event dispatcher. + +========= +Build: - Tue Jul 28 19:01:27 GMT 2020 + lex: + Properly shutdown FMLModContainer's event bus when an error in a lifecycle event is detected. + + lex: + Enable EventBus type check during ForgeDev, and add IModBusEvent marker to ModelRegistryEvent. + +========= +Build: 1.16.1-32.0.93 - Tue Jul 28 07:16:31 GMT 2020 + lex: + Make license toml entry optional during 1.16.1 + There are to many existing mods to make this required. + Yes, we are technically before a RB and can do breaking changes. However this is too large. + +========= +Build: 1.16.1-32.0.92 - Tue Jul 28 01:14:20 GMT 2020 + cpw: + Missed one event. NewRegistry needs the marker. + + Signed-off-by: cpw + +========= +Build: 1.16.1-32.0.91 - Tue Jul 28 01:07:03 GMT 2020 + cpw: + Update MDK license to default to All rights reserved, and offer a link to chooseyourlicense.com as a place to research appropriate licenses. + + Note: the license field _is_ backwards compatible and will simply be ignored on older forge versions. + Signed-off-by: cpw + +========= +Build: 1.16.1-32.0.90 - Tue Jul 28 00:47:35 GMT 2020 + cpw: + Update modlauncher, eventbus, accesstransformers and more to use a newer mechanism for generating ASM. + + Introduced IModBusEvent as a marker interface for events on the ModBus. Expect exceptions if you use + the modbus for events not listened there. + + Signed-off-by: cpw + + cpw: + Update coremods and spi, include mandatory license field in metadata. Added at top level of mods.toml file. + + Signed-off-by: cpw + +========= +Build: 1.16.1-32.0.88 - Mon Jul 27 23:35:24 GMT 2020 + ray.neiheiser: + Fix rail 180 rotations (#7177) + + jmansfield: + Fire AnimalTameEvent for cats (#7172) Closes #7171 + +========= +Build: 1.16.1-32.0.86 - Mon Jul 27 22:56:16 GMT 2020 + lex: + Fix Biome generation error. + +========= +Build: 1.16.1-32.0.85 - Mon Jul 27 21:36:07 GMT 2020 + dev: + Fix SleepingTimeCheckEvent not being fired in initial sleep test. (#7005) + +========= +Build: 1.16.1-32.0.84 - Mon Jul 27 21:30:24 GMT 2020 + Yunus1903: + Fix ClimberPathNavigator spinning when width is small. Closes #6993 (#6997) + +========= +Build: 1.16.1-32.0.83 - Mon Jul 27 21:19:50 GMT 2020 + mrtschipp: + Re-added PlayerEvent.NameFormat (#6992) + +========= +Build: 1.16.1-32.0.82 - Mon Jul 27 21:14:02 GMT 2020 + email.squishling: + Fixed modded overworld biomes not spawning [1.16.x] (#6990) + +========= +Build: 1.16.1-32.0.81 - Mon Jul 27 21:08:23 GMT 2020 + christ.klinge: + Added EntityLeaveWorldEvent (#6984) + +========= +Build: 1.16.1-32.0.80 - Mon Jul 27 21:02:53 GMT 2020 + aqscode: + Re-implement moddable flammabilities (#6983) + +========= +Build: 1.16.1-32.0.79 - Mon Jul 27 20:46:11 GMT 2020 + diesieben07: + Re-add patch for PlayerSetSpawnEvent (#6977) + + Yunus1903: + Updated versions in README and removed flocker.tv mentions (#6978) + +========= +Build: 1.16.1-32.0.77 - Mon Jul 27 20:40:33 GMT 2020 + sciwhiz12: + Fix ChunkDataEvents using different data tags (#6961) Fixes #6957 + +========= +Build: - Mon Jul 27 20:27:00 GMT 2020 + joetarbit: + Post SoundLoadEvent on mod bus instead of forge bus (#6955) + +========= +Build: 1.16.1-32.0.75 - Wed Jul 22 01:26:19 GMT 2020 + cpw: + Remove startupquery. Currently wasn't functional, and 1.16 has out of band state loading in all cases, so the complex functionality there is no longer needed. Going to research using the Lifecycle indicator from DFU as a proxy/replacement. Probably with some codec FUN. + + Signed-off-by: cpw + +========= +Build: 1.16.1-32.0.74 - Wed Jul 22 00:34:43 GMT 2020 + lex: + Run Forge's data generators to sync 1.16 vanilla changes. + +========= +Build: 1.16.1-32.0.73 - Wed Jul 22 00:13:48 GMT 2020 + cpw: + Don't show the early launcher GUI when running data. It's not needed and prevents use on automated builds. + + Need to investigate why a bunch of tags seem to be being blown away by rerunning on forge. + + Signed-off-by: cpw + +========= +Build: 1.16.1-32.0.72 - Tue Jul 21 23:56:54 GMT 2020 + cpw: + Add mixin + + Signed-off-by: cpw + +========= +Build: 1.16.1-32.0.71 - Mon Jul 20 22:56:31 GMT 2020 + cyborgmas18: + Load Modded Datapacks in DatapackScreen, before world creation (#6913) + +========= +Build: 1.16.1-32.0.70 - Sat Jul 18 22:35:53 GMT 2020 tterrag: - Compute ASMDataTable submaps parallel, speeds up contructing mods - (#5246) - * Compute submaps parallel, speeds up contructing mods by a lot + Fix inconsistencies with model/blockstate datagen + +========= +Build: 1.16.1-32.0.69 - Fri Jul 17 17:35:47 GMT 2020 + dev: + Filter duplicate mod files from mod file scan data (#6855) + +========= +Build: 1.16.1-32.0.68 - Thu Jul 16 21:56:30 GMT 2020 + lex: + Fixed Forge commands. Closes #6973 Closes #6974 Closes #6976 + +========= +Build: 1.16.1-32.0.67 - Wed Jul 15 19:30:53 GMT 2020 + jaredlll08: + Added an event for registering commands. closes #6968 (#6969) + +========= +Build: 1.16.1-32.0.66 - Tue Jul 14 00:15:41 GMT 2020 + darklime: + Make all functions in Style common. (#6931) + +========= +Build: 1.16.1-32.0.65 - Mon Jul 13 22:44:53 GMT 2020 + 55965249+seymourimadeit: + Mark Raid.WaveMembers as an extensible enum. (#6878) + +========= +Build: 1.16.1-32.0.64 - Mon Jul 13 22:17:58 GMT 2020 + lex: + Fix checkPatches task. Closes #6956 + Fix patched in method using srg name. Closes #6965 + Fix capabilities not being collected for ClientWorld. Closes #6966 + Fix TagEmptyCondition using client side copy of tags instead of server. Closes #6949 + Fix ExtendedButton using narrator text. Closes #6958, Closes #6959 + Fix misaligned patch in RepairContainer. Closes #6950, Closes #6953 + Fix LivingJumpEvent not being fired for players jumping horses. Closes #6929 + Remove extra getToughness method in ArmorItem. Closes #6970 + Remove GetCollisionBoxesEvent. Closes #6921 + +========= +Build: 1.16.1-32.0.63 - Fri Jul 10 22:28:22 GMT 2020 + richard: + Fix race condition with DeferredRegister for custom registries (#6951) + +========= +Build: 1.16.1-32.0.62 - Fri Jul 10 17:49:51 GMT 2020 + sciwhiz12: + Remove hooks into beacon base/payments. Vanilla uses tags now for extensibility. (#6948) + +========= +Build: 1.16.1-32.0.61 - Wed Jul 08 21:33:38 GMT 2020 + jaredlll08: + Expose the DataPackRegistries instance to the AddReloadListenerEvent (#6933) + +========= +Build: 1.16.1-32.0.60 - Wed Jul 08 21:13:18 GMT 2020 + sciwhiz12: + Fix canRepair not being set true as default (#6936) - * Use stream API better + Closes #6934 and #6935 -Build 2788: - mezz: Add logging for data manager key registration errors (#5129) +========= +Build: 1.16.1-32.0.59 - Wed Jul 08 14:56:39 GMT 2020 + David Quintana: + Fix particles sometimes "losing" the lightmap and drawing fullbright. -Build 2787: - mezz: Improve support for custom block path types (#5203) + David Quintana: + Fix misaligned patch causing LivingEquipmentChangeEvent to never be posted. -Build 2786: - mezz: Fix missing comments in configs created with annotations (#5189) +========= +Build: 1.16.1-32.0.57 - Mon Jul 06 21:32:33 GMT 2020 + JDLogic: + Add simple patch checker and cleanup patches (#6851) + + * Add simple patch checker and cleanup patches + + * Address comments + * move task implementation + * genPatches is now finalized by checkPatches + * the S2S artifacts are automatically removed + * added class and method access checking -Build 2785: - mezz: Allow items to control the rate of repair from mending (#5102) +========= +Build: 1.16.1-32.0.56 - Mon Jul 06 21:27:02 GMT 2020 + richard: + Fix the modifier combined name for keybinds displaying two pluses outside of forgedev #6901 (#6902) -Build 2784: - mezz: Improve exception handling from server starting events (#5226) +========= +Build: 1.16.1-32.0.55 - Mon Jul 06 21:12:45 GMT 2020 + richard: + Fix harvest level and tool type not actually getting set #6906 (#6922) -Build 2783: - mezz: Improve context provided by potion icon rendering hooks (#5111) +========= +Build: 1.16.1-32.0.54 - Mon Jul 06 20:46:01 GMT 2020 + richard: + Reimplement ITeleporter Patches (#6886) -Build 2782: - mezz: Fix an ObjectHolderRef internal error message (#5214) +========= +Build: 1.16.1-32.0.53 - Mon Jul 06 20:39:37 GMT 2020 + 40738104+Mysterious-Dev: + Add function to add items with the same behavior as the pumpkin for enderman (#6890) -Build 2781: - mezz: Implement rendering for item models with emissive quads (#5047) +========= +Build: 1.16.1-32.0.52 - Mon Jul 06 20:33:17 GMT 2020 + richard: + Custom Item integration with Piglins (#6914) -Build 2780: - mezz: Clean up logged mod states (#5227) - mezz: Fix minor issue in getFilledPercentage for Fluid rendering (#5206) +========= +Build: 1.16.1-32.0.51 - Mon Jul 06 20:20:02 GMT 2020 + ichttt: + Some dead code cleanup, and re-implement some bed hooks. (#6903) -Build 2779: - mezz: Improve reflection helper methods (#4853) - mezz: Fix inaccurate main thread name shown in client log (#5078) +========= +Build: 1.16.1-32.0.50 - Mon Jul 06 20:06:39 GMT 2020 + diesieben07: + Fix missing null checks in ForgeIngameGui (#6907) -Build 2778: - mezz: Fix Baked Item models with transformations (#5241) +========= +Build: 1.16.1-32.0.49 - Mon Jul 06 19:50:02 GMT 2020 + sciwhiz12: + Fix swap offhand keybind not working in GUIs (#6920) -Build 2777: - mezz: - Re-add some missing villager profession patches (#5200) - * Fix zombie villagers only spawning with vanilla professions - * Fix spawning modded villagers that do not have their own building - mezz: Fix missing string parameters in some log messages (#5210) - mezz: Stop firing LivingSetAttackTargetEvent for setRevengeTarget (#5217) - mezz: Prevent RecipeBook from crashing on empty modded ingredients (#5234) +========= +Build: 1.16.1-32.0.48 - Mon Jul 06 19:42:07 GMT 2020 + thpetuaudletang: + New AddReloadListenerEvent that gathers server side data reload handlers. (#6849) -Build 2776: - mezz: Fix the bed position given to the SleepingTimeCheck event (#5107) +========= +Build: 1.16.1-32.0.47 - Fri Jul 03 12:40:42 GMT 2020 + David Quintana: + Attempt to use a more compatible method to initialize stencil support. + In case the separate attachments don't work for everyone, there's a new setting to choose the combined attachment. -Build 2775: - LexManos: Fix some null returns from defaulted registries (#5235) +========= +Build: 1.16.1-32.0.46 - Fri Jul 03 04:00:22 GMT 2020 + David Quintana: + Update copyright year to 2020. -Build 2774: - LexManos: - Only remove synthetic lambda methods referenced in body of SideOnly - methods (#5127) + David Quintana: + Fix multi-layer item rendering. -Build 2773: - LexManos: - A different approach to my changes in - https://github.com/MinecraftForge/MinecraftForge/commit/8ace535995522bec0557d4217e0d98b3dc76cf1e - to fix #5207 - LexManos: Fix patches from #5160 setting rotation as well as position (#5233) - LexManos: Use HTTPS for files website. +========= +Build: 1.16.1-32.0.44 - Thu Jul 02 17:17:45 GMT 2020 + David Quintana: + Model system improvements: + - Port some things I did in 1.14 which I couldn't do in 1.15 due to breaking changes. + - Fix multi-layer block models not working (1.16 RenderType doesn't override toString the same way anymore) + - Implement multi-layer item rendering. + - Improve CompositeModel submodel data passing. -Build 2772: - tterrag: Make Forge-provided default transforms accessible to custom models +========= +Build: 1.16.1-32.0.43 - Thu Jul 02 12:54:03 GMT 2020 + MartijnvandenBrand: + Include model data in getQuads call (#6884) + + The model data wasn't included when getting quads from specific sides, but was when getting quads for side = null. + + thpetuaudletang: + Pass matrixstack in tooltip render events (#6885) + +========= +Build: 1.16.1-32.0.41 - Thu Jul 02 05:54:25 GMT 2020 tterrag: - Make Forge blockstate variants correctly inherit AO setting from vanilla - models (#5190) - * Make Forge blockstate variants correctly inherit AO setting + Fix improper handling of baked lighting in forge light pipeline - * Move variant format checks into variant, check for added properties + Closes #6812 + +========= +Build: 1.16.1-32.0.40 - Thu Jul 02 01:59:30 GMT 2020 + richard: + Fix FMLServerAboutToStartEvent being fired too late on the integrated server https://github.com/MinecraftForge/MinecraftForge/issues/6859 + +========= +Build: 1.16.1-32.0.39 - Wed Jul 01 18:14:25 GMT 2020 + ichttt: + Fix miss-aligned patch ItemEntity (#6895) + +========= +Build: 1.16.1-32.0.38 - Tue Jun 30 20:19:32 GMT 2020 + info: + Add hoe tool type (#6872) + +========= +Build: 1.16.1-32.0.36 - Tue Jun 30 20:09:21 GMT 2020 + curle: + Allow any armor to have custom knockback resistance (#6877) + +========= +Build: 1.16.1-32.0.35 - Tue Jun 30 19:57:32 GMT 2020 + diesieben07: + Add senderUUID to ClientChatReceivedEvent (#6881) + +========= +Build: 1.16.1-32.0.34 - Tue Jun 30 02:33:58 GMT 2020 + lex: + Re-write checkATs function and automate making Items/Blocks public. + +========= +Build: 1.16.1-32.0.33 - Tue Jun 30 02:10:14 GMT 2020 + cpw: + Reorganize modloading on the dediserver. This removes the DedicatedServer parameter from the FMLDedicatedServerSetupEvent. + Code for customizing the server instance should be moved to the ServerAboutToStartEvent or similar, where the server instance + is available. - * Small code cleanup - tterrag: fixed visual bug with guislider - tterrag: - Allow IModel to express itself as a vanilla parent (#5195) - * Fix errors caused by fancy missing model being non-vanilla parent + This reorganization means that mods will load fully before the server is even constructed, or the server properties loaded. We also move the EULA right to the front so we don't have to wait for bootstrap. - * Switch instanceof checks to a default IModel method + This should fix the problems with mods which customize world data and other things. - * Small code tweaks + Signed-off-by: cpw -Build 2771: - tterrag: Add CreativeTabs#getLabelColor +========= +Build: 1.16.1-32.0.32 - Mon Jun 29 23:43:01 GMT 2020 + thpetuaudletang: + Fix datagen resolving tags and exploding. (#6865) -Build 2770: - tterrag: - Allow providing a BufferedImage for banner render generation (#5041) - * Adds an Event to allow providing a BufferedImage for the banner render - generation (cached) - textures, since banners don't use an atlas. - implementation. +========= +Build: 1.16.1-32.0.31 - Mon Jun 29 23:37:30 GMT 2020 + mattmess1221: + Fix Language.javaLocale parsing (#6862) + +========= +Build: 1.16.1-32.0.30 - Mon Jun 29 22:58:30 GMT 2020 + diesieben07: + Fix IItemHandler wrappers for chests not updating both chests (#6875) + +========= +Build: 1.16.1-32.0.29 - Mon Jun 29 21:08:55 GMT 2020 + lex: + Fix missed patch in PlayerList and EntitySelectioonContext. Closes #6846 Closes #6850 + +========= +Build: 1.16.1-32.0.27 - Mon Jun 29 20:09:12 GMT 2020 + richard: + Fix access levels being hardcoded to private via patch overriding AT entry (#6848) + +========= +Build: 1.16.1-32.0.26 - Mon Jun 29 19:42:50 GMT 2020 + lex: + Fix tag related issues when connecting to a vanilla server. + +========= +Build: 1.16.1-32.0.25 - Sun Jun 28 22:08:15 GMT 2020 + lex: + Fix Forge's internal handler being registered in wrong place. + Fix double call to loader end. + +========= +Build: 1.16.1-32.0.24 - Sat Jun 27 22:50:54 GMT 2020 + David Quintana: + Add a model loader that lets mods specify different models for different perspectives. + Allow custom models to reference vanilla item models as child models. + +========= +Build: 1.16.1-32.0.23 - Fri Jun 26 23:55:23 GMT 2020 + thpetuaudletang: + fix misapplied patch - * Missed some copyright; might as well absolut text match, I guess + also sneak in an import patch removal + +========= +Build: 1.16.1-32.0.21 - Fri Jun 26 22:40:19 GMT 2020 + lex: + Fix blocks being harvested with incorrect tools. + +========= +Build: 1.16.1-32.0.20 - Fri Jun 26 19:53:02 GMT 2020 + lex: + Make installer use MCPConfig version to identify MC assets. + +========= +Build: 1.16.1-32.0.19 - Fri Jun 26 18:27:49 GMT 2020 + cpw: + Tweak the server startup a bit, make sure methods that can't work because they run before a server exists explode saying so. + Also fix other launch profiles. - * Remove unneeded patch change + Signed-off-by: cpw + +========= +Build: 1.16.1-32.0.18 - Fri Jun 26 16:56:37 GMT 2020 + lex: + Fix dedicated server loading by constructing mods before data packs are created. + +========= +Build: 1.16.1-32.0.17 - Fri Jun 26 15:20:37 GMT 2020 + David Quintana: + Fix create method. + Fix test mods not loading correctly. + +========= +Build: 1.16.1-32.0.16 - Fri Jun 26 14:43:19 GMT 2020 + David Quintana: + Reintroduce missed patch in EntityClassification. + +========= +Build: 1.16.1-32.0.15 - Fri Jun 26 13:55:42 GMT 2020 + thpetuaudletang: + Include a getter for the matrix stack in OverlayEvent (#6834) + +========= +Build: 1.16.1-32.0.14 - Fri Jun 26 13:23:07 GMT 2020 + thpetuaudletang: + Fix block render types not being properly applied to item entities (#6832) + +========= +Build: 1.16.1-32.0.13 - Fri Jun 26 13:05:18 GMT 2020 + mods.itsmeow: + [1.16.x] Allow GlobalEntityTypeAttributes' EntityType -> AttributeModifierMap to be added to (#6822) - * Fix event variable access convention + * Make GlobalEntityTypeAttributes map able to be added to - * Formatting fix + * Split get patch into two lines - * Improve event handling registration + * Favor Forge's map over vanilla + +========= +Build: 1.16.1-32.0.12 - Fri Jun 26 12:59:19 GMT 2020 + thpetuaudletang: + Fixed creative screen arrows (#6827) + + Yunus1903: + Added call to method for tooltip with FontRenderer (#6831) + +========= +Build: 1.16.1-32.0.10 - Fri Jun 26 12:36:59 GMT 2020 + curle: + Retarget Block.Properties patch to the new AbstractBlock, reintroduce harvestLevel and harvestTool fields (#6819) - * Import cleanup + * Retarget Block.Properties patch to the new AbstractBlock, reintroduces the harvestLevel and harvestTool fields. - * Replace event approach with Supplier approach + * Slight adjustment to fix the lootTableSupplier. + +========= +Build: 1.16.1-32.0.9 - Fri Jun 26 12:31:37 GMT 2020 + Yunus1903: + Fixed sneaking while swimming (#6817) + +========= +Build: - Fri Jun 26 12:25:07 GMT 2020 + thpetuaudletang: + Fixed tooltip rendering issues (#6815) + +========= +Build: 1.16.1-32.0.7 - Fri Jun 26 02:30:54 GMT 2020 + thpetuaudletang: + Fixed villager trades having non-applicable enchants - * Better name for test mod (now that it's no longer an event); adds - ENABLE flag + Also added an AT at lex's request + +========= +Build: 1.16.1-32.0.6 - Fri Jun 26 01:52:19 GMT 2020 + thpetuaudletang: + Fix locate command (#6811) + + thpetuaudletang: + Fix block drops (#6810) + + contact: + Add missing patch to ScreenShotHelper (#6809) - * Moves MC code into - net.minecraftforge.client.MinecraftForgeClient.getImageLayer to simplify - patch + Adds the missed patch back + + Yunus1903: + Updated MDK mods.toml versions (#6808) + + thpetuaudletang: + Fix locate command (#6811) + + thpetuaudletang: + Fix block drops (#6810) + + contact: + Add missing patch to ScreenShotHelper (#6809) - * Generalize naming + Adds the missed patch back -Build 2769: - mezz: Fix Mesa biome entry tags in the BiomeDictionary (#5177) + Yunus1903: + Updated MDK mods.toml versions (#6808) -Build 2768: - LexManos: Bump version number for RB. + thpetuaudletang: + Fix locate command (#6811) -Build 2767: - LexManos: - Change biome spawn list entries to use factory method where possible - (#5075) - LexManos: Prevent some texture loading errors from crashing the game (#5121) - LexManos: Patch PotionHelper to use registry delegates (#5142) - LexManos: Add a notification event for handling game rule changes (#5152) + thpetuaudletang: + Fix block drops (#6810) -Build 2766: - LexManos: - Change universal bucket support to use fluid names instead of instances - (#5031) + contact: + Add missing patch to ScreenShotHelper (#6809) + + Adds the missed patch back -Build 2765: - LexManos: Fix NPE on clientside entities constructed with null world (#5170) + Yunus1903: + Updated MDK mods.toml versions (#6808) -Build 2764: - tterrag: Fix patches from #5160 running on the client and causing stutter - -Build 2763: - LexManos: - Class transformer optimizations (#5159) - * Filter packages for deobf transformation - * Only serialize transformed class with TerminalTransformer if bytecode - changed - -Build 2762: - github: Update github stale so issues can be Assigned - -Build 2761: - LexManos: - Fix MC-136995 - Chunk loading and unloading issue with entities placed - in exact positions. (#5160) - Scatter gun patches to improve entity tracking and position tracking. - Provided by Aikar through the Paper project, this commit of patches - combines the following patches: - - https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0306-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch - - https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0315-Always-process-chunk-registration-after-moving.patch - - https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0335-Ensure-chunks-are-always-loaded-on-hard-position-set.patch - - https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0378-Sync-Player-Position-to-Vehicles.patch - -Build 2760: - LexManos: Fix --mods and --modListFile arguments not making it past LaunchWrapper. - -Build 2759: - LexManos: Remove BlamingTransformer (#5115) +========= +Build: 1.16.1-32.0.2 - Fri Jun 26 01:41:51 GMT 2020 + lex: + Rework BlockSnapshot and fix client notifications. Closes #6807 +========= +Build: 1.16.1-32.0.1 - Thu Jun 25 23:24:48 GMT 2020 + lex: + Bump MCPConfig version. diff --git a/gradle.properties b/gradle.properties index e9b9fd5ac..878bf1f7e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,4 @@ # Sets default memory used for gradle commands. Can be overridden by user or command line properties. # This is required to provide enough memory for the Minecraft decompilation process. org.gradle.jvmargs=-Xmx3G +org.gradle.daemon=false \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 30d399d8d..7a3265ee9 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e18cba72f..1d5b29fbd 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Mon Sep 14 12:28:28 PDT 2015 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip diff --git a/gradlew b/gradlew index 91a7e269e..cccdd3d51 100644 --- a/gradlew +++ b/gradlew @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh ############################################################################## ## @@ -6,47 +6,6 @@ ## ############################################################################## -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - # Attempt to set APP_HOME # Resolve links: $0 may be a link PRG="$0" @@ -61,9 +20,49 @@ while [ -h "$PRG" ] ; do fi done SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- +cd "`dirname \"$PRG\"`/" >/dev/null APP_HOME="`pwd -P`" -cd "$SAVED" >&- +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -90,7 +89,7 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then @@ -114,6 +113,7 @@ fi if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` @@ -154,11 +154,19 @@ if $cygwin ; then esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " } -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +APP_ARGS=$(save "$@") -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 97fe31374..808465d8d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -8,14 +8,14 @@ @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + @rem Find java.exe if defined JAVA_MC_HOME goto findJavaFromJavaHome @@ -46,10 +46,9 @@ echo location of your Java installation. goto fail :init -@rem Get command-line arguments, handling Windowz variants +@rem Get command-line arguments, handling Windows variants if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args :win9xME_args @rem Slurp the command line arguments. @@ -60,11 +59,6 @@ set _SKIP=2 if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ :execute @rem Setup the command line diff --git a/libs/lodCore-1.0-sources.jar b/libs/lodCore-1.0-sources.jar deleted file mode 100644 index 83ae622bb..000000000 Binary files a/libs/lodCore-1.0-sources.jar and /dev/null differ diff --git a/libs/lodCore-1.0.jar b/libs/lodCore-1.0.jar deleted file mode 100644 index d16f2e733..000000000 Binary files a/libs/lodCore-1.0.jar and /dev/null differ diff --git a/logs/debug.log b/logs/debug.log new file mode 100644 index 000000000..e69de29bb diff --git a/logs/latest.log b/logs/latest.log new file mode 100644 index 000000000..e69de29bb diff --git a/run/mods/OptiFine_1.12.2_HD_U_F5.jar b/run/mods/OptiFine_1.12.2_HD_U_F5.jar deleted file mode 100644 index eb37d8edc..000000000 Binary files a/run/mods/OptiFine_1.12.2_HD_U_F5.jar and /dev/null differ diff --git a/run/mods/aa_do_not_rename_OptiFineDevTweaker-2.2-all.jar b/run/mods/aa_do_not_rename_OptiFineDevTweaker-2.2-all.jar deleted file mode 100644 index 8169b8580..000000000 Binary files a/run/mods/aa_do_not_rename_OptiFineDevTweaker-2.2-all.jar and /dev/null differ diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index c6d8d0152..000000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ":ASMHelper" \ No newline at end of file diff --git a/src/main/java/com/backsun/lod/LodMain.java b/src/main/java/com/backsun/lod/LodMain.java index 78411042c..b381c7d21 100644 --- a/src/main/java/com/backsun/lod/LodMain.java +++ b/src/main/java/com/backsun/lod/LodMain.java @@ -1,53 +1,61 @@ package com.backsun.lod; import com.backsun.lod.proxy.ClientProxy; -import com.backsun.lod.proxy.CommonProxy; -import com.backsun.lod.util.Reference; +import com.backsun.lod.util.LodConfig; import net.minecraft.client.Minecraft; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.Mod.EventHandler; -import net.minecraftforge.fml.common.Mod.Instance; -import net.minecraftforge.fml.common.SidedProxy; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; -import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; +import net.minecraftforge.fml.config.ModConfig; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.fml.event.server.FMLServerStartingEvent; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; /** * * @author James Seibel * @version 02-07-2021 */ -@IFMLLoadingPlugin.MCVersion("1.12.2") -@IFMLLoadingPlugin.TransformerExclusions({"com.backsun.lod.asm"}) -@Mod(modid = Reference.MOD_ID, name = Reference.NAME, version = Reference.VERSION, dependencies = "required-after:lodcore@[1.0,)") +@Mod(ModInfo.MODID) public class LodMain { - @Instance public static LodMain instance; - @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.COMMON_PROXY_CLASS) - public static CommonProxy common_proxy; public static ClientProxy client_proxy; - @EventHandler - public static void PreInit(FMLPreInitializationEvent event) + + private void init(final FMLCommonSetupEvent event) { - Minecraft.getMinecraft().getFramebuffer().enableStencil(); + Minecraft.getInstance().getFramebuffer().enableStencil(); + ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, LodConfig.COMMON_SPEC); } - @EventHandler - public static void Init(FMLInitializationEvent event) - { - MinecraftForge.EVENT_BUS.register(common_proxy); - client_proxy = new ClientProxy(); - } - @EventHandler - public static void PostInit(FMLPostInitializationEvent event) - { - - } + public LodMain() + { + // Register the methods + FMLJavaModLoadingContext.get().getModEventBus().addListener(this::init); + FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onClientStart); + + // Register ourselves for server and other game events we are interested in + MinecraftForge.EVENT_BUS.register(this); + } + + private void onClientStart(final FMLClientSetupEvent event) + { + client_proxy = new ClientProxy(); + MinecraftForge.EVENT_BUS.register(client_proxy); + } + + + + @SubscribeEvent + public void onServerStarting(FMLServerStartingEvent event) + { + // this is called when the server starts + } + } diff --git a/src/main/java/com/backsun/lod/ModInfo.java b/src/main/java/com/backsun/lod/ModInfo.java new file mode 100644 index 000000000..1a64f0044 --- /dev/null +++ b/src/main/java/com/backsun/lod/ModInfo.java @@ -0,0 +1,16 @@ +package com.backsun.lod; + +/** + * This file is similar to mcmod.info + * + * @author James Seibel + * @version 02-17-2021 + */ +public final class ModInfo +{ + public static final String MODID = "lod"; + public static final String MODNAME = "Levels of Detail"; + public static final String MODAPI = "LodAPI"; + public static final String VERSION = "${version}"; + public static final String APIVERSION = "${apiversion}"; +} \ No newline at end of file diff --git a/src/main/java/com/backsun/lod/mixin/MixinItemEntity.java b/src/main/java/com/backsun/lod/mixin/MixinItemEntity.java new file mode 100644 index 000000000..151289b02 --- /dev/null +++ b/src/main/java/com/backsun/lod/mixin/MixinItemEntity.java @@ -0,0 +1,20 @@ +package com.backsun.lod.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.entity.item.ItemEntity; +import net.minecraft.util.DamageSource; + +@Mixin(ItemEntity.class) +public class MixinItemEntity +{ + @Inject(at = @At("HEAD"), method = "attackEntityFrom(Lnet/minecraft/util/DamageSource;F)Z", cancellable = true) + private void attackEntityFrom(DamageSource source, float amount, CallbackInfoReturnable callback) + { + callback.setReturnValue(false); + } + +} diff --git a/src/main/java/com/backsun/lod/mixin/MixinWorldRenderer.java b/src/main/java/com/backsun/lod/mixin/MixinWorldRenderer.java new file mode 100644 index 000000000..28cd04e8b --- /dev/null +++ b/src/main/java/com/backsun/lod/mixin/MixinWorldRenderer.java @@ -0,0 +1,22 @@ +package com.backsun.lod.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import com.backsun.lod.renderer.RenderGlobalHook; +import com.mojang.blaze3d.matrix.MatrixStack; + +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.WorldRenderer; + +@Mixin(WorldRenderer.class) +public class MixinWorldRenderer +{ + @Inject(at = @At("HEAD"), method = "renderBlockLayer(Lnet/minecraft/client/renderer/RenderType;Lcom/mojang/blaze3d/matrix/MatrixStack;DDD)V", cancellable = false) + private void renderBlockLayer(RenderType blockLayerIn, MatrixStack matrixStackIn, double xIn, double yIn, double zIn, CallbackInfo callback) + { + RenderGlobalHook.startRenderingStencil(blockLayerIn); + } +} diff --git a/src/main/java/com/backsun/lod/objects/LodChunk.java b/src/main/java/com/backsun/lod/objects/LodChunk.java index 0069d7403..85aae9b1e 100644 --- a/src/main/java/com/backsun/lod/objects/LodChunk.java +++ b/src/main/java/com/backsun/lod/objects/LodChunk.java @@ -5,13 +5,13 @@ import java.awt.Color; import com.backsun.lod.util.enums.ColorDirection; import com.backsun.lod.util.enums.LodLocation; -import net.minecraft.block.Block; +import net.minecraft.block.Blocks; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.color.BlockColors; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; -import net.minecraft.world.chunk.storage.ExtendedBlockStorage; +import net.minecraft.world.chunk.ChunkSection; /** * This object contains position @@ -33,8 +33,6 @@ public class LodChunk private static final int CHUNK_DATA_WIDTH = WIDTH; private static final int CHUNK_DATA_HEIGHT = WIDTH; - private final int airBlockId = Block.getIdFromBlock(Block.getBlockFromName("air")); - private final int waterBlockId = Block.getIdFromBlock(Block.getBlockFromName("water")); private final int waterColor = colorToInt(new Color(36, 50, 171)); /** @@ -220,8 +218,8 @@ public class LodChunk } - x = chunk.x; - z = chunk.z; + x = chunk.getPos().x; + z = chunk.getPos().z; top = new short[4]; bottom = new short[4]; @@ -261,7 +259,7 @@ public class LodChunk // should have a length of 16 // (each storage is 16x16x16 and the // world height is 256) - ExtendedBlockStorage[] data = chunk.getBlockStorageArray(); + ChunkSection[] chunkSections = chunk.getSections(); @@ -314,20 +312,20 @@ public class LodChunk if(getTopSection) - return determineTopPoint(data, startX, endX, startZ, endZ); + return determineTopPoint(chunkSections, startX, endX, startZ, endZ); else - return determineBottomPoint(data, startX, endX, startZ, endZ); + return determineBottomPoint(chunkSections, startX, endX, startZ, endZ); } - private short determineBottomPoint(ExtendedBlockStorage[] data, int startX, int endX, int startZ, int endZ) + private short determineBottomPoint(ChunkSection[] chunkSections, int startX, int endX, int startZ, int endZ) { // search from the bottom up - for(int i = 0; i < data.length; i++) + for(int i = 0; i < chunkSections.length; i++) { for(int y = 0; y < CHUNK_DATA_HEIGHT; y++) { - if(isLayerValidLodPoint(data, startX, endX, startZ, endZ, i, y)) + if(isLayerValidLodPoint(chunkSections, startX, endX, startZ, endZ, i, y)) { // we found // enough blocks in this @@ -344,14 +342,14 @@ public class LodChunk return -1; } - private short determineTopPoint(ExtendedBlockStorage[] data, int startX, int endX, int startZ, int endZ) + private short determineTopPoint(ChunkSection[] chunkSections, int startX, int endX, int startZ, int endZ) { // search from the top down - for(int i = data.length - 1; i >= 0; i--) + for(int i = chunkSections.length - 1; i >= 0; i--) { for(int y = CHUNK_DATA_WIDTH - 1; y >= 0; y--) { - if(isLayerValidLodPoint(data, startX, endX, startZ, endZ, i, y)) + if(isLayerValidLodPoint(chunkSections, startX, endX, startZ, endZ, i, y)) { // we found // enough blocks in this @@ -373,10 +371,10 @@ public class LodChunk * values a valid LOD point? */ private boolean isLayerValidLodPoint( - ExtendedBlockStorage[] data, + ChunkSection[] chunkSections, int startX, int endX, int startZ, int endZ, - int dataIndex, int y) + int sectionIndex, int y) { // search through this layer int layerBlocks = 0; @@ -385,7 +383,7 @@ public class LodChunk { for(int z = startZ; z < endZ; z++) { - if(data[dataIndex] == null) + if(chunkSections[sectionIndex] == null) { // this section doesn't have any blocks, // it is not a valid section @@ -393,7 +391,7 @@ public class LodChunk } else { - if(data[dataIndex].get(x, y, z) != null && Block.getIdFromBlock(data[dataIndex].get(x, y, z).getBlock()) != airBlockId) + if(chunkSections[sectionIndex].getBlockState(x, y, z) != null && chunkSections[sectionIndex].getBlockState(x, y, z).getBlock() != Blocks.AIR) { // we found a valid block in // in this layer @@ -416,7 +414,7 @@ public class LodChunk private Color generateLodColorSection(Chunk chunk, World world, ColorDirection colorDir) { - Minecraft mc = Minecraft.getMinecraft(); + Minecraft mc = Minecraft.getInstance(); BlockColors bc = mc.getBlockColors(); switch (colorDir) @@ -445,7 +443,7 @@ public class LodChunk */ private Color generateLodColorVertical(Chunk chunk, ColorDirection colorDir, World world, BlockColors bc) { - ExtendedBlockStorage[] data = chunk.getBlockStorageArray(); + ChunkSection[] chunkSections = chunk.getSections(); int numbOfBlocks = 0; int red = 0; @@ -456,8 +454,8 @@ public class LodChunk // either go top down or bottom up - int dataStart = goTopDown? data.length - 1 : 0; - int dataMax = data.length; + int dataStart = goTopDown? chunkSections.length - 1 : 0; + int dataMax = chunkSections.length; int dataMin = 0; int dataIncrement = goTopDown? -1 : 1; @@ -472,18 +470,18 @@ public class LodChunk { boolean foundBlock = false; - for(int di = dataStart; !foundBlock && di >= dataMin && di < dataMax; di += dataIncrement) + for(int i = dataStart; !foundBlock && i >= dataMin && i < dataMax; i += dataIncrement) { - if(!foundBlock && data[di] != null) + if(!foundBlock && chunkSections[i] != null) { for(int y = topStart; !foundBlock && y >= topMin && y < topMax; y += topIncrement) { int ci; - if(Block.getIdFromBlock(data[di].get(x, y, z).getBlock()) == waterBlockId) + if(chunkSections[i].getBlockState(x, y, z).getBlock() == Blocks.WATER) // this is a special case since getColor on water generally returns white ci = waterColor; else - ci = bc.getColor(data[di].get(x, y, z), world, new BlockPos(x,y,z)); + ci = bc.getColor(chunkSections[i].getBlockState(x, y, z), null, new BlockPos(x,y,z), 0); if(ci == 0) { @@ -522,7 +520,7 @@ public class LodChunk private Color generateLodColorHorizontal(Chunk chunk, ColorDirection colorDir, World world, BlockColors bc) { - ExtendedBlockStorage[] data = chunk.getBlockStorageArray(); + ChunkSection[] chunkSections = chunk.getSections(); int numbOfBlocks = 0; int red = 0; @@ -563,9 +561,9 @@ public class LodChunk } - for (int di = 0; di < data.length; di++) + for (int i = 0; i < chunkSections.length; i++) { - if (data[di] != null) + if (chunkSections[i] != null) { for (int y = 0; y < CHUNK_DATA_HEIGHT; y++) { @@ -607,11 +605,11 @@ public class LodChunk } int ci; - if(Block.getIdFromBlock(data[di].get(x, y, z).getBlock()) == waterBlockId) + if(chunkSections[i].getBlockState(x, y, z).getBlock() == Blocks.WATER) // this is a special case since getColor on water generally returns white ci = waterColor; else - ci = bc.getColor(data[di].get(x, y, z), world, new BlockPos(x,y,z)); + ci = bc.getColor(chunkSections[i].getBlockState(x, y, z), null, new BlockPos(x,y,z), 0); if (ci == 0) { // skip air or invisible blocks diff --git a/src/main/java/com/backsun/lod/objects/LodDimension.java b/src/main/java/com/backsun/lod/objects/LodDimension.java index 0440d85d7..dd9cf78c0 100644 --- a/src/main/java/com/backsun/lod/objects/LodDimension.java +++ b/src/main/java/com/backsun/lod/objects/LodDimension.java @@ -2,7 +2,6 @@ package com.backsun.lod.objects; import com.backsun.lod.util.LodFileHandler; -import net.minecraft.client.Minecraft; import net.minecraft.world.DimensionType; /** @@ -33,7 +32,7 @@ public class LodDimension width = newMaxWidth; // dimension 0 works here since we are just looking for the save handler anyway - rfHandler = new LodFileHandler(Minecraft.getMinecraft().getIntegratedServer().getWorld(0).getSaveHandler(), this); + rfHandler = new LodFileHandler(this); regions = new LodRegion[width][width]; isRegionDirty = new boolean[width][width]; diff --git a/src/main/java/com/backsun/lod/objects/LodWorld.java b/src/main/java/com/backsun/lod/objects/LodWorld.java index d961388fd..fe82437ca 100644 --- a/src/main/java/com/backsun/lod/objects/LodWorld.java +++ b/src/main/java/com/backsun/lod/objects/LodWorld.java @@ -4,6 +4,8 @@ import java.util.Dictionary; import java.util.Enumeration; import java.util.Hashtable; +import net.minecraft.world.DimensionType; + /** * This stores all LODs for a given world. * @@ -17,31 +19,31 @@ public class LodWorld /** * Key = Dimension id (as an int) */ - private Dictionary lodDimensions; + private Dictionary lodDimensions; public LodWorld(String newWorldName) { worldName = newWorldName; - lodDimensions = new Hashtable(); + lodDimensions = new Hashtable<>(); } public void addLodDimension(LodDimension newStorage) { - lodDimensions.put(newStorage.dimension.getId(), newStorage); + lodDimensions.put(newStorage.dimension, newStorage); } - public LodDimension getLodDimension(int dimensionId) + public LodDimension getLodDimension(DimensionType dimension) { - return lodDimensions.get(dimensionId); + return lodDimensions.get(dimension); } public void resizeDimensionRegionWidth(int newWidth) { - Enumeration keys = lodDimensions.keys(); + Enumeration keys = lodDimensions.keys(); while(keys.hasMoreElements()) lodDimensions.get(keys.nextElement()).setRegionWidth(newWidth); diff --git a/src/main/java/com/backsun/lod/proxy/ClientProxy.java b/src/main/java/com/backsun/lod/proxy/ClientProxy.java index 32adab134..a54806f5d 100644 --- a/src/main/java/com/backsun/lod/proxy/ClientProxy.java +++ b/src/main/java/com/backsun/lod/proxy/ClientProxy.java @@ -10,23 +10,21 @@ import com.backsun.lod.objects.LodDimension; import com.backsun.lod.objects.LodRegion; import com.backsun.lod.objects.LodWorld; import com.backsun.lod.renderer.LodRenderer; +import com.backsun.lod.renderer.RenderGlobalHook; import com.backsun.lod.util.LodConfig; import com.backsun.lod.util.LodFileHandler; -import com.backsun.lodCore.util.RenderGlobalHook; import net.minecraft.client.Minecraft; -import net.minecraft.client.multiplayer.WorldClient; import net.minecraft.world.DimensionType; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; -import net.minecraft.world.chunk.storage.ExtendedBlockStorage; +import net.minecraft.world.chunk.ChunkSection; import net.minecraftforge.client.event.RenderWorldLastEvent; -import net.minecraftforge.event.terraingen.PopulateChunkEvent; import net.minecraftforge.event.world.ChunkEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; //TODO Find a way to replace getIntegratedServer so this mod could be used on non-local worlds. -// Minecraft.getMinecraft().getIntegratedServer() +// Minecraft.getInstance().getIntegratedServer() /** * This is used by the client. @@ -34,11 +32,12 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; * @author James_Seibel * @version 01-31-2021 */ -public class ClientProxy extends CommonProxy +public class ClientProxy { private LodRenderer renderer; private LodWorld lodWorld; private ExecutorService lodGenThreadPool = Executors.newFixedThreadPool(1); + Minecraft mc = Minecraft.getInstance(); /** Default size of any LOD regions we use */ private int regionWidth = 5; @@ -61,7 +60,7 @@ public class ClientProxy extends CommonProxy RenderGlobalHook.endRenderingStencil(); GL11.glStencilFunc(GL11.GL_EQUAL, 0, 0xFF); - if (LodConfig.drawLODs) + if (LodConfig.COMMON.drawLODs.get()) renderLods(event.getPartialTicks()); GL11.glDisable(GL11.GL_STENCIL_TEST); @@ -69,7 +68,7 @@ public class ClientProxy extends CommonProxy public void renderLods(float partialTicks) { - int newWidth = Math.max(4, (Minecraft.getMinecraft().gameSettings.renderDistanceChunks * LodChunk.WIDTH * 2) / LodRegion.SIZE); + int newWidth = Math.max(4, (mc.gameSettings.renderDistanceChunks * LodChunk.WIDTH * 2) / LodRegion.SIZE); if (lodWorld != null && regionWidth != newWidth) { lodWorld.resizeDimensionRegionWidth(newWidth); @@ -80,18 +79,18 @@ public class ClientProxy extends CommonProxy return; } - Minecraft mc = Minecraft.getMinecraft(); if (mc == null || mc.player == null || lodWorld == null) return; - int dimId = mc.player.dimension; - LodDimension lodDim = lodWorld.getLodDimension(dimId); + LodDimension lodDim = lodWorld.getLodDimension(mc.player.world.getDimensionType()); if (lodDim == null) return; + mc.getProfiler().endSection(); + mc.getProfiler().startSection("LOD"); - double playerX = mc.player.posX; - double playerZ = mc.player.posZ; + double playerX = mc.player.getPosX(); + double playerZ = mc.player.getPosZ(); int xOffset = ((int)playerX / (LodChunk.WIDTH * LodRegion.SIZE)) - lodDim.getCenterX(); int zOffset = ((int)playerZ / (LodChunk.WIDTH * LodRegion.SIZE)) - lodDim.getCenterZ(); @@ -112,8 +111,11 @@ public class ClientProxy extends CommonProxy } else { - renderer.drawLODs(lodDim, partialTicks); + renderer.drawLODs(lodDim, partialTicks, mc.getProfiler()); } + + // end of profiler tracking + mc.getProfiler().endSection(); } @@ -128,62 +130,35 @@ public class ClientProxy extends CommonProxy //===============// @SubscribeEvent - public void chunkLoadEvent(ChunkEvent event) + public void chunkLoadEvent(ChunkEvent.Load event) { - generateLodChunk(event.getChunk()); - } - - /** - * this event is called whenever a chunk is created for the first time. - */ - @SubscribeEvent - public void onChunkPopulate(PopulateChunkEvent event) - { - Minecraft mc = Minecraft.getMinecraft(); if (mc != null && event != null) { - WorldClient world = mc.world; + World world = mc.world; if(world != null) { - generateLodChunk(world.getChunkFromChunkCoords(event.getChunkX(), event.getChunkZ())); + generateLodChunk((Chunk)event.getChunk()); } } } - /* - * - Use this for generating chunks and maybe determining if they are loaded at all? - - Could I create my own chunk generator and multithread it? It wouldn't save to the world, but could I save it for LODs? - - chunk = Minecraft.getMinecraft().getIntegratedServer().getWorld(0).getChunkProvider().chunkGenerator.generateChunk(chunk.x, chunk.z); - - System.out.println(chunk.x + " " + chunk.z + "\tloaded: " + chunk.isLoaded() + "\tpop: " + chunk.isPopulated() + "\tter pop: " + chunk.isTerrainPopulated()); - */ - private void generateLodChunk(Chunk chunk) { - Minecraft mc = Minecraft.getMinecraft(); - // don't try to create an LOD object // if for some reason we aren't // given a valid chunk object // (Minecraft often gives back empty // or null chunks in this method) - if (chunk == null || !isValidChunk(chunk)) - return; - - int dimId = chunk.getWorld().provider.getDimension(); - World world = mc.getIntegratedServer().getWorld(dimId); - - if (world == null) + if (chunk == null || chunk.getWorld() == null || !isValidChunk(chunk)) return; Thread thread = new Thread(() -> { try { + DimensionType dim = chunk.getWorldForge().getDimensionType(); + World world = chunk.getWorld(); LodChunk lod = new LodChunk(chunk, world); LodDimension lodDim; @@ -208,15 +183,14 @@ public class ClientProxy extends CommonProxy } - if (lodWorld.getLodDimension(dimId) == null) + if (lodWorld.getLodDimension(dim) == null) { - DimensionType dim = DimensionType.getById(dimId); lodDim = new LodDimension(dim, regionWidth); lodWorld.addLodDimension(lodDim); } else { - lodDim = lodWorld.getLodDimension(dimId); + lodDim = lodWorld.getLodDimension(dim); } lodDim.addLod(lod); @@ -239,11 +213,11 @@ public class ClientProxy extends CommonProxy */ private boolean isValidChunk(Chunk chunk) { - ExtendedBlockStorage[] data = chunk.getBlockStorageArray(); + ChunkSection[] sections = chunk.getSections(); - for(ExtendedBlockStorage e : data) + for(ChunkSection section : sections) { - if(e != null && !e.isEmpty()) + if(section != null && !section.isEmpty()) { return true; } diff --git a/src/main/java/com/backsun/lod/proxy/CommonProxy.java b/src/main/java/com/backsun/lod/proxy/CommonProxy.java deleted file mode 100644 index 0b0498ad5..000000000 --- a/src/main/java/com/backsun/lod/proxy/CommonProxy.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.backsun.lod.proxy; - -/** - * This is used by the server. - * - * @author James_Seibel - * @version 08-31-2020 - */ -public class CommonProxy -{ - -} diff --git a/src/main/java/com/backsun/lod/renderer/BuildBufferThread.java b/src/main/java/com/backsun/lod/renderer/BuildBufferThread.java index 8721a63f3..851faac4e 100644 --- a/src/main/java/com/backsun/lod/renderer/BuildBufferThread.java +++ b/src/main/java/com/backsun/lod/renderer/BuildBufferThread.java @@ -1,17 +1,16 @@ package com.backsun.lod.renderer; import java.awt.Color; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; import java.util.concurrent.Callable; +import org.lwjgl.opengl.GL11; + import com.backsun.lod.util.enums.FogDistance; -import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.client.renderer.vertex.VertexFormatElement; import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.MathHelper; /** * @@ -21,8 +20,8 @@ import net.minecraft.util.math.MathHelper; */ public class BuildBufferThread implements Callable { - public ByteBuffer nearBuffer; - public ByteBuffer farBuffer; + public BufferBuilder nearBuffer; + public BufferBuilder farBuffer; public FogDistance distanceMode; public AxisAlignedBB[][] lods; public Color[][] colors; @@ -42,20 +41,20 @@ public class BuildBufferThread implements Callable vertexCount = 0; vertexFormat = DefaultVertexFormats.POSITION_COLOR; vertexFormatIndex = 0; - vertexFormatElement = vertexFormat.getElement(vertexFormatIndex); + vertexFormatElement = vertexFormat.getElements().get(vertexFormatIndex); } - BuildBufferThread(ByteBuffer newNearByteBuffer, ByteBuffer newFarByteBuffer, AxisAlignedBB[][] newLods, Color[][] newColors, FogDistance newDistanceMode, int threadNumber, int totalThreads) + BuildBufferThread(BufferBuilder newNearByteBuffer, BufferBuilder newFarByteBuffer, AxisAlignedBB[][] newLods, Color[][] newColors, FogDistance newDistanceMode, int threadNumber, int totalThreads) { setNewData(newNearByteBuffer, newFarByteBuffer, distanceMode, newLods, newColors, threadNumber, totalThreads); vertexCount = 0; vertexFormat = DefaultVertexFormats.POSITION_COLOR; vertexFormatIndex = 0; - vertexFormatElement = vertexFormat.getElement(vertexFormatIndex); + vertexFormatElement = vertexFormat.getElements().get(vertexFormatIndex); } - public void setNewData(ByteBuffer newNearByteBuffer, ByteBuffer newFarByteBuffer, FogDistance newDistanceMode, AxisAlignedBB[][] newLods, Color[][] newColors, int threadNumber, int totalThreads) + public void setNewData(BufferBuilder newNearByteBuffer, BufferBuilder newFarByteBuffer, FogDistance newDistanceMode, AxisAlignedBB[][] newLods, Color[][] newColors, int threadNumber, int totalThreads) { vertexCount = 0; vertexFormatIndex = 0; @@ -74,10 +73,13 @@ public class BuildBufferThread implements Callable @Override public NearFarBuffer call() - { + { + nearBuffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR); + farBuffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR); + int numbChunksWide = lods.length; - ByteBuffer currentBuffer; + BufferBuilder currentBuffer; AxisAlignedBB bb; int red; int green; @@ -200,16 +202,20 @@ public class BuildBufferThread implements Callable return new NearFarBuffer(nearBuffer, farBuffer); } - private void addPosAndColor(ByteBuffer buffer, double x, double y, double z, int red, int green, int blue, int alpha) + private void addPosAndColor(BufferBuilder buffer, double x, double y, double z, int red, int green, int blue, int alpha) { - addPos(buffer, x, y, z); - addColor(buffer, red, green, blue, alpha); - endVertex(); + buffer.pos(x, y, z).color(red, green, blue, alpha).endVertex(); + +// addPos(buffer, x, y, z); +// addColor(buffer, red, green, blue, alpha); +// endVertex(); } + + /* private void addPos(ByteBuffer byteBuffer, double x, double y, double z) { - int i = this.vertexCount * this.vertexFormat.getNextOffset() + this.vertexFormat.getOffset(this.vertexFormatIndex); + int i = this.vertexCount * this.vertexFormat.getOffset(this.vertexFormatIndex+1) + this.vertexFormat.getOffset(this.vertexFormatIndex); switch (this.vertexFormatElement.getType()) { @@ -242,7 +248,7 @@ public class BuildBufferThread implements Callable private void addColor(ByteBuffer byteBuffer, int red, int green, int blue, int alpha) { - int i = this.vertexCount * this.vertexFormat.getNextOffset() + this.vertexFormat.getOffset(this.vertexFormatIndex); + int i = this.vertexCount * this.vertexFormat.getOffset(this.vertexFormatIndex+1) + this.vertexFormat.getOffset(this.vertexFormatIndex); switch (this.vertexFormatElement.getType()) { @@ -292,10 +298,10 @@ public class BuildBufferThread implements Callable private void nextVertexFormatIndex() { ++this.vertexFormatIndex; - this.vertexFormatIndex %= this.vertexFormat.getElementCount(); - this.vertexFormatElement = this.vertexFormat.getElement(this.vertexFormatIndex); + this.vertexFormatIndex %= this.vertexFormat.getSize(); + this.vertexFormatElement = this.vertexFormat.getElements().get(this.vertexFormatIndex); - if (this.vertexFormatElement.getUsage() == VertexFormatElement.EnumUsage.PADDING) + if (this.vertexFormatElement.getUsage() == VertexFormatElement.Usage.PADDING) { this.nextVertexFormatIndex(); } @@ -303,14 +309,21 @@ public class BuildBufferThread implements Callable private void endVertex() { - ++this.vertexCount; - growBuffer(this.vertexFormat.getNextOffset()); +// ++this.vertexCount; +// growBuffer(this.vertexFormat.getNextOffset()); + + if (this.vertexFormatIndex != 0) { + throw new IllegalStateException("Not filled all elements of the vertex"); + } else { + ++this.vertexCount; + this.growBuffer(vertexFormat.getSize()); + } } private void growBuffer(int p_181670_1_) { //if (MathHelper.roundUp(p_181670_1_, 4) / 4 > this.rawIntBuffer.remaining() || this.vertexCount * this.vertexFormat.getNextOffset() + p_181670_1_ > this.byteBuffer.capacity()) - if (this.vertexCount * this.vertexFormat.getNextOffset() + p_181670_1_ > nearBuffer.capacity()) + if (this.vertexCount * this.vertexFormat.getOffset(this.vertexFormatIndex+1) + p_181670_1_ > nearBuffer.capacity()) { int i = nearBuffer.capacity(); int j = i + MathHelper.roundUp(p_181670_1_, 2097152); @@ -327,7 +340,7 @@ public class BuildBufferThread implements Callable // this.rawShortBuffer.position(k << 1); } } - + */ } \ No newline at end of file diff --git a/src/main/java/com/backsun/lod/renderer/LodRenderer.java b/src/main/java/com/backsun/lod/renderer/LodRenderer.java index d94c4fad3..5bec14306 100644 --- a/src/main/java/com/backsun/lod/renderer/LodRenderer.java +++ b/src/main/java/com/backsun/lod/renderer/LodRenderer.java @@ -13,7 +13,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; import org.lwjgl.opengl.GL11; -import org.lwjgl.util.glu.Project; import com.backsun.lod.objects.LodChunk; import com.backsun.lod.objects.LodDimension; @@ -23,15 +22,19 @@ import com.backsun.lod.util.enums.ColorDirection; import com.backsun.lod.util.enums.FogDistance; import com.backsun.lod.util.enums.FogQuality; import com.backsun.lod.util.enums.LodLocation; +import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ActiveRenderInfo; import net.minecraft.client.renderer.BufferBuilder; -import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.GameRenderer; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.entity.Entity; +import net.minecraft.profiler.IProfiler; import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.vector.Matrix4f; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.world.chunk.Chunk; /** * @author James Seibel @@ -44,6 +47,8 @@ public class LodRenderer public boolean debugging = false; private Minecraft mc; + private GameRenderer gameRender; + private IProfiler profiler; private float farPlaneDistance; // make sure this is an even number, or else it won't align with the chunk grid /** this is the total width of the LODs (I.E the diameter, not the radius) */ @@ -66,10 +71,10 @@ public class LodRenderer private int maxNumbThreads = Runtime.getRuntime().availableProcessors(); /** How many threads should be used for building the render buffer. */ - private int numbBufferThreads = maxNumbThreads; + private int numbBufferThreads = 1; private ArrayList bufferThreads = new ArrayList(); - private volatile ByteBuffer[] nearBuffers = new ByteBuffer[maxNumbThreads]; - private volatile ByteBuffer[] farBuffers = new ByteBuffer[maxNumbThreads]; + private volatile BufferBuilder[] nearBuffers = new BufferBuilder[maxNumbThreads]; + private volatile BufferBuilder[] farBuffers = new BufferBuilder[maxNumbThreads]; private ExecutorService bufferThreadPool = Executors.newFixedThreadPool(maxNumbThreads); /* * this is the maximum number of bytes a buffer @@ -90,12 +95,14 @@ public class LodRenderer /** if this is true the LODs should be regenerated */ private boolean regen = false; + private volatile boolean regenerating = false; public LodRenderer() { - mc = Minecraft.getMinecraft(); + mc = Minecraft.getInstance(); + gameRender = mc.gameRenderer; // for some reason "Tessellator.getInstance()" won't work here, we have to create a new one tessellator = new Tessellator(2097152); @@ -104,36 +111,24 @@ public class LodRenderer reflectionHandler = new ReflectionHandler(); } + private ExecutorService genThread = Executors.newSingleThreadExecutor(); + private ExecutorService loadQueueThread = Executors.newSingleThreadExecutor(); - public void drawLODs(LodDimension newDimension, float partialTicks) + public void drawLODs(LodDimension newDimension, float partialTicks, IProfiler newProfiler) { - if (reflectionHandler.fovMethod == null) - { - // don't continue if we can't get the - // user's FOV - return; - } - - if (reflectionHandler.fovMethod == null) - { - // we aren't able to get the user's - // FOV, don't render anything - return; - } - // should the LODs be regenerated? - if ((int)Minecraft.getMinecraft().player.posX / LodChunk.WIDTH != prevChunkX || - (int)Minecraft.getMinecraft().player.posZ / LodChunk.WIDTH != prevChunkZ || + if ((int)mc.player.getPosX() / LodChunk.WIDTH != prevChunkX || + (int)mc.player.getPosZ() / LodChunk.WIDTH != prevChunkZ || previousChunkRenderDistance != mc.gameSettings.renderDistanceChunks || - prevFogDistance != LodConfig.fogDistance || + prevFogDistance != LodConfig.COMMON.fogDistance.get() || lodDimension != newDimension) { regen = true; - prevChunkX = (int)Minecraft.getMinecraft().player.posX / LodChunk.WIDTH; - prevChunkZ = (int)Minecraft.getMinecraft().player.posZ / LodChunk.WIDTH; - prevFogDistance = LodConfig.fogDistance; + prevChunkX = (int)mc.player.getPosX() / LodChunk.WIDTH; + prevChunkZ = (int)mc.player.getPosZ() / LodChunk.WIDTH; + prevFogDistance = LodConfig.COMMON.fogDistance.get(); } else { @@ -143,6 +138,7 @@ public class LodRenderer regen = false; } + profiler = newProfiler; lodDimension = newDimension; if (lodDimension == null) { @@ -157,20 +153,19 @@ public class LodRenderer // used for debugging and viewing how long different processes take - mc.mcProfiler.endSection(); - mc.mcProfiler.startSection("LOD"); - mc.mcProfiler.startSection("LOD setup"); + profiler.startSection("LOD_setup"); + @SuppressWarnings("unused") long startTime = System.nanoTime(); - if (LodConfig.drawCheckerBoard) + if (LodConfig.COMMON.drawCheckerBoard.get()) { - if (debugging != LodConfig.drawCheckerBoard) + if (debugging != LodConfig.COMMON.drawCheckerBoard.get()) regen = true; debugging = true; } else { - if (debugging != LodConfig.drawCheckerBoard) + if (debugging != LodConfig.COMMON.drawCheckerBoard.get()) regen = true; debugging = false; } @@ -190,10 +185,11 @@ public class LodRenderer // get the camera location - Entity player = mc.player; - double cameraX = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks; - double cameraY = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks; - double cameraZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks; + ActiveRenderInfo renderInfo = mc.gameRenderer.getActiveRenderInfo(); + Vector3d projectedView = renderInfo.getProjectedView(); + double cameraX = projectedView.x; + double cameraY = projectedView.y; + double cameraZ = projectedView.z; @@ -224,113 +220,147 @@ public class LodRenderer - //=================// // create the LODs // //=================// + + profiler.endStartSection("LOD_generation"); + if (regen) { - mc.mcProfiler.endStartSection("LOD generation"); - - // x axis - for (int i = 0; i < numbChunksWide; i++) + Thread t = new Thread(()-> { - // z axis - for (int j = 0; j < numbChunksWide; j++) + int numbChunksGen = 0; + int maxChunkGen = 640; + + // x axis + for (int i = 0; i < numbChunksWide; i++) { - // skip the middle - // (As the player moves some chunks will overlap or be missing, - // this is just how chunk loading/unloading works. This can hopefully - // be hidden with careful use of fog) - int middle = (numbChunksWide / 2); - if (RenderUtil.isCoordinateInLoadedArea(i, j, middle)) + // z axis + for (int j = 0; j < numbChunksWide; j++) { - continue; - } - - - // set where this square will be drawn in the world - double xOffset = (LodChunk.WIDTH * i) + // offset by the number of LOD blocks - startX; // offset so the center LOD block is centered underneath the player - double yOffset = 0; - double zOffset = (LodChunk.WIDTH * j) + startZ; - - int chunkX = i + (startX / LodChunk.WIDTH); - int chunkZ = j + (startZ / LodChunk.WIDTH); - - LodChunk lod = lodDimension.getLodFromCoordinates(chunkX, chunkZ); // new LodChunk(); // - if (lod == null) - { - // note: for some reason if any color or lod object are set here - // it causes the game to use 100% gpu, all of it undefined in the debug menu - // and drop to ~6 fps. -// colorArray[i][j] = null; -// lodArray[i][j] = null; + // skip the middle + // (As the player moves some chunks will overlap or be missing, + // this is just how chunk loading/unloading works. This can hopefully + // be hidden with careful use of fog) + int middle = (numbChunksWide / 2); + if (RenderUtil.isCoordinateInLoadedArea(i, j, middle)) + { + continue; + } - continue; - } - - Color c = new Color( - (lod.colors[ColorDirection.TOP.value].getRed()), - (lod.colors[ColorDirection.TOP.value].getGreen()), - (lod.colors[ColorDirection.TOP.value].getBlue()), - lod.colors[ColorDirection.TOP.value].getAlpha()); - - - - if (!debugging) - { - // add the color to the array - colorArray[i][j] = c; - } - else - { - // if debugging draw the squares as a black and white checker board - if ((chunkX + chunkZ) % 2 == 0) - c = white; + + // set where this square will be drawn in the world + double xOffset = (LodChunk.WIDTH * i) + // offset by the number of LOD blocks + startX; // offset so the center LOD block is centered underneath the player + double yOffset = 0; + double zOffset = (LodChunk.WIDTH * j) + startZ; + + int chunkX = i + (startX / LodChunk.WIDTH); + int chunkZ = j + (startZ / LodChunk.WIDTH); + + LodChunk lod = lodDimension.getLodFromCoordinates(chunkX, chunkZ); + if (lod == null) + { + // note: for some reason if any color or lod object are set here + // it causes the game to use 100% gpu, all of it undefined in the debug menu + // and drop to ~6 fps. + // colorArray[i][j] = null; + // lodArray[i][j] = null; + + // TODO this partially works, but not fully + if (numbChunksGen < maxChunkGen) + { +// if (lod == null) +// { +// LodChunk placeholder = new LodChunk(); +// placeholder.x = chunkX; +// placeholder.z = chunkZ; +// placeholder.colors[ColorDirection.TOP.value] = error; +// lodDimension.addLod(placeholder); +// } + + // Thread loadT = new Thread(()-> { + Chunk newChunk = mc.world.getChunk(chunkX, chunkZ); + lodDimension.addLod(new LodChunk(newChunk, newChunk.getWorld())); + System.out.println(chunkX + "," + chunkZ + "\t" + numbChunksGen); + // }); + // loadQueueThread.execute(loadT); + numbChunksGen++; + } + + continue; + } + + Color c = new Color( + (lod.colors[ColorDirection.TOP.value].getRed()), + (lod.colors[ColorDirection.TOP.value].getGreen()), + (lod.colors[ColorDirection.TOP.value].getBlue()), + lod.colors[ColorDirection.TOP.value].getAlpha()); + + + + if (!debugging) + { + // add the color to the array + colorArray[i][j] = c; + } else - c = black; - // draw the first square as red - if (i == 0 && j == 0) - c = red; + { + // if debugging draw the squares as a black and white checker board + if ((chunkX + chunkZ) % 2 == 0) + c = white; + else + c = black; + // draw the first square as red + if (i == 0 && j == 0) + c = red; + + colorArray[i][j] = c; + } - colorArray[i][j] = c; + + // add the new box to the array + int topPoint = getLodHeightPoint(lod.top); + int bottomPoint = getLodHeightPoint(lod.bottom); + + // don't draw an LOD if it is empty + if (topPoint == -1 && bottomPoint == -1) + continue; + + lodArray[i][j] = new AxisAlignedBB(0, bottomPoint, 0, LodChunk.WIDTH, topPoint, LodChunk.WIDTH).offset(xOffset, yOffset, zOffset); } - - - // add the new box to the array - int topPoint = getLodHeightPoint(lod.top); - int bottomPoint = getLodHeightPoint(lod.bottom); - - // don't draw an LOD if it is empty - if (topPoint == -1 && bottomPoint == -1) - continue; - - lodArray[i][j] = new AxisAlignedBB(0, bottomPoint, 0, LodChunk.WIDTH, topPoint, LodChunk.WIDTH).offset(xOffset, yOffset, zOffset); } - } + }); + t.run(); +// genThread.execute(t); } + //===========================// // GL settings for rendering // //===========================// + profiler.endStartSection("LOD_setup"); // set the required open GL settings GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glLineWidth(2.0f); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL); - GlStateManager.translate(-cameraX, -cameraY, -cameraZ); + RenderSystem.pushMatrix(); + RenderSystem.rotatef(renderInfo.getPitch(), 1, 0, 0); // Fixes camera rotation. + RenderSystem.rotatef(renderInfo.getYaw() + 180, 0, 1, 0); // Fixes camera rotation. + RenderSystem.translated(-cameraX, -cameraY, -cameraZ); - setProjectionMatrix(partialTicks); - setupLighting(partialTicks); +// setupProjectionMatrix(partialTicks); +// setupLighting(partialTicks); setupBufferThreads(lodArray); @@ -338,32 +368,41 @@ public class LodRenderer + + + + + //===========// // rendering // //===========// - mc.mcProfiler.endStartSection("LOD build buffer"); + profiler.endStartSection("LOD build buffer"); if (regen) - generateLodBuffers(lodArray, colorArray, LodConfig.fogDistance); + generateLodBuffers(lodArray, colorArray, LodConfig.COMMON.fogDistance.get()); - switch(LodConfig.fogDistance) + profiler.endStartSection("LOD draw"); + + switch(LodConfig.COMMON.fogDistance.get()) { case NEAR_AND_FAR: - mc.mcProfiler.endStartSection("LOD draw setup"); + profiler.startSection("LOD draw near"); setupFog(FogDistance.NEAR, reflectionHandler.getFogQuality()); sendLodsToGpuAndDraw(nearBuffers); + profiler.endSection(); - mc.mcProfiler.endStartSection("LOD draw setup"); - setupFog(FogDistance.FAR, reflectionHandler.getFogQuality()); - sendLodsToGpuAndDraw(farBuffers); +// profiler.startSection("LOD draw far"); +// setupFog(FogDistance.FAR, reflectionHandler.getFogQuality()); +// sendLodsToGpuAndDraw(farBuffers); +// profiler.endSection(); break; case NEAR: - mc.mcProfiler.endStartSection("LOD draw setup"); + profiler.endStartSection("LOD draw near"); setupFog(FogDistance.NEAR, reflectionHandler.getFogQuality()); sendLodsToGpuAndDraw(nearBuffers); break; case FAR: - mc.mcProfiler.endStartSection("LOD draw setup"); + profiler.endStartSection("LOD draw far"); setupFog(FogDistance.FAR, reflectionHandler.getFogQuality()); sendLodsToGpuAndDraw(farBuffers); break; @@ -372,50 +411,57 @@ public class LodRenderer - //=========// // cleanup // //=========// - mc.mcProfiler.endStartSection("LOD cleanup"); + profiler.endStartSection("LOD_cleanup"); // this must be done otherwise other parts of the screen may be drawn with a fog effect // IE the GUI - GlStateManager.disableFog(); + RenderSystem.disableFog(); GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL); GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_LIGHT1); + GL11.glDisable(GL11.GL_LIGHT2); GL11.glDisable(GL11.GL_COLOR_MATERIAL); + GL11.glDisable(GL11.GL_CULL_FACE); + + // undo any projection matrix changes we did to prevent other renders + // from being corrupted + RenderSystem.popMatrix(); - // change the perspective matrix back to prevent incompatibilities - // with other mods that may render during forgeRenderLast - Project.gluPerspective(reflectionHandler.getFov(mc, partialTicks, true), (float) this.mc.displayWidth / (float) this.mc.displayHeight, 0.05F, this.farPlaneDistance * MathHelper.SQRT_2); // this can't be called until after the buffers are built // because otherwise the buffers may be set to the wrong size previousChunkRenderDistance = mc.gameSettings.renderDistanceChunks; - // This is about how long this whole process should take // 16 ms = 60 hz @SuppressWarnings("unused") long endTime = System.nanoTime(); - - // end of profiler tracking - mc.mcProfiler.endSection(); } + + + + + + + + + + + + + + + + - - - - - - /** * draw an array of cubes (or squares) with the given colors. * @param lods bounding boxes to draw @@ -431,11 +477,11 @@ public class LodRenderer { if (nearBuffers[i] == null || previousChunkRenderDistance != mc.gameSettings.renderDistanceChunks) { - nearBuffers[i] = ByteBuffer.allocateDirect(bufferMaxCapacity); - nearBuffers[i].order(ByteOrder.LITTLE_ENDIAN); + nearBuffers[i] = new BufferBuilder(bufferMaxCapacity); //ByteBuffer.allocateDirect(bufferMaxCapacity); +// nearBuffers[i].order(ByteOrder.LITTLE_ENDIAN); - farBuffers[i] = ByteBuffer.allocateDirect(bufferMaxCapacity); - farBuffers[i].order(ByteOrder.LITTLE_ENDIAN); + farBuffers[i] = new BufferBuilder(bufferMaxCapacity); //ByteBuffer.allocateDirect(bufferMaxCapacity); +// farBuffers[i].order(ByteOrder.LITTLE_ENDIAN); clearBytes = new byte[bufferMaxCapacity]; } @@ -446,18 +492,18 @@ public class LodRenderer // overwrite the old data // (which needs to be done otherwise old // LODs may be drawn) - nearBuffers[i].clear(); - nearBuffers[i].put(clearBytes); - nearBuffers[i].clear(); + nearBuffers[i].byteBuffer.clear(); + nearBuffers[i].byteBuffer.put(clearBytes); + nearBuffers[i].byteBuffer.clear(); - farBuffers[i].clear(); - farBuffers[i].put(clearBytes); - farBuffers[i].clear(); + farBuffers[i].byteBuffer.clear(); + farBuffers[i].byteBuffer.put(clearBytes); + farBuffers[i].byteBuffer.clear(); } - int pos = bufferBuilder.getByteBuffer().position(); - nearBuffers[i].position(pos); - farBuffers[i].position(pos); +// int pos = bufferBuilder.byteBuffer.position(); +// nearBuffers[i].byteBuffer.position(pos); +// farBuffers[i].byteBuffer.position(pos); bufferThreads.get(i).setNewData(nearBuffers[i], farBuffers[i], fogDistance, lods, colors, i, numbBufferThreads); } @@ -478,6 +524,9 @@ public class LodRenderer { nearBuffers[i] = bufferFutures.get(i).get().nearBuffer; farBuffers[i] = bufferFutures.get(i).get().farBuffer; + + nearBuffers[i].finishDrawing(); + farBuffers[i].finishDrawing(); } catch(CancellationException | ExecutionException| InterruptedException e) { @@ -488,22 +537,23 @@ public class LodRenderer } - private void sendLodsToGpuAndDraw(ByteBuffer[] buffers) + private void sendLodsToGpuAndDraw(BufferBuilder[] nearBuffers) { for(int i = 0; i < numbBufferThreads; i++) { - int pos = bufferBuilder.getByteBuffer().position(); - buffers[i].position(pos); + profiler.startSection("LOD setup"); +// int pos = bufferBuilder.byteBuffer.position(); +// nearBuffers[i].byteBuffer.position(pos); bufferBuilder.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR); - bufferBuilder.getByteBuffer().clear(); - bufferBuilder.putBulkData(buffers[i]); + bufferBuilder.byteBuffer.clear(); + bufferBuilder.putBulkData(nearBuffers[i].byteBuffer); - mc.mcProfiler.endStartSection("LOD draw"); + profiler.endStartSection("LOD draw"); tessellator.draw(); - mc.mcProfiler.endStartSection("LOD draw setup"); - bufferBuilder.getByteBuffer().clear(); // this is required otherwise nothing is drawn + bufferBuilder.byteBuffer.clear(); // this is required otherwise nothing is drawn + profiler.endSection(); } } @@ -517,11 +567,12 @@ public class LodRenderer // Setup Functions // //=================// + @SuppressWarnings("deprecation") private void setupFog(FogDistance fogDistance, FogQuality fogQuality) { if(fogQuality == FogQuality.OFF) { - GlStateManager.disableFog(); + RenderSystem.disableFog(); return; } @@ -542,8 +593,8 @@ public class LodRenderer if (fogQuality == FogQuality.FANCY) { - GlStateManager.setFogEnd(farPlaneDistance * 0.3f * LOD_CHUNK_DISTANCE_RADIUS); - GlStateManager.setFogStart(farPlaneDistance * 0.35f * LOD_CHUNK_DISTANCE_RADIUS); + RenderSystem.fogEnd(farPlaneDistance * 0.3f * LOD_CHUNK_DISTANCE_RADIUS); + RenderSystem.fogStart(farPlaneDistance * 0.35f * LOD_CHUNK_DISTANCE_RADIUS); } else if(fogQuality == FogQuality.FAST) { @@ -551,49 +602,55 @@ public class LodRenderer // to start right where the LODs' end use: // end = 0.8f, start = 1.5f - GlStateManager.setFogEnd(farPlaneDistance * 1.5f); - GlStateManager.setFogStart(farPlaneDistance * 2.0f); + RenderSystem.fogEnd(farPlaneDistance * 1.5f); + RenderSystem.fogStart(farPlaneDistance * 2.0f); } } else if(fogDistance == FogDistance.FAR) { if (fogQuality == FogQuality.FANCY) { - GlStateManager.setFogStart(farPlaneDistance * 0.78f * LOD_CHUNK_DISTANCE_RADIUS); - GlStateManager.setFogEnd(farPlaneDistance * 1.0f * LOD_CHUNK_DISTANCE_RADIUS); + RenderSystem.fogStart(farPlaneDistance * 0.78f * LOD_CHUNK_DISTANCE_RADIUS); + RenderSystem.fogEnd(farPlaneDistance * 1.0f * LOD_CHUNK_DISTANCE_RADIUS); } else if(fogQuality == FogQuality.FAST) { - GlStateManager.setFogStart(farPlaneDistance * 0.5f * LOD_CHUNK_DISTANCE_RADIUS); - GlStateManager.setFogEnd(farPlaneDistance * 0.75f * LOD_CHUNK_DISTANCE_RADIUS); + RenderSystem.fogStart(farPlaneDistance * 0.5f * LOD_CHUNK_DISTANCE_RADIUS); + RenderSystem.fogEnd(farPlaneDistance * 0.75f * LOD_CHUNK_DISTANCE_RADIUS); } } - GlStateManager.setFogDensity(0.1f); - GlStateManager.enableFog(); + RenderSystem.fogDensity(0.1f); + RenderSystem.enableFog(); } + /** * create a new projection matrix and send it over to the GPU * @param partialTicks how many ticks into the frame we are * @return true if the matrix was successfully created and sent to the GPU, false otherwise */ - private void setProjectionMatrix(float partialTicks) + private void setupProjectionMatrix(float partialTicks) { - // create a new view frustum so that the squares can be drawn outside the normal view distance - GlStateManager.matrixMode(GL11.GL_PROJECTION); - GlStateManager.loadIdentity(); +// Project.gluPerspective(getFov(partialTicks, true), (float) mc.currentScreen.width / (float) mc.currentScreen.height, 0.5F, farPlaneDistance * 12); + gameRender.resetProjectionMatrix(getCustomProjectionMatrix(partialTicks, false)); - // only continue if we can get the FOV - if (reflectionHandler.fovMethod != null) - { - Project.gluPerspective(reflectionHandler.getFov(mc, partialTicks, true), (float) mc.displayWidth / (float) mc.displayHeight, 0.5F, farPlaneDistance * 12); - } - - // we weren't able to set up the projection matrix return; } + /** + * Almost an exact copy of what is in GameRenderer + */ + public Matrix4f getCustomProjectionMatrix(float partialTicks, boolean useFovSetting) + { + ActiveRenderInfo activeRenderInfoIn = mc.gameRenderer.getActiveRenderInfo(); + + return Matrix4f.perspective( + gameRender.getFOVModifier(activeRenderInfoIn, partialTicks, useFovSetting), + (float)this.mc.getMainWindow().getFramebufferWidth() / (float)this.mc.getMainWindow().getFramebufferHeight(), + 0.5F, + this.farPlaneDistance * LOD_CHUNK_DISTANCE_RADIUS * 2); + } /** @@ -604,18 +661,18 @@ public class LodRenderer GL11.glEnable(GL11.GL_COLOR_MATERIAL); // set the color to be used as the material (this allows lighting to be enabled) // this isn't perfect right now, but it looks pretty good at 50% brightness - float sunBrightness = mc.world.getSunBrightness(partialTicks) * mc.world.provider.getSunBrightnessFactor(partialTicks); - float skyHasLight = mc.world.provider.hasSkyLight()? 1.0f : 0.15f; - float gammaMultiplyer = (mc.gameSettings.gammaSetting * 0.5f + 0.5f); + float sunBrightness = mc.world.getSunBrightness(partialTicks); + float skyHasLight = 1.0f; //mc.world.provider.hasSkyLight()? 1.0f : 0.15f; + float gammaMultiplyer = ((float)mc.gameSettings.gamma * 0.5f + 0.5f); float lightStrength = sunBrightness * skyHasLight * gammaMultiplyer; float lightAmbient[] = {lightStrength, lightStrength, lightStrength, 1.0f}; ByteBuffer temp = ByteBuffer.allocateDirect(16); temp.order(ByteOrder.nativeOrder()); - GL11.glLight(GL11.GL_LIGHT1, GL11.GL_AMBIENT, (FloatBuffer) temp.asFloatBuffer().put(lightAmbient).flip()); - GL11.glEnable(GL11.GL_LIGHT1); // Enable the above lighting + GL11.glLightfv(GL11.GL_LIGHT2, GL11.GL_AMBIENT, (FloatBuffer) temp.asFloatBuffer().put(lightAmbient).flip()); + GL11.glEnable(GL11.GL_LIGHT2); // Enable the above lighting - GlStateManager.enableLighting(); + RenderSystem.enableLighting(); } @@ -633,11 +690,11 @@ public class LodRenderer for(int i = 0; i < maxNumbThreads; i++) { - nearBuffers[i] = ByteBuffer.allocateDirect(bufferMaxCapacity); - nearBuffers[i].order(ByteOrder.LITTLE_ENDIAN); + nearBuffers[i] = new BufferBuilder(bufferMaxCapacity); //ByteBuffer.allocateDirect(bufferMaxCapacity); +// nearBuffers[i].order(ByteOrder.LITTLE_ENDIAN); - farBuffers[i] = ByteBuffer.allocateDirect(bufferMaxCapacity); - farBuffers[i].order(ByteOrder.LITTLE_ENDIAN); + farBuffers[i] = new BufferBuilder(bufferMaxCapacity); //ByteBuffer.allocateDirect(bufferMaxCapacity); +// farBuffers[i].order(ByteOrder.LITTLE_ENDIAN); } } } @@ -646,6 +703,7 @@ public class LodRenderer + /** * Returns -1 if there are no valid points */ @@ -661,6 +719,10 @@ public class LodRenderer } + public double getFov(float partialTicks, boolean useFovSetting) + { + return mc.gameRenderer.getFOVModifier(mc.gameRenderer.getActiveRenderInfo(), partialTicks, useFovSetting); + } diff --git a/src/main/java/com/backsun/lod/renderer/NearFarBuffer.java b/src/main/java/com/backsun/lod/renderer/NearFarBuffer.java index 1c57da0f8..a4f4a66e0 100644 --- a/src/main/java/com/backsun/lod/renderer/NearFarBuffer.java +++ b/src/main/java/com/backsun/lod/renderer/NearFarBuffer.java @@ -1,6 +1,6 @@ package com.backsun.lod.renderer; -import java.nio.ByteBuffer; +import net.minecraft.client.renderer.BufferBuilder; /** * This object is just a replacement for an array @@ -12,12 +12,12 @@ import java.nio.ByteBuffer; */ public class NearFarBuffer { - public ByteBuffer nearBuffer; + public BufferBuilder nearBuffer; - public ByteBuffer farBuffer; + public BufferBuilder farBuffer; - NearFarBuffer(ByteBuffer newNearBuffer, ByteBuffer newFarBuffer) + NearFarBuffer(BufferBuilder newNearBuffer, BufferBuilder newFarBuffer) { nearBuffer = newNearBuffer; farBuffer = newFarBuffer; diff --git a/src/main/java/com/backsun/lod/renderer/RenderGlobalHook.java b/src/main/java/com/backsun/lod/renderer/RenderGlobalHook.java new file mode 100644 index 000000000..ad1c75e98 --- /dev/null +++ b/src/main/java/com/backsun/lod/renderer/RenderGlobalHook.java @@ -0,0 +1,82 @@ +package com.backsun.lod.renderer; + + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.renderer.RenderType; + +/** + * This code is used for drawing + * to the stencil buffer. + * + * @author James Seibel + * @version 02-17-2021 + */ +public class RenderGlobalHook +{ + /** + * this variable should be the same as the method name below. + * It is used when transforming the RenderGlobal class' + * renderBlockLayer method. + */ + public static final String START_STENCIL_METHOD_NAME = "startRenderingStencil"; + + /** + * This method tells OpenGL to start drawing everything to the stencil. + * This is done to prevent LODs from being rendered on top of the world. + *

+ * Called in the order (as of minecraft 1.16.4):
+ * RenderType.getSolid()
+ * RenderType.getCutoutMipped()
+ * RenderType.getCutout()
+ * RenderType.getTranslucent()
+ * RenderType.getTripwire()
+ */ + public static void startRenderingStencil(RenderType blockLayerIn) + { + // we only enable drawing to the stencil once since + // we want to skip the rendering of the out of world fog + // but catch everything else + if (blockLayerIn == RenderType.getSolid()) + { + // solid is the first layer rendered + // clear the buffer so we can start fresh. + // if this isn't cleared first we will have overlap with the fog + // outside the world + GL11.glClearStencil(0); + GL11.glStencilMask(0x11111111); + GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT); + + GL11.glEnable(GL11.GL_STENCIL_TEST); + GL11.glStencilFunc(GL11.GL_ALWAYS, 1, 0x11111111); + GL11.glStencilMask(0b11111111); + GL11.glStencilOp(GL11.GL_KEEP, // this doesn't mater since GL_ALWAYS is being used + GL11.GL_KEEP, // stencil test passes + GL11.GL_REPLACE); // stencil + depth pass + } + } + + + /** + * this variable should be the same as the method name below. + * It is used when transforming the RenderGlobal class' + * renderBlockLayer method. + */ + public static final String END_STENCIL_METHOD_NAME = "endRenderingStencil"; + + /** + * Currently this method isn't used in any transformations since we end + * the stencil drawing in the ClientProxy right before we draw the LODs. + */ + public static void endRenderingStencil(RenderType blockLayerIn) + { + GL11.glStencilOp(GL11.GL_KEEP, // this doesn't mater since GL_ALWAYS is being used + GL11.GL_KEEP, // stencil test passes + GL11.GL_KEEP); // stencil + depth pass + } + + public static void endRenderingStencil() + { + endRenderingStencil(null); + } +} diff --git a/src/main/java/com/backsun/lod/renderer/RenderUtil.java b/src/main/java/com/backsun/lod/renderer/RenderUtil.java index 8a9950c39..93b2e86ab 100644 --- a/src/main/java/com/backsun/lod/renderer/RenderUtil.java +++ b/src/main/java/com/backsun/lod/renderer/RenderUtil.java @@ -17,7 +17,7 @@ public class RenderUtil */ public static boolean isCoordinateInLoadedArea(int i, int j, int centerCoordinate) { - Minecraft mc = Minecraft.getMinecraft(); + Minecraft mc = Minecraft.getInstance(); return (i >= centerCoordinate - mc.gameSettings.renderDistanceChunks && i <= centerCoordinate + mc.gameSettings.renderDistanceChunks) diff --git a/src/main/java/com/backsun/lod/util/LodConfig.java b/src/main/java/com/backsun/lod/util/LodConfig.java index 3cc12cbcb..02977fcb1 100644 --- a/src/main/java/com/backsun/lod/util/LodConfig.java +++ b/src/main/java/com/backsun/lod/util/LodConfig.java @@ -1,55 +1,65 @@ package com.backsun.lod.util; +import org.apache.commons.lang3.tuple.Pair; + +import com.backsun.lod.ModInfo; import com.backsun.lod.util.enums.FogDistance; -import net.minecraftforge.common.config.Config; -import net.minecraftforge.common.config.ConfigManager; -import net.minecraftforge.fml.client.event.ConfigChangedEvent; +import net.minecraftforge.common.ForgeConfigSpec; import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; /** * * @author James Seibel * @version 02-14-2021 */ -@Config(modid = Reference.MOD_ID) +@Mod.EventBusSubscriber public class LodConfig { - // save the config file when it is changed - @Mod.EventBusSubscriber(modid = Reference.MOD_ID) - private static class EventHandler + public static final LodConfig.Common COMMON; + public static final ForgeConfigSpec COMMON_SPEC; + + // create the required variables + static + { + final Pair specPair = new ForgeConfigSpec.Builder().configure(LodConfig.Common::new); + COMMON_SPEC = specPair.getRight(); + COMMON = specPair.getLeft(); + } + + + public static class Common { - @SubscribeEvent - public static void onConfigChanged(final ConfigChangedEvent.OnConfigChangedEvent event) + public ForgeConfigSpec.BooleanValue drawLODs; + + public ForgeConfigSpec.EnumValue fogDistance; + + public ForgeConfigSpec.BooleanValue drawCheckerBoard; + + + Common(ForgeConfigSpec.Builder builder) { - if (event.getModID().equals(Reference.MOD_ID)) - { - ConfigManager.sync(Reference.MOD_ID, Config.Type.INSTANCE); - } - } + builder.comment(ModInfo.MODNAME + " configuration settings").push("common"); + + drawLODs = builder + .comment("If true LODs will be drawn, if false LODs will " + + "not be rendered. However they will " + + "still be generated.") + .define("drawLODs", true); + + fogDistance = builder + .comment("At what distance should Fog be drawn on the LODs?") + .defineEnum("fogDistance", FogDistance.NEAR_AND_FAR); + + drawCheckerBoard = builder + .comment("If false the LODs will draw with their normal world colors. " + + "If true they will draw as a black and white checkerboard. " + + "This can be used for debugging or imagining you are playing a " + + "giant game of chess ;)") + .define("drawCheckerBoard", false); + + builder.pop(); + } } - - @Config.Comment( - {"Enable LODs", - "If true LODs will be drawn, if false LODs will " - + "not be rendered. However they will " - + "still be generated and stored in your world's save folder."}) - public static boolean drawLODs = true; - - @Config.Comment( - {"Fog Distance", - "What distance should Fog be drawn on the LODs?"}) - public static FogDistance fogDistance = FogDistance.NEAR_AND_FAR; - - @Config.Comment( - {"Draw Debugging Checkerboard", - "If false the LODs will draw with their normal world colors." - + "If true they will draw as a black and white checkerboard." - + "This can be used for debugging or imagining you are playing a " - + "giant game of chess ;)"}) - public static boolean drawCheckerBoard = false; - - } diff --git a/src/main/java/com/backsun/lod/util/LodFileHandler.java b/src/main/java/com/backsun/lod/util/LodFileHandler.java index 0f2e07ed6..392756097 100644 --- a/src/main/java/com/backsun/lod/util/LodFileHandler.java +++ b/src/main/java/com/backsun/lod/util/LodFileHandler.java @@ -13,7 +13,6 @@ import com.backsun.lod.objects.LodDimension; import com.backsun.lod.objects.LodRegion; import net.minecraft.client.Minecraft; -import net.minecraft.world.storage.ISaveHandler; /** * This object handles creating LodRegions @@ -25,34 +24,25 @@ import net.minecraft.world.storage.ISaveHandler; */ public class LodFileHandler { + // TODO this object needs to be changed to use NBT data instead of writing to files + private static final boolean IMPLEMENTED = false; + + private Minecraft mc = Minecraft.getInstance(); + private LodDimension loadedRegion = null; public long regionLastWriteTime[][]; - // String s = Minecraft.getMinecraftDir().getCanonicalPath() + "/saves/" + world.getSaveHandler().getSaveDirectoryName() + "/data/AA/World" + world.provider.dimensionId + ".dat"; - private String save_dir; - public ISaveHandler saveHandler; - - private final String FILE_NAME_PREFIX = "lod"; - private final String FILE_EXTENSION = ".txt"; - - private ExecutorService fileWritingThreadPool = Executors.newFixedThreadPool(1); - /** Is true if the readyToReadAndWrite is false */ - private boolean waitingToSaveRegions = false; + private ExecutorService fileWritingThreadPool = Executors.newSingleThreadExecutor(); - public LodFileHandler(ISaveHandler newSaveHandler, LodDimension newLoadedRegion) + public LodFileHandler(LodDimension newLoadedRegion) { - saveHandler = newSaveHandler; - loadedRegion = newLoadedRegion; // these two variable are used in sync with the LodDimension regionLastWriteTime = new long[loadedRegion.getWidth()][loadedRegion.getWidth()]; for(int i = 0; i < loadedRegion.getWidth(); i++) for(int j = 0; j < loadedRegion.getWidth(); j++) regionLastWriteTime[i][j] = -1; - - if (saveHandler != null && saveHandler.getWorldDirectory() != null) - save_dir = getWorldSaveDirectory(); } @@ -71,15 +61,15 @@ public class LodFileHandler */ public LodRegion loadRegionFromFile(int regionX, int regionZ) { + if (!IMPLEMENTED) + return null; + // we don't currently support reading or writing // files when connected to a server - if (!Minecraft.getMinecraft().isIntegratedServerRunning()) + if (!mc.isIntegratedServerRunning()) return null; - if (!readyToReadAndWrite()) - return null; - - String fileName = getFileNameForRegion(regionX, regionZ); + String fileName = ""; File f = new File(fileName); @@ -144,49 +134,13 @@ public class LodFileHandler public synchronized void saveDirtyRegionsToFile() { - // we don't currently support reading or writing - // files when connected to a server - if (!Minecraft.getMinecraft().isIntegratedServerRunning()) + if (!IMPLEMENTED) return; - if (!readyToReadAndWrite()) - { - // we aren't ready to read and write yet - if(!waitingToSaveRegions) - { - waitingToSaveRegions = true; - - // retry until we are able to read and write - // then wake up the fileWritingThreadPool - Thread retryReady = new Thread(() -> - { - try - { - // check once every so often so see - // if anything has changed so we can - // start reading and writing files - while(!readyToReadAndWrite()) - { - this.wait(1000); - // get the save handler again, if for some - // reason the original handler was null - saveHandler = Minecraft.getMinecraft().getIntegratedServer().getWorld(0).getSaveHandler(); - save_dir = getWorldSaveDirectory(); - } - - // we can start writing files now - fileWritingThreadPool.execute(saveDirtyRegionsThread); - waitingToSaveRegions = false; - } - catch (InterruptedException e) - { /* should never be called */} - }); - - retryReady.run(); - } - + // we don't currently support reading or writing + // files when connected to a server + if (!mc.isIntegratedServerRunning()) return; - } fileWritingThreadPool.execute(saveDirtyRegionsThread); } @@ -203,22 +157,21 @@ public class LodFileHandler } } } - - waitingToSaveRegions = false; }); private void saveRegionToDisk(LodRegion region) { - if (!readyToReadAndWrite() || region == null) + if (!IMPLEMENTED) return; - // convert chunk coordinates to region - // coordinates - int x = region.x; - int z = region.z; + if (region == null) + return; - File f = new File(getFileNameForRegion(x, z)); +// int x = region.x; +// int z = region.z; + + File f = new File(""); try { @@ -254,34 +207,6 @@ public class LodFileHandler //================// - /** - * Return the name of the file that should contain the - * region at the given x and z.
- * Returns null if this object isn't ready to read and write. - * @param regionX - * @param regionZ - */ - private String getFileNameForRegion(int regionX, int regionZ) - { - if (!readyToReadAndWrite()) - return null; - - return save_dir + "\\lod_data\\DIM" + loadedRegion.dimension.getId() + "\\" + - FILE_NAME_PREFIX + "." + regionX + "." + regionZ + FILE_EXTENSION; - } - - - /** - * Returns if this FileHandler is ready to read - * and write files. - */ - public boolean readyToReadAndWrite() - { - return saveHandler != null && saveHandler.getWorldDirectory() != null && - save_dir != null && !save_dir.isEmpty(); - } - - /** @@ -291,11 +216,11 @@ public class LodFileHandler */ public static String getWorldName() { - Minecraft mc = Minecraft.getMinecraft(); + Minecraft mc = Minecraft.getInstance(); if(mc.isIntegratedServerRunning()) { - return mc.getIntegratedServer().getWorldName(); + return mc.getIntegratedServer().getName(); } else { @@ -304,19 +229,4 @@ public class LodFileHandler } - - /** - * Returns null if there was an IO Exception - */ - private String getWorldSaveDirectory() - { - try - { - return saveHandler.getWorldDirectory().getCanonicalPath(); - } - catch (IOException e) - { - return null; - } - } } diff --git a/src/main/java/com/backsun/lod/util/ReflectionHandler.java b/src/main/java/com/backsun/lod/util/ReflectionHandler.java index 992482bc0..76026d845 100644 --- a/src/main/java/com/backsun/lod/util/ReflectionHandler.java +++ b/src/main/java/com/backsun/lod/util/ReflectionHandler.java @@ -1,9 +1,6 @@ package com.backsun.lod.util; import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.Parameter; import com.backsun.lod.util.enums.FogQuality; @@ -14,97 +11,27 @@ import net.minecraft.client.Minecraft; * where they are private. * * @author James Seibel - * @version 09-21-2020 + * @version 02-18-2021 */ public class ReflectionHandler { - public Method fovMethod = null; + private Minecraft mc = Minecraft.getInstance(); + public Field ofFogField = null; public ReflectionHandler() { - setupFovMethod(); setupFogField(); } - - - - /** - * This sets the "getFOVModifier" method from the - * minecraft "EntityRenderer" class, so that we can get - * the FOV of the player at any time. - * - * This is required since Minecraft is obfuscated so - * we can't just look for 'getFOVModifier' - * we have to search for it based on its parameters and - * return type; which luckily are unique in the EntityRenderer - * class. - */ - private void setupFovMethod() - { - // get every method from the entity renderer - Method[] methods = Minecraft.getMinecraft().entityRenderer.getClass().getDeclaredMethods(); - - Class returnType; - Parameter[] params; - Method returnMethod = null; - - for(Method m : methods) - { - returnType = m.getReturnType(); - params = m.getParameters(); - - // see if this method has the same return type - // and parameters as the 'getFOVModifier' method. - if (returnType.equals(float.class) && - params.length == 2 && - params[0].getType().equals(float.class) && - params[1].getType().equals(boolean.class)) - { - - // only accept the first method that we find - if (returnMethod == null) - { - returnMethod = m; - } - else - { - // we found a second method that matches the - // outline we were looking for, - // to prevent unexpected behavior - // dont't set fovMethod. - - // Since we aren't sure that - // this method is the right - // one, we may accidently mess - // up the entityRender by invoking - // it and we probably wouldn't get - // the FOV from it anyway. - - System.err.println("Error: a second method that matches the parameters and return typ of 'getFOVModifier' was found, LODs won't be rendered."); - - return; - } - } - } - - // only set the method once we have gone through - // the whole array of methods, just to - // make sure we have the right one. - fovMethod = returnMethod; - // set up the method so we can invoke it later - fovMethod.setAccessible(true); - } - /** * Similar to setupFovMethod. */ private void setupFogField() { // get every variable from the entity renderer - Field[] vars = Minecraft.getMinecraft().gameSettings.getClass().getDeclaredFields(); + Field[] vars = mc.gameSettings.getClass().getDeclaredFields(); // try and find the ofFogType variable in gameSettings for(Field f : vars) @@ -143,7 +70,7 @@ public class ReflectionHandler try { - returnNum = (int)ofFogField.get(Minecraft.getMinecraft().gameSettings); + returnNum = (int)ofFogField.get(mc.gameSettings); } catch (IllegalArgumentException | IllegalAccessException e) { @@ -166,22 +93,4 @@ public class ReflectionHandler } } - - /** - * Gets the FOV used by the EntityRender. - */ - public float getFov(Minecraft mc, float partialTicks, boolean useFovSetting) - { - try - { - return (float)fovMethod.invoke(mc.entityRenderer, new Object[]{partialTicks, useFovSetting}); - } - catch(InvocationTargetException | IllegalAccessException | IllegalArgumentException e) - { - e.printStackTrace(); - } - - return 0.0f; - } - } diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg new file mode 100644 index 000000000..c0aa56039 --- /dev/null +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -0,0 +1,36 @@ +# Note: to update code in eclipse run the "eclipse" commad in graldew + + +# make public the method getFOVModifier +public net.minecraft.client.renderer.GameRenderer func_215311_a(Lnet/minecraft/client/renderer/ActiveRenderInfo;FZ)D # getFOVModifier + +# make public the byteBuffer in BufferBuilder +public net.minecraft.client.renderer.BufferBuilder field_179001_a # byteBuffer + +# make public the cameraZoom in the GameRenderer +public net.minecraft.client.renderer.GameRenderer field_78503_V # cameraZoom + +# make public the cameraYaw in the GameRenderer +public net.minecraft.client.renderer.GameRenderer field_228376_w_ # cameraYaw + +# make public the cameraPitch in the GameRenderer +public net.minecraft.client.renderer.GameRenderer field_228377_x_ # cameraPitch + + +#=====================# +# Examples from Forge # +#=====================# + +# Makes public the IScreenFactory class in ScreenManager +public net.minecraft.client.gui.ScreenManager$IScreenFactory + +# Makes protected and removes the final modifier from 'random' in MinecraftServer +protected-f net.minecraft.server.MinecraftServer field_147146_q #random + +# Makes public the 'createNamedService' method in Util, +# accepting a String and returns an ExecutorService +public net.minecraft.util.Util func_240979_a_(Ljava/lang/String;)Ljava/util/concurrent/ExecutorService; #createNamedService + +# Makes public the 'func_239776_a_' method in UUIDCodec, +# accepting two longs and returning an int[] +public net.minecraft.util.UUIDCodec func_239776_a_(JJ)[I #func_239776_a_ \ No newline at end of file diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml new file mode 100644 index 000000000..851bbcdac --- /dev/null +++ b/src/main/resources/META-INF/mods.toml @@ -0,0 +1,40 @@ +# This is an example mods.toml file. It contains the data relating to the loading mods. +# There are several mandatory fields (#mandatory), and many more that are optional (#optional). +# The overall format is standard TOML format, v0.5.0. +# Note that there are a couple of TOML lists in this file. +# Find more information on toml format here: https://github.com/toml-lang/toml +# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml +modLoader="javafml" #mandatory +# A version range to match for said mod loader - for regular FML @Mod it will be the forge version +loaderVersion="[35,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. +# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties. +# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here. +license="All rights reserved" +# A URL to refer people to when problems occur with this mod +#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional +# A list of mods - how many allowed here is determined by the individual mod loader +[[mods]] #mandatory +# The modid of the mod +modId="lod" #mandatory +# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it +# ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata +# see the associated build.gradle script for how to populate this completely automatically during a build +version="${file.jarVersion}" #mandatory + # A display name for the mod +displayName="Levels of Detail" #mandatory +# A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/ +#updateJSONURL="https://change.me.example.invalid/updates.json" #optional +# A URL for the "homepage" for this mod, displayed in the mod UI +#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional +# A file name (in the root of the mod JAR) containing a logo for display +#logoFile="examplemod.png" #optional + +# A text field displayed in the mod UI +#credits="" #optional + +# A text field displayed in the mod UI +authors="James Seibel" #optional +# The description text for the mod (multi line!) (#mandatory) +description=''' + +''' \ No newline at end of file diff --git a/src/main/resources/lod.mixins.json b/src/main/resources/lod.mixins.json new file mode 100644 index 000000000..88bb68f1b --- /dev/null +++ b/src/main/resources/lod.mixins.json @@ -0,0 +1,11 @@ +{ + "required": true, + "package": "com.backsun.lod.mixin", + "compatibilityLevel": "JAVA_8", + "refmap": "lod.refmap.json", + "mixins": [ + "MixinItemEntity", + "MixinWorldRenderer" + ], + "minVersion": "0.8" +} \ No newline at end of file diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index a18922536..9a3715271 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -4,13 +4,13 @@ "name": "Level Of Details", "description": "Generates and renders simplified chunks beyond the normal view distance, at a low performance cost.", "version": "0.1", - "mcversion": "1.12.2", + "mcversion": "1.16.4", "url": "", "updateUrl": "", "authorList": ["James Seibel"], "credits": "TechnoVision and Vike for their modding tutorials.", "logoFile": "", "screenshots": [], - "dependencies": ["lodcore"] + "dependencies": [] } ] diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index 401826761..c79a3626c 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,7 +1,7 @@ { "pack": { "description": "examplemod resources", - "pack_format": 3, - "_comment": "A pack_format of 3 should be used starting with Minecraft 1.11. All resources, including language files, should be lowercase (eg: en_us.lang). A pack_format of 2 will load your mod resources with LegacyV2Adapter, which requires language files to have uppercase letters (eg: en_US.lang)." + "pack_format": 6, + "_comment": "A pack_format of 6 requires json lang files and some texture changes from 1.16.2. Note: we require v6 pack meta for all mods." } }