Package net.minecraft.world

Examples of net.minecraft.world.ChunkCoordIntPair


 
  public void addBaseFirstTime(ITeamBase base)
  {
    addBase(base);
    //Add the chunk this base is in to our chunk loading ticket
    ForgeChunkManager.forceChunk(chunkLoadingTicket, new ChunkCoordIntPair((int)base.getPosX() >> 4, (int)base.getPosZ() >> 4));
    FlansMod.log("Added chunk at " + ((int)base.getPosX() >> 4) + ",  " + ((int)base.getPosZ() >> 4) + " to chunk loading ticket for base " + name );
  }
View Full Code Here


      FlansMod.log("Base array for map " + name + " null");
      return;
    }
    bases.remove(base);
    //Remove the chunk from the chunk loading ticket
    ForgeChunkManager.unforceChunk(chunkLoadingTicket, new ChunkCoordIntPair((int)base.getPosX() >> 4, (int)base.getPosZ() >> 4));
    FlansMod.log("Removed chunk at " + ((int)base.getPosX() >> 4) + ",  " + ((int)base.getPosZ() >> 4) + " from chunk loading ticket for base " + name );
  }
View Full Code Here

 
  public void addObjectFirstTime(ITeamObject object)
  {
    //Add the chunk this object is in to our chunk loading ticket
    if(object.forceChunkLoading())
      ForgeChunkManager.forceChunk(chunkLoadingTicket, new ChunkCoordIntPair((int)object.getPosX() >> 4, (int)object.getPosZ() >> 4));
  }
View Full Code Here

                return false;
            }
            else
            {
                OutputHandler.debug("Force loaded " + world.provider.dimensionId);
                ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(0, 0));
                ticket.getModData().setInteger("count", 1);
                map.put(world.provider.dimensionId, ticket);
                return true;
            }
        }
View Full Code Here

            Ticket ticket = map.get(world.provider.dimensionId);
            ticket.getModData().setInteger("count", ticket.getModData().getInteger("count") - 1);
            if (ticket.getModData().getInteger("count") == 0)
            {
                OutputHandler.debug(world.provider.dimensionId + " was removed fron the force loaded list.");
                ForgeChunkManager.unforceChunk(ticket, new ChunkCoordIntPair(0, 0));
                ForgeChunkManager.releaseTicket(ticket);
                map.remove(world.provider.dimensionId);
                return true;
            }
            else
View Full Code Here

        ImmutableSetMultimap<ChunkCoordIntPair, Ticket> newMap = ImmutableSetMultimap.<ChunkCoordIntPair,Ticket>builder().putAll(forcedChunks.get(ticket.world)).put(chunk, ticket).build();
        forcedChunks.put(ticket.world, newMap);
        if (ticket.maxDepth > 0 && ticket.requestedChunks.size() > ticket.maxDepth)
        {
            ChunkCoordIntPair removed = ticket.requestedChunks.iterator().next();
            unforceChunk(ticket,removed);
        }
    }
View Full Code Here

    if(!MainProxy.isServer()) {
      System.err.println("sendPacketToAllWatchingChunk called clientside !");
      new Exception().printStackTrace();
      return;
    }
    ChunkCoordIntPair chunk = new ChunkCoordIntPair(X >> 4, Z >> 4);
    PlayerCollectionList players = LogisticsEventListener.watcherList.get(chunk);
    if(players != null) {
      for(EntityPlayer player:players.players()) {
        if(MainProxy.getDimensionForWorld(player.worldObj) == dimensionId) {
          sendPacketToPlayer(packet, player);
View Full Code Here

      }
      return;
    }

    AELog.info( "New Ticket " + ct.toString() );
    ForgeChunkManager.forceChunk( ct, new ChunkCoordIntPair( xCoord >> 4, zCoord >> 4 ) );
  }
View Full Code Here

        int zStart = Math.min(zChunkA, zChunkB);
        int zEnd = Math.max(zChunkA, zChunkB);

        for (int xx = xStart; xx <= xEnd; xx++) {
            for (int zz = zStart; zz <= zEnd; zz++) {
                chunkList.add(new ChunkCoordIntPair(xx, zz));
                if (chunkList.size() >= max) {
                    return chunkList;
                }
            }
        }
View Full Code Here

     */
    public Set<ChunkCoordIntPair> getChunksAround(int xChunk, int zChunk, int radius) {
        Set<ChunkCoordIntPair> chunkList = new HashSet<ChunkCoordIntPair>();
        for (int xx = xChunk - radius; xx <= xChunk + radius; xx++) {
            for (int zz = zChunk - radius; zz <= zChunk + radius; zz++) {
                chunkList.add(new ChunkCoordIntPair(xx, zz));
            }
        }
        return chunkList;
    }
View Full Code Here

TOP

Related Classes of net.minecraft.world.ChunkCoordIntPair

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.