diff --git a/api/src/main/java/net/draycia/carbon/api/users/CarbonPlayer.java b/api/src/main/java/net/draycia/carbon/api/users/CarbonPlayer.java index b21d46209..829aaff53 100644 --- a/api/src/main/java/net/draycia/carbon/api/users/CarbonPlayer.java +++ b/api/src/main/java/net/draycia/carbon/api/users/CarbonPlayer.java @@ -407,6 +407,4 @@ record ChannelMessage(Component message, ChatChannel channel) {} CompletableFuture<@Nullable Party> party(); - void party(@Nullable Party party); - } diff --git a/common/src/main/java/net/draycia/carbon/common/users/CarbonPlayerCommon.java b/common/src/main/java/net/draycia/carbon/common/users/CarbonPlayerCommon.java index ed5448460..30b8098ee 100644 --- a/common/src/main/java/net/draycia/carbon/common/users/CarbonPlayerCommon.java +++ b/common/src/main/java/net/draycia/carbon/common/users/CarbonPlayerCommon.java @@ -499,7 +499,6 @@ public void saved() { return this.users.party(id); } - @Override public void party(final @Nullable Party party) { this.party.set(party == null ? null : party.id()); } diff --git a/common/src/main/java/net/draycia/carbon/common/users/ConsoleCarbonPlayer.java b/common/src/main/java/net/draycia/carbon/common/users/ConsoleCarbonPlayer.java index 849ae2d21..2a2f83727 100644 --- a/common/src/main/java/net/draycia/carbon/common/users/ConsoleCarbonPlayer.java +++ b/common/src/main/java/net/draycia/carbon/common/users/ConsoleCarbonPlayer.java @@ -253,11 +253,6 @@ public void leaveChannel(final ChatChannel channel) { return CompletableFuture.completedFuture(null); } - @Override - public void party(final @Nullable Party party) { - - } - @Override public @NotNull Identity identity() { return Identity.nil(); diff --git a/common/src/main/java/net/draycia/carbon/common/users/PartyImpl.java b/common/src/main/java/net/draycia/carbon/common/users/PartyImpl.java index 1e9ea7951..864106f17 100644 --- a/common/src/main/java/net/draycia/carbon/common/users/PartyImpl.java +++ b/common/src/main/java/net/draycia/carbon/common/users/PartyImpl.java @@ -84,7 +84,7 @@ public void addMember(final UUID id) { this.userManager.user(id).thenCompose(user -> { final WrappedCarbonPlayer wrapped = (WrappedCarbonPlayer) user; final @Nullable UUID oldPartyId = wrapped.partyId(); - user.party(this); + wrapped.party(this); if (oldPartyId != null) { return this.userManager.party(oldPartyId).thenAccept(old -> { if (old != null) { @@ -112,7 +112,7 @@ public void removeMember(final UUID id) { this.userManager.user(id).thenAccept(user -> { final WrappedCarbonPlayer wrapped = (WrappedCarbonPlayer) user; if (Objects.equals(wrapped.partyId(), this.id)) { - user.party(null); + wrapped.party(null); } }).whenComplete(exceptionHandler); } @@ -130,7 +130,7 @@ public void disband() { if (this.disbanded) { throw new IllegalStateException("This party is already disbanded."); } - this.server.players().stream().filter(p -> this.members.contains(p.uuid())).forEach(p -> p.party(null)); + this.server.players().stream().filter(p -> this.members.contains(p.uuid())).forEach(p -> ((WrappedCarbonPlayer) p).party(null)); this.userManager.disbandParty(this.id); this.disbanded = true; } diff --git a/common/src/main/java/net/draycia/carbon/common/users/WrappedCarbonPlayer.java b/common/src/main/java/net/draycia/carbon/common/users/WrappedCarbonPlayer.java index 661de2e8d..2d26dad83 100644 --- a/common/src/main/java/net/draycia/carbon/common/users/WrappedCarbonPlayer.java +++ b/common/src/main/java/net/draycia/carbon/common/users/WrappedCarbonPlayer.java @@ -439,7 +439,6 @@ public int hashCode() { return this.carbonPlayerCommon.party(); } - @Override public void party(final @Nullable Party party) { this.carbonPlayerCommon.party(party); }