diff --git a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Listener/ItemShortcut.java b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Listener/ItemShortcut.java
index 32bd3cf..9ed5ef1 100644
--- a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Listener/ItemShortcut.java
+++ b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Listener/ItemShortcut.java
@@ -123,6 +123,18 @@ else if(isItemShortcut(itemStack))
}
}
+ private void removeItem(Player player)
+ {
+ for(ItemStack itemStack : player.getInventory())
+ {
+ if(isItemShortcut(itemStack))
+ {
+ itemStack.setAmount(0);
+ return;
+ }
+ }
+ }
+
//region Add backpack item
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onJoin(PlayerJoinEvent event)
@@ -139,10 +151,17 @@ public void onSpawn(PlayerRespawnEvent event)
}
@EventHandler(priority = EventPriority.MONITOR)
- public void onWorldChange(PlayerChangedWorldEvent event)
+ public void onWorldChange(final PlayerChangedWorldEvent event)
{
if(plugin.isDisabled(event.getPlayer()) != WorldBlacklistMode.None) return;
- Bukkit.getScheduler().runTaskLater(plugin, () -> addItem(event.getPlayer()), 2L);
+ Bukkit.getScheduler().runTaskLater(plugin, () -> {
+ Player player = event.getPlayer();
+ if(!player.isOnline()) return;
+ if(player.hasPermission(Permissions.USE))
+ addItem(player);
+ else
+ removeItem(player);
+ }, 2L);
}
@EventHandler(priority = EventPriority.MONITOR)
diff --git a/pom.xml b/pom.xml
index be98df6..29d82c7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
pom
- 2.4.2
+ 2.4.3-RC1
UTF-8
UTF-8