Package net.minecraft.server.management

Examples of net.minecraft.server.management.PlayerManager


    public void sendToChunk(World world, int chunkX, int chunkZ) {
        sendToChunk(toPacket(), world, chunkX, chunkZ);
    }

    public static void sendToChunk(Packet packet, World world, int chunkX, int chunkZ) {
        PlayerManager playerManager = ((WorldServer)world).getPlayerManager();
        for (EntityPlayerMP player : (List<EntityPlayerMP>) MinecraftServer.getServer().getConfigurationManager().playerEntityList)
            if(playerManager.isPlayerWatchingChunk(player, chunkX, chunkZ))
                sendToPlayer(packet, player);

        /* Commented until forge accepts access tranformer request
        PlayerInstance p = ((WorldServer) world).getPlayerManager().getOrCreateChunkWatcher(chunkX, chunkZ, false);
        if (p != null)
View Full Code Here


    if (world instanceof WorldServer) {
      TObjectHashIterator<Chunk> c = set.iterator();
      for (int k = 0, e = set.size(); k < e; ++k) {
        Chunk chunk = c.next();
        PlayerManager manager = ((WorldServer) world).getPlayerManager();
        if (manager == null) {
          return;
        }
        PlayerInstance watcher = manager.getOrCreateChunkWatcher(chunk.xPosition, chunk.zPosition, false);
        if (watcher != null) {
          watcher.sendToAllPlayersWatchingChunk(new S21PacketChunkData(chunk, false, -1));
        }
      }
    }
View Full Code Here

  public static void sendChunk(Chunk c, int verticalBits)
  {
    try
    {
      WorldServer ws = (WorldServer) c.worldObj;
      PlayerManager pm = ws.getPlayerManager();

      if ( getOrCreateChunkWatcher == null )
      {
        getOrCreateChunkWatcher = ReflectionHelper.findMethod( PlayerManager.class, pm, new String[] { "getOrCreateChunkWatcher", "func_72690_a" },
            int.class, int.class, boolean.class );
View Full Code Here

    int ticks = world.tickCount;
    // Handle unload requests
    final ConcurrentQueueSet<Long> unloadStage0 = this.unloadStage0;
    if (!unloadStage0.isEmpty()) {
      ImmutableSetMultimap<ChunkCoordIntPair, ForgeChunkManager.Ticket> persistentChunks = world.getPersistentChunks();
      PlayerManager playerManager = world.getPlayerManager();
      ChunkCoordIntPair chunkCoordIntPair = new ChunkCoordIntPair(0, 0);
      Long key_;
      int done = 0;
      while (++done != 75 && (key_ = unloadStage0.take()) != null) {
        long key = key_;
        int x = (int) key;
        int z = (int) (key >> 32);
        chunkCoordIntPair.chunkXPos = x;
        chunkCoordIntPair.chunkZPos = z;
        Chunk chunk = (Chunk) chunks.getValueByKey(key);
        if (chunk == null) {
          continue;
        }
        synchronized (chunk) {
          if (chunk.partiallyUnloaded || !chunk.queuedUnload || unloadingChunks.containsItem(key)) {
            continue;
          }
          if (persistentChunks.containsKey(chunkCoordIntPair) || playerManager.getOrCreateChunkWatcher(x, z, false) != null || !fireBukkitUnloadEvent(chunk)) {
            chunk.queuedUnload = false;
            continue;
          }
          if (lastChunk == chunk) {
            lastChunk = null;
View Full Code Here

TOP

Related Classes of net.minecraft.server.management.PlayerManager

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.