Пример #1
0
 public virtual void func_22094_a(WorldInfo worldinfo)
 {
     NBTTagCompound nbttagcompound = worldinfo.func_22185_a();
     var nbttagcompound1 = new NBTTagCompound();
     nbttagcompound1.setTag("Data", nbttagcompound);
     try
     {
         var file = new File(field_22099_b, "level.dat_new");
         var file1 = new File(field_22099_b, "level.dat_old");
         var file2 = new File(field_22099_b, "level.dat");
         CompressedStreamTools.writeGzippedCompoundToOutputStream(nbttagcompound1, new FileOutputStream(file));
         if (file1.exists())
         {
             file1.delete();
         }
         file2.renameTo(file1);
         if (file2.exists())
         {
             file2.delete();
         }
         file.renameTo(file2);
         if (file.exists())
         {
             file.delete();
         }
     }
     catch (Exception exception)
     {
         exception.printStackTrace();
     }
 }
Пример #2
0
 public WorldInfo(WorldInfo worldinfo)
 {
     randomSeed = worldinfo.randomSeed;
     spawnX = worldinfo.spawnX;
     spawnY = worldinfo.spawnY;
     spawnZ = worldinfo.spawnZ;
     worldTime = worldinfo.worldTime;
     lastPlayed = worldinfo.lastPlayed;
     sizeOnDisk = worldinfo.sizeOnDisk;
     field_22195_h = worldinfo.field_22195_h;
     field_22194_i = worldinfo.field_22194_i;
     levelName = worldinfo.levelName;
     version = worldinfo.version;
 }
Пример #3
0
 public override void func_22095_a(WorldInfo worldinfo, List list)
 {
     worldinfo.func_22191_a(19132);
     base.func_22095_a(worldinfo, list);
 }
Пример #4
0
 public override void func_22095_a(WorldInfo worldinfo, List list)
 {
     worldinfo.func_22191_a(19132);
     base.func_22095_a(worldinfo, list);
 }
Пример #5
0
        public World(ISaveHandler isavehandler, string s, long l, WorldProvider worldprovider)
        {
            scheduledUpdatesAreImmediate = false;
            field_821_y = new ArrayList();
            loadedEntityList = new ArrayList();
            unloadedEntityList = new ArrayList();
            scheduledTickTreeSet = new TreeSet();
            scheduledTickSet = new HashSet();
            loadedTileEntityList = new ArrayList();
            playerEntities = new ArrayList();
            field_6159_E = 0xffffffL;
            skylightSubtracted = 0;
            distHashCounter = (new Random()).nextInt();
            DIST_HASH_MAGIC = 0x3c6ef35f;
            editingBlocks = false;
            lockTimestamp = java.lang.System.currentTimeMillis();
            autosavePeriod = 40;
            rand = new Random();
            field_9212_p = false;
            worldAccesses = new ArrayList();
            field_9207_I = new ArrayList();
            field_4265_J = 0;
            spawnHostileMobs = true;
            spawnPeacefulMobs = true;
            activeChunkSet = new HashSet();
            ambientTickCountdown = rand.nextInt(12000);
            field_778_L = new ArrayList();
            singleplayerWorld = false;
            worldFile = isavehandler;
            worldInfo = isavehandler.func_22096_c();
            field_9212_p = worldInfo == null;
            if (worldprovider != null)
            {
                worldProvider = worldprovider;
            }
            else if (worldInfo != null && worldInfo.func_22178_h() == -1)
            {
                worldProvider = new WorldProviderHell();
            }
            else
            {
                worldProvider = new WorldProvider();
            }
            bool flag = false;
            if (worldInfo == null)
            {
                worldInfo = new WorldInfo(l, s);
                flag = true;
            }
            else
            {
                worldInfo.setLevelName(s);
            }
            worldProvider.registerWorld(this);
            chunkProvider = func_22086_b();
            if (flag)
            {
                field_9209_x = true;
                int i = 0;
                byte byte0 = 64;
                int j;
                for (j = 0; !worldProvider.canCoordinateBeSpawn(i, j); j += rand.nextInt(64) - rand.nextInt(64))
                {
                    i += rand.nextInt(64) - rand.nextInt(64);
                }

                worldInfo.setSpawnPosition(i, byte0, j);
                field_9209_x = false;
            }
            calculateInitialSkylight();
        }
Пример #6
0
        public override bool func_22102_a(string s)
        {
            WorldInfo worldinfo = func_22103_b(s);

            return(worldinfo != null && worldinfo.func_22188_i() == 0);
        }