示例#1
0
  protected void initialWorldChunkLoad() {
    boolean var1 = true;
    boolean var2 = true;
    boolean var3 = true;
    boolean var4 = true;
    int var5 = 0;
    this.setUserMessage("menu.generatingTerrain");
    byte var6 = 0;
    logger.info("Preparing start region for level " + var6);
    WorldServer var7 = this.worldServers[var6];
    BlockPos var8 = var7.getSpawnPoint();
    long var9 = getCurrentTimeMillis();

    for (int var11 = -192; var11 <= 192 && this.isServerRunning(); var11 += 16) {
      for (int var12 = -192; var12 <= 192 && this.isServerRunning(); var12 += 16) {
        long var13 = getCurrentTimeMillis();

        if (var13 - var9 > 1000L) {
          this.outputPercentRemaining("Preparing spawn area", var5 * 100 / 625);
          var9 = var13;
        }

        ++var5;
        var7.theChunkProviderServer.loadChunk(var8.getX() + var11 >> 4, var8.getZ() + var12 >> 4);
      }
    }

    this.clearCurrentTask();
  }
示例#2
0
 @Override
 public void onNeighborBlockChange(
     World world, BlockPos pos, IBlockState state, Block neighborBlock) {
   if (world.isAirBlock(pos.up())) {
     this.dropBlockAsItem(world, pos, state, 0);
     world.setBlockToAir(pos);
   }
 }