From f49f7bc79b9c7e5472f8a6d7c934352526ff4728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Tue, 18 Feb 2020 21:30:38 +0100 Subject: [PATCH] Add plot info entries and fix up the default format --- .../plotsquared/plot/commands/Info.java | 2 +- .../plotsquared/plot/config/Captions.java | 8 +++++--- .../plotsquared/plot/flags/GlobalFlagContainer.java | 2 +- .../plotsquared/plot/util/MainUtil.java | 10 ++++++++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Info.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Info.java index db5190c64..24bd751f0 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Info.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Info.java @@ -93,7 +93,7 @@ public class Info extends SubCommand { plot.getId().x + ";" + plot.getId().y); return true; } - String info = Captions.PLOT_INFO.getTranslated(); + String info = Captions.PLOT_INFO_FORMAT.getTranslated(); boolean full; if (arg != null) { info = getCaption(arg); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java index 58d32ebd7..6f1004e64 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java @@ -465,10 +465,11 @@ public enum Captions implements Caption { PLOT_INFO_UNCLAIMED("$2Plot $1%s$2 is not yet claimed", "Info"), PLOT_INFO_HEADER("$3&m---------&r $1INFO $3&m---------", false, "Info"), PLOT_INFO_HIDDEN("$2You cannot view the information about this plot", "Info"), - PLOT_INFO("$1ID: $2%id%$1&-" + "$1Alias:$2%alias%$1&-" + "$1Owner:$2%owner%$1&-" + PLOT_INFO_FORMAT("$1ID: $2%id%$1&-" + "$1Area: $2%area%$1&-" + +"$1Alias:$2%alias%$1&-" + "$1Owner:$2%owner%$1&-" + "$1Biome: $2%biome%$1&-" + "$1Can Build: $2%build%$1&-" + "$1Rating: $2%rating%&-" + "$1Seen: $2%seen%&-" + "$1Trusted:$2%trusted%$1&-" + "$1Members:$2%members%$1&-" - + "$1Denied:$2%denied%$1&-" + "$1Flags:$2%flags%", "Info"), + + "$1Denied:$2%denied%$1&-" + "$1Flags:$2%flags%&-$1Description: $2%desc%$1", "Info"), PLOT_INFO_FOOTER("$3&m---------&r $1INFO $3&m---------", false, "Info"), PLOT_INFO_TRUSTED("$1Trusted:$2%trusted%", "Info"), PLOT_INFO_MEMBERS("$1Members:$2%members%", "Info"), @@ -483,7 +484,8 @@ public enum Captions implements Caption { PLOT_INFO_SIZE("$1Size:$2 %size%", "Info"), PLOT_INFO_SEEN("$1Seen:$2 %seen%", "Info"), PLOT_USER_LIST(" $1%user%$2,", "Info"), - PLOT_FLAG_LIST("$1%s0:%s1$2", "Info"), + PLOT_FLAG_LIST("$2%s0:%s1$3", "Info"), + PLOT_NO_DESCRIPTION("No description set.", "Info"), INFO_SYNTAX_CONSOLE("$2/plot info X;Z", "Info"), // // diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/GlobalFlagContainer.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/GlobalFlagContainer.java index c82919ab2..582faa129 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/GlobalFlagContainer.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/GlobalFlagContainer.java @@ -104,7 +104,7 @@ public final class GlobalFlagContainer extends FlagContainer { this.addFlag(AnimalAttackFlag.ANIMAL_ATTACK_FALSE); this.addFlag(AnimalInteractFlag.ANIMAL_INTERACT_FALSE); this.addFlag(BlockBurnFlag.BLOCK_BURN_FALSE); - this.addFlag(BlockIgnitionFlag.BLOCK_IGNITION_FALSE); + this.addFlag(BlockIgnitionFlag.BLOCK_IGNITION_TRUE); this.addFlag(DeviceInteractFlag.DEVICE_INTERACT_FALSE); this.addFlag(DisablePhysicsFlag.DISABLE_PHYSICS_FALSE); this.addFlag(DropProtectionFlag.DROP_PROTECTION_FALSE); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java index 35bd8bcf9..2346c30e2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java @@ -787,7 +787,7 @@ public class MainUtil { if (flagCollection.isEmpty()) { flags.append(Captions.NONE.getTranslated()); } else { - String prefix = ""; + String prefix = " "; for (final PlotFlag flag : flagCollection) { Object value; if (flag instanceof DoubleFlag && !Settings.General.SCIENTIFIC) { @@ -802,6 +802,12 @@ public class MainUtil { } boolean build = plot.isAdded(player.getUUID()); String owner = plot.getOwners().isEmpty() ? "unowned" : getPlayerList(plot.getOwners()); + if (plot.getArea() != null) { + info = info.replace("%area%", plot.getArea().worldname + + (plot.getArea().id == null ? "" : "(" + plot.getArea().id + ")")); + } else { + info = info.replace("%area%", Captions.NONE.getTranslated()); + } info = info.replace("%id%", plot.getId().toString()); info = info.replace("%alias%", alias); info = info.replace("%num%", String.valueOf(num)); @@ -816,7 +822,7 @@ public class MainUtil { info = info.replace("%seen%", seen); info = info.replace("%flags%", flags); info = info.replace("%build%", String.valueOf(build)); - info = info.replace("%desc%", "No description set."); + info = info.replace("%desc%", Captions.PLOT_NO_DESCRIPTION.getTranslated()); if (info.contains("%rating%")) { final String newInfo = info; TaskManager.runTaskAsync(() -> {