npcutil: make rtconfig nullable
This commit is contained in:
@@ -26,19 +26,22 @@
|
|||||||
package net.runelite.client.game;
|
package net.runelite.client.game;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.NPC;
|
import net.runelite.api.NPC;
|
||||||
import net.runelite.api.NPCComposition;
|
import net.runelite.api.NPCComposition;
|
||||||
import net.runelite.api.NpcID;
|
import net.runelite.api.NpcID;
|
||||||
import net.runelite.client.RuntimeConfig;
|
import net.runelite.client.RuntimeConfig;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class NpcUtil
|
public class NpcUtil
|
||||||
{
|
{
|
||||||
private final RuntimeConfig runtimeConfig;
|
private final RuntimeConfig runtimeConfig;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private NpcUtil(RuntimeConfig runtimeConfig)
|
private NpcUtil(@Nullable RuntimeConfig runtimeConfig)
|
||||||
{
|
{
|
||||||
this.runtimeConfig = runtimeConfig;
|
this.runtimeConfig = runtimeConfig;
|
||||||
}
|
}
|
||||||
@@ -92,10 +95,13 @@ public class NpcUtil
|
|||||||
case NpcID.KALPHITE_QUEEN_963: // KQ's first form sometimes regenerates 1hp after reaching 0hp, thus not dying
|
case NpcID.KALPHITE_QUEEN_963: // KQ's first form sometimes regenerates 1hp after reaching 0hp, thus not dying
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
Set<Integer> ignoredNpcs = runtimeConfig.getIgnoreDeadNpcs();
|
if (runtimeConfig != null)
|
||||||
if (ignoredNpcs != null && ignoredNpcs.contains(id))
|
|
||||||
{
|
{
|
||||||
return false;
|
Set<Integer> ignoredNpcs = runtimeConfig.getIgnoreDeadNpcs();
|
||||||
|
if (ignoredNpcs != null && ignoredNpcs.contains(id))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final NPCComposition npcComposition = npc.getTransformedComposition();
|
final NPCComposition npcComposition = npc.getTransformedComposition();
|
||||||
|
|||||||
Reference in New Issue
Block a user