Grant plots to the correct player

This commit is contained in:
Alexander Söderberg 2020-07-23 19:26:29 +02:00 committed by Alexander Söderberg
parent 05ce67fbfe
commit ad40ab7e1e

View File

@ -83,7 +83,7 @@ public class Grant extends Command {
final UUID uuid = uuids.toArray(new UUID[0])[0]; final UUID uuid = uuids.toArray(new UUID[0])[0];
PlotPlayer<?> pp = PlotSquared.platform().getPlayerManager().getPlayerIfExists(uuid); PlotPlayer<?> pp = PlotSquared.platform().getPlayerManager().getPlayerIfExists(uuid);
if (pp != null) { if (pp != null) {
try (final MetaDataAccess<Integer> access = player.accessPersistentMetaData( try (final MetaDataAccess<Integer> access = pp.accessPersistentMetaData(
PlayerMetaDataKeys.GRANTED_PLOTS)) { PlayerMetaDataKeys.GRANTED_PLOTS)) {
if (args[0].equalsIgnoreCase("check")) { if (args[0].equalsIgnoreCase("check")) {
Captions.GRANTED_PLOTS.send(player, access.get().orElse(0)); Captions.GRANTED_PLOTS.send(player, access.get().orElse(0));