From 6dcedc9bff19b0b970658cef16f256ea3f243c25 Mon Sep 17 00:00:00 2001 From: Eric Date: Sat, 19 Nov 2016 14:04:44 +0100 Subject: [PATCH] Added messages when WorldGuard denies shop use --- .../java/de/epiceric/shopchest/language/LanguageUtils.java | 2 ++ .../de/epiceric/shopchest/language/LocalizedMessage.java | 2 ++ .../epiceric/shopchest/listeners/ShopInteractListener.java | 3 +++ src/main/resources/lang/de_DE.lang | 2 ++ src/main/resources/lang/en_US.lang | 6 ++++++ 5 files changed, 15 insertions(+) diff --git a/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java b/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java index ebb22d8..6834fed 100644 --- a/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java +++ b/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java @@ -962,6 +962,8 @@ public class LanguageUtils { messages.add(new LocalizedMessage(LocalizedMessage.Message.NO_PERMISSION_OPEN_OTHERS, langConfig.getString("message.noPermission.open-others", "&cYou don't have permission to open this chest."))); messages.add(new LocalizedMessage(LocalizedMessage.Message.NO_PERMISSION_BUY, langConfig.getString("message.noPermission.buy", "&cYou don't have permission to buy something."))); messages.add(new LocalizedMessage(LocalizedMessage.Message.NO_PERMISSION_SELL, langConfig.getString("message.noPermission.sell", "&cYou don't have permission to sell something."))); + messages.add(new LocalizedMessage(LocalizedMessage.Message.NO_PERMISSION_WG_BUY, langConfig.getString("message.noPermission.worldguard-buy", "&cYou don't have permission to buy something here."))); + messages.add(new LocalizedMessage(LocalizedMessage.Message.NO_PERMISSION_WG_SELL, langConfig.getString("message.noPermission.worldguard-sell", "&cYou don't have permission to sell something here."))); messages.add(new LocalizedMessage(LocalizedMessage.Message.NO_PERMISSION_REMOVE_OTHERS, langConfig.getString("message.noPermission.remove-others", "&cYou don't have permission to remove this shop."))); messages.add(new LocalizedMessage(LocalizedMessage.Message.NO_PERMISSION_RELOAD, langConfig.getString("message.noPermission.reload", "&cYou don't have permission to reload the shops."))); messages.add(new LocalizedMessage(LocalizedMessage.Message.NO_PERMISSION_UPDATE, langConfig.getString("message.noPermission.update", "&cYou don't have permission to check for updates."))); diff --git a/src/main/java/de/epiceric/shopchest/language/LocalizedMessage.java b/src/main/java/de/epiceric/shopchest/language/LocalizedMessage.java index f0086c0..99c6d12 100644 --- a/src/main/java/de/epiceric/shopchest/language/LocalizedMessage.java +++ b/src/main/java/de/epiceric/shopchest/language/LocalizedMessage.java @@ -108,6 +108,8 @@ public class LocalizedMessage { NO_PERMISSION_OPEN_OTHERS, NO_PERMISSION_BUY, NO_PERMISSION_SELL, + NO_PERMISSION_WG_BUY, + NO_PERMISSION_WG_SELL, NO_PERMISSION_REMOVE_OTHERS, NO_PERMISSION_RELOAD, NO_PERMISSION_UPDATE, diff --git a/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java b/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java index 9761ee6..ab4961d 100644 --- a/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java +++ b/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java @@ -223,6 +223,7 @@ public class ShopInteractListener implements Listener { buy(p, shop); } else { plugin.debug(p.getName() + " doesn't have worldguard permission"); + p.sendMessage(LanguageUtils.getMessage(LocalizedMessage.Message.NO_PERMISSION_WG_BUY)); } } else { if (plugin.hasWorldGuard()) { @@ -245,6 +246,7 @@ public class ShopInteractListener implements Listener { } } else { plugin.debug(p.getName() + " doesn't have worldguard permission"); + p.sendMessage(LanguageUtils.getMessage(LocalizedMessage.Message.NO_PERMISSION_WG_BUY)); } } } else { @@ -302,6 +304,7 @@ public class ShopInteractListener implements Listener { } } else { plugin.debug(p.getName() + " doesn't have worldguard permission"); + p.sendMessage(LanguageUtils.getMessage(LocalizedMessage.Message.NO_PERMISSION_WG_SELL)); } } else { p.sendMessage(LanguageUtils.getMessage(LocalizedMessage.Message.NO_PERMISSION_SELL)); diff --git a/src/main/resources/lang/de_DE.lang b/src/main/resources/lang/de_DE.lang index 1b9d859..00b04c5 100644 --- a/src/main/resources/lang/de_DE.lang +++ b/src/main/resources/lang/de_DE.lang @@ -64,6 +64,8 @@ message.noPermission.create-protected=&cDu hast keine Berechtigung hier einen Sh message.noPermission.open-others=&cDu hast keine Berechtigung diesen Shop zu öffnen. message.noPermission.buy=&cDu hast keine Berechtigung etwas zu kaufen. message.noPermission.sell=&cDu hast keine Berechtigung etwas zu verkaufen. +message.noPermission.worldguard-buy=&cDu hast keine Berechtigung hier etwas zu kaufen. +message.noPermission.worldguard-sell=&cDu hast keine Berechtigung hier etwas zu verkaufen. message.noPermission.remove-others=&cDu hast keine Berechtigung diesen Shop zu entfernen. message.noPermission.reload=&cDu hast keine Berechtigung die Shops neu zu laden. message.noPermission.update=&cDu hast keine Berechtigung nach Aktualisierungen zu suchen. diff --git a/src/main/resources/lang/en_US.lang b/src/main/resources/lang/en_US.lang index f608333..cc9ff62 100644 --- a/src/main/resources/lang/en_US.lang +++ b/src/main/resources/lang/en_US.lang @@ -226,6 +226,12 @@ message.noPermission.buy=&cYou don't have permission to buy something. # Set the message when a not permitted player tries to sell something. message.noPermission.sell=&cYou don't have permission to sell something. +# Set the message when a player tries to buy something in a WorldGuard region that denied shop use. +message.noPermission.worldguard-buy=&cYou don't have permission to buy something here. + +# Set the message when a player tries to sell something in a WorldGuard region that denied shop use. +message.noPermission.worldguard-sell=&cYou don't have permission to sell something here. + # Set the message when a not permitted player tries to remove another player's shop. message.noPermission.remove-others=&cYou don't have permission to remove this shop.