Package org.bukkit.craftbukkit.v1_6_R3

Examples of org.bukkit.craftbukkit.v1_6_R3.CraftServer


public class BukkitCommandUtil
{
  public static SimpleCommandMap getBukkitCommandMap()
  {
    CraftServer craftServer = (CraftServer)Bukkit.getServer();
    return craftServer.getCommandMap();
  }
View Full Code Here


  }
 
  public static RemoteConsoleCommandSender getRcon()
  {
    Server server = Bukkit.getServer();
    CraftServer craftServer = (CraftServer)server;
    MinecraftServer minecraftServer = craftServer.getServer();
    return minecraftServer.remoteConsole;
  }
View Full Code Here

  // -------------------------------------------- //
  // A way of getting the player directory even when the server just started
 
  public static File getPlayerDirectory()
  {
    CraftServer cserver = (CraftServer)Bukkit.getServer();
    DedicatedServer dserver = (DedicatedServer)cserver.getServer();
    String levelName = dserver.propertyManager.getString("level-name", "world");
    return new File(Bukkit.getWorldContainer(), new File(levelName, "players").getPath());
  }
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.CraftServer

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.