mirror of
https://github.com/Crazy-Crew/CrazyAuctions.git
synced 2024-11-25 12:25:20 +01:00
parent
fa47a8a089
commit
35768c9e34
@ -23,6 +23,8 @@ import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -510,6 +512,16 @@ public class GuiListener implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void playSoldSound(@NotNull Player player) {
|
||||
FileConfiguration config = Files.CONFIG.getFile();
|
||||
String sound = config.getString("Settings.Sold-Item-Sound", "");
|
||||
if (sound.isEmpty()) return;
|
||||
|
||||
try {
|
||||
player.playSound(player.getLocation(), Sound.valueOf(sound), 1, 1);
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInvClose(InventoryCloseEvent e) {
|
||||
@ -889,6 +901,7 @@ public class GuiListener implements Listener {
|
||||
if (Methods.isOnline(seller) && Methods.getPlayer(seller) != null) {
|
||||
Player sell = Methods.getPlayer(seller);
|
||||
sell.sendMessage(Messages.PLAYER_BOUGHT_ITEM.getMessage(placeholders));
|
||||
playSoldSound(sell);
|
||||
}
|
||||
|
||||
player.getInventory().addItem(i);
|
||||
|
@ -24,6 +24,7 @@ Settings:
|
||||
Sounds:
|
||||
Toggle: false #Disable the clicking sound.
|
||||
Sound: 'CLICK' #Make sure if you use 1.8 or lower you use the 1.8 sound and 1.9 and up use 1.9 sounds. The default sound is 1.8.
|
||||
Sold-Item-Sound: 'CLICK'
|
||||
#Sounds are found here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html
|
||||
GUISettings: #Settings for things in the gui.
|
||||
SellingItemLore: #The lore on items that are being sold.
|
||||
|
Loading…
Reference in New Issue
Block a user