Replace deprecated usages of CompatibleSound with XSound

This commit is contained in:
Christian Koop 2023-06-30 22:34:19 +02:00
parent ccb34a3602
commit 441bea2a21
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
package com.craftaro.ultimatestacker.listeners.item;
import com.craftaro.core.compatibility.CompatibleSound;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XSound;
import com.craftaro.ultimatestacker.api.UltimateStackerApi;
import com.craftaro.ultimatestacker.api.stack.item.StackedItem;
import com.craftaro.ultimatestacker.settings.Settings;
@ -29,7 +29,7 @@ public class ItemCurrentListener implements Listener {
if (amount < (stack.getMaxStackSize() / 2)) return;
event.setCancelled(true);
Player player = (Player) event.getEntity();
player.playSound(player.getLocation(), CompatibleSound.ENTITY_ITEM_PICKUP.getSound(), .2f, (float) (1 + Math.random()));
XSound.ENTITY_ITEM_PICKUP.play(player, .2f, (float) (1 + Math.random()));
Methods.updateInventory(event.getItem(), player.getInventory());
} else {
stackedItem.setAmount(amount - 1);

View File

@ -1,6 +1,6 @@
package com.craftaro.ultimatestacker.listeners.item;
import com.craftaro.core.compatibility.CompatibleSound;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XSound;
import com.craftaro.ultimatestacker.api.UltimateStackerApi;
import com.craftaro.ultimatestacker.settings.Settings;
import com.craftaro.ultimatestacker.utils.Methods;
@ -27,7 +27,7 @@ public class ItemLegacyListener implements Listener {
if (amount < (stack.getMaxStackSize() / 2)) return;
event.setCancelled(true);
event.getPlayer().playSound(event.getPlayer().getLocation(), CompatibleSound.ENTITY_ITEM_PICKUP.getSound(), .2f, (float) (1 + Math.random()));
XSound.ENTITY_ITEM_PICKUP.play(event.getPlayer(), .2f, (float) (1 + Math.random()));
Methods.updateInventory(event.getItem(), event.getPlayer().getInventory());
}