Skip to content

Commit d199b78

Browse files
fix: incorrect construction of nameandId
1 parent 789ec9f commit d199b78

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

common/src/main/java/dev/ftb/mods/ftbteams/data/PartyTeam.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public boolean isPartyTeam() {
6868
}
6969

7070
public int join(ServerPlayer player) throws CommandSyntaxException {
71-
return join(player, new NameAndId(player.getGameProfile()));
71+
return join(player, player.nameAndId());
7272
}
7373

7474
public int join(@Nullable ServerPlayer player, NameAndId playerProfile) throws CommandSyntaxException {

common/src/main/java/dev/ftb/mods/ftbteams/data/PlayerTeam.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public Team createParty(UUID playerId, @Nullable ServerPlayer player, String nam
108108
try {
109109
PartyTeam team = manager.createParty(playerId, player, name, description, Color4I.rgb(color));
110110
if (player != null) {
111-
team.invite(player, invited.stream().map(e -> new NameAndId(e)).toList());
111+
team.invite(player, invited.stream().map(NameAndId::new).toList());
112112
}
113113
return team;
114114
} catch (CommandSyntaxException ex) {

common/src/main/java/dev/ftb/mods/ftbteams/net/PlayerGUIOperationMessage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ private static void processTarget(ServerPlayer sourcePlayer, TeamRank senderRank
8383
if (senderRank.isAtLeast(TeamRank.OWNER)) {
8484
ServerPlayer p = sourcePlayer.level().getServer().getPlayerList().getPlayer(targetId);
8585
if (p != null) {
86-
partyTeam.transferOwnership(sourcePlayer.createCommandSourceStack(), new NameAndId(p.getGameProfile()));
86+
partyTeam.transferOwnership(sourcePlayer.createCommandSourceStack(), p.nameAndId());
8787
}
8888
}
8989
}
@@ -93,7 +93,7 @@ private static void processTarget(ServerPlayer sourcePlayer, TeamRank senderRank
9393
ServerPlayer p = sourcePlayer.level().getServer().getPlayerList().getPlayer(targetId);
9494
if (p != null) {
9595
// need the player to be online to receive an invitation
96-
partyTeam.invite(sourcePlayer, List.of(new NameAndId(p.getGameProfile())));
96+
partyTeam.invite(sourcePlayer, List.of(p.nameAndId()));
9797
}
9898
}
9999
}

0 commit comments

Comments
 (0)