diff --git a/com.b3dgs.lionheart.editor/src/com/b3dgs/lionheart/editor/stage/StageSaveHandler.java b/com.b3dgs.lionheart.editor/src/com/b3dgs/lionheart/editor/stage/StageSaveHandler.java index 9d870710e..4e65d46a7 100644 --- a/com.b3dgs.lionheart.editor/src/com/b3dgs/lionheart/editor/stage/StageSaveHandler.java +++ b/com.b3dgs.lionheart.editor/src/com/b3dgs/lionheart/editor/stage/StageSaveHandler.java @@ -87,9 +87,9 @@ private static Xml saveFeaturable(Featurable featurable) final Xml root = new Xml(EntityConfig.NODE_ENTITY); featurable.getFeatures().forEach(feature -> { - if (feature instanceof XmlSaver) + if (feature instanceof final XmlSaver saver) { - ((XmlSaver) feature).save(root); + saver.save(root); } }); return root; diff --git a/lionheart-game/src/main/java/com/b3dgs/lionheart/Util.java b/lionheart-game/src/main/java/com/b3dgs/lionheart/Util.java index 25dd65393..886d288f1 100644 --- a/lionheart-game/src/main/java/com/b3dgs/lionheart/Util.java +++ b/lionheart-game/src/main/java/com/b3dgs/lionheart/Util.java @@ -302,9 +302,9 @@ public static void loadEntityFeature(Featurable entity, EntityConfig config) { entity.getFeatures().forEach(feature -> { - if (feature instanceof XmlLoader) + if (feature instanceof final XmlLoader loader) { - ((XmlLoader) feature).load(config.getRoot()); + loader.load(config.getRoot()); } }); } diff --git a/lionheart-game/src/main/java/com/b3dgs/lionheart/World.java b/lionheart-game/src/main/java/com/b3dgs/lionheart/World.java index 19e3ff568..77cbeec94 100644 --- a/lionheart-game/src/main/java/com/b3dgs/lionheart/World.java +++ b/lionheart-game/src/main/java/com/b3dgs/lionheart/World.java @@ -1307,9 +1307,9 @@ private void saveSnapshotables(FileWriting file) throws IOException file.writeString(featurable.getMedia().getPath()); for (final Feature feature : featurable.getFeatures()) { - if (feature instanceof Snapshotable) + if (feature instanceof final Snapshotable snapshotable) { - ((Snapshotable) feature).save(file); + snapshotable.save(file); } } } @@ -1369,9 +1369,9 @@ private void loadSnapshotable(FileReading file) throws IOException } for (final Feature feature : featurable.getFeatures()) { - if (feature instanceof Snapshotable) + if (feature instanceof final Snapshotable snapshotable) { - ((Snapshotable) feature).load(file); + snapshotable.load(file); } } handler.add(featurable); diff --git a/lionheart-pc/pom.xml b/lionheart-pc/pom.xml index 14e18830a..a8aee2214 100644 --- a/lionheart-pc/pom.xml +++ b/lionheart-pc/pom.xml @@ -16,6 +16,7 @@ 5.14.0 1.0.4 true + 2.22.0 @@ -33,6 +34,21 @@ + + org.apache.logging.log4j + log4j-api + ${log4j2.version} + + + org.apache.logging.log4j + log4j-core + ${log4j2.version} + + + org.apache.logging.log4j + log4j-slf4j2-impl + ${log4j2.version} + com.b3dgs.lionengine lionengine-core-awt