本文整理汇总了Java中net.minecraft.scoreboard.Scoreboard.removeObjectiveFromEntity方法的典型用法代码示例。如果您正苦于以下问题:Java Scoreboard.removeObjectiveFromEntity方法的具体用法?Java Scoreboard.removeObjectiveFromEntity怎么用?Java Scoreboard.removeObjectiveFromEntity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.scoreboard.Scoreboard
的用法示例。
在下文中一共展示了Scoreboard.removeObjectiveFromEntity方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resetPlayers
import net.minecraft.scoreboard.Scoreboard; //导入方法依赖的package包/类
protected void resetPlayers(ICommandSender p_147187_1_, String[] p_147187_2_, int p_147187_3_) throws CommandException
{
Scoreboard scoreboard = this.getScoreboard();
String s = getEntityName(p_147187_1_, p_147187_2_[p_147187_3_++]);
if (p_147187_2_.length > p_147187_3_)
{
ScoreObjective scoreobjective = this.getObjective(p_147187_2_[p_147187_3_++], false);
scoreboard.removeObjectiveFromEntity(s, scoreobjective);
notifyOperators(p_147187_1_, this, "commands.scoreboard.players.resetscore.success", new Object[] {scoreobjective.getName(), s});
}
else
{
scoreboard.removeObjectiveFromEntity(s, (ScoreObjective)null);
notifyOperators(p_147187_1_, this, "commands.scoreboard.players.reset.success", new Object[] {s});
}
}
示例2: handleUpdateScore
import net.minecraft.scoreboard.Scoreboard; //导入方法依赖的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);
}
}
}
示例3: handleUpdateScore
import net.minecraft.scoreboard.Scoreboard; //导入方法依赖的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);
}
}
}
示例4: handleUpdateScore
import net.minecraft.scoreboard.Scoreboard; //导入方法依赖的package包/类
/**
* 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);
}
}
}
示例5: resetPlayerScore
import net.minecraft.scoreboard.Scoreboard; //导入方法依赖的package包/类
protected void resetPlayerScore(ICommandSender sender, String[] p_184912_2_, int p_184912_3_, MinecraftServer server) throws CommandException
{
Scoreboard scoreboard = this.getScoreboard(server);
String s = getEntityName(server, sender, p_184912_2_[p_184912_3_++]);
if (p_184912_2_.length > p_184912_3_)
{
ScoreObjective scoreobjective = this.convertToObjective(p_184912_2_[p_184912_3_++], false, server);
scoreboard.removeObjectiveFromEntity(s, scoreobjective);
notifyCommandListener(sender, this, "commands.scoreboard.players.resetscore.success", new Object[] {scoreobjective.getName(), s});
}
else
{
scoreboard.removeObjectiveFromEntity(s, (ScoreObjective)null);
notifyCommandListener(sender, this, "commands.scoreboard.players.reset.success", new Object[] {s});
}
}