From 8856ebe07730dc43d18e11feedf22d51980d1223 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Mon, 18 Feb 2019 19:50:58 +0100 Subject: [PATCH] Bug Fix --- pom.xml | 2 +- .../java/me/paradoxpixel/themepark/api/LocationUtils.java | 6 ++++++ .../me/paradoxpixel/themepark/command/ThemeParkCommand.java | 4 ++-- .../java/me/paradoxpixel/themepark/config/YamlConfig.java | 2 +- src/main/resources/message.yml | 2 +- src/main/resources/plugin.yml | 2 +- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index af7510c..f9f303f 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ me.paradoxpixel themepark - 1.2 + 1.2.2 diff --git a/src/main/java/me/paradoxpixel/themepark/api/LocationUtils.java b/src/main/java/me/paradoxpixel/themepark/api/LocationUtils.java index 3875e81..a62f8b5 100644 --- a/src/main/java/me/paradoxpixel/themepark/api/LocationUtils.java +++ b/src/main/java/me/paradoxpixel/themepark/api/LocationUtils.java @@ -11,6 +11,9 @@ public class LocationUtils { return null; World world = location.getWorld(); + if(world == null) + return null; + double x = location.getX(); double y = location.getY(); double z = location.getZ(); @@ -31,6 +34,9 @@ public class LocationUtils { return null; World world = Bukkit.getWorld(args[0]); + if(world == null) + return null; + double x = Double.parseDouble(args[1]); double y = Double.parseDouble(args[2]); double z = Double.parseDouble(args[3]); diff --git a/src/main/java/me/paradoxpixel/themepark/command/ThemeParkCommand.java b/src/main/java/me/paradoxpixel/themepark/command/ThemeParkCommand.java index 12d109d..3eefa22 100644 --- a/src/main/java/me/paradoxpixel/themepark/command/ThemeParkCommand.java +++ b/src/main/java/me/paradoxpixel/themepark/command/ThemeParkCommand.java @@ -273,7 +273,7 @@ public class ThemeParkCommand extends BukkitCommand { String id = args[1]; if(!API.isAttraction(id)) { - String message = Message.getMessage("attraction.no"); + String message = Message.getMessage("attraction.not"); message = message.replace("{id}", id); sender.sendMessage(Utils.color(message)); return true; @@ -302,7 +302,7 @@ public class ThemeParkCommand extends BukkitCommand { String id = args[1]; if (!API.isAttraction(id)) { - String message = Message.getMessage("attraction.no"); + String message = Message.getMessage("attraction.not"); message = message.replace("{id}", id); sender.sendMessage(Utils.color(message)); return true; diff --git a/src/main/java/me/paradoxpixel/themepark/config/YamlConfig.java b/src/main/java/me/paradoxpixel/themepark/config/YamlConfig.java index 2fa00b5..5c4f9f3 100644 --- a/src/main/java/me/paradoxpixel/themepark/config/YamlConfig.java +++ b/src/main/java/me/paradoxpixel/themepark/config/YamlConfig.java @@ -46,7 +46,7 @@ public class YamlConfig { } public void reload() { - if(file == null) { + if(file == null || !file.exists()) { load(); return; } diff --git a/src/main/resources/message.yml b/src/main/resources/message.yml index 5f524ec..9bc27ca 100644 --- a/src/main/resources/message.yml +++ b/src/main/resources/message.yml @@ -25,7 +25,7 @@ status: attraction: notfound: "&4No attractions found" list: "&6ID: &f{id} &6Name: &f{name} &6Region: &f{region} &6Status: &f{status}" - no: "{prefix} &4There is no attraction with ID: {id}" + not: "{prefix} &4There is no attraction with ID: {id}" nostatus: "{prefix} &4Attraction: {name} &4has no status named: {status}" changed: status: diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 7f2b59b..684224f 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: ThemePark -version: 1.2 +version: 1.2.2 main: me.paradoxpixel.themepark.ThemeParkPlugin author: ParadoxPixel commands: