mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-01 08:09:39 +01:00
Add pickup sounds to cancelled PlayerPickupItemEvents
This will make the player aware that he has picked up an item.
This commit is contained in:
parent
4b36a11dda
commit
cb03a98113
@ -2,6 +2,7 @@ package com.gmail.nossr50.listeners;
|
|||||||
|
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockState;
|
import org.bukkit.block.BlockState;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
@ -241,6 +242,7 @@ public class PlayerListener implements Listener {
|
|||||||
event.setCancelled(ShareHandler.handleItemShare(drop, mcMMOPlayer));
|
event.setCancelled(ShareHandler.handleItemShare(drop, mcMMOPlayer));
|
||||||
|
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
|
player.playSound(player.getLocation(), Sound.ITEM_PICKUP, Misc.POP_VOLUME, Misc.POP_PITCH);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -249,6 +251,7 @@ public class PlayerListener implements Listener {
|
|||||||
event.setCancelled(Unarmed.handleItemPickup(player.getInventory(), drop));
|
event.setCancelled(Unarmed.handleItemPickup(player.getInventory(), drop));
|
||||||
|
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
|
player.playSound(player.getLocation(), Sound.ITEM_PICKUP, Misc.POP_VOLUME, Misc.POP_PITCH);
|
||||||
player.updateInventory();
|
player.updateInventory();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user