Procházet zdrojové kódy

BETA: Minor changes to getHtm() method by UnAfraid, there will be examples of use later.

Zoey76 před 12 roky
rodič
revize
f561bc2de6

+ 3 - 4
L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/EnchantItemData.java

@@ -29,6 +29,7 @@ import com.l2jserver.gameserver.model.StatsSet;
 import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
 
 /**
+ * This class holds the Enchant Item information.
  * @author UnAfraid
  */
 public class EnchantItemData extends DocumentParser
@@ -76,12 +77,11 @@ public class EnchantItemData extends DocumentParser
 						}
 						
 						List<Integer> items = new ArrayList<>();
-						
 						for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
 						{
 							if ("item".equalsIgnoreCase(cd.getNodeName()))
 							{
-								items.add(parseInt(cd.getAttributes(), "id"));
+								items.add(parseInteger(cd.getAttributes(), "id"));
 							}
 						}
 						EnchantScroll item = new EnchantScroll(set, items);
@@ -99,12 +99,11 @@ public class EnchantItemData extends DocumentParser
 						}
 						
 						List<Integer> items = new ArrayList<>();
-						
 						for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
 						{
 							if ("item".equalsIgnoreCase(cd.getNodeName()))
 							{
-								items.add(parseInt(cd.getAttributes(), "id"));
+								items.add(parseInteger(cd.getAttributes(), "id"));
 							}
 						}
 						EnchantItem item = new EnchantItem(set, items);

+ 9 - 5
L2J_Server_BETA/java/com/l2jserver/gameserver/model/quest/Quest.java

@@ -2362,20 +2362,24 @@ public class Quest extends ManagedScript
 	}
 	
 	/**
-	 * Return HTML file contents
 	 * @param prefix player's language prefix.
 	 * @param fileName the html file to be get.
-	 * @return
+	 * @return the HTML file contents
 	 */
 	public String getHtm(String prefix, String fileName)
 	{
-		String content = HtmCache.getInstance().getHtm(prefix, fileName.startsWith("data/") ? fileName : "data/scripts/" + getDescr().toLowerCase() + "/" + getName() + "/" + fileName);
+		final HtmCache hc = HtmCache.getInstance();
+		String content = hc.getHtm(prefix, fileName.startsWith("data/") ? fileName : "data/scripts/" + getDescr().toLowerCase() + "/" + getName() + "/" + fileName);
 		if (content == null)
 		{
-			content = HtmCache.getInstance().getHtm(prefix, "data/scripts/quests/Q" + getName() + "/" + fileName);
+			content = hc.getHtm(prefix, "data/scripts/" + getDescr() + "/" + getName() + "/" + fileName);
 			if (content == null)
 			{
-				content = HtmCache.getInstance().getHtmForce(prefix, "data/scripts/quests/" + getName() + "/" + fileName);
+				content = hc.getHtm(prefix, "data/scripts/quests/Q" + getName() + "/" + fileName);
+				if (content == null)
+				{
+					content = hc.getHtmForce(prefix, "data/scripts/quests/" + getName() + "/" + fileName);
+				}
 			}
 		}
 		return content;