Small fixes for (#1149)

This commit is contained in:
ORelio 2020-07-29 21:35:00 +02:00 committed by ORelio
parent d7259a49db
commit 61ac5bb3d1
5 changed files with 28 additions and 28 deletions

View file

@ -42,6 +42,7 @@ namespace MinecraftClient.Mapping
EyeOfEnder, EyeOfEnder,
FallingBlock, FallingBlock,
FireworkRocket, FireworkRocket,
FishingBobber,
Fox, Fox,
Ghast, Ghast,
Giant, Giant,
@ -100,6 +101,7 @@ namespace MinecraftClient.Mapping
Egg, Egg,
EnderPearl, EnderPearl,
ExperienceBottle, ExperienceBottle,
Player,
Potion, Potion,
Trident, Trident,
TraderLlama, TraderLlama,
@ -119,7 +121,5 @@ namespace MinecraftClient.Mapping
ZombieHorse, ZombieHorse,
ZombieVillager, ZombieVillager,
ZombiePigman, ZombiePigman,
Player,
FishingBobber,
} }
} }

View file

@ -676,7 +676,7 @@ namespace MinecraftClient.Protocol.Handlers
/// </summary> /// </summary>
/// <param name="paramBool">Boolean to encode</param> /// <param name="paramBool">Boolean to encode</param>
/// <returns>Byte array for this boolean</returns> /// <returns>Byte array for this boolean</returns>
public byte[] GetVarBool(bool paramBool) public byte[] GetBool(bool paramBool)
{ {
List<byte> bytes = new List<byte>(); List<byte> bytes = new List<byte>();
bytes.Add((byte)Convert.ToByte(paramBool)); bytes.Add((byte)Convert.ToByte(paramBool));

View file

@ -106,11 +106,11 @@ namespace MinecraftClient.Protocol.Handlers
{ {
if (protocolversion > MC1161Version && handler.GetEntityHandlingEnabled()) if (protocolversion > MC1161Version && handler.GetEntityHandlingEnabled())
throw new NotImplementedException("Please update entity types handling for this Minecraft version. See EntityType.cs"); throw new NotImplementedException("Please update entity types handling for this Minecraft version. See EntityType.cs");
if (protocolversion < MC115Version) if (protocolversion >= MC116Version)
entityPalette = new EntityPalette114();
if (protocolversion > MC115Version)
entityPalette = new EntityPalette116(); entityPalette = new EntityPalette116();
else entityPalette = new EntityPalette115(); else if (protocolversion >= MC115Version)
entityPalette = new EntityPalette115();
else entityPalette = new EntityPalette114();
} }
else entityPalette = new EntityPalette113(); else entityPalette = new EntityPalette113();
} }
@ -1443,7 +1443,7 @@ namespace MinecraftClient.Protocol.Handlers
// Currently hardcoded to false // Currently hardcoded to false
// TODO: Update to reflect the real player state // TODO: Update to reflect the real player state
if (protocolversion >= MC116Version) if (protocolversion >= MC116Version)
fields.AddRange(dataTypes.GetVarBool(false)); fields.AddRange(dataTypes.GetBool(false));
SendPacket(PacketOutgoingType.InteractEntity, fields); SendPacket(PacketOutgoingType.InteractEntity, fields);
return true; return true;

View file

@ -385,7 +385,7 @@ namespace MinecraftClient.Protocol.Handlers
case 0x29: return PacketIncomingType.EntityPositionAndRotation; case 0x29: return PacketIncomingType.EntityPositionAndRotation;
case 0x58: return PacketIncomingType.EntityProperties; case 0x58: return PacketIncomingType.EntityProperties;
case 0x56: return PacketIncomingType.EntityTeleport; case 0x56: return PacketIncomingType.EntityTeleport;
case 0x46: return PacketIncomingType.EntityVelocity; // This is maybe entity moving, not sure case 0x46: return PacketIncomingType.EntityVelocity;
case 0x47: return PacketIncomingType.EntityEquipment; case 0x47: return PacketIncomingType.EntityEquipment;
case 0x59: return PacketIncomingType.EntityEffect; case 0x59: return PacketIncomingType.EntityEffect;
case 0x4E: return PacketIncomingType.TimeUpdate; case 0x4E: return PacketIncomingType.TimeUpdate;