cleanup: remove redundant cast
This commit is contained in:
@@ -21,15 +21,16 @@
|
||||
*/
|
||||
package provider.wz;
|
||||
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import tools.data.input.LittleEndianAccessor;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import tools.data.input.LittleEndianAccessor;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
/*
|
||||
* Ported Code, see WZFile.java for more info
|
||||
@@ -103,7 +104,7 @@ public class WZTool {
|
||||
if (b == 0x7F) {
|
||||
strLength = llea.readInt();
|
||||
} else {
|
||||
strLength = (int) b;
|
||||
strLength = b;
|
||||
}
|
||||
if (strLength < 0) {
|
||||
return "";
|
||||
@@ -172,7 +173,7 @@ public class WZTool {
|
||||
if (b == -128) {
|
||||
return lea.readInt();
|
||||
} else {
|
||||
return ((int) b);
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,15 +21,16 @@
|
||||
*/
|
||||
package provider.wz;
|
||||
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import tools.data.input.LittleEndianAccessor;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import tools.data.input.LittleEndianAccessor;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
/*
|
||||
* Ported Code, see WZFile.java for more info
|
||||
@@ -103,7 +104,7 @@ public class WZTool {
|
||||
if (b == 0x7F) {
|
||||
strLength = llea.readInt();
|
||||
} else {
|
||||
strLength = (int) b;
|
||||
strLength = b;
|
||||
}
|
||||
if (strLength < 0) {
|
||||
return "";
|
||||
@@ -172,7 +173,7 @@ public class WZTool {
|
||||
if (b == -128) {
|
||||
return lea.readInt();
|
||||
} else {
|
||||
return ((int) b);
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,45 +21,10 @@
|
||||
*/
|
||||
package tools;
|
||||
|
||||
import java.io.File;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import provider.*;
|
||||
|
||||
//import net.server.Server;
|
||||
import provider.MapleData;
|
||||
import provider.MapleDataDirectoryEntry;
|
||||
import provider.MapleDataFileEntry;
|
||||
import provider.MapleDataProvider;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
import tools.DatabaseConnection;
|
||||
//import tools.MaplePacketCreator;
|
||||
import tools.Pair;
|
||||
//import client.MapleCharacter;
|
||||
//import client.MapleClient;
|
||||
//import client.MapleJob;
|
||||
//import client.Skill;
|
||||
//import client.SkillFactory;
|
||||
//import client.autoban.AutobanFactory;
|
||||
//import client.inventory.Equip;
|
||||
//import client.inventory.Item;
|
||||
//import client.inventory.MapleInventory;
|
||||
//import client.inventory.MapleInventoryType;
|
||||
//import client.inventory.MapleWeaponType;
|
||||
//import constants.ServerConstants;
|
||||
//import constants.EquipSlot;
|
||||
//import constants.ItemConstants;
|
||||
//import constants.skills.Assassin;
|
||||
//import constants.skills.Gunslinger;
|
||||
//import constants.skills.NightWalker;
|
||||
import java.sql.Connection;
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
//import server.life.MapleMonsterInformationProvider;
|
||||
|
||||
/**
|
||||
@@ -311,7 +276,7 @@ public class MapleItemInformationProvider {
|
||||
public short getSlotMax(int itemId) {
|
||||
Short slotMax = slotMaxCache.get(itemId);
|
||||
if (slotMax != null) {
|
||||
return (short)(slotMax);
|
||||
return slotMax;
|
||||
}
|
||||
short ret = 0;
|
||||
MapleData item = getItemData(itemId);
|
||||
@@ -325,7 +290,7 @@ public class MapleItemInformationProvider {
|
||||
}
|
||||
|
||||
slotMaxCache.put(itemId, ret);
|
||||
return (short)(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int getMeso(int itemId) {
|
||||
@@ -378,7 +343,7 @@ public class MapleItemInformationProvider {
|
||||
try {
|
||||
pEntry = MapleDataTool.getDouble(pData);
|
||||
} catch (Exception e) {
|
||||
pEntry = (double) MapleDataTool.getInt(pData);
|
||||
pEntry = MapleDataTool.getInt(pData);
|
||||
}
|
||||
} else {
|
||||
pData = item.getChildByPath("info/price");
|
||||
@@ -386,7 +351,7 @@ public class MapleItemInformationProvider {
|
||||
return -1;
|
||||
}
|
||||
try {
|
||||
pEntry = (double) MapleDataTool.getInt(pData);
|
||||
pEntry = MapleDataTool.getInt(pData);
|
||||
} catch(Exception e) {
|
||||
priceCache.put(itemId, 0.0);
|
||||
return 0;
|
||||
|
||||
@@ -19,25 +19,9 @@
|
||||
*/
|
||||
package maplegachaponitemidretriever;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.LinkedList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Collections;
|
||||
import java.io.*;
|
||||
import java.sql.*;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -168,7 +152,7 @@ public class MapleGachaponItemidRetriever {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = (int) (prop ^ (prop >>> 32));
|
||||
int result = prop ^ (prop >>> 32);
|
||||
result = 31 * result + (header != null ? header.hashCode() : 0);
|
||||
result = 31 * result + (target != null ? target.hashCode() : 0);
|
||||
result = 31 * result + (buff != null ? buff.hashCode() : 0);
|
||||
|
||||
@@ -21,15 +21,16 @@
|
||||
*/
|
||||
package provider.wz;
|
||||
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import tools.data.input.LittleEndianAccessor;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import tools.data.input.LittleEndianAccessor;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
/*
|
||||
* Ported Code, see WZFile.java for more info
|
||||
@@ -103,7 +104,7 @@ public class WZTool {
|
||||
if (b == 0x7F) {
|
||||
strLength = llea.readInt();
|
||||
} else {
|
||||
strLength = (int) b;
|
||||
strLength = b;
|
||||
}
|
||||
if (strLength < 0) {
|
||||
return "";
|
||||
@@ -172,7 +173,7 @@ public class WZTool {
|
||||
if (b == -128) {
|
||||
return lea.readInt();
|
||||
} else {
|
||||
return ((int) b);
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,15 +21,16 @@
|
||||
*/
|
||||
package provider.wz;
|
||||
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import tools.data.input.LittleEndianAccessor;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import tools.data.input.LittleEndianAccessor;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
/*
|
||||
* Ported Code, see WZFile.java for more info
|
||||
@@ -103,7 +104,7 @@ public class WZTool {
|
||||
if (b == 0x7F) {
|
||||
strLength = llea.readInt();
|
||||
} else {
|
||||
strLength = (int) b;
|
||||
strLength = b;
|
||||
}
|
||||
if (strLength < 0) {
|
||||
return "";
|
||||
@@ -172,7 +173,7 @@ public class WZTool {
|
||||
if (b == -128) {
|
||||
return lea.readInt();
|
||||
} else {
|
||||
return ((int) b);
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,15 +21,16 @@
|
||||
*/
|
||||
package provider.wz;
|
||||
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import tools.data.input.LittleEndianAccessor;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import tools.data.input.LittleEndianAccessor;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
/*
|
||||
* Ported Code, see WZFile.java for more info
|
||||
@@ -103,7 +104,7 @@ public class WZTool {
|
||||
if (b == 0x7F) {
|
||||
strLength = llea.readInt();
|
||||
} else {
|
||||
strLength = (int) b;
|
||||
strLength = b;
|
||||
}
|
||||
if (strLength < 0) {
|
||||
return "";
|
||||
@@ -172,7 +173,7 @@ public class WZTool {
|
||||
if (b == -128) {
|
||||
return lea.readInt();
|
||||
} else {
|
||||
return ((int) b);
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,45 +21,14 @@
|
||||
*/
|
||||
package tools;
|
||||
|
||||
import provider.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
//import net.server.Server;
|
||||
import provider.MapleData;
|
||||
import provider.MapleDataDirectoryEntry;
|
||||
import provider.MapleDataFileEntry;
|
||||
import provider.MapleDataProvider;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
import tools.DatabaseConnection;
|
||||
//import tools.MaplePacketCreator;
|
||||
import tools.Pair;
|
||||
//import client.MapleCharacter;
|
||||
//import client.MapleClient;
|
||||
//import client.MapleJob;
|
||||
//import client.Skill;
|
||||
//import client.SkillFactory;
|
||||
//import client.autoban.AutobanFactory;
|
||||
//import client.inventory.Equip;
|
||||
//import client.inventory.Item;
|
||||
//import client.inventory.MapleInventory;
|
||||
//import client.inventory.MapleInventoryType;
|
||||
//import client.inventory.MapleWeaponType;
|
||||
//import constants.ServerConstants;
|
||||
//import constants.EquipSlot;
|
||||
//import constants.ItemConstants;
|
||||
//import constants.skills.Assassin;
|
||||
//import constants.skills.Gunslinger;
|
||||
//import constants.skills.NightWalker;
|
||||
import java.sql.Connection;
|
||||
import java.util.*;
|
||||
//import server.life.MapleMonsterInformationProvider;
|
||||
|
||||
/**
|
||||
@@ -313,7 +282,7 @@ public class MapleItemInformationProvider {
|
||||
public short getSlotMax(int itemId) {
|
||||
Short slotMax = slotMaxCache.get(itemId);
|
||||
if (slotMax != null) {
|
||||
return (short)(slotMax);
|
||||
return slotMax;
|
||||
}
|
||||
short ret = 0;
|
||||
MapleData item = getItemData(itemId);
|
||||
@@ -327,7 +296,7 @@ public class MapleItemInformationProvider {
|
||||
}
|
||||
|
||||
slotMaxCache.put(itemId, ret);
|
||||
return (short)(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int getMeso(int itemId) {
|
||||
@@ -380,7 +349,7 @@ public class MapleItemInformationProvider {
|
||||
try {
|
||||
pEntry = MapleDataTool.getDouble(pData);
|
||||
} catch (Exception e) {
|
||||
pEntry = (double) MapleDataTool.getInt(pData);
|
||||
pEntry = MapleDataTool.getInt(pData);
|
||||
}
|
||||
} else {
|
||||
pData = item.getChildByPath("info/price");
|
||||
@@ -388,7 +357,7 @@ public class MapleItemInformationProvider {
|
||||
return -1;
|
||||
}
|
||||
try {
|
||||
pEntry = (double) MapleDataTool.getInt(pData);
|
||||
pEntry = MapleDataTool.getInt(pData);
|
||||
} catch(Exception e) {
|
||||
priceCache.put(itemId, 0.0);
|
||||
return 0;
|
||||
|
||||
@@ -21,15 +21,16 @@
|
||||
*/
|
||||
package provider.wz;
|
||||
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import tools.data.input.LittleEndianAccessor;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import tools.data.input.LittleEndianAccessor;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
/*
|
||||
* Ported Code, see WZFile.java for more info
|
||||
@@ -103,7 +104,7 @@ public class WZTool {
|
||||
if (b == 0x7F) {
|
||||
strLength = llea.readInt();
|
||||
} else {
|
||||
strLength = (int) b;
|
||||
strLength = b;
|
||||
}
|
||||
if (strLength < 0) {
|
||||
return "";
|
||||
@@ -172,7 +173,7 @@ public class WZTool {
|
||||
if (b == -128) {
|
||||
return lea.readInt();
|
||||
} else {
|
||||
return ((int) b);
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,15 +21,16 @@
|
||||
*/
|
||||
package provider.wz;
|
||||
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import tools.data.input.LittleEndianAccessor;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import tools.data.input.LittleEndianAccessor;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
/*
|
||||
* Ported Code, see WZFile.java for more info
|
||||
@@ -103,7 +104,7 @@ public class WZTool {
|
||||
if (b == 0x7F) {
|
||||
strLength = llea.readInt();
|
||||
} else {
|
||||
strLength = (int) b;
|
||||
strLength = b;
|
||||
}
|
||||
if (strLength < 0) {
|
||||
return "";
|
||||
@@ -172,7 +173,7 @@ public class WZTool {
|
||||
if (b == -128) {
|
||||
return lea.readInt();
|
||||
} else {
|
||||
return ((int) b);
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,15 +21,16 @@
|
||||
*/
|
||||
package provider.wz;
|
||||
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import tools.data.input.LittleEndianAccessor;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import tools.data.input.LittleEndianAccessor;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
/*
|
||||
* Ported Code, see WZFile.java for more info
|
||||
@@ -103,7 +104,7 @@ public class WZTool {
|
||||
if (b == 0x7F) {
|
||||
strLength = llea.readInt();
|
||||
} else {
|
||||
strLength = (int) b;
|
||||
strLength = b;
|
||||
}
|
||||
if (strLength < 0) {
|
||||
return "";
|
||||
@@ -172,7 +173,7 @@ public class WZTool {
|
||||
if (b == -128) {
|
||||
return lea.readInt();
|
||||
} else {
|
||||
return ((int) b);
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user