Skip to content

Commit 81e3cd4

Browse files
authored
chore: update submodule (#28)
Also fix unicode decode bugs Fixes #27, #25
1 parent b770ad2 commit 81e3cd4

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import minecraft_data
22
# Java edition minecraft-data
3-
mcd = minecraft_data("1.13")
3+
mcd = minecraft_data("1.21.3")
44

55
print(mcd.version)
66

@@ -14,7 +14,7 @@
1414
print(mcd.effects_name['Haste'])
1515

1616
# Bedrock Edition minecraft-data
17-
mcd_pe = minecraft_data("1.0", "bedrock")
17+
mcd_pe = minecraft_data("1.21.70", "bedrock")
1818

1919
print(mcd_pe.version)
2020
print(mcd_pe.find_item_or_block('stone'))

minecraft_data/data

Submodule data updated 552 files

minecraft_data/tools.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
def convert(_dir, version, edition ='pc'):
7-
with open(os.path.join(_dir, 'dataPaths.json')) as f:
7+
with open(os.path.join(_dir, 'dataPaths.json'), encoding="utf-8") as f:
88
datapaths = json.load(f)
99
data = _grabdata(_dir, datapaths[edition][version])
1010
ret = {}
@@ -49,7 +49,7 @@ def commondata(_dir, edition = 'pc'):
4949
common_path = os.path.join(_dir, edition, 'common')
5050
for common_file in os.listdir(common_path):
5151
key = common_file.split('.', 1)[0]
52-
with open(os.path.join(common_path, common_file)) as f:
52+
with open(os.path.join(common_path, common_file), encoding="utf-8") as f:
5353
data = json.load(f)
5454
ret.update({key: data})
5555
return ret
@@ -60,7 +60,7 @@ def _grabdata(_dir, datapaths):
6060
for category, folder in datapaths.items():
6161
path = os.path.join(_dir, folder, f'{category}.json')
6262
if os.path.isfile(path):
63-
with open(path) as fp:
63+
with open(path, encoding="utf-8") as fp:
6464
data[category] = json.load(fp)
6565
return data
6666

0 commit comments

Comments
 (0)