Example #1
0
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteByte(WindowId);
            stream.WriteShort(PropertyId);
            stream.WriteShort(Value);
            stream.Purge();

            return(this);
        }
Example #2
0
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteByte(ID);
            stream.WriteByte((byte)Variable);
            stream.WriteShort(Red);
            stream.WriteShort(Green);
            stream.WriteShort(Blue);
            stream.Purge();

            return(this);
        }
Example #3
0
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteVarInt(EntityID);
            stream.WriteShort(VelocityX);
            stream.WriteShort(VelocityY);
            stream.WriteShort(VelocityZ);
            stream.Purge();

            return(this);
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteVarInt(EntityID);
            stream.WriteShort(VelocityX);
            stream.WriteShort(VelocityY);
            stream.WriteShort(VelocityZ);
            stream.Purge();

            return this;
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteByte(ID);
            stream.WriteByte((byte) Variable);
            stream.WriteShort(Red);
            stream.WriteShort(Green);
            stream.WriteShort(Blue);
            stream.Purge();

            return this;
        }
Example #6
0
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteByte(WindowID);
            stream.WriteShort(Slot);
            stream.WriteByte(Button);
            stream.WriteShort(ActionNumber);
            stream.WriteByte(Mode);
            ClickedItem.ToStream(stream);
            stream.Purge();

            return(this);
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteByte(WindowID);
            stream.WriteShort(Slot);
            stream.WriteByte(Button);
            stream.WriteShort(ActionNumber);
            stream.WriteByte(Mode);
            ClickedItem.ToStream(stream);
            stream.Purge();

            return this;
        }
Example #8
0
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteByte(ID);
            stream.WriteByte(SelectionID);
            stream.WriteString(Label);
            StartLocation.ToStreamShort(stream);
            EndLocation.ToStreamShort(stream);
            stream.WriteShort(Red);
            stream.WriteShort(Green);
            stream.WriteShort(Blue);
            stream.WriteShort(Opacity);
            stream.Purge();

            return(this);
        }
Example #9
0
        public void ToStream(IMinecraftStream stream)
        {
            stream.WriteShort(ID);
            stream.WriteShort(Damage);
            stream.WriteShort(Count);

            //if (Empty)
            //    stream.WriteSByte(Slot);

            if (NBTData == null)
            {
                stream.WriteShort(-1);
                return;
            }
        }
Example #10
0
        public IPacket WritePacket(IMinecraftStream stream) // TODO: Complete
        {
            stream.WriteVarInt(ID);
            stream.WriteVarInt(EntityID);
            stream.WriteByte((byte)Type);
            Vector3.ToStreamIntFixedPoint(stream);
            stream.WriteByte(Yaw);
            stream.WriteByte(Pitch);
            stream.WriteShort(SpeedX);
            stream.WriteShort(SpeedY);
            stream.WriteShort(SpeedZ);
            stream.Purge();

            return(this);
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteByte(ID);
            stream.WriteByte(SelectionID);
            stream.WriteString(Label);
            StartLocation.ToStreamShort(stream);
            EndLocation.ToStreamShort(stream);
            stream.WriteShort(Red);
            stream.WriteShort(Green);
            stream.WriteShort(Blue);
            stream.WriteShort(Opacity);
            stream.Purge();

            return this;
        }
        public IPacket WritePacket(IMinecraftStream stream) // TODO: Complete
        {
            stream.WriteVarInt(ID);
            stream.WriteVarInt(EntityID);
            stream.WriteByte((byte) Type);
            Vector3.ToStreamIntFixedPoint(stream);
            stream.WriteByte(Yaw);
            stream.WriteByte(Pitch);
            stream.WriteShort(SpeedX);
            stream.WriteShort(SpeedY);
            stream.WriteShort(SpeedZ);
            stream.Purge();

            return this;
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteByte(ID);
            stream.WriteShort(Distance);
            stream.Purge();

            return(this);
        }
Example #14
0
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteShort(Slot);
            stream.Purge();

            return(this);
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteShort(Slot);
            stream.Purge();

            return this;
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteVarInt(EntityID);
            stream.WriteByte((byte) Type);
            Vector3.ToStreamIntFixedPoint(stream);
            stream.WriteSByte(Yaw);
            stream.WriteSByte(Pitch);
            stream.WriteSByte(HeadPitch);
            stream.WriteShort(VelocityX);
            stream.WriteShort(VelocityY);
            stream.WriteShort(VelocityZ);
            EntityMetadata.ToStream(stream);
            stream.Purge();

            return this;
        }
Example #17
0
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteVarInt(EntityID);
            stream.WriteByte((byte)Type);
            Vector3.ToStreamIntFixedPoint(stream);
            stream.WriteSByte(Yaw);
            stream.WriteSByte(Pitch);
            stream.WriteSByte(HeadPitch);
            stream.WriteShort(VelocityX);
            stream.WriteShort(VelocityY);
            stream.WriteShort(VelocityZ);
            EntityMetadata.ToStream(stream);
            stream.Purge();

            return(this);
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteByte(ID);
            stream.WriteShort(Distance);
            stream.Purge();

            return this;
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteByte(ID);
            stream.WriteString(AppName);
            stream.WriteShort(ExtensionCount);
            stream.Purge();

            return this;
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteByte(ID);
            stream.WriteString(AppName);
            stream.WriteShort(ExtensionCount);
            stream.Purge();

            return(this);
        }
Example #21
0
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteByte(ID);
            stream.WriteShort(ChunkLength);
            stream.WriteByteArray(ChunkData);
            stream.WriteByte(PercentComplete);
            stream.Purge();

            return(this);
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteVarInt(EntityID);
            Vector3.ToStreamIntFixedPoint(stream);
            stream.WriteShort(Count);
            stream.Purge();

            return(this);
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteVarInt(EntityID);
            stream.WriteShort((short)Slot);
            Item.ToStream(stream);
            stream.Purge();

            return(this);
        }
Example #24
0
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteByte(WindowId);
            stream.WriteShort(ActionNumber);
            stream.WriteBoolean(Accepted);
            stream.Purge();

            return(this);
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteByte(WindowID);
            stream.WriteShort(Slot);
            stream.WriteBoolean(Accepted);
            stream.Purge();

            return this;
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteVarInt(EntityID);
            Vector3.ToStreamIntFixedPoint(stream);
            stream.WriteShort(Count);
            stream.Purge();

            return this;
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteByte(ID);
            stream.WriteShort(ChunkLength);
            stream.WriteByteArray(ChunkData);
            stream.WriteByte(PercentComplete);
            stream.Purge();

            return this;
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteString(Channel);
            stream.WriteShort((short)Data.Length);
            stream.WriteByteArray(Data);
            stream.Purge();

            return(this);
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteSByte(WindowId);
            stream.WriteShort(Slot);
            SlotData.ToStream(stream);
            stream.Purge();

            return(this);
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteSByte(WindowId);
            stream.WriteShort(Slot);
            SlotData.ToStream(stream);
            stream.Purge();

            return this;
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteVarInt(EntityID);
            stream.WriteShort((short) Slot);
            Item.ToStream(stream);
            stream.Purge();

            return this;
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteByte(ID);
            stream.WriteString(TextureURL);
            stream.WriteByte(SideBlock);
            stream.WriteByte(EdgeBlock);
            stream.WriteShort(SideLevel);
            stream.Purge();

            return this;
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteVarInt(ProtocolVersion);
            stream.WriteString(ServerAddress);
            stream.WriteShort(ServerPort);
            stream.WriteVarInt((byte)NextState);
            stream.Purge();

            return(this);
        }
Example #34
0
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteByte(ID);
            stream.WriteString(TextureURL);
            stream.WriteByte(SideBlock);
            stream.WriteByte(EdgeBlock);
            stream.WriteShort(SideLevel);
            stream.Purge();

            return(this);
        }
Example #35
0
        public void ToStream(ref IMinecraftStream stream)
        {
            foreach (var itemStack in _entries)
            {
                //if (itemStack.ID == 1) // AIR
                //    return;

                stream.WriteShort(itemStack.ID);
                stream.WriteShort(itemStack.Damage);
                stream.WriteShort(itemStack.Count);

                //if (itemStack.Empty)
                //    stream.WriteSByte(itemStack.Slot);

                if (itemStack.NBTData == null)
                {
                    stream.WriteShort(-1);
                    return;
                }
            }
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteByte(ID);
            stream.WriteShort(NameID);
            stream.WriteString(PlayerName);
            stream.WriteString(ListName);
            stream.WriteString(GroupName);
            stream.WriteByte(GroupRank);
            stream.Purge();

            return(this);
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteByte(ID);
            stream.WriteByte((byte) Flying);
            stream.WriteByte((byte) NoClip);
            stream.WriteByte((byte) Speeding);
            stream.WriteByte((byte) SpawnControl);
            stream.WriteByte((byte) ThirdPersonView);
            stream.WriteShort(JumpHeight);
            stream.Purge();

            return this;
        }
Example #38
0
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteByte(ID);
            stream.WriteByte((byte)Flying);
            stream.WriteByte((byte)NoClip);
            stream.WriteByte((byte)Speeding);
            stream.WriteByte((byte)SpawnControl);
            stream.WriteByte((byte)ThirdPersonView);
            stream.WriteShort(JumpHeight);
            stream.Purge();

            return(this);
        }
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteVarInt(EntityID);
            stream.WriteBigInteger(PlayerUUID);
            Vector3.ToStreamIntFixedPoint(stream);
            stream.WriteSByte(Yaw);
            stream.WriteSByte(Pitch);
            stream.WriteShort(CurrentItem);
            EntityMetadata.ToStream(stream);
            stream.Purge();

            return this;
        }
Example #40
0
        public IPacket WritePacket(IMinecraftStream stream)
        {
            stream.WriteVarInt(ID);
            stream.WriteVarInt(EntityID);
            stream.WriteBigInteger(PlayerUUID);
            Vector3.ToStreamIntFixedPoint(stream);
            stream.WriteSByte(Yaw);
            stream.WriteSByte(Pitch);
            stream.WriteShort(CurrentItem);
            EntityMetadata.ToStream(stream);
            stream.Purge();

            return(this);
        }
Example #41
0
        public void ToStream(ref IMinecraftStream stream)
        {
            stream.WriteInt(Count);

            foreach (var entry in _entries)
            {
                stream.WriteString(entry.Key);
                stream.WriteDouble(entry.Value);

                stream.WriteShort((short)entry.Modifiers.Length);
                foreach (var modifiers in entry.Modifiers)
                {
                    stream.WriteBigInteger(modifiers.UUID);
                    stream.WriteDouble(modifiers.Amount);
                    stream.WriteSByte(modifiers.Operation);
                }
            }
        }
 public override void ToStream(IMinecraftStream stream, byte index)
 {
     stream.WriteByte(GetKey(index));
     stream.WriteShort(Value);
 }
Example #43
0
 public void ToStreamShort(IMinecraftStream stream)
 {
     stream.WriteShort((short)X);
     stream.WriteShort((short)Y);
     stream.WriteShort((short)Z);
 }
Example #44
0
 public override void ToStream(IMinecraftStream stream, byte index)
 {
     stream.WriteByte(GetKey(index));
     stream.WriteShort(Value);
 }