menu entry swapper: expand talk-to/pickpocket swap to non-blackjack npcs

This commit is contained in:
Adam
2019-08-23 22:30:10 -04:00
parent fba1d0ad51
commit c2bda2d47f
2 changed files with 8 additions and 3 deletions

View File

@@ -194,8 +194,8 @@ public interface MenuEntrySwapperConfig extends Config
@ConfigItem(
keyName = "swapPickpocket",
name = "Pickpocket on H.A.M.",
description = "Swap Talk-to with Pickpocket on H.A.M members"
name = "Pickpocket",
description = "Swap Talk-to with Pickpocket"
)
default boolean swapPickpocket()
{

View File

@@ -373,7 +373,7 @@ public class MenuEntrySwapperPlugin extends Plugin
if (option.equals("talk-to"))
{
if (config.swapPickpocket() && target.contains("h.a.m."))
if (config.swapPickpocket() && shouldSwapPickpocket(target))
{
swap("pickpocket", option, target, true);
}
@@ -596,6 +596,11 @@ public class MenuEntrySwapperPlugin extends Plugin
}
}
private static boolean shouldSwapPickpocket(String target)
{
return !target.startsWith("villager") && !target.startsWith("bandit") && !target.startsWith("menaphite thug");
}
@Subscribe
public void onPostItemComposition(PostItemComposition event)
{