entity hider: add option to hide dead npcs
This commit is contained in:
@@ -176,4 +176,15 @@ public interface EntityHiderConfig extends Config
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
position = 14,
|
||||||
|
keyName = "hideDeadNpcs",
|
||||||
|
name = "Hide Dead NPCs",
|
||||||
|
description = "Hides NPCs when their health reaches 0"
|
||||||
|
)
|
||||||
|
default boolean hideDeadNpcs()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ public class EntityHiderPlugin extends Plugin
|
|||||||
private boolean hideLocalPlayer2D;
|
private boolean hideLocalPlayer2D;
|
||||||
private boolean hideNPCs;
|
private boolean hideNPCs;
|
||||||
private boolean hideNPCs2D;
|
private boolean hideNPCs2D;
|
||||||
|
private boolean hideDeadNpcs;
|
||||||
private boolean hidePets;
|
private boolean hidePets;
|
||||||
private boolean hideAttackers;
|
private boolean hideAttackers;
|
||||||
private boolean hideProjectiles;
|
private boolean hideProjectiles;
|
||||||
@@ -118,6 +119,7 @@ public class EntityHiderPlugin extends Plugin
|
|||||||
|
|
||||||
hideNPCs = config.hideNPCs();
|
hideNPCs = config.hideNPCs();
|
||||||
hideNPCs2D = config.hideNPCs2D();
|
hideNPCs2D = config.hideNPCs2D();
|
||||||
|
hideDeadNpcs = config.hideDeadNpcs();
|
||||||
|
|
||||||
hidePets = config.hidePets();
|
hidePets = config.hidePets();
|
||||||
|
|
||||||
@@ -187,6 +189,12 @@ public class EntityHiderPlugin extends Plugin
|
|||||||
return !hidePets;
|
return !hidePets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// dead npcs can also be interacting so prioritize it over the interacting check
|
||||||
|
if (npc.isDead() && hideDeadNpcs)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (npc.getInteracting() == client.getLocalPlayer())
|
if (npc.getInteracting() == client.getLocalPlayer())
|
||||||
{
|
{
|
||||||
boolean b = hideAttackers;
|
boolean b = hideAttackers;
|
||||||
|
|||||||
Reference in New Issue
Block a user