Fix fake player entity removal

This commit is contained in:
Moulberry committed 2024-11-17 02:17:20 +08:00
1 parent 1c6dfca638
commit c209ff2e23
4 files changed
+19 -21

No files matched your search

@@ -23,6 +23,16 @@ public class FakePlayer extends ServerPlayer {
super(minecraftServer, serverLevel, gameProfile, clientInformation);
}
@Override
public void remove(RemovalReason removalReason) {
if (removalReason == RemovalReason.DISCARDED && !this.hasDisconnected()) {
this.disconnect();
this.server.getPlayerList().remove(this);
} else {
super.remove(removalReason);
}
}
@Override
public void sendChatMessage(OutgoingChatMessage outgoingChatMessage, boolean bl, ChatType.Bound bound) {
}