• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IScoreObjectiveCriteria类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: addToPlayerScore

import net.minecraft.scoreboard.IScoreObjectiveCriteria; //导入依赖的package包/类
/**
 * Adds a value to the player score. Currently not actually used and the entity passed in does nothing. Args:
 * entity, scoreToAdd
 */
public void addToPlayerScore(Entity entityIn, int amount)
{
    this.addScore(amount);
    Collection<ScoreObjective> collection = this.getWorldScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.totalKillCount);

    if (entityIn instanceof EntityPlayer)
    {
        this.triggerAchievement(StatList.playerKillsStat);
        collection.addAll(this.getWorldScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.playerKillCount));
        collection.addAll(this.func_175137_e(entityIn));
    }
    else
    {
        this.triggerAchievement(StatList.mobKillsStat);
    }

    for (ScoreObjective scoreobjective : collection)
    {
        Score score = this.getWorldScoreboard().getValueFromObjective(this.getName(), scoreobjective);
        score.func_96648_a();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:27,代码来源:EntityPlayer.java


示例2: func_175779_n

import net.minecraft.scoreboard.IScoreObjectiveCriteria; //导入依赖的package包/类
protected void func_175779_n(ICommandSender p_175779_1_, String[] p_175779_2_, int p_175779_3_) throws CommandException
{
    Scoreboard scoreboard = this.getScoreboard();
    String s = getPlayerName(p_175779_1_, p_175779_2_[p_175779_3_++]);

    if (s.length() > 40)
    {
        throw new SyntaxErrorException("commands.scoreboard.players.name.tooLong", new Object[] {s, Integer.valueOf(40)});
    }
    else
    {
        ScoreObjective scoreobjective = this.getObjective(p_175779_2_[p_175779_3_], false);

        if (scoreobjective.getCriteria() != IScoreObjectiveCriteria.TRIGGER)
        {
            throw new CommandException("commands.scoreboard.players.enable.noTrigger", new Object[] {scoreobjective.getName()});
        }
        else
        {
            Score score = scoreboard.getValueFromObjective(s, scoreobjective);
            score.setLocked(false);
            notifyOperators(p_175779_1_, this, "commands.scoreboard.players.enable.success", new Object[] {scoreobjective.getName(), s});
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:26,代码来源:CommandScoreboard.java


示例3: addTabCompletionOptions

import net.minecraft.scoreboard.IScoreObjectiveCriteria; //导入依赖的package包/类
public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos)
{
    if (args.length == 1)
    {
        Scoreboard scoreboard = MinecraftServer.getServer().worldServerForDimension(0).getScoreboard();
        List<String> list = Lists.<String>newArrayList();

        for (ScoreObjective scoreobjective : scoreboard.getScoreObjectives())
        {
            if (scoreobjective.getCriteria() == IScoreObjectiveCriteria.TRIGGER)
            {
                list.add(scoreobjective.getName());
            }
        }

        return getListOfStringsMatchingLastWord(args, (String[])list.toArray(new String[list.size()]));
    }
    else
    {
        return args.length == 2 ? getListOfStringsMatchingLastWord(args, new String[] {"add", "set"}): null;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:23,代码来源:CommandTrigger.java


示例4: handleScoreboardObjective

import net.minecraft.scoreboard.IScoreObjectiveCriteria; //导入依赖的package包/类
/**
 * May create a scoreboard objective, remove an objective from the scoreboard or
 * update an objectives' displayname
 */
public void handleScoreboardObjective(S3BPacketScoreboardObjective packetIn) {
	PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
	Scoreboard scoreboard = this.clientWorldController.getScoreboard();

	if (packetIn.func_149338_e() == 0) {
		ScoreObjective scoreobjective = scoreboard.addScoreObjective(packetIn.func_149339_c(),
				IScoreObjectiveCriteria.DUMMY);
		scoreobjective.setDisplayName(packetIn.func_149337_d());
		scoreobjective.setRenderType(packetIn.func_179817_d());
	} else {
		ScoreObjective scoreobjective1 = scoreboard.getObjective(packetIn.func_149339_c());

		if (packetIn.func_149338_e() == 1) {
			scoreboard.removeObjective(scoreobjective1);
		} else if (packetIn.func_149338_e() == 2) {
			scoreobjective1.setDisplayName(packetIn.func_149337_d());
			scoreobjective1.setRenderType(packetIn.func_179817_d());
		}
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:25,代码来源:NetHandlerPlayClient.java


示例5: addToPlayerScore

import net.minecraft.scoreboard.IScoreObjectiveCriteria; //导入依赖的package包/类
public void addToPlayerScore(Entity p_70084_1_, int p_70084_2_)
{
	addScore(p_70084_2_);
	Collection collection = getWorldScoreboard().func_96520_a(IScoreObjectiveCriteria.totalKillCount);
	if ((p_70084_1_ instanceof EntityPlayer))
	{
		addStat(StatList.playerKillsStat, 1);
		collection.addAll(getWorldScoreboard().func_96520_a(IScoreObjectiveCriteria.playerKillCount));
	}
	else
	{
		addStat(StatList.mobKillsStat, 1);
	}
	Iterator iterator = collection.iterator();
	while (iterator.hasNext())
	{
		ScoreObjective scoreobjective = (ScoreObjective)iterator.next();
		Score score = getWorldScoreboard().func_96529_a(getCommandSenderName(), scoreobjective);
		score.func_96648_a();
	}
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:22,代码来源:EntityPlayer.java


示例6: addToPlayerScore

import net.minecraft.scoreboard.IScoreObjectiveCriteria; //导入依赖的package包/类
/**
 * Adds a value to the player score. Currently not actually used and the entity passed in does nothing. Args:
 * entity, scoreToAdd
 */
public void addToPlayerScore(Entity par1Entity, int par2)
{
    this.addScore(par2);
    Collection var3 = this.getWorldScoreboard().func_96520_a(IScoreObjectiveCriteria.totalKillCount);

    if (par1Entity instanceof EntityPlayer)
    {
        this.addStat(StatList.playerKillsStat, 1);
        var3.addAll(this.getWorldScoreboard().func_96520_a(IScoreObjectiveCriteria.playerKillCount));
    }
    else
    {
        this.addStat(StatList.mobKillsStat, 1);
    }

    Iterator var4 = var3.iterator();

    while (var4.hasNext())
    {
        ScoreObjective var5 = (ScoreObjective)var4.next();
        Score var6 = this.getWorldScoreboard().func_96529_a(this.getCommandSenderName(), var5);
        var6.func_96648_a();
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:29,代码来源:EntityPlayer.java


示例7: handleScoreboardObjective

import net.minecraft.scoreboard.IScoreObjectiveCriteria; //导入依赖的package包/类
/**
 * May create a scoreboard objective, remove an objective from the scoreboard or update an objectives' displayname
 */
public void handleScoreboardObjective(S3BPacketScoreboardObjective p_147291_1_)
{
    Scoreboard var2 = this.clientWorldController.getScoreboard();
    ScoreObjective var3;

    if (p_147291_1_.func_149338_e() == 0)
    {
        var3 = var2.addScoreObjective(p_147291_1_.func_149339_c(), IScoreObjectiveCriteria.field_96641_b);
        var3.setDisplayName(p_147291_1_.func_149337_d());
    }
    else
    {
        var3 = var2.getObjective(p_147291_1_.func_149339_c());

        if (p_147291_1_.func_149338_e() == 1)
        {
            var2.func_96519_k(var3);
        }
        else if (p_147291_1_.func_149338_e() == 2)
        {
            var3.setDisplayName(p_147291_1_.func_149337_d());
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:28,代码来源:NetHandlerPlayClient.java


示例8: addToPlayerScore

import net.minecraft.scoreboard.IScoreObjectiveCriteria; //导入依赖的package包/类
public void addToPlayerScore(Entity p_70084_1_, int p_70084_2_)
{
    this.addScore(p_70084_2_);
    // CraftBukkit - Get our scores instead
    Collection<Score> collection = this.worldObj.getServer().getScoreboardManager().getScoreboardScores(IScoreObjectiveCriteria.totalKillCount, this.getCommandSenderName(), new java.util.ArrayList<Score>());

    if (p_70084_1_ instanceof EntityPlayer)
    {
        this.addStat(StatList.playerKillsStat, 1);
        // CraftBukkit - Get our scores instead
        this.worldObj.getServer().getScoreboardManager().getScoreboardScores(IScoreObjectiveCriteria.playerKillCount, this.getCommandSenderName(), collection);
    }
    else
    {
        this.addStat(StatList.mobKillsStat, 1);
    }

    Iterator iterator = collection.iterator();

    while (iterator.hasNext())
    {
        Score score = (Score) iterator.next(); // CraftBukkit - Use our scores instead
        score.func_96648_a();
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:26,代码来源:EntityPlayer.java


示例9: handleScoreboardObjective

import net.minecraft.scoreboard.IScoreObjectiveCriteria; //导入依赖的package包/类
public void handleScoreboardObjective(S3BPacketScoreboardObjective p_147291_1_)
{
    Scoreboard scoreboard = this.clientWorldController.getScoreboard();
    ScoreObjective scoreobjective;

    if (p_147291_1_.func_149338_e() == 0)
    {
        scoreobjective = scoreboard.addScoreObjective(p_147291_1_.func_149339_c(), IScoreObjectiveCriteria.field_96641_b);
        scoreobjective.setDisplayName(p_147291_1_.func_149337_d());
    }
    else
    {
        scoreobjective = scoreboard.getObjective(p_147291_1_.func_149339_c());

        if (p_147291_1_.func_149338_e() == 1)
        {
            scoreboard.func_96519_k(scoreobjective);
        }
        else if (p_147291_1_.func_149338_e() == 2)
        {
            scoreobjective.setDisplayName(p_147291_1_.func_149337_d());
        }
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:25,代码来源:NetHandlerPlayClient.java


示例10: addToPlayerScore

import net.minecraft.scoreboard.IScoreObjectiveCriteria; //导入依赖的package包/类
public void addToPlayerScore(Entity p_70084_1_, int p_70084_2_)
{
    this.addScore(p_70084_2_);
    Collection collection = this.getWorldScoreboard().func_96520_a(IScoreObjectiveCriteria.totalKillCount);

    if (p_70084_1_ instanceof EntityPlayer)
    {
        this.addStat(StatList.playerKillsStat, 1);
        collection.addAll(this.getWorldScoreboard().func_96520_a(IScoreObjectiveCriteria.playerKillCount));
    }
    else
    {
        this.addStat(StatList.mobKillsStat, 1);
    }

    Iterator iterator = collection.iterator();

    while (iterator.hasNext())
    {
        ScoreObjective scoreobjective = (ScoreObjective)iterator.next();
        Score score = this.getWorldScoreboard().func_96529_a(this.getCommandSenderName(), scoreobjective);
        score.func_96648_a();
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:25,代码来源:EntityPlayer.java


示例11: getOrCreateObjective

import net.minecraft.scoreboard.IScoreObjectiveCriteria; //导入依赖的package包/类
@Nonnull
@Override
public Objective getOrCreateObjective(@Nonnull String id) {
    Checks.notNull(id, "Id may not be null");
    Checks.check(id.length() <= 16, "Id must not be longer than 16");

    NailedObjective objective = objectivesById.get(id);
    if(objective == null){
        objective = new NailedObjective(id, this);
        this.objectives.add(objective);
        this.objectivesById.put(id, objective);
        S3BPacketScoreboardObjective packet = new S3BPacketScoreboardObjective();
        packet.objectiveName = objective.getId();
        packet.objectiveValue = objective.getDisplayName();
        packet.field_149342_c = 0; //0 = Create
        packet.type = IScoreObjectiveCriteria.EnumRenderType.INTEGER; //TODO: config option
        this.sendPacket(packet);
    }
    return objective;
}
 
开发者ID:nailed,项目名称:nailed,代码行数:21,代码来源:PlayerScoreboardManager.java


示例12: func_175137_e

import net.minecraft.scoreboard.IScoreObjectiveCriteria; //导入依赖的package包/类
private Collection<ScoreObjective> func_175137_e(Entity p_175137_1_)
{
    ScorePlayerTeam scoreplayerteam = this.getWorldScoreboard().getPlayersTeam(this.getName());

    if (scoreplayerteam != null)
    {
        int i = scoreplayerteam.getChatFormat().getColorIndex();

        if (i >= 0 && i < IScoreObjectiveCriteria.field_178793_i.length)
        {
            for (ScoreObjective scoreobjective : this.getWorldScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.field_178793_i[i]))
            {
                Score score = this.getWorldScoreboard().getValueFromObjective(p_175137_1_.getName(), scoreobjective);
                score.func_96648_a();
            }
        }
    }

    ScorePlayerTeam scoreplayerteam1 = this.getWorldScoreboard().getPlayersTeam(p_175137_1_.getName());

    if (scoreplayerteam1 != null)
    {
        int j = scoreplayerteam1.getChatFormat().getColorIndex();

        if (j >= 0 && j < IScoreObjectiveCriteria.field_178792_h.length)
        {
            return this.getWorldScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.field_178792_h[j]);
        }
    }

    return Lists.<ScoreObjective>newArrayList();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:33,代码来源:EntityPlayer.java


示例13: readPacketData

import net.minecraft.scoreboard.IScoreObjectiveCriteria; //导入依赖的package包/类
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.objectiveName = buf.readStringFromBuffer(16);
    this.field_149342_c = buf.readByte();

    if (this.field_149342_c == 0 || this.field_149342_c == 2)
    {
        this.objectiveValue = buf.readStringFromBuffer(32);
        this.type = IScoreObjectiveCriteria.EnumRenderType.func_178795_a(buf.readStringFromBuffer(16));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:15,代码来源:S3BPacketScoreboardObjective.java


示例14: StatBase

import net.minecraft.scoreboard.IScoreObjectiveCriteria; //导入依赖的package包/类
public StatBase(String statIdIn, IChatComponent statNameIn, IStatType typeIn)
{
    this.statId = statIdIn;
    this.statName = statNameIn;
    this.type = typeIn;
    this.field_150957_c = new ObjectiveStat(this);
    IScoreObjectiveCriteria.INSTANCES.put(this.field_150957_c.getName(), this.field_150957_c);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:9,代码来源:StatBase.java


示例15: StatCrafting

import net.minecraft.scoreboard.IScoreObjectiveCriteria; //导入依赖的package包/类
public StatCrafting(String p_i45910_1_, String p_i45910_2_, IChatComponent statNameIn, Item p_i45910_4_)
{
    super(p_i45910_1_ + p_i45910_2_, statNameIn);
    this.field_150960_a = p_i45910_4_;
    int i = Item.getIdFromItem(p_i45910_4_);

    if (i != 0)
    {
        IScoreObjectiveCriteria.INSTANCES.put(p_i45910_1_ + i, this.func_150952_k());
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:StatCrafting.java


示例16: func_175782_e

import net.minecraft.scoreboard.IScoreObjectiveCriteria; //导入依赖的package包/类
protected List<String> func_175782_e()
{
    Collection<ScoreObjective> collection = this.getScoreboard().getScoreObjectives();
    List<String> list = Lists.<String>newArrayList();

    for (ScoreObjective scoreobjective : collection)
    {
        if (scoreobjective.getCriteria() == IScoreObjectiveCriteria.TRIGGER)
        {
            list.add(scoreobjective.getName());
        }
    }

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


示例17: handleScoreboardObjective

import net.minecraft.scoreboard.IScoreObjectiveCriteria; //导入依赖的package包/类
/**
 * May create a scoreboard objective, remove an objective from the scoreboard or update an objectives' displayname
 */
public void handleScoreboardObjective(S3BPacketScoreboardObjective packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Scoreboard scoreboard = this.clientWorldController.getScoreboard();

    if (packetIn.func_149338_e() == 0)
    {
        ScoreObjective scoreobjective = scoreboard.addScoreObjective(packetIn.func_149339_c(), IScoreObjectiveCriteria.DUMMY);
        scoreobjective.setDisplayName(packetIn.func_149337_d());
        scoreobjective.setRenderType(packetIn.func_179817_d());
    }
    else
    {
        ScoreObjective scoreobjective1 = scoreboard.getObjective(packetIn.func_149339_c());

        if (packetIn.func_149338_e() == 1)
        {
            scoreboard.removeObjective(scoreobjective1);
        }
        else if (packetIn.func_149338_e() == 2)
        {
            scoreobjective1.setDisplayName(packetIn.func_149337_d());
            scoreobjective1.setRenderType(packetIn.func_179817_d());
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:30,代码来源:NetHandlerPlayClient.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ActionEvent类代码示例发布时间:2022-05-22
下一篇:
Java Footer类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap