mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Fix plot grant
This commit is contained in:
parent
8547533210
commit
ff83931a3f
@ -36,6 +36,7 @@ import com.plotsquared.core.util.Permissions;
|
|||||||
import com.plotsquared.core.util.task.RunnableVal;
|
import com.plotsquared.core.util.task.RunnableVal;
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
|
import com.plotsquared.core.uuid.UUIDMapping;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
@ -76,8 +77,8 @@ public class Grant extends Command {
|
|||||||
} else if (throwable != null || uuids.size() != 1) {
|
} else if (throwable != null || uuids.size() != 1) {
|
||||||
MainUtil.sendMessage(player, Captions.INVALID_PLAYER);
|
MainUtil.sendMessage(player, Captions.INVALID_PLAYER);
|
||||||
} else {
|
} else {
|
||||||
final UUID uuid = uuids.toArray(new UUID[0])[0];
|
final UUIDMapping uuid = uuids.toArray(new UUIDMapping[0])[0];
|
||||||
MainUtil.getPersistentMeta(uuid,
|
MainUtil.getPersistentMeta(uuid.getUuid(),
|
||||||
"grantedPlots", new RunnableVal<byte[]>() {
|
"grantedPlots", new RunnableVal<byte[]>() {
|
||||||
@Override public void run(byte[] array) {
|
@Override public void run(byte[] array) {
|
||||||
if (arg0.equals("check")) { // check
|
if (arg0.equals("check")) { // check
|
||||||
@ -99,11 +100,11 @@ public class Grant extends Command {
|
|||||||
String key = "grantedPlots";
|
String key = "grantedPlots";
|
||||||
byte[] rawData = Ints.toByteArray(amount);
|
byte[] rawData = Ints.toByteArray(amount);
|
||||||
|
|
||||||
PlotPlayer online = PlotSquared.imp().getPlayerManager().getPlayerIfExists(uuid);
|
PlotPlayer online = PlotSquared.imp().getPlayerManager().getPlayerIfExists(uuid.getUuid());
|
||||||
if (online != null) {
|
if (online != null) {
|
||||||
online.setPersistentMeta(key, rawData);
|
online.setPersistentMeta(key, rawData);
|
||||||
} else {
|
} else {
|
||||||
DBFunc.addPersistentMeta(uuid, key, rawData, replace);
|
DBFunc.addPersistentMeta(uuid.getUuid(), key, rawData, replace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user