/**
* Callback when the command is invoked
*/
public void processCommand(ICommandSender sender, String[] args) throws CommandException
{
if (args.length < 1)
{
throw new WrongUsageException("commands.testfor.usage", new Object[0]);
}
else
{
Entity entity = func_175768_b(sender, args[0]);
NBTTagCompound nbttagcompound = null;
if (args.length >= 2)
{
try
{
nbttagcompound = JsonToNBT.getTagFromJson(buildString(args, 1));
}
catch (NBTException nbtexception)
{
throw new CommandException("commands.testfor.tagError", new Object[] {nbtexception.getMessage()});
}
}
if (nbttagcompound != null)
{
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
entity.writeToNBT(nbttagcompound1);
if (!NBTUtil.func_181123_a(nbttagcompound, nbttagcompound1, true))
{
throw new CommandException("commands.testfor.failure", new Object[] {entity.getName()});
}
}
notifyOperators(sender, this, "commands.testfor.success", new Object[] {entity.getName()});
}
}
CommandTestFor.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:DecompiledMinecraft
作者:
评论列表
文章目录