From 2190393bf576c079158bbd239854af0ad1d950b3 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Thu, 29 Jun 2023 11:36:01 +0200 Subject: [PATCH] Replace deprecated usages of CompatibleSound with XSound --- .../java/com/songoda/epichoppers/hopper/Hopper.java | 12 ++++++------ .../hopper/teleport/TeleportHandlerImpl.java | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/EpicHoppers-API/src/main/java/com/songoda/epichoppers/hopper/Hopper.java b/EpicHoppers-API/src/main/java/com/songoda/epichoppers/hopper/Hopper.java index 43355a2..127f49a 100644 --- a/EpicHoppers-API/src/main/java/com/songoda/epichoppers/hopper/Hopper.java +++ b/EpicHoppers-API/src/main/java/com/songoda/epichoppers/hopper/Hopper.java @@ -2,9 +2,9 @@ import com.craftaro.core.SongodaPlugin; import com.craftaro.core.compatibility.CompatibleParticleHandler; -import com.craftaro.core.compatibility.CompatibleSound; import com.craftaro.core.compatibility.ServerVersion; import com.craftaro.core.hooks.EconomyManager; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XSound; import com.songoda.epichoppers.EpicHoppersApi; import com.songoda.epichoppers.api.events.HopperAccessEvent; import com.songoda.epichoppers.database.DataManager; @@ -156,12 +156,12 @@ private void upgradeFinal(Level level, Player player) { } if (getLevelManager().getHighestLevel() != level) { - player.playSound(player.getLocation(), CompatibleSound.ENTITY_PLAYER_LEVELUP.getSound(), 0.6F, 15.0F); + XSound.ENTITY_PLAYER_LEVELUP.play(player, .6f, 15); } else { - player.playSound(player.getLocation(), CompatibleSound.ENTITY_PLAYER_LEVELUP.getSound(), 2F, 25.0F); - player.playSound(player.getLocation(), CompatibleSound.BLOCK_NOTE_BLOCK_CHIME.getSound(), 2F, 25.0F); - Bukkit.getScheduler().scheduleSyncDelayedTask(getPlugin(), () -> player.playSound(player.getLocation(), CompatibleSound.BLOCK_NOTE_BLOCK_CHIME.getSound(), 1.2F, 35.0F), 5L); - Bukkit.getScheduler().scheduleSyncDelayedTask(getPlugin(), () -> player.playSound(player.getLocation(), CompatibleSound.BLOCK_NOTE_BLOCK_CHIME.getSound(), 1.8F, 35.0F), 10L); + XSound.ENTITY_PLAYER_LEVELUP.play(player, 2, 25); + XSound.BLOCK_NOTE_BLOCK_CHIME.play(player, 2, 25); + Bukkit.getScheduler().scheduleSyncDelayedTask(getPlugin(), () -> XSound.BLOCK_NOTE_BLOCK_CHIME.play(player, 1.2f, 35), 5); + Bukkit.getScheduler().scheduleSyncDelayedTask(getPlugin(), () -> XSound.BLOCK_NOTE_BLOCK_CHIME.play(player, 1.8f, 35), 10); } } diff --git a/EpicHoppers-Plugin/src/main/java/com/songoda/epichoppers/hopper/teleport/TeleportHandlerImpl.java b/EpicHoppers-Plugin/src/main/java/com/songoda/epichoppers/hopper/teleport/TeleportHandlerImpl.java index 91d270a..38877e0 100644 --- a/EpicHoppers-Plugin/src/main/java/com/songoda/epichoppers/hopper/teleport/TeleportHandlerImpl.java +++ b/EpicHoppers-Plugin/src/main/java/com/songoda/epichoppers/hopper/teleport/TeleportHandlerImpl.java @@ -1,7 +1,7 @@ package com.songoda.epichoppers.hopper.teleport; -import com.craftaro.core.compatibility.CompatibleSound; import com.craftaro.core.compatibility.ServerVersion; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XSound; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.hopper.Hopper; import com.songoda.epichoppers.settings.Settings; @@ -119,6 +119,6 @@ private void doTeleport(Entity entity, Location location) { entity.teleport(location); - CompatibleSound.ENTITY_ENDERMAN_TELEPORT.play(entity.getWorld(), entity.getLocation(), 10, 10); + XSound.ENTITY_ENDERMAN_TELEPORT.play(entity.getLocation(), 10, 10); } }