Minecraft-Console-Client/MinecraftClient/Mapping/EntityTypeExtensions.cs

74 lines
2.4 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MinecraftClient.Mapping
{
public static class EntityTypeExtensions
{
/// <summary>
/// Return TRUE if the Entity is an hostile mob
/// </summary>
/// <remarks>New mobs added in newer Minecraft versions might be absent from the list</remarks>
/// <returns>TRUE if hostile</returns>
public static bool IsHostile(this EntityType e)
{
switch (e)
{
case EntityType.Blaze:
case EntityType.Creeper:
case EntityType.Drowned:
case EntityType.Evoker:
case EntityType.Ghast:
case EntityType.Guardian:
2020-07-29 21:35:00 +02:00
case EntityType.Hoglin:
case EntityType.Husk:
case EntityType.MagmaCube:
case EntityType.Phantom:
case EntityType.Piglin:
2020-07-29 21:35:00 +02:00
case EntityType.Pillager:
case EntityType.Ravager:
case EntityType.Shulker:
case EntityType.Silverfish:
case EntityType.Skeleton:
case EntityType.Slime:
case EntityType.Spider:
case EntityType.Stray:
case EntityType.Vex:
case EntityType.Vindicator:
case EntityType.Witch:
case EntityType.WitherSkeleton:
2020-07-29 21:35:00 +02:00
case EntityType.Zoglin:
case EntityType.Zombie:
case EntityType.ZombieVillager:
return true;
default:
return false;
}
}
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>
2020-08-20 21:36:50 +05:00
/// <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;
};
}
}
}