mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Added UUID to spawning players. And UUID property to Entity.cs
This commit is contained in:
parent
116efc5e78
commit
1c2e4ab6d8
2 changed files with 19 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue