diff --git a/js/io/formats/optifine_jem.js b/js/io/formats/optifine_jem.js index fd3c66fe..c90b11bc 100644 --- a/js/io/formats/optifine_jem.js +++ b/js/io/formats/optifine_jem.js @@ -383,11 +383,12 @@ BARS.defineActions(function() { }) }) -new ValidatorCheck('optifine_jem_uv', { - condition: {formats: ['optifine_entity']}, +new ValidatorCheck('zero_wide_uv_faces', { + condition: {formats: ['optifine_entity', 'java_block']}, update_triggers: ['update_selection'], run() { for (let cube of Cube.all) { + if (cube.box_uv && Format.id == 'optifine_entity') continue; let select_cube_button = { name: 'Select Cube', icon: 'fa-cube', @@ -399,25 +400,16 @@ new ValidatorCheck('optifine_jem_uv', { for (let fkey in cube.faces) { let face = cube.faces[fkey]; let uv_size = face.uv_size; - let size_issue, offset_issue; + let size_issue; for (let i of [0, 1]) { let size = uv_size[i]; - if (Math.roundTo(size, 4) && Math.abs(size) < 1) { + if (Math.abs(size) < 0.00005) { size_issue = true; } - if (Math.roundTo(face.uv[i], 4) % 1) { - offset_issue = true; - } } if (size_issue) { this.warn({ - message: `The face "${fkey}" on cube "${cube.name}" has invalid UV sizes. UV sizes with an absolute value below 1 but not 0 are invalid in OptiFine models.`, - buttons: [select_cube_button] - }) - } - if (offset_issue) { - this.warn({ - message: `The face "${fkey}" on cube "${cube.name}" has an invalid UV offset. OptiFine only supports integer values as UV offset.`, + message: `The face "${fkey}" on cube "${cube.name}" has invalid UV sizes. UV sizes cannot be 0.`, buttons: [select_cube_button] }) }