mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-09-07 01:08:40 +02:00
Plot info footer
This commit is contained in:
parent
0667e885de
commit
6f90700187
2
pom.xml
2
pom.xml
@ -8,7 +8,7 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<artifactId>PlotSquared</artifactId>
|
<artifactId>PlotSquared</artifactId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.4</version>
|
||||||
<name>PlotSquared</name>
|
<name>PlotSquared</name>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<build>
|
<build>
|
||||||
|
@ -265,6 +265,7 @@ public class Info extends SubCommand {
|
|||||||
}
|
}
|
||||||
MainUtil.sendMessage(player, C.PLOT_INFO_HEADER);
|
MainUtil.sendMessage(player, C.PLOT_INFO_HEADER);
|
||||||
MainUtil.sendMessage(player, info, false);
|
MainUtil.sendMessage(player, info, false);
|
||||||
|
MainUtil.sendMessage(player, C.PLOT_INFO_FOOTER);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
@ -34,7 +34,7 @@ import com.plotsquared.general.commands.CommandDeclaration;
|
|||||||
permission = "plots.admin",
|
permission = "plots.admin",
|
||||||
description = "Update PlotSquared",
|
description = "Update PlotSquared",
|
||||||
usage = "/plot update",
|
usage = "/plot update",
|
||||||
requiredType = RequiredType.CONSOLE,
|
requiredType = RequiredType.PLAYER,
|
||||||
aliases = {"updateplugin"},
|
aliases = {"updateplugin"},
|
||||||
category = CommandCategory.DEBUG
|
category = CommandCategory.DEBUG
|
||||||
)
|
)
|
||||||
|
@ -45,12 +45,6 @@ import com.plotsquared.general.commands.CommandDeclaration;
|
|||||||
)
|
)
|
||||||
public class Visit extends SubCommand {
|
public class Visit extends SubCommand {
|
||||||
|
|
||||||
public Visit() {
|
|
||||||
requiredArguments = new Argument[] {
|
|
||||||
Argument.String
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Plot> getPlots(final UUID uuid) {
|
public List<Plot> getPlots(final UUID uuid) {
|
||||||
final List<Plot> plots = new ArrayList<>();
|
final List<Plot> plots = new ArrayList<>();
|
||||||
for (final Plot p : PS.get().getPlots()) {
|
for (final Plot p : PS.get().getPlots()) {
|
||||||
|
@ -271,6 +271,12 @@ public class list extends SubCommand {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
UUID uuid = UUIDHandler.getUUID(args[0], null);
|
UUID uuid = UUIDHandler.getUUID(args[0], null);
|
||||||
|
if (uuid == null) {
|
||||||
|
try {
|
||||||
|
uuid = UUID.fromString(args[0]);
|
||||||
|
}
|
||||||
|
catch (Exception e) {}
|
||||||
|
}
|
||||||
if (uuid != null) {
|
if (uuid != null) {
|
||||||
if (!Permissions.hasPermission(plr, "plots.list.player")) {
|
if (!Permissions.hasPermission(plr, "plots.list.player")) {
|
||||||
MainUtil.sendMessage(plr, C.NO_PERMISSION, "plots.list.player");
|
MainUtil.sendMessage(plr, C.NO_PERMISSION, "plots.list.player");
|
||||||
|
@ -28,6 +28,7 @@ import java.util.ArrayList;
|
|||||||
|
|
||||||
import com.intellectualcrafters.plot.PS;
|
import com.intellectualcrafters.plot.PS;
|
||||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||||
|
import com.intellectualcrafters.plot.util.MainUtil;
|
||||||
import com.intellectualcrafters.plot.util.TaskManager;
|
import com.intellectualcrafters.plot.util.TaskManager;
|
||||||
import com.plotsquared.general.commands.CommandDeclaration;
|
import com.plotsquared.general.commands.CommandDeclaration;
|
||||||
|
|
||||||
@ -35,7 +36,7 @@ import com.plotsquared.general.commands.CommandDeclaration;
|
|||||||
command = "plugin",
|
command = "plugin",
|
||||||
permission = "plots.use",
|
permission = "plots.use",
|
||||||
description = "Show plugin information",
|
description = "Show plugin information",
|
||||||
aliases = {"version}"},
|
aliases = {"version"},
|
||||||
category = CommandCategory.INFO
|
category = CommandCategory.INFO
|
||||||
)
|
)
|
||||||
public class plugin extends SubCommand {
|
public class plugin extends SubCommand {
|
||||||
@ -80,7 +81,7 @@ public class plugin extends SubCommand {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
for (final String s : strings) {
|
for (final String s : strings) {
|
||||||
plr.sendMessage(s);
|
MainUtil.sendMessage(plr, s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -386,6 +386,7 @@ public enum C {
|
|||||||
PLOT_INFO_UNCLAIMED("$2Plot $1%s$2 is not yet claimed", "Info"),
|
PLOT_INFO_UNCLAIMED("$2Plot $1%s$2 is not yet claimed", "Info"),
|
||||||
PLOT_INFO_HEADER("$3&m---------&r $1INFO $3&m---------", false, "Info"),
|
PLOT_INFO_HEADER("$3&m---------&r $1INFO $3&m---------", false, "Info"),
|
||||||
PLOT_INFO("$1ID: $2%id%$1&-" + "$1Alias: $2%alias%$1&-" + "$1Owner: $2%owner%$1&-" + "$1Biome: $2%biome%$1&-" + "$1Can Build: $2%build%$1&-" + "$1Rating: $2%rating%&-" + "$1Trusted: $2%trusted%$1&-" + "$1Members: $2%members%$1&-" + "$1Denied: $2%denied%$1&-" + "$1Flags: $2%flags%", "Info"),
|
PLOT_INFO("$1ID: $2%id%$1&-" + "$1Alias: $2%alias%$1&-" + "$1Owner: $2%owner%$1&-" + "$1Biome: $2%biome%$1&-" + "$1Can Build: $2%build%$1&-" + "$1Rating: $2%rating%&-" + "$1Trusted: $2%trusted%$1&-" + "$1Members: $2%members%$1&-" + "$1Denied: $2%denied%$1&-" + "$1Flags: $2%flags%", "Info"),
|
||||||
|
PLOT_INFO_FOOTER("$3&m---------&r $1INFO $3&m---------", false, "Info"),
|
||||||
PLOT_INFO_TRUSTED("$1Trusted:$2 %trusted%", "Info"),
|
PLOT_INFO_TRUSTED("$1Trusted:$2 %trusted%", "Info"),
|
||||||
PLOT_INFO_MEMBERS("$1Members:$2 %members%", "Info"),
|
PLOT_INFO_MEMBERS("$1Members:$2 %members%", "Info"),
|
||||||
PLOT_INFO_DENIED("$1Denied:$2 %denied%", "Info"),
|
PLOT_INFO_DENIED("$1Denied:$2 %denied%", "Info"),
|
||||||
|
@ -160,19 +160,24 @@ public abstract class PlotWorld {
|
|||||||
case "s":
|
case "s":
|
||||||
case "0":
|
case "0":
|
||||||
this.GAMEMODE = PlotGamemode.SURVIVAL;
|
this.GAMEMODE = PlotGamemode.SURVIVAL;
|
||||||
|
break;
|
||||||
case "creative":
|
case "creative":
|
||||||
case "c":
|
case "c":
|
||||||
case "1":
|
case "1":
|
||||||
this.GAMEMODE = PlotGamemode.CREATIVE;
|
this.GAMEMODE = PlotGamemode.CREATIVE;
|
||||||
|
break;
|
||||||
case "adventure":
|
case "adventure":
|
||||||
case "a":
|
case "a":
|
||||||
case "2":
|
case "2":
|
||||||
this.GAMEMODE = PlotGamemode.ADVENTURE;
|
this.GAMEMODE = PlotGamemode.ADVENTURE;
|
||||||
|
break;
|
||||||
case "spectator":
|
case "spectator":
|
||||||
case "3":
|
case "3":
|
||||||
this.GAMEMODE = PlotGamemode.SPECTATOR;
|
this.GAMEMODE = PlotGamemode.SPECTATOR;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
PS.debug("&cInvalid gamemode set for: " + worldname);
|
PS.debug("&cInvalid gamemode set for: " + worldname);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.HOME_ALLOW_NONMEMBER = config.getBoolean("home.allow-nonmembers");
|
this.HOME_ALLOW_NONMEMBER = config.getBoolean("home.allow-nonmembers");
|
||||||
|
@ -1370,12 +1370,16 @@ public class MainUtil {
|
|||||||
final com.intellectualcrafters.plot.object.Location bot2 = MainUtil.getPlotBottomLoc(plot2.world, plot2.id);
|
final com.intellectualcrafters.plot.object.Location bot2 = MainUtil.getPlotBottomLoc(plot2.world, plot2.id);
|
||||||
final Location top = MainUtil.getPlotTopLoc(plot1.world, plot1.id);
|
final Location top = MainUtil.getPlotTopLoc(plot1.world, plot1.id);
|
||||||
if (plot1.owner == null) {
|
if (plot1.owner == null) {
|
||||||
|
PS.debug(plot2 +" is unowned (single)");
|
||||||
|
TaskManager.runTask(whenDone);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final Plot pos1 = getBottomPlot(plot1);
|
final Plot pos1 = getBottomPlot(plot1);
|
||||||
final Plot pos2 = getTopPlot(plot1);
|
final Plot pos2 = getTopPlot(plot1);
|
||||||
final PlotId size = MainUtil.getSize(plot1);
|
final PlotId size = MainUtil.getSize(plot1);
|
||||||
if (!MainUtil.isUnowned(plot2.world, plot2.id, new PlotId((plot2.id.x + size.x) - 1, (plot2.id.y + size.y) - 1))) {
|
if (!MainUtil.isUnowned(plot2.world, plot2.id, new PlotId((plot2.id.x + size.x) - 1, (plot2.id.y + size.y) - 1))) {
|
||||||
|
PS.debug(plot2 +" is unowned (multi)");
|
||||||
|
TaskManager.runTask(whenDone);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final int offset_x = plot2.id.x - pos1.id.x;
|
final int offset_x = plot2.id.x - pos1.id.x;
|
||||||
|
@ -74,7 +74,7 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
|
|||||||
final String s = current.replaceAll(".dat$", "");
|
final String s = current.replaceAll(".dat$", "");
|
||||||
try {
|
try {
|
||||||
UUID uuid = UUID.fromString(s);
|
UUID uuid = UUID.fromString(s);
|
||||||
if (check || all.contains(uuid)) {
|
if (check || all.remove(uuid)) {
|
||||||
File file = new File(playerdataFolder + File.separator + current);
|
File file = new File(playerdataFolder + File.separator + current);
|
||||||
InputSupplier<FileInputStream> is = Files.newInputStreamSupplier(file);
|
InputSupplier<FileInputStream> is = Files.newInputStreamSupplier(file);
|
||||||
NbtFactory.NbtCompound compound = NbtFactory.fromStream(is, NbtFactory.StreamOptions.GZIP_COMPRESSION);
|
NbtFactory.NbtCompound compound = NbtFactory.fromStream(is, NbtFactory.StreamOptions.GZIP_COMPRESSION);
|
||||||
@ -91,9 +91,14 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
add(toAdd);
|
add(toAdd);
|
||||||
|
if (all.size() == 0) {
|
||||||
if (whenDone != null) whenDone.run();
|
if (whenDone != null) whenDone.run();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
PS.debug("Failed to cache: " + all.size() + " uuids - slowly processing all files");
|
||||||
|
}
|
||||||
|
}
|
||||||
final HashSet<String> worlds = new HashSet<>();
|
final HashSet<String> worlds = new HashSet<>();
|
||||||
worlds.add(world);
|
worlds.add(world);
|
||||||
worlds.add("world");
|
worlds.add("world");
|
||||||
|
Loading…
Reference in New Issue
Block a user