Skip to content

Commit

Permalink
修复玩家修改名字时领地丢失的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdeZhang committed Jun 21, 2024
1 parent ea9be48 commit a568d87
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>cn.lunadeer</groupId>
<artifactId>Dominion</artifactId>
<version>1.32.1-beta</version>
<version>1.32.2-beta</version>
<packaging>jar</packaging>

<name>Dominion</name>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/cn/lunadeer/dominion/dtos/PlayerDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public static List<PlayerDTO> all() {
return query(sql);
}

public PlayerDTO onJoin() {
public PlayerDTO onJoin(String name) {
this.setLastKnownName(name);
return update(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class PlayerEvents implements Listener {
public void onPlayerJoin(PlayerJoinEvent event) {
Player bukkitPlayer = event.getPlayer();
PlayerDTO player = PlayerDTO.get(bukkitPlayer);
player.onJoin(); // update name
player.onJoin(bukkitPlayer.getName()); // update name
}

@EventHandler
Expand Down

0 comments on commit a568d87

Please sign in to comment.