Added UUID to spawning players. And UUID property to Entity.cs

This commit is contained in:
CarbonNeuron 2020-04-30 16:25:10 -05:00 committed by ORelio
parent 116efc5e78
commit 1c2e4ab6d8
2 changed files with 19 additions and 1 deletions

View file

@ -15,6 +15,11 @@ namespace MinecraftClient.Mapping
/// </summary>
public int ID;
/// <summary>
/// UUID of the entity if it is a player.
/// </summary>
public Guid UUID;
/// <summary>
/// Entity type determined by Minecraft Console Client
/// </summary>
@ -81,6 +86,19 @@ namespace MinecraftClient.Mapping
this.Type = type;
this.Location = location;
}
/// <summary>
/// Create a new entity based on Entity ID, Entity Type, location and UUID
/// </summary>
/// <param name="ID">Entity ID</param>
/// <param name="type">Entity Type Enum</param>
/// <param name="location">Entity location</param>
public Entity(int ID, EntityType type, Location location, Guid uuid)
{
this.ID = ID;
this.Type = type;
this.Location = location;
this.UUID = uuid;
}
/// <summary>
/// Return TRUE if the Entity is an hostile mob

View file

@ -1271,7 +1271,7 @@ namespace MinecraftClient
public void OnSpawnPlayer(int EntityID, Guid UUID, Location location, byte Yaw, byte Pitch)
{
if (entities.ContainsKey(EntityID)) return;
Entity entity = new Entity(EntityID, EntityType.Player, location);
Entity entity = new Entity(EntityID, EntityType.Player, location, UUID);
entities.Add(EntityID, entity);
foreach (ChatBot bot in bots.ToArray())
{