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


Java CommandBlock类代码示例

本文整理汇总了Java中org.bukkit.block.CommandBlock的典型用法代码示例。如果您正苦于以下问题:Java CommandBlock类的具体用法?Java CommandBlock怎么用?Java CommandBlock使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: fireTrigger

import org.bukkit.block.CommandBlock; //导入依赖的package包/类
/**
 * Execute a trigger for this puzzle.
 *
 * Valid Method Signatures:
 * doStuff()
 * doStuff(CommandBlock)
 * @param trigger
 */
public void fireTrigger(String trigger, CommandBlock block) {
    if (!triggers.containsKey(getClass())) // Get and cache the trigger map.
        addTriggers(getClass());

    Map<String, Method> t = triggers.get(getClass());
    if (!t.containsKey(trigger))
        return; // Is this trigger applicable to this puzzle?

    try {
        Method m = t.get(trigger); // Fire the method associated with the trigger.
        PuzzleTrigger pt = m.getAnnotation(PuzzleTrigger.class);
        if (!pt.skipCheck() && !canTrigger())
            return; // If the trigger conditions aren't met, don't execute.

        if (m.getParameterCount() > 0) {
            m.invoke(this, block);
        } else {
            m.invoke(this);
        }
    } catch (Exception e) {
        e.printStackTrace();
        Core.warn("Failed to execute puzzle trigger '" + trigger + "' in " + getClass().getSimpleName() + ".");
    }
}
 
开发者ID:Kneesnap,项目名称:Kineticraft,代码行数:33,代码来源:Puzzle.java

示例2: bPress

import org.bukkit.block.CommandBlock; //导入依赖的package包/类
@PuzzleTrigger
public void bPress(CommandBlock cmd) {
    buttons--;

    // Play sound.
    cmd.getBlock().getWorld().playSound(cmd.getBlock().getLocation(), Sound.BLOCK_NOTE_PLING, 1F, 2F);

    // Get rid of button
    for (BlockFace face : Utils.CUBE_FACES) {
        Block bk = cmd.getBlock().getRelative(face, 2);
        if (bk.getType() == Material.WOOD_BUTTON)
            bk.setType(Material.AIR);
    }

    if (buttons == 0) {// If there are no buttons left, activate the gold torch.
        GenericItem iw = new GenericItem(ItemManager.createItem(Material.RED_ROSE, ChatColor.RED + "Red Key"));
        iw.setTagString("id", "d1_red");
        Utils.giveItem(Utils.getNearestPlayer(cmd.getLocation(), 15), iw.generateItem());
        cmd.getBlock().getWorld().playSound(cmd.getBlock().getLocation(), Sound.BLOCK_NOTE_PLING, 1F, 0.5F);
    }
}
 
开发者ID:Kneesnap,项目名称:Kineticraft,代码行数:22,代码来源:GatherPuzzle.java

示例3: changeColor

import org.bukkit.block.CommandBlock; //导入依赖的package包/类
@SuppressWarnings("SuspiciousMethodCalls")
@PuzzleTrigger
public void changeColor(CommandBlock block) {
    Block wool = block.getBlock().getRelative(BlockFace.UP);
    int index = COLORS.indexOf(((Wool) wool.getState().getData()).getColor()) + 1;
    wool.setData(COLORS.get(index >= COLORS.size() ? 0 : index).getWoolData());
    scanBoard();
}
 
开发者ID:Kneesnap,项目名称:Kineticraft,代码行数:9,代码来源:MatchPuzzle.java

示例4: lightTorch

import org.bukkit.block.CommandBlock; //导入依赖的package包/类
@PuzzleTrigger
public void lightTorch(CommandBlock cmd) {
    Location loc = cmd.getLocation();
    for (int i = 0; i < 10; i++) {
        loc.add(0, 1, 0);
        if (loc.getBlock().getType() == Material.REDSTONE_TORCH_ON)
            resetFakeBlock(loc.getBlock());
    }

    getDungeon().playSound(Sound.BLOCK_NOTE_HARP, 1.25F);
    getDungeon().playSound(Sound.BLOCK_NOTE_HARP, 1F);
}
 
开发者ID:Kneesnap,项目名称:Kineticraft,代码行数:13,代码来源:GatherPuzzle.java

示例5: makeAnchors

import org.bukkit.block.CommandBlock; //导入依赖的package包/类
private void makeAnchors() {
	this.anchors = new HashMap<>();
	
	for (String worldName : QuestManagerPlugin.questManagerPlugin.getPluginConfiguration().getWorlds()) {
		World world = Bukkit.getWorld(worldName);
		if (world == null) {
			continue;
		}
		
		Location loc = world.getSpawnLocation().clone();
		loc.setY(5);
		loc.getBlock().setType(Material.COMMAND);
		anchors.put(worldName, (CommandBlock) loc.getBlock().getState());
	}
}
 
开发者ID:Dove-Bren,项目名称:QuestManager,代码行数:16,代码来源:QuestManager.java

示例6: serializeState

import org.bukkit.block.CommandBlock; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public static Optional<String> serializeState(BlockState state) {
    YamlConfiguration yaml = new YamlConfiguration();

    // http://minecraft.gamepedia.com/Block_entity was used as a reference for this method

    if (state instanceof InventoryHolder) {
        yaml.set(INVENTORY_KEY, InventoryHelper.serializeInventory(((InventoryHolder) state).getInventory()));
    }

    if (state instanceof Sign) {
        yaml.set(SIGN_LINES_KEY, Arrays.asList(((Sign) state).getLines()));
    } else if (Support.BANNER && state instanceof Banner) {
        yaml.set(BANNER_BASE_COLOR_KEY, ((Banner) state).getBaseColor().name());
        ConfigurationSection patternSection = yaml.createSection(BANNER_PATTERNS_KEY);
        List<Pattern> patterns = ((Banner) state).getPatterns();
        for (int i = 0; i < patterns.size(); i++) {
            ConfigurationSection subSection = patternSection.createSection("" + i);
            subSection.set(BANNER_PATTERN_COLOR_KEY, patterns.get(i).getColor().name());
            subSection.set(BANNER_PATTERN_TYPE_KEY, patterns.get(i).getPattern().name());
        }
    } else if (state instanceof CreatureSpawner) {
        yaml.set(SPAWNER_TYPE_KEY, ((CreatureSpawner) state).getSpawnedType().name());
        yaml.set(SPAWNER_DELAY_KEY, ((CreatureSpawner) state).getDelay());
    } else if (state instanceof NoteBlock) {
        yaml.set(NOTE_OCTAVE_KEY, ((NoteBlock) state).getNote().getOctave());
        yaml.set(NOTE_TONE_KEY, ((NoteBlock) state).getNote().getTone().name());
    } else if (state instanceof Jukebox) {
        if (((Jukebox) state).isPlaying()) {
            yaml.set(JUKEBOX_DISC_KEY, ((Jukebox) state).getPlaying());
        }
    } else if (state instanceof Skull) {
        yaml.set(SKULL_OWNER_KEY, ((Skull) state).getOwner());
        yaml.set(SKULL_ROTATION_KEY, ((Skull) state).getRotation().name());
    } else if (state instanceof CommandBlock) {
        yaml.set(COMMAND_NAME_KEY, ((CommandBlock) state).getName());
        yaml.set(COMMAND_CMD_KEY, ((CommandBlock) state).getCommand());
    } else if (state instanceof FlowerPot) {
        yaml.set(FLOWER_TYPE_KEY, ((FlowerPot) state).getContents().getItemType().name());
        yaml.set(FLOWER_DATA_KEY, ((FlowerPot) state).getContents().getData());
    }

    if (yaml.getKeys(false).size() > 0) {
        return Optional.of(yaml.saveToString());
    }
    return Optional.absent();
}
 
开发者ID:caseif,项目名称:Steel,代码行数:48,代码来源:BlockStateSerializer.java

示例7: isDifferent

import org.bukkit.block.CommandBlock; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public boolean isDifferent(Block block) {
    Material blockMaterial = block.getType();
    byte blockData = block.getData();
    if ((material != null && blockMaterial != material) || (data != null && blockData != data)) {
        return true;
    }

    // Special cases
    if (material == Material.WALL_BANNER || material == Material.STANDING_BANNER) {
        // Can't compare patterns for now
        return true;
    }

    BlockState blockState = block.getState();
    if (blockState instanceof Sign) {
        // Not digging into sign text
        return true;
    } else if (blockState instanceof CommandBlock && extraData != null && extraData instanceof BlockCommand) {
        CommandBlock command = (CommandBlock)blockState;
        if (!command.getCommand().equals(((BlockCommand)extraData).command)) {
            return true;
        }
    } else if (blockState instanceof InventoryHolder) {
        // Just copy it over.... not going to compare inventories :P
        return true;
    }

    return false;
}
 
开发者ID:elBukkit,项目名称:MagicLib,代码行数:31,代码来源:MaterialAndData.java

示例8: onBlockRedstone

import org.bukkit.block.CommandBlock; //导入依赖的package包/类
public void onBlockRedstone(BlockRedstoneEvent event) 
{
	//wenn: am Block  redstone  gebaut/abgebaut   bzw. Signal sich �ndert
	Block block = event.getBlock();
	int iBlockID = block.getTypeId();
	int iPower = 0;
	if ( !(iBlockID==137) )   { return; }
	BlockState blState = event.getBlock().getState();
	if (blState instanceof CommandBlock)   // Kommandoblock
	{
		m_CommandBlock = (CommandBlock)blState;
		try
		{
			iPower = block.getBlockPower();
			if(iPower==0) { return; }
		}  catch  ( Exception exc ) { iPower = 0; return; }
		System.out.println(" MCBP plugin:  Kommandoblock  onBlockRedstone()  ");
		System.out.println(" MCBP plugin:   BlockPower =  " + iPower);
		
		m_CommandsString = m_CommandBlock.getCommand();
		
		System.out.println(" MCBP plugin:    " + m_CommandsString);
		// logTo(String sLogStr)
		//  =>  weiter an   CommandParser()
		ParsedCommand[] commands = getCommands(m_CommandsString, block);
		for (int i=0; i < commands.length;i++)
		{	
			//CommandSender oSender = (CommandSender) m_CommandBlock.getBlock();
			//BlockCommandSender bcs = (BlockCommandSender)m_CommandBlock;
			sendeBefehl(commands[i].getCommand());
			System.out.println("send Command: " + commands[i].getCommand());
			try {
				Thread.sleep(commands[i].getInterval());
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
}
 
开发者ID:memoryleakx,项目名称:MultiCommandBlockPlugin,代码行数:41,代码来源:CommandBlockExt.java

示例9: getName

import org.bukkit.block.CommandBlock; //导入依赖的package包/类
/**
 * @param commandSender A command sender.
 * @return A name for this sender: the player name, or “Command block 'name'”, or “Console”.
 */
public static String getName(CommandSender commandSender)
{
	if (commandSender instanceof Player)
		return ((Player) commandSender).getDisplayName();

	else if (commandSender instanceof CommandBlock)
		return "Command block '" + commandSender.getName() + "'";

	else
		return "Console";
}
 
开发者ID:pgmann,项目名称:SpectatorPlus,代码行数:16,代码来源:SPUtils.java

示例10: onCommand

import org.bukkit.block.CommandBlock; //导入依赖的package包/类
@Override
protected void onCommand(BlockCommandSender sender, String[] args) {
    getDungeon(sender).triggerPuzzles(args[0], (CommandBlock) sender.getBlock().getState());
}
 
开发者ID:Kneesnap,项目名称:Kineticraft,代码行数:5,代码来源:CommandPuzzleTrigger.java

示例11: finish

import org.bukkit.block.CommandBlock; //导入依赖的package包/类
@PuzzleTrigger
public void finish(CommandBlock cmd) {
    if (getGateLocation() == null || cmd.getLocation().distance(getGateLocation()) <= 10)
        complete();
}
 
开发者ID:Kneesnap,项目名称:Kineticraft,代码行数:6,代码来源:Puzzle.java

示例12: fireLazer

import org.bukkit.block.CommandBlock; //导入依赖的package包/类
@PuzzleTrigger
public void fireLazer(CommandBlock block) {
    getRepeats().clear();
    Block bk = block.getBlock().getRelative(BlockFace.UP);

    BlockFace[] direction = new BlockFace[] {Utils.getDirection(bk)};
    Location lazer = bk.getLocation().add(.5, .15, .5);

    // Shoot the lazer.
    traceTask = addTimerTask(() -> {
        lazer.getWorld().spawnParticle(Particle.REDSTONE, lazer, 1, 0, 0, 0, 0); // Draw trail.

        Block last = lazer.getBlock();
        BlockFace d = direction[0];
        lazer.add(d.getModX() / ((double) PER_BLOCK), 0, d.getModZ() / ((double) PER_BLOCK)); // Move the lazer along its path.
        Block b = lazer.getBlock();

        if (!last.equals(b)) {
            if (b.getType() == Material.AIR)
                return;

            if (b.getType() == Material.DIODE_BLOCK_OFF && !getRepeats().contains(b)) { // Change direction.
                getRepeats().add(b); // Don't allow infinite loops.
                BlockFace newDirection = Utils.getDirection(b);
                if (newDirection.getOppositeFace() != d) { // Cannot activate repeater from the direction it faces.
                    lazer.add(d.getModX() * 0.5, 0, d.getModZ() * 0.5); // Center lazer.
                    activateRepeater(b);
                    direction[0] = newDirection; // Update direction.
                    return;
                }
            }

            // We've hit a wall.
            traceTask.cancel(); // Stop trying to trace the lazer.
            traceTask = null;
            if (b.getType() == Material.BEACON) {// This wall is actually the goal block.
                complete();
            } else { // They failed.
                b.getWorld().spawnEntity(b.getLocation().add(0, 1, 0), EntityType.ZOMBIE);
            }
        }
    }, 1L);
}
 
开发者ID:Kneesnap,项目名称:Kineticraft,代码行数:44,代码来源:LazerPuzzle.java

示例13: getAnchor

import org.bukkit.block.CommandBlock; //导入依赖的package包/类
public CommandBlock getAnchor(String worldName) {
	return anchors.get(worldName);
}
 
开发者ID:Dove-Bren,项目名称:QuestManager,代码行数:4,代码来源:QuestManager.java

示例14: generateCmdBlockWithOffHand

import org.bukkit.block.CommandBlock; //导入依赖的package包/类
private void generateCmdBlockWithOffHand(Location l, ArmorStand as) {
    Location loc = as.getLocation();
    int dSlots = getDisabledSlots(as);
    String hand, boots, legs, chest, helm, offHand;
    int handDmg, offHandDmg;
    hand = as.getEquipment().getItemInMainHand() == null ? "air" : getNmsName(as.getEquipment().getItemInMainHand().getType());
    offHand = as.getEquipment().getItemInOffHand() == null ? "air" : getNmsName(as.getEquipment().getItemInOffHand().getType());
    boots = as.getBoots() == null ? "air" : getNmsName(as.getBoots().getType());
    legs = as.getLeggings() == null ? "air" : getNmsName(as.getLeggings().getType());
    chest = as.getChestplate() == null ? "air" : getNmsName(as.getChestplate().getType());
    helm = as.getHelmet() == null ? "air" : getNmsName(as.getHelmet().getType());
    handDmg = as.getEquipment().getItemInMainHand() == null ? 0 : as.getEquipment().getItemInMainHand().getDurability();
    offHandDmg = as.getEquipment().getItemInOffHand() == null ? 0 : as.getEquipment().getItemInOffHand().getDurability();

    int bootsDmg = as.getBoots() == null ? 0 : as.getBoots().getDurability();
    int legsDmg = as.getLeggings() == null ? 0 : as.getLeggings().getDurability();
    int chestDmg = as.getChestplate() == null ? 0 : as.getChestplate().getDurability();
    int helmDmg = as.getHelmet() == null ? 0 : as.getHelmet().getDurability();
    EulerAngle he = as.getHeadPose();
    EulerAngle ll = as.getLeftLegPose();
    EulerAngle rl = as.getRightLegPose();
    EulerAngle la = as.getLeftArmPose();
    EulerAngle ra = as.getRightArmPose();
    EulerAngle bo = as.getBodyPose();
    String cmd = "summon " + summonEntityName + " " + Utils.twoDec(loc.getX()) + " " + Utils.twoDec(loc.getY()) + " " + Utils.twoDec(loc.getZ()) + " {"
            + (as.isVisible() ? "" : "Invisible:1,")
            + (as.hasBasePlate() ? "" : "NoBasePlate:1,")
            + (as.hasGravity() ? "" : "NoGravity:1,")
            + (as.hasArms() ? "ShowArms:1," : "")
            + (as.isSmall() ? "Small:1," : "")
            + (isInvulnerable(as) ? "Invulnerable:1," : "")
            + (dSlots == 0 ? "" : ("DisabledSlots:" + dSlots + ","))
            + (as.isCustomNameVisible() ? "CustomNameVisible:1," : "")
            + (as.getCustomName() == null ? "" : ("CustomName:\"" + as.getCustomName() + "\","))
            + (loc.getYaw() == 0F ? "" : ("Rotation:[" + Utils.twoDec(loc.getYaw()) + "f],"))
            + (as.getBoots() == null && as.getLeggings() == null && as.getChestplate() == null && as.getHelmet() == null ? "" : (
            "ArmorItems:["
                    + "{id:" + boots + ",Count:" + as.getBoots().getAmount() + ",Damage:" + bootsDmg + getItemStackTags(as.getBoots()) + "},"
                    + "{id:" + legs + ",Count:" + as.getLeggings().getAmount() + ",Damage:" + legsDmg + getItemStackTags(as.getLeggings()) + "},"
                    + "{id:" + chest + ",Count:" + as.getChestplate().getAmount() + ",Damage:" + chestDmg + getItemStackTags(as.getChestplate()) + "},"
                    + "{id:" + helm + ",Count:" + as.getHelmet().getAmount() + ",Damage:" + helmDmg + getItemStackTags(as.getHelmet()) + skullOwner(as.getHelmet()) + "}],"))
            + (as.getEquipment().getItemInMainHand() == null && as.getEquipment().getItemInOffHand() == null ? "" : (
            "HandItems:["
                    + "{id:" + hand + ",Count:" + as.getEquipment().getItemInMainHand().getAmount() + ",Damage:" + handDmg + getItemStackTags(as.getEquipment().getItemInMainHand()) + "},"
                    + "{id:" + offHand + ",Count:" + as.getEquipment().getItemInOffHand().getAmount() + ",Damage:" + offHandDmg + getItemStackTags(as.getEquipment().getItemInOffHand()) + "}],"))
            + "Pose:{"
            + (bo.equals(zero) ? "" : ("Body:[" + Utils.angle(bo.getX()) + "f," + Utils.angle(bo.getY()) + "f," + Utils.angle(bo.getZ()) + "f],"))
            + (he.equals(zero) ? "" : ("Head:[" + Utils.angle(he.getX()) + "f," + Utils.angle(he.getY()) + "f," + Utils.angle(he.getZ()) + "f],"))
            + (ll.equals(zero) ? "" : ("LeftLeg:[" + Utils.angle(ll.getX()) + "f," + Utils.angle(ll.getY()) + "f," + Utils.angle(ll.getZ()) + "f],"))
            + (rl.equals(zero) ? "" : ("RightLeg:[" + Utils.angle(rl.getX()) + "f," + Utils.angle(rl.getY()) + "f," + Utils.angle(rl.getZ()) + "f],"))
            + (la.equals(zero) ? "" : ("LeftArm:[" + Utils.angle(la.getX()) + "f," + Utils.angle(la.getY()) + "f," + Utils.angle(la.getZ()) + "f],"))
            + "RightArm:[" + Utils.angle(ra.getX()) + "f," + Utils.angle(ra.getY()) + "f," + Utils.angle(ra.getZ()) + "f]}}";
    Block b = l.getBlock();
    b.setType(Material.COMMAND);
    //noinspection deprecation
    b.setData((byte) 0);
    CommandBlock cb = (CommandBlock) b.getState();
    cb.setCommand(cmd);
    cb.update();
}
 
开发者ID:St3venAU,项目名称:ArmorStandTools,代码行数:61,代码来源:NMS.java

示例15: generateCmdBlockWithoutOffHand

import org.bukkit.block.CommandBlock; //导入依赖的package包/类
@SuppressWarnings("deprecation")
private void generateCmdBlockWithoutOffHand(Location l, ArmorStand as) {
    Location loc = as.getLocation();
    int dSlots = Main.nms.getDisabledSlots(as);
    String hand, boots, legs, chest, helm;
    int handDmg;

    hand = getItemInMainHand(as) == null ? "0" : String.valueOf(getItemInMainHand(as).getTypeId());
    boots = as.getBoots() == null ? "0" : String.valueOf(as.getBoots().getTypeId());
    legs = as.getLeggings() == null ? "0" : String.valueOf(as.getLeggings().getTypeId());
    chest = as.getChestplate() == null ? "0" : String.valueOf(as.getChestplate().getTypeId());
    helm = as.getHelmet() == null ? "0" : String.valueOf(as.getHelmet().getTypeId());
    handDmg = getItemInMainHand(as) == null ? 0 : getItemInMainHand(as).getDurability();

    int bootsDmg = as.getBoots() == null ? 0 : as.getBoots().getDurability();
    int legsDmg = as.getLeggings() == null ? 0 : as.getLeggings().getDurability();
    int chestDmg = as.getChestplate() == null ? 0 : as.getChestplate().getDurability();
    int helmDmg = as.getHelmet() == null ? 0 : as.getHelmet().getDurability();
    EulerAngle he = as.getHeadPose();
    EulerAngle ll = as.getLeftLegPose();
    EulerAngle rl = as.getRightLegPose();
    EulerAngle la = as.getLeftArmPose();
    EulerAngle ra = as.getRightArmPose();
    EulerAngle bo = as.getBodyPose();
    String cmd = "summon ArmorStand " + Utils.twoDec(loc.getX()) + " " + Utils.twoDec(loc.getY()) + " " + Utils.twoDec(loc.getZ()) + " {"
            + (as.isVisible() ? "" : "Invisible:1,")
            + (as.hasBasePlate() ? "" : "NoBasePlate:1,")
            + (as.hasGravity() ? "" : "NoGravity:1,")
            + (as.hasArms() ? "ShowArms:1," : "")
            + (as.isSmall() ? "Small:1," : "")
            + (Main.nms.isInvulnerable(as) ? "Invulnerable:1," : "")
            + (dSlots == 0 ? "" : ("DisabledSlots:" + dSlots + ","))
            + (as.isCustomNameVisible() ? "CustomNameVisible:1," : "")
            + (as.getCustomName() == null ? "" : ("CustomName:\"" + as.getCustomName() + "\","))
            + (loc.getYaw() == 0F ? "" : ("Rotation:[" + Utils.twoDec(loc.getYaw()) + "f],"))
            + (getItemInMainHand(as) == null && as.getBoots() == null && as.getLeggings() == null && as.getChestplate() == null && as.getHelmet() == null ? "" : (
            "Equipment:["
                    + "{id:" + hand + ",Count:" + getItemInMainHand(as).getAmount() + ",Damage:" + handDmg + getItemStackTags(getItemInMainHand(as)) + "},"
                    + "{id:" + boots + ",Count:" + as.getBoots().getAmount() + ",Damage:" + bootsDmg + getItemStackTags(as.getBoots()) + "},"
                    + "{id:" + legs + ",Count:" + as.getLeggings().getAmount() + ",Damage:" + legsDmg + getItemStackTags(as.getLeggings()) + "},"
                    + "{id:" + chest + ",Count:" + as.getChestplate().getAmount() + ",Damage:" + chestDmg + getItemStackTags(as.getChestplate()) + "},"
                    + "{id:" + helm + ",Count:" + as.getHelmet().getAmount() + ",Damage:" + helmDmg + getItemStackTags(as.getHelmet()) + skullOwner(as.getHelmet()) + "}],"))
            + "Pose:{"
            + (bo.equals(zero) ? "" : ("Body:[" + Utils.angle(bo.getX()) + "f," + Utils.angle(bo.getY()) + "f," + Utils.angle(bo.getZ()) + "f],"))
            + (he.equals(zero) ? "" : ("Head:[" + Utils.angle(he.getX()) + "f," + Utils.angle(he.getY()) + "f," + Utils.angle(he.getZ()) + "f],"))
            + (ll.equals(zero) ? "" : ("LeftLeg:[" + Utils.angle(ll.getX()) + "f," + Utils.angle(ll.getY()) + "f," + Utils.angle(ll.getZ()) + "f],"))
            + (rl.equals(zero) ? "" : ("RightLeg:[" + Utils.angle(rl.getX()) + "f," + Utils.angle(rl.getY()) + "f," + Utils.angle(rl.getZ()) + "f],"))
            + (la.equals(zero) ? "" : ("LeftArm:[" + Utils.angle(la.getX()) + "f," + Utils.angle(la.getY()) + "f," + Utils.angle(la.getZ()) + "f],"))
            + "RightArm:[" + Utils.angle(ra.getX()) + "f," + Utils.angle(ra.getY()) + "f," + Utils.angle(ra.getZ()) + "f]}}";
    Block b = l.getBlock();
    b.setType(Material.COMMAND);
    b.setData((byte) 0);
    CommandBlock cb = (CommandBlock) b.getState();
    cb.setCommand(cmd);
    cb.update();
}
 
开发者ID:St3venAU,项目名称:ArmorStandTools,代码行数:57,代码来源:NMS.java


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