2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/ScoreboardServer.java
|
|
|
|
+++ b/net/minecraft/server/ScoreboardServer.java
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -22,7 +22,7 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
public void handleScoreChanged(ScoreboardScore scoreboardscore) {
|
|
|
|
super.handleScoreChanged(scoreboardscore);
|
|
|
|
if (this.b.contains(scoreboardscore.getObjective())) {
|
2018-07-15 02:00:00 +02:00
|
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardScore(ScoreboardServer.Action.CHANGE, scoreboardscore.getObjective().getName(), scoreboardscore.getPlayerName(), scoreboardscore.getScore()));
|
|
|
|
+ this.sendAll(new PacketPlayOutScoreboardScore(ScoreboardServer.Action.CHANGE, scoreboardscore.getObjective().getName(), scoreboardscore.getPlayerName(), scoreboardscore.getScore()));
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
this.b();
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -31,7 +31,7 @@
|
|
|
|
@Override
|
2014-11-25 22:32:16 +01:00
|
|
|
public void handlePlayerRemoved(String s) {
|
|
|
|
super.handlePlayerRemoved(s);
|
2018-07-15 02:00:00 +02:00
|
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardScore(ScoreboardServer.Action.REMOVE, (String) null, s, 0));
|
|
|
|
+ this.sendAll(new PacketPlayOutScoreboardScore(ScoreboardServer.Action.REMOVE, (String) null, s, 0));
|
2014-11-25 22:32:16 +01:00
|
|
|
this.b();
|
|
|
|
}
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -39,7 +39,7 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
public void a(String s, ScoreboardObjective scoreboardobjective) {
|
|
|
|
super.a(s, scoreboardobjective);
|
2018-07-15 02:00:00 +02:00
|
|
|
if (this.b.contains(scoreboardobjective)) {
|
|
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardScore(ScoreboardServer.Action.REMOVE, scoreboardobjective.getName(), s, 0));
|
|
|
|
+ this.sendAll(new PacketPlayOutScoreboardScore(ScoreboardServer.Action.REMOVE, scoreboardobjective.getName(), s, 0));
|
|
|
|
}
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2018-07-15 02:00:00 +02:00
|
|
|
this.b();
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -52,7 +52,7 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
super.setDisplaySlot(i, scoreboardobjective);
|
|
|
|
if (scoreboardobjective1 != scoreboardobjective && scoreboardobjective1 != null) {
|
|
|
|
if (this.h(scoreboardobjective1) > 0) {
|
|
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardDisplayObjective(i, scoreboardobjective));
|
2015-02-26 23:41:06 +01:00
|
|
|
+ this.sendAll(new PacketPlayOutScoreboardDisplayObjective(i, scoreboardobjective));
|
2014-11-25 22:32:16 +01:00
|
|
|
} else {
|
|
|
|
this.g(scoreboardobjective1);
|
|
|
|
}
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -60,7 +60,7 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
if (scoreboardobjective != null) {
|
|
|
|
if (this.b.contains(scoreboardobjective)) {
|
|
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardDisplayObjective(i, scoreboardobjective));
|
2015-02-26 23:41:06 +01:00
|
|
|
+ this.sendAll(new PacketPlayOutScoreboardDisplayObjective(i, scoreboardobjective));
|
2014-11-25 22:32:16 +01:00
|
|
|
} else {
|
|
|
|
this.e(scoreboardobjective);
|
|
|
|
}
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -72,7 +72,7 @@
|
|
|
|
@Override
|
2018-07-15 02:00:00 +02:00
|
|
|
public boolean addPlayerToTeam(String s, ScoreboardTeam scoreboardteam) {
|
|
|
|
if (super.addPlayerToTeam(s, scoreboardteam)) {
|
2018-12-25 22:00:00 +01:00
|
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, Arrays.asList(s), 3));
|
|
|
|
+ this.sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, Arrays.asList(s), 3));
|
2014-11-25 22:32:16 +01:00
|
|
|
this.b();
|
|
|
|
return true;
|
|
|
|
} else {
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -83,7 +83,7 @@
|
|
|
|
@Override
|
2014-11-25 22:32:16 +01:00
|
|
|
public void removePlayerFromTeam(String s, ScoreboardTeam scoreboardteam) {
|
|
|
|
super.removePlayerFromTeam(s, scoreboardteam);
|
2018-12-25 22:00:00 +01:00
|
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, Arrays.asList(s), 4));
|
|
|
|
+ this.sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, Arrays.asList(s), 4));
|
2014-11-25 22:32:16 +01:00
|
|
|
this.b();
|
|
|
|
}
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -97,7 +97,7 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
public void handleObjectiveChanged(ScoreboardObjective scoreboardobjective) {
|
|
|
|
super.handleObjectiveChanged(scoreboardobjective);
|
|
|
|
if (this.b.contains(scoreboardobjective)) {
|
|
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardObjective(scoreboardobjective, 2));
|
2015-02-26 23:41:06 +01:00
|
|
|
+ this.sendAll(new PacketPlayOutScoreboardObjective(scoreboardobjective, 2));
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
this.b();
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -116,21 +116,21 @@
|
|
|
|
@Override
|
2014-11-25 22:32:16 +01:00
|
|
|
public void handleTeamAdded(ScoreboardTeam scoreboardteam) {
|
|
|
|
super.handleTeamAdded(scoreboardteam);
|
|
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, 0));
|
2015-02-26 23:41:06 +01:00
|
|
|
+ this.sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, 0));
|
2014-11-25 22:32:16 +01:00
|
|
|
this.b();
|
|
|
|
}
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@Override
|
2014-11-25 22:32:16 +01:00
|
|
|
public void handleTeamChanged(ScoreboardTeam scoreboardteam) {
|
|
|
|
super.handleTeamChanged(scoreboardteam);
|
|
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, 2));
|
2015-02-26 23:41:06 +01:00
|
|
|
+ this.sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, 2));
|
2014-11-25 22:32:16 +01:00
|
|
|
this.b();
|
|
|
|
}
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@Override
|
2014-11-25 22:32:16 +01:00
|
|
|
public void handleTeamRemoved(ScoreboardTeam scoreboardteam) {
|
|
|
|
super.handleTeamRemoved(scoreboardteam);
|
|
|
|
- this.a.getPlayerList().sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, 1));
|
2015-02-26 23:41:06 +01:00
|
|
|
+ this.sendAll(new PacketPlayOutScoreboardTeam(scoreboardteam, 1));
|
2014-11-25 22:32:16 +01:00
|
|
|
this.b();
|
|
|
|
}
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -179,6 +179,7 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
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()) {
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -211,6 +212,7 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
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()) {
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -235,6 +237,16 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
return i;
|
|
|
|
}
|
2018-07-15 02:00:00 +02:00
|
|
|
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // 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
|
2018-07-15 02:00:00 +02:00
|
|
|
+
|
|
|
|
public static enum Action {
|
|
|
|
|
|
|
|
CHANGE, REMOVE;
|