Skip to content

Commit

Permalink
fix removing score on packetevents
Browse files Browse the repository at this point in the history
  • Loading branch information
vytskalt committed Oct 13, 2024
1 parent acd64b8 commit b0d6903
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.megavex.scoreboardlibrary.implementation.packetAdapter.packetevents;

import com.github.retrooper.packetevents.PacketEventsAPI;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerDisplayScoreboard;
Expand Down Expand Up @@ -107,12 +108,10 @@ public void removeScore(@NotNull Collection<Player> players, @NotNull String ent
objectiveName
);

for (Player player : players) {
if (packetEvents.getPlayerManager().getClientVersion(player).isNewerThanOrEquals(ClientVersion.V_1_20_3)) {
provider.sendPacket(players, newPacket);
} else {
provider.sendPacket(players, oldPacket);
}
if (packetEvents.getServerManager().getVersion().isNewerThanOrEquals(ServerVersion.V_1_20_3)) {
provider.sendPacket(players, newPacket);
} else {
provider.sendPacket(players, oldPacket);
}
}

Expand Down

0 comments on commit b0d6903

Please sign in to comment.