Skip to content

Commit 8dfd2a1

Browse files
author
Rit
authored
fix: add trim_material and trim_pattern (#399)
* fix: add trim_material and trim_pattern to data_pack * style: paint it black * fix: add to `__all__`
1 parent d1b0bb6 commit 8dfd2a1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

beet/library/data_pack.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
"Predicate",
1111
"Recipe",
1212
"Structure",
13+
"TrimPattern",
14+
"TrimMaterial",
1315
"TagFile",
1416
"BlockTag",
1517
"EntityTypeTag",
@@ -174,6 +176,20 @@ def to_bytes(self, content: StructureFileData) -> bytes:
174176
return dst.getvalue()
175177

176178

179+
class TrimPattern(JsonFile):
180+
"""Class representing a trim pattern."""
181+
182+
scope: ClassVar[Tuple[str, ...]] = ("trim_pattern",)
183+
extension: ClassVar[str] = ".json"
184+
185+
186+
class TrimMaterial(JsonFile):
187+
"""Class representing a trim material."""
188+
189+
scope: ClassVar[Tuple[str, ...]] = ("trim_material",)
190+
extension: ClassVar[str] = ".json"
191+
192+
177193
class TagFile(JsonFile):
178194
"""Base class for tag files."""
179195

@@ -288,6 +304,8 @@ class DataPackNamespace(Namespace):
288304
loot_tables: NamespacePin[LootTable] = NamespacePin(LootTable)
289305
predicates: NamespacePin[Predicate] = NamespacePin(Predicate)
290306
recipes: NamespacePin[Recipe] = NamespacePin(Recipe)
307+
trim_pattern: NamespacePin[TrimPattern] = NamespacePin(TrimPattern)
308+
trim_material: NamespacePin[TrimMaterial] = NamespacePin(TrimMaterial)
291309
structures: NamespacePin[Structure] = NamespacePin(Structure)
292310
chat_type: NamespacePin[ChatType] = NamespacePin(ChatType)
293311
damage_type: NamespacePin[DamageType] = NamespacePin(DamageType)
@@ -326,6 +344,8 @@ class DataPack(Pack[DataPackNamespace]):
326344
loot_tables: NamespaceProxyDescriptor[LootTable] = NamespaceProxyDescriptor(LootTable)
327345
predicates: NamespaceProxyDescriptor[Predicate] = NamespaceProxyDescriptor(Predicate)
328346
recipes: NamespaceProxyDescriptor[Recipe] = NamespaceProxyDescriptor(Recipe)
347+
trim_pattern: NamespaceProxyDescriptor[TrimPattern] = NamespaceProxyDescriptor(TrimPattern)
348+
trim_material: NamespaceProxyDescriptor[TrimMaterial] = NamespaceProxyDescriptor(TrimMaterial)
329349
structures: NamespaceProxyDescriptor[Structure] = NamespaceProxyDescriptor(Structure)
330350
chat_type: NamespaceProxyDescriptor[ChatType] = NamespaceProxyDescriptor(ChatType)
331351
damage_type: NamespaceProxyDescriptor[DamageType] = NamespaceProxyDescriptor(DamageType)

0 commit comments

Comments
 (0)