Ejemplo n.º 1
0
 public override void writeEntityToNBT(NBTTagCompound nbttagcompound)
 {
     nbttagcompound.setByte("Dir", (byte)direction);
     nbttagcompound.setString("Motive", art.title);
     nbttagcompound.setInteger("TileX", xPosition);
     nbttagcompound.setInteger("TileY", yPosition);
     nbttagcompound.setInteger("TileZ", zPosition);
 }
Ejemplo n.º 2
0
 private void func_22176_a(NBTTagCompound nbttagcompound, NBTTagCompound nbttagcompound1)
 {
     nbttagcompound.setLong("RandomSeed", randomSeed);
     nbttagcompound.setInteger("SpawnX", spawnX);
     nbttagcompound.setInteger("SpawnY", spawnY);
     nbttagcompound.setInteger("SpawnZ", spawnZ);
     nbttagcompound.setLong("Time", worldTime);
     nbttagcompound.setLong("SizeOnDisk", sizeOnDisk);
     nbttagcompound.setLong("LastPlayed", java.lang.System.currentTimeMillis());
     nbttagcompound.setString("LevelName", levelName);
     nbttagcompound.setInteger("version", version);
     if (nbttagcompound1 != null)
     {
         nbttagcompound.setCompoundTag("Player", nbttagcompound1);
     }
 }
Ejemplo n.º 3
0
        public override void writeEntityToNBT(NBTTagCompound nbttagcompound)
        {
            nbttagcompound.setInteger("Type", minecartType);
            if (minecartType == 2)
            {
                nbttagcompound.setDouble("PushX", pushX);
                nbttagcompound.setDouble("PushZ", pushZ);
                nbttagcompound.setShort("Fuel", (short)fuel);
            }
            else if (minecartType == 1)
            {
                var nbttaglist = new NBTTagList();
                for (int i = 0; i < cargoItems.Length; i++)
                {
                    if (cargoItems[i] != null)
                    {
                        var nbttagcompound1 = new NBTTagCompound();
                        nbttagcompound1.setByte("Slot", (byte)i);
                        cargoItems[i].writeToNBT(nbttagcompound1);
                        nbttaglist.setTag(nbttagcompound1);
                    }
                }

                nbttagcompound.setTag("Items", nbttaglist);
            }
        }
Ejemplo n.º 4
0
 public override void writeEntityToNBT(NBTTagCompound nbttagcompound)
 {
     base.writeEntityToNBT(nbttagcompound);
     nbttagcompound.setTag("Inventory", inventory.writeToNBT(new NBTTagList()));
     nbttagcompound.setInteger("Dimension", dimension);
     nbttagcompound.setBoolean("Sleeping", sleeping);
     nbttagcompound.setShort("SleepTimer", (short)sleepTimer);
 }
Ejemplo n.º 5
0
        public virtual void writeToNBT(NBTTagCompound nbttagcompound)
        {
            var s = (string)classToNameMap.get((Class)GetType());

            if (s == null)
            {
                throw new RuntimeException(
                          (new StringBuilder()).append(GetType()).append(" is missing a mapping! This is a bug!").toString());
            }
            else
            {
                nbttagcompound.setString("id", s);
                nbttagcompound.setInteger("x", xCoord);
                nbttagcompound.setInteger("y", yCoord);
                nbttagcompound.setInteger("z", zCoord);
                return;
            }
        }
Ejemplo n.º 6
0
 public override void writeEntityToNBT(NBTTagCompound nbttagcompound)
 {
     base.writeEntityToNBT(nbttagcompound);
     nbttagcompound.setTag("Inventory", inventory.writeToNBT(new NBTTagList()));
     nbttagcompound.setInteger("Dimension", dimension);
     nbttagcompound.setBoolean("Sleeping", sleeping);
     nbttagcompound.setShort("SleepTimer", (short) sleepTimer);
 }
Ejemplo n.º 7
0
 private void func_22176_a(NBTTagCompound nbttagcompound, NBTTagCompound nbttagcompound1)
 {
     nbttagcompound.setLong("RandomSeed", randomSeed);
     nbttagcompound.setInteger("SpawnX", spawnX);
     nbttagcompound.setInteger("SpawnY", spawnY);
     nbttagcompound.setInteger("SpawnZ", spawnZ);
     nbttagcompound.setLong("Time", worldTime);
     nbttagcompound.setLong("SizeOnDisk", sizeOnDisk);
     nbttagcompound.setLong("LastPlayed", java.lang.System.currentTimeMillis());
     nbttagcompound.setString("LevelName", levelName);
     nbttagcompound.setInteger("version", version);
     if (nbttagcompound1 != null)
     {
         nbttagcompound.setCompoundTag("Player", nbttagcompound1);
     }
 }
Ejemplo n.º 8
0
        public override void writeEntityToNBT(NBTTagCompound nbttagcompound)
        {
            nbttagcompound.setInteger("Type", minecartType);
            if (minecartType == 2)
            {
                nbttagcompound.setDouble("PushX", pushX);
                nbttagcompound.setDouble("PushZ", pushZ);
                nbttagcompound.setShort("Fuel", (short) fuel);
            }
            else if (minecartType == 1)
            {
                var nbttaglist = new NBTTagList();
                for (int i = 0; i < cargoItems.Length; i++)
                {
                    if (cargoItems[i] != null)
                    {
                        var nbttagcompound1 = new NBTTagCompound();
                        nbttagcompound1.setByte("Slot", (byte) i);
                        cargoItems[i].writeToNBT(nbttagcompound1);
                        nbttaglist.setTag(nbttagcompound1);
                    }
                }

                nbttagcompound.setTag("Items", nbttaglist);
            }
        }
Ejemplo n.º 9
0
 public override void writeEntityToNBT(NBTTagCompound nbttagcompound)
 {
     nbttagcompound.setByte("Dir", (byte) direction);
     nbttagcompound.setString("Motive", art.title);
     nbttagcompound.setInteger("TileX", xPosition);
     nbttagcompound.setInteger("TileY", yPosition);
     nbttagcompound.setInteger("TileZ", zPosition);
 }
Ejemplo n.º 10
0
 public virtual void writeToNBT(NBTTagCompound nbttagcompound)
 {
     var s = (string) classToNameMap.get((Class) GetType());
     if (s == null)
     {
         throw new RuntimeException(
             (new StringBuilder()).append(GetType()).append(" is missing a mapping! This is a bug!").toString());
     }
     else
     {
         nbttagcompound.setString("id", s);
         nbttagcompound.setInteger("x", xCoord);
         nbttagcompound.setInteger("y", yCoord);
         nbttagcompound.setInteger("z", zCoord);
         return;
     }
 }
Ejemplo n.º 11
0
        public static void storeChunkInCompound(Chunk chunk, World world, NBTTagCompound nbttagcompound)
        {
            world.checkSessionLock();
            nbttagcompound.setInteger("xPos", chunk.xPosition);
            nbttagcompound.setInteger("zPos", chunk.zPosition);
            nbttagcompound.setLong("LastUpdate", world.getWorldTime());
            nbttagcompound.setByteArray("Blocks", chunk.blocks);
            nbttagcompound.setByteArray("Data", chunk.data.data);
            nbttagcompound.setByteArray("SkyLight", chunk.skylightMap.data);
            nbttagcompound.setByteArray("BlockLight", chunk.blocklightMap.data);
            nbttagcompound.setByteArray("HeightMap", chunk.heightMap);
            nbttagcompound.setBoolean("TerrainPopulated", chunk.isTerrainPopulated);
            chunk.hasEntities = false;
            var nbttaglist = new NBTTagList();

            for (int i = 0; i < chunk.entities.Length; i++)
            {
                Iterator iterator = chunk.entities[i].iterator();
                do
                {
                    if (!iterator.hasNext())
                    {
                        goto label0;
                    }
                    var entity = (Entity) iterator.next();
                    chunk.hasEntities = true;
                    var nbttagcompound1 = new NBTTagCompound();
                    if (entity.addEntityID(nbttagcompound1))
                    {
                        nbttaglist.setTag(nbttagcompound1);
                    }
                } while (true);
            }
            label0:

            nbttagcompound.setTag("Entities", nbttaglist);
            var nbttaglist1 = new NBTTagList();
            NBTTagCompound nbttagcompound2;
            for (Iterator iterator1 = chunk.chunkTileEntityMap.values().iterator();
                 iterator1.hasNext();
                 nbttaglist1.setTag(nbttagcompound2))
            {
                var tileentity = (TileEntity) iterator1.next();
                nbttagcompound2 = new NBTTagCompound();
                tileentity.writeToNBT(nbttagcompound2);
            }

            nbttagcompound.setTag("TileEntities", nbttaglist1);
        }