fix: more lenient str parsing for dimensions
This commit is contained in:
parent
f0be394458
commit
97870d0b10
1 changed files with 4 additions and 3 deletions
|
@ -21,11 +21,12 @@ class Dimension(Enum):
|
|||
|
||||
@classmethod
|
||||
def from_str(cls, txt:str) -> 'Dimension':
|
||||
if txt == 'minecraft:overworld':
|
||||
txt = txt.lower().replace('minecraft:', '')
|
||||
if txt == 'overworld':
|
||||
return Dimension.OVERWORLD
|
||||
if txt == 'minecraft:the_nether':
|
||||
if txt == 'the_nether':
|
||||
return Dimension.NETHER
|
||||
if txt == 'minecraft:the_end':
|
||||
if txt == 'the_end':
|
||||
return Dimension.END
|
||||
return Dimension.UNKNOWN
|
||||
|
||||
|
|
Loading…
Reference in a new issue