This commit is contained in:
Telesphoreo 2020-09-24 22:59:45 -05:00
commit 9a827568e7
4 changed files with 15 additions and 7 deletions

View file

@ -21,7 +21,7 @@
<dependency>
<groupId>com.plotsquared</groupId>
<artifactId>PlotSquared-Core</artifactId>
<version>5.13.3</version>
<version>5.13.6</version>
<scope>compile</scope>
</dependency>
<dependency>

View file

@ -36,6 +36,7 @@ import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.task.RunnableVal;
import com.plotsquared.core.util.task.RunnableVal2;
import com.plotsquared.core.util.task.RunnableVal3;
import com.plotsquared.core.uuid.UUIDMapping;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
@ -76,8 +77,8 @@ public class Grant extends Command {
} else if (throwable != null || uuids.size() != 1) {
MainUtil.sendMessage(player, Captions.INVALID_PLAYER);
} else {
final UUID uuid = uuids.toArray(new UUID[0])[0];
MainUtil.getPersistentMeta(uuid,
final UUIDMapping uuid = uuids.toArray(new UUIDMapping[0])[0];
MainUtil.getPersistentMeta(uuid.getUuid(),
"grantedPlots", new RunnableVal<byte[]>() {
@Override public void run(byte[] array) {
if (arg0.equals("check")) { // check
@ -99,11 +100,11 @@ public class Grant extends Command {
String key = "grantedPlots";
byte[] rawData = Ints.toByteArray(amount);
PlotPlayer online = PlotSquared.imp().getPlayerManager().getPlayerIfExists(uuid);
PlotPlayer online = PlotSquared.imp().getPlayerManager().getPlayerIfExists(uuid.getUuid());
if (online != null) {
online.setPersistentMeta(key, rawData);
} else {
DBFunc.addPersistentMeta(uuid, key, rawData, replace);
DBFunc.addPersistentMeta(uuid.getUuid(), key, rawData, replace);
}
}
}

View file

@ -107,6 +107,7 @@ public class HomeCommand extends Command {
PlotQuery query = query(player);
int page = 1; // page = index + 1
String identifier;
PlotArea plotArea;
boolean basePlotOnly = true;
switch (args.length) {
case 1:
@ -129,12 +130,18 @@ public class HomeCommand extends Command {
query.withPlot(fromId);
break;
}
// allow for plot home within a plot area
plotArea = PlotSquared.get().getPlotAreaByString(args[0]);
if (plotArea != null) {
query.inArea(plotArea);
break;
}
// it wasn't a valid plot id, trying to find plot by alias
query.withAlias(identifier);
break;
case 2:
// we assume args[0] is a plot area and args[1] an identifier
PlotArea plotArea = PlotSquared.get().getPlotAreaByString(args[0]);
plotArea = PlotSquared.get().getPlotAreaByString(args[0]);
identifier = args[1];
if (plotArea == null) {
// invalid command, therefore no plots

View file

@ -34,7 +34,7 @@ ext {
git = Grgit.open(dir: new File(rootDir.toString() + "/.git"))
}
def ver = "5.13.5"
def ver = "5.13.6"
def versuffix = ""
ext {
if (project.hasProperty("versionsuffix")) {