diff --git a/Bukkit/src/main/resources/plugin.yml b/Bukkit/src/main/resources/plugin.yml index 92c67adad..cbee6f866 100644 --- a/Bukkit/src/main/resources/plugin.yml +++ b/Bukkit/src/main/resources/plugin.yml @@ -311,7 +311,7 @@ permissions: default: false plots.permpack.basicflags: - default: op + default: false children: plots.set.flag: true plots.flag: true @@ -360,7 +360,7 @@ permissions: plots.set.flag.price.*: true plots.set.flag.no-worldedit.*: true plots.permpack.basicinbox: - default: op + default: false children: plots.inbox.read.public: true plots.inbox.modify.public: true @@ -373,7 +373,7 @@ permissions: plots.comment: true plots.inbox: true plots.permpack.wilderness: - default: op + default: false children: plots.admin.interact.unowned: true plots.admin.destroy.unowned: true @@ -382,7 +382,7 @@ permissions: plots.admin.vehicle.break.unowned: true plots.admin.pve.unowned: true plots.permpack.basic: - default: op + default: false children: plots.use: true plots.info: true diff --git a/Core/src/main/java/com/plotsquared/core/configuration/Settings.java b/Core/src/main/java/com/plotsquared/core/configuration/Settings.java index 2ee5f1ba2..20c8acaf3 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/Settings.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/Settings.java @@ -46,7 +46,7 @@ public class Settings extends Config { @Comment({"Show additional information in console. It helps us at IntellectualSites to find out more about an issue.", "Leave it off if you don't need it, it can spam your console."}) - public static boolean DEBUG = false; + public static boolean DEBUG = true; @Comment({"The big text that appears when you enter a plot.", "For a single plot set `/plot flag set titles false` to disable it.", "For just you run `/plot toggle titles` to disable it.", "For all plots: Add `titles: false` in the worlds.yml flags block to disable it."}) @@ -58,11 +58,6 @@ public class Settings extends Config { public static int TITLES_STAY = 50; @Comment("Plot titles fading out (duration in ticks)") public static int TITLES_FADE_OUT = 20; - @Comment({"Changes the notification method on plot entry from Title + SubTitle -> ActionBar.", - "The message still sent to the player is pulled from the lang key \"titles.title_entered_plot\".", - "If you would like to still show the owner of the plot, append the contents of \"titles.title_entered_plot_sub\" onto the " + - "former lang key."}) - public static boolean TITLES_AS_ACTIONBAR = false; @Create // This value will be generated automatically public static ConfigBlock AUTO_CLEAR = null; @@ -663,7 +658,7 @@ public class Settings extends Config { @Comment({"Time to wait in ms before beginning to notify player or console of progress.", "Prevent needless notification of progress for short queues."}) public static int NOTIFY_WAIT = 5000; - @Comment({"How lighitng should be handled by the queue. Modes:", + @Comment({"How lighting should be handled by the queue. Modes:", " - 0 - Do not do any lighting (fastest)", " - 1 - Only execute lighting where blocks with light values are placed", " - 2 - Only execute lighting where blocks with light values are placed or removed/replaced", @@ -723,7 +718,7 @@ public class Settings extends Config { public static boolean KILL_ROAD_VEHICLES = false; @Comment("Notify a player of any missed plot comments upon plot entry") public static boolean - COMMENT_NOTIFIER = false; + COMMENT_NOTIFIER = true; @Comment("Let players claim entire worlds with PlotSquared") public static boolean WORLDS = false; @@ -763,6 +758,14 @@ public class Settings extends Config { ); @Comment("Whether PlotSquared should hook into MvDWPlaceholderAPI or not") public static boolean USE_MVDWAPI = true; + @Comment({"Changes the notification method on plot entry from Title + SubTitle -> ActionBar.", + "The message still sent to the player is pulled from the lang key \"titles.title_entered_plot\".", + "If you would like to still show the owner of the plot, append the contents of \"titles.title_entered_plot_sub\" onto the " + + "former lang key."}) + public static boolean TITLES_AS_ACTIONBAR = false; + @Comment({"Whether an action bar message should be send over a chat message for notification purposes such for the ", + "notify-enter, notify-leave, greeting or farewell flag."}) + public static boolean NOTIFICATION_AS_ACTIONBAR = false; } diff --git a/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java b/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java index 110c51e20..383bc99a6 100644 --- a/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java +++ b/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java @@ -171,7 +171,11 @@ public class PlotListener { final String greeting = plot.getFlag(GreetingFlag.class); if (!greeting.isEmpty()) { - plot.format(StaticCaption.of(greeting), player, false).thenAcceptAsync(player::sendMessage); + if (!Settings.Enabled_Components.NOTIFICATION_AS_ACTIONBAR) { + plot.format(StaticCaption.of(greeting), player, false).thenAcceptAsync(player::sendMessage); + } else { + plot.format(StaticCaption.of(greeting), player, false).thenAcceptAsync(player::sendActionBar); + } } if (plot.getFlag(NotifyEnterFlag.class)) { @@ -179,11 +183,14 @@ public class PlotListener { for (UUID uuid : plot.getOwners()) { final PlotPlayer owner = PlotSquared.platform().playerManager().getPlayerIfExists(uuid); if (owner != null && !owner.getUUID().equals(player.getUUID()) && owner.canSee(player)) { - owner.sendMessage( - TranslatableCaption.of("notification.notify_enter"), - Template.of("player", player.getName()), - Template.of("plot", plot.getId().toString()) - ); + Caption caption = TranslatableCaption.of("notification.notify_enter"); + Template playerTemplate = Template.of("player", player.getName()); + Template plotTemplate = Template.of("plot", plot.getId().toString()); + if (!Settings.Enabled_Components.NOTIFICATION_AS_ACTIONBAR) { + owner.sendMessage(caption, playerTemplate, plotTemplate); + } else { + owner.sendActionBar(caption, playerTemplate, plotTemplate); + } } } } @@ -305,7 +312,7 @@ public class PlotListener { Template ownerTemplate = Template.of("owner", owner); final Consumer userConsumer = user -> { - if (Settings.TITLES_AS_ACTIONBAR) { + if (Settings.Enabled_Components.TITLES_AS_ACTIONBAR) { player.sendActionBar(header, plotTemplate, worldTemplate, ownerTemplate); } else { player.sendTitle(header, subHeader, plotTemplate, worldTemplate, ownerTemplate); @@ -385,7 +392,11 @@ public class PlotListener { final String farewell = plot.getFlag(FarewellFlag.class); if (!farewell.isEmpty()) { - plot.format(StaticCaption.of(farewell), player, false).thenAcceptAsync(player::sendMessage); + if (!Settings.Enabled_Components.NOTIFICATION_AS_ACTIONBAR) { + plot.format(StaticCaption.of(farewell), player, false).thenAcceptAsync(player::sendMessage); + } else { + plot.format(StaticCaption.of(farewell), player, false).thenAcceptAsync(player::sendActionBar); + } } if (plot.getFlag(NotifyLeaveFlag.class)) { @@ -393,11 +404,14 @@ public class PlotListener { for (UUID uuid : plot.getOwners()) { final PlotPlayer owner = PlotSquared.platform().playerManager().getPlayerIfExists(uuid); if ((owner != null) && !owner.getUUID().equals(player.getUUID()) && owner.canSee(player)) { - owner.sendMessage( - TranslatableCaption.of("notification.notify_leave"), - Template.of("player", player.getName()), - Template.of("plot", plot.getId().toString()) - ); + Caption caption = TranslatableCaption.of("notification.notify_leave"); + Template playerTemplate = Template.of("player", player.getName()); + Template plotTemplate = Template.of("plot", plot.getId().toString()); + if (!Settings.Enabled_Components.NOTIFICATION_AS_ACTIONBAR) { + owner.sendMessage(caption, playerTemplate, plotTemplate); + } else { + owner.sendActionBar(caption, playerTemplate, plotTemplate); + } } } }