當前位置: 首頁>>代碼示例>>Java>>正文


Java CommandBase.parseBoolean方法代碼示例

本文整理匯總了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;
}
 
開發者ID:mchorse,項目名稱:blockbuster,代碼行數:30,代碼來源:CommandAction.java

示例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);
}
 
開發者ID:tiffit,項目名稱:TaleCraft,代碼行數:10,代碼來源:InfobarCommand.java

示例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);
}
 
開發者ID:tiffit,項目名稱:TaleCraft,代碼行數:11,代碼來源:InvokeVisualizationCommand.java

示例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();
}
 
開發者ID:tiffit,項目名稱:TaleCraft,代碼行數:11,代碼來源:InvokeTrackerCommand.java


注:本文中的net.minecraft.command.CommandBase.parseBoolean方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。