Skip to content

Commit 4f5f8c1

Browse files
committed
Add more versatile logging for when source texture fails to parse
1 parent 64d4fae commit 4f5f8c1

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/main/java/btw/lowercase/optiboxes/skybox/SkyboxParser.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,13 @@ private SkyboxParser() {
3030
public static @Nullable JsonObject parseSkyProperties(Properties properties, Identifier propertiesIdentifier) {
3131
JsonObject output = new JsonObject();
3232

33-
Optional<Identifier> sourceTexture = Optional.ofNullable(parseSourceTexture(properties.getProperty("source", null), propertiesIdentifier));
34-
if (sourceTexture.isEmpty() && OptiBoxesClient.getConfig().ignoreBrokenSkies.isEnabled()) {
35-
return null;
33+
final String source = properties.getProperty("source", null);
34+
Optional<Identifier> sourceTexture = Optional.ofNullable(parseSourceTexture(source, propertiesIdentifier));
35+
if (sourceTexture.isEmpty()) {
36+
LOGGER.warn("Failed to load source texture \"{}\"", source);
37+
if (OptiBoxesClient.getConfig().ignoreBrokenSkies.isEnabled()) {
38+
return null;
39+
}
3640
}
3741

3842
output.addProperty("source", sourceTexture.orElse(MissingTextureAtlasSprite.getLocation()).toString());
@@ -178,6 +182,7 @@ private SkyboxParser() {
178182
namespace = location.getNamespace();
179183
path = location.getPath();
180184
} else {
185+
LOGGER.error("Failed to read location of source as resource location");
181186
return null;
182187
}
183188
}
@@ -186,7 +191,7 @@ private SkyboxParser() {
186191

187192
try {
188193
textureId = Identifier.fromNamespaceAndPath(namespace, path);
189-
} catch (IdentifierException e) {
194+
} catch (IdentifierException ignored) {
190195
LOGGER.error("Failed to read texture path '{}:{}' as resource location", namespace, path);
191196
return null;
192197
}

0 commit comments

Comments
 (0)