Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-21 05:50:05 +01:00
90ac03522a
This reverts commit d6e3dff7d8
.
127 Zeilen
5.9 KiB
Diff
127 Zeilen
5.9 KiB
Diff
--- ../work/decompile-8eb82bde//net/minecraft/server/ScoreboardServer.java 2014-11-28 17:43:43.369707429 +0000
|
|
+++ src/main/java/net/minecraft/server/ScoreboardServer.java 2014-11-28 17:38:17.000000000 +0000
|
|
@@ -21,7 +21,7 @@
|
|
public void handleScoreChanged(ScoreboardScore scoreboardscore) {
|
|
super.handleScoreChanged(scoreboardscore);
|
|
if (this.b.contains(scoreboardscore.getObjective())) {
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardScore(scoreboardscore));
|
|
+ this.sendAll(new PacketPlayOutScoreboardScore(scoreboardscore)); // CraftBukkit - Internal packet method
|
|
}
|
|
|
|
this.b();
|
|
@@ -29,13 +29,13 @@
|
|
|
|
public void handlePlayerRemoved(String s) {
|
|
super.handlePlayerRemoved(s);
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardScore(s));
|
|
+ this.sendAll(new PacketPlayOutScoreboardScore(s)); // CraftBukkit - Internal packet method
|
|
this.b();
|
|
}
|
|
|
|
public void a(String s, ScoreboardObjective scoreboardobjective) {
|
|
super.a(s, scoreboardobjective);
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardScore(s, scoreboardobjective));
|
|
+ this.sendAll(new PacketPlayOutScoreboardScore(s, scoreboardobjective)); // CraftBukkit - Internal packet method
|
|
this.b();
|
|
}
|
|
|
|
@@ -45,7 +45,7 @@
|
|
super.setDisplaySlot(i, scoreboardobjective);
|
|
if (scoreboardobjective1 != scoreboardobjective && scoreboardobjective1 != null) {
|
|
if (this.h(scoreboardobjective1) > 0) {
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardDisplayObjective(i, scoreboardobjective));
|
|
+ this.sendAll(new PacketPlayOutScoreboardDisplayObjective(i, scoreboardobjective)); // CraftBukkit - Internal packet method
|
|
} else {
|
|
this.g(scoreboardobjective1);
|
|
}
|
|
@@ -53,7 +53,7 @@
|
|
|
|
if (scoreboardobjective != null) {
|
|
if (this.b.contains(scoreboardobjective)) {
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardDisplayObjective(i, scoreboardobjective));
|
|
+ this.sendAll(new PacketPlayOutScoreboardDisplayObjective(i, scoreboardobjective)); // CraftBukkit - Internal packet method
|
|
} else {
|
|
this.e(scoreboardobjective);
|
|
}
|
|
@@ -66,7 +66,7 @@
|
|
if (super.addPlayerToTeam(s, s1)) {
|
|
ScoreboardTeam scoreboardteam = this.getTeam(s1);
|
|
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, Arrays.asList(new String[] { s}), 3));
|
|
+ this.sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, Arrays.asList(new String[] { s}), 3)); // CraftBukkit - Internal packet method
|
|
this.b();
|
|
return true;
|
|
} else {
|
|
@@ -76,7 +76,7 @@
|
|
|
|
public void removePlayerFromTeam(String s, ScoreboardTeam scoreboardteam) {
|
|
super.removePlayerFromTeam(s, scoreboardteam);
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, Arrays.asList(new String[] { s}), 4));
|
|
+ this.sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, Arrays.asList(new String[] { s}), 4)); // CraftBukkit - Internal packet method
|
|
this.b();
|
|
}
|
|
|
|
@@ -88,7 +88,7 @@
|
|
public void handleObjectiveChanged(ScoreboardObjective scoreboardobjective) {
|
|
super.handleObjectiveChanged(scoreboardobjective);
|
|
if (this.b.contains(scoreboardobjective)) {
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardObjective(scoreboardobjective, 2));
|
|
+ this.sendAll(new PacketPlayOutScoreboardObjective(scoreboardobjective, 2)); // CraftBukkit - Internal packet method
|
|
}
|
|
|
|
this.b();
|
|
@@ -105,19 +105,19 @@
|
|
|
|
public void handleTeamAdded(ScoreboardTeam scoreboardteam) {
|
|
super.handleTeamAdded(scoreboardteam);
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, 0));
|
|
+ this.sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, 0)); // CraftBukkit - Internal packet method
|
|
this.b();
|
|
}
|
|
|
|
public void handleTeamChanged(ScoreboardTeam scoreboardteam) {
|
|
super.handleTeamChanged(scoreboardteam);
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, 2));
|
|
+ this.sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, 2)); // CraftBukkit - Internal packet method
|
|
this.b();
|
|
}
|
|
|
|
public void handleTeamRemoved(ScoreboardTeam scoreboardteam) {
|
|
super.handleTeamRemoved(scoreboardteam);
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, 1));
|
|
+ this.sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, 1)); // CraftBukkit - Internal packet method
|
|
this.b();
|
|
}
|
|
|
|
@@ -160,6 +160,7 @@
|
|
|
|
while (iterator.hasNext()) {
|
|
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
|
+ if (entityplayer.getBukkitEntity().getScoreboard().getHandle() != this) continue; // CraftBukkit - Only players on this board
|
|
Iterator iterator1 = list.iterator();
|
|
|
|
while (iterator1.hasNext()) {
|
|
@@ -192,6 +193,7 @@
|
|
|
|
while (iterator.hasNext()) {
|
|
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
|
+ if (entityplayer.getBukkitEntity().getScoreboard().getHandle() != this) continue; // CraftBukkit - Only players on this board
|
|
Iterator iterator1 = list.iterator();
|
|
|
|
while (iterator1.hasNext()) {
|
|
@@ -215,4 +217,14 @@
|
|
|
|
return i;
|
|
}
|
|
+
|
|
+ // CraftBukkit start - Send to players
|
|
+ private void sendAll(Packet packet) {
|
|
+ for (EntityPlayer entityplayer : (List<EntityPlayer>) this.a.getPlayerList().players) {
|
|
+ if (entityplayer.getBukkitEntity().getScoreboard().getHandle() == this) {
|
|
+ entityplayer.playerConnection.sendPacket(packet);
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+ // CraftBukkit end
|
|
}
|