Code refactoring (related to #1024)

This commit is contained in:
ORelio 2020-05-25 21:39:24 +02:00
parent d120001d70
commit 23870711a0
11 changed files with 69 additions and 100 deletions

View file

@ -14,9 +14,9 @@ namespace MinecraftClient.Mapping.EntityPalettes
protected abstract Dictionary<int, EntityType> GetDict();
/// <summary>
/// Get mapping dictionary for pre-1.13. May be overriden with proper implementation.
/// Get mapping dictionary for pre-1.14 non-living entities.
/// </summary>
/// <returns>Palette dictionary for non-living entities (pre-1.13)</returns>
/// <returns>Palette dictionary for non-living entities (pre-1.14)</returns>
protected virtual Dictionary<int, EntityType> GetDictNonLiving()
{
return null;
@ -34,13 +34,13 @@ namespace MinecraftClient.Mapping.EntityPalettes
if (entityTypesNonLiving != null && !living)
{
//Pre-1.13 non-living entities have a different set of IDs (entityTypesNonLiving != null)
//Pre-1.14 non-living entities have a different set of IDs (entityTypesNonLiving != null)
if (entityTypesNonLiving.ContainsKey(id))
return entityTypesNonLiving[id];
}
else
{
//Post-1.13 entities have the same set of IDs regardless of living status
//1.14+ entities have the same set of IDs regardless of living status
if (entityTypes.ContainsKey(id))
return entityTypes[id];
}

View file

@ -6,7 +6,7 @@ namespace MinecraftClient.Mapping.EntityPalettes
/// <summary>
/// Defines mappings for pre-1.14 entitiy IDs
/// Pre-1.14 Minecraft has 2 set of ids: One for non-living objects and one for living mobs
/// Post-1.14 Minecraft has only one set of ids for all types of entities
/// 1.14+ Minecraft has only one set of ids for all types of entities
/// </summary>
public class EntityPalette113 : EntityPalette
{