Package net.minecraft.world

Examples of net.minecraft.world.WorldProvider


    {
        try
        {
            if (dimensions.containsKey(dim))
            {
                WorldProvider provider = providers.get(getProviderType(dim)).newInstance();
                provider.setDimension(dim);
                return provider;
            }
            else
            {
                throw new RuntimeException(String.format("No WorldProvider bound for dimension %d", dim)); //It's going to crash anyway at this point.  Might as well be informative
View Full Code Here


    final Random rand = randoms.get();
    final Iterator<ChunkCoordIntPair> chunkCoordIterator = this.chunkCoordIterator;
    final ChunkProviderServer chunkProviderServer = this.theChunkProviderServer;
    final boolean isRaining = this.isRaining();
    final boolean isThundering = this.isThundering();
    final WorldProvider provider = this.provider;
    int updateLCG = this.updateLCG;
    // We use a random per thread - randoms are threadsafe, however it can result in some contention. See Random.nextInt - compareAndSet.
    // This reduces contention -> slightly increased performance, woo! :P
    while (true) {
      ChunkCoordIntPair chunkCoordIntPair;
      synchronized (chunkCoordIterator) {
        if (!chunkCoordIterator.hasNext()) {
          break;
        }
        try {
          chunkCoordIntPair = chunkCoordIterator.next();
        } catch (ConcurrentModificationException e) {
          break;
        }
      }

      if (tpsFactor < 1 && rand.nextFloat() > tpsFactor) {
        continue;
      }

      int cX = chunkCoordIntPair.chunkXPos;
      int cZ = chunkCoordIntPair.chunkZPos;

      Chunk chunk = chunkProviderServer.getChunkFastUnsafe(cX, cZ);
      if (chunk == null || !chunk.isTerrainPopulated || chunk.partiallyUnloaded || chunk.queuedUnload) {
        continue;
      }

      int xPos = cX * 16;
      int zPos = cZ * 16;
      this.moodSoundAndLightCheck(xPos, zPos, chunk);
      chunk.updateSkylight();
      int var8;
      int var9;
      int var10;
      int var11;

      if (isRaining && isThundering && provider.canDoLightning(chunk) && rand.nextInt(100000) == 0) {
        updateLCG = updateLCG * 1664525 + 1013904223;
        var8 = updateLCG >> 2;
        var9 = xPos + (var8 & 15);
        var10 = zPos + (var8 >> 8 & 15);
        var11 = this.getPrecipitationHeight(var9, var10);

        if (this.canLightningStrikeAt(var9, var11, var10)) {
          this.addWeatherEffect(new EntityLightningBolt(this, (double) var9, (double) var11, (double) var10));
        }
      }

      int blockID;

      if (provider.canDoRainSnowIce(chunk) && rand.nextInt(16) == 0) {
        updateLCG = updateLCG * 1664525 + 1013904223;
        var8 = updateLCG >> 2;
        var9 = var8 & 15;
        var10 = var8 >> 8 & 15;
        var11 = this.getPrecipitationHeight(var9 + xPos, var10 + zPos);
View Full Code Here

public class ListSet extends SynchronizedList {
  @Override
  public synchronized boolean add(final Object o) {
    if (o instanceof World) {
      World world = (World) o;
      WorldProvider provider = world.provider;
      if (provider == null) {
        Log.severe("Tried to add world " + world + " with null provider to bukkit dimensions.", new Throwable());
        return false;
      }
      Iterator<World> iterator = this.iterator();
View Full Code Here

    tf.finishTable();
    return tf;
  }

  private static int getDimension(TileEntity o) {
    WorldProvider worldProvider = o.worldObj.provider;
    return worldProvider == null ? -999 : worldProvider.dimensionId;
  }
View Full Code Here

    WorldProvider worldProvider = o.worldObj.provider;
    return worldProvider == null ? -999 : worldProvider.dimensionId;
  }

  private static int getDimension(Entity o) {
    WorldProvider worldProvider = o.worldObj.provider;
    return worldProvider == null ? -999 : worldProvider.dimensionId;
  }
View Full Code Here

  }

  @Override
  @Declare
  public void setDimension(int dimensionId) {
    WorldProvider provider = this.provider;
    this.dimensionId = dimensionId;
    if (provider.dimensionId != dimensionId) {
      try {
        DimensionManager.registerDimension(dimensionId, provider.dimensionId);
      } catch (Throwable t) {
View Full Code Here

TOP

Related Classes of net.minecraft.world.WorldProvider

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.