diff options
author | Samuel Barney <samjbarney@gmail.com> | 2014-08-21 16:29:27 +0200 |
---|---|---|
committer | Samuel Barney <samjbarney@gmail.com> | 2014-08-21 16:29:27 +0200 |
commit | b4c84ca002c808ac699ceae2cc3cbb46e4567fc8 (patch) | |
tree | fb8e0b42ad4b791dd81701421234e001524f91d9 /src/Protocol | |
parent | Renamed all new Mob files and classes (diff) | |
download | cuberite-b4c84ca002c808ac699ceae2cc3cbb46e4567fc8.tar cuberite-b4c84ca002c808ac699ceae2cc3cbb46e4567fc8.tar.gz cuberite-b4c84ca002c808ac699ceae2cc3cbb46e4567fc8.tar.bz2 cuberite-b4c84ca002c808ac699ceae2cc3cbb46e4567fc8.tar.lz cuberite-b4c84ca002c808ac699ceae2cc3cbb46e4567fc8.tar.xz cuberite-b4c84ca002c808ac699ceae2cc3cbb46e4567fc8.tar.zst cuberite-b4c84ca002c808ac699ceae2cc3cbb46e4567fc8.zip |
Diffstat (limited to 'src/Protocol')
-rw-r--r-- | src/Protocol/Protocol.h | 1 | ||||
-rw-r--r-- | src/Protocol/Protocol125.cpp | 207 | ||||
-rw-r--r-- | src/Protocol/Protocol125.h | 1 | ||||
-rw-r--r-- | src/Protocol/Protocol17x.cpp | 218 | ||||
-rw-r--r-- | src/Protocol/Protocol17x.h | 1 |
5 files changed, 0 insertions, 428 deletions
diff --git a/src/Protocol/Protocol.h b/src/Protocol/Protocol.h index 16f686b48..585483ca8 100644 --- a/src/Protocol/Protocol.h +++ b/src/Protocol/Protocol.h @@ -111,7 +111,6 @@ public: virtual void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) = 0; virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) = 0; virtual void SendSpawnMob (const cMonster & a_Mob) = 0; - virtual void SendSpawnMob (const cNewMonster & a_Mob) = 0; virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch) = 0; virtual void SendSpawnVehicle (const cEntity & a_Vehicle, char a_VehicleType, char a_VehicleSubType) = 0; virtual void SendStatistics (const cStatManager & a_Manager) = 0; diff --git a/src/Protocol/Protocol125.cpp b/src/Protocol/Protocol125.cpp index ab6f72370..23e7b7406 100644 --- a/src/Protocol/Protocol125.cpp +++ b/src/Protocol/Protocol125.cpp @@ -19,7 +19,6 @@ Documentation: #include "../Entities/Entity.h" #include "../Entities/ExpOrb.h" #include "../Mobs/Monster.h" -#include "../Mobs/NewMonster.h" #include "../Entities/Pickup.h" #include "../Entities/Player.h" #include "../ChatColor.h" @@ -950,28 +949,6 @@ void cProtocol125::SendSpawnMob(const cMonster & a_Mob) -void cProtocol125::SendSpawnMob(const cNewMonster & a_Mob) -{ - cCSLock Lock(m_CSPacket); - WriteByte (PACKET_SPAWN_MOB); - WriteInt (a_Mob.GetUniqueID()); - WriteByte ((Byte)a_Mob.GetMobType()); - WriteVectorI((Vector3i)(a_Mob.GetPosition() * 32)); - WriteByte (0); - WriteByte (0); - WriteByte (0); - - WriteCommonMetadata(a_Mob); - WriteMobMetadata(a_Mob); - WriteByte(0x7f); - - Flush(); -} - - - - - void cProtocol125::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch) { UNUSED(a_Yaw); @@ -2149,189 +2126,5 @@ void cProtocol125::WriteMobMetadata(const cMonster & a_Mob) } } -void cProtocol125::WriteMobMetadata(const cNewMonster & a_Mob) -{ - switch (a_Mob.GetMobType()) - { - case cNewMonster::mtCreeper: - { - WriteByte(0x10); - WriteChar(((const cNewCreeper &)a_Mob).IsBlowing() ? 1 : -1); // Blowing up? - WriteByte(0x11); - WriteByte(((const cNewCreeper &)a_Mob).IsCharged() ? 1 : 0); // Lightning-charged? - break; - } - case cNewMonster::mtBat: - { - WriteByte(0x10); - WriteByte(((const cNewBat &)a_Mob).IsHanging() ? 1 : 0); // Upside down? - break; - } - case cNewMonster::mtPig: - { - WriteByte(0x10); - WriteByte(((const cNewPig &)a_Mob).IsSaddled() ? 1 : 0); // Saddled? - break; - } - case cNewMonster::mtVillager: - { - WriteByte(0x50); - WriteInt(((const cNewVillager &)a_Mob).GetVilType()); // What sort of TESTIFICATE? - break; - } - case cNewMonster::mtZombie: - { - WriteByte(0xC); - WriteByte(((const cNewZombie &)a_Mob).IsBaby() ? 1 : 0); // Baby zombie? - WriteByte(0xD); - WriteByte(((const cNewZombie &)a_Mob).IsVillagerZombie() ? 1 : 0); // Converted zombie? - WriteByte(0xE); - WriteByte(((const cNewZombie &)a_Mob).IsConverting() ? 1 : 0); // Converted-but-converting-back zombllager? - break; - } - case cNewMonster::mtGhast: - { - WriteByte(0x10); - WriteByte(((const cNewGhast &)a_Mob).IsCharging()); // About to spit a flameball? - break; - } - case cNewMonster::mtWolf: - { - Byte WolfStatus = 0; - if (((const cNewWolf &)a_Mob).IsSitting()) - { - WolfStatus |= 0x1; - } - if (((const cNewWolf &)a_Mob).IsAngry()) - { - WolfStatus |= 0x2; - } - if (((const cNewWolf &)a_Mob).IsTame()) - { - WolfStatus |= 0x4; - } - WriteByte(0x10); - WriteByte(WolfStatus); - - WriteByte(0x72); - WriteFloat((float)(a_Mob.GetHealth())); // Tail health-o-meter (only shown when tamed, by the way) - WriteByte(0x13); - WriteByte(((const cNewWolf &)a_Mob).IsBegging() ? 1 : 0); // Ultra cute mode? - break; - } - case cNewMonster::mtSheep: - { - // [1](1111) - // [] = Is sheared? () = Color, from 0 to 15 - - WriteByte(0x10); - Byte SheepMetadata = 0; - SheepMetadata = (Byte)((const cNewSheep &)a_Mob).GetFurColor(); - - if (((const cNewSheep &)a_Mob).IsSheared()) - { - SheepMetadata |= 0x16; - } - WriteByte(SheepMetadata); - break; - } - case cNewMonster::mtEnderman: - { - WriteByte(0x10); - WriteByte((Byte)(((const cNewEnderman &)a_Mob).GetCarriedBlock())); // Block that he stole from your house - WriteByte(0x11); - WriteByte((Byte)(((const cNewEnderman &)a_Mob).GetCarriedMeta())); // Meta of block that he stole from your house - WriteByte(0x12); - WriteByte(((const cNewEnderman &)a_Mob).IsScreaming() ? 1 : 0); // Screaming at your face? - break; - } - case cNewMonster::mtSkeleton: - { - WriteByte(0xD); - WriteByte(((const cNewSkeleton &)a_Mob).IsWither() ? 1 : 0); // It's a skeleton, but it's not - break; - } - case cNewMonster::mtWitch: - { - WriteByte(0x15); - WriteByte(((const cNewWitch &)a_Mob).IsAngry() ? 1 : 0); // Aggravated? Doesn't seem to do anything - break; - } - case cNewMonster::mtWither: - { - WriteByte(0x54); // Int at index 20 - WriteInt((Int32)((const cNewWither &)a_Mob).GetWitherInvulnerableTicks()); - WriteByte(0x66); // Float at index 6 - WriteFloat((float)(a_Mob.GetHealth())); - break; - } - case cNewMonster::mtSlime: - case cNewMonster::mtMagmaCube: - { - WriteByte(0x10); - if (a_Mob.GetMobType() == cNewMonster::mtSlime) - { - WriteByte((Byte)((const cNewSlime &)a_Mob).GetSize()); // Size of slime - HEWGE, meh, cute BABBY SLIME - } - else - { - WriteByte((Byte)((const cNewMagmaCube &)a_Mob).GetSize()); // Size of slime - HEWGE, meh, cute BABBY SLIME - } - break; - } - case cNewMonster::mtHorse: - { - int Flags = 0; - if (((const cNewHorse &)a_Mob).IsTame()) - { - Flags |= 0x2; - } - if (((const cNewHorse &)a_Mob).IsSaddled()) - { - Flags |= 0x4; - } - if (((const cNewHorse &)a_Mob).IsChested()) - { - Flags |= 0x8; - } - if (((const cNewHorse &)a_Mob).IsBaby()) - { - Flags |= 0x10; // IsBred flag, according to wiki.vg - don't think it does anything in multiplayer - } - if (((const cNewHorse &)a_Mob).IsEating()) - { - Flags |= 0x20; - } - if (((const cNewHorse &)a_Mob).IsRearing()) - { - Flags |= 0x40; - } - if (((const cNewHorse &)a_Mob).IsMthOpen()) - { - Flags |= 0x80; - } - WriteByte(0x50); - WriteInt(Flags); - - WriteByte(0x13); - WriteByte((Byte)((const cNewHorse &)a_Mob).GetHorseType()); // Type of horse (donkey, chestnut, etc.) - - WriteByte(0x54); - int Appearance = 0; - Appearance = ((const cNewHorse &)a_Mob).GetHorseColor(); // Mask FF - Appearance |= ((const cNewHorse &)a_Mob).GetHorseStyle() * 256; // Mask FF00, so multiply by 256 - WriteInt(Appearance); - - WriteByte(0x56); - WriteInt(((const cNewHorse &)a_Mob).GetHorseArmour()); // Horshey armour - break; - } - default: - { - break; - } - } -} - diff --git a/src/Protocol/Protocol125.h b/src/Protocol/Protocol125.h index cab86faa0..303b7c6ad 100644 --- a/src/Protocol/Protocol125.h +++ b/src/Protocol/Protocol125.h @@ -82,7 +82,6 @@ public: virtual void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) override; virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) override; virtual void SendSpawnMob (const cMonster & a_Mob) override; - virtual void SendSpawnMob (const cNewMonster & a_Mob) override; virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch) override; virtual void SendSpawnVehicle (const cEntity & a_Vehicle, char a_VehicleType, char a_VehicleSubType) override; virtual void SendStatistics (const cStatManager & a_Manager) override; diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index c2aea69da..56e73c1c1 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -35,7 +35,6 @@ Implements the 1.7.x protocol classes: #include "../Entities/FireworkEntity.h" #include "../Mobs/IncludeAllMonsters.h" -#include "../Mobs/NewMonster.h" #include "../UI/Window.h" #include "../BlockEntities/BeaconEntity.h" @@ -1169,30 +1168,6 @@ void cProtocol172::SendSpawnMob(const cMonster & a_Mob) -void cProtocol172::SendSpawnMob(const cNewMonster & a_Mob) -{ - ASSERT(m_State == 3); // In game mode? - - cPacketizer Pkt(*this, 0x0f); // Spawn Mob packet - Pkt.WriteVarInt(a_Mob.GetUniqueID()); - Pkt.WriteByte((Byte)a_Mob.GetMobType()); - Pkt.WriteFPInt(a_Mob.GetPosX()); - Pkt.WriteFPInt(a_Mob.GetPosY()); - Pkt.WriteFPInt(a_Mob.GetPosZ()); - Pkt.WriteByteAngle(a_Mob.GetPitch()); - Pkt.WriteByteAngle(a_Mob.GetHeadYaw()); - Pkt.WriteByteAngle(a_Mob.GetYaw()); - Pkt.WriteShort((short)(a_Mob.GetSpeedX() * 400)); - Pkt.WriteShort((short)(a_Mob.GetSpeedY() * 400)); - Pkt.WriteShort((short)(a_Mob.GetSpeedZ() * 400)); - Pkt.WriteEntityMetadata(a_Mob); - Pkt.WriteByte(0x7f); // Metadata terminator -} - - - - - void cProtocol172::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch) { ASSERT(m_State == 3); // In game mode? @@ -3027,199 +3002,6 @@ void cProtocol172::cPacketizer::WriteMobMetadata(const cMonster & a_Mob) -void cProtocol172::cPacketizer::WriteMobMetadata(const cNewMonster & a_Mob) -{ - switch (a_Mob.GetMobType()) - { - case cMonster::mtCreeper: - { - // WriteByte(0x10); - // WriteByte(((const cCreeper &)a_Mob).IsBlowing() ? 1 : -1); - // WriteByte(0x11); - // WriteByte(((const cCreeper &)a_Mob).IsCharged() ? 1 : 0); - break; - } - - case cMonster::mtBat: - { - // WriteByte(0x10); - // WriteByte(((const cBat &)a_Mob).IsHanging() ? 1 : 0); - break; - } - - case cMonster::mtPig: - { - // WriteByte(0x10); - // WriteByte(((const cPig &)a_Mob).IsSaddled() ? 1 : 0); - break; - } - - case cMonster::mtVillager: - { - // WriteByte(0x50); - // WriteInt(((const cVillager &)a_Mob).GetVilType()); - break; - } - - case cMonster::mtZombie: - { - // WriteByte(0x0c); - // WriteByte(((const cZombie &)a_Mob).IsBaby() ? 1 : 0); - // WriteByte(0x0d); - // WriteByte(((const cZombie &)a_Mob).IsVillagerZombie() ? 1 : 0); - // WriteByte(0x0e); - // WriteByte(((const cZombie &)a_Mob).IsConverting() ? 1 : 0); - break; - } - - case cMonster::mtGhast: - { - // WriteByte(0x10); - // WriteByte(((const cGhast &)a_Mob).IsCharging()); - break; - } - - case cMonster::mtWolf: - { - // const cWolf & Wolf = (const cWolf &)a_Mob; - // Byte WolfStatus = 0; - // if (Wolf.IsSitting()) - // { - // WolfStatus |= 0x1; - // } - // if (Wolf.IsAngry()) - // { - // WolfStatus |= 0x2; - // } - // if (Wolf.IsTame()) - // { - // WolfStatus |= 0x4; - // } - // WriteByte(0x10); - // WriteByte(WolfStatus); - - // WriteByte(0x72); - // WriteFloat((float)(a_Mob.GetHealth())); - // WriteByte(0x13); - // WriteByte(Wolf.IsBegging() ? 1 : 0); - // WriteByte(0x14); - // WriteByte(Wolf.GetCollarColor()); - break; - } - - case cMonster::mtSheep: - { - // WriteByte(0x10); - // Byte SheepMetadata = 0; - // SheepMetadata = ((const cSheep &)a_Mob).GetFurColor(); - // if (((const cSheep &)a_Mob).IsSheared()) - // { - // SheepMetadata |= 0x10; - // } - // WriteByte(SheepMetadata); - break; - } - - case cMonster::mtEnderman: - { - // WriteByte(0x10); - // WriteByte((Byte)(((const cEnderman &)a_Mob).GetCarriedBlock())); - // WriteByte(0x11); - // WriteByte((Byte)(((const cEnderman &)a_Mob).GetCarriedMeta())); - // WriteByte(0x12); - // WriteByte(((const cEnderman &)a_Mob).IsScreaming() ? 1 : 0); - break; - } - - case cMonster::mtSkeleton: - { - // WriteByte(0x0d); - // WriteByte(((const cSkeleton &)a_Mob).IsWither() ? 1 : 0); - break; - } - - case cMonster::mtWitch: - { - // WriteByte(0x15); - // WriteByte(((const cWitch &)a_Mob).IsAngry() ? 1 : 0); - break; - } - - case cMonster::mtWither: - { - // WriteByte(0x54); // Int at index 20 - // WriteInt(((const cWither &)a_Mob).GetWitherInvulnerableTicks()); - // WriteByte(0x66); // Float at index 6 - // WriteFloat((float)(a_Mob.GetHealth())); - break; - } - - case cMonster::mtSlime: - { - // WriteByte(0x10); - // WriteByte(((const cSlime &)a_Mob).GetSize()); - break; - } - - case cMonster::mtMagmaCube: - { - // WriteByte(0x10); - // WriteByte(((const cMagmaCube &)a_Mob).GetSize()); - break; - } - - case cMonster::mtHorse: - { - // const cHorse & Horse = (const cHorse &)a_Mob; - // int Flags = 0; - // if (Horse.IsTame()) - // { - // Flags |= 0x02; - // } - // if (Horse.IsSaddled()) - // { - // Flags |= 0x04; - // } - // if (Horse.IsChested()) - // { - // Flags |= 0x08; - // } - // if (Horse.IsBaby()) - // { - // Flags |= 0x10; - // } - // if (Horse.IsEating()) - // { - // Flags |= 0x20; - // } - // if (Horse.IsRearing()) - // { - // Flags |= 0x40; - // } - // if (Horse.IsMthOpen()) - // { - // Flags |= 0x80; - // } - // WriteByte(0x50); // Int at index 16 - // WriteInt(Flags); - // WriteByte(0x13); // Byte at index 19 - // WriteByte(Horse.GetHorseType()); - // WriteByte(0x54); // Int at index 20 - // int Appearance = 0; - // Appearance = Horse.GetHorseColor(); - // Appearance |= Horse.GetHorseStyle() << 8; - // WriteInt(Appearance); - // WriteByte(0x56); // Int at index 22 - // WriteInt(Horse.GetHorseArmour()); - break; - } - } // switch (a_Mob.GetType()) -} - - - - - void cProtocol172::cPacketizer::WriteEntityProperties(const cEntity & a_Entity) { if (!a_Entity.IsMob()) diff --git a/src/Protocol/Protocol17x.h b/src/Protocol/Protocol17x.h index ef73a043f..fff15a67a 100644 --- a/src/Protocol/Protocol17x.h +++ b/src/Protocol/Protocol17x.h @@ -114,7 +114,6 @@ public: virtual void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) override; virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) override; virtual void SendSpawnMob (const cMonster & a_Mob) override; - virtual void SendSpawnMob (const cNewMonster & a_Mob) override; virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch) override; virtual void SendSpawnVehicle (const cEntity & a_Vehicle, char a_VehicleType, char a_VehicleSubType) override; virtual void SendStatistics (const cStatManager & a_Manager) override; |