Added missing final modifiers.
This commit is contained in:
@@ -303,7 +303,7 @@ public final class AdminData implements IXmlReader
|
||||
|
||||
for (String name : getAllGmNames(player.isGM()))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.GM_C1);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.GM_C1);
|
||||
sm.addString(name);
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
|
@@ -114,8 +114,8 @@ public final class ArmorSetsData implements IXmlReader
|
||||
}
|
||||
case "shield_skill":
|
||||
{
|
||||
int skillId = parseInteger(attrs, "id");
|
||||
int skillLevel = parseInteger(attrs, "level");
|
||||
final int skillId = parseInteger(attrs, "id");
|
||||
final int skillLevel = parseInteger(attrs, "level");
|
||||
set.addShieldSkill(new SkillHolder(skillId, skillLevel));
|
||||
break;
|
||||
}
|
||||
|
@@ -86,7 +86,7 @@ public final class BeautyShopData implements IXmlReader
|
||||
sex = parseEnum(att, Sex.class);
|
||||
}
|
||||
|
||||
BeautyData beautyData = new BeautyData();
|
||||
final BeautyData beautyData = new BeautyData();
|
||||
|
||||
for (Node a = b.getFirstChild(); a != null; a = a.getNextSibling())
|
||||
{
|
||||
@@ -99,7 +99,7 @@ public final class BeautyShopData implements IXmlReader
|
||||
att = attrs.item(i);
|
||||
set.set(att.getNodeName(), att.getNodeValue());
|
||||
}
|
||||
BeautyItem hair = new BeautyItem(set);
|
||||
final BeautyItem hair = new BeautyItem(set);
|
||||
|
||||
for (Node g = a.getFirstChild(); g != null; g = g.getNextSibling())
|
||||
{
|
||||
@@ -126,7 +126,7 @@ public final class BeautyShopData implements IXmlReader
|
||||
att = attrs.item(i);
|
||||
set.set(att.getNodeName(), att.getNodeValue());
|
||||
}
|
||||
BeautyItem face = new BeautyItem(set);
|
||||
final BeautyItem face = new BeautyItem(set);
|
||||
beautyData.addFace(face);
|
||||
}
|
||||
}
|
||||
|
@@ -72,10 +72,10 @@ public final class BuyListData implements IXmlReader
|
||||
{
|
||||
while (rs.next())
|
||||
{
|
||||
int buyListId = rs.getInt("buylist_id");
|
||||
int itemId = rs.getInt("item_id");
|
||||
long count = rs.getLong("count");
|
||||
long nextRestockTime = rs.getLong("next_restock_time");
|
||||
final int buyListId = rs.getInt("buylist_id");
|
||||
final int itemId = rs.getInt("item_id");
|
||||
final long count = rs.getLong("count");
|
||||
final long nextRestockTime = rs.getLong("next_restock_time");
|
||||
final L2BuyList buyList = getBuyList(buyListId);
|
||||
if (buyList == null)
|
||||
{
|
||||
@@ -121,7 +121,7 @@ public final class BuyListData implements IXmlReader
|
||||
long price = -1;
|
||||
long restockDelay = -1;
|
||||
long count = -1;
|
||||
NamedNodeMap attrs = list_node.getAttributes();
|
||||
final NamedNodeMap attrs = list_node.getAttributes();
|
||||
Node attr = attrs.getNamedItem("id");
|
||||
itemId = Integer.parseInt(attr.getNodeValue());
|
||||
attr = attrs.getNamedItem("price");
|
||||
@@ -155,7 +155,7 @@ public final class BuyListData implements IXmlReader
|
||||
{
|
||||
if ("npc".equalsIgnoreCase(npcs_node.getNodeName()))
|
||||
{
|
||||
int npcId = Integer.parseInt(npcs_node.getTextContent());
|
||||
final int npcId = Integer.parseInt(npcs_node.getTextContent());
|
||||
buyList.addAllowedNpc(npcId);
|
||||
}
|
||||
}
|
||||
|
@@ -77,7 +77,7 @@ public class DailyMissionData implements IXmlReader
|
||||
{
|
||||
if ("mission".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
NamedNodeMap attrs = d.getAttributes();
|
||||
final NamedNodeMap attrs = d.getAttributes();
|
||||
Node att;
|
||||
id = -1;
|
||||
clientId = 0;
|
||||
@@ -219,7 +219,7 @@ public class DailyMissionData implements IXmlReader
|
||||
*/
|
||||
public List<DailyMissionHolder> getDailyMissions(int classId)
|
||||
{
|
||||
List<DailyMissionHolder> missions = new ArrayList<>();
|
||||
final List<DailyMissionHolder> missions = new ArrayList<>();
|
||||
for (DailyMissionHolder mission : _dailyMissions)
|
||||
{
|
||||
if (mission.getAvailableClasses().contains(classId))
|
||||
@@ -237,7 +237,7 @@ public class DailyMissionData implements IXmlReader
|
||||
*/
|
||||
public List<DailyMissionHolder> getDailyLevelUpMissions(int classId)
|
||||
{
|
||||
List<DailyMissionHolder> missions = new ArrayList<>();
|
||||
final List<DailyMissionHolder> missions = new ArrayList<>();
|
||||
for (DailyMissionHolder mission : _dailyLevelUpMissions)
|
||||
{
|
||||
if (mission.getAvailableClasses().contains(classId))
|
||||
|
@@ -119,8 +119,8 @@ public class DoorData implements IXmlReader
|
||||
private void makeDoor(StatsSet set)
|
||||
{
|
||||
insertCollisionData(set);
|
||||
L2DoorTemplate template = new L2DoorTemplate(set);
|
||||
L2DoorInstance door = new L2DoorInstance(template);
|
||||
final L2DoorTemplate template = new L2DoorTemplate(set);
|
||||
final L2DoorInstance door = new L2DoorInstance(template);
|
||||
door.setCurrentHp(door.getMaxHp());
|
||||
door.spawnMe(template.getX(), template.getY(), template.getZ());
|
||||
putDoor(door, MapRegionManager.getInstance().getMapRegionLocId(door));
|
||||
@@ -218,20 +218,20 @@ public class DoorData implements IXmlReader
|
||||
boolean intersectFace = false;
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
int j = (i + 1) < 4 ? i + 1 : 0;
|
||||
final int j = (i + 1) < 4 ? i + 1 : 0;
|
||||
// lower part of the multiplier fraction, if it is 0 we avoid an error and also know that the lines are parallel
|
||||
int denominator = ((ty - y) * (doorInst.getX(i) - doorInst.getX(j))) - ((tx - x) * (doorInst.getY(i) - doorInst.getY(j)));
|
||||
final int denominator = ((ty - y) * (doorInst.getX(i) - doorInst.getX(j))) - ((tx - x) * (doorInst.getY(i) - doorInst.getY(j)));
|
||||
if (denominator == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// multipliers to the equations of the lines. If they are lower than 0 or bigger than 1, we know that segments don't intersect
|
||||
float multiplier1 = (float) (((doorInst.getX(j) - doorInst.getX(i)) * (y - doorInst.getY(i))) - ((doorInst.getY(j) - doorInst.getY(i)) * (x - doorInst.getX(i)))) / denominator;
|
||||
float multiplier2 = (float) (((tx - x) * (y - doorInst.getY(i))) - ((ty - y) * (x - doorInst.getX(i)))) / denominator;
|
||||
final float multiplier1 = (float) (((doorInst.getX(j) - doorInst.getX(i)) * (y - doorInst.getY(i))) - ((doorInst.getY(j) - doorInst.getY(i)) * (x - doorInst.getX(i)))) / denominator;
|
||||
final float multiplier2 = (float) (((tx - x) * (y - doorInst.getY(i))) - ((ty - y) * (x - doorInst.getX(i)))) / denominator;
|
||||
if ((multiplier1 >= 0) && (multiplier1 <= 1) && (multiplier2 >= 0) && (multiplier2 <= 1))
|
||||
{
|
||||
int intersectZ = Math.round(z + (multiplier1 * (tz - z)));
|
||||
final int intersectZ = Math.round(z + (multiplier1 * (tz - z)));
|
||||
// now checking if the resulting point is between door's min and max z
|
||||
if ((intersectZ > doorInst.getZMin()) && (intersectZ < doorInst.getZMax()))
|
||||
{
|
||||
|
@@ -75,13 +75,13 @@ public final class EnchantItemGroupsData implements IXmlReader
|
||||
{
|
||||
if ("current".equalsIgnoreCase(cd.getNodeName()))
|
||||
{
|
||||
String range = parseString(cd.getAttributes(), "enchant");
|
||||
double chance = parseDouble(cd.getAttributes(), "chance");
|
||||
final String range = parseString(cd.getAttributes(), "enchant");
|
||||
final double chance = parseDouble(cd.getAttributes(), "chance");
|
||||
int min = -1;
|
||||
int max = 0;
|
||||
if (range.contains("-"))
|
||||
{
|
||||
String[] split = range.split("-");
|
||||
final String[] split = range.split("-");
|
||||
if ((split.length == 2) && Util.isDigit(split[0]) && Util.isDigit(split[1]))
|
||||
{
|
||||
min = Integer.parseInt(split[0]);
|
||||
@@ -103,7 +103,7 @@ public final class EnchantItemGroupsData implements IXmlReader
|
||||
}
|
||||
else if ("enchantScrollGroup".equals(d.getNodeName()))
|
||||
{
|
||||
int id = parseInteger(d.getAttributes(), "id");
|
||||
final int id = parseInteger(d.getAttributes(), "id");
|
||||
final EnchantScrollGroup group = new EnchantScrollGroup(id);
|
||||
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
|
||||
{
|
||||
|
@@ -94,7 +94,7 @@ public class EnchantItemHPBonusData implements IXmlReader
|
||||
final Collection<Integer> armorIds = it.getAllArmorsId();
|
||||
for (Integer itemId : armorIds)
|
||||
{
|
||||
L2Item item = it.getTemplate(itemId);
|
||||
final L2Item item = it.getTemplate(itemId);
|
||||
if ((item != null) && (item.getCrystalType() != CrystalType.NONE))
|
||||
{
|
||||
switch (item.getBodyPart())
|
||||
|
@@ -61,7 +61,7 @@ public class EnchantItemOptionsData implements IXmlReader
|
||||
{
|
||||
if ("item".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
int itemId = parseInteger(d.getAttributes(), "id");
|
||||
final int itemId = parseInteger(d.getAttributes(), "id");
|
||||
if (!_data.containsKey(itemId))
|
||||
{
|
||||
_data.put(itemId, new HashMap<Integer, EnchantOptions>());
|
||||
|
@@ -112,11 +112,11 @@ public class EnchantSkillGroupsData implements IXmlReader
|
||||
if ("enchant".equalsIgnoreCase(b.getNodeName()))
|
||||
{
|
||||
attrs = b.getAttributes();
|
||||
StatsSet set = new StatsSet();
|
||||
final StatsSet set = new StatsSet();
|
||||
|
||||
for (int i = 0; i < attrs.getLength(); i++)
|
||||
{
|
||||
Node att = attrs.item(i);
|
||||
final Node att = attrs.item(i);
|
||||
set.set(att.getNodeName(), att.getNodeValue());
|
||||
}
|
||||
group.addEnchantDetail(new EnchantSkillHolder(set));
|
||||
|
@@ -80,7 +80,7 @@ public final class ExperienceData implements IXmlReader
|
||||
{
|
||||
if ("experience".equals(n.getNodeName()))
|
||||
{
|
||||
NamedNodeMap attrs = n.getAttributes();
|
||||
final NamedNodeMap attrs = n.getAttributes();
|
||||
maxLevel = parseInteger(attrs, "level");
|
||||
if (maxLevel > Config.PLAYER_MAXIMUM_LEVEL)
|
||||
{
|
||||
|
@@ -71,7 +71,7 @@ public final class HitConditionBonusData implements IXmlReader
|
||||
{
|
||||
for (Node d = doc.getFirstChild().getFirstChild(); d != null; d = d.getNextSibling())
|
||||
{
|
||||
NamedNodeMap attrs = d.getAttributes();
|
||||
final NamedNodeMap attrs = d.getAttributes();
|
||||
switch (d.getNodeName())
|
||||
{
|
||||
case "front":
|
||||
|
@@ -95,7 +95,7 @@ public final class InitialEquipmentData implements IXmlReader
|
||||
attrs = c.getAttributes();
|
||||
for (int i = 0; i < attrs.getLength(); i++)
|
||||
{
|
||||
Node attr = attrs.item(i);
|
||||
final Node attr = attrs.item(i);
|
||||
set.set(attr.getNodeName(), attr.getNodeValue());
|
||||
}
|
||||
equipList.add(new PcItemTemplate(set));
|
||||
|
@@ -66,7 +66,7 @@ public final class ItemCrystalizationData implements IXmlReader
|
||||
{
|
||||
if ("item".equalsIgnoreCase(c.getNodeName()))
|
||||
{
|
||||
NamedNodeMap attrs = c.getAttributes();
|
||||
final NamedNodeMap attrs = c.getAttributes();
|
||||
final int itemId = parseInteger(attrs, "id");
|
||||
final long itemCount = parseLong(attrs, "count");
|
||||
final double itemChance = parseDouble(attrs, "chance");
|
||||
|
@@ -62,7 +62,7 @@ public class KarmaData implements IXmlReader
|
||||
if ("increase".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
final NamedNodeMap attrs = d.getAttributes();
|
||||
int level = parseInteger(attrs, "lvl");
|
||||
final int level = parseInteger(attrs, "lvl");
|
||||
if (level >= Config.PLAYER_MAXIMUM_LEVEL)
|
||||
{
|
||||
break;
|
||||
|
@@ -64,8 +64,8 @@ public class LuckyGameData implements IXmlReader
|
||||
{
|
||||
if ("list".equalsIgnoreCase(n.getNodeName()))
|
||||
{
|
||||
NamedNodeMap at = n.getAttributes();
|
||||
Node attribute = at.getNamedItem("enabled");
|
||||
final NamedNodeMap at = n.getAttributes();
|
||||
final Node attribute = at.getNamedItem("enabled");
|
||||
if ((attribute != null) && Boolean.parseBoolean(attribute.getNodeValue())) // <list enabled="true"
|
||||
{
|
||||
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
|
||||
@@ -76,7 +76,7 @@ public class LuckyGameData implements IXmlReader
|
||||
{
|
||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
||||
{
|
||||
NamedNodeMap attrs = b.getAttributes();
|
||||
final NamedNodeMap attrs = b.getAttributes();
|
||||
|
||||
final int itemId = parseInteger(attrs, "id");
|
||||
final int count = parseInteger(attrs, "count");
|
||||
@@ -97,7 +97,7 @@ public class LuckyGameData implements IXmlReader
|
||||
{
|
||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
||||
{
|
||||
NamedNodeMap attrs = b.getAttributes();
|
||||
final NamedNodeMap attrs = b.getAttributes();
|
||||
|
||||
final int itemId = parseInteger(attrs, "id");
|
||||
final int count = parseInteger(attrs, "count");
|
||||
@@ -118,7 +118,7 @@ public class LuckyGameData implements IXmlReader
|
||||
{
|
||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
||||
{
|
||||
NamedNodeMap attrs = b.getAttributes();
|
||||
final NamedNodeMap attrs = b.getAttributes();
|
||||
|
||||
final int itemId = parseInteger(attrs, "id");
|
||||
final int count = parseInteger(attrs, "count");
|
||||
|
@@ -84,7 +84,7 @@ public final class MultisellData implements IXmlReader
|
||||
{
|
||||
try
|
||||
{
|
||||
int id = Integer.parseInt(f.getName().replaceAll(".xml", ""));
|
||||
final int id = Integer.parseInt(f.getName().replaceAll(".xml", ""));
|
||||
int entryId = 1;
|
||||
Node att;
|
||||
final ListContainer list = new ListContainer(id);
|
||||
@@ -132,7 +132,7 @@ public final class MultisellData implements IXmlReader
|
||||
{
|
||||
if ("item".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
Entry e = parseEntry(d, entryId++, list);
|
||||
final Entry e = parseEntry(d, entryId++, list);
|
||||
list.getEntries().add(e);
|
||||
}
|
||||
else if ("npcs".equalsIgnoreCase(d.getNodeName()))
|
||||
@@ -167,7 +167,7 @@ public final class MultisellData implements IXmlReader
|
||||
|
||||
private final Entry parseEntry(Node n, int entryId, ListContainer list)
|
||||
{
|
||||
Node first = n.getFirstChild();
|
||||
final Node first = n.getFirstChild();
|
||||
final Entry entry = new Entry(entryId);
|
||||
|
||||
NamedNodeMap attrs;
|
||||
@@ -234,7 +234,7 @@ public final class MultisellData implements IXmlReader
|
||||
*/
|
||||
public final void separateAndSend(int listId, L2PcInstance player, L2Npc npc, boolean inventoryOnly, double productMultiplier, double ingredientMultiplier)
|
||||
{
|
||||
ListContainer template = _entries.get(listId);
|
||||
final ListContainer template = _entries.get(listId);
|
||||
if (template == null)
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Cannot find list ID: " + listId + " requested by player: " + player.getName() + ", NPC ID:" + (npc != null ? npc.getId() : 0));
|
||||
@@ -330,14 +330,14 @@ public final class MultisellData implements IXmlReader
|
||||
case PC_BANG_POINTS: // PcBang points
|
||||
final int cost = player.getPcBangPoints() - (int) (amount);
|
||||
player.setPcBangPoints(cost);
|
||||
SystemMessage smsgpc = SystemMessage.getSystemMessage(SystemMessageId.YOU_ARE_USING_S1_POINT);
|
||||
final SystemMessage smsgpc = SystemMessage.getSystemMessage(SystemMessageId.YOU_ARE_USING_S1_POINT);
|
||||
smsgpc.addLong((int) amount);
|
||||
player.sendPacket(smsgpc);
|
||||
player.sendPacket(new ExPCCafePointInfo(player.getPcBangPoints(), (int) amount, 1));
|
||||
return true;
|
||||
case CLAN_REPUTATION:
|
||||
player.getClan().takeReputationScore((int) amount, true);
|
||||
SystemMessage smsg = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
||||
final SystemMessage smsg = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
||||
smsg.addLong(amount);
|
||||
player.sendPacket(smsg);
|
||||
return true;
|
||||
|
@@ -236,7 +236,7 @@ public class NpcData implements IXmlReader
|
||||
{
|
||||
case "attack":
|
||||
{
|
||||
String attackAttributeType = parseString(attrs, "type");
|
||||
final String attackAttributeType = parseString(attrs, "type");
|
||||
switch (attackAttributeType.toUpperCase())
|
||||
{
|
||||
case "FIRE":
|
||||
@@ -441,7 +441,7 @@ public class NpcData implements IXmlReader
|
||||
dropLists = new EnumMap<>(DropListScope.class);
|
||||
}
|
||||
|
||||
List<IDropItem> dropList = new ArrayList<>();
|
||||
final List<IDropItem> dropList = new ArrayList<>();
|
||||
parseDropList(f, dropListsNode, dropListScope, dropList);
|
||||
dropLists.put(dropListScope, Collections.unmodifiableList(dropList));
|
||||
}
|
||||
@@ -629,19 +629,19 @@ public class NpcData implements IXmlReader
|
||||
{
|
||||
for (Node dropNode = dropListNode.getFirstChild(); dropNode != null; dropNode = dropNode.getNextSibling())
|
||||
{
|
||||
NamedNodeMap attrs = dropNode.getAttributes();
|
||||
final NamedNodeMap attrs = dropNode.getAttributes();
|
||||
switch (dropNode.getNodeName().toLowerCase())
|
||||
{
|
||||
case "group":
|
||||
{
|
||||
GroupedGeneralDropItem dropItem = dropListScope.newGroupedDropItem(parseDouble(attrs, "chance"));
|
||||
List<IDropItem> groupedDropList = new ArrayList<>(2);
|
||||
final GroupedGeneralDropItem dropItem = dropListScope.newGroupedDropItem(parseDouble(attrs, "chance"));
|
||||
final List<IDropItem> groupedDropList = new ArrayList<>(2);
|
||||
for (Node groupNode = dropNode.getFirstChild(); groupNode != null; groupNode = groupNode.getNextSibling())
|
||||
{
|
||||
parseDropListItem(groupNode, dropListScope, groupedDropList);
|
||||
}
|
||||
|
||||
List<GeneralDropItem> items = new ArrayList<>(groupedDropList.size());
|
||||
final List<GeneralDropItem> items = new ArrayList<>(groupedDropList.size());
|
||||
for (IDropItem item : groupedDropList)
|
||||
{
|
||||
if (item instanceof GeneralDropItem)
|
||||
@@ -669,7 +669,7 @@ public class NpcData implements IXmlReader
|
||||
|
||||
private void parseDropListItem(Node dropListItem, DropListScope dropListScope, List<IDropItem> drops)
|
||||
{
|
||||
NamedNodeMap attrs = dropListItem.getAttributes();
|
||||
final NamedNodeMap attrs = dropListItem.getAttributes();
|
||||
switch (dropListItem.getNodeName().toLowerCase())
|
||||
{
|
||||
case "item":
|
||||
@@ -707,7 +707,7 @@ public class NpcData implements IXmlReader
|
||||
*/
|
||||
public int getClanId(String clanName)
|
||||
{
|
||||
Integer id = _clans.get(clanName.toUpperCase());
|
||||
final Integer id = _clans.get(clanName.toUpperCase());
|
||||
return id != null ? id : -1;
|
||||
}
|
||||
|
||||
@@ -839,7 +839,7 @@ public class NpcData implements IXmlReader
|
||||
{
|
||||
final List<MinionHolder> minions = new ArrayList<>(1);
|
||||
NamedNodeMap attrs = listNode.getAttributes();
|
||||
int id = parseInteger(attrs, "id");
|
||||
final int id = parseInteger(attrs, "id");
|
||||
for (Node npcNode = listNode.getFirstChild(); npcNode != null; npcNode = npcNode.getNextSibling())
|
||||
{
|
||||
if ("minion".equals(npcNode.getNodeName()))
|
||||
|
@@ -131,8 +131,8 @@ public class OptionData implements IXmlReader
|
||||
|
||||
private void parseFuncs(NamedNodeMap attrs, String functionName, Options op)
|
||||
{
|
||||
Stats stat = Stats.valueOfXml(parseString(attrs, "stat"));
|
||||
double val = parseDouble(attrs, "val");
|
||||
final Stats stat = Stats.valueOfXml(parseString(attrs, "stat"));
|
||||
final double val = parseDouble(attrs, "val");
|
||||
int order = -1;
|
||||
final Node orderNode = attrs.getNamedItem("order");
|
||||
if (orderNode != null)
|
||||
|
@@ -60,21 +60,21 @@ public final class PetDataTable implements IXmlReader
|
||||
public void parseDocument(Document doc)
|
||||
{
|
||||
NamedNodeMap attrs;
|
||||
Node n = doc.getFirstChild();
|
||||
final Node n = doc.getFirstChild();
|
||||
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
|
||||
{
|
||||
if (d.getNodeName().equals("pet"))
|
||||
{
|
||||
int npcId = parseInteger(d.getAttributes(), "id");
|
||||
int itemId = parseInteger(d.getAttributes(), "itemId");
|
||||
final int npcId = parseInteger(d.getAttributes(), "id");
|
||||
final int itemId = parseInteger(d.getAttributes(), "itemId");
|
||||
// index ignored for now
|
||||
L2PetData data = new L2PetData(npcId, itemId);
|
||||
final L2PetData data = new L2PetData(npcId, itemId);
|
||||
for (Node p = d.getFirstChild(); p != null; p = p.getNextSibling())
|
||||
{
|
||||
if (p.getNodeName().equals("set"))
|
||||
{
|
||||
attrs = p.getAttributes();
|
||||
String type = attrs.getNamedItem("name").getNodeValue();
|
||||
final String type = attrs.getNamedItem("name").getNodeValue();
|
||||
if ("food".equals(type))
|
||||
{
|
||||
for (String foodId : attrs.getNamedItem("val").getNodeValue().split(";"))
|
||||
|
@@ -79,9 +79,9 @@ public final class PlayerTemplateData implements IXmlReader
|
||||
}
|
||||
else if ("staticData".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
StatsSet set = new StatsSet();
|
||||
final StatsSet set = new StatsSet();
|
||||
set.set("classId", classId);
|
||||
List<Location> creationPoints = new ArrayList<>();
|
||||
final List<Location> creationPoints = new ArrayList<>();
|
||||
|
||||
for (Node nd = d.getFirstChild(); nd != null; nd = nd.getNextSibling())
|
||||
{
|
||||
@@ -152,10 +152,10 @@ public final class PlayerTemplateData implements IXmlReader
|
||||
if ("level".equalsIgnoreCase(lvlNode.getNodeName()))
|
||||
{
|
||||
attrs = lvlNode.getAttributes();
|
||||
int level = parseInteger(attrs, "val");
|
||||
final int level = parseInteger(attrs, "val");
|
||||
for (Node valNode = lvlNode.getFirstChild(); valNode != null; valNode = valNode.getNextSibling())
|
||||
{
|
||||
String nodeName = valNode.getNodeName();
|
||||
final String nodeName = valNode.getNodeName();
|
||||
|
||||
if ((level < Config.PLAYER_MAXIMUM_LEVEL) && (nodeName.startsWith("hp") || nodeName.startsWith("mp") || nodeName.startsWith("cp")) && _playerTemplates.containsKey(ClassId.getClassId(classId)))
|
||||
{
|
||||
|
@@ -58,8 +58,8 @@ public final class PlayerXpPercentLostData implements IXmlReader
|
||||
{
|
||||
if ("xpLost".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
NamedNodeMap attrs = d.getAttributes();
|
||||
Integer level = parseInteger(attrs, "level");
|
||||
final NamedNodeMap attrs = d.getAttributes();
|
||||
final Integer level = parseInteger(attrs, "level");
|
||||
if (level > _maxlevel)
|
||||
{
|
||||
break;
|
||||
|
@@ -71,8 +71,8 @@ public class PrimeShopData implements IXmlReader
|
||||
{
|
||||
if ("list".equalsIgnoreCase(n.getNodeName()))
|
||||
{
|
||||
NamedNodeMap at = n.getAttributes();
|
||||
Node attribute = at.getNamedItem("enabled");
|
||||
final NamedNodeMap at = n.getAttributes();
|
||||
final Node attribute = at.getNamedItem("enabled");
|
||||
if ((attribute != null) && Boolean.parseBoolean(attribute.getNodeValue()))
|
||||
{
|
||||
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
|
||||
@@ -81,14 +81,14 @@ public class PrimeShopData implements IXmlReader
|
||||
{
|
||||
NamedNodeMap attrs = d.getAttributes();
|
||||
Node att;
|
||||
StatsSet set = new StatsSet();
|
||||
final StatsSet set = new StatsSet();
|
||||
for (int i = 0; i < attrs.getLength(); i++)
|
||||
{
|
||||
att = attrs.item(i);
|
||||
set.set(att.getNodeName(), att.getNodeValue());
|
||||
}
|
||||
|
||||
List<PrimeShopItem> items = new ArrayList<>();
|
||||
final List<PrimeShopItem> items = new ArrayList<>();
|
||||
for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling())
|
||||
{
|
||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
||||
|
@@ -76,11 +76,11 @@ public class RecipeData implements IXmlReader
|
||||
recipePartList.clear();
|
||||
recipeStatUseList.clear();
|
||||
recipeAltStatChangeList.clear();
|
||||
NamedNodeMap attrs = d.getAttributes();
|
||||
final NamedNodeMap attrs = d.getAttributes();
|
||||
Node att;
|
||||
int id = -1;
|
||||
boolean haveRare = false;
|
||||
StatsSet set = new StatsSet();
|
||||
final StatsSet set = new StatsSet();
|
||||
|
||||
att = attrs.getNamedItem("id");
|
||||
if (att == null)
|
||||
@@ -135,8 +135,8 @@ public class RecipeData implements IXmlReader
|
||||
{
|
||||
if ("statUse".equalsIgnoreCase(c.getNodeName()))
|
||||
{
|
||||
String statName = c.getAttributes().getNamedItem("name").getNodeValue();
|
||||
int value = Integer.parseInt(c.getAttributes().getNamedItem("value").getNodeValue());
|
||||
final String statName = c.getAttributes().getNamedItem("name").getNodeValue();
|
||||
final int value = Integer.parseInt(c.getAttributes().getNamedItem("value").getNodeValue());
|
||||
try
|
||||
{
|
||||
recipeStatUseList.add(new L2RecipeStatInstance(statName, value));
|
||||
@@ -149,8 +149,8 @@ public class RecipeData implements IXmlReader
|
||||
}
|
||||
else if ("altStatChange".equalsIgnoreCase(c.getNodeName()))
|
||||
{
|
||||
String statName = c.getAttributes().getNamedItem("name").getNodeValue();
|
||||
int value = Integer.parseInt(c.getAttributes().getNamedItem("value").getNodeValue());
|
||||
final String statName = c.getAttributes().getNamedItem("name").getNodeValue();
|
||||
final int value = Integer.parseInt(c.getAttributes().getNamedItem("value").getNodeValue());
|
||||
try
|
||||
{
|
||||
recipeAltStatChangeList.add(new L2RecipeStatInstance(statName, value));
|
||||
@@ -163,8 +163,8 @@ public class RecipeData implements IXmlReader
|
||||
}
|
||||
else if ("ingredient".equalsIgnoreCase(c.getNodeName()))
|
||||
{
|
||||
int ingId = Integer.parseInt(c.getAttributes().getNamedItem("id").getNodeValue());
|
||||
int ingCount = Integer.parseInt(c.getAttributes().getNamedItem("count").getNodeValue());
|
||||
final int ingId = Integer.parseInt(c.getAttributes().getNamedItem("id").getNodeValue());
|
||||
final int ingCount = Integer.parseInt(c.getAttributes().getNamedItem("count").getNodeValue());
|
||||
recipePartList.add(new L2RecipeInstance(ingId, ingCount));
|
||||
}
|
||||
else if ("production".equalsIgnoreCase(c.getNodeName()))
|
||||
@@ -181,7 +181,7 @@ public class RecipeData implements IXmlReader
|
||||
}
|
||||
}
|
||||
|
||||
L2RecipeList recipeList = new L2RecipeList(set, haveRare);
|
||||
final L2RecipeList recipeList = new L2RecipeList(set, haveRare);
|
||||
for (L2RecipeInstance recipePart : recipePartList)
|
||||
{
|
||||
recipeList.addRecipe(recipePart);
|
||||
@@ -235,7 +235,7 @@ public class RecipeData implements IXmlReader
|
||||
*/
|
||||
public int[] getAllItemIds()
|
||||
{
|
||||
int[] idList = new int[_recipes.size()];
|
||||
final int[] idList = new int[_recipes.size()];
|
||||
int i = 0;
|
||||
for (L2RecipeList rec : _recipes.values())
|
||||
{
|
||||
@@ -252,7 +252,7 @@ public class RecipeData implements IXmlReader
|
||||
*/
|
||||
public L2RecipeList getValidRecipeList(L2PcInstance player, int id)
|
||||
{
|
||||
L2RecipeList recipeList = _recipes.get(id);
|
||||
final L2RecipeList recipeList = _recipes.get(id);
|
||||
if ((recipeList == null) || (recipeList.getRecipes().length == 0))
|
||||
{
|
||||
player.sendMessage(getClass().getSimpleName() + ": No recipe for: " + id);
|
||||
|
@@ -110,7 +110,7 @@ public final class ShuttleData implements IXmlReader
|
||||
if ("stop".equalsIgnoreCase(a.getNodeName()))
|
||||
{
|
||||
attrs = a.getAttributes();
|
||||
L2ShuttleStop stop = new L2ShuttleStop(parseInteger(attrs, "id"));
|
||||
final L2ShuttleStop stop = new L2ShuttleStop(parseInteger(attrs, "id"));
|
||||
|
||||
for (Node z = a.getFirstChild(); z != null; z = z.getNextSibling())
|
||||
{
|
||||
@@ -131,7 +131,7 @@ public final class ShuttleData implements IXmlReader
|
||||
if ("route".equalsIgnoreCase(a.getNodeName()))
|
||||
{
|
||||
attrs = a.getAttributes();
|
||||
List<Location> locs = new ArrayList<>();
|
||||
final List<Location> locs = new ArrayList<>();
|
||||
for (Node z = a.getFirstChild(); z != null; z = z.getNextSibling())
|
||||
{
|
||||
if ("loc".equalsIgnoreCase(z.getNodeName()))
|
||||
@@ -141,7 +141,7 @@ public final class ShuttleData implements IXmlReader
|
||||
}
|
||||
}
|
||||
|
||||
VehiclePathPoint[] route = new VehiclePathPoint[locs.size()];
|
||||
final VehiclePathPoint[] route = new VehiclePathPoint[locs.size()];
|
||||
int i = 0;
|
||||
for (Location loc : locs)
|
||||
{
|
||||
|
@@ -75,8 +75,8 @@ public class SiegeScheduleData implements IXmlReader
|
||||
final NamedNodeMap attrs = cd.getAttributes();
|
||||
for (int i = 0; i < attrs.getLength(); i++)
|
||||
{
|
||||
Node node = attrs.item(i);
|
||||
String key = node.getNodeName();
|
||||
final Node node = attrs.item(i);
|
||||
final String key = node.getNodeName();
|
||||
String val = node.getNodeValue();
|
||||
if ("day".equals(key))
|
||||
{
|
||||
|
@@ -773,13 +773,13 @@ public final class SkillTreesData implements IXmlReader
|
||||
public Collection<Skill> getAllAvailableSkills(L2PcInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||
{
|
||||
// Get available skills
|
||||
PlayerSkillHolder holder = new PlayerSkillHolder(player);
|
||||
final PlayerSkillHolder holder = new PlayerSkillHolder(player);
|
||||
List<L2SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
||||
while (learnable.size() > 0)
|
||||
{
|
||||
for (L2SkillLearn s : learnable)
|
||||
{
|
||||
Skill sk = SkillData.getInstance().getSkill(s.getSkillId(), s.getSkillLevel());
|
||||
final Skill sk = SkillData.getInstance().getSkill(s.getSkillId(), s.getSkillLevel());
|
||||
holder.addSkill(sk);
|
||||
}
|
||||
|
||||
@@ -894,7 +894,7 @@ public final class SkillTreesData implements IXmlReader
|
||||
public List<L2SkillLearn> getAvailableRevelationSkills(L2PcInstance player, SubclassType type)
|
||||
{
|
||||
final List<L2SkillLearn> result = new ArrayList<>();
|
||||
Map<Integer, L2SkillLearn> revelationSkills = _revelationSkillTree.get(type);
|
||||
final Map<Integer, L2SkillLearn> revelationSkills = _revelationSkillTree.get(type);
|
||||
|
||||
for (L2SkillLearn skill : revelationSkills.values())
|
||||
{
|
||||
|
@@ -86,7 +86,7 @@ public final class StaticObjectData implements IXmlReader
|
||||
*/
|
||||
private void addObject(StatsSet set)
|
||||
{
|
||||
L2StaticObjectInstance obj = new L2StaticObjectInstance(new L2CharTemplate(new StatsSet()), set.getInt("id"));
|
||||
final L2StaticObjectInstance obj = new L2StaticObjectInstance(new L2CharTemplate(new StatsSet()), set.getInt("id"));
|
||||
obj.setType(set.getInt("type", 0));
|
||||
obj.setName(set.getString("name"));
|
||||
obj.setMap(set.getString("texture", "none"), set.getInt("map_x", 0), set.getInt("map_y", 0));
|
||||
|
@@ -70,16 +70,16 @@ public final class TransformData implements IXmlReader
|
||||
if ("transform".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
NamedNodeMap attrs = d.getAttributes();
|
||||
StatsSet set = new StatsSet();
|
||||
final StatsSet set = new StatsSet();
|
||||
for (int i = 0; i < attrs.getLength(); i++)
|
||||
{
|
||||
Node att = attrs.item(i);
|
||||
final Node att = attrs.item(i);
|
||||
set.set(att.getNodeName(), att.getNodeValue());
|
||||
}
|
||||
final Transform transform = new Transform(set);
|
||||
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
|
||||
{
|
||||
boolean isMale = "Male".equalsIgnoreCase(cd.getNodeName());
|
||||
final boolean isMale = "Male".equalsIgnoreCase(cd.getNodeName());
|
||||
if ("Male".equalsIgnoreCase(cd.getNodeName()) || "Female".equalsIgnoreCase(cd.getNodeName()))
|
||||
{
|
||||
TransformTemplate templateData = null;
|
||||
@@ -103,7 +103,7 @@ public final class TransformData implements IXmlReader
|
||||
attrs = s.getAttributes();
|
||||
for (int i = 0; i < attrs.getLength(); i++)
|
||||
{
|
||||
Node att = attrs.item(i);
|
||||
final Node att = attrs.item(i);
|
||||
set.set(att.getNodeName(), att.getNodeValue());
|
||||
}
|
||||
break;
|
||||
@@ -126,8 +126,8 @@ public final class TransformData implements IXmlReader
|
||||
if ("skill".equals(s.getNodeName()))
|
||||
{
|
||||
attrs = s.getAttributes();
|
||||
int skillId = parseInteger(attrs, "id");
|
||||
int skillLevel = parseInteger(attrs, "level");
|
||||
final int skillId = parseInteger(attrs, "id");
|
||||
final int skillLevel = parseInteger(attrs, "level");
|
||||
templateData.addSkill(new SkillHolder(skillId, skillLevel));
|
||||
}
|
||||
}
|
||||
@@ -157,9 +157,9 @@ public final class TransformData implements IXmlReader
|
||||
if ("skill".equals(s.getNodeName()))
|
||||
{
|
||||
attrs = s.getAttributes();
|
||||
int skillId = parseInteger(attrs, "id");
|
||||
int skillLevel = parseInteger(attrs, "level");
|
||||
int minLevel = parseInteger(attrs, "minLevel");
|
||||
final int skillId = parseInteger(attrs, "id");
|
||||
final int skillLevel = parseInteger(attrs, "level");
|
||||
final int minLevel = parseInteger(attrs, "minLevel");
|
||||
templateData.addAdditionalSkill(new AdditionalSkillHolder(skillId, skillLevel, minLevel));
|
||||
}
|
||||
}
|
||||
@@ -177,8 +177,8 @@ public final class TransformData implements IXmlReader
|
||||
if ("item".equals(s.getNodeName()))
|
||||
{
|
||||
attrs = s.getAttributes();
|
||||
int itemId = parseInteger(attrs, "id");
|
||||
boolean allowed = parseBoolean(attrs, "allowed");
|
||||
final int itemId = parseInteger(attrs, "id");
|
||||
final boolean allowed = parseBoolean(attrs, "allowed");
|
||||
templateData.addAdditionalItem(new AdditionalItemHolder(itemId, allowed));
|
||||
}
|
||||
}
|
||||
@@ -200,7 +200,7 @@ public final class TransformData implements IXmlReader
|
||||
attrs = s.getAttributes();
|
||||
for (int i = 0; i < attrs.getLength(); i++)
|
||||
{
|
||||
Node att = attrs.item(i);
|
||||
final Node att = attrs.item(i);
|
||||
levelsSet.set(att.getNodeName(), att.getNodeValue());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user