entityhider: Hide npcs on death. (#1195)
This commit is contained in:
@@ -70,6 +70,8 @@ public abstract class EntityHiderBridgeMixin implements RSClient
|
||||
@Inject
|
||||
public static String hideNPCsNames;
|
||||
|
||||
@Inject
|
||||
public static String hideNPCsOnDeath;
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
@@ -141,6 +143,13 @@ public abstract class EntityHiderBridgeMixin implements RSClient
|
||||
hideNPCsNames = NPCs;
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void setNPCsHiddenOnDeath(String NPCs)
|
||||
{
|
||||
hideNPCsOnDeath = NPCs;
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void setAttackersHidden(boolean state)
|
||||
|
||||
@@ -68,7 +68,10 @@ public abstract class EntityHiderMixin implements RSScene
|
||||
private static boolean hideNPCs;
|
||||
|
||||
@Shadow("hideNPCsNames")
|
||||
private static String hideNPCsNames;
|
||||
private static String hideNPCsNames;
|
||||
|
||||
@Shadow("hideNPCsOnDeath")
|
||||
private static String hideNPCsOnDeath;
|
||||
|
||||
@Shadow("hideNPCs2D")
|
||||
private static boolean hideNPCs2D;
|
||||
@@ -158,6 +161,7 @@ public abstract class EntityHiderMixin implements RSScene
|
||||
{
|
||||
RSNPC npc = (RSNPC) renderable;
|
||||
String[] names = hideNPCsNames.split(",");
|
||||
String[] removeOnDeath = hideNPCsOnDeath.split(",");
|
||||
|
||||
if (!hideAttackers)
|
||||
{
|
||||
@@ -176,12 +180,20 @@ public abstract class EntityHiderMixin implements RSScene
|
||||
{
|
||||
if (name != null && !name.equals(""))
|
||||
{
|
||||
if (npc.getName() != null)
|
||||
if (npc.getName() != null && npc.getName().startsWith(name))
|
||||
{
|
||||
if (npc.getName().startsWith(name))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (String name : removeOnDeath)
|
||||
{
|
||||
if (name != null && !name.equals(""))
|
||||
{
|
||||
if (npc.getName() != null && npc.getName().startsWith(name) && npc.getHealthRatio() == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user