Skip to content

Commit

Permalink
Fix 位置处理的判定
Browse files Browse the repository at this point in the history
  • Loading branch information
windy664 committed Feb 11, 2024
1 parent f95ba12 commit 7de32a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

group = 'org.windy'
version = '1.9-SNAPSHOT'
version = '2.0-SNAPSHOT'

repositories {
mavenCentral()
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/org/windy/spawnjoin/SpawnJoin.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@ public void onPlayerJoin(PlayerJoinEvent event) {

if (world != null) {
Location location = new Location(world, x, y, z);
for (int i = 0; i < n; i++) {
int n2 = 0;
while (player.getLocation().equals(location)) {
// 将玩家传送到指定位置
player.teleport(location);
n2++;
if(n2==n){
break;
}
}

} else {
// 处理无效的世界名称的情况,可能需要给出错误提示或者使用默认世界等
this.getServer().getConsoleSender().sendMessage(Texts.logo);
Expand Down Expand Up @@ -111,5 +117,6 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
public void onDisable() {
// Plugin shutdown logic
this.getServer().getConsoleSender().sendMessage(Texts.logo);
this.getServer().getConsoleSender().sendMessage("插件已被卸载,感谢使用!");
}
}

0 comments on commit 7de32a4

Please sign in to comment.