- * Event handling is a callback feature -- once {@link GameLoop#addEventHandler(EventHandler, Class) added}, it allows you to
+ * Event handling is a callback feature -- once {@link GameLoop#addEventHandler(Class, EventHandler) added}, it allows you to
* {@link #handleEvents(List, Queue) handle} events and observers of the registered types {@code T} and {@code V}.
*
* @param
- * Event observing is a callback feature -- once {@link GameLoop#addEventObserver(EventObserver, Class) added}, it allows you to
+ * Event observing is a callback feature -- once {@link GameLoop#addEventObserver(Class, EventObserver) added}, it allows you to
* {@link #eventReceived(Event) receive} events of the registered type {@code T}.
*
* @param
+ * This method does not account for file extensions with more than one dot ({@code .}) -- in cases like those, only the last part
+ * of the extension will be returned.
+ *
+ * For paths which contain no file extension, an empty {@code String} will be returned.
+ *
+ * @param filePath The {@code Path} to get the file extension of.
+ * @return The {@code Path}'s file extension.
+ */
+ public static String getFileExtension(String filePath) {
+ if (filePath.contains(".")) {
+ return filePath.substring(filePath.lastIndexOf(".") + 1);
}
return "";
}
diff --git a/src/main/java/tech/fastj/resources/models/MtlUtil.java b/src/main/java/tech/fastj/resources/models/MtlUtil.java
index b0780e1c..c2e45cac 100644
--- a/src/main/java/tech/fastj/resources/models/MtlUtil.java
+++ b/src/main/java/tech/fastj/resources/models/MtlUtil.java
@@ -78,7 +78,8 @@ public static void parse(Polygon2D polygon, Path materialPath, String materialNa
case ParsingKeys.NewMaterial -> {
return;
}
- case ParsingKeys.DiffuseColor, ParsingKeys.SpecularColor, ParsingKeys.SpecularExponent, ParsingKeys.Empty -> {
+ case ParsingKeys.DiffuseColor, ParsingKeys.SpecularColor, ParsingKeys.SpecularExponent, ParsingKeys.IlluminationMode,
+ ParsingKeys.Empty -> {
}
default -> Log.warn(ObjUtil.class, "Unused parsing key: \"{}\"", tokens[0]);
}
diff --git a/src/main/java/tech/fastj/resources/models/ObjUtil.java b/src/main/java/tech/fastj/resources/models/ObjUtil.java
index 7cf263f1..ac8e3926 100644
--- a/src/main/java/tech/fastj/resources/models/ObjUtil.java
+++ b/src/main/java/tech/fastj/resources/models/ObjUtil.java
@@ -87,7 +87,8 @@ public static Polygon2D[] parse(Path modelPath, List