Java 类net.minecraft.network.play.server.SPacketScoreboardObjective 实例源码

项目:Backmemed    文件:ServerScoreboard.java   
public List < Packet<? >> getCreatePackets(ScoreObjective objective)
{
    List < Packet<? >> list = Lists. < Packet<? >> newArrayList();
    list.add(new SPacketScoreboardObjective(objective, 0));

    for (int i = 0; i < 19; ++i)
    {
        if (this.getObjectiveInDisplaySlot(i) == objective)
        {
            list.add(new SPacketDisplayObjective(i, objective));
        }
    }

    for (Score score : this.getSortedScores(objective))
    {
        list.add(new SPacketUpdateScore(score));
    }

    return list;
}
项目:CustomWorldGen    文件:ServerScoreboard.java   
public List < Packet<? >> getCreatePackets(ScoreObjective objective)
{
    List < Packet<? >> list = Lists. < Packet<? >> newArrayList();
    list.add(new SPacketScoreboardObjective(objective, 0));

    for (int i = 0; i < 19; ++i)
    {
        if (this.getObjectiveInDisplaySlot(i) == objective)
        {
            list.add(new SPacketDisplayObjective(i, objective));
        }
    }

    for (Score score : this.getSortedScores(objective))
    {
        list.add(new SPacketUpdateScore(score));
    }

    return list;
}
项目:Zombe-Modpack    文件:NetHandlerPlayClient.java   
/**
 * May create a scoreboard objective, remove an objective from the scoreboard or update an objectives' displayname
 */
public void handleScoreboardObjective(SPacketScoreboardObjective packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Scoreboard scoreboard = this.clientWorldController.getScoreboard();

    if (packetIn.getAction() == 0)
    {
        ScoreObjective scoreobjective = scoreboard.addScoreObjective(packetIn.getObjectiveName(), IScoreCriteria.DUMMY);
        scoreobjective.setDisplayName(packetIn.getObjectiveValue());
        scoreobjective.setRenderType(packetIn.getRenderType());
    }
    else
    {
        ScoreObjective scoreobjective1 = scoreboard.getObjective(packetIn.getObjectiveName());

        if (packetIn.getAction() == 1)
        {
            scoreboard.removeObjective(scoreobjective1);
        }
        else if (packetIn.getAction() == 2)
        {
            scoreobjective1.setDisplayName(packetIn.getObjectiveValue());
            scoreobjective1.setRenderType(packetIn.getRenderType());
        }
    }
}
项目:Backmemed    文件:NetHandlerPlayClient.java   
/**
 * May create a scoreboard objective, remove an objective from the scoreboard or update an objectives' displayname
 */
public void handleScoreboardObjective(SPacketScoreboardObjective packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Scoreboard scoreboard = this.clientWorldController.getScoreboard();

    if (packetIn.getAction() == 0)
    {
        ScoreObjective scoreobjective = scoreboard.addScoreObjective(packetIn.getObjectiveName(), IScoreCriteria.DUMMY);
        scoreobjective.setDisplayName(packetIn.getObjectiveValue());
        scoreobjective.setRenderType(packetIn.getRenderType());
    }
    else
    {
        ScoreObjective scoreobjective1 = scoreboard.getObjective(packetIn.getObjectiveName());

        if (packetIn.getAction() == 1)
        {
            scoreboard.removeObjective(scoreobjective1);
        }
        else if (packetIn.getAction() == 2)
        {
            scoreobjective1.setDisplayName(packetIn.getObjectiveValue());
            scoreobjective1.setRenderType(packetIn.getRenderType());
        }
    }
}
项目:Backmemed    文件:ServerScoreboard.java   
public void onObjectiveDisplayNameChanged(ScoreObjective objective)
{
    super.onObjectiveDisplayNameChanged(objective);

    if (this.addedObjectives.contains(objective))
    {
        this.scoreboardMCServer.getPlayerList().sendPacketToAllPlayers(new SPacketScoreboardObjective(objective, 2));
    }

    this.markSaveDataDirty();
}
项目:Backmemed    文件:ServerScoreboard.java   
public List < Packet<? >> getDestroyPackets(ScoreObjective p_96548_1_)
{
    List < Packet<? >> list = Lists. < Packet<? >> newArrayList();
    list.add(new SPacketScoreboardObjective(p_96548_1_, 1));

    for (int i = 0; i < 19; ++i)
    {
        if (this.getObjectiveInDisplaySlot(i) == p_96548_1_)
        {
            list.add(new SPacketDisplayObjective(i, p_96548_1_));
        }
    }

    return list;
}
项目:CustomWorldGen    文件:NetHandlerPlayClient.java   
/**
 * May create a scoreboard objective, remove an objective from the scoreboard or update an objectives' displayname
 */
public void handleScoreboardObjective(SPacketScoreboardObjective packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Scoreboard scoreboard = this.clientWorldController.getScoreboard();

    if (packetIn.getAction() == 0)
    {
        ScoreObjective scoreobjective = scoreboard.addScoreObjective(packetIn.getObjectiveName(), IScoreCriteria.DUMMY);
        scoreobjective.setDisplayName(packetIn.getObjectiveValue());
        scoreobjective.setRenderType(packetIn.getRenderType());
    }
    else
    {
        ScoreObjective scoreobjective1 = scoreboard.getObjective(packetIn.getObjectiveName());

        if (packetIn.getAction() == 1)
        {
            scoreboard.removeObjective(scoreobjective1);
        }
        else if (packetIn.getAction() == 2)
        {
            scoreobjective1.setDisplayName(packetIn.getObjectiveValue());
            scoreobjective1.setRenderType(packetIn.getRenderType());
        }
    }
}
项目:CustomWorldGen    文件:ServerScoreboard.java   
public void onObjectiveDisplayNameChanged(ScoreObjective objective)
{
    super.onObjectiveDisplayNameChanged(objective);

    if (this.addedObjectives.contains(objective))
    {
        this.scoreboardMCServer.getPlayerList().sendPacketToAllPlayers(new SPacketScoreboardObjective(objective, 2));
    }

    this.markSaveDataDirty();
}
项目:CustomWorldGen    文件:ServerScoreboard.java   
public List < Packet<? >> getDestroyPackets(ScoreObjective p_96548_1_)
{
    List < Packet<? >> list = Lists. < Packet<? >> newArrayList();
    list.add(new SPacketScoreboardObjective(p_96548_1_, 1));

    for (int i = 0; i < 19; ++i)
    {
        if (this.getObjectiveInDisplaySlot(i) == p_96548_1_)
        {
            list.add(new SPacketDisplayObjective(i, p_96548_1_));
        }
    }

    return list;
}
项目:ExpandedRailsMod    文件:NetHandlerPlayClient.java   
/**
 * May create a scoreboard objective, remove an objective from the scoreboard or update an objectives' displayname
 */
public void handleScoreboardObjective(SPacketScoreboardObjective packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Scoreboard scoreboard = this.clientWorldController.getScoreboard();

    if (packetIn.getAction() == 0)
    {
        ScoreObjective scoreobjective = scoreboard.addScoreObjective(packetIn.getObjectiveName(), IScoreCriteria.DUMMY);
        scoreobjective.setDisplayName(packetIn.getObjectiveValue());
        scoreobjective.setRenderType(packetIn.getRenderType());
    }
    else
    {
        ScoreObjective scoreobjective1 = scoreboard.getObjective(packetIn.getObjectiveName());

        if (packetIn.getAction() == 1)
        {
            scoreboard.removeObjective(scoreobjective1);
        }
        else if (packetIn.getAction() == 2)
        {
            scoreobjective1.setDisplayName(packetIn.getObjectiveValue());
            scoreobjective1.setRenderType(packetIn.getRenderType());
        }
    }
}
项目:Backmemed    文件:INetHandlerPlayClient.java   
/**
 * May create a scoreboard objective, remove an objective from the scoreboard or update an objectives' displayname
 */
void handleScoreboardObjective(SPacketScoreboardObjective packetIn);
项目:CustomWorldGen    文件:INetHandlerPlayClient.java   
/**
 * May create a scoreboard objective, remove an objective from the scoreboard or update an objectives' displayname
 */
void handleScoreboardObjective(SPacketScoreboardObjective packetIn);