BeeHives, BeeNests disappear from trade options after a server reboot.
BigScary opened this issue ยท 3 comments
Preliminaries:
- Shopkeepers version:
<Insert Shopkeepers version>
- Spigot version: CraftBukkit version git-Spigot-ad703da-d77f4d9 (MC: 1.16.1) (Implementing API version 1.16.1-R0.1-SNAPSHOT)
- I have checked that my issue/question does not get answered by:
- The documentation.
- The FAQ.
- The Known Issues.
- I have checked all open and closed issues, but none seems to fit my issue/question.
Reproduction on a fresh and up-to-date Spigot server:
I was was to reproduce my issue on a freshly setup and up-to-date Spigot server (currently CraftBukkit version git-Spigot-ad703da-d77f4d9 (MC: 1.16.1) (Implementing API version 1.16.1-R0.1-SNAPSHOT)
) with the latest version of Shopkeepers (currently 2.10.0
), with no other plugins and with no kinds of other server or client mods.
The issue:
- Set up a barter style shop where you're offering both beehives and beenests as separate trades.
- Try to trade with the entity (we're using witches) to confirm those trades are available in the trade UI.
- Restart the server.
- Try to trade with the entity (we're using witches).
Expected: Trades are still there.
Actual: Trades are missing, shop owner needs to set up them up again to have them offered.
Wild guess: Maybe it has to do with metadata... whether bees are or are not in the hive/nest?
- Can you clarify how you create the items involved in the trade and how the trades are setup exactly (i.e. which input items and which result item do they use)? If you create those items with a command or some other mechanism (plugin, loot table, etc.) I need the instructions to recreate the items in the exact same way.
- Is that an admin shop or a player shop (which looks up its supplies form a chest)? With 'barter style shop', do you mean an admin shop or a trading player shop?
Trades are missing, shop owner needs to set up them up again to have them offered.
Do the trades disappear completely from the shopkeeper? Or are they still there but can no longer be used?
If the trade is still there but can no longer be used: Is there a red X indicating that the trade is not available, or is it simply not accepting the input items (And if that is the case: Is it either not allowing to pickup the result item, or is it not even showing the result item after inserting the input item into the trading interface)?
Wild guess: Maybe it has to do with metadata... whether bees are or are not in the hive/nest?
Could be.
Commonly issues with trades no longer working after a plugin reload are related to Spigot's item serialization not being able to correctly persist the ItemStack (when the Shopkeepers plugin saves and loads it to/from the save.yml file). If the loaded item no longer matches the user's input items, the trade will no longer work.
There have also been some issues recently with some NBT data not getting saved correctly for some types of blocks. Do these bee hive items contain any other special data, other than bees? Do the bees themselves have any special data?
However, for the trades to completely disappear would be something new to me.
Are there any errors in the console? Or warnings indiciating some issue when the plugin tries to load the shopkeepers?
Can you check the contents of the save.yml file if the trade is:
- Correctly getting saved there after you have setup the trades.
- Whether the trade has also disappeared from the save file after it is no longer appearing in game.
- Can you upload / attach the save data for the affected shopkeeper to this ticket (before the trades disappear)?
Also, in the config of the Shopkeepers plugin, do you have save-instantly
enabled?
If it is disabled, and you stop the server regulary, does the trade get properly saved into the save.yml file? If it is disabled and you enable it, can you still reproduce the issue?
I just tried setting up trades for bee nests and bee hives, both with and without bees (spawned via regular bee spawn eggs) inside them, both in an admin and a player trading shop, and was not yet able to reproduce the issue.
Sorry for all of those questions, but I am not yet able to narrow it down / reproduce this from your initial description.
Okay I think I am now able to reproduce the issue with a bee hive containing a bee with custom name. The data of the bee hive item seems to no longer match the original bee hive item and the trade does therefore no longer function if this is a player shop which pulls supplies from a chest.
I still have to figure out the exact data that has changed during the deserialization of the ItemStack. My guess is the name right now.
Edit: Okay, in my case the issue was with the lore of the bee hive ItemStack. I picked up the bee hive block in creative mode. This adds a lore with text '{"text":"(+NBT)"}'
. After deserialization this lore has become '{"extra":[{"text":"(+NBT)"}],"text":""}'
. See http://prntscr.com/tf4xba
Depending on how you create the original bee hive ItemStack the same issue applies to any other text attributes of the item (eg. display name). Relevant Spigot tickets for this issue are: https://hub.spigotmc.org/jira/browse/SPIGOT-5063 and https://hub.spigotmc.org/jira/browse/SPIGOT-5964
Can you verify that the issue is with some text representation changing in your case as well?
With the latest Spigot changes (https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/commits/560b65c4f8a15619aaa4a1737c7040f21e725cce) this should be resolved (assuming the issue was with the lore of that item; if the issue is caused by some other piece of data consider letting me know).
I have tested this briefly and it seems that everything works fine. However, if you update your server make sure to create a backup of your save data, just in case something goes wrong.
In my testing it seems that I now get a lore of '"(+NBT)"'
(http://prntscr.com/we4ksm), which gets properly persisted by the Shopkeepers plugin now.