Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P aCis_gameserver
- Index: java/net/sf/l2j/gameserver/model/actor/knownlist/NpcKnownList.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/knownlist/NpcKnownList.java (revision 288)
- +++ java/net/sf/l2j/gameserver/model/actor/knownlist/NpcKnownList.java (working copy)
- @@ -14,6 +14,10 @@
- */
- package net.sf.l2j.gameserver.model.actor.knownlist;
- +import java.util.ArrayList;
- +import java.util.Collection;
- +import java.util.List;
- +
- import net.sf.l2j.gameserver.model.L2Object;
- import net.sf.l2j.gameserver.model.actor.L2Character;
- import net.sf.l2j.gameserver.model.actor.L2Npc;
- @@ -21,6 +25,8 @@
- import net.sf.l2j.gameserver.model.actor.instance.L2CabaleBufferInstance;
- import net.sf.l2j.gameserver.model.actor.instance.L2FestivalGuideInstance;
- import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +import net.sf.l2j.gameserver.util.Util;
- public class NpcKnownList extends CharKnownList
- {
- @@ -58,4 +64,42 @@
- return 500;
- }
- +
- + @Override
- + @SuppressWarnings("unchecked")
- + public <A> Collection<A> getKnownType(Class<A> type)
- + {
- + List<A> result = new ArrayList<>();
- +
- + for (L2Object obj : _knownObjects.values())
- + {
- + if (type.isAssignableFrom(obj.getClass()))
- + {
- + if (obj instanceof L2PcInstance && ((L2PcInstance) obj).isGM() && ((L2PcInstance) obj).getAppearance().getInvisible())
- + continue;
- +
- + result.add((A) obj);
- + }
- + }
- + return result;
- + }
- +
- + @Override
- + @SuppressWarnings("unchecked")
- + public <A> Collection<A> getKnownTypeInRadius(Class<A> type, int radius)
- + {
- + List<A> result = new ArrayList<>();
- +
- + for (L2Object obj : _knownObjects.values())
- + {
- + if (type.isAssignableFrom(obj.getClass()) && Util.checkIfInRange(radius, getActiveObject(), obj, true))
- + {
- + if (obj instanceof L2PcInstance && ((L2PcInstance) obj).isGM() && ((L2PcInstance) obj).getAppearance().getInvisible())
- + continue;
- +
- + result.add((A) obj);
- + }
- + }
- + return result;
- + }
- }
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/model/actor/knownlist/ObjectKnownList.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/knownlist/ObjectKnownList.java (revision 288)
- +++ java/net/sf/l2j/gameserver/model/actor/knownlist/ObjectKnownList.java (working copy)
- @@ -132,7 +132,7 @@
- }
- @SuppressWarnings("unchecked")
- - public final <A> Collection<A> getKnownType(Class<A> type)
- + public <A> Collection<A> getKnownType(Class<A> type)
- {
- List<A> result = new ArrayList<>();
- @@ -145,7 +145,7 @@
- }
- @SuppressWarnings("unchecked")
- - public final <A> Collection<A> getKnownTypeInRadius(Class<A> type, int radius)
- + public <A> Collection<A> getKnownTypeInRadius(Class<A> type, int radius)
- {
- List<A> result = new ArrayList<>();
Advertisement
Add Comment
Please, Sign In to add comment