Open CowedOffACliff opened 4 years ago
The best bug report I have ever got for this project, thanks. I never had the banners on my scope, only enchanted items, potions etc. Thanks for the hint, I will look into it
I taught myself to code by learning to modify the game several years ago. My knowledge is very rusty but I remember a lot about how things work. I spent at least a good few hours trying to diagnose the bug in a live non-development environment before I officially reported it. Cheers. :P
Describe the bug A clear and concise description of what the bug is.
Custom banners (i.e. any type of modified banner) cannot be sold to or purchased from an admin shop (and all shops because the handling methods are all the universal?) after a server restarts. The banners will still appear correctly in the inventory with all of their correct item data and all of the shop interface information in tact. Attempting to purchase/sell a banner in this state will result in the interface doing nothing. It will just refuse to modify any inventories.
I believe this may have something to do with how the banner step information is being saved in the shop yaml file. Banners get saved with a lot of information like this "patterns=[org.bukkit.block.banner.Pattern@1b0f3c14" describing the steps. I'm not a Bukkit coder but looking through the plugin code for a bit I'm guessing the @* information is being appended by a .toString(). After messing with this for a while I took notice that if you add a banner to the shop then get the shop into a state where they are no longer able to be purchased, then add the same banner into the shop again, the new instance of the banner inside the yaml file will have completely different @data in certain places even though it is the exact same minecraft item that was placed in the shop the first time.
To Reproduce Did you changed the savefiles by yourself? - I both did and not modify the save file manually throughout my time spent trying to test the bug. Any error in the server log? (Add server log) - No relevant information in server log. Steps to reproduce.
A Bukkit:Reload will not trigger this problem immediately after adding the item to the shop. It will also not fix the problem after the failure state has occured. Once the failure state is triggered I have not been able to find a way to get it working again without redoing the items. I am fairly certain that completely stopping and restarting the server instance produces the trigger condition which causes the shop to fail to load and interpret the information correctly.
Expected behavior A clear and concise description of what you expected to happen.
Banners of any type should be able to be placed into a shop and sold as normal items. This may end up requiring a specialty function like player heads and mob spawners do. This is perfectly acceptable and sensible if it is required.
Environment Paper: Paper version git-Paper-282 (MC: 1.15.2) (Implementing API version 1.15.2-R0.1-SNAPSHOT) Server version 1.15.2 Plugin version 1.2.5f