diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldHopperPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldHopperPlugin.java index a161be1af6..84abfcf9f5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldHopperPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldHopperPlugin.java @@ -350,11 +350,21 @@ public class WorldHopperPlugin extends Plugin // Don't add entry if user is offline ChatPlayer player = getChatPlayerFromName(event.getTarget()); - if (player == null || player.getWorld() == 0 || player.getWorld() == client.getWorld()) + if (player == null || player.getWorld() == 0 || player.getWorld() == client.getWorld() + || worldResult == null) { return; } + World currentWorld = worldResult.findWorld(client.getWorld()); + World targetWorld = worldResult.findWorld(player.getWorld()); + if (targetWorld == null || currentWorld == null + || (!currentWorld.getTypes().contains(WorldType.PVP) && targetWorld.getTypes().contains(WorldType.PVP))) + { + // Disable Hop-to a PVP world from a regular world + return; + } + final MenuEntry hopTo = new MenuEntry(); hopTo.setOption(HOP_TO); hopTo.setTarget(event.getTarget());