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


Java CommandResultStats类代码示例

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


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

示例1: emptyTeam

import net.minecraft.command.CommandResultStats; //导入依赖的package包/类
protected void emptyTeam(ICommandSender p_147188_1_, String[] p_147188_2_, int p_147188_3_) throws CommandException
{
    Scoreboard scoreboard = this.getScoreboard();
    ScorePlayerTeam scoreplayerteam = this.getTeam(p_147188_2_[p_147188_3_]);

    if (scoreplayerteam != null)
    {
        Collection<String> collection = Lists.newArrayList(scoreplayerteam.getMembershipCollection());
        p_147188_1_.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, collection.size());

        if (collection.isEmpty())
        {
            throw new CommandException("commands.scoreboard.teams.empty.alreadyEmpty", new Object[] {scoreplayerteam.getRegisteredName()});
        }
        else
        {
            for (String s : collection)
            {
                scoreboard.removePlayerFromTeam(s, scoreplayerteam);
            }

            notifyOperators(p_147188_1_, this, "commands.scoreboard.teams.empty.success", new Object[] {Integer.valueOf(collection.size()), scoreplayerteam.getRegisteredName()});
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:26,代码来源:CommandScoreboard.java

示例2: emptyTeam

import net.minecraft.command.CommandResultStats; //导入依赖的package包/类
protected void emptyTeam(ICommandSender sender, String[] p_184917_2_, int p_184917_3_, MinecraftServer server) throws CommandException
{
    Scoreboard scoreboard = this.getScoreboard(server);
    ScorePlayerTeam scoreplayerteam = this.convertToTeam(p_184917_2_[p_184917_3_], server);

    if (scoreplayerteam != null)
    {
        Collection<String> collection = Lists.newArrayList(scoreplayerteam.getMembershipCollection());
        sender.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, collection.size());

        if (collection.isEmpty())
        {
            throw new CommandException("commands.scoreboard.teams.empty.alreadyEmpty", new Object[] {scoreplayerteam.getRegisteredName()});
        }
        else
        {
            for (String s : collection)
            {
                scoreboard.removePlayerFromTeam(s, scoreplayerteam);
            }

            notifyCommandListener(sender, this, "commands.scoreboard.teams.empty.success", new Object[] {Integer.valueOf(collection.size()), scoreplayerteam.getRegisteredName()});
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:26,代码来源:CommandScoreboard.java

示例3: Entity

import net.minecraft.command.CommandResultStats; //导入依赖的package包/类
public Entity(World worldIn)
{
    this.entityId = nextEntityID++;
    this.renderDistanceWeight = 1.0D;
    this.boundingBox = ZERO_AABB;
    this.width = 0.6F;
    this.height = 1.8F;
    this.nextStepDistance = 1;
    this.rand = new Random();
    this.fireResistance = 1;
    this.firstUpdate = true;
    this.entityUniqueID = MathHelper.getRandomUuid(this.rand);
    this.cmdResultStats = new CommandResultStats();
    this.worldObj = worldIn;
    this.setPosition(0.0D, 0.0D, 0.0D);

    if (worldIn != null)
    {
        this.dimension = worldIn.provider.getDimensionId();
    }

    this.dataWatcher = new DataWatcher(this);
    this.dataWatcher.addObject(0, Byte.valueOf((byte)0));
    this.dataWatcher.addObject(1, Short.valueOf((short)300));
    this.dataWatcher.addObject(3, Byte.valueOf((byte)0));
    this.dataWatcher.addObject(2, "");
    this.dataWatcher.addObject(4, Byte.valueOf((byte)0));
    this.entityInit();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:30,代码来源:Entity.java

示例4: processCommand

import net.minecraft.command.CommandResultStats; //导入依赖的package包/类
/**
 * Callback when the command is invoked
 */
public void processCommand(ICommandSender sender, String[] args) throws CommandException
{
    int i = MinecraftServer.getServer().getCurrentPlayerCount();
    sender.addChatMessage(new ChatComponentTranslation("commands.players.list", new Object[] {Integer.valueOf(i), Integer.valueOf(MinecraftServer.getServer().getMaxPlayers())}));
    sender.addChatMessage(new ChatComponentText(MinecraftServer.getServer().getConfigurationManager().func_181058_b(args.length > 0 && "uuids".equalsIgnoreCase(args[0]))));
    sender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, i);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:11,代码来源:CommandListPlayers.java

示例5: listPlayers

import net.minecraft.command.CommandResultStats; //导入依赖的package包/类
protected void listPlayers(ICommandSender p_147195_1_, String[] p_147195_2_, int p_147195_3_) throws CommandException
{
    Scoreboard scoreboard = this.getScoreboard();

    if (p_147195_2_.length > p_147195_3_)
    {
        String s = getEntityName(p_147195_1_, p_147195_2_[p_147195_3_]);
        Map<ScoreObjective, Score> map = scoreboard.getObjectivesForEntity(s);
        p_147195_1_.setCommandStat(CommandResultStats.Type.QUERY_RESULT, map.size());

        if (map.size() <= 0)
        {
            throw new CommandException("commands.scoreboard.players.list.player.empty", new Object[] {s});
        }

        ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.scoreboard.players.list.player.count", new Object[] {Integer.valueOf(map.size()), s});
        chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN);
        p_147195_1_.addChatMessage(chatcomponenttranslation);

        for (Score score : map.values())
        {
            p_147195_1_.addChatMessage(new ChatComponentTranslation("commands.scoreboard.players.list.player.entry", new Object[] {Integer.valueOf(score.getScorePoints()), score.getObjective().getDisplayName(), score.getObjective().getName()}));
        }
    }
    else
    {
        Collection<String> collection = scoreboard.getObjectiveNames();
        p_147195_1_.setCommandStat(CommandResultStats.Type.QUERY_RESULT, collection.size());

        if (collection.size() <= 0)
        {
            throw new CommandException("commands.scoreboard.players.list.empty", new Object[0]);
        }

        ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("commands.scoreboard.players.list.count", new Object[] {Integer.valueOf(collection.size())});
        chatcomponenttranslation1.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN);
        p_147195_1_.addChatMessage(chatcomponenttranslation1);
        p_147195_1_.addChatMessage(new ChatComponentText(joinNiceString(collection.toArray())));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:41,代码来源:CommandScoreboard.java

示例6: execute

import net.minecraft.command.CommandResultStats; //导入依赖的package包/类
/**
 * Callback for when the command is executed
 */
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
    int i = server.getCurrentPlayerCount();
    sender.addChatMessage(new TextComponentTranslation("commands.players.list", new Object[] {Integer.valueOf(i), Integer.valueOf(server.getMaxPlayers())}));
    sender.addChatMessage(new TextComponentString(server.getPlayerList().getFormattedListOfPlayers(args.length > 0 && "uuids".equalsIgnoreCase(args[0]))));
    sender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, i);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:11,代码来源:CommandListPlayers.java

示例7: listPlayers

import net.minecraft.command.CommandResultStats; //导入依赖的package包/类
protected void listPlayers(ICommandSender sender, String[] p_184920_2_, int p_184920_3_, MinecraftServer server) throws CommandException
{
    Scoreboard scoreboard = this.getScoreboard(server);

    if (p_184920_2_.length > p_184920_3_)
    {
        String s = getEntityName(server, sender, p_184920_2_[p_184920_3_]);
        Map<ScoreObjective, Score> map = scoreboard.getObjectivesForEntity(s);
        sender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, map.size());

        if (map.isEmpty())
        {
            throw new CommandException("commands.scoreboard.players.list.player.empty", new Object[] {s});
        }

        TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.scoreboard.players.list.player.count", new Object[] {Integer.valueOf(map.size()), s});
        textcomponenttranslation.getStyle().setColor(TextFormatting.DARK_GREEN);
        sender.addChatMessage(textcomponenttranslation);

        for (Score score : map.values())
        {
            sender.addChatMessage(new TextComponentTranslation("commands.scoreboard.players.list.player.entry", new Object[] {Integer.valueOf(score.getScorePoints()), score.getObjective().getDisplayName(), score.getObjective().getName()}));
        }
    }
    else
    {
        Collection<String> collection = scoreboard.getObjectiveNames();
        sender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, collection.size());

        if (collection.isEmpty())
        {
            throw new CommandException("commands.scoreboard.players.list.empty", new Object[0]);
        }

        TextComponentTranslation textcomponenttranslation1 = new TextComponentTranslation("commands.scoreboard.players.list.count", new Object[] {Integer.valueOf(collection.size())});
        textcomponenttranslation1.getStyle().setColor(TextFormatting.DARK_GREEN);
        sender.addChatMessage(textcomponenttranslation1);
        sender.addChatMessage(new TextComponentString(joinNiceString(collection.toArray())));
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:41,代码来源:CommandScoreboard.java

示例8: getCommandStats

import net.minecraft.command.CommandResultStats; //导入依赖的package包/类
@Override
public CommandResultStats getCommandStats() {
	if (m_realPlayer == null) {
		return super.getCommandStats();
	} else {
		syncToRealPlayer();
		return syncPublicFieldsFromRealAndReturn(m_realPlayer.getCommandStats());
	}
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:10,代码来源:EntityPlayerMPProxy.java

示例9: getCommandStats

import net.minecraft.command.CommandResultStats; //导入依赖的package包/类
@Override
public CommandResultStats getCommandStats() {
	if (m_realPlayer == null) {
		return super.getCommandStats();
	} else {
		return m_realPlayer.getCommandStats();
	}
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:9,代码来源:EntityPlayerProxy.java

示例10: Entity

import net.minecraft.command.CommandResultStats; //导入依赖的package包/类
public Entity(World worldIn)
{
    this.entityId = nextEntityID++;
    this.riddenByEntities = Lists.<Entity>newArrayList();
    this.boundingBox = ZERO_AABB;
    this.width = 0.6F;
    this.height = 1.8F;
    this.nextStepDistance = 1;
    this.rand = new Random();
    this.field_190534_ay = -this.func_190531_bD();
    this.firstUpdate = true;
    this.entityUniqueID = MathHelper.getRandomUUID(this.rand);
    this.cachedUniqueIdString = this.entityUniqueID.toString();
    this.cmdResultStats = new CommandResultStats();
    this.tags = Sets.<String>newHashSet();
    this.field_191505_aI = new double[] {0.0D, 0.0D, 0.0D};
    this.world = worldIn;
    this.setPosition(0.0D, 0.0D, 0.0D);

    if (worldIn != null)
    {
        this.dimension = worldIn.provider.getDimensionType().getId();
    }

    this.dataManager = new EntityDataManager(this);
    this.dataManager.register(FLAGS, Byte.valueOf((byte)0));
    this.dataManager.register(AIR, Integer.valueOf(300));
    this.dataManager.register(CUSTOM_NAME_VISIBLE, Boolean.valueOf(false));
    this.dataManager.register(CUSTOM_NAME, "");
    this.dataManager.register(SILENT, Boolean.valueOf(false));
    this.dataManager.register(NO_GRAVITY, Boolean.valueOf(false));
    this.entityInit();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:34,代码来源:Entity.java

示例11: setCommandStat

import net.minecraft.command.CommandResultStats; //导入依赖的package包/类
public void setCommandStat(CommandResultStats.Type type, int amount)
{
    if (this.world != null && !this.world.isRemote)
    {
        this.cmdResultStats.setCommandStatForSender(this.world.getMinecraftServer(), this, type, amount);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:8,代码来源:Entity.java

示例12: setCommandStat

import net.minecraft.command.CommandResultStats; //导入依赖的package包/类
public void setCommandStat(CommandResultStats.Type type, int amount)
{
    if (this.worldObj != null && !this.worldObj.isRemote)
    {
        this.cmdResultStats.setCommandStatForSender(this.worldObj.getMinecraftServer(), this, type, amount);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:8,代码来源:Entity.java

示例13: setCommandStat

import net.minecraft.command.CommandResultStats; //导入依赖的package包/类
public void setCommandStat(CommandResultStats.Type type, int amount)
{
    this.cmdResultStats.func_179672_a(this, type, amount);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:Entity.java

示例14: getCommandStats

import net.minecraft.command.CommandResultStats; //导入依赖的package包/类
public CommandResultStats getCommandStats()
{
    return this.cmdResultStats;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:Entity.java

示例15: setCommandStat

import net.minecraft.command.CommandResultStats; //导入依赖的package包/类
public void setCommandStat(CommandResultStats.Type type, int amount)
{
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:4,代码来源:RConConsoleSource.java


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