public EntMetadata(Wrapped.Wrapped socket, Form1 mainform) { socket.readInt(); functions parser = new functions(); parser.readMetadata(socket); }
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; } } }
public entityEquipment(Wrapped.Wrapped sock, Form1 myform) { socket = sock; mainform = myform; handle(); }
public EntEffect(Wrapped.Wrapped socket, Form1 Mainform) { socket.readInt(); socket.readByte(); socket.readByte(); socket.readShort(); }
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); }
//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. } }
public tileEditor(Wrapped.Wrapped socket, Form1 mainForm) { socket.readByte(); socket.readInt(); socket.readInt(); socket.readInt(); }
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. } }
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; } } }
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; } }
// 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(); }
public EntVelocity(Wrapped.Wrapped socket, Form1 mainform) { socket.readInt(); socket.readShort(); socket.readShort(); socket.readShort(); }
public PlayerLook(Wrapped.Wrapped socket, Form1 mainform) { socket.writeByte(12); socket.writeFloat(mainform.position[0]); socket.writeFloat(mainform.position[1]); socket.writeBool(mainform.onground); }
// 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()); } } }
public itemData(Wrapped.Wrapped socket, Form1 mainform) { socket.readShort(); socket.readShort(); int txtlength = socket.readShort(); socket.readByteArray(txtlength); }
public SpawnGlobalEntity(Wrapped.Wrapped socket, Form1 mainform) { socket.readInt(); socket.readByte(); socket.readInt(); socket.readInt(); socket.readInt(); }
public OpenWindow(Wrapped.Wrapped socket, Form1 mainform) { socket.readByte(); socket.readByte(); socket.readString(); socket.readByte(); bool useTitle = socket.readBool(); }
public SpawnExporb(Wrapped.Wrapped socket, Form1 mainform) { socket.readInt(); socket.readInt(); socket.readInt(); socket.readInt(); socket.readShort(); }
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); }
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); }
public useBed(Wrapped.Wrapped socket, Form1 Mainform) { socket.readInt(); socket.readByte(); socket.readInt(); socket.readByte(); socket.readInt(); }
public BlockbreakAni(Wrapped.Wrapped socket, Form1 mainform) { socket.readInt(); socket.readInt(); socket.readInt(); socket.readInt(); socket.readByte(); }
public BlockAction(Wrapped.Wrapped socket, Form1 mainform) { socket.readInt(); socket.readShort(); socket.readInt(); socket.readByte(); socket.readByte(); socket.readShort(); }
public Sound(Wrapped.Wrapped socket, Form1 Mainform) { socket.readInt(); socket.readInt(); socket.readByte(); socket.readInt(); socket.readInt(); socket.readBool(); }
public Namedsound(Wrapped.Wrapped socket, Form1 mainform) { socket.readString(); socket.readInt(); socket.readInt(); socket.readInt(); socket.readFloat(); socket.readByte(); }
// 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); }
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); }
public SpawnPainting(Wrapped.Wrapped socket, Form1 Mainform) { socket.readInt(); socket.readString(); socket.readInt(); socket.readInt(); socket.readInt(); socket.readInt(); }
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); }
public Handshake(Wrapped.Wrapped socket, Form1 asdf, bool outgoing = false) { sock = socket; myform = asdf; if (outgoing) { send(); } else { handle(); } }
public PluginMessage(Wrapped.Wrapped socket, Form1 Mainform) { socket.readString(); int length = socket.readShort(); if (length != 0) { socket.readByteArray(length); } }
public chatMessage(Wrapped.Wrapped sock, Form1 myform, bool outgoing = false) { socket = sock; mainform = myform; if (outgoing) { send(); } else { handle(); } }
public Animation(Wrapped.Wrapped socket, Form1 Mainform, bool outgoing = false) { Socket = socket; mainform = Mainform; if (outgoing) { } else { handle(); } }
public HeldItemChange(Wrapped.Wrapped Socket, Form1 Myform, bool outgoing = false) { socket = Socket; myform = Myform; if (outgoing) { send(); } else { handle(); } }
public PPaL(Wrapped.Wrapped socket, Form1 Mainform, bool outgoing = false) { Socket = socket; mainform = Mainform; if (outgoing) { send(); } else { handle(); } }
public keepAlive(Wrapped.Wrapped socket, Form1 asdf) { sock = socket; myform = asdf; handle(); }
public spawnPosition(Wrapped.Wrapped sock, Form1 myform) { socket = sock; mainform = myform; handle(); }
public Respawn(Wrapped.Wrapped Socket, Form1 Mainform) { socket = Socket; mainform = Mainform; handle(); }