found the solution, preparing for v1.3

This commit is contained in:
Bryson Steck 2022-01-15 16:19:03 -07:00
parent 0188e381b2
commit dddb321c70
3 changed files with 17 additions and 25 deletions

View file

@ -61,12 +61,10 @@ public class CommandResurrect implements CommandExecutor {
resurrectPlayer.removePotionEffect(effect.getType()); resurrectPlayer.removePotionEffect(effect.getType());
resurrectPlayer.setGameMode(GameMode.SURVIVAL); resurrectPlayer.setGameMode(GameMode.SURVIVAL);
for(Player player : Bukkit.getOnlinePlayers()){ for(Player player : Bukkit.getOnlinePlayers()){
try { // for versions > 1.8
player.playSound(player.getLocation(), Sound.ENTITY_ENDERDRAGON_GROWL, 1, 0); player.playSound(player.getLocation(), Sound.ENTITY_WITHER_DEATH, 1, 0);
} catch (NoSuchFieldError e) { // for version 1.8
log.warning("NoSuchFieldError encountered, playing Wither noise instead."); //player.playSound(player.getLocation(), Sound.WITHER_DEATH, 1, 0);
player.playSound(player.getLocation(), Sound.WITHER_DEATH, 1, 0);
}
} }
Bukkit.broadcastMessage(ChatColor.YELLOW +""+ ChatColor.BOLD + strings[0] + " has been resurrected manually by an admin!"); Bukkit.broadcastMessage(ChatColor.YELLOW +""+ ChatColor.BOLD + strings[0] + " has been resurrected manually by an admin!");
removeDeath(resurrectPlayer); removeDeath(resurrectPlayer);
@ -113,12 +111,10 @@ public class CommandResurrect implements CommandExecutor {
resurrectPlayer.removePotionEffect(effect.getType()); resurrectPlayer.removePotionEffect(effect.getType());
resurrectPlayer.setGameMode(GameMode.SURVIVAL); resurrectPlayer.setGameMode(GameMode.SURVIVAL);
for(Player player : Bukkit.getOnlinePlayers()){ for(Player player : Bukkit.getOnlinePlayers()){
try { // for versions > 1.8
player.playSound(player.getLocation(), Sound.ENTITY_ENDERDRAGON_GROWL, 1, 0); player.playSound(player.getLocation(), Sound.ENTITY_WITHER_DEATH, 1, 0);
} catch (NoSuchFieldError e) { // for version 1.8
log.warning("NoSuchFieldError encountered, playing Wither noise instead."); //player.playSound(player.getLocation(), Sound.WITHER_DEATH, 1, 0);
player.playSound(player.getLocation(), Sound.WITHER_DEATH, 1, 0);
}
} }
Bukkit.broadcastMessage(strings[0] + " has been resurrected manually by an admin!"); Bukkit.broadcastMessage(strings[0] + " has been resurrected manually by an admin!");
removeDeath(resurrectPlayer); removeDeath(resurrectPlayer);

View file

@ -148,12 +148,10 @@ public class PlayerListener implements Listener {
p.teleport(spawn); p.teleport(spawn);
} }
for(Player p : Bukkit.getOnlinePlayers()){ for(Player p : Bukkit.getOnlinePlayers()){
try { // for versions > 1.8
p.playSound(p.getLocation(), Sound.ENTITY_ENDERDRAGON_GROWL, 1, 0); p.playSound(p.getLocation(), Sound.ENTITY_WITHER_DEATH, 1, 0);
} catch (NoSuchFieldError e) { // for version 1.8
log.warning("NoSuchFieldError encountered, playing Wither noise instead."); //p.playSound(p.getLocation(), Sound.WITHER_DEATH, 1, 0);
p.playSound(p.getLocation(), Sound.WITHER_DEATH, 1, 0);
}
} }
} }
}.runTaskLater(JavaPlugin.getProvidingPlugin(Resurrection.class), timeToResurrection); }.runTaskLater(JavaPlugin.getProvidingPlugin(Resurrection.class), timeToResurrection);
@ -244,12 +242,10 @@ public class PlayerListener implements Listener {
p.teleport(spawn); p.teleport(spawn);
} }
for(Player p : Bukkit.getOnlinePlayers()){ for(Player p : Bukkit.getOnlinePlayers()){
try { // for versions > 1.8
p.playSound(p.getLocation(), Sound.ENTITY_ENDERDRAGON_GROWL, 1, 0); p.playSound(p.getLocation(), Sound.ENTITY_WITHER_DEATH, 1, 0);
} catch (NoSuchFieldError e) { // for version 1.8
log.warning("NoSuchFieldError encountered, playing Wither noise instead."); //p.playSound(p.getLocation(), Sound.WITHER_DEATH, 1, 0);
p.playSound(p.getLocation(), Sound.WITHER_DEATH, 1, 0);
}
} }
} }
}.runTaskLater(JavaPlugin.getProvidingPlugin(Resurrection.class), timeToResurrection); }.runTaskLater(JavaPlugin.getProvidingPlugin(Resurrection.class), timeToResurrection);

View file

@ -5,7 +5,7 @@ version: '1.3'
website: https://brysonsteck.net/resurrection.html website: https://brysonsteck.net/resurrection.html
description: Makes players wait large amounts of time before respawning! description: Makes players wait large amounts of time before respawning!
database: false database: false
api-version: 1.9 api-version: 1.13
commands: commands:
about: about: