mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-25 18:09:48 -05:00
chat plugin compatibility
Former-commit-id: ade0af095d331216a8eaf692656393689373eecf [formerly cb9f457e2dba059c08dc44d37180ff6d19eb69f5] Former-commit-id: c16207f320b9a43b5740a3a454b6da11ddc0d9d7
This commit is contained in:
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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user