本文整理匯總了Java中net.minecraft.command.CommandBase.parseBoolean方法的典型用法代碼示例。如果您正苦於以下問題:Java CommandBase.parseBoolean方法的具體用法?Java CommandBase.parseBoolean怎麽用?Java CommandBase.parseBoolean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.command.CommandBase
的用法示例。
在下文中一共展示了CommandBase.parseBoolean方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: actorFromArgs
import net.minecraft.command.CommandBase; //導入方法依賴的package包/類
/**
* Create an actor from command line arguments (i.e. String array).
* Description of every element in array:
*
* 1. Ignored (since it's filename)
* 2. Name tag
* 3. Model name
* 4. Skin resource location
* 5. Invincible flag (boolean)
*
* And of course, all of those arguments are optional (i.e. have default
* values).
*/
public static EntityActor actorFromArgs(String[] args, World world) throws CommandException
{
EntityActor actor = null;
String name = args.length >= 2 ? args[1] : "";
String model = args.length >= 3 ? args[2] : "";
String skin = args.length >= 4 ? args[3] : "";
boolean invincible = args.length >= 5 ? CommandBase.parseBoolean(args[4]) : false;
actor = new EntityActor(world);
actor.modify(MorphUtils.morphFromModel(model, skin), false, false, true);
actor.setEntityInvulnerable(invincible);
actor.setCustomNameTag(name);
return actor;
}
示例2: execute
import net.minecraft.command.CommandBase; //導入方法依賴的package包/類
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
if(args.length != 1) {
return;
}
boolean flag = CommandBase.parseBoolean(args[0]);
ClientProxy.settings.setBoolean("client.infobar.enabled", flag);
}
示例3: execute
import net.minecraft.command.CommandBase; //導入方法依賴的package包/類
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
if(args.length != 1) {
sender.sendMessage(new TextComponentString("Enables/Disables the invoke visualization."));
return;
}
boolean flag = CommandBase.parseBoolean(args[0]);
ClientProxy.settings.setBoolean("client.render.invokeVisualize", flag);
}
示例4: execute
import net.minecraft.command.CommandBase; //導入方法依賴的package包/類
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
if(args.length != 1) {
return;
}
boolean flag = CommandBase.parseBoolean(args[0]);
ClientProxy.settings.setBoolean("invoke.tracker", flag);
ClientProxy.settings.send();
}