KaiKikuchi / QuickShop

A shop plugin for Bukkit
47 stars 41 forks source link

Little fix for double chest when user click on de second chest without sign #16

Closed FlashLight34 closed 8 years ago

FlashLight34 commented 8 years ago

In your playerinterractevent add this for the doublechest line 120 of playerlistener (onclick)

        /**
        * Detect double chest
        */
        if (shop == null && b.getType() == Material.CHEST) {
            Block attached = Util.getSecondHalf(b);
            if (attached != null) {
                shop = plugin.getShopManager().getShop(attached.getLocation());
            }
        }

before

        // Purchase handling
        if (shop != null && p.hasPermission("quickshop.use") && (plugin.sneakTrade == false || p.isSneaking())) {
            shop.onClick();