Skip to content

Commit

Permalink
Fix self not visible on tab list when vanished on login
Browse files Browse the repository at this point in the history
  • Loading branch information
aromaa committed Dec 7, 2023
1 parent aed8395 commit 86fc1c9
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,11 @@ public abstract class PlayerListMixin implements PlayerListBridge {
target = "Lnet/minecraft/server/players/PlayerList;broadcastAll(Lnet/minecraft/network/protocol/Packet;)V"
)
)
private void impl$sendScoreboard(final PlayerList playerList, final Packet<?> addPlayer,
private void impl$onlySendSelfAddPlayerOnVanished(final PlayerList playerList, final Packet<?> addPlayer,
final Connection playerConnection, final net.minecraft.server.level.ServerPlayer serverPlayer
) {
if (((VanishableBridge) serverPlayer).bridge$vanishState().invisible()) {
playerConnection.send(addPlayer);
return;
}
playerList.broadcastAll(addPlayer);
Expand All @@ -418,17 +419,8 @@ public abstract class PlayerListMixin implements PlayerListBridge {
method = "placeNewPlayer",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket;createPlayerInitializing(Ljava/util/Collection;)Lnet/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket;"
),
slice = @Slice(
from = @At(
value = "INVOKE",
target = "Lnet/minecraft/server/level/ServerPlayer;sendServerStatus(Lnet/minecraft/network/protocol/status/ServerStatus;)V"
),
to = @At(
value = "INVOKE",
target = "Lnet/minecraft/server/level/ServerLevel;addNewPlayer(Lnet/minecraft/server/level/ServerPlayer;)V"
)
target = "Lnet/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket;createPlayerInitializing(Ljava/util/Collection;)Lnet/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket;",
ordinal = 0
)
)
private ClientboundPlayerInfoUpdatePacket impl$onlySendAddPlayerForUnvanishedPlayers(final Collection<net.minecraft.server.level.ServerPlayer> $$0) {
Expand Down

0 comments on commit 86fc1c9

Please sign in to comment.