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> <dependency>
<groupId>com.plotsquared</groupId> <groupId>com.plotsquared</groupId>
<artifactId>PlotSquared-Core</artifactId> <artifactId>PlotSquared-Core</artifactId>
<version>5.13.3</version> <version>5.13.6</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<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.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);
} }
} }
} }

View file

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

View file

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