Rename and clean up MapleMonsterInformationProvider
This commit is contained in:
@@ -36,7 +36,7 @@ import provider.*;
|
||||
import provider.wz.WZFiles;
|
||||
import server.MakerItemFactory.MakerItemCreateEntry;
|
||||
import server.life.LifeFactory;
|
||||
import server.life.MapleMonsterInformationProvider;
|
||||
import server.life.MonsterInformationProvider;
|
||||
import tools.*;
|
||||
|
||||
import java.sql.Connection;
|
||||
@@ -2059,7 +2059,7 @@ public class MapleItemInformationProvider {
|
||||
|
||||
try (ResultSet rs = ps.executeQuery()) {
|
||||
while (rs.next()) {
|
||||
String resultName = MapleMonsterInformationProvider.getInstance().getMobNameFromId(rs.getInt("dropperid"));
|
||||
String resultName = MonsterInformationProvider.getInstance().getMobNameFromId(rs.getInt("dropperid"));
|
||||
if (!resultName.isEmpty()) {
|
||||
list.add(resultName);
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class LifeFactory {
|
||||
|
||||
private static void setMonsterAttackInfo(int mid, List<MobAttackInfoHolder> attackInfos) {
|
||||
if (!attackInfos.isEmpty()) {
|
||||
MapleMonsterInformationProvider mi = MapleMonsterInformationProvider.getInstance();
|
||||
MonsterInformationProvider mi = MonsterInformationProvider.getInstance();
|
||||
|
||||
for (MobAttackInfoHolder attackInfo : attackInfos) {
|
||||
mi.setMobAttackInfo(mid, attackInfo.attackPos, attackInfo.mpCon, attackInfo.coolTime);
|
||||
@@ -181,7 +181,7 @@ public class LifeFactory {
|
||||
}
|
||||
decodeElementalString(stats, DataTool.getString("elemAttr", monsterInfoData, ""));
|
||||
|
||||
MapleMonsterInformationProvider mi = MapleMonsterInformationProvider.getInstance();
|
||||
MonsterInformationProvider mi = MonsterInformationProvider.getInstance();
|
||||
Data monsterSkillInfoData = monsterInfoData.getChildByPath("skill");
|
||||
if (monsterSkillInfoData != null) {
|
||||
int i = 0;
|
||||
|
||||
@@ -314,9 +314,9 @@ public class Monster extends AbstractLoadedLife {
|
||||
long animationTime;
|
||||
|
||||
if (skill == null) {
|
||||
animationTime = MapleMonsterInformationProvider.getInstance().getMobAttackAnimationTime(this.getId(), attackPos);
|
||||
animationTime = MonsterInformationProvider.getInstance().getMobAttackAnimationTime(this.getId(), attackPos);
|
||||
} else {
|
||||
animationTime = MapleMonsterInformationProvider.getInstance().getMobSkillAnimationTime(skill);
|
||||
animationTime = MonsterInformationProvider.getInstance().getMobSkillAnimationTime(skill);
|
||||
}
|
||||
|
||||
if (animationTime > 0) {
|
||||
@@ -738,7 +738,7 @@ public class Monster extends AbstractLoadedLife {
|
||||
|
||||
public List<MonsterDropEntry> retrieveRelevantDrops() {
|
||||
if (this.getStats().isFriendly()) { // thanks Conrad for noticing friendly mobs not spawning loots after a recent update
|
||||
return MapleMonsterInformationProvider.getInstance().retrieveEffectiveDrop(this.getId());
|
||||
return MonsterInformationProvider.getInstance().retrieveEffectiveDrop(this.getId());
|
||||
}
|
||||
|
||||
Map<Integer, Character> pchars = map.getMapAllPlayers();
|
||||
@@ -1542,7 +1542,7 @@ public class Monster extends AbstractLoadedLife {
|
||||
}
|
||||
*/
|
||||
|
||||
Pair<Integer, Integer> attackInfo = MapleMonsterInformationProvider.getInstance().getMobAttackInfo(this.getId(), attackPos);
|
||||
Pair<Integer, Integer> attackInfo = MonsterInformationProvider.getInstance().getMobAttackInfo(this.getId(), attackPos);
|
||||
if (attackInfo == null) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -38,12 +38,12 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
|
||||
public class MapleMonsterInformationProvider {
|
||||
public class MonsterInformationProvider {
|
||||
// Author : LightPepsi
|
||||
|
||||
private static final MapleMonsterInformationProvider instance = new MapleMonsterInformationProvider();
|
||||
private static final MonsterInformationProvider instance = new MonsterInformationProvider();
|
||||
|
||||
public static MapleMonsterInformationProvider getInstance() {
|
||||
public static MonsterInformationProvider getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class MapleMonsterInformationProvider {
|
||||
private final Map<Integer, Boolean> mobBossCache = new HashMap<>();
|
||||
private final Map<Integer, String> mobNameCache = new HashMap<>();
|
||||
|
||||
protected MapleMonsterInformationProvider() {
|
||||
protected MonsterInformationProvider() {
|
||||
retrieveGlobal();
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ public class MapleMonsterInformationProvider {
|
||||
if (mobName == null) {
|
||||
DataProvider dataProvider = DataProviderFactory.getDataProvider(WZFiles.STRING);
|
||||
Data mobData = dataProvider.getData("Mob.img");
|
||||
|
||||
|
||||
mobName = DataTool.getString(mobData.getChildByPath(id + "/name"), "");
|
||||
mobNameCache.put(id, mobName);
|
||||
}
|
||||
@@ -20,8 +20,8 @@
|
||||
package server.loot;
|
||||
|
||||
import client.Character;
|
||||
import server.life.MapleMonsterInformationProvider;
|
||||
import server.life.MonsterDropEntry;
|
||||
import server.life.MonsterInformationProvider;
|
||||
import server.quest.MapleQuest;
|
||||
|
||||
import java.util.LinkedList;
|
||||
@@ -74,7 +74,7 @@ public class MapleLootManager {
|
||||
}
|
||||
|
||||
public static List<MonsterDropEntry> retrieveRelevantDrops(int monsterId, List<Character> players) {
|
||||
List<MonsterDropEntry> loots = MapleMonsterInformationProvider.getInstance().retrieveEffectiveDrop(monsterId);
|
||||
List<MonsterDropEntry> loots = MonsterInformationProvider.getInstance().retrieveEffectiveDrop(monsterId);
|
||||
if(loots.isEmpty()) return loots;
|
||||
|
||||
List<MapleLootInventory> playersInv = new LinkedList<>();
|
||||
|
||||
@@ -721,7 +721,7 @@ public class MapleMap {
|
||||
chRate = 1;
|
||||
}
|
||||
|
||||
final MapleMonsterInformationProvider mi = MapleMonsterInformationProvider.getInstance();
|
||||
final MonsterInformationProvider mi = MonsterInformationProvider.getInstance();
|
||||
final List<MonsterGlobalDropEntry> globalEntry = mi.getRelevantGlobalDrops(this.getId());
|
||||
|
||||
final List<MonsterDropEntry> dropEntry = new ArrayList<>();
|
||||
@@ -2793,7 +2793,7 @@ public class MapleMap {
|
||||
}
|
||||
if (monster.isBoss()) {
|
||||
if (unclaimOwnership() != null) {
|
||||
String mobName = MapleMonsterInformationProvider.getInstance().getMobNameFromId(monster.getId());
|
||||
String mobName = MonsterInformationProvider.getInstance().getMobNameFromId(monster.getId());
|
||||
if (mobName != null) {
|
||||
mobName = mobName.trim();
|
||||
this.dropMessage(5, "This lawn has been taken siege by " + mobName + "'s forces and will be kept hold until their defeat.");
|
||||
|
||||
Reference in New Issue
Block a user