Search in sources :

Example 1 with SPacketDisplayObjective

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]));
}
Also used : SPacketDisplayObjective(net.minecraft.network.play.server.SPacketDisplayObjective) SpongeObjective(org.spongepowered.common.scoreboard.SpongeObjective) SpongeDisplaySlot(org.spongepowered.common.scoreboard.SpongeDisplaySlot)

Aggregations

SPacketDisplayObjective (net.minecraft.network.play.server.SPacketDisplayObjective)1 SpongeDisplaySlot (org.spongepowered.common.scoreboard.SpongeDisplaySlot)1 SpongeObjective (org.spongepowered.common.scoreboard.SpongeObjective)1