Bläddra i källkod

BETA: Other changes.

Zoey76 13 år sedan
förälder
incheckning
a01f87f1ac

+ 19 - 5
L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/FishingMonstersData.java

@@ -82,21 +82,35 @@ public final class FishingMonstersData extends DocumentParser
 	
 	/**
 	 * Gets the fishing monster.
-	 * @param lvl the fisher lvl
-	 * @return A fishing monster by fisher lvl
+	 * @param lvl the fisherman level
+	 * @return a fishing monster given the fisherman level
 	 */
 	public L2FishingMonster getFishingMonster(int lvl)
 	{
-		for (Map.Entry<Integer, L2FishingMonster> fishingMonster : _fishingMonstersData.entrySet())
+		for (L2FishingMonster fishingMonster : _fishingMonstersData.values())
 		{
-			if ((lvl >= fishingMonster.getValue().getUserMinLevel()) && (lvl <= fishingMonster.getValue().getUserMaxLevel()))
+			if ((lvl >= fishingMonster.getUserMinLevel()) && (lvl <= fishingMonster.getUserMaxLevel()))
 			{
-				return fishingMonster.getValue();
+				return fishingMonster;
 			}
 		}
 		return null;
 	}
 	
+	/**
+	 * Gets the fishing monster by Id.
+	 * @param id the fishing monster Id
+	 * @return the fishing monster by Id
+	 */
+	public L2FishingMonster getFishingMonsterById(int id)
+	{
+		if (_fishingMonstersData.containsKey(id))
+		{
+			return _fishingMonstersData.get(id);
+		}
+		return null;
+	}
+	
 	/**
 	 * Gets the single instance of FishingMonsterData.
 	 * @return single instance of FishingMonsterData