From cb03a981130dccd5ff52aa290860e549790df460 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Sat, 20 Apr 2013 13:24:50 +0200 Subject: [PATCH] Add pickup sounds to cancelled PlayerPickupItemEvents This will make the player aware that he has picked up an item. --- src/main/java/com/gmail/nossr50/listeners/PlayerListener.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 5c0ebff49..99dd790ca 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -2,6 +2,7 @@ package com.gmail.nossr50.listeners; import org.bukkit.GameMode; import org.bukkit.Material; +import org.bukkit.Sound; import org.bukkit.block.Block; import org.bukkit.block.BlockState; import org.bukkit.entity.Entity; @@ -241,6 +242,7 @@ public class PlayerListener implements Listener { event.setCancelled(ShareHandler.handleItemShare(drop, mcMMOPlayer)); if (event.isCancelled()) { + player.playSound(player.getLocation(), Sound.ITEM_PICKUP, Misc.POP_VOLUME, Misc.POP_PITCH); return; } } @@ -249,6 +251,7 @@ public class PlayerListener implements Listener { event.setCancelled(Unarmed.handleItemPickup(player.getInventory(), drop)); if (event.isCancelled()) { + player.playSound(player.getLocation(), Sound.ITEM_PICKUP, Misc.POP_VOLUME, Misc.POP_PITCH); player.updateInventory(); return; }