geforkt von Mirrors/Paper
Improve scoreboard entries
Dieser Commit ist enthalten in:
Ursprung
d237e02832
Commit
6ad7b27bb3
@ -144,6 +144,15 @@ final class CraftObjective extends CraftScoreboardComponent implements Objective
|
|||||||
return new CraftScore(this, CraftScoreboard.getScoreHolder(entry));
|
return new CraftScore(this, CraftScoreboard.getScoreHolder(entry));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Paper start
|
||||||
|
@Override
|
||||||
|
public Score getScoreFor(org.bukkit.entity.Entity entity) throws IllegalArgumentException, IllegalStateException {
|
||||||
|
Preconditions.checkArgument(entity != null, "Entity cannot be null");
|
||||||
|
this.checkState();
|
||||||
|
return new CraftScore(this, ((org.bukkit.craftbukkit.entity.CraftEntity) entity).getHandle());
|
||||||
|
}
|
||||||
|
// Paper end
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void unregister() {
|
public void unregister() {
|
||||||
CraftScoreboard scoreboard = this.checkState();
|
CraftScoreboard scoreboard = this.checkState();
|
||||||
|
@ -235,6 +235,26 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
|
|||||||
this.board.setDisplayObjective(CraftScoreboardTranslations.fromBukkitSlot(slot), null);
|
this.board.setDisplayObjective(CraftScoreboardTranslations.fromBukkitSlot(slot), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Paper start
|
||||||
|
@Override
|
||||||
|
public ImmutableSet<Score> getScoresFor(org.bukkit.entity.Entity entity) throws IllegalArgumentException {
|
||||||
|
Preconditions.checkArgument(entity != null, "Entity cannot be null");
|
||||||
|
return this.getScores(((org.bukkit.craftbukkit.entity.CraftEntity) entity).getHandle());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void resetScoresFor(org.bukkit.entity.Entity entity) throws IllegalArgumentException {
|
||||||
|
Preconditions.checkArgument(entity != null, "Entity cannot be null");
|
||||||
|
this.resetScores(((org.bukkit.craftbukkit.entity.CraftEntity) entity).getHandle());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Team getEntityTeam(org.bukkit.entity.Entity entity) throws IllegalArgumentException {
|
||||||
|
Preconditions.checkArgument(entity != null, "Entity cannot be null");
|
||||||
|
return this.getEntryTeam(((org.bukkit.craftbukkit.entity.CraftEntity) entity).getHandle().getScoreboardName());
|
||||||
|
}
|
||||||
|
// Paper end
|
||||||
|
|
||||||
// CraftBukkit method
|
// CraftBukkit method
|
||||||
public Scoreboard getHandle() {
|
public Scoreboard getHandle() {
|
||||||
return this.board;
|
return this.board;
|
||||||
|
@ -304,6 +304,26 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Paper start
|
||||||
|
@Override
|
||||||
|
public void addEntity(org.bukkit.entity.Entity entity) throws IllegalStateException, IllegalArgumentException {
|
||||||
|
Preconditions.checkArgument(entity != null, "Entity cannot be null");
|
||||||
|
this.addEntry(((org.bukkit.craftbukkit.entity.CraftEntity) entity).getHandle().getScoreboardName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean removeEntity(org.bukkit.entity.Entity entity) throws IllegalStateException, IllegalArgumentException {
|
||||||
|
Preconditions.checkArgument(entity != null, "Entity cannot be null");
|
||||||
|
return this.removeEntry(((org.bukkit.craftbukkit.entity.CraftEntity) entity).getHandle().getScoreboardName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasEntity(org.bukkit.entity.Entity entity) throws IllegalStateException, IllegalArgumentException {
|
||||||
|
Preconditions.checkArgument(entity != null, "Entity cannot be null");
|
||||||
|
return this.hasEntry(((org.bukkit.craftbukkit.entity.CraftEntity) entity).getHandle().getScoreboardName());
|
||||||
|
}
|
||||||
|
// Paper end
|
||||||
|
|
||||||
public static Visibility bukkitToNotch(NameTagVisibility visibility) {
|
public static Visibility bukkitToNotch(NameTagVisibility visibility) {
|
||||||
switch (visibility) {
|
switch (visibility) {
|
||||||
case ALWAYS:
|
case ALWAYS:
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren