From d9a48b5b97b27944e6ef8ce038e81c1ad7c21f50 Mon Sep 17 00:00:00 2001 From: Zrips Date: Tue, 25 Dec 2018 12:58:17 +0200 Subject: [PATCH] Lets simplify it even more Version increment for future release --- .../jobs/Placeholders/Placeholder.java | 21 ++++++++++--------- src/main/resources/plugin.yml | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java b/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java index d129adc4..cb1b07a3 100644 --- a/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java +++ b/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java @@ -449,27 +449,28 @@ public class Placeholder { if (values.isEmpty()) return ""; Job j = getJobFromValue(values.get(0)); - + if (j == null) + return ""; // Global placeholders by jobname switch (placeHolder) { case name_$1: - return j == null ? "" : j.getName(); + return j.getName(); case shortname_$1: - return j == null ? "" : j.getShortName(); + return j.getShortName(); case chatcolor_$1: - return j == null ? "" : j.getChatColor().toString(); + return j.getChatColor().toString(); case description_$1: - return j == null ? "" : j.getDescription(); + return j.getDescription(); case maxdailyq_$1: - return j == null ? "" : String.valueOf(j.getMaxDailyQuests()); + return String.valueOf(j.getMaxDailyQuests()); case maxlvl_$1: - return j == null ? "" : String.valueOf(j.getMaxLevel()); + return String.valueOf(j.getMaxLevel()); case maxviplvl_$1: - return j == null ? "" : String.valueOf(j.getVipMaxLevel()); + return String.valueOf(j.getVipMaxLevel()); case totalplayers_$1: - return j == null ? "" : String.valueOf(j.getTotalPlayers()); + return String.valueOf(j.getTotalPlayers()); case maxslots_$1: - return j == null ? "" : String.valueOf(j.getMaxSlots()); + return String.valueOf(j.getMaxSlots()); default: break; } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 8eed147d..b96d3451 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,7 +1,7 @@ name: Jobs description: Jobs Plugin for the BukkitAPI main: com.gamingmesh.jobs.Jobs -version: 4.9.4 +version: 4.9.5 api-version: 1.13 website: https://www.spigotmc.org/resources/4216/ author: phrstbrn