заменить правую часть, на ту как здесь.
public static Map<Integer, NpcLocation> _shadowSpawns = new HashMap<Integer, NpcLocation>();
public static Map<Integer, NpcLocation> _mysteriousBoxSpawns = new HashMap<Integer, NpcLocation>();
public static Map<Integer, List<NpcLocation>> _dukeFinalMobs = new HashMap<Integer, List<NpcLocation>>();
public static Map<Integer, List<NpcLocation>> _emperorsGraveNpcs = new HashMap<Integer, List<NpcLocation>>();
public static Map<Integer, List<NpcLocation>> _magicalMonsters = new HashMap<Integer, List<NpcLocation>>();
public static Map<Integer, List<NpcLocation>> _physicalMonsters = new HashMap<Integer, List<NpcLocation>>();
public static Map<Integer, Location> _startHallSpawns = new HashMap<Integer, Location>();
public static Map<Integer, Boolean> _hallInUse = new HashMap<Integer, Boolean>();
public static List<GateKeeper> _GateKeepers = new ArrayList<GateKeeper>();
public static Map<Integer, Integer> _keyBoxNpc = new HashMap<Integer, Integer>();
public static Map<Integer, Integer> _victim = new HashMap<Integer, Integer>();
public static Map<Integer, Boolean> _archonSpawned = new HashMap<Integer, Boolean>();
в этой функции переместить объявление переменной locations ниже без final
private static int loadSpawn(Map<Integer, List<NpcLocation>> table, int type) {
int count = 0;
try {
/* final List<NpcLocation> locations = new ArrayList<NpcLocation>();
*/
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(false);
factory.setIgnoringComments(true);
final File file = new File(ServerConfig.DATAPACK_ROOT, "data/xmlscript/static/four_sepulchers_spawnlist.xml");
final Document document = factory.newDocumentBuilder().parse(file);
for (Node firstNode = document.getFirstChild(); firstNode != null; firstNode = firstNode.getNextSibling()) {
if ("list".equalsIgnoreCase(firstNode.getNodeName())) {
for (Node secondNode = firstNode.getFirstChild(); secondNode != null; secondNode = secondNode.getNextSibling()) {
if ("npc".equalsIgnoreCase(secondNode.getNodeName())) {
/*locations.clear();
*/
List<NpcLocation> locations = new ArrayList<NpcLocation>();
final NamedNodeMap attrs = secondNode.getAttributes();
final int npcKeyId = Integer.parseInt(attrs.getNamedItem("keyId").getNodeValue());
final int spawnType = Integer.parseInt(attrs.getNamedItem("spawnType").getNodeValue());
if (spawnType == type) {
for (Node thirdNode = secondNode.getFirstChild(); thirdNode != null; thirdNode = thirdNode.getNextSibling()) {
if ("data".equalsIgnoreCase(thirdNode.getNodeName())) {
final NamedNodeMap attrs1 = thirdNode.getAttributes();
final int templateId = Integer.parseInt(attrs1.getNamedItem("templateId").getNodeValue());
final String[] spawnLocationData = attrs1.getNamedItem("location").getNodeValue().split(",");
final int heading = Integer.parseInt(attrs1.getNamedItem("heading").getNodeValue());
final int x = Integer.parseInt(spawnLocationData[0]);
final int y = Integer.parseInt(spawnLocationData[1]);
final int z = Integer.parseInt(spawnLocationData[2]);
locations.add(new NpcLocation(x, y, z, heading, templateId));
count++;
}
}
table.put(npcKeyId, locations);
}
}
}
}
}
} catch (Exception e) {
_log.error("Error loading four_sepulchers_spawnlist.xml {}", e.getLocalizedMessage());
}
return count;
}