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

项目:Zombe-Modpack    文件:NetHandlerPlayClient.java   
/**
 * Either updates the score with a specified value or removes the score for an objective
 */
public void handleUpdateScore(SPacketUpdateScore packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Scoreboard scoreboard = this.clientWorldController.getScoreboard();
    ScoreObjective scoreobjective = scoreboard.getObjective(packetIn.getObjectiveName());

    if (packetIn.getScoreAction() == SPacketUpdateScore.Action.CHANGE)
    {
        Score score = scoreboard.getOrCreateScore(packetIn.getPlayerName(), scoreobjective);
        score.setScorePoints(packetIn.getScoreValue());
    }
    else if (packetIn.getScoreAction() == SPacketUpdateScore.Action.REMOVE)
    {
        if (StringUtils.isNullOrEmpty(packetIn.getObjectiveName()))
        {
            scoreboard.removeObjectiveFromEntity(packetIn.getPlayerName(), (ScoreObjective)null);
        }
        else if (scoreobjective != null)
        {
            scoreboard.removeObjectiveFromEntity(packetIn.getPlayerName(), scoreobjective);
        }
    }
}
项目:Backmemed    文件:NetHandlerPlayClient.java   
/**
 * Either updates the score with a specified value or removes the score for an objective
 */
public void handleUpdateScore(SPacketUpdateScore packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Scoreboard scoreboard = this.clientWorldController.getScoreboard();
    ScoreObjective scoreobjective = scoreboard.getObjective(packetIn.getObjectiveName());

    if (packetIn.getScoreAction() == SPacketUpdateScore.Action.CHANGE)
    {
        Score score = scoreboard.getOrCreateScore(packetIn.getPlayerName(), scoreobjective);
        score.setScorePoints(packetIn.getScoreValue());
    }
    else if (packetIn.getScoreAction() == SPacketUpdateScore.Action.REMOVE)
    {
        if (StringUtils.isNullOrEmpty(packetIn.getObjectiveName()))
        {
            scoreboard.removeObjectiveFromEntity(packetIn.getPlayerName(), (ScoreObjective)null);
        }
        else if (scoreobjective != null)
        {
            scoreboard.removeObjectiveFromEntity(packetIn.getPlayerName(), scoreobjective);
        }
    }
}
项目: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    文件:NetHandlerPlayClient.java   
/**
 * Either updates the score with a specified value or removes the score for an objective
 */
public void handleUpdateScore(SPacketUpdateScore packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Scoreboard scoreboard = this.clientWorldController.getScoreboard();
    ScoreObjective scoreobjective = scoreboard.getObjective(packetIn.getObjectiveName());

    if (packetIn.getScoreAction() == SPacketUpdateScore.Action.CHANGE)
    {
        Score score = scoreboard.getOrCreateScore(packetIn.getPlayerName(), scoreobjective);
        score.setScorePoints(packetIn.getScoreValue());
    }
    else if (packetIn.getScoreAction() == SPacketUpdateScore.Action.REMOVE)
    {
        if (StringUtils.isNullOrEmpty(packetIn.getObjectiveName()))
        {
            scoreboard.removeObjectiveFromEntity(packetIn.getPlayerName(), (ScoreObjective)null);
        }
        else if (scoreobjective != null)
        {
            scoreboard.removeObjectiveFromEntity(packetIn.getPlayerName(), scoreobjective);
        }
    }
}
项目: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;
}
项目:ExpandedRailsMod    文件:NetHandlerPlayClient.java   
/**
 * Either updates the score with a specified value or removes the score for an objective
 */
public void handleUpdateScore(SPacketUpdateScore packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Scoreboard scoreboard = this.clientWorldController.getScoreboard();
    ScoreObjective scoreobjective = scoreboard.getObjective(packetIn.getObjectiveName());

    if (packetIn.getScoreAction() == SPacketUpdateScore.Action.CHANGE)
    {
        Score score = scoreboard.getOrCreateScore(packetIn.getPlayerName(), scoreobjective);
        score.setScorePoints(packetIn.getScoreValue());
    }
    else if (packetIn.getScoreAction() == SPacketUpdateScore.Action.REMOVE)
    {
        if (StringUtils.isNullOrEmpty(packetIn.getObjectiveName()))
        {
            scoreboard.removeObjectiveFromEntity(packetIn.getPlayerName(), (ScoreObjective)null);
        }
        else if (scoreobjective != null)
        {
            scoreboard.removeObjectiveFromEntity(packetIn.getPlayerName(), scoreobjective);
        }
    }
}
项目:Backmemed    文件:ServerScoreboard.java   
public void onScoreUpdated(Score scoreIn)
{
    super.onScoreUpdated(scoreIn);

    if (this.addedObjectives.contains(scoreIn.getObjective()))
    {
        this.scoreboardMCServer.getPlayerList().sendPacketToAllPlayers(new SPacketUpdateScore(scoreIn));
    }

    this.markSaveDataDirty();
}
项目:CustomWorldGen    文件:ServerScoreboard.java   
public void onScoreUpdated(Score scoreIn)
{
    super.onScoreUpdated(scoreIn);

    if (this.addedObjectives.contains(scoreIn.getObjective()))
    {
        this.scoreboardMCServer.getPlayerList().sendPacketToAllPlayers(new SPacketUpdateScore(scoreIn));
    }

    this.markSaveDataDirty();
}
项目:Backmemed    文件:ServerScoreboard.java   
public void broadcastScoreUpdate(String scoreName)
{
    super.broadcastScoreUpdate(scoreName);
    this.scoreboardMCServer.getPlayerList().sendPacketToAllPlayers(new SPacketUpdateScore(scoreName));
    this.markSaveDataDirty();
}
项目:Backmemed    文件:ServerScoreboard.java   
public void broadcastScoreUpdate(String scoreName, ScoreObjective objective)
{
    super.broadcastScoreUpdate(scoreName, objective);
    this.scoreboardMCServer.getPlayerList().sendPacketToAllPlayers(new SPacketUpdateScore(scoreName, objective));
    this.markSaveDataDirty();
}
项目:CustomWorldGen    文件:ServerScoreboard.java   
public void broadcastScoreUpdate(String scoreName)
{
    super.broadcastScoreUpdate(scoreName);
    this.scoreboardMCServer.getPlayerList().sendPacketToAllPlayers(new SPacketUpdateScore(scoreName));
    this.markSaveDataDirty();
}
项目:CustomWorldGen    文件:ServerScoreboard.java   
public void broadcastScoreUpdate(String scoreName, ScoreObjective objective)
{
    super.broadcastScoreUpdate(scoreName, objective);
    this.scoreboardMCServer.getPlayerList().sendPacketToAllPlayers(new SPacketUpdateScore(scoreName, objective));
    this.markSaveDataDirty();
}
项目:Backmemed    文件:INetHandlerPlayClient.java   
/**
 * Either updates the score with a specified value or removes the score for an objective
 */
void handleUpdateScore(SPacketUpdateScore packetIn);
项目:CustomWorldGen    文件:INetHandlerPlayClient.java   
/**
 * Either updates the score with a specified value or removes the score for an objective
 */
void handleUpdateScore(SPacketUpdateScore packetIn);