mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
29 lines
No EOL
1.1 KiB
C#
29 lines
No EOL
1.1 KiB
C#
using MinecraftClient.Mapping.EntityMetadataPalettes;
|
|
using MinecraftClient.Protocol.Handlers;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace MinecraftClient.Mapping;
|
|
|
|
public abstract class EntityMetadataPalette
|
|
{
|
|
public abstract Dictionary<int, EntityMetaDataType> GetEntityMetadataMappingsList();
|
|
|
|
public EntityMetaDataType GetDataType(int typeId)
|
|
{
|
|
return GetEntityMetadataMappingsList()[typeId];
|
|
}
|
|
|
|
public static EntityMetadataPalette GetPalette(int protocolVersion)
|
|
{
|
|
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
|
|
<= Protocol18Handler.MC_1_20_4_Version => new EntityMetadataPalette1194(), // 1.19.4 - 1.20.4 +
|
|
_ => throw new NotImplementedException()
|
|
};
|
|
}
|
|
} |