Renamed BelowNameScoreboard to BelowNameTag

This commit is contained in:
R0bbyYT 2020-08-08 13:36:15 +02:00
parent 1ad20209d0
commit bbe9cda40b
2 changed files with 12 additions and 12 deletions

View File

@ -34,7 +34,7 @@ import net.minestom.server.network.player.PlayerConnection;
import net.minestom.server.recipe.Recipe;
import net.minestom.server.recipe.RecipeManager;
import net.minestom.server.resourcepack.ResourcePack;
import net.minestom.server.scoreboard.BelowNameScoreboard;
import net.minestom.server.scoreboard.BelowNameTag;
import net.minestom.server.scoreboard.Team;
import net.minestom.server.sound.Sound;
import net.minestom.server.sound.SoundCategory;
@ -109,7 +109,7 @@ public class Player extends LivingEntity implements CommandSender {
private int blockBreakTime;
private Set<BossBar> bossBars = new CopyOnWriteArraySet<>();
private BelowNameScoreboard belowNameScoreboard = null;
private BelowNameTag belowNameTag = null;
/**
* Last damage source to hit this player, used to display the death message.
@ -1373,16 +1373,16 @@ public class Player extends LivingEntity implements CommandSender {
/**
* Change the tag below the name
*
* @param belowNameScoreboard The new below name tag
* @param belowNameTag The new below name tag
*/
public void setBelowNameScoreboard(BelowNameScoreboard belowNameScoreboard) {
if (this.belowNameScoreboard == belowNameScoreboard) return;
public void setBelowNameTag(BelowNameTag belowNameTag) {
if (this.belowNameTag == belowNameTag) return;
if (this.belowNameScoreboard != null) {
this.belowNameScoreboard.removeViewer(this);
if (this.belowNameTag != null) {
this.belowNameTag.removeViewer(this);
}
this.belowNameScoreboard = belowNameScoreboard;
this.belowNameTag = belowNameTag;
}
@Override

View File

@ -15,7 +15,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
/**
* Represents a scoreboard which rendered a tag below the name
*/
public class BelowNameScoreboard implements Viewable {
public class BelowNameTag implements Viewable {
private final Set<Player> viewers = new CopyOnWriteArraySet<>();
private final String objectiveName;
@ -30,7 +30,7 @@ public class BelowNameScoreboard implements Viewable {
* @param name The objective name of the scoreboard
* @param value The value of the scoreboard
*/
public BelowNameScoreboard(String name, String value) {
public BelowNameTag(String name, String value) {
this.objectiveName = name;
this.scoreboardObjectivePacket = this.getCreationObjectivePacket(value);
@ -99,7 +99,7 @@ public class BelowNameScoreboard implements Viewable {
connection.sendPacket(this.scoreboardObjectivePacket);
connection.sendPacket(this.displayScoreboardPacket);
player.setBelowNameScoreboard(this);
player.setBelowNameTag(this);
}
return result;
@ -112,7 +112,7 @@ public class BelowNameScoreboard implements Viewable {
if (result) {
connection.sendPacket(this.destructionObjectivePacket);
player.setBelowNameScoreboard(null);
player.setBelowNameTag(null);
}
return result;