From 3d23f397f75e5b159fb23cd3947c137be4712c79 Mon Sep 17 00:00:00 2001 From: TheWhiteDog9487 Date: Fri, 9 Aug 2024 16:08:50 +0800 Subject: [PATCH] =?UTF-8?q?0.3.1=20=E8=BF=99=E4=B8=AA=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E4=BC=9A=E5=87=BA1.21=E5=92=8C1.21.1?= =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E7=89=88=E6=9C=AC=E7=9A=84=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E3=80=82=20=E9=82=A3=E4=B8=AAModMenu=E5=86=85=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E5=90=8D=E5=AD=97=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98=E4=BF=AE=E6=8E=89=E4=BA=86?= =?UTF-8?q?=EF=BC=8C=E6=94=B9=E7=BF=BB=E8=AF=91=E9=94=AE=E6=B2=A1=E6=94=B9?= =?UTF-8?q?=E5=AE=8C=E5=AF=BC=E8=87=B4=E7=9A=84=E3=80=82=20=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E6=96=87=E4=BB=B6=E5=90=8D=E6=94=B9=E6=8E=89=E4=BA=86?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E7=84=B6=E4=B8=A4=E4=B8=AA=E4=B8=8D=E5=90=8C?= =?UTF-8?q?=E7=9A=84=E6=B8=B8=E6=88=8F=E7=89=88=E6=9C=AC=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E5=8F=91=E4=B8=80=E4=B8=AA=E6=A8=A1=E7=BB=84=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=B8=8D=E5=A5=BD=E5=BC=84=E3=80=82=20=E9=82=A3=E4=B8=AA?= =?UTF-8?q?=E4=BB=8E=E6=9D=A5=E5=B0=B1=E6=B2=A1=E6=9C=89=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E8=BF=87=E7=9A=84=E8=BF=87=E8=BF=91=E8=B7=9D?= =?UTF-8?q?=E7=A6=BB=E4=BF=9D=E6=8A=A4=E7=9B=B4=E6=8E=A5=E4=B8=8B=E4=BA=86?= =?UTF-8?q?=EF=BC=8C=E5=8F=AF=E8=83=BD=E4=B9=8B=E5=90=8E=E5=86=8D=E5=8A=A0?= =?UTF-8?q?=E5=9B=9E=E6=9D=A5=E5=90=A7=EF=BC=8C=E5=8F=8D=E6=AD=A3=E7=8E=B0?= =?UTF-8?q?=E5=9C=A8=E9=82=A3=E4=B8=AA=E5=B0=B1=E6=B2=A1=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E8=BF=87=E3=80=82=20=E5=85=B6=E4=BB=96=E9=83=BD=E6=98=AF?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E4=BE=A7=E7=9A=84=E5=B0=8F=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=EF=BC=8C=E7=94=A8=E6=88=B7=E4=BE=A7=E6=97=A0=E6=84=9F=E7=9F=A5?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++++ build.gradle | 4 ++-- gradle.properties | 8 ++++---- gradle/wrapper/gradle-wrapper.properties | 2 +- src/client/resources/randomteleporter.client.mixins.json | 2 +- src/main/java/xyz/thewhitedog9487/CommandRegister.java | 8 -------- .../resources/assets/randomteleporter/lang/zh_cn.json | 3 +-- src/main/resources/fabric.mod.json | 6 +++--- src/main/resources/randomteleporter.mixins.json | 2 +- 9 files changed, 17 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 519f0a9..a3bc0ef 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,10 @@ 1. 服务器需要安装 2. 客户端不需要 +**注意:情况2和3,虽然其他玩家不需要安装本模组就能使用功能。但是由于命令执行后的反馈结果文字使用了翻译,如果其他玩家没有安装模组会导致显示不正常,玩家会直接看到翻译键而不是对应的文字。 +因此,虽然可以但不建议其他人不安装。 +能安装的话还是都装一下吧。** + # 一些小彩蛋 你可以使用 /随机传送 来替代 /rtp 没错,Minecraft的命令是可以存在非ASCII字符的,所以我就整了一个 diff --git a/build.gradle b/build.gradle index 47b135a..1e85b56 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,9 @@ plugins { - id 'fabric-loom' version '1.6-SNAPSHOT' + id 'fabric-loom' version '1.7-SNAPSHOT' id 'maven-publish' } -version = project.mod_version +version = project.mod_version + " mc$project.minecraft_version" group = project.maven_group base { diff --git a/gradle.properties b/gradle.properties index f05a5b2..58cbb3c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,19 +5,19 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop minecraft_version=1.21 -yarn_mappings=1.21+build.1 +yarn_mappings=1.21+build.9 loader_version=0.15.11 # Mod Properties -mod_version=0.3.0 +mod_version=0.3.1 maven_group=xyz.thewhitedog9487 archives_base_name=randomteleporter # Dependencies -fabric_version=0.100.1+1.21 +fabric_version=0.102.0+1.21 loom_libraries_base=https://bmclapi2.bangbang93.com/maven/ loom_resources_base=https://bmclapi2.bangbang93.com/assets/ loom_version_manifests=https://bmclapi2.bangbang93.com/mc/game/version_manifest.json loom_experimental_versions=https://maven.fabricmc.net/net/minecraft/experimental_versions.json -loom_fabric_repository=https://repository.hanbings.io/proxy/ \ No newline at end of file +# loom_fabric_repository=https://repository.hanbings.io/proxy/ \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a441313..2793dd2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https://services.gradle.org/distributions/gradle-8.9-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/client/resources/randomteleporter.client.mixins.json b/src/client/resources/randomteleporter.client.mixins.json index ab1b52a..6386c2b 100644 --- a/src/client/resources/randomteleporter.client.mixins.json +++ b/src/client/resources/randomteleporter.client.mixins.json @@ -1,7 +1,7 @@ { "required": false, "package": "xyz.thewhitedog9487.mixin.client", - "compatibilityLevel": "JAVA_17", + "compatibilityLevel": "JAVA_21", "client": [ ], diff --git a/src/main/java/xyz/thewhitedog9487/CommandRegister.java b/src/main/java/xyz/thewhitedog9487/CommandRegister.java index ece6a6a..94b51be 100644 --- a/src/main/java/xyz/thewhitedog9487/CommandRegister.java +++ b/src/main/java/xyz/thewhitedog9487/CommandRegister.java @@ -20,7 +20,6 @@ import static net.minecraft.server.command.CommandManager.literal; public class CommandRegister { final static long WorldBorder = (long) 2.9e7; - static byte Retry = 0; static byte PermissionLevel = 2; public static void Register(String Name){ // /rtp @@ -193,13 +192,6 @@ public class CommandRegister { // if ( String.valueOf(entity.getWorld().getBiome(new BlockPos(Math.toIntExact(Coordinate_X), Coordinate_Y, Math.toIntExact(Coordinate_Z))).getKey()).equals("minecraft:the_void") ) { // Coordinate_Y++;} Coordinate_Y++; - Vec3d Coordinate = new Vec3d(Coordinate_X, Coordinate_Y, Coordinate_Z); - if (Radius == WorldBorder && Retry < 126 && entity.getPos().distanceTo(Coordinate) < 1e5){ - Retry++; - execute_command(Source, Radius,null, Origin); - return 0;} - if (Retry >= 126){ - Source.sendFeedback(()->{ return Text.translatable("warning.retry"); }, true);} entity.teleport(Source.getWorld(),Coordinate_X + 0.5, Coordinate_Y, Coordinate_Z + 0.5, new HashSet<>(), entity.getYaw(), entity.getPitch()); final long FinalCoordinate_X = Coordinate_X; final int FinalCoordinate_Y = Coordinate_Y; diff --git a/src/main/resources/assets/randomteleporter/lang/zh_cn.json b/src/main/resources/assets/randomteleporter/lang/zh_cn.json index 440cf1e..ccd77ac 100644 --- a/src/main/resources/assets/randomteleporter/lang/zh_cn.json +++ b/src/main/resources/assets/randomteleporter/lang/zh_cn.json @@ -3,7 +3,6 @@ "modmenu.descriptionTranslation.randomteleporter": "增加了两个用于随机传送的命令", "info.success": "已将玩家%s传送到%d %d %d", "error.not_player": "执行命令的不是玩家", - "warning.retry": "重试次数过大,为避免死循环将在本次传送中取消距离保护", - "bilibili": "哔哩哔哩主页", + "bilibili": "TheWhiteDog9487的哔哩哔哩主页", "blog": "TheWhiteDog9487的博客" } \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index d460103..bde54a9 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -28,7 +28,7 @@ ], "depends": { "fabricloader": ">=0.15.11", - "minecraft": "~1.21", + "minecraft": "1.21", "java": ">=21", "fabric-api": "*" }, @@ -38,7 +38,7 @@ "custom": { "modmenu": { "links": { - "twd.bilibili": "https://space.bilibili.com/401746666", - "twd.blog": "www.thewhitedog9487.xyz"}, + "bilibili": "https://space.bilibili.com/401746666", + "blog": "www.thewhitedog9487.xyz"}, "update_checker": true}} } \ No newline at end of file diff --git a/src/main/resources/randomteleporter.mixins.json b/src/main/resources/randomteleporter.mixins.json index ee9ba38..5cc4a57 100644 --- a/src/main/resources/randomteleporter.mixins.json +++ b/src/main/resources/randomteleporter.mixins.json @@ -1,7 +1,7 @@ { "required": false, "package": "xyz.thewhitedog9487.mixin", - "compatibilityLevel": "JAVA_17", + "compatibilityLevel": "JAVA_21", "mixins": [ ],