1
0
mirror of https://e.coding.net/circlecloud/QuickShop.git synced 2024-12-27 07:48:48 +00:00

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

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

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>QuickShop</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

Binary file not shown.

Binary file not shown.

Binary file not shown.

27
pom.xml
View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.maxgamer</groupId>
<artifactId>QuickShop</artifactId>
<version>2.0.1</version>
<version>2.1</version>
<description>快捷商店重置版本...</description>
<build>
<finalName>${project.name}</finalName>
@ -14,14 +14,6 @@
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
@ -60,21 +52,19 @@
<env.GIT_COMMIT>DEBUG</env.GIT_COMMIT>
<update.description>§a全新版本 §c虚拟悬浮物(橙子提供 对 就是那个汉化COI的逗比)§e7老板修复逗比BUG...</update.description>
<update.changes>
§b2.1.0 - §c修复大箱子刷物品的问题...;
§b2.0.1 - §a使用新类库 兼容最新版本...;
§b1.9.5 - §a1.10+兼容虚拟悬浮物...;
§b1.9.4 - §a1.9+兼容虚拟悬浮物...;
</update.changes>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>yumc-repo</id>
<url>http://repo.yumc.pw/content/groups/public/</url>
</repository>
<repository>
<id>dmulloy</id>
<url>http://repo.dmulloy2.net/content/groups/public/</url>
</repository>
</repositories>
<distributionManagement>
<repository>
@ -88,19 +78,12 @@
<groupId>pw.yumc</groupId>
<artifactId>YumCore</artifactId>
<type>jar</type>
<version>1.5</version>
<version>1.6</version>
</dependency>
<dependency>
<groupId>io.github.Cnly.WowSuchCleaner</groupId>
<artifactId>WowSuchCleaner</artifactId>
<version>1.6.5</version>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>WorldEdit</artifactId>
<version>5.4.5</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/WorldEdit.jar</systemPath>
</dependency>
</dependencies>
</project>

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