Package org.bukkit.craftbukkit.v1_6_R1

Examples of org.bukkit.craftbukkit.v1_6_R1.CraftWorld


    {
      // We use 36 here since it's the size of the player inventory (without armor)
      size = 36;
     
      // This is a PlayerInventory
      ret = new CraftInventoryPlayer(new MCorePlayerInventory());
      PlayerInventory pret = (PlayerInventory)ret;
     
      // helmet
      if (jsonInventory.has(HELMET))
      {
View Full Code Here


  private static void replaceAllBukkitChunks(boolean reset) {
    List<World> worlds = Bukkit.getServer().getWorlds();
    for (World world : worlds) {
      try {
        CraftWorld cw = (CraftWorld) world;
        Field worldServer = CraftWorld.class.getDeclaredField("world");
        worldServer.setAccessible(true);
        ChunkProviderServer cps = ((WorldServer) worldServer.get(cw)).chunkProviderServer;
        for (Chunk c : cps.chunks.values()) {
                    if (reset) {
View Full Code Here

  @Override
  public void run(int playerId) {
    SpoutPlayer player = SpoutManager.getPlayerFromId(playerId);
    if (player != null) {
      CraftWorld cw = ((CraftWorld)player.getWorld());
      if (cw.getHandle().chunkProviderServer.unloadQueue.contains(chunkX, chunkZ)) {
        return;
      }
      if (!cw.getHandle().chunkProviderServer.isChunkLoaded(chunkX, chunkZ)) {
        return;
      }
      Chunk c = player.getWorld().getChunkAt(chunkX, chunkZ);
      if (c instanceof SpoutChunk) {
        SpoutChunk chunk = (SpoutChunk)c;
View Full Code Here

    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

TOP

Related Classes of org.bukkit.craftbukkit.v1_6_R1.CraftWorld

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.