Package net.minecraft.world.storage

Examples of net.minecraft.world.storage.WorldInfo


  @Override
  protected void doProcess()
  {
    World w = Minecraft.getMinecraft().theWorld;
    EntityPlayerSP player = Minecraft.getMinecraft().thePlayer;
    WorldInfo info = w.getWorldInfo();
   
    setValue("time_modulo24k", (int) (info.getWorldTime() % 24000L));
    setValue("rain", info.isRaining());
    //setValue("thunder", info.isThundering());
    setValue("thunder", w.getWeightedThunderStrength(0f) > 0.9f);
    setValue("dimension", player.dimension);
    setValue("light_subtracted", w.skylightSubtracted);
    setValue("remote", w.isRemote);
View Full Code Here


            /*
           * Weather part
           */
            if (wt.weatherSpecified)
            {
                WorldInfo winfo = e.world.getWorldInfo();
                if (!wt.rain)
                {
                    winfo.setRainTime(20 * 300);
                    winfo.setRaining(false);
                    winfo.setThunderTime(20 * 300);
                    winfo.setThundering(false);
                }
                else if (!wt.storm)
                {
                    winfo.setThunderTime(20 * 300);
                    winfo.setThundering(false);
                }
            }

          /*
           * Time part
View Full Code Here

  @Override
  public boolean tickUpdates(boolean runAll) {
    final ArrayList<NextTickListEntry> runningTickListEntries;
    final TreeSet pendingTickListEntries = this.pendingTickListEntries;
    final Random rand = this.rand;
    final WorldInfo worldInfo = this.worldInfo;
    synchronized (pendingTickListEntries) {
      int max = pendingTickListEntries.size();

      if (max == 0) {
        return false;
      }

      runningTickListEntries = new ArrayList<NextTickListEntry>(Math.min(lastTickEntries, max));

      final long worldTime = worldInfo.getWorldTotalTime();

      for (int i = 0; i < max; ++i) {
        NextTickListEntry nextTickListEntry = (NextTickListEntry) pendingTickListEntries.first();

        if (!runAll && nextTickListEntry.scheduledTime > worldTime) {
View Full Code Here

  }

  @Override
  public void tick() {
    final Profiler profiler = this.theProfiler;
    final WorldInfo worldInfo = this.worldInfo;
    final int tickCount = ++this.tickCount;
    final boolean hasPlayers = !playerEntities.isEmpty();
    this.updateWeather();
    if (!forcedChunksInited) {
      ForgeChunkManager.loadForcedChunks(this);
    }
    updateEntityTick = 0;
    if (this.difficultySetting < 3 && this.getWorldInfo().isHardcoreModeEnabled()) {
      this.difficultySetting = 3;
    }

    if (tickCount % 120 == 0) {
      redstoneBurnoutMap.clear();
    }

    if (tickCount % 200 == 0) {
      this.provider.worldChunkMgr.cleanupCache();
    }

    if (hasPlayers && this.areAllPlayersAsleep()) {
      long var2 = worldInfo.getWorldTime();
      worldInfo.setWorldTime(var2 + 24000L - (var2 % 24000L));
      this.wakeAllPlayers();
    }

    profiler.startSection("mobSpawner");

    if (hasPlayers && (loadedEntityList.size() / TickThreading.instance.maxEntitiesPerPlayer) < playerEntities.size() && this.getGameRules().getGameRuleBooleanValue("doMobSpawning")) {
      if (TickThreading.instance.shouldFastSpawn(this)) {
        SpawnerAnimals.spawnMobsQuickly(this, spawnHostileMobs && (ticksPerMonsterSpawns != 0 && tickCount % ticksPerMonsterSpawns == 0L), spawnPeacefulMobs && (ticksPerAnimalSpawns != 0 && tickCount % ticksPerAnimalSpawns == 0L), worldInfo.getWorldTotalTime() % 400L == 0L);
      } else {
        animalSpawner.findChunksForSpawning(this, spawnHostileMobs && (ticksPerMonsterSpawns != 0 && tickCount % ticksPerMonsterSpawns == 0L), spawnPeacefulMobs && (ticksPerAnimalSpawns != 0 && tickCount % ticksPerAnimalSpawns == 0L), worldInfo.getWorldTotalTime() % 400L == 0L);
      }
    }

    profiler.endStartSection("chunkSource");
    theChunkProviderServer.unloadQueuedChunks();
    theChunkProviderServer.tick();
    this.skylightSubtracted = this.calculateSkylightSubtracted(1.0F);

    this.sendAndApplyBlockEvents();
    worldInfo.incrementTotalWorldTime(worldInfo.getWorldTotalTime() + 1L);
    worldInfo.setWorldTime(worldInfo.getWorldTime() + 1L);
    profiler.endStartSection("tickPending");
    this.tickUpdates(false);
    profiler.endStartSection("tickTiles");
    this.tickBlocksAndAmbiance();
    profiler.endStartSection("chunkMap");
View Full Code Here

TOP

Related Classes of net.minecraft.world.storage.WorldInfo

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.