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


Java CommandResultStats.Type方法代码示例

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


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

示例1: setCommandStat

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

示例2: readFromNBT

import net.minecraft.command.CommandResultStats; //导入方法依赖的package包/类
public void readFromNBT(NBTTagCompound compound)
{
    this.isEditable = false;
    super.readFromNBT(compound);
    ICommandSender icommandsender = new ICommandSender()
    {
        public String getName()
        {
            return "Sign";
        }
        public IChatComponent getDisplayName()
        {
            return new ChatComponentText(this.getName());
        }
        public void addChatMessage(IChatComponent component)
        {
        }
        public boolean canCommandSenderUseCommand(int permLevel, String commandName)
        {
            return true;
        }
        public BlockPos getPosition()
        {
            return TileEntitySign.this.pos;
        }
        public Vec3 getPositionVector()
        {
            return new Vec3((double)TileEntitySign.this.pos.getX() + 0.5D, (double)TileEntitySign.this.pos.getY() + 0.5D, (double)TileEntitySign.this.pos.getZ() + 0.5D);
        }
        public World getEntityWorld()
        {
            return TileEntitySign.this.worldObj;
        }
        public Entity getCommandSenderEntity()
        {
            return null;
        }
        public boolean sendCommandFeedback()
        {
            return false;
        }
        public void setCommandStat(CommandResultStats.Type type, int amount)
        {
        }
    };

    for (int i = 0; i < 4; ++i)
    {
        String s = compound.getString("Text" + (i + 1));

        try
        {
            IChatComponent ichatcomponent = IChatComponent.Serializer.jsonToComponent(s);

            try
            {
                this.signText[i] = ChatComponentProcessor.processComponent(icommandsender, ichatcomponent, (Entity)null);
            }
            catch (CommandException var7)
            {
                this.signText[i] = ichatcomponent;
            }
        }
        catch (JsonParseException var8)
        {
            this.signText[i] = new ChatComponentText(s);
        }
    }

    this.stats.readStatsFromNBT(compound);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:72,代码来源:TileEntitySign.java

示例3: executeCommand

import net.minecraft.command.CommandResultStats; //导入方法依赖的package包/类
public boolean executeCommand(final EntityPlayer playerIn)
{
    ICommandSender icommandsender = new ICommandSender()
    {
        public String getName()
        {
            return playerIn.getName();
        }
        public IChatComponent getDisplayName()
        {
            return playerIn.getDisplayName();
        }
        public void addChatMessage(IChatComponent component)
        {
        }
        public boolean canCommandSenderUseCommand(int permLevel, String commandName)
        {
            return permLevel <= 2;
        }
        public BlockPos getPosition()
        {
            return TileEntitySign.this.pos;
        }
        public Vec3 getPositionVector()
        {
            return new Vec3((double)TileEntitySign.this.pos.getX() + 0.5D, (double)TileEntitySign.this.pos.getY() + 0.5D, (double)TileEntitySign.this.pos.getZ() + 0.5D);
        }
        public World getEntityWorld()
        {
            return playerIn.getEntityWorld();
        }
        public Entity getCommandSenderEntity()
        {
            return playerIn;
        }
        public boolean sendCommandFeedback()
        {
            return false;
        }
        public void setCommandStat(CommandResultStats.Type type, int amount)
        {
            TileEntitySign.this.stats.func_179672_a(this, type, amount);
        }
    };

    for (int i = 0; i < this.signText.length; ++i)
    {
        ChatStyle chatstyle = this.signText[i] == null ? null : this.signText[i].getChatStyle();

        if (chatstyle != null && chatstyle.getChatClickEvent() != null)
        {
            ClickEvent clickevent = chatstyle.getChatClickEvent();

            if (clickevent.getAction() == ClickEvent.Action.RUN_COMMAND)
            {
                MinecraftServer.getServer().getCommandManager().executeCommand(icommandsender, clickevent.getValue());
            }
        }
    }

    return true;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:63,代码来源:TileEntitySign.java

示例4: setCommandStat

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

示例5: setCommandStat

import net.minecraft.command.CommandResultStats; //导入方法依赖的package包/类
public void setCommandStat(CommandResultStats.Type type, int amount)
{
    this.resultStats.setCommandStatForSender(this.getServer(), this, type, amount);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:CommandBlockBaseLogic.java

示例6: setCommandStat

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

示例7: readFromNBT

import net.minecraft.command.CommandResultStats; //导入方法依赖的package包/类
public void readFromNBT(NBTTagCompound compound)
{
    this.isEditable = false;
    super.readFromNBT(compound);
    ICommandSender icommandsender = new ICommandSender()
    {
        public String getName()
        {
            return "Sign";
        }
        public ITextComponent getDisplayName()
        {
            return new TextComponentString(this.getName());
        }
        public void addChatMessage(ITextComponent component)
        {
        }
        public boolean canCommandSenderUseCommand(int permLevel, String commandName)
        {
            return true;
        }
        public BlockPos getPosition()
        {
            return TileEntitySign.this.pos;
        }
        public Vec3d getPositionVector()
        {
            return new Vec3d((double)TileEntitySign.this.pos.getX() + 0.5D, (double)TileEntitySign.this.pos.getY() + 0.5D, (double)TileEntitySign.this.pos.getZ() + 0.5D);
        }
        public World getEntityWorld()
        {
            return TileEntitySign.this.world;
        }
        public Entity getCommandSenderEntity()
        {
            return null;
        }
        public boolean sendCommandFeedback()
        {
            return false;
        }
        public void setCommandStat(CommandResultStats.Type type, int amount)
        {
        }
        public MinecraftServer getServer()
        {
            return TileEntitySign.this.world.getMinecraftServer();
        }
    };

    for (int i = 0; i < 4; ++i)
    {
        String s = compound.getString("Text" + (i + 1));
        ITextComponent itextcomponent = ITextComponent.Serializer.jsonToComponent(s);

        try
        {
            this.signText[i] = TextComponentUtils.processComponent(icommandsender, itextcomponent, (Entity)null);
        }
        catch (CommandException var7)
        {
            this.signText[i] = itextcomponent;
        }
    }

    this.stats.readStatsFromNBT(compound);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:68,代码来源:TileEntitySign.java

示例8: executeCommand

import net.minecraft.command.CommandResultStats; //导入方法依赖的package包/类
public boolean executeCommand(final EntityPlayer playerIn)
{
    ICommandSender icommandsender = new ICommandSender()
    {
        public String getName()
        {
            return playerIn.getName();
        }
        public ITextComponent getDisplayName()
        {
            return playerIn.getDisplayName();
        }
        public void addChatMessage(ITextComponent component)
        {
        }
        public boolean canCommandSenderUseCommand(int permLevel, String commandName)
        {
            return permLevel <= 2;
        }
        public BlockPos getPosition()
        {
            return TileEntitySign.this.pos;
        }
        public Vec3d getPositionVector()
        {
            return new Vec3d((double)TileEntitySign.this.pos.getX() + 0.5D, (double)TileEntitySign.this.pos.getY() + 0.5D, (double)TileEntitySign.this.pos.getZ() + 0.5D);
        }
        public World getEntityWorld()
        {
            return playerIn.getEntityWorld();
        }
        public Entity getCommandSenderEntity()
        {
            return playerIn;
        }
        public boolean sendCommandFeedback()
        {
            return false;
        }
        public void setCommandStat(CommandResultStats.Type type, int amount)
        {
            if (TileEntitySign.this.world != null && !TileEntitySign.this.world.isRemote)
            {
                TileEntitySign.this.stats.setCommandStatForSender(TileEntitySign.this.world.getMinecraftServer(), this, type, amount);
            }
        }
        public MinecraftServer getServer()
        {
            return playerIn.getServer();
        }
    };

    for (ITextComponent itextcomponent : this.signText)
    {
        Style style = itextcomponent == null ? null : itextcomponent.getStyle();

        if (style != null && style.getClickEvent() != null)
        {
            ClickEvent clickevent = style.getClickEvent();

            if (clickevent.getAction() == ClickEvent.Action.RUN_COMMAND)
            {
                playerIn.getServer().getCommandManager().executeCommand(icommandsender, clickevent.getValue());
            }
        }
    }

    return true;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:70,代码来源:TileEntitySign.java


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