Fix Rank Location not working due to incorrect UUIDs utilized

This commit is contained in:
AlexTheCoder 2017-09-01 13:53:56 -04:00 committed by cnr
parent 6f04292b2a
commit f5ae4a7ca5
4 changed files with 11 additions and 12 deletions

View File

@ -20,7 +20,7 @@ public class NautHashMap<KeyType, ValueType>
{ {
Validate.isTrue(keys.length == values.length, "Keys array and values array must be the same size when making a Map"); 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) public boolean containsKey(KeyType key)

View File

@ -76,13 +76,13 @@ public class ResetPlayerCommand extends CommandBase<CoreClientManager>
{ {
Plugin.runSync(() -> Plugin.runSync(() ->
{ {
if (id.intValue() == -1) if (id == -1)
{ {
UtilPlayer.message(caller, F.main(Plugin.getName(), F.elem(target) + " was not found!")); UtilPlayer.message(caller, F.main(Plugin.getName(), F.elem(target) + " was not found!"));
} }
else else
{ {
Plugin.clearGroups(id.intValue(), success -> Plugin.clearGroups(id, success ->
{ {
if (success) if (success)
{ {

View File

@ -93,12 +93,12 @@ public class Teleport extends MiniPlugin
{ {
runSync(() -> 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) if (taskId != null)
{ {
getScheduler().cancelTask(taskId.intValue()); getScheduler().cancelTask(taskId);
UtilPlayer.message(p, F.main("Locate", "All Online:")); UtilPlayer.message(p, F.main("Locate", "All Online:"));
} }
@ -137,7 +137,7 @@ public class Teleport extends MiniPlugin
Integer taskId = _failedRedisLocates.remove(callback.getUUID()); Integer taskId = _failedRedisLocates.remove(callback.getUUID());
if (taskId != null) if (taskId != null)
{ {
getScheduler().cancelTask(taskId.intValue()); getScheduler().cancelTask(taskId);
} }
Player player = Bukkit.getPlayer(callback.getReceivingPlayerId()); Player player = Bukkit.getPlayer(callback.getReceivingPlayerId());
@ -162,7 +162,6 @@ public class Teleport extends MiniPlugin
private void generatePermissions() private void generatePermissions()
{ {
PermissionGroup.TRAINEE.setPermission(Perm.FIND_COMMAND, true, true); PermissionGroup.TRAINEE.setPermission(Perm.FIND_COMMAND, true, true);
PermissionGroup.MC.setPermission(Perm.FIND_MOD_COMMAND, false, true); PermissionGroup.MC.setPermission(Perm.FIND_MOD_COMMAND, false, true);
PermissionGroup.ADMIN.setPermission(Perm.FIND_MOD_COMMAND, true, 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 + "].")); UtilPlayer.message(player, F.main("Locate", C.mBody + "Failed to locate [" + C.mElem + target + C.mBody + "]."));
}, 40L).getTaskId(); }, 40L).getTaskId();
_failedRedisLocates.put(locate.getUUID(), Integer.valueOf(id)); _failedRedisLocates.put(locate.getUUID(), id);
} }
public void locateRank(final Player sender, final PermissionGroup group) 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!")); UtilPlayer.message(sender, F.main("Locate", "There are no members of that group online!"));
}, 60L).getTaskId(); }, 60L).getTaskId();
_failedRankLocates.put(locate.getUUID(), Integer.valueOf(id)); _failedRankLocates.put(locate.getUUID(), id);
} }
@EventHandler @EventHandler

View File

@ -153,7 +153,7 @@ public class SalesAnnouncementRepository extends RepositoryBase
{ {
runAsync(() -> 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) if (after != null)
{ {
runSync(after); runSync(after);
@ -165,7 +165,7 @@ public class SalesAnnouncementRepository extends RepositoryBase
{ {
runAsync(() -> runAsync(() ->
{ {
executeUpdate(DELETE_ANNOUNCEMENT, new ColumnInt("id", data.getId().intValue())); executeUpdate(DELETE_ANNOUNCEMENT, new ColumnInt("id", data.getId()));
if (after != null) if (after != null)
{ {
runSync(after); runSync(after);