use of org.spongepowered.common.accessor.world.scores.ScoreboardAccessor in project SpongeCommon by SpongePowered.
the class ServerScoreboardMixin method bridge$updateDisplaySlot.
@Override
public void bridge$updateDisplaySlot(@Nullable final Objective objective, final int slot) throws IllegalStateException {
if (objective != null && !objective.scoreboards().contains(this)) {
throw new IllegalStateException("Attempting to set an objective's display slot that does not exist on this scoreboard!");
}
((ScoreboardAccessor) this).accessor$displayObjectives()[slot] = objective == null ? null : ((SpongeObjective) objective).getObjectiveFor(this);
((ServerScoreboardBridge) this).bridge$sendToPlayers(new ClientboundSetDisplayObjectivePacket(slot, ((ScoreboardAccessor) this).accessor$displayObjectives()[slot]));
}
Aggregations