Updated to 6.0.1 (view the changelog on Spigot).

This commit is contained in:
CoderMarido 2018-09-12 14:17:58 +02:00
parent 48ec58b1a7
commit 965ff27997
3 changed files with 27 additions and 30 deletions

View File

@ -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.
}
}

View File

@ -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());
}
}

View File

@ -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.