diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 550b373..0000000 --- a/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -# gradle - -.gradle/ -build/ -out/ -classes/ - -# eclipse - -*.launch - -# idea - -.idea/ -*.iml -*.ipr -*.iws - -# vscode - -.settings/ -.vscode/ -bin/ -.classpath -.project - -# fabric - -run/ diff --git a/README.md b/README.md index fd96346..4adb0fd 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,4 @@ -# Fabric Example Mod +# Lag Remover -## Setup - -For setup instructions please see the [fabric wiki page](https://fabricmc.net/wiki/tutorial:setup) that relates to the IDE that you are using. - -## License - -This template is available under the CC0 license. Feel free to learn from it and incorporate it in your own projects. +## 用途 +用于修复Minecraft在主线程获取头颅皮肤导致Minecraft卡死5秒的Bug。不确定在其他国家也有这个问题。 \ No newline at end of file diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 8d86f6d..0000000 --- a/build.gradle +++ /dev/null @@ -1,77 +0,0 @@ -plugins { - id 'fabric-loom' version '0.2.7-SNAPSHOT' - id 'maven-publish' -} - -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 - -archivesBaseName = project.archives_base_name -version = project.mod_version -group = project.maven_group - -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}" - - // Fabric API. This is technically optional, but you probably want it anyway. - modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - - // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs. - // You may need to force-disable transitiveness on them. -} - -processResources { - inputs.property "version", project.version - - from(sourceSets.main.resources.srcDirs) { - include "fabric.mod.json" - expand "version": project.version - } - - from(sourceSets.main.resources.srcDirs) { - exclude "fabric.mod.json" - } -} - -// ensure that the encoding is set to UTF-8, no matter what the system default is -// this fixes some edge cases with special characters not displaying correctly -// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html -tasks.withType(JavaCompile) { - options.encoding = "UTF-8" -} - -// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task -// if it is present. -// If you remove this task, sources will not be generated. -task sourcesJar(type: Jar, dependsOn: classes) { - classifier = "sources" - from sourceSets.main.allSource -} - -jar { - from "LICENSE" -} - -// configure the maven publication -publishing { - publications { - mavenJava(MavenPublication) { - // add all the jars that should be included when publishing to maven - artifact(remapJar) { - builtBy remapJar - } - artifact(sourcesJar) { - builtBy remapSourcesJar - } - } - } - - // select the repositories you want to publish to - repositories { - // uncomment to publish to the local maven - // mavenLocal() - } -} diff --git a/gradle.properties b/gradle.properties index 563fe65..f5c558b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,14 +4,15 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use minecraft_version=1.15.2 - yarn_mappings=1.15.2+build.15 - loader_version=0.8.2+build.194 + yarn_mappings=1.15.2+build.14 + loader_version=0.7.8+build.184 # Mod Properties mod_version = 1.0.0 - maven_group = net.fabricmc - archives_base_name = fabric-example-mod + maven_group = tv.calibur + archives_base_name = LagRemover # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api - fabric_version=0.5.1+build.294-1.15 + fabric_version=0.4.32+build.292-1.15 + \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index f3d88b1..5c2d1cf 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 a4b4429..4a6ebce 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew old mode 100755 new mode 100644 index 2fe81a7..8e25e6c --- a/gradlew +++ b/gradlew @@ -125,8 +125,8 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` @@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then else eval `echo args$i`="\"$arg\"" fi - i=`expr $i + 1` + i=$((i+1)) done case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi @@ -175,9 +175,14 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=`save "$@"` +APP_ARGS=$(save "$@") # 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 62bd9b9..9618d8d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -29,9 +29,6 @@ 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" diff --git a/src/main/java/net/fabricmc/example/ExampleMod.java b/src/main/java/net/fabricmc/example/ExampleMod.java deleted file mode 100644 index e5ed082..0000000 --- a/src/main/java/net/fabricmc/example/ExampleMod.java +++ /dev/null @@ -1,14 +0,0 @@ -package net.fabricmc.example; - -import net.fabricmc.api.ModInitializer; - -public class ExampleMod implements ModInitializer { - @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. - - System.out.println("Hello Fabric world!"); - } -} diff --git a/src/main/java/net/fabricmc/example/mixin/ExampleMixin.java b/src/main/java/net/fabricmc/example/mixin/ExampleMixin.java deleted file mode 100644 index 83ee1a8..0000000 --- a/src/main/java/net/fabricmc/example/mixin/ExampleMixin.java +++ /dev/null @@ -1,15 +0,0 @@ -package net.fabricmc.example.mixin; - -import net.minecraft.client.gui.screen.TitleScreen; -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; - -@Mixin(TitleScreen.class) -public class ExampleMixin { - @Inject(at = @At("HEAD"), method = "init()V") - private void init(CallbackInfo info) { - System.out.println("This line is printed by an example mod mixin!"); - } -} diff --git a/src/main/java/tv/calibur/lagremover/Main.java b/src/main/java/tv/calibur/lagremover/Main.java new file mode 100644 index 0000000..cb71839 --- /dev/null +++ b/src/main/java/tv/calibur/lagremover/Main.java @@ -0,0 +1,10 @@ +package tv.calibur.lagremover; + +import net.fabricmc.api.ModInitializer; + +public class Main implements ModInitializer { + @Override + public void onInitialize() { + System.out.println("Loaded"); + } +} diff --git a/src/main/java/tv/calibur/lagremover/mixin/Remover.java b/src/main/java/tv/calibur/lagremover/mixin/Remover.java new file mode 100644 index 0000000..bb4f023 --- /dev/null +++ b/src/main/java/tv/calibur/lagremover/mixin/Remover.java @@ -0,0 +1,15 @@ +package tv.calibur.lagremover.mixin; + +import com.mojang.authlib.GameProfile; +import net.minecraft.block.entity.SkullBlockEntity; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; + +@Mixin(value = SkullBlockEntity.class) +public class Remover { + @Overwrite + public static GameProfile loadProperties(GameProfile profile) { + System.out.println("Skipping Load Skull Skin"); + return profile; + } +} diff --git a/src/main/resources/modid.mixins.json b/src/main/resources/LagRemover.mixins.json similarity index 72% rename from src/main/resources/modid.mixins.json rename to src/main/resources/LagRemover.mixins.json index 21fe73a..b3e43d2 100644 --- a/src/main/resources/modid.mixins.json +++ b/src/main/resources/LagRemover.mixins.json @@ -1,12 +1,12 @@ { "required": true, "minVersion": "0.8", - "package": "net.fabricmc.example.mixin", + "package": "tv.calibur.lagremover.mixin", "compatibilityLevel": "JAVA_8", "mixins": [ ], "client": [ - "ExampleMixin" + "Remover" ], "injectors": { "defaultRequire": 1 diff --git a/src/main/resources/assets/calibur/calibur.png b/src/main/resources/assets/calibur/calibur.png new file mode 100644 index 0000000..d3cc500 Binary files /dev/null and b/src/main/resources/assets/calibur/calibur.png differ diff --git a/src/main/resources/assets/modid/icon.png b/src/main/resources/assets/modid/icon.png deleted file mode 100644 index 047b91f..0000000 Binary files a/src/main/resources/assets/modid/icon.png and /dev/null differ diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 197c798..272fed3 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,34 +1,36 @@ { "schemaVersion": 1, - "id": "modid", - "version": "${version}", + "id": "lagremover", + "version": "1.0.0", - "name": "Example Mod", - "description": "This is an example description! Tell everyone what your mod is about!", + "name": "Lag Remover", + "description": "Remove the lag caused by the player's head block.", "authors": [ - "Me!" + "Margele" ], "contact": { - "homepage": "https://fabricmc.net/", - "sources": "https://github.com/FabricMC/fabric-example-mod" + "homepage": "https://github.com/Calibur-Pixel", + "source": "https://github.com/Calibur-Pixel/LagRemover", + "issues": "https://github.com/Calibur-Pixel/LagRemover/issues" }, "license": "CC0-1.0", - "icon": "assets/modid/icon.png", + "icon": "assets/calibur/calibur.png", - "environment": "*", + "environment": "client", "entrypoints": { "main": [ - "net.fabricmc.example.ExampleMod" + "tv.calibur.lagremover.Main" ] }, "mixins": [ - "modid.mixins.json" + "LagRemover.mixins.json" ], - + "custom": { + "modmenu:clientsideOnly": true + }, "depends": { "fabricloader": ">=0.7.4", - "fabric": "*", "minecraft": "1.15.x" }, "suggests": {