From 01dbe1f31253353b303396dfd0677a905777a6fc Mon Sep 17 00:00:00 2001 From: AbdElAziz333 <89092953+AbdElAziz333@users.noreply.github.com> Date: Mon, 13 Jun 2022 09:28:40 +0200 Subject: [PATCH 01/10] x1.19 forge port --- build.gradle | 94 ++++----- gradle.properties | 21 ++- gradlew | 10 +- gradlew.bat | 178 +++++++++--------- settings.gradle | 10 +- .../com/abdelaziz333/fastload/FastLoad.java | 10 + .../mixin/DownloadingTerrainScreenMixin.java | 23 +++ .../fastload/mixin/MinecraftClientMixin.java | 55 ++++++ .../fastload/mixin/MinecraftServerMixin.java | 21 +++ .../WorldGenerationProcessLoggerMixin.java | 14 ++ .../WorldGenerationProgressTrackerMixin.java | 12 ++ .../resources/META-INF/accesstransformer.cfg | 0 src/main/resources/META-INF/mods.toml | 32 ++++ src/main/resources/fastload.mixins.json | 2 +- src/main/resources/icon.png | Bin 0 -> 4527 bytes src/main/resources/pack.mcmeta | 7 + 16 files changed, 337 insertions(+), 152 deletions(-) create mode 100644 src/main/java/com/abdelaziz333/fastload/FastLoad.java create mode 100644 src/main/java/com/abdelaziz333/fastload/mixin/DownloadingTerrainScreenMixin.java create mode 100644 src/main/java/com/abdelaziz333/fastload/mixin/MinecraftClientMixin.java create mode 100644 src/main/java/com/abdelaziz333/fastload/mixin/MinecraftServerMixin.java create mode 100644 src/main/java/com/abdelaziz333/fastload/mixin/WorldGenerationProcessLoggerMixin.java create mode 100644 src/main/java/com/abdelaziz333/fastload/mixin/WorldGenerationProgressTrackerMixin.java create mode 100644 src/main/resources/META-INF/accesstransformer.cfg create mode 100644 src/main/resources/META-INF/mods.toml create mode 100644 src/main/resources/icon.png create mode 100644 src/main/resources/pack.mcmeta diff --git a/build.gradle b/build.gradle index 1faecea5..74473122 100644 --- a/build.gradle +++ b/build.gradle @@ -1,70 +1,78 @@ plugins { - id 'fabric-loom' version '0.12-SNAPSHOT' - id 'maven-publish' + id "dev.architectury.loom" version "0.12.0-SNAPSHOT" + id "maven-publish" } -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 +sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17 archivesBaseName = project.archives_base_name version = project.mod_version group = project.maven_group -repositories { - // Add repositories to retrieve artifacts from in here. - // You should only use this when depending on other mods because - // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. - // See https://docs.gradle.org/current/userguide/declaring_repositories.html - // for more information about repositories. +loom { + forge { + mixinConfigs = [ + "fastload.mixins.json" + ] + } + + launches { + data { + arg "--existing", file("src/main/resources").absolutePath + } + } } -dependencies { - // To change the versions see the gradle.properties file - minecraft "com.mojang:minecraft:${project.minecraft_version}" - mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" - modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" +repositories {} +dependencies { + minecraft "com.mojang:minecraft:${project.minecraft_version}" + mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" + forge "net.minecraftforge:forge:${project.forge_version}" } processResources { - inputs.property "version", project.version + inputs.property "version", project.version - filesMatching("fabric.mod.json") { - expand "version": project.version - } + filesMatching("META-INF/mods.toml") { + expand "version": project.version + } } -tasks.withType(JavaCompile).configureEach { - // Minecraft 1.18 (1.18-pre2) upwards uses Java 17. - it.options.release = 17 +tasks.withType(JavaCompile) { + options.encoding = "UTF-8" + options.release = 17 } java { - // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task - // if it is present. - // If you remove this line, sources will not be generated. - withSourcesJar() + withSourcesJar() } jar { - from("LICENSE") { - rename { "${it}_${project.archivesBaseName}"} - } + manifest { + attributes([ + "Specification-Title" : project.mod_id, + "Specification-Vendor" : project.mod_author, + "Specification-Version" : "1", + "Implementation-Title" : project.name, + "Implementation-Version" : version, + "Implementation-Vendor" : project.mod_author, + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") + ]) + } } -// configure the maven publication publishing { - publications { - mavenJava(MavenPublication) { - from components.java - } - } + publications { + mavenJava(MavenPublication) { + artifact(remapJar) { + builtBy remapJar + } + artifact(sourcesJar) { + builtBy remapSourcesJar + } + } + } - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. - repositories { - // Add repositories to publish to here. - // Notice: This block does NOT have the same function as the block in the top level. - // The repositories here will be used for publishing your artifact, not for - // retrieving dependencies. - } -} + repositories {} +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 89a17e0a..4613c42c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,12 +1,17 @@ -# Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx1G +loom.platform=forge -# Fabric Properties - minecraft_version=1.19 - yarn_mappings=1.19+build.2 - loader_version=0.14.7 +# Base properties + # minecraft version + minecraft_version=1.19 + # forge version, latest version can be found on https://files.minecraftforge.net/ + forge_version=1.19-41.0.16 + # yarn, latest version can be found on https://fabricmc.net/use + yarn_mappings=1.19+build.2 # Mod Properties - mod_version = 1.0.5+1.19 - maven_group = io.github.bumblesoftware.fastload - archives_base_name = Fastload + mod_version=1.0.0 + maven_group=com.abdelaziz333.fastload + archives_base_name=fastload-mc1.19 + mod_id=fastload + mod_author=AbdElAziz333 \ No newline at end of file diff --git a/gradlew b/gradlew index c53aefaa..1b6c7873 100644 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,10 +32,10 @@ # Busybox and similar reduced shells will NOT work, because this script # requires all of these POSIX shell features: # * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». # # Important for patching: # diff --git a/gradlew.bat b/gradlew.bat index 107acd32..ac1b06f9 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,89 +1,89 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@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="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@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="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle b/settings.gradle index b02216ba..34687d03 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,10 +1,8 @@ pluginManagement { repositories { - maven { - name = 'Fabric' - url = 'https://maven.fabricmc.net/' - } - mavenCentral() + maven { url "https://maven.fabricmc.net/" } + maven { url "https://maven.architectury.dev/" } + maven { url "https://files.minecraftforge.net/maven/" } gradlePluginPortal() } -} +} \ No newline at end of file diff --git a/src/main/java/com/abdelaziz333/fastload/FastLoad.java b/src/main/java/com/abdelaziz333/fastload/FastLoad.java new file mode 100644 index 00000000..91ca621a --- /dev/null +++ b/src/main/java/com/abdelaziz333/fastload/FastLoad.java @@ -0,0 +1,10 @@ +package com.abdelaziz333.fastload; + +import net.minecraftforge.fml.common.Mod; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@Mod("fastload") +public class FastLoad { + public static final Logger LOGGER = LoggerFactory.getLogger("Fastload"); +} \ No newline at end of file diff --git a/src/main/java/com/abdelaziz333/fastload/mixin/DownloadingTerrainScreenMixin.java b/src/main/java/com/abdelaziz333/fastload/mixin/DownloadingTerrainScreenMixin.java new file mode 100644 index 00000000..b9a5852b --- /dev/null +++ b/src/main/java/com/abdelaziz333/fastload/mixin/DownloadingTerrainScreenMixin.java @@ -0,0 +1,23 @@ +package com.abdelaziz333.fastload.mixin; + +import net.minecraft.client.gui.screen.DownloadingTerrainScreen; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + + +@Mixin(DownloadingTerrainScreen.class) +public class DownloadingTerrainScreenMixin { + + //Code is from 'kennytv'. All credits are to this person. This is not our code. + //Permission granted to do so from MIT License of 'forcecloseloadingscreen'. + + @Shadow private boolean closeOnNextTick; + + @Inject(at = @At("HEAD"), method = "setReady") + public void tick(final CallbackInfo ci) { + this.closeOnNextTick = true; + } +} diff --git a/src/main/java/com/abdelaziz333/fastload/mixin/MinecraftClientMixin.java b/src/main/java/com/abdelaziz333/fastload/mixin/MinecraftClientMixin.java new file mode 100644 index 00000000..0fb8f048 --- /dev/null +++ b/src/main/java/com/abdelaziz333/fastload/mixin/MinecraftClientMixin.java @@ -0,0 +1,55 @@ +package com.abdelaziz333.fastload.mixin; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.screen.DownloadingTerrainScreen; +import net.minecraft.client.gui.screen.Screen; +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(MinecraftClient.class) +public abstract class MinecraftClientMixin { + //Original code is from 'kennytv, forceloadingscreen'. Code is modified to our needs. + @Shadow + public void setScreen(@Nullable Screen screen) {} + @Inject(method = "setScreen", at = @At("HEAD"), cancellable = true) + private void setScreen(final Screen screen, final CallbackInfo ci) { + if (screen instanceof DownloadingTerrainScreen) { + render(true); + ci.cancel(); + setScreen(null); + justLoaded = true; + } + } + + @Shadow + private void render(boolean tick) {} + + @Shadow + public boolean skipGameRender; + + @Shadow private boolean windowFocused; + + @Inject(method = "render", at = @At("HEAD")) + private void setSkipGameRender(boolean tick, CallbackInfo ci) { + skipGameRender = false; + } + + private boolean justLoaded; + + @Shadow private volatile boolean running; + + @Inject(method = "openPauseMenu", at = @At("HEAD"), cancellable = true) + private void cancelOpenPauseMenu(boolean pause, CallbackInfo ci) { + if (windowFocused && justLoaded) { + justLoaded = false; + } + else if (!windowFocused && running && justLoaded) { + ci.cancel(); + justLoaded = false; + } + } +} \ No newline at end of file diff --git a/src/main/java/com/abdelaziz333/fastload/mixin/MinecraftServerMixin.java b/src/main/java/com/abdelaziz333/fastload/mixin/MinecraftServerMixin.java new file mode 100644 index 00000000..d271bd9e --- /dev/null +++ b/src/main/java/com/abdelaziz333/fastload/mixin/MinecraftServerMixin.java @@ -0,0 +1,21 @@ +package com.abdelaziz333.fastload.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +import net.minecraft.server.MinecraftServer; + + +/* +* This code is inspired by: https://github.com/VidTu/Ksyxis of which it's under the MIT License. +* The BumbleSoftware team modified the code to make this possible. +*/ + +@Mixin(MinecraftServer.class) +public class MinecraftServerMixin { + @ModifyConstant(method = "prepareStartRegion", constant = @Constant(intValue = 441)) + public int onPrepareRedirectChunksLoaded(int value) { + return 49; + } +} diff --git a/src/main/java/com/abdelaziz333/fastload/mixin/WorldGenerationProcessLoggerMixin.java b/src/main/java/com/abdelaziz333/fastload/mixin/WorldGenerationProcessLoggerMixin.java new file mode 100644 index 00000000..018e18ac --- /dev/null +++ b/src/main/java/com/abdelaziz333/fastload/mixin/WorldGenerationProcessLoggerMixin.java @@ -0,0 +1,14 @@ +package com.abdelaziz333.fastload.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.*; + +import net.minecraft.server.WorldGenerationProgressLogger; + +@Mixin(WorldGenerationProgressLogger.class) +public class WorldGenerationProcessLoggerMixin { + @ModifyVariable(method = "", at = @At("HEAD"), argsOnly = true) + private static int injected(int radius){ + return 3; + } +} diff --git a/src/main/java/com/abdelaziz333/fastload/mixin/WorldGenerationProgressTrackerMixin.java b/src/main/java/com/abdelaziz333/fastload/mixin/WorldGenerationProgressTrackerMixin.java new file mode 100644 index 00000000..c42a8f41 --- /dev/null +++ b/src/main/java/com/abdelaziz333/fastload/mixin/WorldGenerationProgressTrackerMixin.java @@ -0,0 +1,12 @@ +package com.abdelaziz333.fastload.mixin; + +import net.minecraft.client.gui.WorldGenerationProgressTracker; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.ModifyVariable; + +@Mixin(WorldGenerationProgressTracker.class) +public class WorldGenerationProgressTrackerMixin { + @ModifyVariable(method = "", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/WorldGenerationProgressLogger;(I)V"), argsOnly = true) + public int getRadius(int radius) {return 3;} +} diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg new file mode 100644 index 00000000..e69de29b diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml new file mode 100644 index 00000000..ae96549a --- /dev/null +++ b/src/main/resources/META-INF/mods.toml @@ -0,0 +1,32 @@ +modLoader = "javafml" +loaderVersion = "[40,)" +license = "All rights reserved" + +#issueTrackerURL="https://github.com/invalid/pleasechangeme/issues" + +[[mods]] +modId = "fastload" +version = "${version}" +displayName = "Fastload" +#updateJSONURL="https://changeme.dev/updates.json" +#displayURL="https://changeme.dev/" +logoFile="icon.png" +credits="overloadedwithmods" +authors="AbdElAziz333" +description = ''' +Fastload is a simple performance mod that reduces world loading time. +''' + +[[dependencies.fastload]] +modId = "forge" +mandatory = true +versionRange = "[40,)" +ordering = "NONE" +side = "BOTH" + +[[dependencies.fastload]] +modId = "minecraft" +mandatory = true +versionRange = "[1.18.2,)" +ordering = "NONE" +side = "BOTH" \ No newline at end of file diff --git a/src/main/resources/fastload.mixins.json b/src/main/resources/fastload.mixins.json index ba266255..bf3e8695 100644 --- a/src/main/resources/fastload.mixins.json +++ b/src/main/resources/fastload.mixins.json @@ -1,7 +1,7 @@ { "required": true, "minVersion": "0.8", - "package": "io.github.bumblesoftware.fastload.mixin", + "package": "com.abdelaziz333.fastload.mixin", "compatibilityLevel": "JAVA_17", "mixins": [ "DownloadingTerrainScreenMixin", diff --git a/src/main/resources/icon.png b/src/main/resources/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..0eb8c89d803aa95d39f92c4650fc6feaed3f0d93 GIT binary patch literal 4527 zcmb`L=Q|sY+r?wXiczI8LRGDzB^0q@l@1hDqc$;HiXir=*-Fq-vqq^|wW&}uNJ|=f z)Qa$>_TKa9?|*o%>pu6n&iiwn7oWEV`Z^#6ZUz7V0DAOL%jlnn|4($Z|2|IDuJ4~w zAdPf102M^um4AWSSzS*Z0H{u6Jh!9ym+3tpnj--KX59Zofqz|s007vu9%-o?`&(~h z26-AE`QpP+q_6l@$Mh3k=Dm2>-M$~{T8YRU=w|8< zKU!1feyUjLI?3g%oiI!<2mW475VVb|W}>865@j7oLa-Mx+kpJ%b`tDf<1)?%OHXi(8YEoR zv%Q6Q?sHR%Fw!}U zj5bBp5+?bA-0o6@yli2XzXid+rz&I)^D(&S&mEng(%aoj8*NaOXc9snYO;##+u^A5 zq6Ubz&iKB94R<(3C5+u!eI@eG_vaU%KAP`H6o`*6p zAQOD~< zS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_x+)o}f(=LkyG7}`)1i}pg) z!KcoxxB^?LigL)JhD#-ON|zF{(jZEoZk3z4!IQW;RRTCn6L8w9=?}hcDYut1Ib1;Y z?C8wpHDarKrGlcfxY;aSt*v3$w{bMZ zBxsU9=dh?CIaMMq4pI4;-*(@hwzvV3Yu1b%MsCza!@MXvk_rM(xJM%c{pVdHsd$6( zn*==F=hM{xRaZ~)R4(UPz9e+Sl`&~sS9-^Y!N|5_5urJPoiIRQ^8OqC+DVm3P?xHhr(FMNT#*P0rOne@YV z^itag#VT*ka|p1{?;0g+rAfg~a-ST#NettvzxYFiS8bq{q-$3qNuxtDFfO?Gt7I9U zng&wzw&NqH<;B(Xk55UtYD53wLz~)d|gxhg9htj zolpSYO$mSrz+>9$jch$m&;c-^x&QzG literal 0 HcmV?d00001 diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta new file mode 100644 index 00000000..18e8affd --- /dev/null +++ b/src/main/resources/pack.mcmeta @@ -0,0 +1,7 @@ +{ + "pack": { + "description": "Resources for fastload", + "pack_format": 8, + "_comment": "pack_format 8 is the current format for Minecraft 1.18.2. Be aware may have changed by the time you use this template!" + } +} From 30cd368f300c2eb70ad1d623e918918663d0cddc Mon Sep 17 00:00:00 2001 From: Fluffy Bumblebee <60066663+FluffyBumblebees@users.noreply.github.com> Date: Mon, 13 Jun 2022 19:32:17 +1000 Subject: [PATCH 02/10] Update gradle.properties --- gradle.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 4613c42c..8e4b0fb9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,8 +10,8 @@ loom.platform=forge yarn_mappings=1.19+build.2 # Mod Properties - mod_version=1.0.0 + mod_version=1.0.5+1.19 maven_group=com.abdelaziz333.fastload - archives_base_name=fastload-mc1.19 + archives_base_name=Fastload-Reforged mod_id=fastload - mod_author=AbdElAziz333 \ No newline at end of file + mod_author=AbdElAziz333 From 26505bcf109ff823ef927cd0819bc2ecb020916f Mon Sep 17 00:00:00 2001 From: Fluffy Bumblebee <60066663+FluffyBumblebees@users.noreply.github.com> Date: Mon, 13 Jun 2022 19:33:38 +1000 Subject: [PATCH 03/10] Update mods.toml --- src/main/resources/META-INF/mods.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index ae96549a..4382c870 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -2,7 +2,7 @@ modLoader = "javafml" loaderVersion = "[40,)" license = "All rights reserved" -#issueTrackerURL="https://github.com/invalid/pleasechangeme/issues" +#issueTrackerURL="https://github.com/BumbleSoftware/Fastload/issues" [[mods]] modId = "fastload" @@ -12,7 +12,7 @@ displayName = "Fastload" #displayURL="https://changeme.dev/" logoFile="icon.png" credits="overloadedwithmods" -authors="AbdElAziz333" +authors="AbdElAziz333, FluffyBumblebees, JoostMSoftware, VidTu, kennytv" description = ''' Fastload is a simple performance mod that reduces world loading time. ''' @@ -29,4 +29,4 @@ modId = "minecraft" mandatory = true versionRange = "[1.18.2,)" ordering = "NONE" -side = "BOTH" \ No newline at end of file +side = "BOTH" From 179805df49da3eaf60194cf6b8eafffcafd5d57a Mon Sep 17 00:00:00 2001 From: Fluffy Bumblebee <60066663+FluffyBumblebees@users.noreply.github.com> Date: Mon, 13 Jun 2022 19:34:11 +1000 Subject: [PATCH 04/10] Update pack.mcmeta --- src/main/resources/pack.mcmeta | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index 18e8affd..0e50ecd7 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,7 +1,7 @@ { "pack": { - "description": "Resources for fastload", + "description": "", "pack_format": 8, - "_comment": "pack_format 8 is the current format for Minecraft 1.18.2. Be aware may have changed by the time you use this template!" + "_comment": "" } } From ac2e969cd911cebb49d155e9a7d42ce548879219 Mon Sep 17 00:00:00 2001 From: Fluffy Bumblebee <60066663+FluffyBumblebees@users.noreply.github.com> Date: Mon, 13 Jun 2022 20:37:19 +1000 Subject: [PATCH 05/10] Update gradle.properties --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 8e4b0fb9..addd4608 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ loom.platform=forge yarn_mappings=1.19+build.2 # Mod Properties - mod_version=1.0.5+1.19 + mod_version=1.0.6+1.19 maven_group=com.abdelaziz333.fastload archives_base_name=Fastload-Reforged mod_id=fastload From ee8a6fdec6d4d3f6570ae2388dc142f4dcd5fdc2 Mon Sep 17 00:00:00 2001 From: Fluffy Bumblebee <60066663+FluffyBumblebees@users.noreply.github.com> Date: Mon, 13 Jun 2022 20:38:10 +1000 Subject: [PATCH 06/10] Delete FastLoad.java --- .../bumblesoftware/fastload/FastLoad.java | 20 ------------------- 1 file changed, 20 deletions(-) delete mode 100644 src/main/java/io/github/bumblesoftware/fastload/FastLoad.java diff --git a/src/main/java/io/github/bumblesoftware/fastload/FastLoad.java b/src/main/java/io/github/bumblesoftware/fastload/FastLoad.java deleted file mode 100644 index 7ed5e2fe..00000000 --- a/src/main/java/io/github/bumblesoftware/fastload/FastLoad.java +++ /dev/null @@ -1,20 +0,0 @@ -package io.github.bumblesoftware.fastload; - -import net.fabricmc.api.ModInitializer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class FastLoad implements ModInitializer { - // This logger is used to write text to the console and the log file. - // It is considered best practice to use your mod id as the logger's name. - // That way, it's clear which mod wrote info, warnings, and errors. - public static final Logger LOGGER = LoggerFactory.getLogger("Fastload"); - - @Override - public void onInitialize() { - // This code runs as soon as Minecraft is in a mod-load-ready state. - // However, some things (like resources) may still be uninitialized. - // Proceed with mild caution. - LOGGER.warn("Fastload may cause issues, report them to us instead of other mod authors"); - } -} From 471328e4f3fed612a9ab1a97eac158d2d13d1f02 Mon Sep 17 00:00:00 2001 From: Fluffy Bumblebee <60066663+FluffyBumblebees@users.noreply.github.com> Date: Mon, 13 Jun 2022 20:38:56 +1000 Subject: [PATCH 07/10] Update MinecraftClientMixin.java --- .../abdelaziz333/fastload/mixin/MinecraftClientMixin.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/abdelaziz333/fastload/mixin/MinecraftClientMixin.java b/src/main/java/com/abdelaziz333/fastload/mixin/MinecraftClientMixin.java index 0fb8f048..c482eb5c 100644 --- a/src/main/java/com/abdelaziz333/fastload/mixin/MinecraftClientMixin.java +++ b/src/main/java/com/abdelaziz333/fastload/mixin/MinecraftClientMixin.java @@ -27,6 +27,10 @@ private void setScreen(final Screen screen, final CallbackInfo ci) { @Shadow private void render(boolean tick) {} + @Inject(method = "startIntegratedServer", at = @At("HEAD")) + private void renderOnStartServer(CallbackInfo ci) { + render(true); + } @Shadow public boolean skipGameRender; @@ -52,4 +56,4 @@ else if (!windowFocused && running && justLoaded) { justLoaded = false; } } -} \ No newline at end of file +} From cdce26242a557bb1512cc3570f8e3dbcf0d428ff Mon Sep 17 00:00:00 2001 From: Fluffy Bumblebee <60066663+FluffyBumblebees@users.noreply.github.com> Date: Mon, 13 Jun 2022 22:18:15 +1000 Subject: [PATCH 08/10] Cure OCD --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 87c2a4a3..59cd8fc8 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,6 @@ Speed times: [All other elements are controlled!] Modrinth: https://modrinth.com/mod/fastload -Curseforge:https://www.curseforge.com/minecraft/mc-mods/fastload +Curseforge: https://www.curseforge.com/minecraft/mc-mods/fastload Discord: https://discord.gg/fMSnenNSXM From 95caac892b9f27485a4697f5e1070888916c37cd Mon Sep 17 00:00:00 2001 From: Fluffy Bumblebee <60066663+FluffyBumblebees@users.noreply.github.com> Date: Tue, 14 Jun 2022 01:53:08 +1000 Subject: [PATCH 09/10] deditated wam allokayted to my meinkwaft serwer --- README.md | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 59cd8fc8..1325fd46 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,32 @@ -# Fastload +# What the hell is 441 chunk loading and why is it important? +441 Chunk loading is essentially a generator for your world that loads 21^2 chunks (or 10 chunk-render-distance), Why does 10 turn into 21? 2 sides plus the one you are standing on, squared for 2 dimensions. -Fastload, is a simple mod that reduces world loading time. This serves as an alternative to ksyxis, which uses an unsafe method of cutting down time. +# Short explanation: +Fastload is a simple mod that reduces world loading time. This serves as an alternative to ksyxis and Forcecloseloadingscreen. -Credits for mods that are integrated: -- Ksyxis by VidTu (Incompatible) + +# Required by: +- Client +- Server +- ...& Will work on one but not the other but some features will be disabled. So use both if you want all the features! + + + +# Credits for mods that are integrated: +- Ksyxis by VidTu (Inompatible) - Forcecloseloadingscreen by kennytv (Incompatible) -- ...Respect to them for the ideas! +...Respect to them for the ideas! -How is it done? -The 441 loading engine is a chunk pre-generator for your worlds. This is very inefficient and wastes a lot of time. + -Here are its features: +# Here are its features: - Reducing 21^2 chunks to 5^2 - Permitting the rendering engine to run in the background whilst the world is still loading - Cancels 'Loading Terrain' for even quicker loading times. - Adjusts the visual chunk loading to be smaller and in sync with the smaller radius. -Speed times: [All other elements are controlled!] + +# Speed times: [All other elements are controlled!] - Vanilla: [ - Create New world: ~32 sec - Load World: ~5 sec @@ -26,8 +36,13 @@ Speed times: [All other elements are controlled!] - Load World: ~3 sec - ] -Modrinth: https://modrinth.com/mod/fastload +# How it works (In detail) (In comparison with integrated mods): +Ksyxis cancels 441 world loading by essentially telling the game "Hey, we're done!", which works on paper. But, it is a very unsafe method of loading and rather inefficient. It does this during chunk loading which is a big no-no in code. Not only does this cause potential crashes, and corruption, but it also makes it take longer to load in comparison to our way. Ksyxis doesn't even initialise at the beginning of 441, it does it after it is initialised! Which is just plain bad. But don't get angry at ksyxis yet! The developer of it issues a firm warning that it isn't stable and really shouldn't be used, which explains everything. + +We do this in a better, safer way by simply dialing down the number of chunks required to load before 441 initialises. This is fairly self-explanatory! To make world loading faster, we integrated yet another 'unstable' mod, Forcecloseloadingscreen. Like ksyxis, it also issues a firm warning of instability. How did we improve this? Just by initialising the pre-renderer earlier in the world initiation phase as well as preventing the 'Pause Menu' activating when not focused on the window until the real renderer initialised. Thus, fixing the bugs that mods brings in too! There's your technical explanation + +# Modrinth: https://modrinth.com/mod/fastload -Curseforge: https://www.curseforge.com/minecraft/mc-mods/fastload +# Curseforge: https://www.curseforge.com/minecraft/mc-mods/fastload -Discord: https://discord.gg/fMSnenNSXM +# Discord: https://discord.gg/fMSnenNSXM From 20d2577d85f761f20bb76d81f05d3dc582e1aa16 Mon Sep 17 00:00:00 2001 From: Fluffy Bumblebee <60066663+FluffyBumblebees@users.noreply.github.com> Date: Tue, 14 Jun 2022 01:56:15 +1000 Subject: [PATCH 10/10] wtf was I doing there? --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1325fd46..62f55237 100644 --- a/README.md +++ b/README.md @@ -41,8 +41,8 @@ Ksyxis cancels 441 world loading by essentially telling the game "Hey, we're don We do this in a better, safer way by simply dialing down the number of chunks required to load before 441 initialises. This is fairly self-explanatory! To make world loading faster, we integrated yet another 'unstable' mod, Forcecloseloadingscreen. Like ksyxis, it also issues a firm warning of instability. How did we improve this? Just by initialising the pre-renderer earlier in the world initiation phase as well as preventing the 'Pause Menu' activating when not focused on the window until the real renderer initialised. Thus, fixing the bugs that mods brings in too! There's your technical explanation -# Modrinth: https://modrinth.com/mod/fastload +Modrinth: https://modrinth.com/mod/fastload -# Curseforge: https://www.curseforge.com/minecraft/mc-mods/fastload +Curseforge: https://www.curseforge.com/minecraft/mc-mods/fastload -# Discord: https://discord.gg/fMSnenNSXM +Discord: https://discord.gg/fMSnenNSXM