Skip to content

Commit 757ecdf

Browse files
stuff
1 parent b007a31 commit 757ecdf

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/model/modelConverter.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ function parseSchematicData(data, idToNameMap) {
229229

230230
let convertLegacy = function (id, data) {
231231
let mapped = idToNameMap.blocks[id + ":" + data];
232+
if (!mapped) {
233+
// try to bypass data
234+
mapped = idToNameMap.blocks[id + ":" + 0];
235+
}
232236
if (!mapped) {
233237
console.warn("Missing legacy mapping for " + id + ":" + data);
234238
return "minecraft:air";

src/model/modelFunctions.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ export function parseModel(model, modelOptions, parsedModelList, assetRoot) {
7070
let variant = blockstate.variants[variantKey];
7171
if (!variant) {
7272
console.warn("Missing variant for " + model.blockstate + ": " + model.variant);
73-
resolve(null);
74-
return;
73+
variant = blockstate.variants[Object.keys(blockstate.variants)[0]];
7574
}
7675

7776
let variants = [];
@@ -394,11 +393,16 @@ export function loadTextures(textureNames, assetRoot) {
394393
continue;
395394
}
396395
filteredNames.push(name);
397-
promises.push(loadTextureAsBase64(assetRoot, "minecraft", "/", texture));
396+
promises.push(loadTextureAsBase64(assetRoot, "minecraft", "/", texture).catch(err => {
397+
console.warn("Failed to load texture " + texture);
398+
console.warn(err);
399+
return undefined;
400+
}));
398401
}
399402
Promise.all(promises).then((textures) => {
400403
let mappedTextures = {};
401404
for (let i = 0; i < textures.length; i++) {
405+
if (!textures[i]) continue;
402406
mappedTextures[filteredNames[i]] = textures[i];
403407
}
404408

0 commit comments

Comments
 (0)