chat plugin compatibility

Former-commit-id: ade0af095d331216a8eaf692656393689373eecf [formerly cb9f457e2dba059c08dc44d37180ff6d19eb69f5]
Former-commit-id: c16207f320b9a43b5740a3a454b6da11ddc0d9d7
This commit is contained in:
Ghost_chu committed 2019-02-02 23:48:41 +08:00
1 parent f284ae70ec
commit 2a18a719c4
4 files changed
+16 -3

No files matched your search

@@ -5,6 +5,7 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.maxgamer.quickshop.QuickShop;
import org.maxgamer.quickshop.Util.Util;
/**
*
@@ -17,8 +18,12 @@ public class ChatListener implements Listener {
public ChatListener(QuickShop plugin) {
this.plugin = plugin;
}
@EventHandler(priority = EventPriority.LOWEST,ignoreCancelled=true)
@EventHandler(priority = EventPriority.LOWEST)
public void onChat(AsyncPlayerChatEvent e) {
if(e.isCancelled()&&plugin.getConfig().getBoolean("shop.ignore-cancel-chat-event")) {
Util.debugLog("Ignorr chat event (cancel by other plugin.)");
return;
}
if (!plugin.getShopManager().getActions().containsKey(e.getPlayer().getUniqueId())) {
plugin.log(plugin.getShopManager().getActions().toString());
return;
@@ -746,6 +746,12 @@ public class QuickShop extends JavaPlugin {
saveConfig();
reloadConfig();
}
if (selectedVersion == 16) {
getConfig().set("config-version", 16);
selectedVersion = 17;
saveConfig();
reloadConfig();
}
}
/** Reloads QuickShops config */
+3 -1
View File
@@ -1,7 +1,7 @@
#Default config: https://github.com/KaiKikuchi/QuickShop/blob/master/src/main/resources/config.yml
#Do not touch if you not clear know about this
config-version: 16
config-version: 17
#Do not touch if you not know what is this
dev-mode: false
@@ -119,6 +119,8 @@ shop:
#Allow auto fetch player shop, if you disable it ,Player need use /qs fetchmessage to fetch history shop messages. (Disable it may cause database size lost control.)
auto-fetch-shop-messages: true
#Ignore cancel chat event, maybe can improve compatibility with other chat plugin.
ignore-cancel-chat-event: false
#List of items to disallow selling of. Anyone with quickshop.bypass.<itemID> can bypass it