QuickShop-Hikari
QuickShop-Hikari copied to clipboard
[BUG] Chest shops before 1.21 remove custom NBT and sometimes throw an error
Description
Chest shops that were created before 1.21
either remove custom NBT or throw the following.
[18:30:30 WARN]: [QuickShop-Hikari] Failed to processing purchase, rolling back...
java.lang.IllegalStateException: Failed to commit transaction! Economy Error Response:Failed to add 1x item:
Steps to reproduce
- Load a
1.20.4
server, and create a chest shop that buys something with custom NBT.
On our server, we have things like AdvancedEnchants or Vouchers
- Update it to
1.21
. - Attempt to sell the item to the shop.
- This will either remove the custom NBT or straight up throw an error.
You can use
/data get entity <player>
to check the nbt.
Expected Behaviour
Players should be able to sell items with custom NBT to older shops.
Screenshots
When using an AdvancedEnchants enchant
Client
[19:30:29] [Render thread/INFO]: [System] [CHAT] +---------------------------------------------------+
[19:30:29] [Render thread/INFO]: [System] [CHAT] | Shop Information:
[19:30:29] [Render thread/INFO]: [System] [CHAT] | Owner: <hidden>
[19:30:29] [Render thread/INFO]: [System] [CHAT] | Item: Chaos I [Item Preview]
[19:30:29] [Render thread/INFO]: [System] [CHAT] | Space: 53
[19:30:29] [Render thread/INFO]: [System] [CHAT] | Price per Chaos I - $1
[19:30:29] [Render thread/INFO]: [System] [CHAT] | This shop is BUYING items.
[19:30:29] [Render thread/INFO]: [System] [CHAT] +---------------------------------------------------+
[19:30:29] [Render thread/INFO]: [System] [CHAT] Enter in chat, how much you wish to SELL. You can sell 1. Enter all in chat, to sell all.
[19:30:30] [Render thread/INFO]: [System] [CHAT] Sorry, but an internal error occurred while processing your purchase. The purchase has been cancelled and any other operations have been rolled back. Please contact the server administrators if this error persists.
Server
[18:30:30 WARN]: [QuickShop-Hikari] Failed to processing purchase, rolling back...
java.lang.IllegalStateException: Failed to commit transaction! Economy Error Response:Failed to add 1x item:
==: org.bukkit.inventory.ItemStack
v: 3953
type: BOOK
meta:
==: ItemMeta
meta-type: UNSPECIFIC
display-name: '{"text":"","extra":[{"text":"Chaos I","obfuscated":false,"italic":false,"underlined":true,"strikethrough":false,"color":"light_purple","bold":true}]}'
lore:
- '{"text":"","extra":[{"text":"100% Success Rate","obfuscated":false,"italic":false,"underlined":false,"strikethrough":false,"color":"green","bold":false}]}'
- '{"text":"","extra":[{"text":"0% Destroy Rate","obfuscated":false,"italic":false,"underlined":false,"strikethrough":false,"color":"red","bold":false}]}'
- '{"text":"","extra":[{"text":"Chance to give your victims ","obfuscated":false,"italic":false,"underlined":false,"strikethrough":false,"color":"yellow","bold":false}]}'
- '{"text":"","extra":[{"text":"Weakness and Wither.","italic":false,"color":"yellow"}]}'
- '{"text":"","extra":[{"text":"Tridents Enchantment","obfuscated":false,"italic":false,"underlined":false,"strikethrough":false,"color":"gray","bold":false}]}'
- '{"text":"","extra":[{"text":"Drag n'' drop onto item to enchant","obfuscated":false,"italic":false,"underlined":false,"strikethrough":false,"color":"gray","bold":false}]}'
custom-model-data: 0
to {"inventoryType":"org.bukkit.craftbukkit.inventory.CraftInventory","inventory":"org.bukkit.craftbukkit.inventory.CraftInventory@19b7b75e"}
at QuickShop-Hikari 6.2.0.6.jar/com.ghostchu.quickshop.shop.ContainerShop.buy(ContainerShop.java:308) ~[QuickShop-Hikari 6.2.0.6.jar:?]
at QuickShop-Hikari 6.2.0.6.jar/com.ghostchu.quickshop.shop.SimpleShopManager.actionBuying(SimpleShopManager.java:213) ~[QuickShop-Hikari 6.2.0.6.jar:?]
at QuickShop-Hikari 6.2.0.6.jar/com.ghostchu.quickshop.shop.SimpleShopManager.actionTrade(SimpleShopManager.java:1128) ~[QuickShop-Hikari 6.2.0.6.jar:?]
at QuickShop-Hikari 6.2.0.6.jar/com.ghostchu.quickshop.shop.SimpleShopManager.lambda$handleChat$2(SimpleShopManager.java:689) ~[QuickShop-Hikari 6.2.0.6.jar:?]
at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:86) ~[purpur-1.21.jar:1.21-2280-930003b]
at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:475) ~[purpur-1.21.jar:1.21-2280-930003b]
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1762) ~[purpur-1.21.jar:1.21-2280-930003b]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:509) ~[purpur-1.21.jar:1.21-2280-930003b]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1634) ~[purpur-1.21.jar:1.21-2280-930003b]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1334) ~[purpur-1.21.jar:1.21-2280-930003b]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:333) ~[purpur-1.21.jar:1.21-2280-930003b]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Other custom NBT Items
When selling simpler custom NBT items the NBT is just removed.
/quickshop paste
URL
https://ghost-chu.github.io/quickshop-hikari-paste-viewer/?remote=https%3A%2F%2Fbytebin.lucko.me%2FAZtcMvf0Al
Additional Context
No response
Checklist
- [ ] I'm running Paper or Spigot, and not a fork
- [ ] I confirm that Paper/Spigot has been updated to the latest build
- [X] I confirm that QuickShop-Hikari has been updated to the latest stable version released on Modrinth (or the latest CI version)
- [X] I confirm that I have not read these checkboxes and therefore I just ticked them all.
- [X] I confirm that I'm using QuickShop-Hikari, not QuickShop-Reremake, and I'm well aware that they're maintained by different people, and that Reremake issues shouldn't be reported here.
- [X] I confirm that I am running a server that is not a Hybird Server, (e.g. Mohist, Magma, CatServer, Banner, etc.), and I am aware that QuickShop-Hikari may not function properly on a Forge/Fabric hybrid server, and I am running at my own risk on such a server program, and I am aware that the I run such server-side programs at my own risk and know that I will not receive any support or help for this behavior.
- [X] I am well aware that if the Issue Ticket is not filled out correctly and completely, it will simply be closed without any response or reason.