mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Wire up entity metadata palette
This commit is contained in:
parent
1a22002bde
commit
f4ad24746c
6 changed files with 225 additions and 337 deletions
|
|
@ -25,6 +25,7 @@ public enum EntityMetaDataType
|
|||
Pose,
|
||||
CatVariant,
|
||||
FrogVariant,
|
||||
GlobalPosition,
|
||||
OptionalGlobalPosition,
|
||||
PaintingVariant,
|
||||
SnifferState,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
using MinecraftClient.Mapping.EntityMetadataPalettes;
|
||||
using MinecraftClient.Protocol.Handlers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MinecraftClient.Mapping;
|
||||
|
|
@ -5,4 +8,29 @@ 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)
|
||||
{
|
||||
if (protocolVersion < Protocol18Handler.MC_1_9_1_Version)
|
||||
return new EntityMetadataPalette19();
|
||||
else if (protocolVersion <= Protocol18Handler.MC_1_11_2_Version)
|
||||
return new EntityMetadataPalette111();
|
||||
else if (protocolVersion <= Protocol18Handler.MC_1_13_2_Version)
|
||||
return new EntityMetadataPalette113();
|
||||
else if (protocolVersion <= Protocol18Handler.MC_1_14_Version)
|
||||
return new EntityMetadataPalette114();
|
||||
else if (protocolVersion <= Protocol18Handler.MC_1_19_2_Version)
|
||||
return new EntityMetadataPalette1191();
|
||||
else if (protocolVersion <= Protocol18Handler.MC_1_19_3_Version)
|
||||
return new EntityMetadataPalette1193();
|
||||
else if (protocolVersion <= Protocol18Handler.MC_1_19_4_Version)
|
||||
return new EntityMetadataPalette1194();
|
||||
else
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
|
@ -27,7 +27,7 @@ public class EntityMetadataPalette1191 : EntityMetadataPalette
|
|||
{ 18, EntityMetaDataType.Pose },
|
||||
{ 19, EntityMetaDataType.CatVariant },
|
||||
{ 20, EntityMetaDataType.FrogVariant },
|
||||
{ 21, EntityMetaDataType.OptionalGlobalPosition },
|
||||
{ 21, EntityMetaDataType.GlobalPosition },
|
||||
{ 22, EntityMetaDataType.PaintingVariant }
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class EntityMetadataPalette1193 : EntityMetadataPalette
|
|||
{ 19, EntityMetaDataType.Pose },
|
||||
{ 20, EntityMetaDataType.CatVariant },
|
||||
{ 21, EntityMetaDataType.FrogVariant },
|
||||
{ 22, EntityMetaDataType.OptionalGlobalPosition },
|
||||
{ 22, EntityMetaDataType.GlobalPosition },
|
||||
{ 23, EntityMetaDataType.PaintingVariant }
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue