1
0
mirror of https://e.coding.net/circlecloud/QuickShop.git synced 2025-10-02 12:37:27 +00:00

fix: 修复悬浮物和刷物品的问题

Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
2017-01-25 13:05:10 +08:00
parent 3c5e4c2cf6
commit b90049aad7
8 changed files with 25 additions and 62 deletions

View File

@ -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"));
}
}
}
}

View File

@ -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());