diff --git a/build.gradle b/build.gradle index 565b45c..0ef5277 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.4-SNAPSHOT' + id 'fabric-loom' version '1.5-SNAPSHOT' id 'maven-publish' } diff --git a/gradle.properties b/gradle.properties index 26334ad..9c7db37 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,20 +4,20 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop -minecraft_version=1.19.1 -yarn_mappings=1.19.1+build.6 -loader_version=0.14.24 +minecraft_version=1.20.4 +yarn_mappings=1.20.4+build.3 +loader_version=0.15.6 # Mod Properties -mod_version=0.1.1 +mod_version=0.2.0 maven_group=xyz.thewhitedog9487 archives_base_name=randomteleporter # Dependencies -fabric_version=0.58.5+1.19.1 +fabric_version=0.95.0+1.20.4 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/src/main/java/xyz/thewhitedog9487/CommandRegister.java b/src/main/java/xyz/thewhitedog9487/CommandRegister.java index 0c5b5be..448912c 100644 --- a/src/main/java/xyz/thewhitedog9487/CommandRegister.java +++ b/src/main/java/xyz/thewhitedog9487/CommandRegister.java @@ -37,7 +37,7 @@ public class CommandRegister { Register("rtp");} static int execute_command_radius(ServerCommandSource Source, Long Radius){ if (Source.getPlayer() == null) { - Source.sendFeedback(Text.translatable("error.twd.rtp.not_player"), true); + Source.sendFeedback(()->{ return Text.translatable("error.twd.rtp.not_player"); }, true); return -1;} if (Radius == null){Radius = WorldBorder - (long) 1e4;} Radius = Math.abs(Radius); @@ -45,9 +45,9 @@ public class CommandRegister { long Coordinate_Z = new SplittableRandom().nextLong(-Radius, Radius); int Coordinate_Y = 320; for (; - Blocks.AIR == Source.getWorld().getBlockState(new BlockPos(Coordinate_X, Coordinate_Y, Coordinate_Z)).getBlock() || - Blocks.VOID_AIR == Source.getWorld().getBlockState(new BlockPos(Coordinate_X, Coordinate_Y, Coordinate_Z)).getBlock() || - Blocks.CAVE_AIR == Source.getWorld().getBlockState(new BlockPos(Coordinate_X, Coordinate_Y, Coordinate_Z)).getBlock() + Blocks.AIR == Source.getWorld().getBlockState(new BlockPos(Math.toIntExact(Coordinate_X), Coordinate_Y, Math.toIntExact(Coordinate_Z))).getBlock() || + Blocks.VOID_AIR == Source.getWorld().getBlockState(new BlockPos(Math.toIntExact(Coordinate_X), Coordinate_Y, Math.toIntExact(Coordinate_Z))).getBlock() || + Blocks.CAVE_AIR == Source.getWorld().getBlockState(new BlockPos(Math.toIntExact(Coordinate_X), Coordinate_Y, Math.toIntExact(Coordinate_Z))).getBlock() ;Coordinate_Y--){} Coordinate_Y++; Vec3d Coordinate = new Vec3d(Coordinate_X, Coordinate_Y, Coordinate_Z); @@ -56,8 +56,9 @@ public class CommandRegister { execute_command_radius(Source, Radius); return 0;} if (Retry >= 126){ - Source.sendFeedback(Text.translatable("warning.twd.rtp.retry"), true);} + Source.sendFeedback(()->{ return Text.translatable("warning.twd.rtp.retry"); }, true);} Source.getPlayer().teleport(Source.getWorld(), Coordinate_X, Coordinate_Y, Coordinate_Z, 0, 0); - Source.sendFeedback(Text.translatable("info.twd.rtp.success", Source.getPlayer().getName(), Coordinate_X, Coordinate_Y, Coordinate_Z),true); + final int FinalCoordinate_Y = Coordinate_Y; + Source.sendFeedback(()->{ return Text.translatable("info.twd.rtp.success", Source.getPlayer().getName(), Coordinate_X, FinalCoordinate_Y, Coordinate_Z); },true); return 0;} } \ No newline at end of file diff --git a/src/main/resources/assets/randomteleporter/lang/en_us.json b/src/main/resources/assets/randomteleporter/lang/en_us.json index 0e0dcd2..988b421 100644 --- a/src/main/resources/assets/randomteleporter/lang/en_us.json +++ b/src/main/resources/assets/randomteleporter/lang/en_us.json @@ -1,3 +1,4 @@ { - + "twd-sasf.bilibili": "Bilibili", + "twd-sasf.blog": "Blog" } \ No newline at end of file diff --git a/src/main/resources/assets/randomteleporter/lang/zh_cn.json b/src/main/resources/assets/randomteleporter/lang/zh_cn.json index a59d64a..f2ea851 100644 --- a/src/main/resources/assets/randomteleporter/lang/zh_cn.json +++ b/src/main/resources/assets/randomteleporter/lang/zh_cn.json @@ -1,5 +1,7 @@ { "info.twd.rtp.success": "已将玩家%s传送到%d %d %d", "error.twd.rtp.not_player": "执行命令的不是玩家", - "warning.twd.rtp.retry": "重试次数过大,为避免死循环将在本次传送中取消距离保护" + "warning.twd.rtp.retry": "重试次数过大,为避免死循环将在本次传送中取消距离保护", + "twd.bilibili": "哔哩哔哩主页", + "twd.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 d1fb0dd..77aebd2 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -13,14 +13,10 @@ }, "license": "WTFPL", "icon": "assets/randomteleporter/icon.png", - "environment": "server", + "environment": "*", "entrypoints": { "main": [ - "xyz.thewhitedog9487.RandomTeleporter" - ], - "client": [ - "xyz.thewhitedog9487.RandomTeleporterClient" - ] + "xyz.thewhitedog9487.RandomTeleporter"] }, "mixins": [ "randomteleporter.mixins.json", @@ -30,10 +26,10 @@ } ], "depends": { - "fabricloader": ">=0.14.24", - "minecraft": "~1.19.1", + "fabricloader": ">=0.15.6", + "minecraft": "~1.20.4", "java": ">=17", - "fabric": "*" + "fabric-api": "*" }, "suggests": { "another-mod": "*" @@ -41,7 +37,7 @@ "custom": { "modmenu": { "links": { - "twd-sasf.bilibili": "https://space.bilibili.com/401746666", - "twd-sasf.blog": "www.thewhitedog9487.xyz"}, + "twd.bilibili": "https://space.bilibili.com/401746666", + "twd.blog": "www.thewhitedog9487.xyz"}, "update_checker": true}} } \ No newline at end of file