From dddb321c70ce2ac3b781e5f39eded8fb5fb1ff14 Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Sat, 15 Jan 2022 16:19:03 -0700 Subject: found the solution, preparing for v1.3 --- .../Resurrection/player/PlayerListener.java | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/net/brysonsteck/Resurrection/player') diff --git a/src/net/brysonsteck/Resurrection/player/PlayerListener.java b/src/net/brysonsteck/Resurrection/player/PlayerListener.java index 6c95418..424e0fc 100644 --- a/src/net/brysonsteck/Resurrection/player/PlayerListener.java +++ b/src/net/brysonsteck/Resurrection/player/PlayerListener.java @@ -148,12 +148,10 @@ public class PlayerListener implements Listener { p.teleport(spawn); } for(Player p : Bukkit.getOnlinePlayers()){ - try { - p.playSound(p.getLocation(), Sound.ENTITY_ENDERDRAGON_GROWL, 1, 0); - } catch (NoSuchFieldError e) { - log.warning("NoSuchFieldError encountered, playing Wither noise instead."); - p.playSound(p.getLocation(), Sound.WITHER_DEATH, 1, 0); - } + // for versions > 1.8 + p.playSound(p.getLocation(), Sound.ENTITY_WITHER_DEATH, 1, 0); + // for version 1.8 + //p.playSound(p.getLocation(), Sound.WITHER_DEATH, 1, 0); } } }.runTaskLater(JavaPlugin.getProvidingPlugin(Resurrection.class), timeToResurrection); @@ -244,12 +242,10 @@ public class PlayerListener implements Listener { p.teleport(spawn); } for(Player p : Bukkit.getOnlinePlayers()){ - try { - p.playSound(p.getLocation(), Sound.ENTITY_ENDERDRAGON_GROWL, 1, 0); - } catch (NoSuchFieldError e) { - log.warning("NoSuchFieldError encountered, playing Wither noise instead."); - p.playSound(p.getLocation(), Sound.WITHER_DEATH, 1, 0); - } + // for versions > 1.8 + p.playSound(p.getLocation(), Sound.ENTITY_WITHER_DEATH, 1, 0); + // for version 1.8 + //p.playSound(p.getLocation(), Sound.WITHER_DEATH, 1, 0); } } }.runTaskLater(JavaPlugin.getProvidingPlugin(Resurrection.class), timeToResurrection); -- cgit v1.2.3