Skip to content

Commit

Permalink
fix: add trim_material and trim_pattern (#399)
Browse files Browse the repository at this point in the history
* fix: add trim_material and trim_pattern to data_pack

* style: paint it black

* fix: add to `__all__`
  • Loading branch information
RitikShah authored Jun 28, 2023
1 parent d1b0bb6 commit 8dfd2a1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions beet/library/data_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"Predicate",
"Recipe",
"Structure",
"TrimPattern",
"TrimMaterial",
"TagFile",
"BlockTag",
"EntityTypeTag",
Expand Down Expand Up @@ -174,6 +176,20 @@ def to_bytes(self, content: StructureFileData) -> bytes:
return dst.getvalue()


class TrimPattern(JsonFile):
"""Class representing a trim pattern."""

scope: ClassVar[Tuple[str, ...]] = ("trim_pattern",)
extension: ClassVar[str] = ".json"


class TrimMaterial(JsonFile):
"""Class representing a trim material."""

scope: ClassVar[Tuple[str, ...]] = ("trim_material",)
extension: ClassVar[str] = ".json"


class TagFile(JsonFile):
"""Base class for tag files."""

Expand Down Expand Up @@ -288,6 +304,8 @@ class DataPackNamespace(Namespace):
loot_tables: NamespacePin[LootTable] = NamespacePin(LootTable)
predicates: NamespacePin[Predicate] = NamespacePin(Predicate)
recipes: NamespacePin[Recipe] = NamespacePin(Recipe)
trim_pattern: NamespacePin[TrimPattern] = NamespacePin(TrimPattern)
trim_material: NamespacePin[TrimMaterial] = NamespacePin(TrimMaterial)
structures: NamespacePin[Structure] = NamespacePin(Structure)
chat_type: NamespacePin[ChatType] = NamespacePin(ChatType)
damage_type: NamespacePin[DamageType] = NamespacePin(DamageType)
Expand Down Expand Up @@ -326,6 +344,8 @@ class DataPack(Pack[DataPackNamespace]):
loot_tables: NamespaceProxyDescriptor[LootTable] = NamespaceProxyDescriptor(LootTable)
predicates: NamespaceProxyDescriptor[Predicate] = NamespaceProxyDescriptor(Predicate)
recipes: NamespaceProxyDescriptor[Recipe] = NamespaceProxyDescriptor(Recipe)
trim_pattern: NamespaceProxyDescriptor[TrimPattern] = NamespaceProxyDescriptor(TrimPattern)
trim_material: NamespaceProxyDescriptor[TrimMaterial] = NamespaceProxyDescriptor(TrimMaterial)
structures: NamespaceProxyDescriptor[Structure] = NamespaceProxyDescriptor(Structure)
chat_type: NamespaceProxyDescriptor[ChatType] = NamespaceProxyDescriptor(ChatType)
damage_type: NamespaceProxyDescriptor[DamageType] = NamespaceProxyDescriptor(DamageType)
Expand Down

0 comments on commit 8dfd2a1

Please sign in to comment.