Skip to content

Commit c7f53c5

Browse files
ref: exceptions
1 parent 5221d5b commit c7f53c5

4 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/main/java/cam72cam/mod/model/common/material/Material.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package cam72cam.mod.model.common.material;
22

3+
import cam72cam.mod.ModCore;
34
import cam72cam.mod.model.common.mesh.IModelBuilder;
45
import cam72cam.mod.resource.Identifier;
56
import org.apache.commons.io.FilenameUtils;
@@ -59,7 +60,7 @@ public void populateSize() {
5960
}
6061
}
6162
} catch (Exception ignored) {
62-
//Unable to load
63+
ModCore.warn("Unable to populate texture at %s, do you have a broken pack? This material is set to default size of 32!", relative);
6364
}
6465
}
6566
}

src/main/java/cam72cam/mod/model/common/material/TextureRepacker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121

2222
/* primer: https://codeincomplete.com/articles/bin-packing/ */
2323
public class TextureRepacker {
24+
//ARGB
2425
private static final int normalFallback;
2526
private static final int specularFallback;
26-
//ARGB
2727
private static final int albedoFallback;
2828

2929
private int width = 0;

src/main/java/cam72cam/mod/model/common/mesh/SimpleModelBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ public class SimpleFaceBuilder implements IFaceBuilder {
391391
@Override
392392
public IFaceBuilder addVert(int posIdx, int uvIdx, int normalIdx) {
393393
if (posIdx == -1) {
394-
throw new IllegalArgumentException("Unable to read model geometry data because vertex position is invalid!");
394+
throw new MalformedModelException("Unable to read model geometry data because vertex position is invalid!");
395395
} else if (normalIdx == -1) {
396396
SimpleModelBuilder.this.hasNormal = false;
397397
}

src/test/java/cam72cam/mod/model/common/OBJParserTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public void nanUvThrows() throws Exception {
238238
"f 1/1 2/1 3/1\n"));
239239
}
240240

241-
@Test(expected = IllegalArgumentException.class)
241+
@Test(expected = MalformedModelException.class)
242242
public void missingPositionThrows() throws Exception {
243243
ModelLoader.load(obj(defaultPos() +
244244
"vn 0 0 1\n" +

0 commit comments

Comments
 (0)