Frame stuff is an entity, not tile entity.

This commit is contained in:
Auke Kok 2016-03-26 20:15:38 -07:00
parent 04fd08f746
commit 6ab33ce34f
2 changed files with 12 additions and 4 deletions

View File

@ -7,6 +7,7 @@ import sqlite3
from serialize import *
from itemstack import *
from tile_entities import te_convert
from entities import e_convert
class MCMap:
@ -106,6 +107,12 @@ class MCBlock:
t["x"] = self.pos[0]*16 + 15-t["x"]%16
self.tile_entities.append(t)
self.entities = []
for e in chunk["Entities"]:
t = e.copy()
self.entities.append(t)
@staticmethod
def expand_half_bytes(l):
# This function reverses x axis node order within each slice, and
@ -312,6 +319,11 @@ class MTBlock:
except:
self.metadata[(x&0xf, y&0xf, z&0xf)] = meta
for e in mcblock.entities:
id = e["id"]
f = e_convert.get(id.lower(), lambda arg: (None, None, None)) # Do nothing if not found
block, p2, meta = f(e)
def save(self):
os = BytesIO()
writeU8(os, 25) # Version

View File

@ -25,9 +25,6 @@ def escape(s):
s2 += c
return s2
def convert_frame(te):
def convert_furnace(te):
src_time = 0
src_totaltime = 0
@ -121,7 +118,6 @@ def convert_cmdblock(te):
return None, None, (fields, {})
te_convert = {"chest": convert_chest,
"ItemFrame": convert_frame,
"sign": convert_sign,
"furnace": convert_furnace,
"music": convert_nodeblock,