当前位置: 首页>>代码示例>>Java>>正文


Java S3CPacketUpdateScore类代码示例

本文整理汇总了Java中net.minecraft.network.play.server.S3CPacketUpdateScore的典型用法代码示例。如果您正苦于以下问题:Java S3CPacketUpdateScore类的具体用法?Java S3CPacketUpdateScore怎么用?Java S3CPacketUpdateScore使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


S3CPacketUpdateScore类属于net.minecraft.network.play.server包,在下文中一共展示了S3CPacketUpdateScore类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: func_96550_d

import net.minecraft.network.play.server.S3CPacketUpdateScore; //导入依赖的package包/类
public List<Packet> func_96550_d(ScoreObjective p_96550_1_)
{
    List<Packet> list = Lists.<Packet>newArrayList();
    list.add(new S3BPacketScoreboardObjective(p_96550_1_, 0));

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

    for (Score score : this.getSortedScores(p_96550_1_))
    {
        list.add(new S3CPacketUpdateScore(score));
    }

    return list;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:21,代码来源:ServerScoreboard.java

示例2: handleUpdateScore

import net.minecraft.network.play.server.S3CPacketUpdateScore; //导入依赖的package包/类
/**
 * Either updates the score with a specified value or removes the score for an objective
 */
public void handleUpdateScore(S3CPacketUpdateScore packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Scoreboard scoreboard = this.clientWorldController.getScoreboard();
    ScoreObjective scoreobjective = scoreboard.getObjective(packetIn.getObjectiveName());

    if (packetIn.getScoreAction() == S3CPacketUpdateScore.Action.CHANGE)
    {
        Score score = scoreboard.getValueFromObjective(packetIn.getPlayerName(), scoreobjective);
        score.setScorePoints(packetIn.getScoreValue());
    }
    else if (packetIn.getScoreAction() == S3CPacketUpdateScore.Action.REMOVE)
    {
        if (StringUtils.isNullOrEmpty(packetIn.getObjectiveName()))
        {
            scoreboard.removeObjectiveFromEntity(packetIn.getPlayerName(), (ScoreObjective)null);
        }
        else if (scoreobjective != null)
        {
            scoreboard.removeObjectiveFromEntity(packetIn.getPlayerName(), scoreobjective);
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:27,代码来源:NetHandlerPlayClient.java

示例3: handleUpdateScore

import net.minecraft.network.play.server.S3CPacketUpdateScore; //导入依赖的package包/类
/**
 * Either updates the score with a specified value or removes the score for an
 * objective
 */
public void handleUpdateScore(S3CPacketUpdateScore packetIn) {
	PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
	Scoreboard scoreboard = this.clientWorldController.getScoreboard();
	ScoreObjective scoreobjective = scoreboard.getObjective(packetIn.getObjectiveName());

	if (packetIn.getScoreAction() == S3CPacketUpdateScore.Action.CHANGE) {
		Score score = scoreboard.getValueFromObjective(packetIn.getPlayerName(), scoreobjective);
		score.setScorePoints(packetIn.getScoreValue());
	} else if (packetIn.getScoreAction() == S3CPacketUpdateScore.Action.REMOVE) {
		if (StringUtils.isNullOrEmpty(packetIn.getObjectiveName())) {
			scoreboard.removeObjectiveFromEntity(packetIn.getPlayerName(), (ScoreObjective) null);
		} else if (scoreobjective != null) {
			scoreboard.removeObjectiveFromEntity(packetIn.getPlayerName(), scoreobjective);
		}
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:21,代码来源:NetHandlerPlayClient.java

示例4: handleUpdateScore

import net.minecraft.network.play.server.S3CPacketUpdateScore; //导入依赖的package包/类
/**
 * Either updates the score with a specified value or removes the score for an objective
 */
public void handleUpdateScore(S3CPacketUpdateScore p_147250_1_)
{
    Scoreboard var2 = this.clientWorldController.getScoreboard();
    ScoreObjective var3 = var2.getObjective(p_147250_1_.func_149321_d());

    if (p_147250_1_.func_149322_f() == 0)
    {
        Score var4 = var2.func_96529_a(p_147250_1_.func_149324_c(), var3);
        var4.func_96647_c(p_147250_1_.func_149323_e());
    }
    else if (p_147250_1_.func_149322_f() == 1)
    {
        var2.func_96515_c(p_147250_1_.func_149324_c());
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:19,代码来源:NetHandlerPlayClient.java

示例5: func_96550_d

import net.minecraft.network.play.server.S3CPacketUpdateScore; //导入依赖的package包/类
public List func_96550_d(ScoreObjective par1ScoreObjective)
{
    ArrayList var2 = new ArrayList();
    var2.add(new S3BPacketScoreboardObjective(par1ScoreObjective, 0));

    for (int var3 = 0; var3 < 3; ++var3)
    {
        if (this.func_96539_a(var3) == par1ScoreObjective)
        {
            var2.add(new S3DPacketDisplayScoreboard(var3, par1ScoreObjective));
        }
    }

    Iterator var5 = this.func_96534_i(par1ScoreObjective).iterator();

    while (var5.hasNext())
    {
        Score var4 = (Score)var5.next();
        var2.add(new S3CPacketUpdateScore(var4, 0));
    }

    return var2;
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:24,代码来源:ServerScoreboard.java

示例6: func_96550_d

import net.minecraft.network.play.server.S3CPacketUpdateScore; //导入依赖的package包/类
public List func_96550_d(ScoreObjective p_96550_1_)
{
    ArrayList arraylist = new ArrayList();
    arraylist.add(new S3BPacketScoreboardObjective(p_96550_1_, 0));

    for (int i = 0; i < 3; ++i)
    {
        if (this.func_96539_a(i) == p_96550_1_)
        {
            arraylist.add(new S3DPacketDisplayScoreboard(i, p_96550_1_));
        }
    }

    Iterator iterator = this.func_96534_i(p_96550_1_).iterator();

    while (iterator.hasNext())
    {
        Score score = (Score)iterator.next();
        arraylist.add(new S3CPacketUpdateScore(score, 0));
    }

    return arraylist;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:24,代码来源:ServerScoreboard.java

示例7: func_96536_a

import net.minecraft.network.play.server.S3CPacketUpdateScore; //导入依赖的package包/类
public void func_96536_a(Score p_96536_1_)
{
    super.func_96536_a(p_96536_1_);

    if (this.field_96553_b.contains(p_96536_1_.getObjective()))
    {
        this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3CPacketUpdateScore(p_96536_1_));
    }

    this.func_96551_b();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:ServerScoreboard.java

示例8: func_96536_a

import net.minecraft.network.play.server.S3CPacketUpdateScore; //导入依赖的package包/类
public void func_96536_a(Score par1Score)
{
    super.func_96536_a(par1Score);

    if (this.field_96553_b.contains(par1Score.func_96645_d()))
    {
        this.scoreboardMCServer.getConfigurationManager().func_148540_a(new S3CPacketUpdateScore(par1Score, 0));
    }

    this.func_96551_b();
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:12,代码来源:ServerScoreboard.java

示例9: handleUpdateScore

import net.minecraft.network.play.server.S3CPacketUpdateScore; //导入依赖的package包/类
public void handleUpdateScore(S3CPacketUpdateScore p_147250_1_)
{
    Scoreboard scoreboard = this.clientWorldController.getScoreboard();
    ScoreObjective scoreobjective = scoreboard.getObjective(p_147250_1_.func_149321_d());

    if (p_147250_1_.func_149322_f() == 0)
    {
        Score score = scoreboard.func_96529_a(p_147250_1_.func_149324_c(), scoreobjective);
        score.setScorePoints(p_147250_1_.func_149323_e());
    }
    else if (p_147250_1_.func_149322_f() == 1)
    {
        scoreboard.func_96515_c(p_147250_1_.func_149324_c());
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:16,代码来源:NetHandlerPlayClient.java

示例10: func_96536_a

import net.minecraft.network.play.server.S3CPacketUpdateScore; //导入依赖的package包/类
public void func_96536_a(Score p_96536_1_)
{
    super.func_96536_a(p_96536_1_);

    if (this.field_96553_b.contains(p_96536_1_.func_96645_d()))
    {
        this.sendAll(new S3CPacketUpdateScore(p_96536_1_, 0)); // CraftBukkit - Internal packet method
    }

    this.func_96551_b();
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:12,代码来源:ServerScoreboard.java

示例11: func_96536_a

import net.minecraft.network.play.server.S3CPacketUpdateScore; //导入依赖的package包/类
public void func_96536_a(Score p_96536_1_)
{
    super.func_96536_a(p_96536_1_);

    if (this.field_96553_b.contains(p_96536_1_.func_96645_d()))
    {
        this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3CPacketUpdateScore(p_96536_1_, 0));
    }

    this.func_96551_b();
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:12,代码来源:ServerScoreboard.java

示例12: removeScore

import net.minecraft.network.play.server.S3CPacketUpdateScore; //导入依赖的package包/类
@Override
public void removeScore(@Nonnull Score score) {
    Checks.notNull(score, "score may not be null");
    if(this.scores.remove(score)){
        this.scoresByName.remove(score.getName());
        S3CPacketUpdateScore p = new S3CPacketUpdateScore();
        p.name = score.getName();
        p.action = S3CPacketUpdateScore.Action.REMOVE;
        manager.sendPacket(p);
    }
}
 
开发者ID:nailed,项目名称:nailed,代码行数:12,代码来源:NailedObjective.java

示例13: sendData

import net.minecraft.network.play.server.S3CPacketUpdateScore; //导入依赖的package包/类
public void sendData(Player player){
    for(Score score : this.scores){
        S3CPacketUpdateScore p = new S3CPacketUpdateScore();
        p.name = score.getName();
        p.objective = this.id;
        p.value = score.getValue();
        p.action = S3CPacketUpdateScore.Action.CHANGE;
        ((NailedPlayer) player).sendPacket(p);
    }
}
 
开发者ID:nailed,项目名称:nailed,代码行数:11,代码来源:NailedObjective.java

示例14: update

import net.minecraft.network.play.server.S3CPacketUpdateScore; //导入依赖的package包/类
@Override
public void update() {
    S3CPacketUpdateScore p = new S3CPacketUpdateScore();
    p.name = this.name;
    p.objective = this.owner.getId();
    p.value = this.value;
    p.action = S3CPacketUpdateScore.Action.CHANGE;
    owner.getManager().sendPacket(p);
}
 
开发者ID:nailed,项目名称:nailed,代码行数:10,代码来源:NailedScore.java

示例15: func_96516_a

import net.minecraft.network.play.server.S3CPacketUpdateScore; //导入依赖的package包/类
public void func_96516_a(String p_96516_1_)
{
    super.func_96516_a(p_96516_1_);
    this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3CPacketUpdateScore(p_96516_1_));
    this.func_96551_b();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:7,代码来源:ServerScoreboard.java


注:本文中的net.minecraft.network.play.server.S3CPacketUpdateScore类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。