mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-15 06:45:04 +01:00
Fix typo and formatting in SceneEntityLoader
This commit is contained in:
@@ -130,7 +130,7 @@ public class Scene {
|
|||||||
if (group.getPropList() != null && group.getPropList().size() > 0) {
|
if (group.getPropList() != null && group.getPropList().size() > 0) {
|
||||||
for (PropInfo propInfo : group.getPropList()) {
|
for (PropInfo propInfo : group.getPropList()) {
|
||||||
try {
|
try {
|
||||||
EntityProp prop = this.getEntityLoader().loadNpc(this, group, propInfo);
|
EntityProp prop = this.getEntityLoader().loadProp(this, group, propInfo);
|
||||||
this.addEntity(prop);
|
this.addEntity(prop);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// Ignored
|
// Ignored
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class SceneEntityLoader {
|
|||||||
NpcMonsterExcel npcMonsterExcel = GameData.getNpcMonsterExcelMap().get(monsterInfo.getNPCMonsterID());
|
NpcMonsterExcel npcMonsterExcel = GameData.getNpcMonsterExcelMap().get(monsterInfo.getNPCMonsterID());
|
||||||
if (npcMonsterExcel == null) return null;
|
if (npcMonsterExcel == null) return null;
|
||||||
|
|
||||||
// Create monster with excels
|
// Create monster from group monster info
|
||||||
EntityMonster monster = new EntityMonster(scene, npcMonsterExcel, monsterInfo.getPos());
|
EntityMonster monster = new EntityMonster(scene, npcMonsterExcel, monsterInfo.getPos());
|
||||||
monster.getRot().set(monsterInfo.getRot());
|
monster.getRot().set(monsterInfo.getRot());
|
||||||
monster.setGroupId(group.getId());
|
monster.setGroupId(group.getId());
|
||||||
@@ -35,23 +35,21 @@ public class SceneEntityLoader {
|
|||||||
return monster;
|
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
|
// Don't spawn entity if they have the IsDelete flag in group info
|
||||||
if (propInfo.isIsDelete()) return null;
|
if (propInfo.isIsDelete()) return null;
|
||||||
|
|
||||||
// Get prop excel
|
// Get prop excel to make sure prop exists
|
||||||
PropExcel propExcel = GameData.getPropExcelMap().get(propInfo.getPropID());
|
PropExcel propExcel = GameData.getPropExcelMap().get(propInfo.getPropID());
|
||||||
if (propExcel == null) {
|
if (propExcel == null) return null;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create prop from prop info
|
// Create prop from group prop info
|
||||||
EntityProp prop = new EntityProp(scene, propExcel, propInfo.getPos());
|
EntityProp prop = new EntityProp(scene, propExcel, propInfo.getPos());
|
||||||
prop.setState(propInfo.getState());
|
|
||||||
prop.getRot().set(propInfo.getRot());
|
prop.getRot().set(propInfo.getRot());
|
||||||
prop.setInstId(propInfo.getID());
|
|
||||||
prop.setGroupId(group.getId());
|
|
||||||
prop.setPropInfo(propInfo);
|
prop.setPropInfo(propInfo);
|
||||||
|
prop.setGroupId(group.getId());
|
||||||
|
prop.setInstId(propInfo.getID());
|
||||||
|
prop.setState(propInfo.getState());
|
||||||
|
|
||||||
// Cache
|
// Cache
|
||||||
if (prop.getPropId() == 1003) {
|
if (prop.getPropId() == 1003) {
|
||||||
@@ -92,7 +90,7 @@ public class SceneEntityLoader {
|
|||||||
}
|
}
|
||||||
if (haseDuplicateNpcId) return null;
|
if (haseDuplicateNpcId) return null;
|
||||||
|
|
||||||
// Create npc from npc info
|
// Create npc from group npc info
|
||||||
EntityNpc npc = new EntityNpc(scene, npcInfo.getNPCID(), npcInfo.getPos());
|
EntityNpc npc = new EntityNpc(scene, npcInfo.getNPCID(), npcInfo.getPos());
|
||||||
npc.getRot().set(npcInfo.getRot());
|
npc.getRot().set(npcInfo.getRot());
|
||||||
npc.setInstId(npcInfo.getID());
|
npc.setInstId(npcInfo.getID());
|
||||||
|
|||||||
Reference in New Issue
Block a user