本文整理汇总了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);
}
}
示例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);
}
}
示例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)});
}
}
}
示例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);
}
}
示例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)});
}
}
}