Examples of WorldProvider


Examples of net.minecraft.world.WorldProvider

                        {
                            GCLog.severe("Problem matching player name in space station check: " + this.selectedStationOwner);
                            return false;
                        }
                        int spacestationID = mapping;
                        WorldProvider spacestation = WorldUtil.getProviderForDimension(spacestationID);
                        if (spacestation != null)
                        {
                            dimension = spacestation.getDimensionName();
                        }
                        else
                        {
                            GCLog.severe("Failed to find a spacestation with dimension " + spacestationID);
                            return false;
View Full Code Here

Examples of net.minecraft.world.WorldProvider

                n = "DIM" + w.provider.dimensionId;
            }
        }
        else // Legacy mapping
            n = w.getWorldInfo().getWorldName();
            WorldProvider wp = w.provider;
            switch(wp.dimensionId) {
                case 0:
                    break;
                case -1:
                    n += "_nether";
View Full Code Here

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

Examples of net.minecraft.world.WorldProvider

    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

Examples of net.minecraft.world.WorldProvider

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

Examples of net.minecraft.world.WorldProvider

    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

Examples of net.minecraft.world.WorldProvider

    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

Examples of net.minecraft.world.WorldProvider

  }

  @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

Examples of org.terasology.world.WorldProvider

        return "Spawned block.";
    }

    @Command(shortDescription = "Sets the current world time in days")
    public String setWorldTime(@CommandParam("day") float day) {
        WorldProvider world = CoreRegistry.get(WorldProvider.class);
        world.getTime().setDays(day);

        return "World time changed";
    }
View Full Code Here

Examples of org.terasology.world.WorldProvider

    public void applyParameters(Material program) {

        program.setFloat("viewingDistance", CoreRegistry.get(Config.class).getRendering().getViewDistance().getChunkDistance().x * 8.0f);

        WorldRenderer worldRenderer = CoreRegistry.get(WorldRenderer.class);
        WorldProvider worldProvider = CoreRegistry.get(WorldProvider.class);

        if (worldRenderer != null) {
            program.setFloat("daylight", worldRenderer.getDaylight(), true);
            program.setFloat("swimming", worldRenderer.isHeadUnderWater() ? 1.0f : 0.0f, true);
            program.setFloat("tick", worldRenderer.getTick(), true);
            program.setFloat("sunlightValueAtPlayerPos", worldRenderer.getSmoothedPlayerSunlightValue(), true);

            if (worldRenderer.getActiveCamera() != null) {
                final Vector3f cameraDir = worldRenderer.getActiveCamera().getViewingDirection();
                final Vector3f cameraPosition = worldRenderer.getActiveCamera().getPosition();

                program.setFloat3("cameraPosition", cameraPosition.x, cameraPosition.y, cameraPosition.z, true);
                program.setFloat3("cameraDirection", cameraDir.x, cameraDir.y, cameraDir.z, true);
                program.setFloat3("cameraParameters", worldRenderer.getActiveCamera().getzNear(), worldRenderer.getActiveCamera().getzFar(), 0.0f, true);
            }

            Vector3f sunDirection = worldRenderer.getSkysphere().getSunDirection(false);
            program.setFloat3("sunVec", sunDirection.x, sunDirection.y, sunDirection.z, true);
        }

        if (worldProvider != null) {
            program.setFloat("time", worldProvider.getTime().getDays());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.