本文整理汇总了Java中net.minecraft.entity.EntityList.isStringValidEntityName方法的典型用法代码示例。如果您正苦于以下问题:Java EntityList.isStringValidEntityName方法的具体用法?Java EntityList.isStringValidEntityName怎么用?Java EntityList.isStringValidEntityName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.EntityList
的用法示例。
在下文中一共展示了EntityList.isStringValidEntityName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isEntityTypeValid
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
private static <T extends Entity> boolean isEntityTypeValid(ICommandSender commandSender, Map<String, String> params)
{
String s = func_179651_b(params, "type");
s = s != null && s.startsWith("!") ? s.substring(1) : s;
if (s != null && !EntityList.isStringValidEntityName(s))
{
ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.generic.entity.invalidType", new Object[] {s});
chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED);
commandSender.addChatMessage(chatcomponenttranslation);
return false;
}
else
{
return true;
}
}
示例2: isEntityTypeValid
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
private static <T extends Entity> boolean isEntityTypeValid(ICommandSender commandSender, Map<String, String> params)
{
String s = getArgument(params, field_190849_w);
if (s == null)
{
return true;
}
else
{
ResourceLocation resourcelocation = new ResourceLocation(s.startsWith("!") ? s.substring(1) : s);
if (EntityList.isStringValidEntityName(resourcelocation))
{
return true;
}
else
{
TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.entity.invalidType", new Object[] {resourcelocation});
textcomponenttranslation.getStyle().setColor(TextFormatting.RED);
commandSender.addChatMessage(textcomponenttranslation);
return false;
}
}
}
示例3: isEntityTypeValid
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
private static <T extends Entity> boolean isEntityTypeValid(ICommandSender commandSender, Map<String, String> params)
{
String s = getArgument(params, "type");
s = s != null && s.startsWith("!") ? s.substring(1) : s;
if (s != null && !EntityList.isStringValidEntityName(s))
{
TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.entity.invalidType", new Object[] {s});
textcomponenttranslation.getStyle().setColor(TextFormatting.RED);
commandSender.addChatMessage(textcomponenttranslation);
return false;
}
else
{
return true;
}
}