mirror of
https://e.coding.net/circlecloud/QuickShop.git
synced 2025-10-02 12:37:27 +00:00
@ -92,9 +92,19 @@ public class BlockListener implements Listener {
|
||||
final Block b = e.getBlock();
|
||||
final Player p = e.getPlayer();
|
||||
final Block chest = Util.getSecondHalf(b);
|
||||
if (chest != null && plugin.getShopManager().getShop(chest.getLocation()) != null && !p.hasPermission("quickshop.create.double")) {
|
||||
e.setCancelled(true);
|
||||
p.sendMessage(MsgUtil.p("no-double-chests"));
|
||||
if (chest != null) {
|
||||
Shop shop = plugin.getShopManager().getShop(chest.getLocation());
|
||||
if (shop != null) {
|
||||
if (!shop.getOwner().equals(p.getName())) {
|
||||
e.setCancelled(true);
|
||||
p.sendMessage(MsgUtil.p("no-double-chests"));
|
||||
return;
|
||||
}
|
||||
if (!p.hasPermission("quickshop.create.double")) {
|
||||
e.setCancelled(true);
|
||||
p.sendMessage(MsgUtil.p("no-double-chests"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ import org.maxgamer.QuickShop.Shop.ContainerShop;
|
||||
|
||||
import pw.yumc.YumCore.bukkit.Log;
|
||||
import pw.yumc.YumCore.bukkit.P;
|
||||
import pw.yumc.YumCore.bukkit.compatible.C;
|
||||
|
||||
/**
|
||||
* @author Netherfoam A display item, that spawns a block above the chest and
|
||||
@ -16,17 +17,17 @@ public abstract class DisplayItem {
|
||||
public static QuickShop plugin = P.getPlugin();
|
||||
|
||||
public static DisplayItem create(final ContainerShop shop) {
|
||||
String ver = C.getNMSVersion();
|
||||
if (plugin.getConfigManager().isDisplay()) {
|
||||
if (plugin.getConfigManager().isFakeItem()) {
|
||||
try {
|
||||
return new FakeItem_19_110(shop, shop.getItem());
|
||||
if (Integer.parseInt(ver.split("_")[1]) > 8) {
|
||||
return new FakeItem_19_110(shop, shop.getItem());
|
||||
} else {
|
||||
return new FakeItem_17_18(shop, shop.getItem());
|
||||
}
|
||||
} catch (final Throwable e) {
|
||||
Log.d(e);
|
||||
try {
|
||||
return new FakeItem_17_18(shop, shop.getItem());
|
||||
} catch (final Throwable e2) {
|
||||
Log.d(e2);
|
||||
}
|
||||
}
|
||||
}
|
||||
return new NormalItem(shop, shop.getItem());
|
||||
|
Reference in New Issue
Block a user