mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-26 18:39:44 -05:00
Improve ProtocolLib support checking
Former-commit-id: 35887ca2d5db0aa0976582ef29c8d3d30536899b
This commit is contained in:
1 parent
b5326fe21d
commit
636e5d646e
3 files changed
+11
-5
No files matched your search
@@ -112,7 +112,6 @@ public class DatabaseManager {
|
||||
}
|
||||
}
|
||||
connection.commit();
|
||||
connection.setAutoCommit(true);
|
||||
} catch (SQLException sqle) {
|
||||
plugin.getSentryErrorReporter().ignoreThrow();
|
||||
sqle.printStackTrace();
|
||||
|
||||
@@ -344,13 +344,13 @@ public class QuickShop extends JavaPlugin {
|
||||
//VirtualItem support
|
||||
if (DisplayItem.getNowUsing() == DisplayType.VIRTUALITEM) {
|
||||
getLogger().info("Using Virtual item Display, loading ProtocolLib support...");
|
||||
if (Bukkit.getPluginManager().getPlugin("ProtocolLib") != null) {
|
||||
Plugin protocolLibPlugin=Bukkit.getPluginManager().getPlugin("ProtocolLib");
|
||||
if (protocolLibPlugin != null&&protocolLibPlugin.isEnabled()) {
|
||||
getLogger().info("Successfully loaded ProtocolLib support!");
|
||||
} else {
|
||||
getLogger().warning("Failed to load ProtocolLib support, fallback to real item display");
|
||||
getConfig().set("shop.display-type", 0);
|
||||
saveConfig();
|
||||
reloadConfig();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ public class QuickShop extends JavaPlugin {
|
||||
if (!clearLagListener.getPlugin().equals(clearlag)) {
|
||||
continue;
|
||||
}
|
||||
int spamTimes = 500;
|
||||
int spamTimes = 20;
|
||||
if (clearLagListener.getListener().getClass().equals(ItemMergeListener.class)) {
|
||||
ItemSpawnEvent.getHandlerList().unregister(clearLagListener.getListener());
|
||||
for (int i = 0; i < spamTimes; i++) {
|
||||
|
||||
@@ -127,7 +127,14 @@ public class ContainerShop implements Shop {
|
||||
this.displayItem = new ArmorStandDisplayItem(this);
|
||||
break;
|
||||
case VIRTUALITEM:
|
||||
this.displayItem = new VirtualDisplayItem(this);
|
||||
try {
|
||||
this.displayItem = new VirtualDisplayItem(this);
|
||||
}catch(Exception e){
|
||||
plugin.getConfig().set("shop.display-type", 0);
|
||||
plugin.saveConfig();
|
||||
this.displayItem = new RealDisplayItem(this);
|
||||
throw new RuntimeException("Failed to initialize VirtualDisplayItem, fallback to RealDisplayItem, are you using the latest version of ProtocolLib?",e);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Util.debugLog(
|
||||
|
||||
Reference in new issue
Block a user