From 43114811857458090428d5ce756f530e828f558c Mon Sep 17 00:00:00 2001 From: Melledy <121644117+Melledy@users.noreply.github.com> Date: Wed, 25 Oct 2023 09:10:45 -0700 Subject: [PATCH] Fix typo and formatting in `SceneEntityLoader` --- .../java/emu/lunarcore/game/scene/Scene.java | 2 +- .../game/scene/SceneEntityLoader.java | 20 +++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/main/java/emu/lunarcore/game/scene/Scene.java b/src/main/java/emu/lunarcore/game/scene/Scene.java index 8ccdc97..67eaaf1 100644 --- a/src/main/java/emu/lunarcore/game/scene/Scene.java +++ b/src/main/java/emu/lunarcore/game/scene/Scene.java @@ -130,7 +130,7 @@ public class Scene { if (group.getPropList() != null && group.getPropList().size() > 0) { for (PropInfo propInfo : group.getPropList()) { try { - EntityProp prop = this.getEntityLoader().loadNpc(this, group, propInfo); + EntityProp prop = this.getEntityLoader().loadProp(this, group, propInfo); this.addEntity(prop); } catch (Exception e) { // Ignored diff --git a/src/main/java/emu/lunarcore/game/scene/SceneEntityLoader.java b/src/main/java/emu/lunarcore/game/scene/SceneEntityLoader.java index 119c331..20ec2d2 100644 --- a/src/main/java/emu/lunarcore/game/scene/SceneEntityLoader.java +++ b/src/main/java/emu/lunarcore/game/scene/SceneEntityLoader.java @@ -24,7 +24,7 @@ public class SceneEntityLoader { NpcMonsterExcel npcMonsterExcel = GameData.getNpcMonsterExcelMap().get(monsterInfo.getNPCMonsterID()); if (npcMonsterExcel == null) return null; - // Create monster with excels + // Create monster from group monster info EntityMonster monster = new EntityMonster(scene, npcMonsterExcel, monsterInfo.getPos()); monster.getRot().set(monsterInfo.getRot()); monster.setGroupId(group.getId()); @@ -35,23 +35,21 @@ public class SceneEntityLoader { return monster; } - public EntityProp loadNpc(Scene scene, GroupInfo group, PropInfo propInfo) { + public EntityProp loadProp(Scene scene, GroupInfo group, PropInfo propInfo) { // Don't spawn entity if they have the IsDelete flag in group info if (propInfo.isIsDelete()) return null; - // Get prop excel + // Get prop excel to make sure prop exists PropExcel propExcel = GameData.getPropExcelMap().get(propInfo.getPropID()); - if (propExcel == null) { - return null; - } + if (propExcel == null) return null; - // Create prop from prop info + // Create prop from group prop info EntityProp prop = new EntityProp(scene, propExcel, propInfo.getPos()); - prop.setState(propInfo.getState()); prop.getRot().set(propInfo.getRot()); - prop.setInstId(propInfo.getID()); - prop.setGroupId(group.getId()); prop.setPropInfo(propInfo); + prop.setGroupId(group.getId()); + prop.setInstId(propInfo.getID()); + prop.setState(propInfo.getState()); // Cache if (prop.getPropId() == 1003) { @@ -92,7 +90,7 @@ public class SceneEntityLoader { } if (haseDuplicateNpcId) return null; - // Create npc from npc info + // Create npc from group npc info EntityNpc npc = new EntityNpc(scene, npcInfo.getNPCID(), npcInfo.getPos()); npc.getRot().set(npcInfo.getRot()); npc.setInstId(npcInfo.getID());