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 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; } } }
// 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 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); }
public EntEffect(Wrapped.Wrapped socket, Form1 Mainform) { socket.readInt(); socket.readByte(); socket.readByte(); socket.readShort(); }
public useBed(Wrapped.Wrapped socket, Form1 Mainform) { socket.readInt(); socket.readByte(); socket.readInt(); socket.readByte(); socket.readInt(); }
public OpenWindow(Wrapped.Wrapped socket, Form1 mainform) { socket.readByte(); socket.readByte(); socket.readString(); socket.readByte(); bool useTitle = socket.readBool(); }
public BlockAction(Wrapped.Wrapped socket, Form1 mainform) { socket.readInt(); socket.readShort(); socket.readInt(); socket.readByte(); socket.readByte(); socket.readShort(); }
void handle() { int Dimention = socket.readInt(); byte Difficulty = socket.readByte(); byte mode = socket.readByte(); short height = socket.readShort(); string leveltype = socket.readString(); mainform.Chunks.Clear(); // Clear out the chunks. }
public Entlook(Wrapped.Wrapped socket, Form1 mainform) { int EID = socket.readInt(); byte yaw = socket.readByte(); byte pitch = socket.readByte(); functions helper = new functions(); Classes.Entity thisEnt = helper.getEntbyID(EID, mainform); thisEnt.yaw = yaw; thisEnt.pitch = pitch; }
public Explosion(Wrapped.Wrapped socket, Form1 mainform) { double ex = socket.readDouble(); double ey = socket.readDouble(); double ez = socket.readDouble(); socket.readFloat(); int count = socket.readInt(); while (count != 0) { int x = (int)socket.readByte(); int y = (int)socket.readByte(); int z = (int)socket.readByte(); // Convert to Absolute coords x = (int)ex + x; y = (int)ey + y; z = (int)ez + z; decimal ChunkX = decimal.Divide(x, 16); decimal ChunkZ = decimal.Divide(z, 16); ChunkX = Math.Floor(ChunkX); ChunkZ = Math.Floor(ChunkZ); Chunk thisChunk = null; foreach (Classes.Chunk b in mainform.Chunks) { if (b.x == ChunkX & b.z == ChunkZ) { thisChunk = b; break; } } if (thisChunk != null) { thisChunk.updateBlock(x, y, z, 0); } count--; } socket.readFloat(); socket.readFloat(); socket.readFloat(); }
public OpenWindow(Wrapped.Wrapped socket, Form1 mainform) { int meh = socket.readByte(); byte invType = socket.readByte(); socket.readString(); socket.readByte(); bool useTitle = socket.readBool(); if (invType == 11) { socket.readInt(); } }
public void readMetadata(Wrapped.Wrapped socket) { // read metadata from socket do { byte item = socket.readByte(); if (item == 127) { break; } int index = item & 0x1F; int type = item >> 5; switch (type) { case 0: socket.readByte(); break; case 1: socket.readShort(); break; case 2: socket.readInt(); break; case 3: socket.readFloat(); break; case 4: socket.readString(); break; case 5: readSlot(socket); break; case 6: socket.readInt(); socket.readInt(); socket.readInt(); break; } } while (true); }
public tileEditor(Wrapped.Wrapped socket, Form1 mainForm) { socket.readByte(); socket.readInt(); socket.readInt(); socket.readInt(); }
// 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 SpawnNamedEntity(Wrapped.Wrapped socket, Form1 mainform) { int EID = socket.readInt(); string Name = socket.readString(); int X = socket.readInt(); int Y = socket.readInt(); int Z = socket.readInt(); byte Yaw = socket.readByte(); byte Pitch = socket.readByte(); short heldItem = socket.readShort(); functions parser = new functions(); parser.readMetadata(socket); Classes.Entity newPlayer = new Classes.Entity(EID, Name, X, Y, Z, Yaw, Pitch, heldItem); mainform.Entitys.Add(newPlayer); }
public BlockbreakAni(Wrapped.Wrapped socket, Form1 mainform) { socket.readInt(); socket.readInt(); socket.readInt(); socket.readInt(); socket.readByte(); }
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 SpawnGlobalEntity(Wrapped.Wrapped socket, Form1 mainform) { socket.readInt(); socket.readByte(); socket.readInt(); socket.readInt(); socket.readInt(); }
public Namedsound(Wrapped.Wrapped socket, Form1 mainform) { socket.readString(); socket.readInt(); socket.readInt(); socket.readInt(); socket.readFloat(); socket.readByte(); }
public Sound(Wrapped.Wrapped socket, Form1 Mainform) { socket.readInt(); socket.readInt(); socket.readByte(); socket.readInt(); socket.readInt(); socket.readBool(); }
public SpawnObj(Wrapped.Wrapped socket, Form1 mainform) { socket.readInt(); socket.readByte(); socket.readInt(); socket.readInt(); socket.readInt(); socket.readByte(); socket.readByte(); // -- int value = socket.readInt(); if (value != 0) { socket.readShort(); socket.readShort(); socket.readShort(); } }
public CloseWindow(Wrapped.Wrapped socket, Form1 mainform, bool outgoing = false) { if (outgoing) { socket.writeByte(0x65); socket.writeByte(0); } else { socket.readByte(); } }
public updateTileEntity(Wrapped.Wrapped socket, Form1 mainform) { socket.readInt(); socket.readShort(); socket.readInt(); socket.readByte(); int length = socket.readShort(); if (length != 0) { socket.readByteArray(length); } }
public SpawnMob(Wrapped.Wrapped socket, Form1 Mainform) { int EID = socket.readInt(); byte type = socket.readByte(); int X = socket.readInt(); int Y = socket.readInt(); int Z = socket.readInt(); byte Pitch = socket.readByte(); byte headPitch = socket.readByte(); byte Yaw = socket.readByte(); socket.readShort(); socket.readShort(); socket.readShort(); functions parser = new functions(); parser.readMetadata(socket); Classes.Entity newMob = new Classes.Entity(EID, ((functions.entityId)type).ToString(), X, Y, Z, Yaw, Pitch, 0); Mainform.Entitys.Add(newMob); }
public DestroyEnt(Wrapped.Wrapped socket, Form1 mainform) { int times = (int)socket.readByte(); while (times != 0) { int EID = socket.readInt(); functions a = new functions(); a.deleteEnt(EID, mainform); times--; } }
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; } } if (blockID == 15 && Mainform.importing == true) { Mainform.importing = false; Classes.Importer Importer = new Classes.Importer(Mainform, Mainform.importName, x, (int)y, z); // Thread importThread = new Thread(Importer.import); // importThread.Start(); Importer.import(); } if (thisChunk != null) { thisChunk.updateBlock(x, y, z, blockID); } }
public ConfirmTransaction(Wrapped.Wrapped socket, Form1 mainform) { // Should only be sent if we actually receive one with a "false" for accepted. byte windowID = socket.readByte(); short actionNumber = socket.readShort(); bool accepted = socket.readBool(); if (accepted == false) { socket.writeByte(0x6A); socket.writeByte(windowID); socket.writeShort(actionNumber); socket.writeBool(accepted); ClickWindow cw = new ClickWindow(socket, mainform, -999, 0, 0, null); // If we're holding something on our cursor, drop it. } }
public entProps(Wrapped.Wrapped socket, Form1 mainform) { int entId = socket.readInt(); int propCount = socket.readInt(); for (int b = 0; b < propCount; b++) { string key = socket.readString(); double value = socket.readDouble(); short listLength = socket.readShort(); for (int i = 0; i < listLength; i++) { long msb = socket.readLong(); long lsb = socket.readLong(); double ammount = socket.readDouble(); byte op = socket.readByte(); } } }
public Classes.Item returnSlot(Wrapped.Wrapped socket) { int blockID = socket.readShort(); if (blockID == -1) { return(null); } byte itemCount = socket.readByte(); short damage = socket.readShort(); int NBTLength = socket.readShort(); if (NBTLength == -1) { return(new Classes.Item(blockID, itemCount, damage, 0)); } socket.readByteArray(NBTLength); return(new Classes.Item(blockID, itemCount, damage, 0)); }