Skip to content

Commit a234758

Browse files
special handling for lava + water to force it into block shape
1 parent 40e4ffe commit a234758

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

src/model/modelFunctions.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,30 @@ export function parseModel(model, modelOptions, parsedModelList, assetRoot) {
245245

246246
export function loadAndMergeModel(model, assetRoot) {
247247
return loadModel(model.name, model.type, assetRoot)
248-
.then(modelData => mergeParents(modelData, model.name, assetRoot));
248+
.then(modelData => mergeParents(modelData, model.name, assetRoot))
249+
.then(merged => {
250+
console.debug(model.name + " merged:");
251+
console.debug(merged);
252+
if (!merged.hasOwnProperty("elements")) {
253+
if (model.name === "lava" || model.name === "water") {
254+
merged.elements = [
255+
{
256+
"from": [0, 0, 0],
257+
"to": [16, 16, 16],
258+
"faces": {
259+
"down": {"texture": "#particle", "cullface": "down"},
260+
"up": {"texture": "#particle", "cullface": "up"},
261+
"north": {"texture": "#particle", "cullface": "north"},
262+
"south": {"texture": "#particle", "cullface": "south"},
263+
"west": {"texture": "#particle", "cullface": "west"},
264+
"east": {"texture": "#particle", "cullface": "east"}
265+
}
266+
}
267+
]
268+
}
269+
}
270+
return merged;
271+
})
249272
}
250273

251274

0 commit comments

Comments
 (0)