mirror of
https://github.com/songoda/EpicVouchers.git
synced 2025-01-10 18:07:38 +01:00
Updated to 6.0.1 (view the changelog on Spigot).
This commit is contained in:
parent
48ec58b1a7
commit
965ff27997
@ -3,8 +3,6 @@ package nl.marido.deluxevouchers.handlers;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import nl.marido.deluxevouchers.DeluxeVouchers;
|
||||
|
||||
public enum SoundHandler {
|
||||
|
||||
AMBIENCE_CAVE("AMBIENCE_CAVE", "AMBIENT_CAVE"),
|
||||
@ -224,14 +222,8 @@ public enum SoundHandler {
|
||||
|
||||
public static void playSound(Player player, String sound, int pitch) {
|
||||
if (!sound.isEmpty()) {
|
||||
try {
|
||||
player.playSound(player.getLocation(), SoundHandler.valueOf(sound).bukkitSound(), Integer.MAX_VALUE, pitch);
|
||||
} catch (Exception error) {
|
||||
DeluxeVouchers.getConsole().sendMessage("§cFailed to play the sound " + sound + " for the player " + player.getName() + ".");
|
||||
if (DataHandler.debugerrors) {
|
||||
error.printStackTrace();
|
||||
}
|
||||
}
|
||||
player.playSound(player.getLocation(), SoundHandler.valueOf(sound).bukkitSound(), Integer.MAX_VALUE, pitch);
|
||||
// TODO: Find an alternative for this to check errors.
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import nl.marido.deluxevouchers.DeluxeVouchers;
|
||||
|
||||
@ -19,26 +20,30 @@ public class UpdateHandler implements Listener {
|
||||
|
||||
public static void checker() {
|
||||
if (DataHandler.checkupdates) {
|
||||
CommandSender console = DeluxeVouchers.getConsole();
|
||||
try {
|
||||
URL checkurl = new URL("https://api.spigotmc.org/legacy/update.php?resource=52480");
|
||||
URLConnection connection = checkurl.openConnection();
|
||||
String latestversion = new BufferedReader(new InputStreamReader(connection.getInputStream())).readLine();
|
||||
String currentversion = DeluxeVouchers.getInstance().getDescription().getVersion();
|
||||
if (latestversion.equals(currentversion)) {
|
||||
console.sendMessage("§fLatest version of DeluxeVouchers detected (" + currentversion + ").");
|
||||
oldversion = false;
|
||||
} else {
|
||||
console.sendMessage("§cOutdated version of DeluxeVouchers detected (" + currentversion + ").");
|
||||
console.sendMessage("§cDownload " + latestversion + ": https://spigotmc.org/resources/52480");
|
||||
oldversion = true;
|
||||
new BukkitRunnable() {
|
||||
public void run() {
|
||||
CommandSender console = DeluxeVouchers.getConsole();
|
||||
try {
|
||||
URL checkurl = new URL("https://api.spigotmc.org/legacy/update.php?resource=52480");
|
||||
URLConnection connection = checkurl.openConnection();
|
||||
String latestversion = new BufferedReader(new InputStreamReader(connection.getInputStream())).readLine();
|
||||
String currentversion = DeluxeVouchers.getInstance().getDescription().getVersion();
|
||||
if (latestversion.equals(currentversion)) {
|
||||
console.sendMessage("§fLatest version of DeluxeVouchers detected (" + currentversion + ").");
|
||||
oldversion = false;
|
||||
} else {
|
||||
console.sendMessage("§cOutdated version of DeluxeVouchers detected (" + currentversion + ").");
|
||||
console.sendMessage("§cDownload " + latestversion + ": https://spigotmc.org/resources/52480");
|
||||
oldversion = true;
|
||||
}
|
||||
} catch (Exception error) {
|
||||
console.sendMessage("§cFailed to create a connection with the updater host.");
|
||||
if (DataHandler.debugerrors) {
|
||||
error.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception error) {
|
||||
console.sendMessage("§cFailed to create a connection with the updater host.");
|
||||
if (DataHandler.debugerrors) {
|
||||
error.printStackTrace();
|
||||
}
|
||||
}
|
||||
}.runTaskAsynchronously(DeluxeVouchers.getInstance());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: DeluxeVouchers
|
||||
main: nl.marido.deluxevouchers.DeluxeVouchers
|
||||
version: 6.0.0
|
||||
version: 6.0.1
|
||||
api-version: 1.13
|
||||
author: Marido
|
||||
description: Enhance your server with awesome customizable vouchers with a lot of features.
|
||||
|
Loading…
Reference in New Issue
Block a user