Implement entity types (#1001)

Implement palette generation and investigate palette changes between
versions. Turns out 1.13- has legacy IDs, 1.14 switches to entity
palette and 1.15 refreshes the whole palette just to insert Bee.

Also refactor entity handling code here and there.
This commit is contained in:
ORelio 2020-05-24 18:21:22 +02:00
parent 5b0b0c9cc3
commit bd85c46663
27 changed files with 1113 additions and 259 deletions

View file

@ -112,7 +112,7 @@ namespace MinecraftClient.ChatBots
/// <returns>If the entity should be attacked</returns>
public bool handleEntity(Entity entity)
{
if (!entity.IsHostile())
if (!entity.Type.IsHostile())
return false;
bool isBeingAttacked = entitiesToAttack.ContainsKey(entity.ID);

View file

@ -46,7 +46,7 @@ namespace MinecraftClient.ChatBots
public override void OnEntitySpawn(Entity entity)
{
if (entity.TypeID == 102)
if (entity.Type == EntityType.FishingBobber)
{
if (GetCurrentLocation().Distance(entity.Location) < 2 && !isFishing)
{
@ -60,7 +60,7 @@ namespace MinecraftClient.ChatBots
public override void OnEntityDespawn(Entity entity)
{
if(entity.TypeID == 102 && isFishing)
if (entity.Type == EntityType.FishingBobber)
{
if(entity.ID == fishingRod.ID)
{