Fix various instances where Adventure is being used incorrectly

This commit is contained in:
dordsor21 2020-10-19 17:59:04 +01:00
parent 333493f351
commit 7e9a9e14c7
8 changed files with 313 additions and 425 deletions

View File

@ -12,7 +12,7 @@ dependencies {
compileOnlyApi("org.yaml:snakeyaml:1.26") // Some platforms provide this compileOnlyApi("org.yaml:snakeyaml:1.26") // Some platforms provide this
// Adventure stuff // Adventure stuff
api("net.kyori:adventure-api:4.1.0") api("net.kyori:adventure-api:4.1.1")
api("net.kyori:adventure-text-minimessage:4.0.0-SNAPSHOT") api("net.kyori:adventure-text-minimessage:4.0.0-SNAPSHOT")
// Guice // Guice

View File

@ -29,9 +29,7 @@ import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.ConfigurationSection; import com.plotsquared.core.configuration.ConfigurationSection;
import com.plotsquared.core.configuration.ConfigurationUtil; import com.plotsquared.core.configuration.ConfigurationUtil;
import com.plotsquared.core.configuration.caption.Caption;
import com.plotsquared.core.configuration.caption.CaptionHolder; import com.plotsquared.core.configuration.caption.CaptionHolder;
import com.plotsquared.core.configuration.caption.StaticCaption;
import com.plotsquared.core.configuration.caption.Templates; import com.plotsquared.core.configuration.caption.Templates;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.configuration.file.YamlConfiguration; import com.plotsquared.core.configuration.file.YamlConfiguration;
@ -110,11 +108,13 @@ public class Area extends SubCommand {
private final Map<UUID, Map<String, Object>> metaData = new HashMap<>(); private final Map<UUID, Map<String, Object>> metaData = new HashMap<>();
@Inject public Area(@Nonnull final PlotAreaManager plotAreaManager, @Inject public Area(@Nonnull final PlotAreaManager plotAreaManager,
@WorldConfig @Nonnull final YamlConfiguration worldConfiguration, @WorldConfig @Nonnull final YamlConfiguration worldConfiguration,
@WorldFile @Nonnull final File worldFile, @WorldFile @Nonnull final File worldFile,
@Nonnull final HybridPlotWorldFactory hybridPlotWorldFactory, @Nonnull final HybridPlotWorldFactory hybridPlotWorldFactory,
@Nonnull final SetupUtils setupUtils, @Nonnull final WorldUtil worldUtil, @Nonnull final SetupUtils setupUtils,
@Nonnull final RegionManager regionManager, @Nonnull final GlobalBlockQueue blockQueue) { @Nonnull final WorldUtil worldUtil,
@Nonnull final RegionManager regionManager,
@Nonnull final GlobalBlockQueue blockQueue) {
this.plotAreaManager = plotAreaManager; this.plotAreaManager = plotAreaManager;
this.worldConfiguration = worldConfiguration; this.worldConfiguration = worldConfiguration;
this.worldFile = worldFile; this.worldFile = worldFile;
@ -137,31 +137,26 @@ public class Area extends SubCommand {
return false; return false;
} }
if (!Permissions.hasPermission(player, "plots.area.create")) { if (!Permissions.hasPermission(player, "plots.area.create")) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", "plots.area.create"));
Template.of("node", "plots.area.create"));
return false; return false;
} }
if (args.length < 2) { if (args.length < 2) {
player.sendMessage(TranslatableCaption.of("single.single_area_needs_name"), player.sendMessage(TranslatableCaption.of("single.single_area_needs_name"), Template.of("command", "/plot area single <name>"));
Template.of("command", "/plot area single <name>"));
return false; return false;
} }
final PlotArea existingArea = final PlotArea existingArea = this.plotAreaManager.getPlotArea(player.getLocation().getWorldName(), args[1]);
this.plotAreaManager.getPlotArea(player.getLocation().getWorldName(), args[1]);
if (existingArea != null && existingArea.getId().equalsIgnoreCase(args[1])) { if (existingArea != null && existingArea.getId().equalsIgnoreCase(args[1])) {
player.sendMessage(TranslatableCaption.of("single.single_area_name_taken")); player.sendMessage(TranslatableCaption.of("single.single_area_name_taken"));
return false; return false;
} }
final LocalSession localSession = final LocalSession localSession = WorldEdit.getInstance().getSessionManager().getIfPresent(player.toActor());
WorldEdit.getInstance().getSessionManager().getIfPresent(player.toActor());
if (localSession == null) { if (localSession == null) {
player.sendMessage(TranslatableCaption.of("single.single_area_missing_selection")); player.sendMessage(TranslatableCaption.of("single.single_area_missing_selection"));
return false; return false;
} }
Region playerSelectedRegion = null; Region playerSelectedRegion = null;
try { try {
playerSelectedRegion = playerSelectedRegion = localSession.getSelection(((Player) player.toActor()).getWorld());
localSession.getSelection(((Player) player.toActor()).getWorld());
} catch (final Exception ignored) { } catch (final Exception ignored) {
} }
if (playerSelectedRegion == null) { if (playerSelectedRegion == null) {
@ -172,8 +167,8 @@ public class Area extends SubCommand {
player.sendMessage(TranslatableCaption.of("single.single_area_not_square")); player.sendMessage(TranslatableCaption.of("single.single_area_not_square"));
return false; return false;
} }
if (this.plotAreaManager.getPlotAreas( if (this.plotAreaManager.getPlotAreas(Objects.requireNonNull(playerSelectedRegion.getWorld()).getName(),
Objects.requireNonNull(playerSelectedRegion.getWorld()).getName(), CuboidRegion.makeCuboid(playerSelectedRegion)).length != 0) { CuboidRegion.makeCuboid(playerSelectedRegion)).length != 0) {
player.sendMessage(TranslatableCaption.of("single.single_area_overlapping")); player.sendMessage(TranslatableCaption.of("single.single_area_overlapping"));
} }
// Alter the region // Alter the region
@ -181,18 +176,15 @@ public class Area extends SubCommand {
final BlockVector3 playerSelectionMax = playerSelectedRegion.getMaximumPoint(); final BlockVector3 playerSelectionMax = playerSelectedRegion.getMaximumPoint();
// Create a new selection that spans the entire vertical range of the world // Create a new selection that spans the entire vertical range of the world
final CuboidRegion selectedRegion = final CuboidRegion selectedRegion =
new CuboidRegion(playerSelectedRegion.getWorld(), new CuboidRegion(playerSelectedRegion.getWorld(), BlockVector3.at(playerSelectionMin.getX(), 0, playerSelectionMin.getZ()),
BlockVector3.at(playerSelectionMin.getX(), 0, playerSelectionMin.getZ()),
BlockVector3.at(playerSelectionMax.getX(), 255, playerSelectionMax.getZ())); BlockVector3.at(playerSelectionMax.getX(), 255, playerSelectionMax.getZ()));
// There's only one plot in the area... // There's only one plot in the area...
final PlotId plotId = PlotId.of(1, 1); final PlotId plotId = PlotId.of(1, 1);
final HybridPlotWorld hybridPlotWorld = this.hybridPlotWorldFactory final HybridPlotWorld hybridPlotWorld = this.hybridPlotWorldFactory
.create(player.getLocation().getWorldName(), args[1], .create(player.getLocation().getWorldName(), args[1], Objects.requireNonNull(PlotSquared.platform()).getDefaultGenerator(),
Objects.requireNonNull(PlotSquared.platform()).getDefaultGenerator(),
plotId, plotId); plotId, plotId);
// Plot size is the same as the region width // Plot size is the same as the region width
hybridPlotWorld.PLOT_WIDTH = hybridPlotWorld.PLOT_WIDTH = hybridPlotWorld.SIZE = (short) selectedRegion.getWidth();
hybridPlotWorld.SIZE = (short) selectedRegion.getWidth();
// We use a schematic generator // We use a schematic generator
hybridPlotWorld.setTerrain(PlotAreaTerrainType.NONE); hybridPlotWorld.setTerrain(PlotAreaTerrainType.NONE);
// It is always a partial plot world // It is always a partial plot world
@ -200,30 +192,24 @@ public class Area extends SubCommand {
// We save the schematic :D // We save the schematic :D
hybridPlotWorld.PLOT_SCHEMATIC = true; hybridPlotWorld.PLOT_SCHEMATIC = true;
// Set the road width to 0 // Set the road width to 0
hybridPlotWorld.ROAD_WIDTH = hybridPlotWorld.ROAD_WIDTH = hybridPlotWorld.ROAD_OFFSET_X = hybridPlotWorld.ROAD_OFFSET_Z = 0;
hybridPlotWorld.ROAD_OFFSET_X = hybridPlotWorld.ROAD_OFFSET_Z = 0;
// Set the plot height to the selection height // Set the plot height to the selection height
hybridPlotWorld.PLOT_HEIGHT = hybridPlotWorld.ROAD_HEIGHT = hybridPlotWorld.PLOT_HEIGHT = hybridPlotWorld.ROAD_HEIGHT = hybridPlotWorld.WALL_HEIGHT = playerSelectionMin.getBlockY();
hybridPlotWorld.WALL_HEIGHT = playerSelectionMin.getBlockY();
// No sign plz // No sign plz
hybridPlotWorld.setAllowSigns(false); hybridPlotWorld.setAllowSigns(false);
final File parentFile = FileUtils.getFile(PlotSquared.platform().getDirectory(), final File parentFile = FileUtils.getFile(PlotSquared.platform().getDirectory(),
"schematics" + File.separator + "GEN_ROAD_SCHEMATIC" + File.separator "schematics" + File.separator + "GEN_ROAD_SCHEMATIC" + File.separator + hybridPlotWorld.getWorldName() + File.separator
+ hybridPlotWorld.getWorldName() + File.separator + hybridPlotWorld + hybridPlotWorld.getId());
.getId());
if (!parentFile.exists() && !parentFile.mkdirs()) { if (!parentFile.exists() && !parentFile.mkdirs()) {
player.sendMessage(TranslatableCaption.of("single.single_area_could_not_make_directories")); player.sendMessage(TranslatableCaption.of("single.single_area_could_not_make_directories"));
return false; return false;
} }
final File file = new File(parentFile, "plot.schem"); final File file = new File(parentFile, "plot.schem");
try (final ClipboardWriter clipboardWriter = BuiltInClipboardFormat.SPONGE_SCHEMATIC try (final ClipboardWriter clipboardWriter = BuiltInClipboardFormat.SPONGE_SCHEMATIC.getWriter(new FileOutputStream(file))) {
.getWriter(new FileOutputStream(file))) {
final BlockArrayClipboard clipboard = new BlockArrayClipboard(selectedRegion); final BlockArrayClipboard clipboard = new BlockArrayClipboard(selectedRegion);
final EditSession editSession = WorldEdit.getInstance().getEditSessionFactory() final EditSession editSession = WorldEdit.getInstance().getEditSessionFactory().getEditSession(selectedRegion.getWorld(), -1);
.getEditSession(selectedRegion.getWorld(), -1);
final ForwardExtentCopy forwardExtentCopy = final ForwardExtentCopy forwardExtentCopy =
new ForwardExtentCopy(editSession, selectedRegion, clipboard, new ForwardExtentCopy(editSession, selectedRegion, clipboard, selectedRegion.getMinimumPoint());
selectedRegion.getMinimumPoint());
forwardExtentCopy.setCopyingBiomes(true); forwardExtentCopy.setCopyingBiomes(true);
forwardExtentCopy.setCopyingEntities(true); forwardExtentCopy.setCopyingEntities(true);
Operations.complete(forwardExtentCopy); Operations.complete(forwardExtentCopy);
@ -245,15 +231,12 @@ public class Area extends SubCommand {
final BlockVector3 singlePos1 = selectedRegion.getMinimumPoint(); final BlockVector3 singlePos1 = selectedRegion.getMinimumPoint();
// Now the schematic is saved, which is wonderful! // Now the schematic is saved, which is wonderful!
PlotAreaBuilder singleBuilder = PlotAreaBuilder.ofPlotArea(hybridPlotWorld) PlotAreaBuilder singleBuilder = PlotAreaBuilder.ofPlotArea(hybridPlotWorld).plotManager(PlotSquared.platform().getPluginName())
.plotManager(PlotSquared.platform().getPluginName()) .generatorName(PlotSquared.platform().getPluginName()).maximumId(plotId).minimumId(plotId);
.generatorName(PlotSquared.platform().getPluginName()).maximumId(plotId)
.minimumId(plotId);
Runnable singleRun = () -> { Runnable singleRun = () -> {
final String path = final String path =
"worlds." + hybridPlotWorld.getWorldName() + ".areas." + hybridPlotWorld "worlds." + hybridPlotWorld.getWorldName() + ".areas." + hybridPlotWorld.getId() + '-' + singleBuilder.minimumId() + '-'
.getId() + '-' + singleBuilder.minimumId() + '-' + singleBuilder + singleBuilder.maximumId();
.maximumId();
final int offsetX = singlePos1.getX(); final int offsetX = singlePos1.getX();
final int offsetZ = singlePos1.getZ(); final int offsetZ = singlePos1.getZ();
if (offsetX != 0) { if (offsetX != 0) {
@ -267,10 +250,7 @@ public class Area extends SubCommand {
PlotSquared.get().loadWorld(world, null); PlotSquared.get().loadWorld(world, null);
player.sendMessage(TranslatableCaption.of("single.single_area_created")); player.sendMessage(TranslatableCaption.of("single.single_area_created"));
} else { } else {
player.sendMessage( player.sendMessage(TranslatableCaption.of("errors.error_create"), Template.of("world", hybridPlotWorld.getWorldName()));
TranslatableCaption.of("errors.error_create"),
Template.of("world", hybridPlotWorld.getWorldName())
);
} }
}; };
singleRun.run(); singleRun.run();
@ -279,8 +259,7 @@ public class Area extends SubCommand {
case "setup": case "setup":
case "create": case "create":
if (!Permissions.hasPermission(player, "plots.area.create")) { if (!Permissions.hasPermission(player, "plots.area.create")) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", "plots.area.create"));
Template.of("node", "plots.area.create"));
return false; return false;
} }
switch (args.length) { switch (args.length) {
@ -291,103 +270,82 @@ public class Area extends SubCommand {
case 2: case 2:
switch (args[1].toLowerCase()) { switch (args[1].toLowerCase()) {
case "pos1": { // Set position 1 case "pos1": { // Set position 1
HybridPlotWorld area = (HybridPlotWorld) metaData HybridPlotWorld area = (HybridPlotWorld) metaData.computeIfAbsent(player.getUUID(), missingUUID -> new HashMap<>())
.computeIfAbsent(player.getUUID(), .get("area_create_area");
missingUUID -> new HashMap<>()).get("area_create_area");
if (area == null) { if (area == null) {
player.sendMessage(TranslatableCaption.of("commandconfig.command_syntax"), player.sendMessage(TranslatableCaption.of("commandconfig.command_syntax"),
Templates.of("value", "/plot area create [world[:id]] [<modifier>=<value>]...")); Templates.of("value", "/plot area create [world[:id]] [<modifier>=<value>]..."));
return false; return false;
} }
Location location = player.getLocation(); Location location = player.getLocation();
metaData.computeIfAbsent(player.getUUID(), missingUUID -> new HashMap<>()) metaData.computeIfAbsent(player.getUUID(), missingUUID -> new HashMap<>()).put("area_pos1", location);
.put("area_pos1", location); player.sendMessage(TranslatableCaption.of("set.set_attribute"), Template.of("attribute", "area_pos1"),
player.sendMessage(TranslatableCaption.of("set.set_attribute"), Template.of("value", location.getX() + "," + location.getZ()));
Template.of("attribute", "area_pos1"), player.sendMessage(TranslatableCaption.of("area.set_pos2"), Template.of("command", "/plot area create pos2"));
Template.of("value", location.getX() + "," + location.getZ()));
player.sendMessage(TranslatableCaption.of("area.set_pos2"),
Template.of("command", "/plot area create pos2"));
return true; return true;
} }
case "pos2": // Set position 2 and finish creation for type=2 (partial) case "pos2": // Set position 2 and finish creation for type=2 (partial)
final HybridPlotWorld area = (HybridPlotWorld) metaData final HybridPlotWorld area =
.computeIfAbsent(player.getUUID(), (HybridPlotWorld) metaData.computeIfAbsent(player.getUUID(), missingUUID -> new HashMap<>())
missingUUID -> new HashMap<>()).get("area_create_area"); .get("area_create_area");
if (area == null) { if (area == null) {
player.sendMessage(TranslatableCaption.of("commandconfig.command_syntax"), player.sendMessage(TranslatableCaption.of("commandconfig.command_syntax"),
Templates.of("value", "/plot area create [world[:id]] [<modifier>=<value>]...")); Templates.of("value", "/plot area create [world[:id]] [<modifier>=<value>]..."));
return false; return false;
} }
Location pos1 = player.getLocation(); Location pos1 = player.getLocation();
Location pos2 = (Location) metaData Location pos2 =
.computeIfAbsent(player.getUUID(), (Location) metaData.computeIfAbsent(player.getUUID(), missingUUID -> new HashMap<>()).get("area_pos1");
missingUUID -> new HashMap<>()).get("area_pos1");
int dx = Math.abs(pos1.getX() - pos2.getX()); int dx = Math.abs(pos1.getX() - pos2.getX());
int dz = Math.abs(pos1.getZ() - pos2.getZ()); int dz = Math.abs(pos1.getZ() - pos2.getZ());
int numX = Math.max(1, int numX = Math.max(1, (dx + 1 + area.ROAD_WIDTH + area.SIZE / 2) / area.SIZE);
(dx + 1 + area.ROAD_WIDTH + area.SIZE / 2) / area.SIZE); int numZ = Math.max(1, (dz + 1 + area.ROAD_WIDTH + area.SIZE / 2) / area.SIZE);
int numZ = Math.max(1,
(dz + 1 + area.ROAD_WIDTH + area.SIZE / 2) / area.SIZE);
int ddx = dx - (numX * area.SIZE - area.ROAD_WIDTH); int ddx = dx - (numX * area.SIZE - area.ROAD_WIDTH);
int ddz = dz - (numZ * area.SIZE - area.ROAD_WIDTH); int ddz = dz - (numZ * area.SIZE - area.ROAD_WIDTH);
int bx = Math.min(pos1.getX(), pos2.getX()) + ddx; int bx = Math.min(pos1.getX(), pos2.getX()) + ddx;
int bz = Math.min(pos1.getZ(), pos2.getZ()) + ddz; int bz = Math.min(pos1.getZ(), pos2.getZ()) + ddz;
int tx = Math.max(pos1.getX(), pos2.getX()) - ddx; int tx = Math.max(pos1.getX(), pos2.getX()) - ddx;
int tz = Math.max(pos1.getZ(), pos2.getZ()) - ddz; int tz = Math.max(pos1.getZ(), pos2.getZ()) - ddz;
int lower = (area.ROAD_WIDTH & 1) == 0 ? int lower = (area.ROAD_WIDTH & 1) == 0 ? area.ROAD_WIDTH / 2 - 1 : area.ROAD_WIDTH / 2;
area.ROAD_WIDTH / 2 - 1 :
area.ROAD_WIDTH / 2;
final int offsetX = bx - (area.ROAD_WIDTH == 0 ? 0 : lower); final int offsetX = bx - (area.ROAD_WIDTH == 0 ? 0 : lower);
final int offsetZ = bz - (area.ROAD_WIDTH == 0 ? 0 : lower); final int offsetZ = bz - (area.ROAD_WIDTH == 0 ? 0 : lower);
final CuboidRegion region = RegionUtil.createRegion(bx, tx, bz, tz); final CuboidRegion region = RegionUtil.createRegion(bx, tx, bz, tz);
final Set<PlotArea> areas = this.plotAreaManager final Set<PlotArea> areas = this.plotAreaManager.getPlotAreasSet(area.getWorldName(), region);
.getPlotAreasSet(area.getWorldName(), region);
if (!areas.isEmpty()) { if (!areas.isEmpty()) {
player.sendMessage(TranslatableCaption.of("cluster.cluster_intersection"), player.sendMessage(TranslatableCaption.of("cluster.cluster_intersection"),
Template.of("cluster", areas.iterator().next().toString())); Template.of("cluster", areas.iterator().next().toString()));
return false; return false;
} }
PlotAreaBuilder builder = PlotAreaBuilder.ofPlotArea(area) PlotAreaBuilder builder = PlotAreaBuilder.ofPlotArea(area).plotManager(PlotSquared.platform().getPluginName())
.plotManager(PlotSquared.platform().getPluginName()) .generatorName(PlotSquared.platform().getPluginName()).minimumId(PlotId.of(1, 1))
.generatorName(PlotSquared.platform().getPluginName()) .maximumId(PlotId.of(numX, numZ));
.minimumId(PlotId.of(1, 1)).maximumId(PlotId.of(numX, numZ));
final String path = final String path =
"worlds." + area.getWorldName() + ".areas." + area.getId() + '-' "worlds." + area.getWorldName() + ".areas." + area.getId() + '-' + builder.minimumId() + '-' + builder
+ builder.minimumId() + '-' + builder.maximumId(); .maximumId();
Runnable run = () -> { Runnable run = () -> {
if (offsetX != 0) { if (offsetX != 0) {
this.worldConfiguration this.worldConfiguration.set(path + ".road.offset.x", offsetX);
.set(path + ".road.offset.x", offsetX);
} }
if (offsetZ != 0) { if (offsetZ != 0) {
this.worldConfiguration this.worldConfiguration.set(path + ".road.offset.z", offsetZ);
.set(path + ".road.offset.z", offsetZ);
} }
final String world = this.setupUtils.setupWorld(builder); final String world = this.setupUtils.setupWorld(builder);
if (this.worldUtil.isWorld(world)) { if (this.worldUtil.isWorld(world)) {
PlotSquared.get().loadWorld(world, null); PlotSquared.get().loadWorld(world, null);
player.sendMessage(TranslatableCaption.of("setup.setup_finished")); player.sendMessage(TranslatableCaption.of("setup.setup_finished"));
player.teleport(this.worldUtil.getSpawn(world), player.teleport(this.worldUtil.getSpawn(world), TeleportCause.COMMAND);
TeleportCause.COMMAND);
if (area.getTerrain() != PlotAreaTerrainType.ALL) { if (area.getTerrain() != PlotAreaTerrainType.ALL) {
QueueCoordinator queue = QueueCoordinator queue = blockQueue.getNewQueue(worldUtil.getWeWorld(world));
blockQueue.getNewQueue(worldUtil.getWeWorld(world)); queue.setChunkConsumer(chunk -> AugmentedUtils.generate(null, world, chunk.getX(), chunk.getZ(), null));
queue.setChunkConsumer(chunk -> AugmentedUtils
.generate(null, world, chunk.getX(), chunk.getZ(),
null));
queue.addReadChunks(region.getChunks()); queue.addReadChunks(region.getChunks());
queue.enqueue(); queue.enqueue();
} }
} else { } else {
player.sendMessage( player.sendMessage(TranslatableCaption.of("errors.error_create"), Template.of("world", area.getWorldName()));
TranslatableCaption.of("errors.error_create"),
Template.of("world", area.getWorldName())
);
} }
}; };
if (hasConfirmation(player)) { if (hasConfirmation(player)) {
CmdConfirm.addPending(player, CmdConfirm.addPending(player, getCommandString() + " create pos2 (Creates world)", run);
getCommandString() + " create pos2 (Creates world)", run);
} else { } else {
run.run(); run.run();
} }
@ -403,17 +361,14 @@ public class Area extends SubCommand {
} }
PlotAreaBuilder builder = PlotAreaBuilder.newBuilder(); PlotAreaBuilder builder = PlotAreaBuilder.newBuilder();
builder.worldName(split[0]); builder.worldName(split[0]);
final HybridPlotWorld pa = this.hybridPlotWorldFactory final HybridPlotWorld pa =
.create(builder.worldName(), id, this.hybridPlotWorldFactory.create(builder.worldName(), id, PlotSquared.platform().getDefaultGenerator(), null, null);
PlotSquared.platform().getDefaultGenerator(), null, null);
PlotArea other = this.plotAreaManager.getPlotArea(pa.getWorldName(), id); PlotArea other = this.plotAreaManager.getPlotArea(pa.getWorldName(), id);
if (other != null && Objects.equals(pa.getId(), other.getId())) { if (other != null && Objects.equals(pa.getId(), other.getId())) {
player.sendMessage(TranslatableCaption.of("setup.setup_world_taken"), player.sendMessage(TranslatableCaption.of("setup.setup_world_taken"), Template.of("value", pa.toString()));
Template.of("value", pa.toString()));
return false; return false;
} }
Set<PlotArea> areas = Set<PlotArea> areas = this.plotAreaManager.getPlotAreasSet(pa.getWorldName());
this.plotAreaManager.getPlotAreasSet(pa.getWorldName());
if (!areas.isEmpty()) { if (!areas.isEmpty()) {
PlotArea area = areas.iterator().next(); PlotArea area = areas.iterator().next();
pa.setType(area.getType()); pa.setType(area.getType());
@ -422,11 +377,9 @@ public class Area extends SubCommand {
for (int i = 2; i < args.length; i++) { for (int i = 2; i < args.length; i++) {
String[] pair = args[i].split("="); String[] pair = args[i].split("=");
if (pair.length != 2) { if (pair.length != 2) {
player.sendMessage( player.sendMessage(TranslatableCaption.of("commandconfig.command_syntax_extended"),
TranslatableCaption.of("commandconfig.command_syntax_extended"), Template.of("value1,", getCommandString()),
Template.of("value1,", getCommandString()), Template.of("value2", " create [world[:id]] [<modifier>=<value>]..."));
Template.of("value2", " create [world[:id]] [<modifier>=<value>]...")
);
return false; return false;
} }
switch (pair[0].toLowerCase()) { switch (pair[0].toLowerCase()) {
@ -449,49 +402,40 @@ public class Area extends SubCommand {
break; break;
case "f": case "f":
case "floor": case "floor":
pa.TOP_BLOCK = pa.TOP_BLOCK = ConfigurationUtil.BLOCK_BUCKET.parseString(pair[1]);
ConfigurationUtil.BLOCK_BUCKET.parseString(pair[1]);
break; break;
case "m": case "m":
case "main": case "main":
pa.MAIN_BLOCK = pa.MAIN_BLOCK = ConfigurationUtil.BLOCK_BUCKET.parseString(pair[1]);
ConfigurationUtil.BLOCK_BUCKET.parseString(pair[1]);
break; break;
case "w": case "w":
case "wall": case "wall":
pa.WALL_FILLING = pa.WALL_FILLING = ConfigurationUtil.BLOCK_BUCKET.parseString(pair[1]);
ConfigurationUtil.BLOCK_BUCKET.parseString(pair[1]);
break; break;
case "b": case "b":
case "border": case "border":
pa.WALL_BLOCK = pa.WALL_BLOCK = ConfigurationUtil.BLOCK_BUCKET.parseString(pair[1]);
ConfigurationUtil.BLOCK_BUCKET.parseString(pair[1]);
break; break;
case "terrain": case "terrain":
pa.setTerrain(PlotAreaTerrainType.fromString(pair[1]) pa.setTerrain(PlotAreaTerrainType.fromString(pair[1])
.orElseThrow(() -> new IllegalArgumentException( .orElseThrow(() -> new IllegalArgumentException(pair[1] + " is not a valid terrain.")));
pair[1] + " is not a valid terrain.")));
builder.terrainType(pa.getTerrain()); builder.terrainType(pa.getTerrain());
break; break;
case "type": case "type":
pa.setType(PlotAreaType.fromString(pair[1]).orElseThrow( pa.setType(PlotAreaType.fromString(pair[1])
() -> new IllegalArgumentException( .orElseThrow(() -> new IllegalArgumentException(pair[1] + " is not a valid type.")));
pair[1] + " is not a valid type.")));
builder.plotAreaType(pa.getType()); builder.plotAreaType(pa.getType());
break; break;
default: default:
player.sendMessage( player.sendMessage(TranslatableCaption.of("commandconfig.command_syntax_extended"),
TranslatableCaption.of("commandconfig.command_syntax_extended"), Template.of("value1", getCommandString()),
Template.of("value1", getCommandString()), Template.of("value2", " create [world[:id]] [<modifier>=<value>]..."));
Template.of("value2", " create [world[:id]] [<modifier>=<value>]...")
);
return false; return false;
} }
} }
if (pa.getType() != PlotAreaType.PARTIAL) { if (pa.getType() != PlotAreaType.PARTIAL) {
if (this.worldUtil.isWorld(pa.getWorldName())) { if (this.worldUtil.isWorld(pa.getWorldName())) {
player.sendMessage(TranslatableCaption.of("setup.setup_world_taken"), player.sendMessage(TranslatableCaption.of("setup.setup_world_taken"), Template.of("value", pa.getWorldName()));
Template.of("value", pa.getWorldName()));
return false; return false;
} }
Runnable run = () -> { Runnable run = () -> {
@ -499,8 +443,7 @@ public class Area extends SubCommand {
if (!this.worldConfiguration.contains(path)) { if (!this.worldConfiguration.contains(path)) {
this.worldConfiguration.createSection(path); this.worldConfiguration.createSection(path);
} }
ConfigurationSection section = ConfigurationSection section = this.worldConfiguration.getConfigurationSection(path);
this.worldConfiguration.getConfigurationSection(path);
pa.saveConfiguration(section); pa.saveConfiguration(section);
pa.loadConfiguration(section); pa.loadConfiguration(section);
builder.plotManager(PlotSquared.platform().getPluginName()); builder.plotManager(PlotSquared.platform().getPluginName());
@ -508,13 +451,9 @@ public class Area extends SubCommand {
String world = this.setupUtils.setupWorld(builder); String world = this.setupUtils.setupWorld(builder);
if (this.worldUtil.isWorld(world)) { if (this.worldUtil.isWorld(world)) {
player.sendMessage(TranslatableCaption.of("setup.setup_finished")); player.sendMessage(TranslatableCaption.of("setup.setup_finished"));
player.teleport(this.worldUtil.getSpawn(world), player.teleport(this.worldUtil.getSpawn(world), TeleportCause.COMMAND);
TeleportCause.COMMAND);
} else { } else {
player.sendMessage( player.sendMessage(TranslatableCaption.of("errors.error_create"), Template.of("world", pa.getWorldName()));
TranslatableCaption.of("errors.error_create"),
Template.of("world", pa.getWorldName())
);
} }
try { try {
this.worldConfiguration.save(this.worldFile); this.worldConfiguration.save(this.worldFile);
@ -523,49 +462,37 @@ public class Area extends SubCommand {
} }
}; };
if (hasConfirmation(player)) { if (hasConfirmation(player)) {
CmdConfirm.addPending(player, CmdConfirm.addPending(player, getCommandString() + ' ' + StringMan.join(args, " "), run);
getCommandString() + ' ' + StringMan.join(args, " "), run);
} else { } else {
run.run(); run.run();
} }
return true; return true;
} }
if (pa.getId() == null) { if (pa.getId() == null) {
player.sendMessage( player.sendMessage(TranslatableCaption.of("commandconfig.command_syntax"), Template.of("value", getUsage()));
TranslatableCaption.of("commandconfig.command_syntax"), player.sendMessage(TranslatableCaption.of("commandconfig.command_syntax_extended"),
Template.of("value", getUsage())); Template.of("value1", getCommandString()), Template.of("value2", " create [world[:id]] [<modifier>=<value>]..."));
player.sendMessage(
TranslatableCaption.of("commandconfig.command_syntax_extended"),
Template.of("value1", getCommandString()),
Template.of("value2", " create [world[:id]] [<modifier>=<value>]...")
);
return false; return false;
} }
if (this.worldUtil.isWorld(pa.getWorldName())) { if (this.worldUtil.isWorld(pa.getWorldName())) {
if (!player.getLocation().getWorldName().equals(pa.getWorldName())) { if (!player.getLocation().getWorldName().equals(pa.getWorldName())) {
player.teleport(this.worldUtil.getSpawn(pa.getWorldName()), player.teleport(this.worldUtil.getSpawn(pa.getWorldName()), TeleportCause.COMMAND);
TeleportCause.COMMAND);
} }
} else { } else {
builder.terrainType(PlotAreaTerrainType.NONE); builder.terrainType(PlotAreaTerrainType.NONE);
builder.plotAreaType(PlotAreaType.NORMAL); builder.plotAreaType(PlotAreaType.NORMAL);
this.setupUtils.setupWorld(builder); this.setupUtils.setupWorld(builder);
player.teleport(this.worldUtil.getSpawn(pa.getWorldName()), player.teleport(this.worldUtil.getSpawn(pa.getWorldName()), TeleportCause.COMMAND);
TeleportCause.COMMAND);
} }
metaData.computeIfAbsent(player.getUUID(), missingUUID -> new HashMap<>()).put("area_create_area", pa); metaData.computeIfAbsent(player.getUUID(), missingUUID -> new HashMap<>()).put("area_create_area", pa);
player.sendMessage( player.sendMessage(TranslatableCaption.of("single.get_position"), Template.of("command", getCommandString()));
TranslatableCaption.of("single.get_position"),
Template.of("command", getCommandString())
);
break; break;
} }
return true; return true;
case "i": case "i":
case "info": { case "info": {
if (!Permissions.hasPermission(player, "plots.area.info")) { if (!Permissions.hasPermission(player, "plots.area.info")) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", "plots.area.info"));
Template.of("node", "plots.area.info"));
return false; return false;
} }
PlotArea area; PlotArea area;
@ -577,17 +504,13 @@ public class Area extends SubCommand {
area = this.plotAreaManager.getPlotAreaByString(args[1]); area = this.plotAreaManager.getPlotAreaByString(args[1]);
break; break;
default: default:
player.sendMessage( player.sendMessage(TranslatableCaption.of("commandconfig.command_syntax_extended"), Template.of("value1", getCommandString()),
TranslatableCaption.of("commandconfig.command_syntax_extended"), Template.of("value2", " info [area]"));
Template.of("value1", getCommandString()),
Template.of("value2", " info [area]")
);
return false; return false;
} }
if (area == null) { if (area == null) {
if (args.length == 2) { if (args.length == 2) {
player.sendMessage(TranslatableCaption.of("errors.not_valid_plot_world"), player.sendMessage(TranslatableCaption.of("errors.not_valid_plot_world"), Template.of("value", args[1]));
Template.of("value", args[1]));
} else { } else {
player.sendMessage(TranslatableCaption.of("errors.not_in_plot_world")); player.sendMessage(TranslatableCaption.of("errors.not_in_plot_world"));
} }
@ -616,11 +539,11 @@ public class Area extends SubCommand {
Template typeTemplate = Template.of("type", area.getType().name()); Template typeTemplate = Template.of("type", area.getType().name());
Template terrainTemplate = Template.of("terrain", area.getTerrain().name()); Template terrainTemplate = Template.of("terrain", area.getTerrain().name());
Template usageTemplate = Template.of("usage", String.format("%.2f", percent)); Template usageTemplate = Template.of("usage", String.format("%.2f", percent));
Template claimedTemplate = Template.of("name", String.valueOf(claimed)); Template claimedTemplate = Template.of("claimed", String.valueOf(claimed));
Template clustersTemplate = Template.of("name", String.valueOf(clusters)); Template clustersTemplate = Template.of("clusters", String.valueOf(clusters));
Template regionTemplate = Template.of("name", region); Template regionTemplate = Template.of("region", region);
Template generatorTemplate = Template.of("name", generator); Template generatorTemplate = Template.of("generator", generator);
Template footerTemplate = Template.of("name", TranslatableCaption.of("info.plot_info_footer").getComponent(player)); Template footerTemplate = Template.of("footer", TranslatableCaption.of("info.plot_info_footer").getComponent(player));
player.sendMessage(TranslatableCaption.of("info.area_info_format"), headerTemplate, nameTemplate, typeTemplate, terrainTemplate, player.sendMessage(TranslatableCaption.of("info.area_info_format"), headerTemplate, nameTemplate, typeTemplate, terrainTemplate,
usageTemplate, claimedTemplate, clustersTemplate, regionTemplate, generatorTemplate, footerTemplate); usageTemplate, claimedTemplate, clustersTemplate, regionTemplate, generatorTemplate, footerTemplate);
return true; return true;
@ -628,8 +551,7 @@ public class Area extends SubCommand {
case "l": case "l":
case "list": case "list":
if (!Permissions.hasPermission(player, "plots.area.list")) { if (!Permissions.hasPermission(player, "plots.area.list")) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", "plots.area.list"));
Template.of("node", "plots.area.list"));
return false; return false;
} }
int page; int page;
@ -643,86 +565,71 @@ public class Area extends SubCommand {
break; break;
} }
default: default:
player.sendMessage( player.sendMessage(TranslatableCaption.of("commandconfig.command_syntax_extended"), Template.of("value1", getCommandString()),
TranslatableCaption.of("commandconfig.command_syntax_extended"), Template.of("value2", " list [#]"));
Template.of("value1", getCommandString()),
Template.of("value2", " list [#]")
);
return false; return false;
} }
final List<PlotArea> areas = final List<PlotArea> areas = new ArrayList<>(Arrays.asList(this.plotAreaManager.getAllPlotAreas()));
new ArrayList<>(Arrays.asList(this.plotAreaManager.getAllPlotAreas())); paginate(player, areas, 8, page, new RunnableVal3<Integer, PlotArea, CaptionHolder>() {
paginate(player, areas, 8, page, @Override public void run(Integer i, PlotArea area, CaptionHolder caption) {
new RunnableVal3<Integer, PlotArea, CaptionHolder>() { String name;
@Override public void run(Integer i, PlotArea area, CaptionHolder caption) { double percent;
String name; int claimed = area.getPlotCount();
double percent; int clusters = area.getClusters().size();
int claimed = area.getPlotCount(); String region;
int clusters = area.getClusters().size(); String generator = String.valueOf(area.getGenerator());
String region; if (area.getType() == PlotAreaType.PARTIAL) {
String generator = String.valueOf(area.getGenerator()); PlotId min = area.getMin();
if (area.getType() == PlotAreaType.PARTIAL) { PlotId max = area.getMax();
PlotId min = area.getMin(); name = area.getWorldName() + ';' + area.getId() + ';' + min + ';' + max;
PlotId max = area.getMax(); int size = (max.getX() - min.getX() + 1) * (max.getY() - min.getY() + 1);
name = area.getWorldName() + ';' + area.getId() + ';' + min + ';' percent = claimed == 0 ? 0 : claimed / (double) size;
+ max; region = area.getRegion().toString();
int size = } else {
(max.getX() - min.getX() + 1) * (max.getY() - min.getY() + 1); name = area.getWorldName();
percent = claimed == 0 ? 0 : size / (double) claimed; percent = claimed == 0 ? 0 : (double) claimed / Short.MAX_VALUE * Short.MAX_VALUE;
region = area.getRegion().toString(); region = "N/A";
} else {
name = area.getWorldName();
percent = claimed == 0 ? 0 : Short.MAX_VALUE * Short.MAX_VALUE / (double) claimed;
region = "N/A";
}
Template claimedTemplate = Template.of("claimed", String.valueOf(claimed));
Template usageTemplate = Template.of("usage", String.format("%.2f", percent) + "%");
Template clustersTemplate = Template.of("clusters", String.valueOf(clusters));
Template regionTemplate = Template.of("region", region);
Template generatorTemplate = Template.of("generator", generator);
String tooltip = MINI_MESSAGE.serialize(MINI_MESSAGE
.parse(TranslatableCaption.of("info.area_list_tooltip").getComponent(player), claimedTemplate, usageTemplate,
clustersTemplate, regionTemplate, generatorTemplate));
Template tooltipTemplate = Template.of("hover_info", tooltip);
Template visitcmdTemplate = Template.of("command_tp", "/plot area tp " + area.toString());
Template numberTemplate = Template.of("number", String.valueOf(i));
Template nameTemplate = Template.of("area_name", name);
Template typeTemplate = Template.of("area_type", area.getType().name());
Template terrainTemplate = Template.of("area_terrain", area.getTerrain().name());
Caption item = TranslatableCaption.of("info.area_list_item");
caption.set(StaticCaption.of(MINI_MESSAGE.serialize(MINI_MESSAGE
.parse(item.getComponent(player), tooltipTemplate, visitcmdTemplate, numberTemplate, nameTemplate, typeTemplate,
terrainTemplate))));
} }
}, "/plot area list", TranslatableCaption.of("list.area_list_header_paged")); Template claimedTemplate = Template.of("claimed", String.valueOf(claimed));
Template usageTemplate = Template.of("usage", String.format("%.2f", percent) + "%");
Template clustersTemplate = Template.of("clusters", String.valueOf(clusters));
Template regionTemplate = Template.of("region", region);
Template generatorTemplate = Template.of("generator", generator);
String tooltip = MINI_MESSAGE.serialize(MINI_MESSAGE
.parse(TranslatableCaption.of("info.area_list_tooltip").getComponent(player), claimedTemplate, usageTemplate,
clustersTemplate, regionTemplate, generatorTemplate));
Template tooltipTemplate = Template.of("hover_info", tooltip);
Template visitcmdTemplate = Template.of("command_tp", "/plot area tp " + area.toString());
Template infocmdTemplate = Template.of("command_info", "/plot area info " + area.toString());
Template numberTemplate = Template.of("number", String.valueOf(i));
Template nameTemplate = Template.of("area_name", name);
Template typeTemplate = Template.of("area_type", area.getType().name());
Template terrainTemplate = Template.of("area_terrain", area.getTerrain().name());
caption.set(TranslatableCaption.of("info.area_list_item"));
caption.setTemplates(tooltipTemplate, visitcmdTemplate, numberTemplate, nameTemplate, typeTemplate, terrainTemplate,
infocmdTemplate);
}
}, "/plot area list", TranslatableCaption.of("list.area_list_header_paged"));
return true; return true;
case "regen": case "regen":
case "clear": case "clear":
case "reset": case "reset":
case "regenerate": { case "regenerate": {
if (!Permissions.hasPermission(player, "plots.area.regen")) { if (!Permissions.hasPermission(player, "plots.area.regen")) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", "plots.area.regen"));
Template.of("node", "plots.area.regen"));
return false; return false;
} }
final PlotArea area = player.getApplicablePlotArea(); final PlotArea area = player.getApplicablePlotArea();
if (area == null) { if (area == null) {
player.sendMessage( player.sendMessage(TranslatableCaption.of("errors.not_in_plot_world"));
TranslatableCaption.of("errors.not_in_plot_world")
);
return false; return false;
} }
if (area.getType() != PlotAreaType.PARTIAL) { if (area.getType() != PlotAreaType.PARTIAL) {
player.sendMessage( player.sendMessage(TranslatableCaption.of("single.delete_world_region"), Template.of("world", area.getWorldName()));
TranslatableCaption.of("single.delete_world_region"),
Template.of("world", area.getWorldName())
);
return false; return false;
} }
QueueCoordinator queue = QueueCoordinator queue = blockQueue.getNewQueue(worldUtil.getWeWorld(area.getWorldName()));
blockQueue.getNewQueue(worldUtil.getWeWorld(area.getWorldName())); queue.setChunkConsumer(chunk -> AugmentedUtils.generate(null, area.getWorldName(), chunk.getX(), chunk.getZ(), null));
queue.setChunkConsumer(chunk -> AugmentedUtils
.generate(null, area.getWorldName(), chunk.getX(), chunk.getZ(), null));
queue.addReadChunks(area.getRegion().getChunks()); queue.addReadChunks(area.getRegion().getChunks());
queue.setCompleteTask(() -> player.sendMessage(TranslatableCaption.of("single.regeneration_complete"))); queue.setCompleteTask(() -> player.sendMessage(TranslatableCaption.of("single.regeneration_complete")));
queue.enqueue(); queue.enqueue();
@ -734,21 +641,16 @@ public class Area extends SubCommand {
case "visit": case "visit":
case "tp": case "tp":
if (!Permissions.hasPermission(player, "plots.area.tp")) { if (!Permissions.hasPermission(player, "plots.area.tp")) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", "plots.area.tp"));
Template.of("node", "plots.area.tp"));
return false; return false;
} }
if (args.length != 2) { if (args.length != 2) {
player.sendMessage( player.sendMessage(TranslatableCaption.of("commandconfig.command_syntax"), Template.of("value", "/plot visit [area]"));
TranslatableCaption.of("commandconfig.command_syntax"),
Template.of("value", "/plot visit [area]")
);
return false; return false;
} }
PlotArea area = this.plotAreaManager.getPlotAreaByString(args[1]); PlotArea area = this.plotAreaManager.getPlotAreaByString(args[1]);
if (area == null) { if (area == null) {
player.sendMessage(TranslatableCaption.of("errors.not_valid_plot_world"), player.sendMessage(TranslatableCaption.of("errors.not_valid_plot_world"), Template.of("value", args[1]));
Template.of("value", args[1]));
return false; return false;
} }
Location center; Location center;
@ -757,14 +659,11 @@ public class Area extends SubCommand {
player.teleport(center, TeleportCause.COMMAND); player.teleport(center, TeleportCause.COMMAND);
} else { } else {
CuboidRegion region = area.getRegion(); CuboidRegion region = area.getRegion();
center = Location.at(area.getWorldName(), region.getMinimumPoint().getX() center = Location.at(area.getWorldName(),
+ (region.getMaximumPoint().getX() - region.getMinimumPoint().getX()) / 2, region.getMinimumPoint().getX() + (region.getMaximumPoint().getX() - region.getMinimumPoint().getX()) / 2, 0,
0, region.getMinimumPoint().getZ() region.getMinimumPoint().getZ() + (region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ()) / 2);
+ (region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ()) this.worldUtil.getHighestBlock(area.getWorldName(), center.getX(), center.getZ(),
/ 2); y -> player.teleport(center.withY(1 + y), TeleportCause.COMMAND));
this.worldUtil
.getHighestBlock(area.getWorldName(), center.getX(), center.getZ(),
y -> player.teleport(center.withY(1 + y), TeleportCause.COMMAND));
} }
return true; return true;
case "delete": case "delete":

View File

@ -248,7 +248,7 @@ public abstract class Command {
if (page < 0) { if (page < 0) {
page = 0; page = 0;
} }
int totalPages = (int) Math.ceil((double) c.size() / size); int totalPages = (int) Math.floor((double) c.size() / size);
if (page > totalPages) { if (page > totalPages) {
page = totalPages; page = totalPages;
} }
@ -266,9 +266,9 @@ public abstract class Command {
int i = page * size; int i = page * size;
for (T obj : subList) { for (T obj : subList) {
i++; i++;
CaptionHolder msg = new CaptionHolder(); final CaptionHolder msg = new CaptionHolder();
add.run(i, obj, msg); add.run(i, obj, msg);
player.sendMessage(msg.get()); player.sendMessage(msg.get(), msg.getTemplates());
} }
// Send the footer // Send the footer
if (page < totalPages && page > 0) { // Back | Next if (page < totalPages && page > 0) { // Back | Next

View File

@ -27,13 +27,12 @@ package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.Caption; import com.plotsquared.core.configuration.caption.Caption;
import com.plotsquared.core.configuration.caption.CaptionHolder; import com.plotsquared.core.configuration.caption.CaptionHolder;
import com.plotsquared.core.configuration.caption.StaticCaption;
import com.plotsquared.core.configuration.caption.Templates; import com.plotsquared.core.configuration.caption.Templates;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.plot.PlotArea;
@ -52,10 +51,11 @@ import com.plotsquared.core.util.query.PlotQuery;
import com.plotsquared.core.util.query.SortingStrategy; import com.plotsquared.core.util.query.SortingStrategy;
import com.plotsquared.core.util.task.RunnableVal3; import com.plotsquared.core.util.task.RunnableVal3;
import com.plotsquared.core.uuid.UUIDMapping; import com.plotsquared.core.uuid.UUIDMapping;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.minimessage.Template; import net.kyori.adventure.text.minimessage.Template;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
@ -80,16 +80,14 @@ public class ListCmd extends SubCommand {
private final PlotAreaManager plotAreaManager; private final PlotAreaManager plotAreaManager;
private final EconHandler econHandler; private final EconHandler econHandler;
@Inject public ListCmd(@Nonnull final PlotAreaManager plotAreaManager, @Inject public ListCmd(@Nonnull final PlotAreaManager plotAreaManager, @Nonnull final EconHandler econHandler) {
@Nonnull final EconHandler econHandler) {
this.plotAreaManager = plotAreaManager; this.plotAreaManager = plotAreaManager;
this.econHandler = econHandler; this.econHandler = econHandler;
} }
private String[] getArgumentList(PlotPlayer player) { private String[] getArgumentList(PlotPlayer player) {
List<String> args = new ArrayList<>(); List<String> args = new ArrayList<>();
if (this.econHandler != null && Permissions if (this.econHandler != null && Permissions.hasPermission(player, Permission.PERMISSION_LIST_FOR_SALE)) {
.hasPermission(player, Permission.PERMISSION_LIST_FOR_SALE)) {
args.add("forsale"); args.add("forsale");
} }
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_MINE)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_MINE)) {
@ -130,7 +128,7 @@ public class ListCmd extends SubCommand {
public void noArgs(PlotPlayer<?> player) { public void noArgs(PlotPlayer<?> player) {
player.sendMessage(TranslatableCaption.of("commandconfig.subcommand_set_options_header"), player.sendMessage(TranslatableCaption.of("commandconfig.subcommand_set_options_header"),
Templates.of("values", Arrays.toString(getArgumentList(player)))); Templates.of("values", Arrays.toString(getArgumentList(player))));
} }
@Override public boolean onCommand(PlotPlayer<?> player, String[] args) { @Override public boolean onCommand(PlotPlayer<?> player, String[] args) {
@ -162,11 +160,8 @@ public class ListCmd extends SubCommand {
final Consumer<PlotQuery> plotConsumer = query -> { final Consumer<PlotQuery> plotConsumer = query -> {
if (query == null) { if (query == null) {
player.sendMessage( player.sendMessage(TranslatableCaption.of("commandconfig.did_you_mean"),
TranslatableCaption.of("commandconfig.did_you_mean"), Template.of("value", new StringComparison<>(args[0], new String[] {"mine", "shared", "world", "all"}).getBestMatch()));
Template.of("value", new StringComparison<>(args[0], new String[] {"mine", "shared", "world", "all"})
.getBestMatch())
);
return; return;
} }
@ -190,8 +185,7 @@ public class ListCmd extends SubCommand {
switch (arg) { switch (arg) {
case "mine": case "mine":
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_MINE)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_MINE)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Templates.of("node", "plots.list.mine"));
Templates.of("node", "plots.list.mine"));
return false; return false;
} }
sort[0] = false; sort[0] = false;
@ -199,29 +193,25 @@ public class ListCmd extends SubCommand {
break; break;
case "shared": case "shared":
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_SHARED)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_SHARED)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Templates.of("node", "plots.list.shared"));
Templates.of("node", "plots.list.shared"));
return false; return false;
} }
plotConsumer.accept(PlotQuery.newQuery().withMember(player.getUUID()).thatPasses(plot -> !plot.isOwnerAbs(player.getUUID()))); plotConsumer.accept(PlotQuery.newQuery().withMember(player.getUUID()).thatPasses(plot -> !plot.isOwnerAbs(player.getUUID())));
break; break;
case "world": case "world":
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_WORLD)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_WORLD)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Templates.of("node", "plots.list.world"));
Templates.of("node", "plots.list.world"));
return false; return false;
} }
if (!Permissions.hasPermission(player, "plots.list.world." + world)) { if (!Permissions.hasPermission(player, "plots.list.world." + world)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Templates.of("node", "plots.list.world" + world));
Templates.of("node", "plots.list.world" + world));
return false; return false;
} }
plotConsumer.accept(PlotQuery.newQuery().inWorld(world)); plotConsumer.accept(PlotQuery.newQuery().inWorld(world));
break; break;
case "expired": case "expired":
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_EXPIRED)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_EXPIRED)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Templates.of("node", "plots.list.expired"));
Templates.of("node", "plots.list.expired"));
return false; return false;
} }
if (ExpireManager.IMP == null) { if (ExpireManager.IMP == null) {
@ -232,13 +222,11 @@ public class ListCmd extends SubCommand {
break; break;
case "area": case "area":
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_AREA)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_AREA)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Templates.of("node", "plots.list.area"));
Templates.of("node", "plots.list.area"));
return false; return false;
} }
if (!Permissions.hasPermission(player, "plots.list.world." + world)) { if (!Permissions.hasPermission(player, "plots.list.world." + world)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Templates.of("node", "plots.list.world" + world));
Templates.of("node", "plots.list.world" + world));
return false; return false;
} }
if (area == null) { if (area == null) {
@ -249,16 +237,14 @@ public class ListCmd extends SubCommand {
break; break;
case "all": case "all":
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_ALL)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_ALL)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Templates.of("node", "plots.list.all"));
Templates.of("node", "plots.list.all"));
return false; return false;
} }
plotConsumer.accept(PlotQuery.newQuery().allPlots()); plotConsumer.accept(PlotQuery.newQuery().allPlots());
break; break;
case "done": case "done":
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_DONE)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_DONE)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Templates.of("node", "plots.list.done"));
Templates.of("node", "plots.list.done"));
return false; return false;
} }
sort[0] = false; sort[0] = false;
@ -266,8 +252,7 @@ public class ListCmd extends SubCommand {
break; break;
case "top": case "top":
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_TOP)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_TOP)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Templates.of("node", "plots.list.top"));
Templates.of("node", "plots.list.top"));
return false; return false;
} }
sort[0] = false; sort[0] = false;
@ -275,8 +260,7 @@ public class ListCmd extends SubCommand {
break; break;
case "forsale": case "forsale":
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_FOR_SALE)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_FOR_SALE)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Templates.of("node", "plots.list.forsale"));
Templates.of("node", "plots.list.forsale"));
return false; return false;
} }
if (this.econHandler.isSupported()) { if (this.econHandler.isSupported()) {
@ -286,21 +270,19 @@ public class ListCmd extends SubCommand {
break; break;
case "unowned": case "unowned":
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_UNOWNED)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_UNOWNED)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Templates.of("node", "plots.list.unowned"));
Templates.of("node", "plots.list.unowned"));
return false; return false;
} }
plotConsumer.accept(PlotQuery.newQuery().allPlots().thatPasses(plot -> plot.getOwner() == null)); plotConsumer.accept(PlotQuery.newQuery().allPlots().thatPasses(plot -> plot.getOwner() == null));
break; break;
case "fuzzy": case "fuzzy":
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_FUZZY)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_FUZZY)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Templates.of("node", "plots.list.fuzzy"));
Templates.of("node", "plots.list.fuzzy"));
return false; return false;
} }
if (args.length < (page == -1 ? 2 : 3)) { if (args.length < (page == -1 ? 2 : 3)) {
player.sendMessage(TranslatableCaption.of("commandconfig.command_syntax"), player.sendMessage(TranslatableCaption.of("commandconfig.command_syntax"),
Templates.of("value", "/plot list fuzzy <search...> [#]")); Templates.of("value", "/plot list fuzzy <search...> [#]"));
return false; return false;
} }
String term; String term;
@ -315,45 +297,39 @@ public class ListCmd extends SubCommand {
default: default:
if (this.plotAreaManager.hasPlotArea(args[0])) { if (this.plotAreaManager.hasPlotArea(args[0])) {
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_WORLD)) { if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_WORLD)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Templates.of("node", "plots.list.world"));
Templates.of("node", "plots.list.world"));
return false; return false;
} }
if (!Permissions.hasPermission(player, "plots.list.world." + args[0])) { if (!Permissions.hasPermission(player, "plots.list.world." + args[0])) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), player.sendMessage(TranslatableCaption.of("permission.no_permission"), Templates.of("node", "plots.list.world." + args[0]));
Templates.of("node", "plots.list.world." + args[0]));
return false; return false;
} }
plotConsumer.accept(PlotQuery.newQuery().inWorld(args[0])); plotConsumer.accept(PlotQuery.newQuery().inWorld(args[0]));
break; break;
} }
PlotSquared.get().getImpromptuUUIDPipeline() PlotSquared.get().getImpromptuUUIDPipeline().getSingle(args[0], (uuid, throwable) -> {
.getSingle(args[0], (uuid, throwable) -> { if (throwable instanceof TimeoutException) {
if (throwable instanceof TimeoutException) { player.sendMessage(TranslatableCaption.of("players.fetching_players_timeout"));
player.sendMessage(TranslatableCaption.of("players.fetching_players_timeout")); } else if (throwable != null) {
} else if (throwable != null) {
if (uuid == null) {
try {
uuid = UUID.fromString(args[0]);
} catch (Exception ignored) {
}
}
}
if (uuid == null) { if (uuid == null) {
player.sendMessage(TranslatableCaption.of("errors.invalid_player"), try {
Templates.of("value", args[0])); uuid = UUID.fromString(args[0]);
} else { } catch (Exception ignored) {
if (!Permissions
.hasPermission(player, Permission.PERMISSION_LIST_PLAYER)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.list.player"));
} else {
sort[0] = false;
plotConsumer.accept(PlotQuery.newQuery().ownedBy(uuid).withSortingStrategy(SortingStrategy.SORT_BY_TEMP));
} }
} }
}); }
if (uuid == null) {
player.sendMessage(TranslatableCaption.of("errors.invalid_player"), Templates.of("value", args[0]));
} else {
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_PLAYER)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"), Templates.of("node", "plots.list.player"));
} else {
sort[0] = false;
plotConsumer.accept(PlotQuery.newQuery().ownedBy(uuid).withSortingStrategy(SortingStrategy.SORT_BY_TEMP));
}
}
});
} }
return true; return true;
@ -376,32 +352,32 @@ public class ListCmd extends SubCommand {
} else { } else {
color = TranslatableCaption.of("info.plot_list_default"); color = TranslatableCaption.of("info.plot_list_default");
} }
String trusted = MINI_MESSAGE.serialize(MINI_MESSAGE.parse(TranslatableCaption.of("info.plot_info_trusted").getComponent(player), Component trusted = MINI_MESSAGE.parse(TranslatableCaption.of("info.plot_info_trusted").getComponent(player),
Template.of("trusted", PlayerManager.getPlayerList(plot.getTrusted())))); Template.of("trusted", PlayerManager.getPlayerList(plot.getTrusted())));
String members = MINI_MESSAGE.serialize(MINI_MESSAGE.parse(TranslatableCaption.of("info.plot_info_members").getComponent(player), Component members = MINI_MESSAGE.parse(TranslatableCaption.of("info.plot_info_members").getComponent(player),
Template.of("members", PlayerManager.getPlayerList(plot.getMembers())))); Template.of("members", PlayerManager.getPlayerList(plot.getMembers())));
Template command_tp = Template.of("command_tp", "/plot visit " + plot.getArea() + ";" + plot.getId()); Template command_tp = Template.of("command_tp", "/plot visit " + plot.getArea() + ";" + plot.getId());
Template command_info = Template.of("command_info", "/plot info " + plot.getArea() + ";" + plot.getId()); Template command_info = Template.of("command_info", "/plot info " + plot.getArea() + ";" + plot.getId());
Template hover_info = Template.of("hover_info", trusted + "\n" + members); Template hover_info =
Template.of("hover_info", MINI_MESSAGE.serialize(Component.text().append(trusted).append(Component.newline()).append(members).asComponent()));
Template numberTemplate = Template.of("number", String.valueOf(i)); Template numberTemplate = Template.of("number", String.valueOf(i));
Template plotTemplate = Template plotTemplate = Template.of("plot", MINI_MESSAGE.parse(color.getComponent(player), Template.of("plot", plot.toString())));
Template.of("plot", MINI_MESSAGE.serialize(MINI_MESSAGE.parse(color.getComponent(player), Template.of("plot", plot.toString()))));
String prefix = ""; String prefix = "";
String online = TranslatableCaption.of("info.plot_list_player_online").getComponent(player); String online = TranslatableCaption.of("info.plot_list_player_online").getComponent(player);
String offline = TranslatableCaption.of("info.plot_list_player_offline").getComponent(player); String offline = TranslatableCaption.of("info.plot_list_player_offline").getComponent(player);
StringBuilder builder = new StringBuilder(); TextComponent.Builder builder = Component.text();
try { try {
final List<UUIDMapping> names = PlotSquared.get().getImpromptuUUIDPipeline().getNames(plot.getOwners()) final List<UUIDMapping> names = PlotSquared.get().getImpromptuUUIDPipeline().getNames(plot.getOwners())
.get(Settings.UUID.BLOCKING_TIMEOUT, TimeUnit.MILLISECONDS); .get(Settings.UUID.BLOCKING_TIMEOUT, TimeUnit.MILLISECONDS);
for (final UUIDMapping uuidMapping : names) { for (final UUIDMapping uuidMapping : names) {
PlotPlayer<?> pp = PlotSquared.platform().getPlayerManager().getPlayerIfExists(uuidMapping.getUuid()); PlotPlayer<?> pp = PlotSquared.platform().getPlayerManager().getPlayerIfExists(uuidMapping.getUuid());
Template prefixTemplate = Template.of("prefix", prefix); Template prefixTemplate = Template.of("prefix", prefix);
Template playerTemplate = Template.of("prefix", uuidMapping.getUsername()); Template playerTemplate = Template.of("player", uuidMapping.getUsername());
if (pp != null) { if (pp != null) {
builder.append(MINI_MESSAGE.serialize(MINI_MESSAGE.parse(online, prefixTemplate, playerTemplate))); builder.append(MINI_MESSAGE.parse(online, prefixTemplate, playerTemplate));
} else { } else {
builder.append(MINI_MESSAGE.serialize(MINI_MESSAGE.parse(offline, prefixTemplate, playerTemplate))); builder.append(MINI_MESSAGE.parse(offline, prefixTemplate, playerTemplate));
} }
prefix = ", "; prefix = ", ";
} }
@ -419,18 +395,16 @@ public class ListCmd extends SubCommand {
} catch (TimeoutException e) { } catch (TimeoutException e) {
player.sendMessage(TranslatableCaption.of("players.fetching_players_timeout")); player.sendMessage(TranslatableCaption.of("players.fetching_players_timeout"));
} }
Template players = Template.of("players", builder.toString()); Template players = Template.of("players", builder.asComponent());
caption.set(StaticCaption.of(MINI_MESSAGE.serialize(MINI_MESSAGE caption.set(TranslatableCaption.of("info.plot_list_item"));
.parse(TranslatableCaption.of("info.plot_list_item").getComponent(player), command_tp, command_info, hover_info, numberTemplate, caption.setTemplates(command_tp, command_info, hover_info, numberTemplate, plotTemplate, players);
plotTemplate, players))));
} }
}, "/plot list " + args[0], TranslatableCaption.of("list.plot_list_header_paged")); }, "/plot list " + args[0], TranslatableCaption.of("list.plot_list_header_paged"));
} }
@Override public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) { @Override public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) {
final List<String> completions = new LinkedList<>(); final List<String> completions = new LinkedList<>();
if (this.econHandler.isSupported() && Permissions if (this.econHandler.isSupported() && Permissions.hasPermission(player, Permission.PERMISSION_LIST_FOR_SALE)) {
.hasPermission(player, Permission.PERMISSION_LIST_FOR_SALE)) {
completions.add("forsale"); completions.add("forsale");
} }
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_MINE)) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_MINE)) {

View File

@ -25,9 +25,12 @@
*/ */
package com.plotsquared.core.configuration.caption; package com.plotsquared.core.configuration.caption;
import net.kyori.adventure.text.minimessage.Template;
public class CaptionHolder { public class CaptionHolder {
private Caption caption = StaticCaption.of(""); private Caption caption = StaticCaption.of("");
private Template[] templates = new Template[0];
public void set(Caption caption) { public void set(Caption caption) {
this.caption = caption; this.caption = caption;
@ -37,4 +40,12 @@ public class CaptionHolder {
return this.caption; return this.caption;
} }
public Template[] getTemplates() {
return this.templates;
}
public void setTemplates(Template... templates) {
this.templates = templates;
}
} }

View File

@ -76,6 +76,7 @@ import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeType;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.minimessage.MiniMessage; import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.minimessage.Template; import net.kyori.adventure.text.minimessage.Template;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -2663,9 +2664,9 @@ public class Plot {
String alias = !this.getAlias().isEmpty() ? this.getAlias() : TranslatableCaption.of("info.none").getComponent(player); String alias = !this.getAlias().isEmpty() ? this.getAlias() : TranslatableCaption.of("info.none").getComponent(player);
Location bot = this.getCorners()[0]; Location bot = this.getCorners()[0];
PlotSquared.platform().getWorldUtil().getBiome(Objects.requireNonNull(this.getWorldName()), bot.getX(), bot.getZ(), biome -> { PlotSquared.platform().getWorldUtil().getBiome(Objects.requireNonNull(this.getWorldName()), bot.getX(), bot.getZ(), biome -> {
String trusted = PlayerManager.getPlayerList(this.getTrusted()); Component trusted = PlayerManager.getPlayerList(this.getTrusted());
String members = PlayerManager.getPlayerList(this.getMembers()); Component members = PlayerManager.getPlayerList(this.getMembers());
String denied = PlayerManager.getPlayerList(this.getDenied()); Component denied = PlayerManager.getPlayerList(this.getDenied());
String seen; String seen;
if (Settings.Enabled_Components.PLOT_EXPIRY && ExpireManager.IMP != null) { if (Settings.Enabled_Components.PLOT_EXPIRY && ExpireManager.IMP != null) {
if (this.isOnline()) { if (this.isOnline()) {
@ -2712,7 +2713,7 @@ public class Plot {
} }
} }
boolean build = this.isAdded(player.getUUID()); boolean build = this.isAdded(player.getUUID());
String owner = this.getOwners().isEmpty() ? "unowned" : PlayerManager.getPlayerList(this.getOwners()); Component owner = this.getOwners().isEmpty() ? Component.text("unowned") : PlayerManager.getPlayerList(this.getOwners());
Template headerTemplate = Template.of("header", TranslatableCaption.of("info.plot_info_header").getComponent(player)); Template headerTemplate = Template.of("header", TranslatableCaption.of("info.plot_info_header").getComponent(player));
Template footerTemplate = Template.of("footer", TranslatableCaption.of("info.plot_info_footer").getComponent(player)); Template footerTemplate = Template.of("footer", TranslatableCaption.of("info.plot_info_footer").getComponent(player));
Template areaTemplate; Template areaTemplate;
@ -2748,13 +2749,14 @@ public class Plot {
} }
if (full && Settings.Ratings.CATEGORIES != null && Settings.Ratings.CATEGORIES.size() > 1) { if (full && Settings.Ratings.CATEGORIES != null && Settings.Ratings.CATEGORIES.size() > 1) {
double[] ratings = this.getAverageRatings(); double[] ratings = this.getAverageRatings();
String rating = ""; StringBuilder rating = new StringBuilder();
String prefix = ""; String prefix = "";
for (int i = 0; i < ratings.length; i++) { for (int i = 0; i < ratings.length; i++) {
rating += prefix + Settings.Ratings.CATEGORIES.get(i) + '=' + String.format("%.1f", ratings[i]); rating.append(prefix).append(Settings.Ratings.CATEGORIES.get(i)).append('=')
.append(String.format("%.1f", ratings[i]));
prefix = ","; prefix = ",";
} }
ratingTemplate = Template.of("rating", rating); ratingTemplate = Template.of("rating", rating.toString());
} else { } else {
ratingTemplate = Template.of("rating", String.format("%.1f", this.getAverageRating()) + '/' + max); ratingTemplate = Template.of("rating", String.format("%.1f", this.getAverageRating()) + '/' + max);
} }

View File

@ -27,6 +27,7 @@ package com.plotsquared.core.util;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.Caption;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.database.DBFunc; import com.plotsquared.core.database.DBFunc;
import com.plotsquared.core.player.ConsolePlayer; import com.plotsquared.core.player.ConsolePlayer;
@ -34,6 +35,7 @@ import com.plotsquared.core.player.OfflinePlotPlayer;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.uuid.UUIDMapping; import com.plotsquared.core.uuid.UUIDMapping;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.minimessage.MiniMessage; import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.minimessage.Template; import net.kyori.adventure.text.minimessage.Template;
@ -110,9 +112,9 @@ public abstract class PlayerManager<P extends PlotPlayer<? extends T>, T> {
* - Uses the format {@link TranslatableCaption#of(String)} of "info.plot_user_list" for the returned string * - Uses the format {@link TranslatableCaption#of(String)} of "info.plot_user_list" for the returned string
* *
* @param uuids UUIDs * @param uuids UUIDs
* @return Name list * @return Component of name list
*/ */
@Nonnull public static String getPlayerList(@Nonnull final Collection<UUID> uuids) { @Nonnull public static Component getPlayerList(@Nonnull final Collection<UUID> uuids) {
if (uuids.size() < 1) { if (uuids.size() < 1) {
TranslatableCaption.of("info.none"); TranslatableCaption.of("info.none");
} }
@ -141,7 +143,7 @@ public abstract class PlayerManager<P extends PlotPlayer<? extends T>, T> {
} }
String c = TranslatableCaption.of("info.plot_user_list").getComponent(ConsolePlayer.getConsole()); String c = TranslatableCaption.of("info.plot_user_list").getComponent(ConsolePlayer.getConsole());
Component list = MINI_MESSAGE.deserialize(""); TextComponent.Builder list = Component.text();
for (int x = 0; x < users.size(); x++) { for (int x = 0; x < users.size(); x++) {
if (x + 1 == uuids.size()) { if (x + 1 == uuids.size()) {
list.append(MINI_MESSAGE.parse(c, Template.of("user", users.get(x)))); list.append(MINI_MESSAGE.parse(c, Template.of("user", users.get(x))));
@ -149,7 +151,7 @@ public abstract class PlayerManager<P extends PlotPlayer<? extends T>, T> {
list.append(MINI_MESSAGE.parse(c + ", ", Template.of("user", users.get(x)))); list.append(MINI_MESSAGE.parse(c + ", ", Template.of("user", users.get(x))));
} }
} }
return list.toString(); return list.asComponent();
} }
/** /**

View File

@ -2,12 +2,12 @@
"confirm.expired_confirm": "<prefix><red>Confirmation has expired, please run the command again!</red>", "confirm.expired_confirm": "<prefix><red>Confirmation has expired, please run the command again!</red>",
"confirm.failed_confirm": "<prefix><red>You have no pending actions to confirm!</red>", "confirm.failed_confirm": "<prefix><red>You have no pending actions to confirm!</red>",
"confirm.requires_confirm": "<prefix><gray>Are you sure you wish to execute: </gray><gold><command></gold><gray>?</gray>\n<red>This cannot be undone! If you are sure: </red><gray><value></gray>", "confirm.requires_confirm": "<prefix><gray>Are you sure you wish to execute: </gray><gold><command></gold><gray>?</gray>\n<red>This cannot be undone! If you are sure: </red><gray><value></gray>",
"move.move_success": "<prefix><dark_aqua>Successfully moved plot.</dark_aqua>", "move.move_success": "<prefix><dark_aqua>Successfully moved plot.</dark_aqua>",
"move.move_merged": "<prefix><red>Merged plots may not be moved. Please unmerge the plot before performing the move.</red>", "move.move_merged": "<prefix><red>Merged plots may not be moved. Please unmerge the plot before performing the move.</red>",
"move.copy_success": "<prefix><dark_aqua>Successfully copied plot.</dark_aqua>", "move.copy_success": "<prefix><dark_aqua>Successfully copied plot.</dark_aqua>",
"move.requires_unowned": "<prefix><red>The location specified is already occupied.</red>", "move.requires_unowned": "<prefix><red>The location specified is already occupied.</red>",
"debug.requires_unmerged": "<prefix><red>The plot cannot be merged.</red>", "debug.requires_unmerged": "<prefix><red>The plot cannot be merged.</red>",
"debug.debug_header": "<prefix> <gold>Debug Information</gold>\n", "debug.debug_header": "<prefix> <gold>Debug Information</gold>\n",
"debug.debug_section": "<gray>>></gray> <gold><bold>&l<val></bold></gold>", "debug.debug_section": "<gray>>></gray> <gold><bold>&l<val></bold></gold>",
@ -18,11 +18,11 @@
"debug.player_in_debugmode": "<prefix><gold>Player(s) in debug mode: </gold>", "debug.player_in_debugmode": "<prefix><gold>Player(s) in debug mode: </gold>",
"debug.player_in_debugmode_list": "<gold>- </gold><gray><value></gray>\n", "debug.player_in_debugmode_list": "<gold>- </gold><gray><value></gray>\n",
"debug.entity_categories": "<prefix><red>Entity categories:</red>", "debug.entity_categories": "<prefix><red>Entity categories:</red>",
"set.set_attribute": "<prefix><dark_aqua>Successfully set <attribute> to <value>.</dark_aqua>", "set.set_attribute": "<prefix><dark_aqua>Successfully set <attribute> to <value>.</dark_aqua>",
"area.set_pos2": "You will now set pos2: <command>. Note: The chosen plot size may result in the created area not exactly matching your second position.", "area.set_pos2": "You will now set pos2: <command>. Note: The chosen plot size may result in the created area not exactly matching your second position.",
"web.generating_link": "<prefix><gold>Processing plot...</gold>", "web.generating_link": "<prefix><gold>Processing plot...</gold>",
"web.generating_link_failed": "<prefix><red>Failed to generate download link!</red>", "web.generating_link_failed": "<prefix><red>Failed to generate download link!</red>",
"web.generation_link_success": "<click:open_url:<url>><url></click>", "web.generation_link_success": "<click:open_url:<url>><url></click>",
@ -31,9 +31,9 @@
"web.load_failed": "<prefix><red>Failed to load schematic.</red>", "web.load_failed": "<prefix><red>Failed to load schematic.</red>",
"web.load_list": "<prefix><gray>To load a schematic, use </gray><gold><command></gold><gray>.</gray>", "web.load_list": "<prefix><gray>To load a schematic, use </gray><gold><command></gold><gray>.</gray>",
"web.save_success": "<prefix><gold>Successfully saved!</gold>", "web.save_success": "<prefix><gold>Successfully saved!</gold>",
"compass.compass_target": "<prefix><dark_aqua>Successfully targeted plot with your compass.</dark_aqua>", "compass.compass_target": "<prefix><dark_aqua>Successfully targeted plot with your compass.</dark_aqua>",
"cluster.cluster_available_args": "<prefix><gold>The following sub commands are available: </gold><dark_aqua>list</dark_aqua><gray>, </gray><dark_aqua>create</dark_aqua><gray>, </gray><dark_aqua>delete</dark_aqua><gray>, </gray><dark_aqua>resize</dark_aqua><gray>, </gray><dark_aqua>invite</dark_aqua><gray>, </gray><dark_aqua>kick</dark_aqua><gray>, </gray><dark_aqua>leave</dark_aqua><gray>, </gray><dark_aqua>members</dark_aqua><gray>, </gray><dark_aqua>info</dark_aqua><gray>, </gray><dark_aqua>tp</dark_aqua><gray>, </gray><dark_aqua>sethome</dark_aqua>", "cluster.cluster_available_args": "<prefix><gold>The following sub commands are available: </gold><dark_aqua>list</dark_aqua><gray>, </gray><dark_aqua>create</dark_aqua><gray>, </gray><dark_aqua>delete</dark_aqua><gray>, </gray><dark_aqua>resize</dark_aqua><gray>, </gray><dark_aqua>invite</dark_aqua><gray>, </gray><dark_aqua>kick</dark_aqua><gray>, </gray><dark_aqua>leave</dark_aqua><gray>, </gray><dark_aqua>members</dark_aqua><gray>, </gray><dark_aqua>info</dark_aqua><gray>, </gray><dark_aqua>tp</dark_aqua><gray>, </gray><dark_aqua>sethome</dark_aqua>",
"cluster.cluster_list_heading": "<prefix><gray>There are </gray><gold><amount></gold><gray> clusters in this world.</gray>", "cluster.cluster_list_heading": "<prefix><gray>There are </gray><gold><amount></gold><gray> clusters in this world.</gray>",
"cluster.cluster_list_element": "<prefix><gray> - </gray><gold><cluster></gold>\n", "cluster.cluster_list_element": "<prefix><gray> - </gray><gold><cluster></gold>\n",
@ -60,21 +60,21 @@
"cluster.cluster_info": "<prefix><gold>Current cluster: </gold><gray><id></gray>\n<gold>Name: </gold><gray><name></gray>\n<gold>Owner: </gold><gray><owner></gray>\n<gold>Size: </gold><gray><size></gray>\n<gold>Rights: </gold><gray><rights></gray>", "cluster.cluster_info": "<prefix><gold>Current cluster: </gold><gray><id></gray>\n<gold>Name: </gold><gray><name></gray>\n<gold>Owner: </gold><gray><owner></gray>\n<gold>Size: </gold><gray><size></gray>\n<gold>Rights: </gold><gray><rights></gray>",
"border.border": "<prefix><gray>You are outside the current map border.</gray>", "border.border": "<prefix><gray>You are outside the current map border.</gray>",
"worldedit.worldedit_bypass": "<prefix><gray><italic>To bypass your restrictions use </gray><dark_aqua><command></dark_aqua></italic>", "worldedit.worldedit_bypass": "<prefix><gray><italic>To bypass your restrictions use </gray><dark_aqua><command></dark_aqua></italic>",
"worldedit.worldedit_bypassed": "<prefix><gray>Currently bypassing WorldEdit restriction.</gray>", "worldedit.worldedit_bypassed": "<prefix><gray>Currently bypassing WorldEdit restriction.</gray>",
"gamemode.gamemode_was_bypassed": "<prefix><gold>You bypassed the gamemode (</gold><gray><gamemode></gray><gold>) <gold>set for </gold><gray><plot>.</gray>", "gamemode.gamemode_was_bypassed": "<prefix><gold>You bypassed the gamemode (</gold><gray><gamemode></gray><gold>) <gold>set for </gold><gray><plot>.</gray>",
"height.height_limit": "<prefix><gold>This plot area has a height limit of </gold><gray><limit>.</gray>", "height.height_limit": "<prefix><gold>This plot area has a height limit of </gold><gray><limit>.</gray>",
"notification.notify_enter": "<prefix><gray><player> entered your plot (</gray><gold><plot></gold><gray>).</gray>", "notification.notify_enter": "<prefix><gray><player> entered your plot (</gray><gold><plot></gold><gray>).</gray>",
"notification.notify_leave": "<prefix><gray><player> left your plot (</gray><gold><plot></gold><gray>).</gray>", "notification.notify_leave": "<prefix><gray><player> left your plot (</gray><gold><plot></gold><gray>).</gray>",
"swap.swap_overlap": "<prefix><red>The proposed areas are not allowed to overlap.</red>", "swap.swap_overlap": "<prefix><red>The proposed areas are not allowed to overlap.</red>",
"swap.swap_success": "<prefix><dark_aqua>Successfully swapped plots.</dark_aqua>", "swap.swap_success": "<prefix><dark_aqua>Successfully swapped plots.</dark_aqua>",
"swap.swap_merged": "<prefix><red>Merged plots may not be swapped. Please unmerge the plots before performing the swap.</red>", "swap.swap_merged": "<prefix><red>Merged plots may not be swapped. Please unmerge the plots before performing the swap.</red>",
"comment.inbox_notification": "<prefix><dark_aqua><amount> </dark_aqua><gray>unread messages. Use <command>.</gray>", "comment.inbox_notification": "<prefix><dark_aqua><amount> </dark_aqua><gray>unread messages. Use <command>.</gray>",
"comment.not_valid_inbox_index": "<prefix><gray>No comment at index <number>.</gray>", "comment.not_valid_inbox_index": "<prefix><gray>No comment at index <number>.</gray>",
"comment.inbox_item": "<gray> - </gray><dark_aqua><value></dark_aqua>", "comment.inbox_item": "<gray> - </gray><dark_aqua><value></dark_aqua>",
@ -87,23 +87,23 @@
"comment.comment_removed_failure": "<prefix><red>Failed to delete comment!</red>", "comment.comment_removed_failure": "<prefix><red>Failed to delete comment!</red>",
"comment.comment_added": "<prefix><dark_aqua>A comment has been left.</dark_aqua>", "comment.comment_added": "<prefix><dark_aqua>A comment has been left.</dark_aqua>",
"comment.inbox_empty": "<prefix><gray>No comments.</gray>", "comment.inbox_empty": "<prefix><gray>No comments.</gray>",
"console.not_console": "<prefix><red>For safety reasons, this command can only be executed by console.</red>", "console.not_console": "<prefix><red>For safety reasons, this command can only be executed by console.</red>",
"console.is_console": "<prefix><red>This command can only be executed by a player.</red>", "console.is_console": "<prefix><red>This command can only be executed by a player.</red>",
"clipboard.paste_failed": "<prefix><red>Failed to paste the selection. Reason: </red><gray><reason></gray>", "clipboard.paste_failed": "<prefix><red>Failed to paste the selection. Reason: </red><gray><reason></gray>",
"toggle.toggle_enabled": "<prefix><gray>Enabled setting: </gray><dark_aqua><setting></dark_aqua>", "toggle.toggle_enabled": "<prefix><gray>Enabled setting: </gray><dark_aqua><setting></dark_aqua>",
"toggle.toggle_disabled": "<prefix><gray>Disabled setting: </gray><dark_aqua><setting></dark_aqua>", "toggle.toggle_disabled": "<prefix><gray>Disabled setting: </gray><dark_aqua><setting></dark_aqua>",
"blockedcmds.command_blocked": "<prefix><red>That command is not allowed in this plot.</red>", "blockedcmds.command_blocked": "<prefix><red>That command is not allowed in this plot.</red>",
"done.done_already_done": "<prefix><gray>This plot is already marked as done.</gray>", "done.done_already_done": "<prefix><gray>This plot is already marked as done.</gray>",
"done.done_not_done": "<prefix><gray>This plot is not marked as done.</gray>", "done.done_not_done": "<prefix><gray>This plot is not marked as done.</gray>",
"done.done_insufficient_complexity": "<prefix><red>This plot is too simple. Please add more detail before using this command.</red>", "done.done_insufficient_complexity": "<prefix><red>This plot is too simple. Please add more detail before using this command.</red>",
"done.done_success": "<prefix><gold>Successfully marked this plot as done.</gold>", "done.done_success": "<prefix><gold>Successfully marked this plot as done.</gold>",
"done.done_removed": "<prefix><gray>You may now continue building in this plot.</gray>", "done.done_removed": "<prefix><gray>You may now continue building in this plot.</gray>",
"ratings.ratings_purged": "<prefix><gray>Purged ratings for this plot.</gray>", "ratings.ratings_purged": "<prefix><gray>Purged ratings for this plot.</gray>",
"ratings.rating_not_valid": "<prefix><red>You need to specify a number between 1 and 10.</red>", "ratings.rating_not_valid": "<prefix><red>You need to specify a number between 1 and 10.</red>",
"ratings.rating_already_exists": "<prefix><gray>You have already rated plot <plot>.</gray>", "ratings.rating_already_exists": "<prefix><gray>You have already rated plot <plot>.</gray>",
@ -113,10 +113,10 @@
"ratings.rating_not_your_own": "<prefix><red>You cannot rate your own plot.</red>", "ratings.rating_not_your_own": "<prefix><red>You cannot rate your own plot.</red>",
"ratings.rating_not_done": "<prefix><red>You can only rate finished plots.</red>", "ratings.rating_not_done": "<prefix><red>You can only rate finished plots.</red>",
"ratings.rating_not_owned": "<prefix><red>You cannot rate a plot that is not claimed by anyone.</red>", "ratings.rating_not_owned": "<prefix><red>You cannot rate a plot that is not claimed by anyone.</red>",
"tutorial.rate_this": "<prefix><gray>Rate this plot!</gray>", "tutorial.rate_this": "<prefix><gray>Rate this plot!</gray>",
"tutorial.comment_this": "<prefix><gray>Leave some feedback on this plot: <plot>.</gray>", "tutorial.comment_this": "<prefix><gray>Leave some feedback on this plot: <plot>.</gray>",
"economy.econ_disabled": "<prefix><red>Economy is not enabled.</red>", "economy.econ_disabled": "<prefix><red>Economy is not enabled.</red>",
"economy.cannot_afford_plot": "<prefix><red>You cannot afford to buy this plot. It costs <gold><money></gold>.</red>", "economy.cannot_afford_plot": "<prefix><red>You cannot afford to buy this plot. It costs <gold><money></gold>.</red>",
"economy.not_for_sale": "<prefix><red>This plot is not for sale.</red>", "economy.not_for_sale": "<prefix><red>This plot is not for sale.</red>",
@ -126,7 +126,7 @@
"economy.added_balance": "<prefix><gold><money> </gold><gray>has been added to your balance.</gray>", "economy.added_balance": "<prefix><gold><money> </gold><gray>has been added to your balance.</gray>",
"economy.removed_balance": "<prefix><gold><money> </gold><gray>has been taken from your balance.</gray>", "economy.removed_balance": "<prefix><gold><money> </gold><gray>has been taken from your balance.</gray>",
"economy.removed_granted_plot": "<prefix><gray>You used <usedGrants> plot grant(s), you've got </gray><gold><remainingGrants></gold> <gray>left.</gray>", "economy.removed_granted_plot": "<prefix><gray>You used <usedGrants> plot grant(s), you've got </gray><gold><remainingGrants></gold> <gray>left.</gray>",
"setup.setup_not_started": "<prefix><gold>No setup started.</gold>", "setup.setup_not_started": "<prefix><gold>No setup started.</gold>",
"setup.setup_init": "<prefix><gold>Usage: </gold><gray>/plot setup <value></gray>", "setup.setup_init": "<prefix><gold>Usage: </gold><gray>/plot setup <value></gray>",
"setup.setup_step": "<gold><dark_gray>[</dark_gray>Step <step><dark_gray>]</dark_gray> <description> <gray>-</gray> Expecting: <gray><type></gray> Default: <gray><value></gray></gold>", "setup.setup_step": "<gold><dark_gray>[</dark_gray>Step <step><dark_gray>]</dark_gray> <description> <gray>-</gray> Expecting: <gray><type></gray> Default: <gray><value></gray></gold>",
@ -152,7 +152,7 @@
"setup.setup_area_max_plot_id": "<prefix><gold>What should be the maximum Plot ID?</gold>", "setup.setup_area_max_plot_id": "<prefix><gold>What should be the maximum Plot ID?</gold>",
"setup.setup_area_max_plot_id_error": "<prefix><red>You must choose a valid maximum Plot ID!</red>", "setup.setup_area_max_plot_id_error": "<prefix><red>You must choose a valid maximum Plot ID!</red>",
"setup.setup_area_plot_id_greater_than_minimum": "<prefix><red>The maximum Plot ID must be greater than the minimum!</red>", "setup.setup_area_plot_id_greater_than_minimum": "<prefix><red>The maximum Plot ID must be greater than the minimum!</red>",
"plotareatype.plot_area_type_normal": "<gray>Standard plot generation</gray>", "plotareatype.plot_area_type_normal": "<gray>Standard plot generation</gray>",
"plotareatype.plot_area_type_augmented": "<gray>Plot generation with vanilla terrain</gray>", "plotareatype.plot_area_type_augmented": "<gray>Plot generation with vanilla terrain</gray>",
"plotareatype.plot_area_type_partial": "<gray>Vanilla with clusters of plots</gray>", "plotareatype.plot_area_type_partial": "<gray>Vanilla with clusters of plots</gray>",
@ -171,30 +171,30 @@
"schematics.schematic_exportall_single_finished": "<prefix><gold>Finished export.</gold>", "schematics.schematic_exportall_single_finished": "<prefix><gold>Finished export.</gold>",
"schematic.schematic_exportall_world": "<prefix><red>Invalid world.</red>", "schematic.schematic_exportall_world": "<prefix><red>Invalid world.</red>",
"schematics.plot_to_schem": "<dark_aqua>Plot</dark_aqua><dark_gray>-></dark_gray><dark_aqua>Schematic</dark_aqua><dark_gray>: </dark_gray><gray>Found </gray><red><amount></red><gray> plots...</gray>", "schematics.plot_to_schem": "<dark_aqua>Plot</dark_aqua><dark_gray>-></dark_gray><dark_aqua>Schematic</dark_aqua><dark_gray>: </dark_gray><gray>Found </gray><red><amount></red><gray> plots...</gray>",
"error.task_in_process": "<prefix><gold>Task is already running.</gold>", "error.task_in_process": "<prefix><gold>Task is already running.</gold>",
"titles.title_entered_plot": "<gold>Plot: <world>;<x>;<z></gold>", "titles.title_entered_plot": "<gold>Plot: <world>;<x>;<z></gold>",
"titles.title_entered_plot_sub": "<dark_aqua>Owned by <owner></dark_aqua>", "titles.title_entered_plot_sub": "<dark_aqua>Owned by <owner></dark_aqua>",
"titles.prefix_greeting": "<gold><id></gold><gray>></gray>", "titles.prefix_greeting": "<gold><id></gold><gray>></gray>",
"titles.prefix_farewell": "<gold><id></gold><gray>></gray>", "titles.prefix_farewell": "<gold><id></gold><gray>></gray>",
"core.prefix": "<dark_gray>[</dark_gray><gold>P2</gold><dark_gray>] </dark_gray>", "core.prefix": "<dark_gray>[</dark_gray><gold>P2</gold><dark_gray>] </dark_gray>",
"core.enabled": "<prefix><gold><value> is now enabled.</gold>", "core.enabled": "<prefix><gold><value> is now enabled.</gold>",
"placeholder.hooked": "<prefix><gold>PlotSquared hooked into MVdWPlaceholderAPI</gold>", "placeholder.hooked": "<prefix><gold>PlotSquared hooked into MVdWPlaceholderAPI</gold>",
"reload.reloaded_configs": "<prefix><gold>Translations and world settings have been reloaded successfully.</gold>", "reload.reloaded_configs": "<prefix><gold>Translations and world settings have been reloaded successfully.</gold>",
"reload.reload_failed": "<prefix><red>Failed to reload file configurations.</red>", "reload.reload_failed": "<prefix><red>Failed to reload file configurations.</red>",
"desc.desc_set": "<prefix><gray>Plot description set.</gray>", "desc.desc_set": "<prefix><gray>Plot description set.</gray>",
"desc.desc_unset": "<prefix><gray>Plot description unset.</gray>", "desc.desc_unset": "<prefix><gray>Plot description unset.</gray>",
"alias.alias_set_to": "<prefix><gray>Plot alias set to </gray><gold><alias></gold><gray>.</gray>", "alias.alias_set_to": "<prefix><gray>Plot alias set to </gray><gold><alias></gold><gray>.</gray>",
"alias.alias_removed": "<prefix><gray>Plot alias removed.</gray>", "alias.alias_removed": "<prefix><gray>Plot alias removed.</gray>",
"alias.alias_too_long": "<prefix><red>The alias must have less than 50 characters in length.</red>", "alias.alias_too_long": "<prefix><red>The alias must have less than 50 characters in length.</red>",
"alias.alias_is_taken": "<prefix><red>That alias is already taken.</red>", "alias.alias_is_taken": "<prefix><red>That alias is already taken.</red>",
"position.position_set": "<prefix><gold>Home position set to your current location.</gold>", "position.position_set": "<prefix><gold>Home position set to your current location.</gold>",
"position.position_unset": "<prefix><gold>Home position reset to the default location.</gold>", "position.position_unset": "<prefix><gold>Home position reset to the default location.</gold>",
@ -206,7 +206,7 @@
"permission.cant_claim_more_clusters": "<prefix><red>You can't claim more clusters.</red>", "permission.cant_claim_more_clusters": "<prefix><red>You can't claim more clusters.</red>",
"permission.cant_transfer_more_plots": "<prefix><red>You can't send more plots to that user.</red>", "permission.cant_transfer_more_plots": "<prefix><red>You can't send more plots to that user.</red>",
"permission.cant_claim_more_plots_num": "<prefix><red>You can't claim more than <gold><amount> </gold>plots at once.</red>", "permission.cant_claim_more_plots_num": "<prefix><red>You can't claim more than <gold><amount> </gold>plots at once.</red>",
"merge.merge_request_confirm": "<prefix><gray>Merge request from </gray><gold><player></gold><gray>.</gray>", "merge.merge_request_confirm": "<prefix><gray>Merge request from </gray><gold><player></gold><gray>.</gray>",
"merge.merge_not_valid": "<prefix><gray>This merge request is no longer valid.</gray>", "merge.merge_not_valid": "<prefix><gray>This merge request is no longer valid.</gray>",
"merge.merge_accepted": "<prefix><gray>The merge request has been accepted.</gray>", "merge.merge_accepted": "<prefix><gray>The merge request has been accepted.</gray>",
@ -216,7 +216,7 @@
"merge.unlink_impossible": "<prefix><red>You can only unlink a mega-plot.</red>", "merge.unlink_impossible": "<prefix><red>You can only unlink a mega-plot.</red>",
"merge.unmerge_cancelled": "<prefix><red>Unlink has been cancelled.</red>", "merge.unmerge_cancelled": "<prefix><red>Unlink has been cancelled.</red>",
"merge.unlink_success": "<prefix><dark_aqua>Successfully unlinked plots.</dark_aqua>", "merge.unlink_success": "<prefix><dark_aqua>Successfully unlinked plots.</dark_aqua>",
"commandconfig.not_valid_subcommand": "<prefix><gray>That is not a valid subcommand.</gray>", "commandconfig.not_valid_subcommand": "<prefix><gray>That is not a valid subcommand.</gray>",
"commandconfig.did_you_mean": "<prefix><gray>Did you mean: <gold><value></gold></gray>", "commandconfig.did_you_mean": "<prefix><gray>Did you mean: <gold><value></gold></gray>",
"commandconfig.subcommand_set_options_header": "<prefix><gray>Possible Values: <values>", "commandconfig.subcommand_set_options_header": "<prefix><gray>Possible Values: <values>",
@ -224,7 +224,7 @@
"commandconfig.command_syntax": "<prefix><gold>Usage: </gold><gray><value></gray>", "commandconfig.command_syntax": "<prefix><gold>Usage: </gold><gray><value></gray>",
"commandconfig.command_syntax_extended": "<prefix><gold>Usage: </gold><gray><value1> <value2></gray>", "commandconfig.command_syntax_extended": "<prefix><gold>Usage: </gold><gray><value1> <value2></gray>",
"commandconfig.flag_tutorial_usage": "<prefix><gold>Have an admin set the flag: </gold><gray><flag></gray>", "commandconfig.flag_tutorial_usage": "<prefix><gold>Have an admin set the flag: </gold><gray><flag></gray>",
"invalid.component_illegal_block": "<prefix><red>You are not allowed to generate a component containing the block <gray><value></gray></red>", "invalid.component_illegal_block": "<prefix><red>You are not allowed to generate a component containing the block <gray><value></gray></red>",
"invalid.not_valid_block": "<prefix><red>That's not a valid block: </red><gray><value></gray>", "invalid.not_valid_block": "<prefix><red>That's not a valid block: </red><gray><value></gray>",
"invalid.not_allowed_block": "<prefix><red>That block is not allowed: <gray><value></gray></red>", "invalid.not_allowed_block": "<prefix><red>That block is not allowed: <gray><value></gray></red>",
@ -287,7 +287,7 @@
"debugexec.script_list_item": "<dark_gray>[</dark_gray><gold><number></gold><dark_gray>]</dark_gray><gold> <name></gold>", "debugexec.script_list_item": "<dark_gray>[</dark_gray><gold><number></gold><dark_gray>]</dark_gray><gold> <name></gold>",
"debugexec.analyze_done": "<prefix><gold>Done. Use </gold><gray><command></gray><gold> for more information. ", "debugexec.analyze_done": "<prefix><gold>Done. Use </gold><gray><command></gray><gold> for more information. ",
"expiry.expired_options_clicky": "<gold><num> <are_or_is> expired: </gold><click:run_command:<list_cmd>><hover:show_text:<list_cmd>><gray><plot></gray></hover></click>\n<dark_gray> - </dark_gray><click:run_command:<cmd_del>><hover:show_text:<cmd_del>><gray>Delete this (<cmd_del>)</gray></hover></click>\n<dark_gray> - </dark_gray><click:run_command:<cmd_keep_1d>><hover:show_text:<cmd_keep_1d>><gray>Remind later (<cmd_keep_1d>)</gray></hover></click>\n<dark_gray> - </dark_gray><click:run_command:<cmd_keep>><hover:show_text:<cmd_keep>><gray>Keep this (<cmd_keep>)</gray></hover></click>\n<dark_gray> - </dark_gray><click:run_command:<cmd_no_show_expir>><hover:show_text:<cmd_no_show_expir>><gray>Don't show me this (<cmd_no_show_expir>)</gray></hover></click>", "expiry.expired_options_clicky": "<gold><num> <are_or_is> expired: </gold><click:run_command:<list_cmd>><hover:show_text:\"<list_cmd>\"><gray><plot></gray></hover></click>\n<dark_gray> - </dark_gray><click:run_command:<cmd_del>><hover:show_text:\"<cmd_del>\"><gray>Delete this (<cmd_del>)</gray></hover></click>\n<dark_gray> - </dark_gray><click:run_command:<cmd_keep_1d>><hover:show_text:\"<cmd_keep_1d>\"><gray>Remind later (<cmd_keep_1d>)</gray></hover></click>\n<dark_gray> - </dark_gray><click:run_command:<cmd_keep>><hover:show_text:\"<cmd_keep>\"><gray>Keep this (<cmd_keep>)</gray></hover></click>\n<dark_gray> - </dark_gray><click:run_command:<cmd_no_show_expir>><hover:show_text:\"<cmd_no_show_expir>\"><gray>Don't show me this (<cmd_no_show_expir>)</gray></hover></click>",
"debugimportworlds.single_plot_area": "<prefix><red>Must be a single plot area.</red>", "debugimportworlds.single_plot_area": "<prefix><red>Must be a single plot area.</red>",
"debugimportworlds.world_container": "<prefix><red>World container must be configured to be a separate directory to your base files.</red>", "debugimportworlds.world_container": "<prefix><red>World container must be configured to be a separate directory to your base files.</red>",
@ -333,37 +333,37 @@
"debugsavetest.starting": "<prefix><gold>Starting debugsavetest.</gold>", "debugsavetest.starting": "<prefix><gold>Starting debugsavetest.</gold>",
"debugsavetest.done": "<prefix><gold>Database sync finished.</gold>", "debugsavetest.done": "<prefix><gold>Database sync finished.</gold>",
"purge.purge_success": "<prefix><dark_aqua>Successfully purged <amount> plots.</dark_aqua>", "purge.purge_success": "<prefix><dark_aqua>Successfully purged <amount> plots.</dark_aqua>",
"players.fetching_player": "<prefix><gold>PlotSquared is attempting to find the specified player from your argument(s). This may take a while.</gold>", "players.fetching_player": "<prefix><gold>PlotSquared is attempting to find the specified player from your argument(s). This may take a while.</gold>",
"players.fetching_players_timeout": "<prefix><red>The specified users did not exist in the cache and will be fetched in the background. Please wait a couple of minutes.</red>", "players.fetching_players_timeout": "<prefix><red>The specified users did not exist in the cache and will be fetched in the background. Please wait a couple of minutes.</red>",
"trim.trim_in_progress": "<prefix><red>A world trim task is already in progress!</red>", "trim.trim_in_progress": "<prefix><red>A world trim task is already in progress!</red>",
"trim.trim_done": "<prefix><gold>Trim done.</gold>", "trim.trim_done": "<prefix><gold>Trim done.</gold>",
"trim.trim_starting": "<prefix><gold>Collecting region data...</gold>", "trim.trim_starting": "<prefix><gold>Collecting region data...</gold>",
"blocklist.block_list_separator": "</gray><gold>,</gold><gray> ", "blocklist.block_list_separator": "</gray><gold>,</gold><gray> ",
"biome.need_biome": "<prefix><red>You need to specify a valid biome.</red>", "biome.need_biome": "<prefix><red>You need to specify a valid biome.</red>",
"biome.biome_set_to": "<prefix><gold>Plot biome set to <gray><value></gray></gold>", "biome.biome_set_to": "<prefix><gold>Plot biome set to <gray><value></gray></gold>",
"teleport.teleported_to_plot": "<prefix><gold>You have been teleported.</gold>", "teleport.teleported_to_plot": "<prefix><gold>You have been teleported.</gold>",
"teleport.teleported_to_road": "<prefix><gold>You got teleported to the road.</gold>", "teleport.teleported_to_road": "<prefix><gold>You got teleported to the road.</gold>",
"teleport.teleport_in_seconds": "<prefix><gold>Teleporting in <amount> seconds. Do not move...</gold>", "teleport.teleport_in_seconds": "<prefix><gold>Teleporting in <amount> seconds. Do not move...</gold>",
"teleport.teleport_failed": "<prefix><red>Teleportation cancelled due to movement or damage.</red>", "teleport.teleport_failed": "<prefix><red>Teleportation cancelled due to movement or damage.</red>",
"setblock.set_block_action_finished": "<prefix><gold>The last setblock action is now finished.</gold>", "setblock.set_block_action_finished": "<prefix><gold>The last setblock action is now finished.</gold>",
"unsafe.debugallowunsafe_on": "<prefix><gray>Unsafe actions enabled.</gray>", "unsafe.debugallowunsafe_on": "<prefix><gray>Unsafe actions enabled.</gray>",
"unsafe.debugallowunsafe_off": "<prefix><gray>Unsafe actions disabled.</gray>", "unsafe.debugallowunsafe_off": "<prefix><gray>Unsafe actions disabled.</gray>",
"need.need_block": "<prefix><red>You've got to specify a block.</red>", "need.need_block": "<prefix><red>You've got to specify a block.</red>",
"near.plot_near": "<prefix><gold>Players: <gray><list></gray></gold>", "near.plot_near": "<prefix><gold>Players: <gray><list></gray></gold>",
"scripts.script_list": "<dark_gray><strikethrough>--------- <reset><gold>SCRIPTS </gold><dark_gray><strikethrough>---------</dark_gray><reset>", "scripts.script_list": "<dark_gray><strikethrough>--------- <reset><gold>SCRIPTS </gold><dark_gray><strikethrough>---------</dark_gray><reset>",
"info.none": "<gray>None</gray>", "info.none": "<gray>None</gray>",
"info.now": "<gray>Now</gray>", "info.now": "<gray>Now</gray>",
"info.never": "<gray>Never</gray>", "info.never": "<gray>Never</gray>",
@ -374,16 +374,16 @@
"info.plot_info_unclaimed": "<prefix><gray>Plot <gold><plot></gold> is not yet claimed.</gray>", "info.plot_info_unclaimed": "<prefix><gray>Plot <gold><plot></gold> is not yet claimed.</gray>",
"info.plot_info_header": "<dark_gray><strikethrough>--------- <reset><gold>INFO </gold><dark_gray><strikethrough>---------</dark_gray><reset>", "info.plot_info_header": "<dark_gray><strikethrough>--------- <reset><gold>INFO </gold><dark_gray><strikethrough>---------</dark_gray><reset>",
"info.plot_info_hidden": "<prefix><red>You cannot view the information about this plot.</red>", "info.plot_info_hidden": "<prefix><red>You cannot view the information about this plot.</red>",
"info.plot_info_format": "<header>\n<gold>ID: <gray><id></gray>\nArea: <gray><area></gray>\nAlias:<gray><alias></gray>\nOwner:<gray><owner></gray>\nBiome: <gray><biome></gray>\nCan Build: <gray><build></gray>\nRating: <gray><rating></gray>\nSeen: <gray><seen></gray>\nTrusted:<gray><trusted></gray>\nMembers:<gray><members></gray>\nDenied:<gray><denied></gray>\nFlags:<gray><flags></gray>\nDescription: <gray><desc></gray></gold>\n<footer>", "info.plot_info_format": "<header>\n<gold>ID: <gray><id></gray>\nArea: <gray><area></gray>\nAlias: <gray><alias></gray>\nOwner: <gray><owner></gray>\nBiome: <gray><biome></gray>\nCan Build: <gray><build></gray>\nRating: <gray><rating></gray>\nSeen: <gray><seen></gray>\nTrusted: <gray><trusted></gray>\nMembers: <gray><members></gray>\nDenied: <gray><denied></gray>\nFlags:<gray><flags></gray>\nDescription: <gray><desc></gray></gold>\n<footer>",
"info.plot_info_footer": "<dark_gray><strikethrough>--------- <reset><gold>INFO </gold><dark_gray><strikethrough>---------<reset>", "info.plot_info_footer": "<dark_gray><strikethrough>--------- <reset><gold>INFO </gold><dark_gray><strikethrough>---------<reset>",
"info.plot_info_trusted": "<gold>Trusted:</gold><gray><trusted></gray>", "info.plot_info_trusted": "<gold>Trusted:</gold> <gray><trusted></gray>",
"info.plot_info_members": "<gold>Members:</gold><gray><members></gray>", "info.plot_info_members": "<gold>Members:</gold> <gray><members></gray>",
"info.plot_info_denied": "<gold>Denied:</gold><gray><denied></gray>", "info.plot_info_denied": "<gold>Denied:</gold> <gray><denied></gray>",
"info.plot_info_flags": "<gold>Flags:</gold><gray> <flags></gray>", "info.plot_info_flags": "<gold>Flags:</gold><gray> <flags></gray>",
"info.plot_info_biome": "<gold>Biome:</gold><gray> <biome></gray>", "info.plot_info_biome": "<gold>Biome:</gold><gray> <biome></gray>",
"info.plot_info_rating": "<gold>Rating:</gold><gray> <rating></gray>", "info.plot_info_rating": "<gold>Rating:</gold><gray> <rating></gray>",
"info.plot_info_likes": "<gold>Like Ratio:</gold><gray> <likes></gray>", "info.plot_info_likes": "<gold>Like Ratio:</gold><gray> <likes></gray>",
"info.plot_info_owner": "<gold>Owner:</gold><gray><owner></gray>", "info.plot_info_owner": "<gold>Owner:</gold> <gray><owner></gray>",
"info.plot_info_id": "<gold>ID:</gold><gray> <id></gray>", "info.plot_info_id": "<gold>ID:</gold><gray> <id></gray>",
"info.plot_info_alias": "<gold>Alias:</gold><gray> <alias></gray>", "info.plot_info_alias": "<gold>Alias:</gold><gray> <alias></gray>",
"info.plot_info_size": "<gold>Size:</gold><gray> <size></gray>", "info.plot_info_size": "<gold>Size:</gold><gray> <size></gray>",
@ -393,17 +393,17 @@
"info.plot_no_description": "<prefix><gray>No description set.</gray>", "info.plot_no_description": "<prefix><gray>No description set.</gray>",
"info.plot_caps_header": "<dark_gray><strikethrough>--------- <reset><gold>CAPS </gold><dark_gray><strikethrough>---------<reset>", "info.plot_caps_header": "<dark_gray><strikethrough>--------- <reset><gold>CAPS </gold><dark_gray><strikethrough>---------<reset>",
"info.plot_caps_format": "<prefix><gray>- Cap Type: </gray><gold><cap> </gold><gray>| Status: </gray><gold><current></gold><gray>/</gray><gold><limit> </gold><gray>(</gray><gold><percentage>%</gold><gray>)</gray>", "info.plot_caps_format": "<prefix><gray>- Cap Type: </gray><gold><cap> </gold><gray>| Status: </gray><gold><current></gold><gray>/</gray><gold><limit> </gold><gray>(</gray><gold><percentage>%</gold><gray>)</gray>",
"info.plot_list_item": "<click:run_command:<command_tp>><hover:show_text:<command_tp>><dark_gray>[</dark_gray><gold><number></gold><dark_gray>]</dark_gray></hover></click><click:run_command:<command_info>><hover:show_text:<hover_info>><gold> <plot></gold></hover></click><gray> - </gray><players>", "info.plot_list_item": "<click:run_command:<command_tp>><hover:show_text:\"<command_tp>\"><dark_gray>[</dark_gray><gold><number></gold><dark_gray>]</dark_gray></hover></click><click:run_command:<command_info>> <hover:show_text:\"<hover_info>\"><gold> <plot></gold></hover></click><gray> - </gray><players>",
"info.plot_list_no_owner": "<dark_gray><plot></dark_gray>", "info.plot_list_no_owner": "<dark_gray><plot></dark_gray>",
"info.plot_list_owned_by": "<gold><plot></gold>", "info.plot_list_owned_by": "<gold><plot></gold>",
"info.plot_list_added_to": "<cyan><plot></cyan>", "info.plot_list_added_to": "<dark_aqua><plot></dark_aqua>",
"info.plot_list_denied_on": "<gray><plot></gray>", "info.plot_list_denied_on": "<gray><plot></gray>",
"info.plot_list_default": "<gold><plot></gold>", "info.plot_list_default": "<gold><plot></gold>",
"info.plot_list_player_online": "<cyan><prefix></cyan><hover:show_text:<cyan>Online</cyan>><gold><player></gold></hover>", "info.plot_list_player_online": "<dark_aqua><prefix></dark_aqua><hover:show_text:\"<dark_aqua>Online</dark_aqua>\"><gold><player></gold></hover>",
"info.plot_list_player_offline": "<cyan><prefix></cyan><hover:show_text:<dark_gray>Offline</dark_gray>><gold><player></gold></hover>", "info.plot_list_player_offline": "<dark_aqua><prefix></dark_aqua><hover:show_text:\"<dark_gray>Offline</dark_gray>\"><gold><player></gold></hover>",
"info.area_info_format": "<header>\n<reset><gold>NAME: </gold><gray><name></gray>\n<gold>Type: </gold><gray><type></gray>\n<gold>Terrain: </gold><gray><terrain></gray>\n<gold>Usage: </gold><gray><usage>%</gray>\n<gold>Claimed: </gold><gray><claimed></gray>\n<gold>Clusters: </gold><gray><clusters></gray>\n<gold>Region: </gold><gray><region></gray>\n<gold>Generator: </gold><gray><generator></gray>\n<footer>", "info.area_info_format": "<header>\n<reset><gold>NAME: </gold><gray><name></gray>\n<gold>Type: </gold><gray><type></gray>\n<gold>Terrain: </gold><gray><terrain></gray>\n<gold>Usage: </gold><gray><usage>%</gray>\n<gold>Claimed: </gold><gray><claimed></gray>\n<gold>Clusters: </gold><gray><clusters></gray>\n<gold>Region: </gold><gray><region></gray>\n<gold>Generator: </gold><gray><generator></gray>\n<footer>",
"info.area_list_tooltip": "<gold>Claimed=</gold><gray><claimed></gray>\n<gold>Usage=</gold><gray><usage></gray>\n<gold>Clusters=</gold><gray><clusters></gray>\n<gold>Region=</gold><gray><region></gray>\n<gold>Generator=</gold><gray><generator></gray>\n", "info.area_list_tooltip": "<gold>Claimed=</gold><gray><claimed></gray>\n<gold>Usage=</gold><gray><usage></gray>\n<gold>Clusters=</gold><gray><clusters></gray>\n<gold>Region=</gold><gray><region></gray>\n<gold>Generator=</gold><gray><generator></gray>",
"info.area_list_item": "<click:run_command:<command_tp>><hover:show_text:<command_tp>><dark_gray>[</dark_gray><gold><number></gold><dark_gray>]</dark_gray></hover></click><click:run_command:<command_info>><hover:show_text:<hover_info>><gold> <area_name></gold></hover></click><gray> - </gray><dark_gray><area_type>:<area_terrain></dark_gray>", "info.area_list_item": "<click:run_command:<command_tp>><hover:show_text:\"<command_tp>\"><dark_gray>[</dark_gray><gold><number></gold><dark_gray>]</dark_gray></hover></click> <click:run_command:<command_info>><hover:show_text:\"<hover_info>\"><gold><area_name></gold></hover></click><gray> - </gray><gray><area_type>:<area_terrain></gray>",
"working.generating_component": "<prefix><gold>Started generating component from your settings.</gold>", "working.generating_component": "<prefix><gold>Started generating component from your settings.</gold>",
"working.clearing_done": "<prefix><dark_aqua>Clear completed! Took <amount>ms.</dark_aqua>", "working.clearing_done": "<prefix><dark_aqua>Clear completed! Took <amount>ms.</dark_aqua>",
@ -411,7 +411,7 @@
"working.plot_not_claimed": "<prefix><gray>Plot not claimed.</gray>", "working.plot_not_claimed": "<prefix><gray>Plot not claimed.</gray>",
"working.plot_is_claimed": "<prefix><gray>This plot is already claimed.</gray>", "working.plot_is_claimed": "<prefix><gray>This plot is already claimed.</gray>",
"working.claimed": "<prefix><dark_aqua>You successfully claimed the plot.</dark_aqua>", "working.claimed": "<prefix><dark_aqua>You successfully claimed the plot.</dark_aqua>",
"list.comment_list_header_paged": "<gray>(Page </gray><gold><cur></gold><gray>/</gray><gold><max></gold><gray>) </gray><gold>List of <amount> comments</gold>", "list.comment_list_header_paged": "<gray>(Page </gray><gold><cur></gold><gray>/</gray><gold><max></gold><gray>) </gray><gold>List of <amount> comments</gold>",
"list.comment_list_comment": "<dark_gray>[</dark_gray><gray>#<number></gray><dark_gray>[</dark_gray><gray><world>;<plot_id></gray><dark_gray>][</dark_gray><gold><commenter></gold><dark_gray>]</dark_gray><comment>\n", "list.comment_list_comment": "<dark_gray>[</dark_gray><gray>#<number></gray><dark_gray>[</dark_gray><gray><world>;<plot_id></gray><dark_gray>][</dark_gray><gold><commenter></gold><dark_gray>]</dark_gray><comment>\n",
"list.comment_list_by_lister": "<green><comment></green>", "list.comment_list_by_lister": "<green><comment></green>",
@ -425,16 +425,16 @@
"chat.plot_chat_spy_format": "<gray>[<gold>Plot Spy</gold>] [<gold><plot_id></gold>] <gold><sender></gold>: <gold><msg></gold></gray>", "chat.plot_chat_spy_format": "<gray>[<gold>Plot Spy</gold>] [<gold><plot_id></gold>] <gold><sender></gold>: <gold><msg></gold></gray>",
"chat.plot_chat_format": "<gray>[<gold>Plot Chat</gold>] [<gold><plot_id></gold>] <gold><sender></gold>: <gold><msg></gold></gray>", "chat.plot_chat_format": "<gray>[<gold>Plot Chat</gold>] [<gold><plot_id></gold>] <gold><sender></gold>: <gold><msg></gold></gray>",
"chat.plot_chat_forced": "<prefix><gray>This world forces everyone to use plot chat.</gray>", "chat.plot_chat_forced": "<prefix><gray>This world forces everyone to use plot chat.</gray>",
"deny.denied_added": "<prefix><dark_aqua>You successfully denied the player from this plot.</dark_aqua>", "deny.denied_added": "<prefix><dark_aqua>You successfully denied the player from this plot.</dark_aqua>",
"deny.you_got_denied": "<prefix><dark_aqua>You are denied from the plot you were previously on, and got teleported to spawn.</dark_aqua>.", "deny.you_got_denied": "<prefix><dark_aqua>You are denied from the plot you were previously on, and got teleported to spawn.</dark_aqua>.",
"deny.cant_remove_owner": "<prefix><red>You can't remove the plot owner.</red>", "deny.cant_remove_owner": "<prefix><red>You can't remove the plot owner.</red>",
"kick.you_got_kicked": "<prefix><dark_aqua>You got kicked from the plot!</dark_aqua>", "kick.you_got_kicked": "<prefix><dark_aqua>You got kicked from the plot!</dark_aqua>",
"trusted.trusted_added": "<prefix><dark_aqua>You successfully trusted a user to the plot.</dark_aqua>", "trusted.trusted_added": "<prefix><dark_aqua>You successfully trusted a user to the plot.</dark_aqua>",
"trusted.plot_removed_user": "<prefix><red>Plot <plot> of which you were added to has been deleted due to owner inactivity.</red>", "trusted.plot_removed_user": "<prefix><red>Plot <plot> of which you were added to has been deleted due to owner inactivity.</red>",
"member.removed_players": "<prefix><gray>Removed <amount> player(s) from this plot.</gray>", "member.removed_players": "<prefix><gray>Removed <amount> player(s) from this plot.</gray>",
"member.plot_left": "<prefix><gray><player> left the plot.</gray>", "member.plot_left": "<prefix><gray><player> left the plot.</gray>",
"member.already_owner": "<prefix><gray><player></gray><gold> is already the plot owner.</gold>", "member.already_owner": "<prefix><gray><player></gray><gold> is already the plot owner.</gold>",
@ -442,17 +442,17 @@
"member.member_added": "<prefix><dark_aqua>That user can now build while the plot owner is online.</dark_aqua>", "member.member_added": "<prefix><dark_aqua>That user can now build while the plot owner is online.</dark_aqua>",
"members.plot_max_members": "<prefix><red>You are not allowed to add any more players to this plot.</red>", "members.plot_max_members": "<prefix><red>You are not allowed to add any more players to this plot.</red>",
"members.not_added_trusted": "<prefix><red>You must be added or trusted to the plot to run that command.</red>", "members.not_added_trusted": "<prefix><red>You must be added or trusted to the plot to run that command.</red>",
"owner.set_owner": "<prefix><dark_aqua>You successfully set the plot owner.</dark_aqua>", "owner.set_owner": "<prefix><dark_aqua>You successfully set the plot owner.</dark_aqua>",
"owner.set_owner_cancelled": "<prefix><red>The set owner action was cancelled.</red>", "owner.set_owner_cancelled": "<prefix><red>The set owner action was cancelled.</red>",
"owner.set_owner_missing_player": "<prefix><red>You need to specify a new owner.</red>", "owner.set_owner_missing_player": "<prefix><red>You need to specify a new owner.</red>",
"owner.now_owner": "<prefix><dark_aqua>You are now the plot owner of plot <plot>.</dark_aqua>", "owner.now_owner": "<prefix><dark_aqua>You are now the plot owner of plot <plot>.</dark_aqua>",
"signs.owner_sign_line_1": "<gold>ID: </gold><gray><id></gray>", "signs.owner_sign_line_1": "<gold>ID: </gold><gray><id></gray>",
"signs.owner_sign_line_2": "<gold>Owner:", "signs.owner_sign_line_2": "<gold>Owner:",
"signs.owner_sign_line_3": "<gray><owner></gray>", "signs.owner_sign_line_3": "<gray><owner></gray>",
"signs.owner_sign_line_4": "<dark_gray>Claimed</dark_gray>", "signs.owner_sign_line_4": "<dark_gray>Claimed</dark_gray>",
"help.help_header": "<dark_gray><strikethrough>---------<reset> <gold>PlotSquared Help </gold><dark_gray><strikethrough>---------<reset>", "help.help_header": "<dark_gray><strikethrough>---------<reset> <gold>PlotSquared Help </gold><dark_gray><strikethrough>---------<reset>",
"help.help_page_header": "\n<gold>Category: </gold><gray><category>,</gray><gold> Page: </gold><gray><current></gray><dark_gray>/</dark_gray><gray><max></gray>\n", "help.help_page_header": "\n<gold>Category: </gold><gray><category>,</gray><gold> Page: </gold><gray><current></gray><dark_gray>/</dark_gray><gray><max></gray>\n",
"help.help_footer": "<dark_gray><strikethrough>---------<reset> <gold>PlotSquared Help </gold><dark_gray><strikethrough>---------<reset>", "help.help_footer": "<dark_gray><strikethrough>---------<reset> <gold>PlotSquared Help </gold><dark_gray><strikethrough>---------<reset>",
@ -460,7 +460,7 @@
"help.help_item": "<gold><usage> <gray>[<gold><alias></gold>]</gray>\n <dark_gray>- </dark_gray><gray><desc></gray>\n", "help.help_item": "<gold><usage> <gray>[<gold><alias></gold>]</gray>\n <dark_gray>- </dark_gray><gray><desc></gray>\n",
"help.help_display_all_commands": "<prefix><gray>Display all commands.</gray>", "help.help_display_all_commands": "<prefix><gray>Display all commands.</gray>",
"help.direction": "<prefix><gold>Current direction: </gold><gray><dir></gray>", "help.direction": "<prefix><gold>Current direction: </gold><gray><dir></gray>",
"category.command_category_claiming": "<gray>Claiming</gray>", "category.command_category_claiming": "<gray>Claiming</gray>",
"category.command_category_teleport": "<gray>Teleport</gray>", "category.command_category_teleport": "<gray>Teleport</gray>",
"category.command_category_settings": "<gray>Protection</gray>", "category.command_category_settings": "<gray>Protection</gray>",
@ -470,12 +470,12 @@
"category.command_category_info": "<gray>Info</gray>", "category.command_category_info": "<gray>Info</gray>",
"category.command_category_debug": "<gray>Debug</gray>", "category.command_category_debug": "<gray>Debug</gray>",
"category.command_category_administration": "<gray>Admin</gray>", "category.command_category_administration": "<gray>Admin</gray>",
"grants.granted_plots": "<prefix><gold>Result: <gray><amount> </gray>grants left.</gold>", "grants.granted_plots": "<prefix><gold>Result: <gray><amount> </gray>grants left.</gold>",
"grants.added": "<prefix><gold><grants></gold> <gray>grant(s) have been added.</gray>", "grants.added": "<prefix><gold><grants></gold> <gray>grant(s) have been added.</gray>",
"events.event_denied": "<prefix><gold><value> </gold><gray>Cancelled by external plugin.</gray>", "events.event_denied": "<prefix><gold><value> </gold><gray>Cancelled by external plugin.</gray>",
"backups.backup_impossible": "<prefix><gray>Backups are not enabled for this plot: <plot>.</gray>", "backups.backup_impossible": "<prefix><gray>Backups are not enabled for this plot: <plot>.</gray>",
"backups.backup_save_success": "<prefix><gold>The backup was created successfully.</gold>", "backups.backup_save_success": "<prefix><gold>The backup was created successfully.</gold>",
"backups.backup_save_failed": "<prefix><red>The backup could not be created: </red><gray><reason></gray>", "backups.backup_save_failed": "<prefix><red>The backup could not be created: </red><gray><reason></gray>",
@ -487,17 +487,17 @@
"backups.backup_automatic_started": "<prefix><gold>Backing up the plot...</gold>", "backups.backup_automatic_started": "<prefix><gold>Backing up the plot...</gold>",
"backups.backup_automatic_finished": "<prefix><gold>The automatic backup process finished successfully!</gold>", "backups.backup_automatic_finished": "<prefix><gold>The automatic backup process finished successfully!</gold>",
"backups.backup_automatic_failure": "<prefix><red>The automatic backup process failed. Your pending action has been canceled. Reason: </red><gray><reason></gray>", "backups.backup_automatic_failure": "<prefix><red>The automatic backup process failed. Your pending action has been canceled. Reason: </red><gray><reason></gray>",
"preset.preset_cannot_afford": "<prefix><red>You cannot afford that preset.</red>", "preset.preset_cannot_afford": "<prefix><red>You cannot afford that preset.</red>",
"preset.preset_invalid": "<prefix><red>Could not generate a pattern from that preset.</red>", "preset.preset_invalid": "<prefix><red>Could not generate a pattern from that preset.</red>",
"preset.preset_lore_cost": "<prefix><gray>Cost: </gray><gold><cost></gold>", "preset.preset_lore_cost": "<prefix><gray>Cost: </gray><gold><cost></gold>",
"preset.preset_lore_component": "<prefix><gray>Component: </gray><gold><component></gold>", "preset.preset_lore_component": "<prefix><gray>Component: </gray><gold><component></gold>",
"generic.generic_other": "<prefix><gray>other</gray>", "generic.generic_other": "<prefix><gray>other</gray>",
"generic.generic_merged": "<prefix><gray>merged</gray>", "generic.generic_merged": "<prefix><gray>merged</gray>",
"generic.generic_unowned": "<prefix><gray>unowned</gray>", "generic.generic_unowned": "<prefix><gray>unowned</gray>",
"generic.generic_invalid_choice": "<prefix><gray>invalid choice</gray>", "generic.generic_invalid_choice": "<prefix><gray>invalid choice</gray>",
"single.single_area_missing_selection": "<prefix><red>Error! You need to select a square region.</red>", "single.single_area_missing_selection": "<prefix><red>Error! You need to select a square region.</red>",
"single.single_area_not_square": "<prefix><red>Error! Your selection needs to be a square.</red>", "single.single_area_not_square": "<prefix><red>Error! Your selection needs to be a square.</red>",
"single.single_area_overlapping": "<prefix><red>Error! Your selection overlaps with an existing plot area.</red>", "single.single_area_overlapping": "<prefix><red>Error! Your selection overlaps with an existing plot area.</red>",
@ -510,7 +510,7 @@
"single.delete_world_region": "<prefix><red>Stop the server and delete: <world>/region.</red>", "single.delete_world_region": "<prefix><red>Stop the server and delete: <world>/region.</red>",
"single.regeneration_complete": "<prefix><gold>Regeneration complete.</gold>", "single.regeneration_complete": "<prefix><gold>Regeneration complete.</gold>",
"single.worldcreation_location": "<prefix><gold>World creation settings may be stored in multiple locations:</gold>\n<dark_gray> - </dark_gray><gray>bukkit.yml in your server's root folder.</gray>\n<dark_gray> - </dark_gray><gray>PlotSquared's settings.yml</gray>\n<dark_gray> - </dark_gray><gray>Hyperverse's worlds.yml (or any world management plugin)</gray>\n<dark_gray> - </dark_gray><red>Stop the server and delete it from these locations.</red>", "single.worldcreation_location": "<prefix><gold>World creation settings may be stored in multiple locations:</gold>\n<dark_gray> - </dark_gray><gray>bukkit.yml in your server's root folder.</gray>\n<dark_gray> - </dark_gray><gray>PlotSquared's settings.yml</gray>\n<dark_gray> - </dark_gray><gray>Hyperverse's worlds.yml (or any world management plugin)</gray>\n<dark_gray> - </dark_gray><red>Stop the server and delete it from these locations.</red>",
"legacyconfig.legacy_config_found": "<prefix><green>A legacy configuration file was detected. Conversion will be attempted.</green>", "legacyconfig.legacy_config_found": "<prefix><green>A legacy configuration file was detected. Conversion will be attempted.</green>",
"legacyconfig.legacy_config_backup": "<prefix><gold>A copy of worlds.yml has been saved in the file worlds.yml.old</gold>.", "legacyconfig.legacy_config_backup": "<prefix><gold>A copy of worlds.yml has been saved in the file worlds.yml.old</gold>.",
"legacyconfig.legacy_config_replaced": "<prefix><gray><value1> has been replaced with <value2></gray>", "legacyconfig.legacy_config_replaced": "<prefix><gray><value1> has been replaced with <value2></gray>",
@ -522,7 +522,7 @@
"update.internal_version": "<prefix><gold>You are running version </gold><dark_aqua><p2version></dark_aqua>", "update.internal_version": "<prefix><gold>You are running version </gold><dark_aqua><p2version></dark_aqua>",
"update.spigot_version": "<prefix><gold>Latest version is </gold><dark_aqua><spigotversion></dark_aqua>", "update.spigot_version": "<prefix><gold>Latest version is </gold><dark_aqua><spigotversion></dark_aqua>",
"update.download": "<prefix><gold>Download the update at: <click:open_url:<downloadurl>><downloadurl></click>", "update.download": "<prefix><gold>Download the update at: <click:open_url:<downloadurl>><downloadurl></click>",
"flag.flag_key": "<gray>Key: <key></gray>", "flag.flag_key": "<gray>Key: <key></gray>",
"flag.flag_desc": "<gray>Desc: <value></gray>", "flag.flag_desc": "<gray>Desc: <value></gray>",
"flag.not_valid_flag": "<red>That is not a valid flag.</red>", "flag.not_valid_flag": "<red>That is not a valid flag.</red>",
@ -538,7 +538,7 @@
"flag.flag_info_header": "<dark_gray><strikethrough>---------<reset> <gold>PlotSquared Flags </gold><dark_gray><strikethrough>---------<reset>", "flag.flag_info_header": "<dark_gray><strikethrough>---------<reset> <gold>PlotSquared Flags </gold><dark_gray><strikethrough>---------<reset>",
"flag.flag_info_footer": "<dark_gray><strikethrough>---------<reset> <gold>PlotSquared Flags </gold><dark_gray><strikethrough>---------<reset>", "flag.flag_info_footer": "<dark_gray><strikethrough>---------<reset> <gold>PlotSquared Flags </gold><dark_gray><strikethrough>---------<reset>",
"flag.flag_list_categories": "<gold><category>: </gold>", "flag.flag_list_categories": "<gold><category>: </gold>",
"flag.flag_list_flag": "<click:run_command:<command>><hover:show_text:<gray>Click to view information about the flag.</gray>><gray><flag></gray></hover></click><gray><suffix></gray>", "flag.flag_list_flag": "<click:run_command:<command>><hover:show_text:\"<gray>Click to view information about the flag.</gray>\"><gray><flag></gray></hover></click><gray><suffix></gray>",
"flag.flag_info_name": "<gray>Name: <gold><flag></gold></gray>", "flag.flag_info_name": "<gray>Name: <gold><flag></gold></gray>",
"flag.flag_info_category": "<gray>Category: </gray>", "flag.flag_info_category": "<gray>Category: </gray>",
"flag.flag_info_description": "<gray>Description: </gray>", "flag.flag_info_description": "<gray>Description: </gray>",
@ -638,7 +638,7 @@
"flags.flag_description_keep": "<gray>Prevents the plot from expiring. Can be set to: true, false, the number of milliseconds to keep the plot for or a timestamp (3w 2d 5h).</gray>", "flags.flag_description_keep": "<gray>Prevents the plot from expiring. Can be set to: true, false, the number of milliseconds to keep the plot for or a timestamp (3w 2d 5h).</gray>",
"flags.flag_description_keep_inventory": "<gray>Prevents players from dropping their items when they die inside of the plot.</gray>", "flags.flag_description_keep_inventory": "<gray>Prevents players from dropping their items when they die inside of the plot.</gray>",
"flags.flag_description_prevent_creative_copy": "<gray>Prevents people from copying item NBT data in the plot unless they're added as members.</gray>", "flags.flag_description_prevent_creative_copy": "<gray>Prevents people from copying item NBT data in the plot unless they're added as members.</gray>",
"flags.flag_error_boolean": "<prefix><red>Flag value must be a boolean (true | false)</red>", "flags.flag_error_boolean": "<prefix><red>Flag value must be a boolean (true | false)</red>",
"flags.flag_error_enum": "<prefix><red>Must be one of: <list></red>", "flags.flag_error_enum": "<prefix><red>Must be one of: <list></red>",
"flags.flag_error_gamemode": "<prefix><red>Flag value must be a gamemode: 'survival', 'creative', 'adventure' or 'spectator.</red>", "flags.flag_error_gamemode": "<prefix><red>Flag value must be a gamemode: 'survival', 'creative', 'adventure' or 'spectator.</red>",