mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-25 18:09:48 -05:00
Fix shop sign is editable
This commit is contained in:
1 parent
78cccf5ffe
commit
8de61fb58b
4 files changed
+17
-8
No files matched your search
@@ -474,7 +474,6 @@ public class CommandManager implements TabCompleter, CommandExecutor {
|
||||
|
||||
private boolean isAdapt(CommandContainer container, CommandSender sender) {
|
||||
return container.getExecutorType().isInstance(sender);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.block.SignChangeEvent;
|
||||
import org.bukkit.event.inventory.InventoryMoveItemEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -180,6 +181,22 @@ public class BlockListener extends ProtectionListenerBase {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Listens for sign update to prevent other plugin or Purpur to edit the sign
|
||||
*/
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST)
|
||||
public void onSignUpdate(SignChangeEvent event) {
|
||||
Block posShopBlock = Util.getAttached(event.getBlock());
|
||||
if (posShopBlock == null) {
|
||||
return;
|
||||
}
|
||||
Shop shop = plugin.getShopManager().getShopIncludeAttached(posShopBlock.getLocation());
|
||||
if (shop == null) {
|
||||
return;
|
||||
}
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Listens for chest placement, so a doublechest shop can't be created.
|
||||
|
||||
@@ -115,13 +115,10 @@ public class ShopProtectionListener extends ProtectionListenerBase {
|
||||
plugin.getLogger().log(Level.WARNING, "Failed to automatic disable disable-move-event for world [" + world.getName() + "], please disable it by yourself or player can steal items from shops.", ex);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onBlockExplode(BlockExplodeEvent e) {
|
||||
|
||||
for (int i = 0, a = e.blockList().size(); i < a; i++) {
|
||||
final Block b = e.blockList().get(i);
|
||||
Shop shop = getShopNature(b.getLocation(), true);
|
||||
|
||||
@@ -216,10 +216,6 @@ public final class EnvironmentChecker {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//tool.verify()
|
||||
|
||||
|
||||
}
|
||||
|
||||
@EnvCheckEntry(name = "EnvChecker SelfTest", priority = 1)
|
||||
|
||||
Reference in new issue
Block a user