Package org.bukkit.craftbukkit.v1_7_R4.help

Examples of org.bukkit.craftbukkit.v1_7_R4.help.CommandAliasHelpTopic


    boolean preSetup(List<dObject> locations) {
        if (locations.size() == 0)
            return false;
        // Freeze the first world in the list.
        CraftWorld craftWorld = (CraftWorld)((dLocation)locations.get(0)).getWorld();
        boolean was_static = craftWorld.getHandle().isStatic;
        if (no_physics)
            craftWorld.getHandle().isStatic = true;
        return was_static;
    }
View Full Code Here


        return was_static;
    }

    void postComplete(Location loc, boolean was_static) {
        // Unfreeze the first world in the list.
        CraftWorld craftWorld = (CraftWorld)loc.getWorld();
        if (no_physics)
            craftWorld.getHandle().isStatic = was_static;
        no_physics = false;
    }
View Full Code Here

        }
        super.remove();
    }

    public static Arrow createArrow(Location location) {
        CraftWorld world = (CraftWorld) location.getWorld();
        EntityArrow arrow = new FakeArrowEntity(world, location);
        return (Arrow) arrow.getBukkitEntity();
    }
View Full Code Here

    }

    @Override
    public boolean onCommand(CommandSender sender, List<String> args)
    {
        CraftWorld world = null;
        int size = 200;
        int offsetX = 0;
        int offsetZ = 0;
        MapWriter.Angle angle = MapWriter.Angle.d0;
        String label = "";

        if (!args.isEmpty() && !args.get(0).startsWith("-"))
        {
            world = (CraftWorld) Bukkit.getWorld(args.get(0));
            args.remove(0);
        }

        if (world == null)
        {
            if (sender instanceof ConsoleCommandSender)
            {
                sender.sendMessage(ERROR_COLOR + "You need to select world");
                return true;
            }
            world = (CraftWorld) ((Player) sender).getWorld();
            Player player = (Player) sender;
            offsetX = (int) player.getLocation().getX();
            offsetZ = (int) player.getLocation().getZ();
        }

        for (int i = 0; i < args.size(); i++)
        {
            if (args.get(i).equals("-s"))
            {
                try
                {
                    size = Integer.parseInt(args.get(i + 1));
                } catch (Exception e)
                {
                    sender.sendMessage(ERROR_COLOR + "Wrong size " + args.get(i + 1));
                }
            }
            if (args.get(i).equals("-o"))
            {
                try
                {
                    offsetX = Integer.parseInt(args.get(i + 1));
                    offsetZ = Integer.parseInt(args.get(i + 2));
                } catch (Exception e)
                {
                    sender.sendMessage(ERROR_COLOR + "Wrong size " + args.get(i + 1));
                }
            }
            if (args.get(i).equals("-r"))
            {
                try
                {
                    int degrees = Integer.parseInt(args.get(i + 1));
                    if (degrees % 90 == 0)
                    {
                        switch (degrees)
                        {
                            case 90:
                                angle = MapWriter.Angle.d90;
                                break;
                            case 180:
                                angle = MapWriter.Angle.d180;
                                break;
                            case 270:
                                angle = MapWriter.Angle.d270;
                                break;
                        }
                    } else
                    {
                        sender.sendMessage(ERROR_COLOR + "Angles must be divisible by 90 degrees");
                    }
                } catch (Exception e)
                {
                    sender.sendMessage(ERROR_COLOR + "Wrong angle " + args.get(i + 1));
                }
            }
            if (args.get(i).equals("-l"))
            {
                label = "[" + offsetX + "_" + offsetZ + "]";
            }
        }


        MapWriter map = new MapWriter(world.getHandle(), size, angle, sender, offsetX, offsetZ, label);

        this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, map);

        return true;
    }
View Full Code Here

    }

    @Override
    public boolean onCommand(CommandSender sender, List<String> args)
    {
        CraftWorld world = null;

        if (args.size() == 3)
        {
            world = (CraftWorld) Bukkit.getWorld(args.get(0));
            args.remove(0);
View Full Code Here

        World world = interactLocation.getWorld();
        boolean currentState = (interactLocation.getBlock().getData() & 0x8) > 0;
        String state = switchState.toString();

        // Try for a linked player
        CraftPlayer craftPlayer = (CraftPlayer) player;
        if (craftPlayer == null && Bukkit.getOnlinePlayers().size() > 0) {
            // If there's none, link any player
            if (Bukkit.getOnlinePlayers().size() > 0) {
                craftPlayer = (CraftPlayer) Bukkit.getOnlinePlayers().toArray()[0];
            }
            else if (Depends.citizens != null) {
                // If there are no players, link any Human NPC
                for (NPC npc: CitizensAPI.getNPCRegistry()) {
                    if (npc.isSpawned() && npc.getEntity() instanceof Player) {
                        craftPlayer = (CraftPlayer) npc.getEntity();
                        break;
                    }
                }
                // TODO: backup if no human NPC available? (Fake EntityPlayer instance?)
            }
        }

        if ((state.equals("ON") && !currentState) ||
            (state.equals("OFF") && currentState) ||
             state.equals("TOGGLE")) {

            try {
                if (interactLocation.getBlock().getType() == Material.IRON_DOOR_BLOCK) {
                    Location block;
                    if (interactLocation.clone().add(0, -1, 0).getBlock().getType() == Material.IRON_DOOR_BLOCK)
                        block = interactLocation.clone().add(0, -1, 0);
                    else
                        block = interactLocation;
                    block.getBlock().setData((byte) (block.getBlock().getData() ^ 4));
                }
                else {

                    // TODO: Rewrite the below code to not use freakin' NMS!
                    Block.getById(interactLocation.getBlock().getType().getId())
                        .interact(((CraftWorld)world).getHandle(),
                                interactLocation.getBlockX(),
                                interactLocation.getBlockY(),
                                interactLocation.getBlockZ(),
                                craftPlayer != null ? craftPlayer.getHandle(): null, 0, 0f, 0f, 0f);
                }

                dB.echoDebug(scriptEntry, "Switched " + interactLocation.getBlock().getType().toString() + "! Current state now: " +
                        ((interactLocation.getBlock().getData() & 0x8) > 0 ? "ON" : "OFF"));
View Full Code Here

            // Register the command
            forceCommand(name, command, new DenizenCommandHelpTopic(command));
            // Register each alias
            for (String alias : command.getAliases()) {
                if (denizenCommands.containsKey(alias)) continue;
                forceCommand(alias, command, new CommandAliasHelpTopic("/" + alias, name,
                        DenizenAPI.getCurrentInstance().getServer().getHelpMap()));
            }
        }
    }
View Full Code Here

        if(this.autosave) savePlayerData();
    }
    public Inventory getEnderChest() {
        InventoryEnderChest endchest = new InventoryEnderChest();
        endchest.a(this.compound.getList("EnderItems", 0));
        return new CraftInventory(endchest);
    }
View Full Code Here

    public org.bukkit.inventory.PlayerInventory getInventory() {
        if (InventoryScriptHelper.offlineInventories.containsKey(getUniqueId()))
            return InventoryScriptHelper.offlineInventories.get(getUniqueId());
        PlayerInventory inventory = new PlayerInventory(null);
        inventory.b(this.compound.getList("Inventory", 10));
        org.bukkit.inventory.PlayerInventory inv = new CraftInventoryPlayer(inventory);
        InventoryScriptHelper.offlineInventories.put(getUniqueId(), inv);
        return inv;
    }
View Full Code Here

        InventoryScriptHelper.offlineInventories.put(getUniqueId(), inv);
        return inv;
    }

    public void setInventory(org.bukkit.inventory.Inventory inventory) {
        CraftInventoryPlayer inv = new CraftInventoryPlayer(new PlayerInventory(null));
        inv.setContents(inventory.getContents());
        this.compound.set("Inventory", inv.getInventory().a(new NBTTagList()));
        if(this.autosave) savePlayerData();
    }
View Full Code Here

TOP

Related Classes of org.bukkit.craftbukkit.v1_7_R4.help.CommandAliasHelpTopic

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.