Fix a typo and string length

This commit is contained in:
Novatux 2014-03-02 18:20:25 +01:00
parent 0fddeea44c
commit ceaf1ac406

View File

@ -18,8 +18,9 @@ def writeU32(os, u32):
os.write(bytes((u32&0xff,))) os.write(bytes((u32&0xff,)))
def writeString(os, s): def writeString(os, s):
writeU16(os, len(s)) b = bytes(s, "utf-8")
os.write(bytes(s, "utf-8")) writeU16(os, len(b))
os.write(b)
def bytesToInt(b): def bytesToInt(b):
s = 0 s = 0
@ -89,7 +90,7 @@ class MCBlock:
self.pos = (chunkpos[0], yslice, chunkpos[1]) self.pos = (chunkpos[0], yslice, chunkpos[1])
if is_anvil: if is_anvil:
# Find the slice # Find the slice
for section in chuck["Sections"]: for section in chunk["Sections"]:
if section["Y"] == yslice: if section["Y"] == yslice:
self.from_section(section) self.from_section(section)
break break