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 5cd38cde8..a3911a69e 100644 --- a/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java +++ b/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java @@ -198,13 +198,7 @@ public class PlotListener { final PlotPlayer owner = PlotSquared.platform().playerManager().getPlayerIfExists(uuid); if (owner != null && !owner.getUUID().equals(player.getUUID()) && owner.canSee(player)) { Caption caption = TranslatableCaption.of("notification.notify_enter"); - Template playerTemplate = Template.of("player", player.getName()); - Template plotTemplate = Template.of("plot", plot.getId().toString()); - if (!Settings.Chat.NOTIFICATION_AS_ACTIONBAR) { - owner.sendMessage(caption, playerTemplate, plotTemplate); - } else { - owner.sendActionBar(caption, playerTemplate, plotTemplate); - } + notifyPlotOwner(player, plot, owner, caption); } } } @@ -443,13 +437,7 @@ public class PlotListener { final PlotPlayer owner = PlotSquared.platform().playerManager().getPlayerIfExists(uuid); if ((owner != null) && !owner.getUUID().equals(player.getUUID()) && owner.canSee(player)) { Caption caption = TranslatableCaption.of("notification.notify_leave"); - Template playerTemplate = Template.of("player", player.getName()); - Template plotTemplate = Template.of("plot", plot.getId().toString()); - if (!Settings.Chat.NOTIFICATION_AS_ACTIONBAR) { - owner.sendMessage(caption, playerTemplate, plotTemplate); - } else { - owner.sendActionBar(caption, playerTemplate, plotTemplate); - } + notifyPlotOwner(player, plot, owner, caption); } } } @@ -497,6 +485,17 @@ public class PlotListener { return true; } + private void notifyPlotOwner(final PlotPlayer player, final Plot plot, final PlotPlayer owner, final Caption caption) { + Template playerTemplate = Template.of("player", player.getName()); + Template plotTemplate = Template.of("plot", plot.getId().toString()); + Template areaTemplate = Template.of("area", plot.getArea().toString()); + if (!Settings.Chat.NOTIFICATION_AS_ACTIONBAR) { + owner.sendMessage(caption, playerTemplate, plotTemplate, areaTemplate); + } else { + owner.sendActionBar(caption, playerTemplate, plotTemplate, areaTemplate); + } + } + public void logout(UUID uuid) { feedRunnable.remove(uuid); healRunnable.remove(uuid); diff --git a/Core/src/main/resources/lang/messages_en.json b/Core/src/main/resources/lang/messages_en.json index 56da0a00d..b9cf6d288 100644 --- a/Core/src/main/resources/lang/messages_en.json +++ b/Core/src/main/resources/lang/messages_en.json @@ -60,8 +60,8 @@ "worldedit.worldedit_bypassed": "Currently bypassing WorldEdit restriction.", "gamemode.gamemode_was_bypassed": "You bypassed the gamemode () set for .", "height.height_limit": "This plot area has building height limits: Min height: , Max height: ", - "notification.notify_enter": " entered your plot ().", - "notification.notify_leave": " left your plot ().", + "notification.notify_enter": " entered your plot (;).", + "notification.notify_leave": " left your plot (;).", "swap.swap_overlap": "The proposed areas are not allowed to overlap.", "swap.swap_success": "Successfully swapped plots -> ", "swap.swap_merged": "Merged plots may not be swapped. Please unmerge the plots before performing the swap.",