mirror of
				https://github.com/TheWhiteDog9487/RandomTeleporter.git
				synced 2025-10-28 19:21:06 +08:00 
			
		
		
		
	Compare commits
	
		
			18 Commits
		
	
	
		
			1.19.1
			...
			d47907cdf4
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| d47907cdf4 | |||
| 8c55311f27 | |||
| 35ac4dd842 | |||
| 34ea09dfd9 | |||
| ad014a2b1b | |||
| 4de867d6aa | |||
| 9770b72448 | |||
| 66a1529132 | |||
| 96a69f3262 | |||
| da6802f605 | |||
| 7376393f37 | |||
| c442f12de4 | |||
| e7c99c2364 | |||
| 6d3af41b34 | |||
| da8e07baea | |||
| 3d23f397f7 | |||
| 6eb98f1f94 | |||
| 8186159653 | 
							
								
								
									
										9
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| # | ||||
| # https://help.github.com/articles/dealing-with-line-endings/ | ||||
| # | ||||
| # Linux start script should use lf | ||||
| /gradlew        text eol=lf | ||||
|  | ||||
| # These are Windows script files and should use crlf | ||||
| *.bat           text eol=crlf | ||||
|  | ||||
							
								
								
									
										37
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,37 @@ | ||||
| # Automatically build the project and run any configured tests for every push | ||||
| # and submitted pull request. This can help catch issues that only occur on | ||||
| # certain platforms or Java versions, and provides a first line of defence | ||||
| # against bad commits. | ||||
|  | ||||
| name: build | ||||
| on: [pull_request, push] | ||||
|  | ||||
| jobs: | ||||
|   build: | ||||
|     strategy: | ||||
|       matrix: | ||||
|         # Use these Java versions | ||||
|         java: [ | ||||
|           21,    # Current Java LTS | ||||
|         ] | ||||
|     runs-on: ubuntu-22.04 | ||||
|     steps: | ||||
|       - name: checkout repository | ||||
|         uses: actions/checkout@v4 | ||||
|       - name: validate gradle wrapper | ||||
|         uses: gradle/wrapper-validation-action@v2 | ||||
|       - name: setup jdk ${{ matrix.java }} | ||||
|         uses: actions/setup-java@v4 | ||||
|         with: | ||||
|           java-version: ${{ matrix.java }} | ||||
|           distribution: 'microsoft' | ||||
|       - name: make gradle wrapper executable | ||||
|         run: chmod +x ./gradlew | ||||
|       - name: build | ||||
|         run: ./gradlew build | ||||
|       - name: capture build artifacts | ||||
|         if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java | ||||
|         uses: actions/upload-artifact@v4 | ||||
|         with: | ||||
|           name: Artifacts | ||||
|           path: build/libs/ | ||||
							
								
								
									
										20
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								README.md
									
									
									
									
									
								
							| @@ -15,14 +15,15 @@ | ||||
|  | ||||
| ## 命令示例 | ||||
| - /rtp   | ||||
| 将执行命令的玩家随机传送到以(0,0)为中心点,2.9e7作为随机半径的范围内的随机一点   | ||||
| 将执行命令的玩家随机传送到以(0,0)为中心点,2.9e7 - 1e4作为随机半径的范围内的随机一点   | ||||
| 2.9e+7 = 2.9 x 10^7 = 29000000 = 两千九百万   | ||||
| 1e4 = 10^4 = 10000 = 一万 | ||||
|  | ||||
| - /rtp 1000   | ||||
| 将执行命令的玩家随机传送到以(0,0)为中心点,1000作为随机半径的范围内的随机一点 | ||||
|  | ||||
| - /rtp TheWhiteDog9487   | ||||
| 将TheWhiteDog9487随机传送到以(0,0)为中心点,2.9e7作为随机半径的范围内的随机一点   | ||||
| 将TheWhiteDog9487随机传送到以(0,0)为中心点,2.9e7 - 1e4作为随机半径的范围内的随机一点   | ||||
|  | ||||
| - /rtp TheWhiteDog9487 1000   | ||||
| 将TheWhiteDog9487随机传送到以(0,0)为中心点,1000作为随机半径的范围内的随机一点   | ||||
| @@ -30,21 +31,19 @@ | ||||
| - /rtp 1000 TheWhiteDog9487   | ||||
| 将TheWhiteDog9487随机传送到以(0,0)为中心点,1000作为随机半径的范围内的随机一点   | ||||
|  | ||||
| - /rtp 1000 10000 ~ 10000   | ||||
| - /rtp 1000 10000 10000   | ||||
| 将执行命令的玩家随机传送到以(10000,10000)为中心点,1000作为随机半径的范围内的随机一点 | ||||
| 提示:按照道理来说中心坐标是不需要高度(Y轴)的,但由于坐标的类型是Vec3d,所以还是要写高度的。   | ||||
| 至于高度的具体数值,随便写,代码里也没用到过。   | ||||
|  | ||||
| - /rtp 1000 TheWhiteDog9487 TheWhiteDog_CN   | ||||
| 将TheWhiteDog9487随机传送到以TheWhiteDog_CN所在位置为中心点,1000作为随机半径的范围内的随机一点   | ||||
|  | ||||
| - /rtp 1000 TheWhiteDog9487 10000 ~ 10000   | ||||
| - /rtp 1000 TheWhiteDog9487 10000 10000   | ||||
| 将TheWhiteDog9487随机传送到以(10000,10000)为中心点,1000作为随机半径的范围内的随机一点   | ||||
|  | ||||
| - /rtp TheWhiteDog9487 1000 TheWhiteDog_CN   | ||||
| 将TheWhiteDog9487随机传送到以TheWhiteDog_CN所在位置为中心点,1000作为随机半径的范围内的随机一点   | ||||
|  | ||||
| - /rtp TheWhiteDog9487 1000 10000 ~ 10000   | ||||
| - /rtp TheWhiteDog9487 1000 10000 10000   | ||||
| 将TheWhiteDog9487随机传送到以(10000,10000)为中心点,1000作为随机半径的范围内的随机一点   | ||||
|  | ||||
| ### 特别提示 | ||||
| @@ -56,7 +55,7 @@ | ||||
| 由于我使用了fabric.api.command.v2中的CommandRegistrationCallback.EVENT来向游戏注册命令,所以这个模组需要依赖Fabric API | ||||
|  | ||||
| # 关于玩家权限 | ||||
| 我参照原版的 /tp 命令,给 /rtp 设置了4级的权限要求。   | ||||
| 我参照原版的 /tp 命令,给 /rtp 设置了2级的权限要求。   | ||||
| 如果是原版或者类原版,你只需要让玩家有作弊的权限就可以用。   | ||||
| 插件服务器方面那些具体的权限分配,因为我自己没玩过所以我也没法给出参考意见。 | ||||
|  | ||||
| @@ -72,6 +71,9 @@ | ||||
|     1. 服务器需要安装 | ||||
|     2. 客户端不需要 | ||||
|  | ||||
| **注意:情况2和3,如果其他玩家不安装本模组,他们看到的命令执行反馈就无法正确使用翻译,而在这种情况下默认显示中文文本。   | ||||
| 如果有查看多语言翻译文本的需求 ,那建议还是都装一下吧。**   | ||||
|  | ||||
| # 一些小彩蛋 | ||||
| 你可以使用 /随机传送 来替代 /rtp   | ||||
| 没错,Minecraft的命令是可以存在非ASCII字符的,所以我就整了一个   | ||||
| @@ -80,4 +82,4 @@ | ||||
| - /随机传送 TheWhiteDog9487 1000 | ||||
|  | ||||
| 这两个命令的效果没有任何差别   | ||||
| 玩家权限限制和 /rtp 当然也是一样的,都是4级 | ||||
| 玩家权限限制和 /rtp 当然也是一样的,都是2级 | ||||
							
								
								
									
										91
									
								
								build.gradle
									
									
									
									
									
								
							
							
						
						
									
										91
									
								
								build.gradle
									
									
									
									
									
								
							| @@ -1,91 +0,0 @@ | ||||
| plugins { | ||||
| 	id 'fabric-loom' version '1.5-SNAPSHOT' | ||||
| 	id 'maven-publish' | ||||
| } | ||||
|  | ||||
| version = project.mod_version | ||||
| group = project.maven_group | ||||
|  | ||||
| base { | ||||
| 	archivesName = project.archives_base_name | ||||
| } | ||||
|  | ||||
| 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 { | ||||
|     splitEnvironmentSourceSets() | ||||
|  | ||||
| 	mods { | ||||
| 		"randomteleporter" { | ||||
| 			sourceSet sourceSets.main | ||||
| 			sourceSet sourceSets.client | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| } | ||||
|  | ||||
| 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}" | ||||
| 	 | ||||
| 	// Uncomment the following line to enable the deprecated Fabric API modules.  | ||||
| 	// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time. | ||||
|  | ||||
| 	// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}" | ||||
| } | ||||
|  | ||||
| processResources { | ||||
| 	inputs.property "version", project.version | ||||
|  | ||||
| 	filesMatching("fabric.mod.json") { | ||||
| 		expand "version": project.version | ||||
| 	} | ||||
| } | ||||
|  | ||||
| tasks.withType(JavaCompile).configureEach { | ||||
| 	it.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() | ||||
|  | ||||
| 	sourceCompatibility = JavaVersion.VERSION_17 | ||||
| 	targetCompatibility = JavaVersion.VERSION_17 | ||||
| } | ||||
|  | ||||
| jar { | ||||
| 	from("LICENSE") { | ||||
| 		rename { "${it}_${project.base.archivesName.get()}"} | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // configure the maven publication | ||||
| publishing { | ||||
| 	publications { | ||||
| 		mavenJava(MavenPublication) { | ||||
| 			from components.java | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	// 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. | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										102
									
								
								build.gradle.kts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										102
									
								
								build.gradle.kts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,102 @@ | ||||
| plugins { | ||||
|     id("fabric-loom") version "1.11-SNAPSHOT" | ||||
|     id("maven-publish") | ||||
| } | ||||
|  | ||||
| version = project.extra["mod_version"] as String | ||||
| group = project.extra["maven_group"] as String | ||||
|  | ||||
| base { | ||||
|     archivesName.set(project.extra["archives_base_name"] as String) | ||||
| } | ||||
|  | ||||
| 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. | ||||
|     maven { | ||||
|         name = "Terraformers" | ||||
|         url = uri("https://maven.terraformersmc.com/") } | ||||
| } | ||||
|  | ||||
| loom { | ||||
|     splitEnvironmentSourceSets() | ||||
|  | ||||
|     mods { | ||||
|         create("randomteleporter") { | ||||
|             sourceSet(sourceSets["main"]) | ||||
|             sourceSet(sourceSets["client"]) | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| dependencies { | ||||
|     // To change the versions see the gradle.properties file | ||||
|     minecraft("com.mojang:minecraft:${project.extra["minecraft_version"]}") | ||||
|     mappings("net.fabricmc:yarn:${project.extra["yarn_mappings"]}:v2") | ||||
|     modImplementation("net.fabricmc:fabric-loader:${project.extra["loader_version"]}") | ||||
|  | ||||
|     // Fabric API. This is technically optional, but you probably want it anyway. | ||||
|     modImplementation("net.fabricmc.fabric-api:fabric-api:${project.extra["fabric_version"]}") | ||||
|  | ||||
|     // Uncomment the following line to enable the deprecated Fabric API modules.  | ||||
|     // These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time. | ||||
|     // "modImplementation"("net.fabricmc.fabric-api:fabric-api-deprecated:${project.extra["fabric_version"]}") | ||||
|  | ||||
|     // ↓ 开发测试用 | ||||
|     modRuntimeOnly("com.terraformersmc:modmenu:${project.extra["modmenu_version"]}") | ||||
| } | ||||
|  | ||||
| tasks.processResources { | ||||
|     inputs.property("version", project.version) | ||||
|  | ||||
|     filesMatching("fabric.mod.json") { | ||||
|         expand("version" to project.version) | ||||
|     } | ||||
| } | ||||
|  | ||||
| tasks.withType<JavaCompile> { | ||||
|     options.release.set(21) | ||||
| } | ||||
|  | ||||
| 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() | ||||
|  | ||||
|     sourceCompatibility = JavaVersion.VERSION_21 | ||||
|     targetCompatibility = JavaVersion.VERSION_21 | ||||
| } | ||||
|  | ||||
| tasks.jar { | ||||
|     from("LICENSE") { | ||||
|         rename { "${it}_${project.base.archivesName.get()}" } } | ||||
| } | ||||
|  | ||||
| tasks.remapJar{ | ||||
|     // https://docs.gradle.org/current/dsl/org.gradle.api.tasks.bundling.Jar.html#org.gradle.api.tasks.bundling.Jar:archiveFileName | ||||
|     // 用这个属性设置jar包的文件名格式 | ||||
|     // 别用上面那个Jar任务的配置,会被remapJar覆盖掉 | ||||
|     archiveFileName = "${project.base.archivesName.get()}-${project.version} mc${project.extra["minecraft_version"]}.jar"} | ||||
| tasks.remapSourcesJar{ | ||||
|     archiveFileName = "${project.base.archivesName.get()}-${project.version} mc${project.extra["minecraft_version"]}-sources.jar"} | ||||
|  | ||||
| // configure the maven publication | ||||
| publishing { | ||||
|     publications { | ||||
|         create<MavenPublication>("mavenJava") { | ||||
|             from(components["java"]) | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     // 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. | ||||
|     } | ||||
| } | ||||
| @@ -4,20 +4,18 @@ org.gradle.parallel=true | ||||
|  | ||||
| # Fabric Properties | ||||
| # check these on https://fabricmc.net/develop | ||||
| minecraft_version=1.20.4 | ||||
| yarn_mappings=1.20.4+build.3 | ||||
| loader_version=0.15.6 | ||||
| minecraft_version=1.21.8 | ||||
| yarn_mappings=1.21.8+build.1 | ||||
| loader_version=0.16.14 | ||||
|  | ||||
| # Mod Properties | ||||
| mod_version=0.2.4 | ||||
| mod_version=0.3.6 | ||||
| maven_group=xyz.thewhitedog9487 | ||||
| archives_base_name=randomteleporter | ||||
| archives_base_name=RandomTeleporter | ||||
|  | ||||
| # Dependencies | ||||
| fabric_version=0.95.4+1.20.4 | ||||
| fabric_version=0.129.0+1.21.8 | ||||
|  | ||||
| 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/ | ||||
| # https://modrinth.com/mod/modmenu/versions | ||||
| # https://maven.terraformersmc.com/releases/com/terraformersmc/modmenu | ||||
| modmenu_version=15.0.0-beta.3 | ||||
							
								
								
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							| @@ -1,6 +1,6 @@ | ||||
| distributionBase=GRADLE_USER_HOME | ||||
| distributionPath=wrapper/dists | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip | ||||
| distributionUrl=https://services.gradle.org/distributions/gradle-8.14-bin.zip | ||||
| networkTimeout=10000 | ||||
| validateDistributionUrl=true | ||||
| zipStoreBase=GRADLE_USER_HOME | ||||
|   | ||||
| @@ -1,11 +0,0 @@ | ||||
| pluginManagement { | ||||
| 	repositories { | ||||
| 		maven { | ||||
| 			name = 'Fabric' | ||||
| 			url = 'https://maven.aliyun.com/repository/gradle-plugin' | ||||
| 			url = 'https://maven.fabricmc.net/' | ||||
| 		} | ||||
| 		mavenCentral() | ||||
| 		gradlePluginPortal() | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										9
									
								
								settings.gradle.kts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								settings.gradle.kts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| pluginManagement { | ||||
|     repositories { | ||||
|         maven { | ||||
|             name = "Fabric" | ||||
|             url = uri("https://maven.fabricmc.net/") } | ||||
|         mavenCentral() | ||||
|         gradlePluginPortal() | ||||
|     } | ||||
| } | ||||
| @@ -1,7 +1,7 @@ | ||||
| { | ||||
| 	"required": false, | ||||
| 	"package": "xyz.thewhitedog9487.mixin.client", | ||||
| 	"compatibilityLevel": "JAVA_17", | ||||
| 	"compatibilityLevel": "JAVA_21", | ||||
| 	"client": [ | ||||
|  | ||||
| 	], | ||||
|   | ||||
| @@ -1,32 +1,54 @@ | ||||
| package xyz.thewhitedog9487; | ||||
|  | ||||
| import com.mojang.brigadier.arguments.LongArgumentType; | ||||
| import com.mojang.brigadier.arguments.IntegerArgumentType; | ||||
| import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; | ||||
| import net.minecraft.block.Blocks; | ||||
| import net.minecraft.command.argument.EntityArgumentType; | ||||
| import net.minecraft.command.argument.Vec3ArgumentType; | ||||
| import net.minecraft.command.argument.Vec2ArgumentType; | ||||
| import net.minecraft.entity.Entity; | ||||
| import net.minecraft.server.command.ServerCommandSource; | ||||
| import net.minecraft.text.Text; | ||||
| import net.minecraft.util.math.BlockPos; | ||||
| import net.minecraft.util.math.Vec3d; | ||||
| import net.minecraft.util.math.Vec2f; | ||||
| import org.jetbrains.annotations.Nullable; | ||||
|  | ||||
| import java.util.HashSet; | ||||
| import java.util.SplittableRandom; | ||||
|  | ||||
| import static net.minecraft.server.command.CommandManager.argument; | ||||
| import static net.minecraft.server.command.CommandManager.literal; | ||||
| import static xyz.thewhitedog9487.Toolbox.Distance; | ||||
|  | ||||
| public class CommandRegister { | ||||
|     final static long WorldBorder = (long) 2.9e7; | ||||
|     static byte Retry = 0; | ||||
|  | ||||
|     /** | ||||
|      * 世界边界 | ||||
|      * <br> | ||||
|      * @see <a href="https://zh.minecraft.wiki/w/%E4%B8%96%E7%95%8C%E8%BE%B9%E7%95%8C#%E5%A4%A7%E5%B0%8F">Minecraft Wiki (中文)</a> | ||||
|      * @see <a href="https://minecraft.wiki/w/World_border#General_information">Minecraft Wiki (English)</a> | ||||
|      */ | ||||
|     final static Integer WorldBorder = (int) 2.9e7; | ||||
|  | ||||
|     /** | ||||
|      * 执行命令所需权限等级 | ||||
|      * @see net.minecraft.server.command.TeleportCommand | ||||
|      */ | ||||
|     final static byte PermissionLevel = 2; | ||||
|  | ||||
|     /** | ||||
|      * 使用Fabric API向游戏内注册命令 | ||||
|      * @param Name 根命令名 | ||||
|      * <br> | ||||
|      * @see <a href="https://docs.fabricmc.net/zh_cn/develop/commands/basics">Fabric Wiki (新样式,中文)</a> | ||||
|      * @see <a href="https://wiki.fabricmc.net/zh_cn:tutorial:commands">Fabric Wiki (旧样式,中文)</a> | ||||
|      * @see <a href="https://docs.fabricmc.net/develop/commands/basics">Fabric Wiki (New style,English)</a> | ||||
|      * @see <a href="https://wiki.fabricmc.net/tutorial:commands">Fabric Wiki (Old style,English)</a> | ||||
|      */ | ||||
|     public static void Register(String Name){ | ||||
|         // /rtp | ||||
|         CommandRegistrationCallback.EVENT | ||||
|                 .register((dispatcher, registryAccess, environment) ->{ | ||||
|                     dispatcher.register(literal(Name) | ||||
|                             .requires(source -> source.hasPermissionLevel(4)) | ||||
|                             .requires(source -> source.hasPermissionLevel(PermissionLevel)) | ||||
|                             .executes(context -> execute_command( | ||||
|                                     context.getSource(),null,null, null)));}); | ||||
|  | ||||
| @@ -34,11 +56,11 @@ public class CommandRegister { | ||||
|         CommandRegistrationCallback.EVENT | ||||
|                 .register((dispatcher, registryAccess, environment) -> { | ||||
|                     dispatcher.register(literal(Name) | ||||
|                             .then(argument("Radius(半径)", LongArgumentType.longArg()) | ||||
|                                     .requires(source -> source.hasPermissionLevel(4)) | ||||
|                             .then(argument("Radius(半径)", IntegerArgumentType.integer()) | ||||
|                                     .requires(source -> source.hasPermissionLevel(PermissionLevel)) | ||||
|                                     .executes(context -> execute_command( | ||||
|                                             context.getSource(), | ||||
|                                             LongArgumentType.getLong(context, "Radius(半径)"), | ||||
|                                             IntegerArgumentType.getInteger(context, "Radius(半径)"), | ||||
|                                             null, | ||||
|                                             null))));}); | ||||
|  | ||||
| @@ -47,7 +69,7 @@ public class CommandRegister { | ||||
|                 .register((dispatcher, registryAccess, environment) -> { | ||||
|                     dispatcher.register(literal(Name) | ||||
|                             .then(argument("被传送玩家名(PlayerID)", EntityArgumentType.entity()) | ||||
|                                     .requires(source -> source.hasPermissionLevel(4)) | ||||
|                                     .requires(source -> source.hasPermissionLevel(PermissionLevel)) | ||||
|                                     .executes(context -> execute_command( | ||||
|                                             context.getSource(), | ||||
|                                             null, | ||||
| @@ -58,12 +80,12 @@ public class CommandRegister { | ||||
|         CommandRegistrationCallback.EVENT | ||||
|                 .register((dispatcher, registryAccess, environment) -> { | ||||
|                     dispatcher.register(literal(Name) | ||||
|                             .then(argument("Radius(半径)", LongArgumentType.longArg()) | ||||
|                             .then(argument("Radius(半径)", IntegerArgumentType.integer()) | ||||
|                                     .then(argument("被传送玩家名(PlayerID)", EntityArgumentType.entity()) | ||||
|                                             .requires(source -> source.hasPermissionLevel(4)) | ||||
|                                             .requires(source -> source.hasPermissionLevel(PermissionLevel)) | ||||
|                                             .executes(context -> execute_command( | ||||
|                                                     context.getSource(), | ||||
|                                                     LongArgumentType.getLong(context, "Radius(半径)"), | ||||
|                                                     IntegerArgumentType.getInteger(context, "Radius(半径)"), | ||||
|                                                     EntityArgumentType.getEntity(context,"被传送玩家名(PlayerID)"), | ||||
|                                                     null)))));}); | ||||
|  | ||||
| @@ -72,11 +94,11 @@ public class CommandRegister { | ||||
|                 .register((dispatcher, registryAccess, environment) -> { | ||||
|                     dispatcher.register(literal(Name) | ||||
|                             .then(argument("被传送玩家名(PlayerID)", EntityArgumentType.entity()) | ||||
|                                 .then(argument("Radius(半径)", LongArgumentType.longArg()) | ||||
|                                             .requires(source -> source.hasPermissionLevel(4)) | ||||
|                                 .then(argument("Radius(半径)", IntegerArgumentType.integer()) | ||||
|                                             .requires(source -> source.hasPermissionLevel(PermissionLevel)) | ||||
|                                             .executes(context -> execute_command( | ||||
|                                                     context.getSource(), | ||||
|                                                     LongArgumentType.getLong(context, "Radius(半径)"), | ||||
|                                                     IntegerArgumentType.getInteger(context, "Radius(半径)"), | ||||
|                                                     EntityArgumentType.getEntity(context,"被传送玩家名(PlayerID)"), | ||||
|                                                     null)))));}); | ||||
|  | ||||
| @@ -86,121 +108,170 @@ public class CommandRegister { | ||||
| //                    dispatcher.register(literal(Name) | ||||
| //                            .then(argument("Radius(半径)", LongArgumentType.longArg()) | ||||
| //                                    .then(argument("Origin(随机中心)",EntityArgumentType.player()) | ||||
| //                                        .requires(source -> source.hasPermissionLevel(4)) | ||||
| //                                        .requires(source -> source.hasPermissionLevel(PermissionLevel)) | ||||
| //                                        .executes(context -> execute_command_origin( | ||||
| //                                                context.getSource(), | ||||
| //                                                LongArgumentType.getLong(context, "Radius(半径)"), | ||||
| //                                                null, | ||||
| //                                                EntityArgumentType.getEntity(context,"Origin(随机中心)"))))));}); | ||||
|  | ||||
|         // /rtp <Radius(半径)> <OriginPos(随机中心,坐标)> | ||||
|         CommandRegistrationCallback.EVENT | ||||
|                 .register((dispatcher, registryAccess, environment) -> { | ||||
|                     dispatcher.register(literal(Name) | ||||
|                             .then(argument("Radius(半径)", LongArgumentType.longArg()) | ||||
|                                     .then(argument("OriginPos(随机中心,坐标)",Vec3ArgumentType.vec3()) | ||||
|                                             .requires(source -> source.hasPermissionLevel(4)) | ||||
|                             .then(argument("Radius(半径)", IntegerArgumentType.integer()) | ||||
|                                     .then(argument("OriginPos(随机中心,坐标)",Vec2ArgumentType.vec2()) | ||||
|                                             .requires(source -> source.hasPermissionLevel(PermissionLevel)) | ||||
|                                             .executes(context -> execute_command( | ||||
|                                                     context.getSource(), | ||||
|                                                     LongArgumentType.getLong(context, "Radius(半径)"), | ||||
|                                                     IntegerArgumentType.getInteger(context, "Radius(半径)"), | ||||
|                                                     null, | ||||
|                                                     Vec3ArgumentType.getVec3(context,"OriginPos(随机中心,坐标)"))))));}); | ||||
|                                                     Vec2ArgumentType.getVec2(context,"OriginPos(随机中心,坐标)"))))));}); | ||||
|  | ||||
|         // /rtp <Radius(半径)> <被传送玩家名(PlayerID)> <OriginEntity(随机中心,实体)> | ||||
|         CommandRegistrationCallback.EVENT | ||||
|                 .register((dispatcher, registryAccess, environment) -> { | ||||
|                     dispatcher.register(literal(Name) | ||||
|                             .then(argument("Radius(半径)", LongArgumentType.longArg()) | ||||
|                             .then(argument("Radius(半径)", IntegerArgumentType.integer()) | ||||
|                                     .then(argument("被传送玩家名(PlayerID)", EntityArgumentType.entity()) | ||||
|                                             .then(argument("OriginEntity(随机中心,实体)",EntityArgumentType.entity()) | ||||
|                                                     .requires(source -> source.hasPermissionLevel(4)) | ||||
|                                                     .executes(context -> execute_command_origin( | ||||
|                                                     .requires(source -> source.hasPermissionLevel(PermissionLevel)) | ||||
|                                                     .executes(context -> execute_command( | ||||
|                                                             context.getSource(), | ||||
|                                                             LongArgumentType.getLong(context, "Radius(半径)"), | ||||
|                                                             IntegerArgumentType.getInteger(context, "Radius(半径)"), | ||||
|                                                             EntityArgumentType.getEntity(context,"被传送玩家名(PlayerID)"), | ||||
|                                                             EntityArgumentType.getEntity(context,"OriginEntity(随机中心,实体)")))))));}); | ||||
|                                                             new Vec2f( (float) EntityArgumentType.getEntity( context,"OriginEntity(随机中心,实体)").getPos().x, | ||||
|                                                                     (float) EntityArgumentType.getEntity( context,"OriginEntity(随机中心,实体)").getPos().z )))))));}); | ||||
|  | ||||
|         // /rtp <Radius(半径)> <被传送玩家名(PlayerID)> <OriginPos(随机中心,坐标)> | ||||
|         CommandRegistrationCallback.EVENT | ||||
|                 .register((dispatcher, registryAccess, environment) -> { | ||||
|                     dispatcher.register(literal(Name) | ||||
|                             .then(argument("Radius(半径)", LongArgumentType.longArg()) | ||||
|                             .then(argument("Radius(半径)", IntegerArgumentType.integer()) | ||||
|                                     .then(argument("被传送玩家名(PlayerID)", EntityArgumentType.entity()) | ||||
|                                             .then(argument("OriginPos(随机中心,坐标)",Vec3ArgumentType.vec3()) | ||||
|                                                     .requires(source -> source.hasPermissionLevel(4)) | ||||
|                                             .then(argument("OriginPos(随机中心,坐标)",Vec2ArgumentType.vec2()) | ||||
|                                                     .requires(source -> source.hasPermissionLevel(PermissionLevel)) | ||||
|                                                     .executes(context -> execute_command( | ||||
|                                                             context.getSource(), | ||||
|                                                             LongArgumentType.getLong(context, "Radius(半径)"), | ||||
|                                                             IntegerArgumentType.getInteger(context, "Radius(半径)"), | ||||
|                                                             EntityArgumentType.getEntity(context,"被传送玩家名(PlayerID)"), | ||||
|                                                             Vec3ArgumentType.getVec3(context,"OriginPos(随机中心,坐标)")))))));}); | ||||
|                                                             Vec2ArgumentType.getVec2(context,"OriginPos(随机中心,坐标)")))))));}); | ||||
|  | ||||
|         // /rtp <被传送玩家名(PlayerID)> <Radius(半径)> <OriginEntity(随机中心,实体)> | ||||
|         CommandRegistrationCallback.EVENT | ||||
|                 .register((dispatcher, registryAccess, environment) -> { | ||||
|                     dispatcher.register(literal(Name) | ||||
|                             .then(argument("被传送玩家名(PlayerID)", EntityArgumentType.entity()) | ||||
|                                     .then(argument("Radius(半径)", LongArgumentType.longArg()) | ||||
|                                     .then(argument("Radius(半径)", IntegerArgumentType.integer()) | ||||
|                                             .then(argument("OriginEntity(随机中心,实体)",EntityArgumentType.entity()) | ||||
|                                                     .requires(source -> source.hasPermissionLevel(4)) | ||||
|                                                     .executes(context -> execute_command_origin( | ||||
|                                                     .requires(source -> source.hasPermissionLevel(PermissionLevel)) | ||||
|                                                     .executes(context -> execute_command( | ||||
|                                                             context.getSource(), | ||||
|                                                             LongArgumentType.getLong(context, "Radius(半径)"), | ||||
|                                                             IntegerArgumentType.getInteger(context, "Radius(半径)"), | ||||
|                                                             EntityArgumentType.getEntity(context,"被传送玩家名(PlayerID)"), | ||||
|                                                             EntityArgumentType.getEntity(context,"OriginEntity(随机中心,实体)")))))));}); | ||||
|                                                             new Vec2f( (float) EntityArgumentType.getEntity( context,"OriginEntity(随机中心,实体)").getPos().x, | ||||
|                                                                     (float) EntityArgumentType.getEntity( context,"OriginEntity(随机中心,实体)").getPos().z )))))));}); | ||||
|  | ||||
|         // /rtp <被传送玩家名(PlayerID)> <Radius(半径)> <OriginPos(随机中心,坐标)> | ||||
|         CommandRegistrationCallback.EVENT | ||||
|                 .register((dispatcher, registryAccess, environment) -> { | ||||
|                     dispatcher.register(literal(Name) | ||||
|                             .then(argument("被传送玩家名(PlayerID)", EntityArgumentType.entity()) | ||||
|                                     .then(argument("Radius(半径)", LongArgumentType.longArg()) | ||||
|                                             .then(argument("OriginPos(随机中心,坐标)",Vec3ArgumentType.vec3()) | ||||
|                                                     .requires(source -> source.hasPermissionLevel(4)) | ||||
|                                     .then(argument("Radius(半径)", IntegerArgumentType.integer()) | ||||
|                                             .then(argument("OriginPos(随机中心,坐标)",Vec2ArgumentType.vec2()) | ||||
|                                                     .requires(source -> source.hasPermissionLevel(PermissionLevel)) | ||||
|                                                     .executes(context -> execute_command( | ||||
|                                                             context.getSource(), | ||||
|                                                             LongArgumentType.getLong(context, "Radius(半径)"), | ||||
|                                                             IntegerArgumentType.getInteger(context, "Radius(半径)"), | ||||
|                                                             EntityArgumentType.getEntity(context,"被传送玩家名(PlayerID)"), | ||||
|                                                             Vec3ArgumentType.getVec3(context,"OriginPos(随机中心,坐标)")))))));});} | ||||
|                                                             Vec2ArgumentType.getVec2(context,"OriginPos(随机中心,坐标)")))))));});} | ||||
|  | ||||
|     /** | ||||
|      * 向游戏内注册命令 | ||||
|      * <br> | ||||
|      * 是 {@link CommandRegister#Register(String)} 的包装器 | ||||
|      * @see CommandRegister#Register(String) | ||||
|      */ | ||||
|     public static void Register(){ | ||||
|         Register("随机传送"); | ||||
|         Register("rtp");} | ||||
|     static int execute_command(ServerCommandSource Source, @Nullable Long Radius, @Nullable Entity Player, @Nullable Vec3d Origin){ | ||||
|         Register("rtp"); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * | ||||
|      * @param Source 命令执行者 | ||||
|      * @param Radius 随机选择的目的坐标距离参数 {@code Origin} 的最大距离 | ||||
|      * @param Player 被传送的玩家 | ||||
|      * @param Origin 随机选择的目的坐标的中心 | ||||
|      * @return 命令运行是否成功 | ||||
|      */ | ||||
|     static int execute_command(ServerCommandSource Source, @Nullable Integer Radius, @Nullable Entity Player, @Nullable Vec2f Origin){ | ||||
|         Entity entity = Player == null ? Source.getPlayer() : Player; | ||||
|         /* | ||||
|             ↑ | ||||
|             Entity entity = null; | ||||
|             if (Player == null){ | ||||
|                 entity = Source.getPlayer();} | ||||
|             else{ | ||||
|                 entity = Player;} | ||||
|          */ | ||||
|         if (entity == null) { | ||||
|             Source.sendFeedback(()->{ return  Text.translatable("error.twd.rtp.not_player"); }, true); | ||||
|             Source.sendFeedback(()->{ return  Text.translatableWithFallback("error.no_target","不存在被传送目标,由非玩家物体执行命令时请显式指定被传送玩家ID"); }, true); | ||||
|             return -1;} | ||||
|         if (Radius == null){Radius = WorldBorder - (long) 1e4;} | ||||
|         if (Radius == null){Radius = (int) (WorldBorder - 1e4);} | ||||
|         // ↑ 远离世界边界 | ||||
|         Radius = Math.abs(Radius); | ||||
|         long Coordinate_X; | ||||
|         long Coordinate_Z; | ||||
|         if (Origin == null){ | ||||
|             Coordinate_X = new SplittableRandom().nextLong(-Radius, Radius); | ||||
|             Coordinate_Z = new SplittableRandom().nextLong(-Radius, Radius);} | ||||
|         else{ | ||||
|             Coordinate_X = new SplittableRandom().nextLong(Math.round(Origin.getX() - Radius), Math.round(Origin.getX() + Radius)); | ||||
|             Coordinate_Z = new SplittableRandom().nextLong(Math.round(Origin.getZ() - Radius), Math.round(Origin.getZ() + Radius));} | ||||
|         int Coordinate_X = 0; | ||||
|         int Coordinate_Z = 0; | ||||
|         try { | ||||
|             if (Origin == null){ | ||||
|                 Coordinate_X = new SplittableRandom().nextInt(-Radius, Radius); | ||||
|                 Coordinate_Z = new SplittableRandom().nextInt(-Radius, Radius);} | ||||
|             else{ | ||||
|                 Coordinate_X = new SplittableRandom().nextInt((int) Origin.x - Radius, (int) Origin.x + Radius); | ||||
|                 Coordinate_Z = new SplittableRandom().nextInt((int) Origin.y - Radius, (int) Origin.y + Radius);}} | ||||
|         catch (IllegalArgumentException e) { | ||||
|             // 半径为零 | ||||
|             if (Origin == null) { | ||||
|                 Source.sendFeedback(()->{ return Text.translatableWithFallback("warning.radius_equal_zero_no_target", "由于你设置的随机半径为0,并且未设置随机中心点坐标,因此什么都不会发生"); },true); | ||||
|                 return -1;} | ||||
|             else { | ||||
|                 Coordinate_X = (int) Origin.x; | ||||
|                 Coordinate_Z = (int) Origin.y; | ||||
|                 int finalCoordinate_X1 = Coordinate_X; | ||||
|                 int finalCoordinate_Z1 = Coordinate_Z; | ||||
|                 // ↑ "lambda 表达式中使用的变量应为 final 或有效 final" | ||||
|                 Source.sendFeedback(()->{ return Text.translatableWithFallback("warning.radius_equal_zero", "警告:由于你设置的随机半径为0,因此在选择出合适高度之后将直接把你传送至%d %d", finalCoordinate_X1, finalCoordinate_Z1); },true);}} | ||||
|         int Coordinate_Y = 320; | ||||
|         for (; | ||||
|              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--){} | ||||
|         if (Blocks.WATER == Source.getWorld().getBlockState(new BlockPos(Math.toIntExact(Coordinate_X), Coordinate_Y, Math.toIntExact(Coordinate_Z))).getBlock() || | ||||
|             Blocks.LAVA == Source.getWorld().getBlockState(new BlockPos(Math.toIntExact(Coordinate_X), Coordinate_Y, Math.toIntExact(Coordinate_Z))).getBlock()){ | ||||
|             Source.getWorld().setBlockState(new BlockPos(Math.toIntExact(Coordinate_X), Coordinate_Y, Math.toIntExact(Coordinate_Z)), Blocks.STONE.getDefaultState());} | ||||
|         for (var CurrentBlock = Source.getWorld().getBlockState(new BlockPos(Coordinate_X, Coordinate_Y, Coordinate_Z)).getBlock(); | ||||
|              // 从世界顶层往下找,直到遇到一个非空气方块 | ||||
|              Blocks.AIR == CurrentBlock || | ||||
|              Blocks.VOID_AIR == CurrentBlock || | ||||
|              Blocks.CAVE_AIR == CurrentBlock | ||||
|                 ;CurrentBlock = Source.getWorld().getBlockState(new BlockPos(Coordinate_X, Coordinate_Y, Coordinate_Z)).getBlock()){ | ||||
|             Coordinate_Y--;} | ||||
|             for (int x = -1; x <= 1; x++) { | ||||
|                 for (int z = -1; z <= 1; z++) { | ||||
|                     // 如果传送到的位置周围一圈是空气、水或岩浆,将其替换为玻璃 | ||||
|                     var BlockPos = new BlockPos(Coordinate_X - x, Coordinate_Y, Coordinate_Z - z); | ||||
|                     var CurrentBlock = Source.getWorld().getBlockState(BlockPos).getBlock(); | ||||
|                     if ( CurrentBlock == Blocks.AIR || | ||||
|                         CurrentBlock == Blocks.VOID_AIR || | ||||
|                         CurrentBlock == Blocks.CAVE_AIR || | ||||
|                         CurrentBlock == Blocks.WATER || | ||||
|                         CurrentBlock == Blocks.LAVA ){ | ||||
|                         // 只替换空气、水和岩浆,其余保留 | ||||
|                             Source.getWorld().setBlockState(BlockPos, Blocks.GLASS.getDefaultState());}}} | ||||
| //        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 && Distance(entity.getPos(), Coordinate) < 1e5){ | ||||
|             Retry++; | ||||
|             execute_command(Source, Radius,null, Origin); | ||||
|             return 0;} | ||||
|         if (Retry >= 126){ | ||||
|             Source.sendFeedback(()->{ return  Text.translatable("warning.twd.rtp.retry"); }, true);} | ||||
|         entity.teleport(Coordinate_X, Coordinate_Y, Coordinate_Z); | ||||
|         final int FinalCoordinate_Y = Coordinate_Y; | ||||
|         Source.sendFeedback(()->{ return  Text.translatable("info.twd.rtp.success", entity.getName(), Coordinate_X, FinalCoordinate_Y, Coordinate_Z); },true); | ||||
|         return 0;} | ||||
|     static int execute_command_origin(ServerCommandSource Source, @Nullable Long Radius, @Nullable Entity Player, Entity Origin){ | ||||
|         return execute_command(Source, Radius, Player, Origin.getPos());} | ||||
|         // ↑ 高一层,人别站在土里了 | ||||
|         entity.teleport(Source.getWorld(),Coordinate_X + 0.5, Coordinate_Y, Coordinate_Z + 0.5, new HashSet<>(), entity.getYaw(), entity.getPitch(), false); | ||||
|         int finalCoordinate_X = Coordinate_X; | ||||
|         int finalCoordinate_Y = Coordinate_Y; | ||||
|         int finalCoordinate_Z = Coordinate_Z; | ||||
|         // ↑ "lambda 表达式中使用的变量应为 final 或有效 final" | ||||
|         final var FeedbackFallbackString = String.format("已将玩家%s传送到%d %d %d", entity.getName().getString(), Coordinate_X, finalCoordinate_Y, Coordinate_Z); | ||||
|         Source.sendFeedback(()->{ return  Text.translatableWithFallback("info.success", FeedbackFallbackString, entity.getName(), finalCoordinate_X, finalCoordinate_Y, finalCoordinate_Z); },true); | ||||
|         return 16;} | ||||
| } | ||||
| @@ -16,7 +16,10 @@ public class RandomTeleporter implements ModInitializer { | ||||
| 		// 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.info("RandomTeleporter Loading!"); | ||||
|  | ||||
| 		CommandRegister.Register(); | ||||
| 		LOGGER.info("Hello Fabric world!"); | ||||
|  | ||||
| 		LOGGER.info("RandomTeleporter Loaded!"); | ||||
| 	} | ||||
| } | ||||
| @@ -1,10 +0,0 @@ | ||||
| package xyz.thewhitedog9487; | ||||
|  | ||||
| import net.minecraft.util.math.Vec3d; | ||||
|  | ||||
| public class Toolbox { | ||||
|     static public double Distance(Vec3d A, Vec3d B){ | ||||
|         return Math.sqrt( | ||||
|                 Math.pow(A.getX() - B.getX(), 2) + | ||||
|                 Math.pow(A.getY() - B.getY(), 2));} | ||||
| } | ||||
| @@ -1,6 +1,9 @@ | ||||
| { | ||||
|   "modmenu.nameTranslation.randomteleporter": "RandomTeleporter", | ||||
|   "modmenu.descriptionTranslation.randomteleporter": "Added two commands for random teleportation", | ||||
|   "twd.bilibili": "Bilibili", | ||||
|   "twd.blog": "Blog" | ||||
|   "info.success": "Teleported %s to %d %d %d", | ||||
|   "error.no_target": "There is no teleported target, and the teleported player ID is explicitly specified when executed by a non-player object", | ||||
|   "warning.radius_equal_zero": "Warning: Since you set a random radius of 0, selecting the right height will teleport you directly to %d %d", | ||||
|   "warning.radius_equal_zero_no_target": "Warning: Since you set a random radius of 0 and you don't set a random center point coordinates, nothing happens", | ||||
|   "bilibili": "Bilibili" | ||||
| } | ||||
| @@ -1,9 +1,9 @@ | ||||
| { | ||||
|   "modmenu.nameTranslation.randomteleporter": "随机传送", | ||||
|   "modmenu.descriptionTranslation.randomteleporter": "增加了两个用于随机传送的命令", | ||||
|   "info.twd.rtp.success": "已将玩家%s传送到%d %d %d", | ||||
|   "error.twd.rtp.not_player": "执行命令的不是玩家", | ||||
|   "warning.twd.rtp.retry": "重试次数过大,为避免死循环将在本次传送中取消距离保护", | ||||
|   "twd.bilibili": "哔哩哔哩主页", | ||||
|   "twd.blog": "TheWhiteDog9487的博客" | ||||
|   "info.success": "已将玩家%s传送到%d %d %d", | ||||
|   "error.no_target": "不存在被传送目标,由非玩家物体执行命令时请显式指定被传送玩家ID", | ||||
|   "warning.radius_equal_zero": "警告:由于你设置的随机半径为0,因此在选择出合适高度之后将直接把你传送至%d %d", | ||||
|   "warning.radius_equal_zero_no_target": "警告:由于你设置的随机半径为0,并且未设置随机中心点坐标,因此什么都不会发生", | ||||
|   "bilibili": "TheWhiteDog9487的哔哩哔哩主页" | ||||
| } | ||||
| @@ -27,10 +27,10 @@ | ||||
| 		} | ||||
| 	], | ||||
| 	"depends": { | ||||
| 		"fabricloader": ">=0.15.6", | ||||
| 		"minecraft": "~1.20.4", | ||||
| 		"java": ">=17", | ||||
| 		"fabric-api": "*" | ||||
| 		"fabricloader": ">=0.16.14", | ||||
| 		"minecraft": "1.21.8", | ||||
| 		"java": ">=21", | ||||
| 		"fabric-api": ">=0.129.0" | ||||
| 	}, | ||||
| 	"suggests": { | ||||
| 		"another-mod": "*" | ||||
| @@ -38,7 +38,6 @@ | ||||
| 	"custom": { | ||||
| 		"modmenu": { | ||||
| 			"links": { | ||||
| 				"twd.bilibili": "https://space.bilibili.com/401746666", | ||||
| 				"twd.blog": "www.thewhitedog9487.xyz"}, | ||||
| 				"bilibili": "https://space.bilibili.com/401746666"}, | ||||
| 			"update_checker": true}} | ||||
| } | ||||
| @@ -1,7 +1,7 @@ | ||||
| { | ||||
| 	"required": false, | ||||
| 	"package": "xyz.thewhitedog9487.mixin", | ||||
| 	"compatibilityLevel": "JAVA_17", | ||||
| 	"compatibilityLevel": "JAVA_21", | ||||
| 	"mixins": [ | ||||
|  | ||||
| 	], | ||||
|   | ||||
		Reference in New Issue
	
	Block a user