cleanup: remove unnecessary conversion to String
This commit is contained in:
@@ -21,71 +21,15 @@
|
|||||||
*/
|
*/
|
||||||
package client;
|
package client;
|
||||||
|
|
||||||
import constants.skills.Aran;
|
import constants.skills.*;
|
||||||
import constants.skills.Archer;
|
import provider.*;
|
||||||
import constants.skills.Assassin;
|
import server.MapleStatEffect;
|
||||||
import constants.skills.Bandit;
|
import server.life.Element;
|
||||||
import constants.skills.Beginner;
|
|
||||||
import constants.skills.Bishop;
|
|
||||||
import constants.skills.BlazeWizard;
|
|
||||||
import constants.skills.Bowmaster;
|
|
||||||
import constants.skills.Buccaneer;
|
|
||||||
import constants.skills.ChiefBandit;
|
|
||||||
import constants.skills.Cleric;
|
|
||||||
import constants.skills.Corsair;
|
|
||||||
import constants.skills.Crossbowman;
|
|
||||||
import constants.skills.Crusader;
|
|
||||||
import constants.skills.DarkKnight;
|
|
||||||
import constants.skills.DawnWarrior;
|
|
||||||
import constants.skills.DragonKnight;
|
|
||||||
import constants.skills.Evan;
|
|
||||||
import constants.skills.FPArchMage;
|
|
||||||
import constants.skills.FPMage;
|
|
||||||
import constants.skills.FPWizard;
|
|
||||||
import constants.skills.Fighter;
|
|
||||||
import constants.skills.GM;
|
|
||||||
import constants.skills.Gunslinger;
|
|
||||||
import constants.skills.Hermit;
|
|
||||||
import constants.skills.Hero;
|
|
||||||
import constants.skills.Hunter;
|
|
||||||
import constants.skills.ILArchMage;
|
|
||||||
import constants.skills.ILMage;
|
|
||||||
import constants.skills.ILWizard;
|
|
||||||
import constants.skills.Legend;
|
|
||||||
import constants.skills.Magician;
|
|
||||||
import constants.skills.Marauder;
|
|
||||||
import constants.skills.Marksman;
|
|
||||||
import constants.skills.NightLord;
|
|
||||||
import constants.skills.NightWalker;
|
|
||||||
import constants.skills.Noblesse;
|
|
||||||
import constants.skills.Page;
|
|
||||||
import constants.skills.Paladin;
|
|
||||||
import constants.skills.Pirate;
|
|
||||||
import constants.skills.Priest;
|
|
||||||
import constants.skills.Ranger;
|
|
||||||
import constants.skills.Rogue;
|
|
||||||
import constants.skills.Shadower;
|
|
||||||
import constants.skills.Sniper;
|
|
||||||
import constants.skills.Spearman;
|
|
||||||
import constants.skills.SuperGM;
|
|
||||||
import constants.skills.Warrior;
|
|
||||||
import constants.skills.ThunderBreaker;
|
|
||||||
import constants.skills.WhiteKnight;
|
|
||||||
import constants.skills.WindArcher;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import provider.MapleData;
|
|
||||||
import provider.MapleDataDirectoryEntry;
|
|
||||||
import provider.MapleDataFileEntry;
|
|
||||||
import provider.MapleDataProvider;
|
|
||||||
import provider.MapleDataProviderFactory;
|
|
||||||
import provider.MapleDataTool;
|
|
||||||
import server.MapleStatEffect;
|
|
||||||
import server.life.Element;
|
|
||||||
|
|
||||||
public class SkillFactory {
|
public class SkillFactory {
|
||||||
private static Map<Integer, Skill> skills = new HashMap<>();
|
private static Map<Integer, Skill> skills = new HashMap<>();
|
||||||
private static MapleDataProvider datasource = MapleDataProviderFactory.getDataProvider(MapleDataProviderFactory.fileInWZPath("Skill.wz"));
|
private static MapleDataProvider datasource = MapleDataProviderFactory.getDataProvider(MapleDataProviderFactory.fileInWZPath("Skill.wz"));
|
||||||
@@ -389,10 +333,10 @@ public class SkillFactory {
|
|||||||
public static String getSkillName(int skillid) {
|
public static String getSkillName(int skillid) {
|
||||||
MapleData data = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/" + "String.wz")).getData("Skill.img");
|
MapleData data = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/" + "String.wz")).getData("Skill.img");
|
||||||
StringBuilder skill = new StringBuilder();
|
StringBuilder skill = new StringBuilder();
|
||||||
skill.append(String.valueOf(skillid));
|
skill.append(skillid);
|
||||||
if (skill.length() == 4) {
|
if (skill.length() == 4) {
|
||||||
skill.delete(0, 4);
|
skill.delete(0, 4);
|
||||||
skill.append("000").append(String.valueOf(skillid));
|
skill.append("000").append(skillid);
|
||||||
}
|
}
|
||||||
if (data.getChildByPath(skill.toString()) != null) {
|
if (data.getChildByPath(skill.toString()) != null) {
|
||||||
for (MapleData skilldata : data.getChildByPath(skill.toString()).getChildren()) {
|
for (MapleData skilldata : data.getChildByPath(skill.toString()).getChildren()) {
|
||||||
|
|||||||
@@ -411,7 +411,7 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl
|
|||||||
if (attack.skill != 0) {
|
if (attack.skill != 0) {
|
||||||
if (attackEffect.getFixDamage() != -1) {
|
if (attackEffect.getFixDamage() != -1) {
|
||||||
if (totDamageToOneMonster != attackEffect.getFixDamage() && totDamageToOneMonster != 0) {
|
if (totDamageToOneMonster != attackEffect.getFixDamage() && totDamageToOneMonster != 0) {
|
||||||
AutobanFactory.FIX_DAMAGE.autoban(player, String.valueOf(totDamageToOneMonster) + " damage");
|
AutobanFactory.FIX_DAMAGE.autoban(player, totDamageToOneMonster + " damage");
|
||||||
}
|
}
|
||||||
|
|
||||||
int threeSnailsId = player.getJobType() * 10000000 + 1000;
|
int threeSnailsId = player.getJobType() * 10000000 + 1000;
|
||||||
|
|||||||
@@ -21,15 +21,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
*/
|
*/
|
||||||
package server.life;
|
package server.life;
|
||||||
|
|
||||||
import java.awt.Point;
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import provider.MapleData;
|
import provider.MapleData;
|
||||||
import provider.MapleDataProvider;
|
import provider.MapleDataProvider;
|
||||||
import provider.MapleDataProviderFactory;
|
import provider.MapleDataProviderFactory;
|
||||||
@@ -38,6 +29,11 @@ import provider.wz.MapleDataType;
|
|||||||
import tools.Pair;
|
import tools.Pair;
|
||||||
import tools.StringUtil;
|
import tools.StringUtil;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
public class MapleLifeFactory {
|
public class MapleLifeFactory {
|
||||||
|
|
||||||
private static MapleDataProvider data = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/Mob.wz"));
|
private static MapleDataProvider data = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/Mob.wz"));
|
||||||
@@ -95,7 +91,7 @@ public class MapleLifeFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Pair<MapleMonsterStats, List<MobAttackInfoHolder>> getMonsterStats(int mid) {
|
private static Pair<MapleMonsterStats, List<MobAttackInfoHolder>> getMonsterStats(int mid) {
|
||||||
MapleData monsterData = data.getData(StringUtil.getLeftPaddedStr(Integer.toString(mid) + ".img", '0', 11));
|
MapleData monsterData = data.getData(StringUtil.getLeftPaddedStr(mid + ".img", '0', 11));
|
||||||
if (monsterData == null) {
|
if (monsterData == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -266,7 +262,7 @@ public class MapleLifeFactory {
|
|||||||
try {
|
try {
|
||||||
MapleMonsterStats stats = monsterStats.get(Integer.valueOf(mid));
|
MapleMonsterStats stats = monsterStats.get(Integer.valueOf(mid));
|
||||||
if (stats == null) {
|
if (stats == null) {
|
||||||
MapleData monsterData = data.getData(StringUtil.getLeftPaddedStr(Integer.toString(mid) + ".img", '0', 11));
|
MapleData monsterData = data.getData(StringUtil.getLeftPaddedStr(mid + ".img", '0', 11));
|
||||||
if (monsterData == null) {
|
if (monsterData == null) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,15 +21,16 @@
|
|||||||
*/
|
*/
|
||||||
package server.life;
|
package server.life;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import provider.MapleData;
|
import provider.MapleData;
|
||||||
import provider.MapleDataProvider;
|
import provider.MapleDataProvider;
|
||||||
import provider.MapleDataProviderFactory;
|
import provider.MapleDataProviderFactory;
|
||||||
import provider.MapleDataTool;
|
import provider.MapleDataTool;
|
||||||
import tools.StringUtil;
|
import tools.StringUtil;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Danny (Leifde)
|
* @author Danny (Leifde)
|
||||||
@@ -46,7 +47,7 @@ public class MobAttackInfoFactory {
|
|||||||
synchronized (mobAttacks) {
|
synchronized (mobAttacks) {
|
||||||
ret = mobAttacks.get(mob.getId() + "" + attack);
|
ret = mobAttacks.get(mob.getId() + "" + attack);
|
||||||
if (ret == null) {
|
if (ret == null) {
|
||||||
MapleData mobData = dataSource.getData(StringUtil.getLeftPaddedStr(Integer.toString(mob.getId()) + ".img", '0', 11));
|
MapleData mobData = dataSource.getData(StringUtil.getLeftPaddedStr(mob.getId() + ".img", '0', 11));
|
||||||
if (mobData != null) {
|
if (mobData != null) {
|
||||||
// MapleData infoData = mobData.getChildByPath("info");
|
// MapleData infoData = mobData.getChildByPath("info");
|
||||||
String linkedmob = MapleDataTool.getString("link", mobData, "");
|
String linkedmob = MapleDataTool.getString("link", mobData, "");
|
||||||
|
|||||||
@@ -21,11 +21,6 @@
|
|||||||
*/
|
*/
|
||||||
package server.maps;
|
package server.maps;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import provider.MapleData;
|
import provider.MapleData;
|
||||||
import provider.MapleDataProvider;
|
import provider.MapleDataProvider;
|
||||||
import provider.MapleDataProviderFactory;
|
import provider.MapleDataProviderFactory;
|
||||||
@@ -34,6 +29,12 @@ import server.maps.MapleReactorStats.StateData;
|
|||||||
import tools.Pair;
|
import tools.Pair;
|
||||||
import tools.StringUtil;
|
import tools.StringUtil;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class MapleReactorFactory {
|
public class MapleReactorFactory {
|
||||||
private static MapleDataProvider data = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/Reactor.wz"));
|
private static MapleDataProvider data = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/Reactor.wz"));
|
||||||
private static Map<Integer, MapleReactorStats> reactorStats = new HashMap<Integer, MapleReactorStats>();
|
private static Map<Integer, MapleReactorStats> reactorStats = new HashMap<Integer, MapleReactorStats>();
|
||||||
@@ -43,7 +44,7 @@ public class MapleReactorFactory {
|
|||||||
MapleReactorStats stats = reactorStats.get(Integer.valueOf(rid));
|
MapleReactorStats stats = reactorStats.get(Integer.valueOf(rid));
|
||||||
if (stats == null) {
|
if (stats == null) {
|
||||||
int infoId = rid;
|
int infoId = rid;
|
||||||
MapleData reactorData = data.getData(StringUtil.getLeftPaddedStr(Integer.toString(infoId) + ".img", '0', 11));
|
MapleData reactorData = data.getData(StringUtil.getLeftPaddedStr(infoId + ".img", '0', 11));
|
||||||
MapleData link = reactorData.getChildByPath("info/link");
|
MapleData link = reactorData.getChildByPath("info/link");
|
||||||
if (link != null) {
|
if (link != null) {
|
||||||
infoId = MapleDataTool.getIntConvert("info/link", reactorData);
|
infoId = MapleDataTool.getIntConvert("info/link", reactorData);
|
||||||
@@ -51,7 +52,7 @@ public class MapleReactorFactory {
|
|||||||
}
|
}
|
||||||
if (stats == null) {
|
if (stats == null) {
|
||||||
stats = new MapleReactorStats();
|
stats = new MapleReactorStats();
|
||||||
reactorData = data.getData(StringUtil.getLeftPaddedStr(Integer.toString(infoId) + ".img", '0', 11));
|
reactorData = data.getData(StringUtil.getLeftPaddedStr(infoId + ".img", '0', 11));
|
||||||
if (reactorData == null) {
|
if (reactorData == null) {
|
||||||
return stats;
|
return stats;
|
||||||
}
|
}
|
||||||
@@ -97,7 +98,7 @@ public class MapleReactorFactory {
|
|||||||
MapleReactorStats stats = reactorStats.get(Integer.valueOf(rid));
|
MapleReactorStats stats = reactorStats.get(Integer.valueOf(rid));
|
||||||
if (stats == null) {
|
if (stats == null) {
|
||||||
int infoId = rid;
|
int infoId = rid;
|
||||||
MapleData reactorData = data.getData(StringUtil.getLeftPaddedStr(Integer.toString(infoId) + ".img", '0', 11));
|
MapleData reactorData = data.getData(StringUtil.getLeftPaddedStr(infoId + ".img", '0', 11));
|
||||||
MapleData link = reactorData.getChildByPath("info/link");
|
MapleData link = reactorData.getChildByPath("info/link");
|
||||||
if (link != null) {
|
if (link != null) {
|
||||||
infoId = MapleDataTool.getIntConvert("info/link", reactorData);
|
infoId = MapleDataTool.getIntConvert("info/link", reactorData);
|
||||||
@@ -109,7 +110,7 @@ public class MapleReactorFactory {
|
|||||||
loadArea = MapleDataTool.getInt("info/activateByTouch", reactorData, 0) != 0;
|
loadArea = MapleDataTool.getInt("info/activateByTouch", reactorData, 0) != 0;
|
||||||
}
|
}
|
||||||
if (stats == null) {
|
if (stats == null) {
|
||||||
reactorData = data.getData(StringUtil.getLeftPaddedStr(Integer.toString(infoId) + ".img", '0', 11));
|
reactorData = data.getData(StringUtil.getLeftPaddedStr(infoId + ".img", '0', 11));
|
||||||
MapleData reactorInfoData = reactorData.getChildByPath("0");
|
MapleData reactorInfoData = reactorData.getChildByPath("0");
|
||||||
stats = new MapleReactorStats();
|
stats = new MapleReactorStats();
|
||||||
List<StateData> statedatas = new ArrayList<>();
|
List<StateData> statedatas = new ArrayList<>();
|
||||||
|
|||||||
@@ -811,7 +811,7 @@ public class BCrypt {
|
|||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"rounds exceeds maximum (30)");
|
"rounds exceeds maximum (30)");
|
||||||
}
|
}
|
||||||
rs.append(Integer.toString(rounds));
|
rs.append(rounds);
|
||||||
rs.append("$");
|
rs.append("$");
|
||||||
rs.append(encode_base64(saltb, saltb.length));
|
rs.append(encode_base64(saltb, saltb.length));
|
||||||
rs.append(encode_base64(hashed,
|
rs.append(encode_base64(hashed,
|
||||||
@@ -855,7 +855,7 @@ public class BCrypt {
|
|||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"log_rounds exceeds maximum (30)");
|
"log_rounds exceeds maximum (30)");
|
||||||
}
|
}
|
||||||
rs.append(Integer.toString(log_rounds));
|
rs.append(log_rounds);
|
||||||
rs.append("$");
|
rs.append("$");
|
||||||
rs.append(encode_base64(rnd, rnd.length));
|
rs.append(encode_base64(rnd, rnd.length));
|
||||||
return rs.toString();
|
return rs.toString();
|
||||||
|
|||||||
Reference in New Issue
Block a user