mirror of
https://github.com/songoda/UltimateStacker.git
synced 2025-01-26 01:01:26 +01:00
Replace deprecated usages of CompatibleSound with XSound
This commit is contained in:
parent
ccb34a3602
commit
441bea2a21
@ -1,6 +1,6 @@
|
|||||||
package com.craftaro.ultimatestacker.listeners.item;
|
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.UltimateStackerApi;
|
||||||
import com.craftaro.ultimatestacker.api.stack.item.StackedItem;
|
import com.craftaro.ultimatestacker.api.stack.item.StackedItem;
|
||||||
import com.craftaro.ultimatestacker.settings.Settings;
|
import com.craftaro.ultimatestacker.settings.Settings;
|
||||||
@ -29,7 +29,7 @@ public class ItemCurrentListener implements Listener {
|
|||||||
if (amount < (stack.getMaxStackSize() / 2)) return;
|
if (amount < (stack.getMaxStackSize() / 2)) return;
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
Player player = (Player) event.getEntity();
|
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());
|
Methods.updateInventory(event.getItem(), player.getInventory());
|
||||||
} else {
|
} else {
|
||||||
stackedItem.setAmount(amount - 1);
|
stackedItem.setAmount(amount - 1);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.craftaro.ultimatestacker.listeners.item;
|
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.UltimateStackerApi;
|
||||||
import com.craftaro.ultimatestacker.settings.Settings;
|
import com.craftaro.ultimatestacker.settings.Settings;
|
||||||
import com.craftaro.ultimatestacker.utils.Methods;
|
import com.craftaro.ultimatestacker.utils.Methods;
|
||||||
@ -27,7 +27,7 @@ public class ItemLegacyListener implements Listener {
|
|||||||
if (amount < (stack.getMaxStackSize() / 2)) return;
|
if (amount < (stack.getMaxStackSize() / 2)) return;
|
||||||
event.setCancelled(true);
|
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());
|
Methods.updateInventory(event.getItem(), event.getPlayer().getInventory());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user