Fix broken multipart models
This commit is contained in:
parent
d6ae0040b1
commit
fd0e8dafa7
@ -473,7 +473,7 @@ cdef class BlockModels(object):
|
|||||||
if varVal is None:
|
if varVal is None:
|
||||||
ok = False
|
ok = False
|
||||||
|
|
||||||
if str(varVal) != val:
|
if str(varVal).lower() != str(val).lower():
|
||||||
# Gross, values in multipart may be raw values but values in resourceVariant are strings...
|
# Gross, values in multipart may be raw values but values in resourceVariant are strings...
|
||||||
ok = False
|
ok = False
|
||||||
|
|
||||||
@ -509,8 +509,11 @@ cdef class BlockModels(object):
|
|||||||
if ok:
|
if ok:
|
||||||
apply = part.get('apply')
|
apply = part.get('apply')
|
||||||
if apply is not None:
|
if apply is not None:
|
||||||
|
if not isinstance(apply, list):
|
||||||
|
apply = [apply]
|
||||||
|
|
||||||
for model in apply:
|
for model in apply:
|
||||||
modelName = apply.get('model')
|
modelName = model.get('model')
|
||||||
if modelName is None:
|
if modelName is None:
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
@ -522,8 +525,8 @@ cdef class BlockModels(object):
|
|||||||
log.exception("Error parsing json for block/%s: %s", modelName, e)
|
log.exception("Error parsing json for block/%s: %s", modelName, e)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
variantXrot = apply.get('x', 0)
|
variantXrot = model.get('x', 0)
|
||||||
variantYrot = apply.get('y', 0)
|
variantYrot = model.get('y', 0)
|
||||||
ret.append((modelDict, variantXrot, variantYrot))
|
ret.append((modelDict, variantXrot, variantYrot))
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
@ -301,11 +301,11 @@ class BlockModelMesh(object):
|
|||||||
nID = areaBlocks[y, z+dz, x+dx]
|
nID = areaBlocks[y, z+dz, x+dx]
|
||||||
props[direction] = ("true"
|
props[direction] = ("true"
|
||||||
if opaqueCube[nID]
|
if opaqueCube[nID]
|
||||||
or paneID and nID == paneID
|
or (paneID and nID == paneID)
|
||||||
or barsID and nID == barsID
|
or (barsID and nID == barsID)
|
||||||
or stainedGlassPaneID and nID == stainedGlassPaneID
|
or (stainedGlassPaneID and nID == stainedGlassPaneID)
|
||||||
or glassID and nID == glassID
|
or (glassID and nID == glassID)
|
||||||
or stainedGlassID and nID == stainedGlassID
|
or (stainedGlassID and nID == stainedGlassID)
|
||||||
else "false")
|
else "false")
|
||||||
actualState = blocktypes.namesByID[ID], combineProps(props)
|
actualState = blocktypes.namesByID[ID], combineProps(props)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user