This commit is contained in:
Ghost_chu committed 2021-01-09 18:50:13 +08:00
1 parent 7111290c06
commit 32067720a4
3 files changed
+14 -7

No files matched your search

@@ -62,7 +62,7 @@ public class QSEventManager implements QuickEventManager, Listener {
this.rescan();
}
private void rescan() {
private synchronized void rescan() {
this.ignoredListener.clear();
plugin
.getConfig()
@@ -21,6 +21,16 @@ package org.maxgamer.quickshop.eventmanager;
import org.bukkit.event.Event;
/**
* QuickEventManager allow user switch between bukkit and quickshop.
* QuickShop's EventManager can filter the Plugin listeners and skip it when calling events
*/
public interface QuickEventManager {
/**
* Calling an event use QuickShopEventManager
*
* @param event The event
* @throws IllegalStateException Just like bukkit
*/
void callEvent(Event event) throws IllegalStateException;
}
@@ -866,7 +866,6 @@ public class ShopManager {
Util.debugLog("Player " + p + " no permission to create stacks shop, forcing creating single item shop");
info.getItem().setAmount(1);
}
Util.debugLog("actionCreate");
// Checking the shop can be created
Util.debugLog("Calling for protection check...");
@@ -893,8 +892,7 @@ public class ShopManager {
MsgUtil.sendMessage(p, MsgUtil.getMessage("chest-was-removed", p));
return;
}
if (info.getLocation().getBlock().getType()
== Material.ENDER_CHEST) { // FIXME: Need a better impl
if (info.getLocation().getBlock().getType() == Material.ENDER_CHEST) { // FIXME: Need a better impl
if (!QuickShop.getPermissionManager().hasPermission(p, "quickshop.create.enderchest")) {
return;
}
@@ -1322,15 +1320,14 @@ public class ShopManager {
Bukkit.getPluginManager().callEvent(se);
}
private boolean shopIsNotValid(@NotNull UUID uuid, @NotNull Info info, @NotNull Shop shop) {
public boolean shopIsNotValid(@NotNull UUID uuid, @NotNull Info info, @NotNull Shop shop) {
Player player = Bukkit.getPlayer(uuid);
return shopIsNotValid(player, info, shop);
}
private boolean shopIsNotValid(@Nullable Player p, @NotNull Info info, @NotNull Shop shop) {
if (plugin.getEconomy() == null) {
MsgUtil.sendMessage(
p, "Error: Economy system not loaded, type /qs main command to get details.");
MsgUtil.sendMessage(p, "Error: Economy system not loaded, type /qs main command to get details.");
return true;
}
if (!Util.canBeShop(info.getLocation().getBlock())) {