From f5ae4a7ca5b5dba05e53121cf8ff29565e7fc0b5 Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Fri, 1 Sep 2017 13:53:56 -0400 Subject: [PATCH] Fix Rank Location not working due to incorrect UUIDs utilized --- .../src/mineplex/core/common/util/NautHashMap.java | 2 +- .../core/account/command/ResetPlayerCommand.java | 4 ++-- .../src/mineplex/core/teleport/Teleport.java | 13 ++++++------- .../SalesAnnouncementRepository.java | 4 ++-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Plugins/Mineplex.Core.Common.Base/src/mineplex/core/common/util/NautHashMap.java b/Plugins/Mineplex.Core.Common.Base/src/mineplex/core/common/util/NautHashMap.java index 41f9d442c..228543e50 100644 --- a/Plugins/Mineplex.Core.Common.Base/src/mineplex/core/common/util/NautHashMap.java +++ b/Plugins/Mineplex.Core.Common.Base/src/mineplex/core/common/util/NautHashMap.java @@ -20,7 +20,7 @@ public class NautHashMap { Validate.isTrue(keys.length == values.length, "Keys array and values array must be the same size when making a Map"); - UtilCollections.loop(0, keys.length, i -> _wrappedHashMap.put(keys[i.intValue()], values[i.intValue()])); + UtilCollections.loop(0, keys.length, i -> _wrappedHashMap.put(keys[i], values[i])); } public boolean containsKey(KeyType key) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/account/command/ResetPlayerCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/account/command/ResetPlayerCommand.java index e10401b7b..e6ad2ce84 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/account/command/ResetPlayerCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/account/command/ResetPlayerCommand.java @@ -76,13 +76,13 @@ public class ResetPlayerCommand extends CommandBase { Plugin.runSync(() -> { - if (id.intValue() == -1) + if (id == -1) { UtilPlayer.message(caller, F.main(Plugin.getName(), F.elem(target) + " was not found!")); } else { - Plugin.clearGroups(id.intValue(), success -> + Plugin.clearGroups(id, success -> { if (success) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java b/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java index 042dae4cf..52b4d8ab1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java @@ -93,12 +93,12 @@ public class Teleport extends MiniPlugin { runSync(() -> { - Player p = Bukkit.getPlayer(command.getUUID()); + Player p = Bukkit.getPlayer(command.getReceivingPlayerUUID()); - Integer taskId = _failedRankLocates.remove(command.getReceivingPlayerUUID()); + Integer taskId = _failedRankLocates.remove(command.getUUID()); if (taskId != null) { - getScheduler().cancelTask(taskId.intValue()); + getScheduler().cancelTask(taskId); UtilPlayer.message(p, F.main("Locate", "All Online:")); } @@ -137,7 +137,7 @@ public class Teleport extends MiniPlugin Integer taskId = _failedRedisLocates.remove(callback.getUUID()); if (taskId != null) { - getScheduler().cancelTask(taskId.intValue()); + getScheduler().cancelTask(taskId); } Player player = Bukkit.getPlayer(callback.getReceivingPlayerId()); @@ -162,7 +162,6 @@ public class Teleport extends MiniPlugin private void generatePermissions() { - PermissionGroup.TRAINEE.setPermission(Perm.FIND_COMMAND, true, true); PermissionGroup.MC.setPermission(Perm.FIND_MOD_COMMAND, false, true); PermissionGroup.ADMIN.setPermission(Perm.FIND_MOD_COMMAND, true, true); @@ -202,7 +201,7 @@ public class Teleport extends MiniPlugin UtilPlayer.message(player, F.main("Locate", C.mBody + "Failed to locate [" + C.mElem + target + C.mBody + "].")); }, 40L).getTaskId(); - _failedRedisLocates.put(locate.getUUID(), Integer.valueOf(id)); + _failedRedisLocates.put(locate.getUUID(), id); } public void locateRank(final Player sender, final PermissionGroup group) @@ -221,7 +220,7 @@ public class Teleport extends MiniPlugin UtilPlayer.message(sender, F.main("Locate", "There are no members of that group online!")); }, 60L).getTaskId(); - _failedRankLocates.put(locate.getUUID(), Integer.valueOf(id)); + _failedRankLocates.put(locate.getUUID(), id); } @EventHandler diff --git a/Plugins/Mineplex.Hub.Clans/src/mineplex/clanshub/salesannouncements/SalesAnnouncementRepository.java b/Plugins/Mineplex.Hub.Clans/src/mineplex/clanshub/salesannouncements/SalesAnnouncementRepository.java index dfe9516af..a2637ba48 100644 --- a/Plugins/Mineplex.Hub.Clans/src/mineplex/clanshub/salesannouncements/SalesAnnouncementRepository.java +++ b/Plugins/Mineplex.Hub.Clans/src/mineplex/clanshub/salesannouncements/SalesAnnouncementRepository.java @@ -153,7 +153,7 @@ public class SalesAnnouncementRepository extends RepositoryBase { runAsync(() -> { - executeUpdate(UPDATE_ANNOUNCEMENT_STATUS, new ColumnBoolean("enabled", data.isEnabled()), new ColumnInt("id", data.getId().intValue())); + executeUpdate(UPDATE_ANNOUNCEMENT_STATUS, new ColumnBoolean("enabled", data.isEnabled()), new ColumnInt("id", data.getId())); if (after != null) { runSync(after); @@ -165,7 +165,7 @@ public class SalesAnnouncementRepository extends RepositoryBase { runAsync(() -> { - executeUpdate(DELETE_ANNOUNCEMENT, new ColumnInt("id", data.getId().intValue())); + executeUpdate(DELETE_ANNOUNCEMENT, new ColumnInt("id", data.getId())); if (after != null) { runSync(after);