Removed InstanceManager import from InstanceWorld.

This commit is contained in:
MobiusDev 2018-04-30 01:16:12 +00:00
parent fc35e75a42
commit fa2d194ac8

View File

@ -21,7 +21,6 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.l2jmobius.commons.util.CommonUtil; import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
@ -39,26 +38,6 @@ public class InstanceWorld
private final List<Integer> _allowed = new CopyOnWriteArrayList<>(); private final List<Integer> _allowed = new CopyOnWriteArrayList<>();
private final StatsSet _parameters = new StatsSet(); private final StatsSet _parameters = new StatsSet();
public List<Integer> getAllowed()
{
return _allowed;
}
public void removeAllowed(int id)
{
_allowed.remove(_allowed.indexOf(Integer.valueOf(id)));
}
public void addAllowed(int id)
{
_allowed.add(id);
}
public boolean isAllowed(int id)
{
return _allowed.contains(id);
}
/** /**
* Sets the instance. * Sets the instance.
* @param instance the instance * @param instance the instance
@ -86,6 +65,26 @@ public class InstanceWorld
return _instance.getId(); return _instance.getId();
} }
public List<Integer> getAllowed()
{
return _allowed;
}
public void removeAllowed(int id)
{
_allowed.remove(_allowed.indexOf(Integer.valueOf(id)));
}
public void addAllowed(int id)
{
_allowed.add(id);
}
public boolean isAllowed(int id)
{
return _allowed.contains(id);
}
/** /**
* Set instance world parameter. * Set instance world parameter.
* @param key parameter name * @param key parameter name
@ -157,19 +156,14 @@ public class InstanceWorld
*/ */
public void onDeath(L2Character killer, L2Character victim) public void onDeath(L2Character killer, L2Character victim)
{ {
if ((victim == null) || !victim.isPlayer()) if ((victim == null) || !victim.isPlayer() || (_instance == null))
{
return;
}
final Instance instance = InstanceManager.getInstance().getInstance(getInstanceId());
if (instance == null)
{ {
return; return;
} }
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IF_YOU_ARE_NOT_RESURRECTED_WITHIN_S1_MINUTES_YOU_WILL_BE_EXPELLED_FROM_THE_INSTANT_ZONE); final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IF_YOU_ARE_NOT_RESURRECTED_WITHIN_S1_MINUTES_YOU_WILL_BE_EXPELLED_FROM_THE_INSTANT_ZONE);
sm.addInt(instance.getEjectTime() / 60 / 1000); sm.addInt(_instance.getEjectTime() / 60 / 1000);
victim.getActingPlayer().sendPacket(sm); victim.getActingPlayer().sendPacket(sm);
instance.addEjectDeadTask(victim.getActingPlayer()); _instance.addEjectDeadTask(victim.getActingPlayer());
} }
/** /**