示例#1
0
        public EntMetadata(Wrapped.Wrapped socket, Form1 mainform)
        {
            socket.readInt();
            functions parser = new functions();

            parser.readMetadata(socket);
        }
示例#2
0
        public EntTeleport(Wrapped.Wrapped socket, Form1 Mainform)
        {
            int       EID    = socket.readInt();
            int       X      = socket.readInt();
            int       Y      = socket.readInt();
            int       Z      = socket.readInt();
            byte      yaw    = socket.readByte();
            byte      pitch  = socket.readByte();
            functions helper = new functions();

            Classes.Entity thisEnt = helper.getEntbyID(EID, Mainform);

            if (thisEnt != null)
            {
                thisEnt.X     = X;
                thisEnt.Y     = Y;
                thisEnt.Z     = Z;
                thisEnt.yaw   = yaw;
                thisEnt.pitch = pitch;

                if (Mainform.following == true && thisEnt.name == Mainform.fname)
                {
                    Mainform.location[0] = thisEnt.X / 32;
                    Mainform.location[1] = thisEnt.Y / 32;
                    Mainform.location[2] = thisEnt.Z / 32;
                    Mainform.location[3] = thisEnt.Y / 32 + 1;
                }
            }
        }
示例#3
0
        public entityEquipment(Wrapped.Wrapped sock, Form1 myform)
        {
            socket = sock;
            mainform = myform;

            handle();
        }
示例#4
0
 public EntEffect(Wrapped.Wrapped socket, Form1 Mainform)
 {
     socket.readInt();
     socket.readByte();
     socket.readByte();
     socket.readShort();
 }
示例#5
0
        public BlockChange(Wrapped.Wrapped socket, Form1 Mainform)
        {
            int chunkX, chunkZ;

            int   x       = socket.readInt();
            byte  y       = socket.readByte();
            int   z       = socket.readInt();
            short blockID = socket.readShort();

            socket.readByte();

            chunkX = (int)Math.Floor(decimal.Divide(x, 16));
            chunkZ = (int)Math.Floor(decimal.Divide(z, 16));

            Classes.Chunk thisChunk = null;

            foreach (Classes.Chunk b in Mainform.Chunks)
            {
                if (b.x == chunkX & b.z == chunkZ)
                {
                    thisChunk = b;
                    break;
                }
            }

            thisChunk.updateBlock(x, y, z, blockID);
        }
示例#6
0
        //Client-to-Server only

        public ClickWindow(Wrapped.Wrapped socket, Form1 MainForm, short slot, byte mouse, byte mode, Classes.Item clicked)
        {
            socket.writeByte(0x66);
            socket.writeByte(0);
            socket.writeShort(slot);
            socket.writeByte(mouse);
            socket.writeShort(13);
            socket.writeByte(mode);

            if (clicked == null)
            {
                socket.writeShort(-1);
            }
            else
            {
                socket.writeShort((short)clicked.itemID);
                socket.writeByte(clicked.itemCount);
                socket.writeShort(clicked.itemDamage);
                socket.writeShort(-1);
            }

            if (slot == -999 && clicked != null)
            {
                MainForm.inventory.Remove(clicked); // Just to make sure, pretty sure that minecraft will send a setwindowitem for it to clear anyway.
            }
        }
示例#7
0
        public entityEquipment(Wrapped.Wrapped sock, Form1 myform)
        {
            socket   = sock;
            mainform = myform;

            handle();
        }
示例#8
0
 public tileEditor(Wrapped.Wrapped socket, Form1 mainForm)
 {
     socket.readByte();
     socket.readInt();
     socket.readInt();
     socket.readInt();
 }
示例#9
0
        public BulkChunks(Wrapped.Wrapped socket, Form1 mainform)
        {
            short columncount = socket.readShort();
            int   Datalength  = socket.readInt();
            bool  skylight    = socket.readBool();

            byte[] packdata = socket.readByteArray(Datalength);
            byte[] decompressed;


            byte[]  trim   = new byte[Datalength - 2];
            Chunk[] chunks = new Chunk[columncount];

            // Shoutout to BjorN64 for the simplification of this.
            Array.Copy(packdata, 2, trim, 0, Datalength - 2);

            // Decompress the data

            Classes.Decompressor dc = new Classes.Decompressor(trim);
            decompressed = dc.decompress();

            for (int i = 0; columncount > i; i++)
            {
                // Need to store this data so it's not lost as well..
                int   x       = socket.readInt();
                int   z       = socket.readInt();
                short pbitmap = socket.readShort();
                short abitmap = socket.readShort();

                chunks[i] = new Chunk(x, z, pbitmap, abitmap, skylight, true); // Assume true for Ground Up Continuous

                decompressed = chunks[i].getData(decompressed);                // Calls the chunk class to take all of the bytes it needs, and return whats left.
                mainform.Chunks.Add(chunks[i]);                                // Add the chunk to the main form so we can use it later.
            }
        }
示例#10
0
        public EntlookRelmove(Wrapped.Wrapped socket, Form1 mainform)
        {
            int       EID    = socket.readInt();
            sbyte     dx     = (sbyte)socket.readByte();
            sbyte     dy     = (sbyte)socket.readByte();
            sbyte     dz     = (sbyte)socket.readByte();
            byte      yaw    = socket.readByte();
            byte      pitch  = socket.readByte();
            functions helper = new functions();

            Classes.Entity thisEnt = helper.getEntbyID(EID, mainform);

            if (thisEnt != null)
            {
                thisEnt.yaw   = yaw;
                thisEnt.pitch = pitch;
                thisEnt.X    += dx;
                thisEnt.Y    += dy;
                thisEnt.Z    += dz;


                if (mainform.following == true && thisEnt.name == mainform.fname)
                {
                    mainform.location[0] = thisEnt.X / 32;
                    mainform.location[1] = thisEnt.Y / 32;
                    mainform.location[2] = thisEnt.Z / 32;
                    mainform.location[3] = thisEnt.Y / 32 + 1;
                }
            }
        }
示例#11
0
        public Playerdigging(Wrapped.Wrapped socket, Form1 mainform, int option)
        {
            switch (option)
            {
            case 3:
                socket.writeByte(14);
                socket.writeByte((byte)option);
                socket.writeInt(0);
                socket.writeByte(0);
                socket.writeInt(0);
                socket.writeByte(0);
                break;

            case 4:
                socket.writeByte(14);
                socket.writeByte((byte)option);
                socket.writeInt(0);
                socket.writeByte(0);
                socket.writeInt(0);
                socket.writeByte(0);
                break;

            case 5:
                socket.writeByte(14);
                socket.writeByte((byte)option);
                socket.writeInt(0);
                socket.writeByte(0);
                socket.writeInt(0);
                socket.writeByte(255);
                break;

            default:
                break;
            }
        }
示例#12
0
        // Server-To-Client only

        public updateScore(Wrapped.Wrapped Socket, Form1 Mainform)
        {
            string itemName  = Socket.readString();
            byte   update    = Socket.readByte();
            string scoreName = Socket.readString();
            int    value     = Socket.readInt();
        }
示例#13
0
 public EntVelocity(Wrapped.Wrapped socket, Form1 mainform)
 {
     socket.readInt();
     socket.readShort();
     socket.readShort();
     socket.readShort();
 }
示例#14
0
 public PlayerLook(Wrapped.Wrapped socket, Form1 mainform)
 {
     socket.writeByte(12);
     socket.writeFloat(mainform.position[0]);
     socket.writeFloat(mainform.position[1]);
     socket.writeBool(mainform.onground);
 }
示例#15
0
文件: teams.cs 项目: SinZ163/Minebot
        // Server-to-Client only

        public teams(Wrapped.Wrapped socket, Form1 Mainform)
        {
            List <string> players;
            string        teamDisplayname;
            string        teamPrefix;
            string        teamSuffix;
            byte          friendlyFire;
            short         playerCount;

            string teamName = socket.readString();
            byte   mode     = socket.readByte();

            if (mode == 0 || mode == 2)
            {
                teamDisplayname = socket.readString();
                teamPrefix      = socket.readString();
                teamSuffix      = socket.readString();
                friendlyFire    = socket.readByte();
            }
            if (mode == 0 || mode == 3 || mode == 4)
            {
                playerCount = socket.readShort();
                players     = new List <string>();

                for (int i = 1; i < playerCount; i++)
                {
                    players.Add(socket.readString());
                }
            }
        }
示例#16
0
        public itemData(Wrapped.Wrapped socket, Form1 mainform)
        {
            socket.readShort();
            socket.readShort();
            int txtlength = socket.readShort();

            socket.readByteArray(txtlength);
        }
示例#17
0
 public SpawnGlobalEntity(Wrapped.Wrapped socket, Form1 mainform)
 {
     socket.readInt();
     socket.readByte();
     socket.readInt();
     socket.readInt();
     socket.readInt();
 }
示例#18
0
 public OpenWindow(Wrapped.Wrapped socket, Form1 mainform)
 {
     socket.readByte();
     socket.readByte();
     socket.readString();
     socket.readByte();
     bool useTitle = socket.readBool();
 }
示例#19
0
 public SpawnExporb(Wrapped.Wrapped socket, Form1 mainform)
 {
     socket.readInt();
     socket.readInt();
     socket.readInt();
     socket.readInt();
     socket.readShort();
 }
示例#20
0
        public SetSlot(Wrapped.Wrapped socket, Form1 mainform)
        {
            byte      windowId = socket.readByte();
            short     slot     = socket.readShort();
            functions Parser   = new functions();

            Parser.readSlot(socket, true, mainform, slot);
        }
示例#21
0
        public creativeInventory(Wrapped.Wrapped socket, Form1 mainform, short slot, Classes.Item clicked)
        {
            functions helper = new functions();

            socket.SendByte(0x6b);
            socket.writeShort(slot);
            helper.writeSlot(clicked, socket);
        }
示例#22
0
 public useBed(Wrapped.Wrapped socket, Form1 Mainform)
 {
     socket.readInt();
     socket.readByte();
     socket.readInt();
     socket.readByte();
     socket.readInt();
 }
示例#23
0
 public BlockbreakAni(Wrapped.Wrapped socket, Form1 mainform)
 {
     socket.readInt();
     socket.readInt();
     socket.readInt();
     socket.readInt();
     socket.readByte();
 }
示例#24
0
 public BlockAction(Wrapped.Wrapped socket, Form1 mainform)
 {
     socket.readInt();
     socket.readShort();
     socket.readInt();
     socket.readByte();
     socket.readByte();
     socket.readShort();
 }
示例#25
0
 public Sound(Wrapped.Wrapped socket, Form1 Mainform)
 {
     socket.readInt();
     socket.readInt();
     socket.readByte();
     socket.readInt();
     socket.readInt();
     socket.readBool();
 }
示例#26
0
 public Namedsound(Wrapped.Wrapped socket, Form1 mainform)
 {
     socket.readString();
     socket.readInt();
     socket.readInt();
     socket.readInt();
     socket.readFloat();
     socket.readByte();
 }
示例#27
0
        // 0 - Start digging
        // 2 - Finish digging
        // 3 - drop item stack
        // 4 - drop item
        // 5 - shoot arrow / finish eating
        // Face:
        // 0 - -y
        // 1 - +y
        // 2 - -z
        // 3 - +z
        // 4 - -x
        // 5 - +x

        public Playerdigging(Wrapped.Wrapped socket, Form1 mainform, int option, int x, int y, int z, byte face)
        {
            socket.writeByte(14);
            socket.writeByte((byte)option);
            socket.writeInt(x);
            socket.writeByte((byte)y);
            socket.writeInt(z);
            socket.writeByte(face);
        }
示例#28
0
 public PlayerPosition(Wrapped.Wrapped Socket, Form1 Mainform)
 {
     Socket.writeByte(11);
     Socket.writeDouble(Math.Round(Mainform.location[0], 1));
     Socket.writeDouble(Math.Round(Mainform.location[1], 1));
     Socket.writeDouble(Math.Round(Mainform.location[3], 1));
     Socket.writeDouble(Math.Round(Mainform.location[2], 1));
     Socket.writeBool(Mainform.onground);
 }
示例#29
0
 public SpawnPainting(Wrapped.Wrapped socket, Form1 Mainform)
 {
     socket.readInt();
     socket.readString();
     socket.readInt();
     socket.readInt();
     socket.readInt();
     socket.readInt();
 }
示例#30
0
 public ClientSettings(Wrapped.Wrapped socket, Form1 mainform)
 {
     socket.writeByte(0xcc);
     socket.writeString("en_US");
     socket.writeByte(1);
     socket.writeByte(4);
     socket.writeByte(2);
     socket.writeBool(false);
 }
示例#31
0
 public Handshake(Wrapped.Wrapped socket, Form1 asdf, bool outgoing = false)
 {
     sock = socket;
     myform = asdf;
     if (outgoing) {
         send();
     } else {
         handle();
     }
 }
示例#32
0
        public PluginMessage(Wrapped.Wrapped socket, Form1 Mainform)
        {
            socket.readString();
            int length = socket.readShort();

            if (length != 0)
            {
                socket.readByteArray(length);
            }
        }
示例#33
0
        public chatMessage(Wrapped.Wrapped sock, Form1 myform, bool outgoing = false)
        {
            socket = sock;
            mainform = myform;

            if (outgoing)
            {
                send();
            }
            else
            {
                handle();
            }
        }
示例#34
0
        public Animation(Wrapped.Wrapped socket, Form1 Mainform, bool outgoing = false)
        {
            Socket = socket;
            mainform = Mainform;

            if (outgoing)
            {

            }
            else
            {
                handle();
            }
        }
示例#35
0
        public HeldItemChange(Wrapped.Wrapped Socket, Form1 Myform, bool outgoing = false)
        {
            socket = Socket;
            myform = Myform;

            if (outgoing)
            {
                send();
            }
            else
            {
                handle();
            }
        }
示例#36
0
文件: PPaL.cs 项目: umby24/Minebot
        public PPaL(Wrapped.Wrapped socket, Form1 Mainform, bool outgoing = false)
        {
            Socket = socket;
            mainform = Mainform;

            if (outgoing)
            {
                send();
            }
            else
            {
                handle();
            }
        }
示例#37
0
 public keepAlive(Wrapped.Wrapped socket, Form1 asdf)
 {
     sock = socket;
     myform = asdf;
     handle();
 }
示例#38
0
 public spawnPosition(Wrapped.Wrapped sock, Form1 myform)
 {
     socket = sock;
     mainform = myform;
     handle();
 }
示例#39
0
文件: Respawn.cs 项目: umby24/Minebot
 public Respawn(Wrapped.Wrapped Socket, Form1 Mainform)
 {
     socket = Socket;
     mainform = Mainform;
     handle();
 }