Also remove shortcut-item in worlds where the plugin is disabled (#184)

This commit is contained in:
GeorgH93 2021-10-24 11:43:03 +02:00
parent ce1a5fca45
commit 04bf7da6ff
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8

View File

@ -153,11 +153,10 @@ public void onSpawn(PlayerRespawnEvent event)
@EventHandler(priority = EventPriority.MONITOR)
public void onWorldChange(final PlayerChangedWorldEvent event)
{
if(plugin.isDisabled(event.getPlayer()) != WorldBlacklistMode.None) return;
Bukkit.getScheduler().runTaskLater(plugin, () -> {
Player player = event.getPlayer();
if(!player.isOnline()) return;
if(player.hasPermission(Permissions.USE))
if(player.hasPermission(Permissions.USE) && plugin.isDisabled(player) == WorldBlacklistMode.None)
addItem(player);
else
removeItem(player);