Skip to content

Commit 609b0d9

Browse files
committed
fix: UV size
1 parent d3c3829 commit 609b0d9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

api/src/main/java/kr/toxicity/model/api/data/blueprint/BlueprintTexture.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,21 @@ public boolean canBeRendered() {
9393
return BetterModel.config().namespace() + ":item/" + packName(obfuscator, parentName);
9494
}
9595

96+
/**
97+
* Checks this textures has UV size
98+
* @return has UV size
99+
*/
100+
public boolean hasUVSize() {
101+
return uvWidth > 0 && uvHeight > 0;
102+
}
103+
96104
/**
97105
* Gets model resolution
98106
* @param resolution parent resolution
99107
* @return resolution
100108
*/
101109
public @NotNull ModelResolution resolution(@NotNull ModelResolution resolution) {
102-
return resolution.width() == image.getWidth() && resolution.height() == image.getHeight() ? new ModelResolution(image.getWidth(), image.getHeight()) : new ModelResolution(uvWidth, uvHeight);
110+
if (!hasUVSize()) return resolution;
111+
return resolution.width() == image.getWidth() && resolution.height() == image.getHeight() ? resolution : new ModelResolution(uvWidth, uvHeight);
103112
}
104113
}

0 commit comments

Comments
 (0)