Skip to content

Commit

Permalink
fix: use plain list to hold commands
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Feb 25, 2021
1 parent 3713dbb commit 9b02b77
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions beet/library/data_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from copy import deepcopy
from dataclasses import dataclass
from gzip import GzipFile
from typing import MutableSequence, Optional, TypeVar
from typing import List, Optional, TypeVar

from nbtlib.contrib.minecraft import StructureFile, StructureFileData

Expand All @@ -58,23 +58,23 @@ class Advancement(JsonFile, NamespaceFile):


@dataclass(eq=False)
class Function(TextFileBase[MutableSequence[str]], NamespaceFile):
class Function(TextFileBase[List[str]], NamespaceFile):
"""Class representing a function."""

content: TextFileContent[MutableSequence[str]] = None
tags: Optional[MutableSequence[str]] = extra_field(default=None)
content: TextFileContent[List[str]] = None
tags: Optional[List[str]] = extra_field(default=None)

scope = ("functions",)
extension = ".mcfunction"

lines = FileDeserialize() # type: FileDeserialize[MutableSequence[str]]
lines = FileDeserialize() # type: FileDeserialize[List[str]]

@classmethod
def to_str(cls, content: MutableSequence[str]) -> str:
def to_str(cls, content: List[str]) -> str:
return "\n".join(content) + "\n"

@classmethod
def from_str(cls, content: str) -> MutableSequence[str]:
def from_str(cls, content: str) -> List[str]:
return content.splitlines()

def bind(self, pack: "DataPack", namespace: str, path: str):
Expand Down

0 comments on commit 9b02b77

Please sign in to comment.