فهرست منبع

BETA: Fix for #5795
Changed related L2TIntObjectHashMap to use .values(V[]) too.

Zoey76 13 سال پیش
والد
کامیت
26edaf9aa4

+ 5 - 5
L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/NpcTable.java

@@ -316,7 +316,7 @@ public class NpcTable
 	 */
 	public L2NpcTemplate getTemplateByName(String name)
 	{
-		for (L2NpcTemplate npcTemplate : _npcs.valueCollection())
+		for (L2NpcTemplate npcTemplate : _npcs.values(new L2NpcTemplate[0]))
 		{
 			if (npcTemplate.getName().equalsIgnoreCase(name))
 			{
@@ -335,7 +335,7 @@ public class NpcTable
 		final List<L2NpcTemplate> list = new FastList<>();
 		for (int lvl : lvls)
 		{
-			for (L2NpcTemplate t : _npcs.valueCollection())
+			for (L2NpcTemplate t : _npcs.values(new L2NpcTemplate[0]))
 			{
 				if (t.getLevel() == lvl)
 				{
@@ -355,7 +355,7 @@ public class NpcTable
 		final List<L2NpcTemplate> list = new FastList<>();
 		for (int lvl : lvls)
 		{
-			for (L2NpcTemplate t : _npcs.valueCollection())
+			for (L2NpcTemplate t : _npcs.values(new L2NpcTemplate[0]))
 			{
 				if ((t.getLevel() == lvl) && t.isType("L2Monster"))
 				{
@@ -375,7 +375,7 @@ public class NpcTable
 		final List<L2NpcTemplate> list = new FastList<>();
 		for (String letter : letters)
 		{
-			for (L2NpcTemplate t : _npcs.valueCollection())
+			for (L2NpcTemplate t : _npcs.values(new L2NpcTemplate[0]))
 			{
 				if (t.getName().startsWith(letter) && t.isType("L2Npc"))
 				{
@@ -395,7 +395,7 @@ public class NpcTable
 		final List<L2NpcTemplate> list = new FastList<>();
 		for (String classType : classTypes)
 		{
-			for (L2NpcTemplate t : _npcs.valueCollection())
+			for (L2NpcTemplate t : _npcs.values(new L2NpcTemplate[0]))
 			{
 				if (t.isType(classType))
 				{

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

@@ -111,7 +111,7 @@ public class SummonItemsData
 		int size = _summonitems.size();
 		int[] result = new int[size];
 		int i = 0;
-		for (L2SummonItem si : _summonitems.valueCollection())
+		for (L2SummonItem si : _summonitems.values(new L2SummonItem[0]))
 		{
 			result[i++] = si.getItemId();
 		}

+ 5 - 5
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -728,7 +728,7 @@ public final class L2PcInstance extends L2Playable
 	
 	protected boolean _inventoryDisable = false;
 	
-	protected L2TIntObjectHashMap<L2CubicInstance> _cubics = new L2TIntObjectHashMap<L2CubicInstance>();
+	private L2TIntObjectHashMap<L2CubicInstance> _cubics = new L2TIntObjectHashMap<>();
 	
 	/** Active shots. */
 	protected FastSet<Integer> _activeSoulShots = new FastSet<Integer>().shared();
@@ -5590,7 +5590,7 @@ public final class L2PcInstance extends L2Playable
 		// Unsummon Cubics
 		if (!_cubics.isEmpty())
 		{
-			for (L2CubicInstance cubic : _cubics.valueCollection())
+			for (L2CubicInstance cubic : _cubics.values(new L2CubicInstance[0]))
 			{
 				cubic.stopAction();
 				cubic.cancelDisappear();
@@ -9646,7 +9646,7 @@ public final class L2PcInstance extends L2Playable
 		if (getCubics() != null)
 		{
 			boolean removed = false;
-			for (L2CubicInstance cubic : _cubics.valueCollection())
+			for (L2CubicInstance cubic : _cubics.values(new L2CubicInstance[0]))
 			{
 				cubic.stopAction();
 				delCubic(cubic.getId());
@@ -9662,7 +9662,7 @@ public final class L2PcInstance extends L2Playable
 		if (getCubics() != null)
 		{
 			boolean removed = false;
-			for (L2CubicInstance cubic : _cubics.valueCollection())
+			for (L2CubicInstance cubic : _cubics.values(new L2CubicInstance[0]))
 			{
 				if (cubic.givenByOther())
 				{
@@ -10150,7 +10150,7 @@ public final class L2PcInstance extends L2Playable
 		
 		if (!getCubics().isEmpty())
 		{
-			for (L2CubicInstance cubic : _cubics.valueCollection())
+			for (L2CubicInstance cubic : _cubics.values(new L2CubicInstance[0]))
 			{
 				cubic.stopAction();
 				cubic.cancelDisappear();

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/skills/l2skills/L2SkillSummon.java

@@ -167,7 +167,7 @@ public class L2SkillSummon extends L2Skill
 					if (mastery == 0 && !player.getCubics().isEmpty())
 					{
 						// Player can have only 1 cubic - we should replace old cubic with new one
-						for (L2CubicInstance c: player.getCubics().valueCollection())
+						for (L2CubicInstance c: player.getCubics().values(new L2CubicInstance[0]))
 						{
 							c.stopAction();
 							c = null;

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/taskmanager/AttackStanceTaskManager.java

@@ -64,7 +64,7 @@ public class AttackStanceTaskManager
 		if (actor instanceof L2PcInstance)
 		{
 			L2PcInstance player = (L2PcInstance) actor;
-			for (L2CubicInstance cubic : player.getCubics().valueCollection())
+			for (L2CubicInstance cubic : player.getCubics().values(new L2CubicInstance[0]))
 				if (cubic.getId() != L2CubicInstance.LIFE_CUBIC)
 					cubic.doAction();
 		}