Examples of CraftWorld


Examples of org.bukkit.craftbukkit.CraftWorld

  }

  public static DummyWorldServer newInstance() {
    DummyWorldServer world = TEMPLATE.newInstanceNull();
    world.chunkProvider = world.chunkProviderServer = world.DUMMYCPS = new DummyChunkProviderServer(world);
    WorldRef.bukkitWorld.set(world, new CraftWorld(world, null, null));
    return world;
  }
View Full Code Here

Examples of org.bukkit.craftbukkit.v1_6_R1.CraftWorld

    return ret;
 
 
  public static Entry<Integer, String> getBiomeIdAndNameAt(World world, int x, int z)
  {
    CraftWorld craftWorld = (CraftWorld)world;
    WorldServer worldServer = craftWorld.getHandle();
   
    BiomeBase biomeBase = worldServer.getBiome(x, z);
   
    Integer id = biomeBase.id;
    String name = biomeBase.y;
View Full Code Here

Examples of org.bukkit.craftbukkit.v1_6_R1.CraftWorld

    return new SimpleEntry<Integer, String>(id, name);
  }
 
  public static void setBiomeIdAt(World world, int x, int z, int id)
  {
    CraftWorld craftWorld = (CraftWorld)world;
    WorldServer worldServer = craftWorld.getHandle();
   
    BiomeBase bb = BiomeBase.biomes[id];
    if (craftWorld.loadChunk(x >> 4, z >> 4, false)) {
      Chunk chunk = worldServer.getChunkAtWorldCoords(x, z);

      if (chunk != null) {
        byte[] biomevals = chunk.m();
        biomevals[((z & 0xF) << 4) | (x & 0xF)] = (byte)bb.id;
View Full Code Here

Examples of org.bukkit.craftbukkit.v1_6_R1.CraftWorld

    recalcLightLevelAt(block.getWorld(), block.getX(), block.getY(), block.getZ());
  }
 
  public static void recalcLightLevelAt(World world, int x, int y, int z)
  {
    CraftWorld cworld = (CraftWorld)world;
    WorldServer worldServer = cworld.getHandle();
    worldServer.A(x, y, z);
  }
View Full Code Here

Examples of org.bukkit.craftbukkit.v1_6_R3.CraftWorld

  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

Examples of org.bukkit.craftbukkit.v1_6_R3.CraftWorld

  @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

Examples of org.bukkit.craftbukkit.v1_7_R4.CraftWorld

    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

Examples of org.bukkit.craftbukkit.v1_7_R4.CraftWorld

        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

Examples of org.bukkit.craftbukkit.v1_7_R4.CraftWorld

        }
        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

Examples of org.bukkit.craftbukkit.v1_7_R4.CraftWorld

    }

    @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
TOP
Copyright © 2018 www.massapi.com. 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.