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


Java Scoreboard.setObjectiveInDisplaySlot方法代码示例

本文整理汇总了Java中net.minecraft.scoreboard.Scoreboard.setObjectiveInDisplaySlot方法的典型用法代码示例。如果您正苦于以下问题:Java Scoreboard.setObjectiveInDisplaySlot方法的具体用法?Java Scoreboard.setObjectiveInDisplaySlot怎么用?Java Scoreboard.setObjectiveInDisplaySlot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.scoreboard.Scoreboard的用法示例。


在下文中一共展示了Scoreboard.setObjectiveInDisplaySlot方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleDisplayScoreboard

import net.minecraft.scoreboard.Scoreboard; //导入方法依赖的package包/类
/**
 * Removes or sets the ScoreObjective to be displayed at a particular scoreboard position (list, sidebar, below
 * name)
 */
public void handleDisplayScoreboard(S3DPacketDisplayScoreboard packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Scoreboard scoreboard = this.clientWorldController.getScoreboard();

    if (packetIn.func_149370_d().length() == 0)
    {
        scoreboard.setObjectiveInDisplaySlot(packetIn.func_149371_c(), (ScoreObjective)null);
    }
    else
    {
        ScoreObjective scoreobjective = scoreboard.getObjective(packetIn.func_149370_d());
        scoreboard.setObjectiveInDisplaySlot(packetIn.func_149371_c(), scoreobjective);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:20,代码来源:NetHandlerPlayClient.java

示例2: handleDisplayObjective

import net.minecraft.scoreboard.Scoreboard; //导入方法依赖的package包/类
/**
 * Removes or sets the ScoreObjective to be displayed at a particular scoreboard position (list, sidebar, below
 * name)
 */
public void handleDisplayObjective(SPacketDisplayObjective packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Scoreboard scoreboard = this.clientWorldController.getScoreboard();

    if (packetIn.getName().isEmpty())
    {
        scoreboard.setObjectiveInDisplaySlot(packetIn.getPosition(), (ScoreObjective)null);
    }
    else
    {
        ScoreObjective scoreobjective = scoreboard.getObjective(packetIn.getName());
        scoreboard.setObjectiveInDisplaySlot(packetIn.getPosition(), scoreobjective);
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:20,代码来源:NetHandlerPlayClient.java

示例3: setObjectiveDisplay

import net.minecraft.scoreboard.Scoreboard; //导入方法依赖的package包/类
protected void setObjectiveDisplay(ICommandSender p_147198_1_, String[] p_147198_2_, int p_147198_3_) throws CommandException
{
    Scoreboard scoreboard = this.getScoreboard();
    String s = p_147198_2_[p_147198_3_++];
    int i = Scoreboard.getObjectiveDisplaySlotNumber(s);
    ScoreObjective scoreobjective = null;

    if (p_147198_2_.length == 4)
    {
        scoreobjective = this.getObjective(p_147198_2_[p_147198_3_], false);
    }

    if (i < 0)
    {
        throw new CommandException("commands.scoreboard.objectives.setdisplay.invalidSlot", new Object[] {s});
    }
    else
    {
        scoreboard.setObjectiveInDisplaySlot(i, scoreobjective);

        if (scoreobjective != null)
        {
            notifyOperators(p_147198_1_, this, "commands.scoreboard.objectives.setdisplay.successSet", new Object[] {Scoreboard.getObjectiveDisplaySlot(i), scoreobjective.getName()});
        }
        else
        {
            notifyOperators(p_147198_1_, this, "commands.scoreboard.objectives.setdisplay.successCleared", new Object[] {Scoreboard.getObjectiveDisplaySlot(i)});
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:31,代码来源:CommandScoreboard.java

示例4: handleDisplayScoreboard

import net.minecraft.scoreboard.Scoreboard; //导入方法依赖的package包/类
/**
 * Removes or sets the ScoreObjective to be displayed at a particular scoreboard
 * position (list, sidebar, below name)
 */
public void handleDisplayScoreboard(S3DPacketDisplayScoreboard packetIn) {
	PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
	Scoreboard scoreboard = this.clientWorldController.getScoreboard();

	if (packetIn.func_149370_d().length() == 0) {
		scoreboard.setObjectiveInDisplaySlot(packetIn.func_149371_c(), (ScoreObjective) null);
	} else {
		ScoreObjective scoreobjective = scoreboard.getObjective(packetIn.func_149370_d());
		scoreboard.setObjectiveInDisplaySlot(packetIn.func_149371_c(), scoreobjective);
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:16,代码来源:NetHandlerPlayClient.java

示例5: setDisplayObjective

import net.minecraft.scoreboard.Scoreboard; //导入方法依赖的package包/类
protected void setDisplayObjective(ICommandSender sender, String[] p_184919_2_, int p_184919_3_, MinecraftServer server) throws CommandException
{
    Scoreboard scoreboard = this.getScoreboard(server);
    String s = p_184919_2_[p_184919_3_++];
    int i = Scoreboard.getObjectiveDisplaySlotNumber(s);
    ScoreObjective scoreobjective = null;

    if (p_184919_2_.length == 4)
    {
        scoreobjective = this.convertToObjective(p_184919_2_[p_184919_3_], false, server);
    }

    if (i < 0)
    {
        throw new CommandException("commands.scoreboard.objectives.setdisplay.invalidSlot", new Object[] {s});
    }
    else
    {
        scoreboard.setObjectiveInDisplaySlot(i, scoreobjective);

        if (scoreobjective != null)
        {
            notifyCommandListener(sender, this, "commands.scoreboard.objectives.setdisplay.successSet", new Object[] {Scoreboard.getObjectiveDisplaySlot(i), scoreobjective.getName()});
        }
        else
        {
            notifyCommandListener(sender, this, "commands.scoreboard.objectives.setdisplay.successCleared", new Object[] {Scoreboard.getObjectiveDisplaySlot(i)});
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:31,代码来源:CommandScoreboard.java


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