Skip to main content

ItemStack加载器

ItemStack加载器是加载Bukkit ItemStack的工具。

caution

Before using this feature, you MUST create a full server backup. After you enable it, changes are written permanently to worlds and databases; rollback is impossible without a backup.

何时需要此功能

当您更新到 Minecraft 到较新版本并在之后降级(但没有同时回滚 quickshop 数据库)时,您可能会看到如下错误:

[Server] ERROR Could not call method 'public static org.bukkit.inventory.ItemStack org.bukkit.inventory.ItemStack.deserialize(java.util.Map)' of class org.bukkit.inventory.ItemStack for deserialization
[Server] INFO java.lang.IllegalArgumentException: Newer version! Server downgrades are not supported!

在这种情况下,我们的建议是恢复最后一个正常的QuickShop数据库备份,但是如果您不幸丢失了所有备份,则可以尝试以下解决方法。

QuickShop 会在控制台出现因版本降级而出现错误时提示, 例如:

[QuickShop-Hikari] [WARN] Cannot load ItemStack {ITEM_INFO} because it was saved by a newer Minecraft server version. The action will fail and you will receive an exception. PLEASE DON'T REPORT THIS TO QUICKSHOP!
[QuickShop-Hikari] [WARN] You can try force load this ItemStack by our hacked ItemStack read util(shop.force-load-downgrade-items), but beware, the data may damaged if you load on this lower Minecraft server version, Please backup your world and database before enable!

启用后备解决方案

Enable the loader workaround by changing the following setting in config.yml:

shop:
# Cross-Version Item Loading (Advanced / Risky)
# Attempts to load items created on newer Minecraft versions.
# WARNING: This may corrupt server or shop data. Always backup first.
force-load-downgrade-items:
enable: true
# Work mode:
# 0 = Ask Bukkit to update the ItemStack
# 1 = Ask Bukkit to load the ItemStack directly
method: 0

Method 0 asks Bukkit to update the ItemStack version, while method 1 asks Bukkit to load it directly. By default, the value is 0.