mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Added more components + added item palette reference
This commit is contained in:
parent
76e873ed54
commit
49319fe781
44 changed files with 667 additions and 29 deletions
|
|
@ -13,7 +13,8 @@ public class StructuredComponentsHandler
|
|||
|
||||
public StructuredComponentsHandler(
|
||||
int protocolVersion,
|
||||
DataTypes dataTypes)
|
||||
DataTypes dataTypes,
|
||||
ItemPalette itemPalette)
|
||||
{
|
||||
// Get the appropriate subcomponent registry type based on the protocol version and then instantiate it
|
||||
var subcomponentRegistryType = protocolVersion switch
|
||||
|
|
@ -32,7 +33,7 @@ public class StructuredComponentsHandler
|
|||
_ => throw new NotSupportedException($"Protocol version {protocolVersion} is not supported for structured component registries!")
|
||||
};
|
||||
|
||||
ComponentRegistry = Activator.CreateInstance(registryType, subcomponentRegistry, dataTypes) as StructuredComponentRegistry
|
||||
ComponentRegistry = Activator.CreateInstance(registryType, dataTypes, itemPalette, subcomponentRegistry) as StructuredComponentRegistry
|
||||
?? throw new InvalidOperationException($"Failed to instantiate a component registry for type {nameof(registryType)}");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue