File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 11import minecraft_data
22# Java edition minecraft-data
3- mcd = minecraft_data ("1.13 " )
3+ mcd = minecraft_data ("1.21.3 " )
44
55print (mcd .version )
66
1414print (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
1919print (mcd_pe .version )
2020print (mcd_pe .find_item_or_block ('stone' ))
Original file line number Diff line number Diff line change 44
55
66def 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
You can’t perform that action at this time.
0 commit comments