SpoutDev/Spout — Issue #971: Unremovable widgets (by plugin)
Author: randomer679
Created: 2011-11-17 22:42:15+00:00
State: open

I believe this is a bug caused by the way bukkit and spout work so I do not think it is easily fixable but I thought I would post a report on here anyway.
I have created two plugins. One to create a PopupScreen and call the other plugin with a custom event when a button on that PopupScreen is pressed. This custom event provides the SpoutPlayer and the PopupScreen along with some other methods. When the custom event is called the other plugin then clears the PopupScreen and attaches its own widgets. Now here is the bug. That plugin attaches several buttons that cause the contents of the PopupScreen to change (next and previous). However when those buttons are clicked the relevant methods CANNOT remove the widgets by the .removeWidgets(plugin) method. I know this is a bug because:
1. If you click the buttons that have not been removed e.g. next, then the widgets that were added the second time will be deleted but the first widgets still remain and the third set of widgets are added.
2. I created a simple little method that creates a button when the event is called. When this button is clicked the plugin executes all the code that was executed before my the event call. This works for the most part in that the screen can be cleared of everything but the button that the event call created.

Also I have tried clearing the irremovable items by the main plugin (that calls the event) instead of the plugin that was supposed to create the widgets however this does not work either so my best guess is that bukkit becoming the owner/creator of those first items OR they have no owner/creator. I have been working on these plugins over several RBs of both Spout and Bukkit and it has stayed the same.

If any extra details are needed just ask :)