Forráskód Böngészése

BETA: Minor code refactor:
* getRandomPartyMember(L2PcInstance, String) to getRandomPartyMember(L2PcInstance, int).

Zoey76 12 éve
szülő
commit
74c7786ee3

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/HerbDropTable.java

@@ -38,7 +38,7 @@ import com.l2jserver.gameserver.model.L2DropData;
  */
 public class HerbDropTable
 {
-	private static Logger _log = Logger.getLogger(HerbDropTable.class.getName());
+	private static final Logger _log = Logger.getLogger(HerbDropTable.class.getName());
 	
 	private final Map<Integer, List<L2DropCategory>> _herbGroups = new HashMap<>();
 	

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/InitialEquipmentData.java

@@ -39,8 +39,8 @@ import com.l2jserver.gameserver.model.items.PcItemTemplate;
  */
 public final class InitialEquipmentData extends DocumentParser
 {
-	private static final String filePathNormal = "data/stats/initialEquipment.xml";
-	private static final String filePathEvent = "data/stats/initialEquipmentEvent.xml";
+	private static final String NORMAL = "data/stats/initialEquipment.xml";
+	private static final String EVENT = "data/stats/initialEquipmentEvent.xml";
 	private final Map<ClassId, List<PcItemTemplate>> _initialEquipmentList = new HashMap<>();
 	
 	/**
@@ -55,7 +55,7 @@ public final class InitialEquipmentData extends DocumentParser
 	public void load()
 	{
 		_initialEquipmentList.clear();
-		parseDatapackFile(Config.INITIAL_EQUIPMENT_EVENT ? filePathEvent : filePathNormal);
+		parseDatapackFile(Config.INITIAL_EQUIPMENT_EVENT ? EVENT : NORMAL);
 		_log.info(getClass().getSimpleName() + ": Loaded " + _initialEquipmentList.size() + " Initial Equipment data.");
 	}
 	

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/conditions/ConditionPlayerCanSweep.java

@@ -39,8 +39,8 @@ import com.l2jserver.gameserver.network.SystemMessageId;
  */
 public class ConditionPlayerCanSweep extends Condition
 {
+	private static final int MAX_SWEEP_TIME = 15000;
 	private final boolean _val;
-	private static final int maxSweepTime = 15000;
 	
 	public ConditionPlayerCanSweep(boolean val)
 	{
@@ -71,7 +71,7 @@ public class ConditionPlayerCanSweep extends Condition
 								if (target.isSpoil())
 								{
 									canSweep = target.checkSpoilOwner(sweeper, true);
-									canSweep &= target.checkCorpseTime(sweeper, maxSweepTime, true);
+									canSweep &= target.checkCorpseTime(sweeper, MAX_SWEEP_TIME, true);
 									canSweep &= sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true);
 								}
 								else

+ 6 - 8
L2J_Server_BETA/java/com/l2jserver/gameserver/model/quest/Quest.java

@@ -92,7 +92,7 @@ import com.l2jserver.util.Util;
  */
 public class Quest extends ManagedScript
 {
-	protected static final Logger _log = Logger.getLogger(Quest.class.getName());
+	public static final Logger _log = Logger.getLogger(Quest.class.getName());
 	
 	/** Map containing events from String value of the event. */
 	private static Map<String, Quest> _allEventsS = new HashMap<>();
@@ -2485,16 +2485,14 @@ public class Quest extends ManagedScript
 	}
 	
 	/**
-	 * Auxiliary function for party quests.<br>
-	 * Note: This function is only here because of how commonly it may be used by quest developers.<br>
-	 * For any variations on this function, the quest script can always handle things on its own.
+	 * Get a random party member with required cond value.
 	 * @param player the instance of a player whose party is to be searched
-	 * @param value the value of the "cond" variable that must be matched
-	 * @return L2PcInstance: L2PcInstance for a random party member that matches the specified condition, or {@code null} if no match was found
+	 * @param cond the value of the "cond" variable that must be matched
+	 * @return a random party member that matches the specified condition, or {@code null} if no match was found
 	 */
-	public L2PcInstance getRandomPartyMember(L2PcInstance player, String value)
+	public L2PcInstance getRandomPartyMember(L2PcInstance player, int cond)
 	{
-		return getRandomPartyMember(player, "cond", value);
+		return getRandomPartyMember(player, "cond", String.valueOf(cond));
 	}
 	
 	/**

+ 2 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExVoteSystemInfo.java

@@ -22,7 +22,8 @@ import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.entity.RecoBonus;
 
 /**
- ** @author Gnacik
+ * ExVoteSystemInfo packet implemetation.
+ * @author Gnacik
  */
 public class ExVoteSystemInfo extends L2GameServerPacket
 {