world hopper: disable Hop-to pvp worlds from regular worlds
This commit is contained in:
@@ -350,11 +350,21 @@ public class WorldHopperPlugin extends Plugin
|
|||||||
// Don't add entry if user is offline
|
// Don't add entry if user is offline
|
||||||
ChatPlayer player = getChatPlayerFromName(event.getTarget());
|
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;
|
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();
|
final MenuEntry hopTo = new MenuEntry();
|
||||||
hopTo.setOption(HOP_TO);
|
hopTo.setOption(HOP_TO);
|
||||||
hopTo.setTarget(event.getTarget());
|
hopTo.setTarget(event.getTarget());
|
||||||
|
|||||||
Reference in New Issue
Block a user