From 97870d0b10c83d6473cc3cd8b88d868471c8c104 Mon Sep 17 00:00:00 2001 From: alemi Date: Fri, 17 Mar 2023 10:35:59 +0100 Subject: [PATCH] fix: more lenient str parsing for dimensions --- aiocraft/mc/definitions.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/aiocraft/mc/definitions.py b/aiocraft/mc/definitions.py index bfc752d..2d6b18b 100644 --- a/aiocraft/mc/definitions.py +++ b/aiocraft/mc/definitions.py @@ -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