Skip to content
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.

Commit

Permalink
WorldHopper: Remove BH World (#2096)
Browse files Browse the repository at this point in the history
WorldHopper: Remove BH World
  • Loading branch information
Owain94 authored Dec 5, 2019
2 parents dacf826 + 8beae6d commit 3dff365
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,23 @@ default boolean removePVPWorld()
{
return false;
}

@ConfigItem(
keyName = "removeBHWorld",
name = "Remove Hop-to menu option (BH)",
description = "Removes Hop-to menu option for Bounty Hunter worlds",
position = 8
)
default boolean removeBHWorld()
{
return false;
}

@ConfigItem(
keyName = "subscriptionFilter",
name = "Show subscription types",
description = "Only show free worlds, member worlds, or both types of worlds in sidebar",
position = 8
position = 9
)
default SubscriptionFilterMode subscriptionFilter()
{
Expand All @@ -140,7 +151,7 @@ default SubscriptionFilterMode subscriptionFilter()
keyName = "displayPing",
name = "Display current ping",
description = "Displays ping to current game world",
position = 9
position = 10
)
default boolean displayPing()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ public class WorldHopperPlugin extends Plugin
private SubscriptionFilterMode subscriptionFilter;
private boolean menuOption;
private boolean removePVPWorld;
private boolean removeBHWorld;
@Getter(AccessLevel.PACKAGE)
private boolean displayPing;

Expand Down Expand Up @@ -395,9 +396,10 @@ else if (BEFORE_OPTIONS.contains(option))
World currentWorld = worldResult.findWorld(client.getWorld());
World targetWorld = worldResult.findWorld(player.getWorld());
if ((targetWorld == null || currentWorld == null)
|| (this.removePVPWorld && !currentWorld.getTypes().contains(WorldType.PVP) && targetWorld.getTypes().contains(WorldType.PVP)))
|| (this.removePVPWorld && !currentWorld.getTypes().contains(WorldType.PVP) && targetWorld.getTypes().contains(WorldType.PVP))
|| (this.removeBHWorld && !currentWorld.getTypes().contains(WorldType.BOUNTY) && targetWorld.getTypes().contains(WorldType.BOUNTY)))
{
// Disable Hop-to a PVP world from a regular world
// Disable Hop-to a PVP world & BH world from a regular world
return;
}

Expand Down Expand Up @@ -528,9 +530,9 @@ private void hop(boolean previous)
{
currentWorldTypes.remove(WorldType.PVP);
currentWorldTypes.remove(WorldType.HIGH_RISK);
currentWorldTypes.remove(WorldType.BOUNTY);
}
// Don't regard these worlds as a type that must be hopped between
currentWorldTypes.remove(WorldType.BOUNTY);
currentWorldTypes.remove(WorldType.SKILL_TOTAL);
currentWorldTypes.remove(WorldType.LAST_MAN_STANDING);

Expand Down Expand Up @@ -795,6 +797,7 @@ private void updateConfig()
this.displayPing = config.displayPing();
this.menuOption = config.menuOption();
this.removePVPWorld = config.removePVPWorld();
this.removeBHWorld = config.removeBHWorld();
}

/**
Expand Down

0 comments on commit 3dff365

Please sign in to comment.