Add Entity.Item, Entity.CustomName, OnEntityMetadata event (#1222)

* Add New Event
* new Event
* Add OnEntityMetadaTa
* Update ChatBot.cs
* Update Protocol18.cs
* Update Entity.cs
* EntityCMD Update
* Update IMinecraftComHandler.cs
* Update Protocol18.cs
* Update IMinecraftComHandler.cs
* Update McClient.cs
* Update IMinecraftComHandler.cs
* Update McClient.cs
* Update McClient.cs
* Update McClient.cs
* Update McClient.cs
* Update ChatBot.cs
* Update McClient.cs
* Update Entity.cs
* Create EntityPose.cs
* Update MinecraftClient.csproj
* Update McClient.cs
* Update EntityPose.cs
* Update Entity.cs
* Update McClient.cs
* Remove debug line
* Update Entitycmd.cs
* Update Entity.cs
* Update McClient.cs
* Update Entity.cs
* Update McClient.cs
* Update McClient.cs
* Update Entity.cs
* Update McClient.cs
* Update Entitycmd.cs
* Update Entitycmd.cs
* Update McClient.cs
* Update Entitycmd.cs
* Update Entitycmd.cs
* Update Entity.cs
* Update McClient.cs
* Update Entitycmd.cs
* Update Entitycmd.cs
* Update Entitycmd.cs
* Update Entitycmd.cs
* Update Entitycmd.cs
* Update Entitycmd.cs
* Crash Fix on Item
* Crashes Fix
* Update McClient.cs
* Crashes fix
* Update McClient.cs
* Update Entity.cs
* Update Entity.cs
* Update McClient.cs
* Update McClient.cs
* Update McClient.cs
* Update McClient.cs
* Update McClient.cs
* Update McClient.cs
* Update McClient.cs
* Update ChatBot.cs
* Update IMinecraftComHandler.cs
* Update McClient.cs
* Update Protocol18.cs
* Update ChatBot.cs
* Update IMinecraftComHandler.cs
* Update Protocol18.cs
* Update McClient.cs
* Fix unaddressed issues
Co-authored-by: ORelio <oreliogitantispam.l0gin@spamgourmet.com>
This commit is contained in:
Рома Данилов 2020-08-20 21:36:50 +05:00 committed by GitHub
parent a6a5f0c333
commit c2e2e85063
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 207 additions and 31 deletions

View file

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using MinecraftClient.Inventory;
namespace MinecraftClient.Mapping
{
@ -22,6 +23,26 @@ namespace MinecraftClient.Mapping
/// Nickname of the entity if it is a player.
/// </summary>
public string Name;
/// <summary>
/// CustomName of the entity.
/// </summary>
public string CustomNameJson;
/// <summary>
/// IsCustomNameVisible of the entity.
/// </summary>
public bool IsCustomNameVisible;
/// <summary>
/// CustomName of the entity.
/// </summary>
public string CustomName;
/// <summary>
/// Latency of the entity if it is a player.
/// </summary>
public int Latency;
/// <summary>
/// Entity type
@ -37,7 +58,22 @@ namespace MinecraftClient.Mapping
/// Health of the entity
/// </summary>
public float Health;
/// <summary>
/// Item of the entity if ItemFrame or Item
/// </summary>
public Item Item;
/// <summary>
/// Entity pose in the Minecraft world
/// </summary>
public EntityPose Pose;
/// <summary>
/// Entity metadata
/// </summary>
public Dictionary<int, object> Metadata;
/// <summary>
/// Create a new entity based on Entity ID, Entity Type and location
/// </summary>

View file

@ -0,0 +1,13 @@
namespace MinecraftClient.Mapping
{
public enum EntityPose
{
Standing = 0,
FallFlying = 1,
Sleeping = 2,
Swimming = 3,
SpinAttack = 4,
Sneaking = 5,
Dying = 6,
}
}

View file

@ -47,5 +47,27 @@ namespace MinecraftClient.Mapping
return false;
}
}
/// <summary>
/// Indicates whether the entity type contains an inner item
/// </summary>
/// <returns>TRUE if item holder (Item Entity, ItemFrame...)</returns>
public static bool ContainsItem(this EntityType e)
{
switch (e)
{
case EntityType.Item:
case EntityType.ItemFrame:
case EntityType.EyeOfEnder:
case EntityType.Egg:
case EntityType.EnderPearl:
case EntityType.Potion:
case EntityType.Fireball:
case EntityType.FireworkRocket:
return true;
default:
return false;
};
}
}
}