Example #1
0
 /// <exception cref="System.IO.IOException"/>
 public override void WritePacketData(java.io.DataOutputStream dataoutputstream)
 {
     dataoutputstream.WriteInt(xLocation);
     dataoutputstream.WriteShort(yLocation);
     dataoutputstream.WriteInt(zLocation);
     dataoutputstream.Write(instrumentType);
     dataoutputstream.Write(pitch);
 }
 /// <exception cref="System.IO.IOException"/>
 public override void WritePacketData(java.io.DataOutputStream dataoutputstream)
 {
     dataoutputstream.Write(status);
     dataoutputstream.WriteInt(xPosition);
     dataoutputstream.Write(yPosition);
     dataoutputstream.WriteInt(zPosition);
     dataoutputstream.Write(face);
 }
Example #3
0
 /// <exception cref="System.IO.IOException"/>
 public override void WritePacketData(java.io.DataOutputStream dataoutputstream)
 {
     dataoutputstream.WriteInt(xPosition);
     dataoutputstream.Write(yPosition);
     dataoutputstream.WriteInt(zPosition);
     dataoutputstream.Write(type);
     dataoutputstream.Write(metadata);
 }
Example #4
0
 /// <exception cref="System.IO.IOException"/>
 public override void WritePacketData(java.io.DataOutputStream dataoutputstream)
 {
     dataoutputstream.WriteInt(entityId);
     dataoutputstream.WriteInt(xPosition);
     dataoutputstream.WriteInt(yPosition);
     dataoutputstream.WriteInt(zPosition);
     dataoutputstream.Write(yaw);
     dataoutputstream.Write(pitch);
 }
Example #5
0
        //public override void ReadPacketData(java.io.DataInputStream datainputstream)
        //{
        //    xPosition = datainputstream.ReadInt();
        //    yPosition = datainputstream.ReadShort();
        //    zPosition = datainputstream.ReadInt();
        //    xSize = datainputstream.Read() + 1;
        //    ySize = datainputstream.Read() + 1;
        //    zSize = datainputstream.Read() + 1;
        //    chunkSize = datainputstream.ReadInt();
        //    byte[] abyte0 = new byte[chunkSize];
        //    datainputstream.ReadFully(abyte0);

        //    using (MemoryStream ms = new MemoryStream(abyte0))
        //    using (MemoryStream output = new MemoryStream())
        //    using (InflaterInputStream ds = new InflaterInputStream(ms))
        //    {
        //        ds.CopyTo(output);
        //        ds.Flush();
        //        chunk = output.ToArray();
        //    }
        //    //chunk = new byte[(xSize * ySize * zSize * 5) / 2];
        //    //java.util.zip.Inflater inflater = new java.util.zip.Inflater();
        //    //inflater.SetInput(abyte0);
        //    //try
        //    //{
        //    //	inflater.Inflate(chunk);
        //    //}
        //    //catch (java.util.zip.DataFormatException)
        //    //{
        //    //	throw new System.IO.IOException("Bad compressed data format");
        //    //}
        //    //finally
        //    //{
        //    //	inflater.End();
        //    //}
        //}

        /// <exception cref="System.IO.IOException"/>
        public override void WritePacketData(java.io.DataOutputStream dataoutputstream)
        {
            dataoutputstream.WriteInt(xPosition);
            dataoutputstream.WriteShort(yPosition);
            dataoutputstream.WriteInt(zPosition);
            dataoutputstream.Write(xSize - 1);
            dataoutputstream.Write(ySize - 1);
            dataoutputstream.Write(zSize - 1);
            dataoutputstream.WriteInt(chunkSize);
            dataoutputstream.Write(chunk.Span);//, 0, chunkSize);
        }
 /// <exception cref="System.IO.IOException"/>
 public override void WritePacketData(java.io.DataOutputStream dataoutputstream)
 {
     dataoutputstream.WriteInt(xPosition);
     dataoutputstream.WriteInt(zPosition);
     dataoutputstream.WriteShort((short)size);
     for (int i = 0; i < size; i++)
     {
         dataoutputstream.WriteShort(coordinateArray[i]);
     }
     dataoutputstream.Write(typeArray);
     dataoutputstream.Write(metadataArray);
 }
Example #7
0
 /// <exception cref="System.IO.IOException"/>
 public override void WritePacketData(java.io.DataOutputStream dataoutputstream)
 {
     dataoutputstream.WriteShort(field_28052_a);
     dataoutputstream.WriteShort(field_28051_b);
     dataoutputstream.WriteByte(field_28053_c.Length);
     dataoutputstream.Write(field_28053_c);
 }
Example #8
0
 /// <exception cref="System.IO.IOException"/>
 public override void WritePacketData(java.io.DataOutputStream dataoutputstream)
 {
     dataoutputstream.WriteInt(xPosition);
     dataoutputstream.Write(yPosition);
     dataoutputstream.WriteInt(zPosition);
     dataoutputstream.Write(direction);
     if (itemStack == null)
     {
         dataoutputstream.WriteShort(-1);
     }
     else
     {
         dataoutputstream.WriteShort(itemStack.itemID);
         dataoutputstream.WriteByte(itemStack.stackSize);
         dataoutputstream.WriteShort(itemStack.GetItemDamage());
     }
 }
Example #9
0
        private void Func_22107_a(string file, List <ChunkFile> arraylist, int i, int j, net.minecraft.src.IProgressUpdate iprogressupdate)
        {
            arraylist.Sort();
            byte[] abyte0 = new byte[4096];
            int    i1;

            for (System.Collections.IEnumerator iterator = arraylist.GetEnumerator(); iterator
                 .MoveNext(); iprogressupdate.SetLoadingProgress(i1))
            {
                net.minecraft.src.ChunkFile chunkfile = (net.minecraft.src.ChunkFile)iterator.Current;
                int k = chunkfile.Func_22205_b();
                int l = chunkfile.Func_22204_c();
                net.minecraft.src.RegionFile regionfile = net.minecraft.src.RegionFileCache.Func_22123_a
                                                              (file, k, l);
                if (!regionfile.IsChunkSaved(k & 0x1f, l & 0x1f))
                {
                    try
                    {
                        using (FileStream fs = File.OpenRead(chunkfile.Func_22207_a()))
                            using (GZipStream ds = new GZipStream(fs, CompressionMode.Decompress))
                            {
                                java.io.DataInputStream datainputstream = new java.io.DataInputStream(ds);
                                //java.io.DataInputStream datainputstream = new java.io.DataInputStream(new java.util.zip.GZIPInputStream(new java.io.FileInputStream(chunkfile.Func_22207_a())));
                                java.io.DataOutputStream dataoutputstream = regionfile.GetChunkDataOutputStream(k & 0x1f, l & 0x1f);
                                for (int j1 = 0; (j1 = datainputstream.Read(abyte0)) != -1;)
                                {
                                    dataoutputstream.Write(abyte0, 0, j1);
                                }
                                dataoutputstream.Close();
                                datainputstream.Close();
                            }
                    }
                    catch (System.IO.IOException ioexception)
                    {
                        Sharpen.Runtime.PrintStackTrace(ioexception);
                    }
                }
                i++;
                i1 = (int)System.Math.Round((100D * (double)i) / (double)j);
            }
            net.minecraft.src.RegionFileCache.Func_22122_a();
        }
Example #10
0
 /// <exception cref="System.IO.IOException"/>
 public override void WritePacketData(java.io.DataOutputStream dataoutputstream)
 {
     dataoutputstream.Write(onGround ? 1 : 0);
 }
Example #11
0
 /// <exception cref="System.IO.IOException"/>
 public static void WritePacket(net.minecraft.src.Packet packet, java.io.DataOutputStream
                                dataoutputstream)
 {
     dataoutputstream.Write(packet.GetPacketId());
     packet.WritePacketData(dataoutputstream);
 }
Example #12
0
 /// <exception cref="System.IO.IOException"/>
 public override void WritePacketData(java.io.DataOutputStream dataoutputstream)
 {
     dataoutputstream.WriteInt(xPosition);
     dataoutputstream.WriteInt(yPosition);
     dataoutputstream.Write(mode ? 1 : 0);
 }