NPC hider based on name
This commit is contained in:
@@ -64,6 +64,10 @@ public abstract class EntityHiderBridgeMixin implements RSClient
|
||||
@Inject
|
||||
public static boolean hideProjectiles;
|
||||
|
||||
@Inject
|
||||
public static String hideNPCsNames;
|
||||
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void setIsHidingEntities(boolean state)
|
||||
@@ -127,6 +131,13 @@ public abstract class EntityHiderBridgeMixin implements RSClient
|
||||
hideNPCs2D = state;
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void setNPCsNames(String NPCs)
|
||||
{
|
||||
hideNPCsNames = NPCs;
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void setAttackersHidden(boolean state)
|
||||
|
||||
@@ -67,6 +67,9 @@ public abstract class EntityHiderMixin implements RSScene
|
||||
@Shadow("hideNPCs")
|
||||
private static boolean hideNPCs;
|
||||
|
||||
@Shadow("hideNPCsNames")
|
||||
private static String hideNPCsNames;
|
||||
|
||||
@Shadow("hideNPCs2D")
|
||||
private static boolean hideNPCs2D;
|
||||
|
||||
@@ -151,6 +154,7 @@ public abstract class EntityHiderMixin implements RSScene
|
||||
else if (renderable instanceof RSNPC)
|
||||
{
|
||||
RSNPC npc = (RSNPC) renderable;
|
||||
String[] names = hideNPCsNames.split(",");
|
||||
|
||||
if (!hideAttackers)
|
||||
{
|
||||
@@ -160,6 +164,14 @@ public abstract class EntityHiderMixin implements RSScene
|
||||
}
|
||||
}
|
||||
|
||||
for(String name: names)
|
||||
{
|
||||
if(names.equals(npc.getName()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return drawingUI ? !hideNPCs2D : !hideNPCs;
|
||||
}
|
||||
else if (renderable instanceof RSProjectile)
|
||||
|
||||
Reference in New Issue
Block a user