Package org.bukkit.craftbukkit.v1_6_R3

Examples of org.bukkit.craftbukkit.v1_6_R3.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


    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

    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

    }
    return (SpoutCraftChunk) chunk;
  }

  public static boolean replaceBukkitChunk(org.bukkit.Chunk chunk) {
    CraftChunk handle = (CraftChunk) ((CraftChunk) chunk).getHandle().bukkitChunk;
    if (handle != null) {
      boolean replace = false;
      if (handle.getX() != chunk.getX()) {
        replace = true;
      }
      if (handle.getZ() != chunk.getZ()) {
        replace = true;
      }
      if (handle.getClass().hashCode() != SpoutCraftChunk.class.hashCode()) {
        replace = true;
      }
      org.bukkit.Chunk loopbackChunk = ((CraftChunk)chunk).getHandle().bukkitChunk;
      if (loopbackChunk != chunk) {
        replace = true;
View Full Code Here

    }
    return false;
  }

  public static void resetBukkitChunk(org.bukkit.Chunk chunk) {
    ((CraftChunk) chunk).getHandle().bukkitChunk = new CraftChunk(((CraftChunk) chunk).getHandle());
  }
View Full Code Here

    return true;
  }

  public static boolean resetPlayerConnection(Player player) {
    CraftPlayer cp = (CraftPlayer) player;
    CraftServer server = (CraftServer) Bukkit.getServer();

    if (cp.getHandle().playerConnection instanceof SpoutPlayerConnection) {
      PlayerConnection oldHandler = cp.getHandle().playerConnection;
      /*Set<ChunkCoordIntPair> chunkUpdateQueue = ((SpoutPlayerConnection) cp.getHandle().playerConnection).getChunkUpdateQueue();
      for (ChunkCoordIntPair c : chunkUpdateQueue) {
View Full Code Here

    return false;
  }

  public static boolean updatePlayerConnection(Player player) {
    CraftPlayer cp = (CraftPlayer) player;
    CraftServer server = (CraftServer) Bukkit.getServer();
    if (!(cp.getHandle().playerConnection instanceof SpoutPlayerConnection)) {
      PlayerConnection oldHandler = cp.getHandle().playerConnection;
      Location loc = player.getLocation();
      SpoutPlayerConnection handler = new SpoutPlayerConnection(MinecraftServer.getServer(), cp.getHandle().playerConnection.networkManager, cp.getHandle());
      /*for (Object o : cp.getHandle().playerChunkCoordIntPairs) {
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

    }
    return true;
  }

  public static boolean resetPlayerConnection(Player player) {
    CraftPlayer cp = (CraftPlayer) player;
    CraftServer server = (CraftServer) Bukkit.getServer();

    if (cp.getHandle().playerConnection instanceof SpoutPlayerConnection) {
      PlayerConnection oldHandler = cp.getHandle().playerConnection;
      /*Set<ChunkCoordIntPair> chunkUpdateQueue = ((SpoutPlayerConnection) cp.getHandle().playerConnection).getChunkUpdateQueue();
      for (ChunkCoordIntPair c : chunkUpdateQueue) {
      cp.getHandle().chunkCoordIntPairQueue.add(c);
      }
      ((SpoutPlayerConnection) cp.getHandle().playerConnection).flushUnloadQueue();*/
      cp.getHandle().playerConnection.a();
      Location loc = player.getLocation();
      PlayerConnection handler = new PlayerConnection(MinecraftServer.getServer(), cp.getHandle().playerConnection.networkManager, cp.getHandle());
      handler.a(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
      cp.getHandle().playerConnection = handler;
      INetworkManager nm = cp.getHandle().playerConnection.networkManager;
      setPlayerConnection(nm, cp.getHandle().playerConnection);
      oldHandler.disconnected = true;
      return true;
    }
    return false;
  }
View Full Code Here

TOP

Related Classes of org.bukkit.craftbukkit.v1_6_R3.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.