From 06db89af5ed6d2ef8486a1320b855c217085befa Mon Sep 17 00:00:00 2001 From: montlikadani Date: Thu, 26 Mar 2020 10:27:17 +0100 Subject: [PATCH] Fixed signs merging issue --- src/main/java/com/gamingmesh/jobs/Signs/SignUtil.java | 10 +++------- .../com/gamingmesh/jobs/commands/list/fireall.java | 4 +--- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/Signs/SignUtil.java b/src/main/java/com/gamingmesh/jobs/Signs/SignUtil.java index 69c86bb8..72275be0 100644 --- a/src/main/java/com/gamingmesh/jobs/Signs/SignUtil.java +++ b/src/main/java/com/gamingmesh/jobs/Signs/SignUtil.java @@ -57,14 +57,10 @@ public class SignUtil { SignsByLocation.put(jSign.locToBlockString(), jSign); - HashMap old = SignsByType.get(jSign.getIdentifier().toLowerCase()); - if (old == null) { - old = new HashMap(); - SignsByType.put(jSign.getIdentifier().toLowerCase(), old); - } + HashMap old = new HashMap<>(); + old.put(jSign.locToBlockString(), jSign); - String loc = jSign.locToBlockString(); - old.put(loc, jSign); + SignsByType.put(jSign.getIdentifier().toLowerCase(), old); } public void LoadSigns() { diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/fireall.java b/src/main/java/com/gamingmesh/jobs/commands/list/fireall.java index 2452d695..6acf4e12 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/fireall.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/fireall.java @@ -4,7 +4,6 @@ import java.util.List; import java.util.Map.Entry; import java.util.UUID; -import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -26,11 +25,10 @@ public class fireall implements Cmd { } if (args[0].equalsIgnoreCase("all")) { - if (sender instanceof Player) { sender.sendMessage(Jobs.getLanguage().getMessage("general.error.fromconsole")); return true; - } + } Jobs.getDBManager().getDB().truncate(DBTables.JobsTable.getTableName());