use of net.minecraft.network.play.server.SPacketDisplayObjective in project SpongeCommon by SpongePowered.
the class MixinScoreboardLogic method scoreboard$updateDisplaySlot.
public void scoreboard$updateDisplaySlot(@Nullable Objective objective, DisplaySlot displaySlot) {
if (objective != null && !objective.getScoreboards().contains(this)) {
throw new IllegalStateException("Attempting to set an objective's display slot that does not exist on this scoreboard!");
}
int index = ((SpongeDisplaySlot) displaySlot).getIndex();
this.objectiveDisplaySlots[index] = objective == null ? null : ((SpongeObjective) objective).getObjectiveFor(this);
this.sendToPlayers(new SPacketDisplayObjective(index, this.objectiveDisplaySlots[index]));
}
Aggregations