StackOverflowError when shift-clicking inventory item

Discussion in 'Plugin Development' started by Mtihc, Jul 26, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Mtihc

    Users of my plugin have been haunted by this error.
    http://pastebin.com/qvkuVjdz

    The lines of code mentioned in the error, can be found here:
    https://github.com/Bukkit/CraftBukkit/blob/master/src/main/java/net/minecraft/server/Container.java
    On line 253, and 418.

    It looks like the error happens because k = 1. Forever.


    Somebody found out how to reproduce the error.
    1. Create a treasure container with my plugin.
    2. Shift-click an item (error happens)

    It only happens when shift-clicking inside any container OTHER THAN chests.

    I don't know how my code can be responsible.
    I rely on bukkit's method getServer().createInventory,
    https://github.com/Mtihc/TreasureCh...easurechest/v8/core/TreasureManager.java#L344
    and bukkit's serialization of ItemStacks.
    https://github.com/Mtihc/TreasureCh...t/treasurechest/v8/core/ItemStackWrapper.java

    Any idea's?
     
  2. Offline

    Alex5657

    Don't use createInventory. Initialize a new CraftInventoryCustom. Thats how I allways do it.
     
  3. Offline

    Mtihc

    Thanks for the suggestion. But it did not help.
    Also... CraftInventoryCustom is not part of the Bukkit API. So you are messing with backwards compatibility support and stuff. It's just not recommended i guess.

    I have found the issue a couple of times.
    Here is the one that is considered original. And it's still open.
    https://bukkit.atlassian.net/browse/BUKKIT-1929

    I would change this thread to "resolved". But it is not really resolved :(

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
Thread Status:
Not open for further replies.

Share This Page