2023-03-24 19:46:25 +08:00
|
|
|
using MinecraftClient.Mapping.EntityMetadataPalettes;
|
|
|
|
|
using MinecraftClient.Protocol.Handlers;
|
|
|
|
|
using System;
|
2023-03-23 23:41:41 +01:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace MinecraftClient.Mapping;
|
|
|
|
|
|
|
|
|
|
public abstract class EntityMetadataPalette
|
|
|
|
|
{
|
|
|
|
|
public abstract Dictionary<int, EntityMetaDataType> GetEntityMetadataMappingsList();
|
2023-03-24 19:46:25 +08:00
|
|
|
|
|
|
|
|
public EntityMetaDataType GetDataType(int typeId)
|
|
|
|
|
{
|
|
|
|
|
return GetEntityMetadataMappingsList()[typeId];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static EntityMetadataPalette GetPalette(int protocolVersion)
|
|
|
|
|
{
|
2023-06-08 19:27:28 +02:00
|
|
|
return protocolVersion switch
|
|
|
|
|
{
|
|
|
|
|
<= Protocol18Handler.MC_1_8_Version => new EntityMetadataPalette18(), // 1.8
|
|
|
|
|
<= Protocol18Handler.MC_1_12_2_Version => new EntityMetadataPalette1122(), // 1.9 - 1.12.2
|
|
|
|
|
<= Protocol18Handler.MC_1_19_2_Version => new EntityMetadataPalette1191(), // 1.13 - 1.19.2
|
|
|
|
|
<= Protocol18Handler.MC_1_19_3_Version => new EntityMetadataPalette1193(), // 1.19.3
|
2023-11-15 15:42:27 +01:00
|
|
|
<= Protocol18Handler.MC_1_20_2_Version => new EntityMetadataPalette1194(), // 1.19.4 - 1.20.2 +
|
2023-06-08 19:27:28 +02:00
|
|
|
_ => throw new NotImplementedException()
|
|
|
|
|
};
|
2023-03-24 19:46:25 +08:00
|
|
|
}
|
2023-03-23 23:41:41 +01:00
|
|
|
}
|