Skip to content

Commit

Permalink
Fix invtool command
Browse files Browse the repository at this point in the history
  • Loading branch information
mc-nekoneko committed Jun 17, 2020
1 parent 6087dba commit 6f267a6
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ public boolean onCommand(CommandSender sender, Command command, String label, St

Player player = (Player) sender;
PlayerInventory inventory = player.getInventory();
if (inventory.contains(Items.getInvisibleActiveItem()))
inventory.remove(Items.getInvisibleActiveItem());
if (inventory.contains(Items.getInvisibleDeActiveItem()))
inventory.remove(Items.getInvisibleDeActiveItem());
if (player.hasMetadata(InvisiblePlugin.METADATA_KEY)) {
inventory.addItem(Items.getInvisibleDeActiveItem().clone());
} else {
inventory.addItem(Items.getInvisibleActiveItem().clone());
} else {
inventory.addItem(Items.getInvisibleDeActiveItem().clone());
}
player.playSound(player.getLocation(), Sound.ENTITY_ITEM_PICKUP, 1.6F, 0.5F);
return true;
Expand Down

0 comments on commit 6f267a6

Please sign in to comment.