Make none-stackable item stackable

Discussion in 'Bukkit Help' started by DjDCH, Jan 16, 2011.

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


    After requesting for a plugin to make sign stackable, I was thinking how this plugin can be made. So I read the bukkit documentation to find out how I can realize this plugin. I come now with these questions to the bukkit developers.

    I see two way to make sign stackable. The easy one, or the hard one.

    First one, would only require that bukkit add a mutator to the Item object to permit editing the maxStackSize value. This is quite easy and simple to add. But, I don't think the way I say it is the good way to do it.

    Second one, would require to register every event where imply manipulation of items stack. So, we need to watch all this event, check if sign is involved, if yes, manually do the manipulation with the custom value of the maxStackSize. This is quite hard and complex to do. It require an event for Inventory change, but also Workbench, Chest, Dispenser and Furnace.

    So, my questions are: What is the best way to make this plugin ? Is all event required will be implemented ? or Is the setMaxStackSize mutator will be implemented ?
  2. Offline


    Item manipulation is handled by the client. If you try to stack 2 signs, I don't think it will send a packet asking if the stack is valid.

    Signs would have to be combined in a non-standard way. For example, if you place 4 signs in your craft box, they are replaced by a 4 sign stack.

    You could listen to the INVENTORY_CHANGE hook (not implemented yet) and check if the condition is met.
    --- merged: Jan 17, 2011 10:41 AM ---
    Also, signs would need to be unstacked prior to placement.
  3. Offline


    Okay. Is the INVENTORY_CHANGE hook will be trigger in player inventory only or any windows-like inventory (such as Workbench, Chest, etc) ?
Thread Status:
Not open for further replies.

Share This Page