Inactive [MECH] Stackable 0.5.1 - Control the stackability of any item [766]

Discussion in 'Inactive/Unsupported Plugins' started by DjDCH, Jan 18, 2011.

  1. Offline

    DjDCH

    Hello everybody,

    Since I started this topic to request a plugin who make sign stackable, I decide to make this plugin it myself. So, this is it!

    Stackable - Version 0.5.1

    This plugin provide you the ability to choose the stack size of any item in the game. You have the possibility to increase a stack size, reduce it or even disable it. Also, set a stack size to zero removed completely any stack of this item from the inventory.

    How to install:
    The only thing you need to do is download the zip containing the jar and unzip it in the plugins directory.

    How to configure:
    If you want to configure this plugin, edit the stackable.properties inside the directory Stackable, which is inside the plugins directory. You may want to remove or add item. Just use the enum name (from the class Material of Bukkit) or the item ID for the property name and the stack size for the property value. Any undefined item in the configuration file will use its default stack size value. For the items group, they are all listed in the default config file. You may want to remove it or edit the stack size value of any items group. Notice that define a item stack size who is contains in a items group will overwrite the value of the items group.

    How to use:
    While the proper events that I need are not implemented yet, you will need to use the command /stackable (or the aliases /s or /stack) to rebuild your item stacks (automatically rebuild inside your inventory) or the rebuild the chest content that you are aiming at. If your inventory or the chest become filled at any moment during the process, all supplementary item will be dropped in front of you/chest.

    Stack Protection feature:
    DeNarr make me notice that stacked item can be lost when using it. This is applying to item that is normally unstackable. In fact, these items weren't design to be used when stacked. So, I have come with this idea, to make something to protect stacks from being lost. This feature will split any stack of tools, weapons, buckets and soup when they are used. Notice that buckets will always be drop since a minecraft bug prevent me from adding the splited stack to the inventory. Notice also that the Stack Protection will not always working for tools and weapons when damaging a entity.

    Pickup event rebuilded:
    With this new update, the pickup event is now properly handled. When you will pickup an item, it will be added to any existent stack while respecting the stack size values from the config file.

    Todo:
    * Todo, etc. on my redmine
    * Add a configuration file
    * Re-organize configuration file
    * Re-organize source code
    * Implement all event hooks
    * Improve server log
    * Add sources and Javadoc
    * Add items group
    * Add Stack Protection feature

    Default configuration file:
    Code:
    # Enable debug print in game
    enable-debug-print=false
    
    # Tools items group. (Shovels, Pickaxes, Axes, Hoes and Fishing Rod)
    @tools=1
    
    # Weapons items group. (Swords and Bow)
    @weapons=1
    
    # Armors items group. (Helmets, Chestplates, Leggings and Boots)
    @armors=64
    
    # Foods items group. (Apple, Mushroom Soup, Bread, Raw Porkchop, Cooked Porkchop, Golden Apple, Raw Fish, Cooked Fish and Cake)
    @foods=32
    
    # Vehicles items group. (Boat and Minecarts)
    @vehicles=32
    
    # Sign
    sign=64
    
    # Wooden Door and Iron Door
    wood_door=64
    iron_door=64
    
    # Wool
    wool=32
    
    # Empty bucket
    bucket=16
    
    # Storage Minecart and Powered Minecart
    storage_minecart=16
    powered_minecart=16
    

    Changelog:
    See changelog (open)
    Code:
    Stackable - Version 0.5.1
    ----------------------------
        * Build with Bukkit #681
        * Tested with CraftBukkit #766
        
        Minor features changes
        -----------------------
        * Armors is now the stacks group for armor-like items and will replace amors stacks group
        * Amors stacks group now is deprecated and will be remove permantly in the next version
        
        Bug fixes/development issues
        -----------------------------
        * Fix code for the new Bukkit version
        
        Know bug
        ---------
        * Double chest are not supported
        * When using a bucket on a triggerable block, both event are execute
        * Mushroom Soup: http://getsatisfaction.com/mojang/topics/no_bowl_from_mushroom_soup
    
    Stackable - Version 0.5
    ----------------------------
        * Build with Bukkit #652
        * Tested with CraftBukkit #670
        
        Major features changes
        -----------------------
        * Pickup event rebuilded
        * Chest inventory can be rebuilded by aiming it when using the /stackable command
        
        Minor features changes
        -----------------------
        * Add aliases /s and /stack for /stackable
        
        Bug fixes/development issues
        -----------------------------
        * Fix code for the new Bukkit version
        
        Know bug
        ---------
        * Double chest are not supported
        * When using a bucket on a triggerable block, both event are execute
        * Mushroom Soup: http://getsatisfaction.com/mojang/topics/no_bowl_from_mushroom_soup
    
    Stackable - Version 0.4.6
    ----------------------------
        * Build with Bukkit #417
        * Tested with CraftBukkit #455
        
        Bug fixes/development issues
        -----------------------------
        * Fix code for the new Bukkit version
        
        Know bug
        ---------
        * Mushroom Soup: http://getsatisfaction.com/mojang/topics/no_bowl_from_mushroom_soup
    
    Stackable - Version 0.4.5
    ----------------------------
        * Build with Bukkit #412
        * Tested with CraftBukkit #432
        
        Bug fixes/development issues
        -----------------------------
        * A lot of fix code for the new Bukkit version
        
        Know bug
        ---------
        * Mushroom Soup: http://getsatisfaction.com/mojang/topics/no_bowl_from_mushroom_soup
    
    Stackable - Version 0.4.4
    ----------------------------
        * Build with Bukkit #144
        * Tested with CraftBukkit #323
        
        Major features changes
        -----------------------
        * Added Stack Protection feature
        
        Minor features changes
        -----------------------
        * Switch to new onCommand method
        * Property enable-short-command is now unused
        
        Bug fixes/development issues
        -----------------------------
        * Fix code for the new Bukkit version
        
        Know bug
        ---------
        * Mushroom Soup: http://getsatisfaction.com/mojang/topics/no_bowl_from_mushroom_soup
        * Stack protection is sometime buggin
    
    Stackable - Version 0.4.3
    ----------------------------
        * Build with Bukkit #102
        * Tested with CraftBukkit #210
        
        Bug fixes/development issues
        -----------------------------
        * Fix code for the new Bukkit version
    
    Stackable - Version 0.4.2
    ----------------------------
        * Build with Bukkit #82
        * Tested with CraftBukkit #161
        
        Minor features changes
        -----------------------
        * Code design improved
        
        Bug fixes/development issues
        -----------------------------
        * Forgot to add bow to the weapon items group
    
    Stackable - Version 0.4.1
    ----------------------------
        * Build with Bukkit #71
        * Tested with CraftBukkit #135
        
        Bug fixes/development issues
        -----------------------------
        * Properly disable the plugin when initialization error occurred
        * Forgot to add fish to the food items group
    
    Stackable - Version 0.4
    ----------------------------
        * Build with Bukkit #68
        * Tested with CraftBukkit #128
        
        Major features changes
        -----------------------
        * Add five general items group
        * Sources now available.
        
        Minor features changes
        -----------------------
        * Default configuration file update
        * Javadoc added to all source files
        
        Bug fixes/development issues
        -----------------------------
        * Made damaged tools unestackable to avoid auto repared tools
        * MaterialData is now keep for Wools and Dyes
    
    Stackable - Version 0.3.1
    ----------------------------
        * Build with Bukkit #57
        * Tested with CraftBukkit #89
        
        Bug fixes/development issues
        -----------------------------
        * Forgot to update the default configuration file
    
    Stackable - Version 0.3
    ----------------------------
        * Build with Bukkit #57
        * Tested with CraftBukkit #89
        
        Major features changes
        -----------------------
        * Configuration file completely redesigned
        * Possibility to choose the stack size
        * Possibility to limit the stackability of already stackable item
        * Item groups removed
        
        Minor features changes
        -----------------------
        * Server log improved
        * Code design improved
        
        Bug fixes/development issues
        -----------------------------
        * Stability improved
    
    Stackable - Version 0.2
    ----------------------------
        * Build with Bukkit #56
        * Tested with CraftBukkit #86
        
        Major features changes
        -----------------------
        * Added configuration file 
        * Added groups of item stack
        
        Minor features changes
        -----------------------
        * Server log improved
    
    Stackable - Version 0.1
    ----------------------------
        * First release
        * Build with Bukkit #56
        * Tested with CraftBukkit #80
        
        Major features changes
        -----------------------
        * Added /stackable command
        * Sign, Wooden door and Iron door are now stackable

    Download Stackable Version 0.5.1 (zip)
    Download Stackable sources version 0.5.1
    Thanks to you for supporting my plugin ! ;P
     
    wassilij, Jef Elrod, harakiwi and 2 others like this.
  2. Offline

    Celtic Minstrel

    I think EvilSeph said that was an error and 670 was still supposed to be the recommended.
     
  3. Offline

    MisanthropX

    Oh, thanks for the information, I should click "Home" a few more times :>
     
  4. Offline

    Wall

    server log is full whit

    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 1}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 2}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 2}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 2}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 2}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 2}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 1}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 1}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 1}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 1}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 1}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 1}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 1}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 1}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 1}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 1}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 1}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 1}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 1}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 1}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 1}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 1}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 1}
    2011-04-14 11:16:38 [INFO] ItemStack{BONE x 1}
    2011-04-14 11:16:38 [INFO] ItemStack{STRING x 2}
    2011-04-14 11:16:38 [INFO] ItemStack{STRING x 2}
    2011-04-14 11:16:38 [INFO] ItemStack{STRING x 2}
    2011-04-14 11:16:38 [INFO] ItemStack{STRING x 2}
    2011-04-14 11:16:38 [INFO] ItemStack{STRING x 2}
    2011-04-14 11:16:38 [INFO] ItemStack{STRING x 2}

    whats up whit that?

    CB 670 and Stackable - Version 0.5
     
  5. Offline

    peaced

    Limiting the stack size is seems broken, as item are re-stackble over the limit with inventory drags
    Exemple : set stack limit for cobble to 5, mine 20, restack in inventory by dragin stack over.

    could this be eventualy fixed ?
    i want to simulate weight of ore by limiting stack size.
     
  6. Offline

    Celtic Minstrel

    I think he plans to fix it as soon as Bukkit lets him detect inventory drags. I've already implemented them, so it's just a matter of polishing (shouldn't take long) and then trying to convince the developers to pull (could take quite awhile).
     
  7. Offline

    peaced

    At least it's in motion, thanks for the info.
     
  8. Offline

    MisanthropX

    :( Still running into problems stacking golden records, is there any fix to come? or: does other people have the problem?
     
  9. Offline

    DjDCH

    What have you done to get this ? Have you enable the debug print ? Anyway, anything that's come from Stackable is prefixed with "Stackable:" ...

    Exactly. Many people have ask me this question. As soon Bukkit provide me the need tools, I will.

    I have just tested, and everything run fine for me. Can you show me your stackable.properties and list me the other plugins that you are using ? Have you try to run with only Stackable enable to see if the problem persist ?
     
  10. Offline

    Wall

    is was dropchest plugin :( woops :)
     
  11. Offline

    MisanthropX

    http://zerius.ze.ohost.de/test/ here is a video of how it actually stacks (or not)

    I used the "golden_record" (also tried "gold_record" to make sure that I am correct with the config)
    for the config; I tried both: just adding my terms or delete anything and just have the golden(or gold) record in the setting. writting it lower cased and upper cased. I tried all vartions to make sure I have the correct thing.

    I disabled (moved out of bukkit folder) all plugins to make sure I only have cookbook and stackable, even without cookbook and stackable as the only plugin running, it stacks in the weirdest way.
    the console out is pretty fine, it also noticed me that its not called "golden record, which is undefined"
    However, the config has no corruption then.


    another thing i noticed is that even if I limit it to 50, I can stack it up infinitive, (having it in the hand)
    putting the records in the inventory puts 64 to inventory and leaves the rest stacked in the hand. see screenshot

    http://dl.dropbox.com/u/13391025/screenshot_20110418171516.jpg
     
  12. Offline

    Celtic Minstrel

    I'm pretty sure that's a (currently) unavoidable side-effect related to records not being stackable by default. I suggest dropping single records outside the inventory window so that the pickup hook can stack them properly.
     
  13. Offline

    DjDCH

    What you have shown in the video is nothing abnormal. As I said a few post ago, I cannot control any inventory transaction, that allowed people to avoid the stackability define in the config file. In the future, when the proper event hook will be available, Stackable will be able to control all the way to stack and unstack an item. Then we will completely control the stackability of an item.

    For the moment, Stackable is a tool that allowed you to stack unstackable item, but not the opposite. (You can, but as you said, you cannot avoid every way to do it).

    @Celtic Minstrel and other interested devs or minecrafters:

    I'm questioning myself about the way that I will implement the inventory transaction when these hooks will be available. There will be a way to act immediately when merging a stack into an other that will react as we want ? It sure with inventory_open and inventory_close that I will able to do some clean up in the inventory to revert unwanted modification. But, will we be able to really fully control the stackability of any item, by removing all unwanted effect, as the max stack size that we define was this one in game ?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 6, 2016
  14. Offline

    MisanthropX

    :( thanks for your answer, I need to find an alternative way for this.
    We actually wanted to use golden records as currency,
    but with this problems, paying for items will be pretty difficult D:

    Thanks in advance for fixing that in the future
     
  15. Offline

    Celtic Minstrel

    In fact, catching the INVENTORY_OPEN hook is probably not suitable since it's not possible to detect when the player has opened their main inventory. Anyway, to answer your question... any click on a slot in an inventory window, or outside an open window, can be detected, and you will also be able to tell whether it was a left click or a right click.
     
  16. Offline

    SinForest

    Is it 733 compatible?
     
  17. Offline

    King_Koopa

    I am running 733 right now with this plugin and it is compatible. Though some things I noticed (not sure if they were intended this way or a bug with 733) are items such as raw porkchops cannot be stacked in inventory, but when picked up will start stacking. Raw porkchops fed to wolves seem to heal me, but I did not test this on a damaged wolf.
     
  18. Offline

    DjDCH

    It should work fine. If not, advise me !
     
  19. Well I used the command and nothing happend, also no errors.

    EDIT: pff, actually nvm, I was aiming at a chest... you should add a message saying that I've stacked something inside a chest xD
     
  20. Offline

    Lead2Life

    Hello
    I run Bukkit server on 733 version and I got Stackable v5.0
    Then It seems to be random that I got many failures in server caused by Stackable. It's like "Could not pass event PLAYER_PICKUP_ITEM to Stackable java.lang ....." and so on ( maybe someone can tell me how I can copy phrases produced by java console? sorry :p
    Uhm the crazy thing about it is that I don't get the error ingame. Because there nothing happens.. all is stacked and so on :confused:
    Maybe u can take a look onto this?
    Keep up your good work!
     
  21. Offline

    DjDCH

    Please, show me the complete server output.
     
  22. Offline

    Lead2Life

    Code:
    11:19:09 [SCHWERWIEGEND] Could not pass event PLAYER_PICKUP_ITEM to Stackable
    java.lang.IllegalArgumentException: Invalid inventory size; expected 36
            at org.bukkit.craftbukkit.inventory.CraftInventory.setContents(CraftInve
    ntory.java:46)
            at com.djdch.stackable.StackableInventory.loadInventory(StackableInvento
    ry.java:47)
            at com.djdch.stackable.StackableInventory.<init>(StackableInventory.java
    :40)
            at com.djdch.stackable.Stackable.addToInventory(Stackable.java:238)
            at com.djdch.stackable.StackablePlayerListener.onPlayerPickupItem(Stacka
    blePlayerListener.java:44)
            at org.bukkit.plugin.java.JavaPluginLoader$17.execute(JavaPluginLoader.j
    ava:302)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:59)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:257)
            at net.minecraft.server.EntityItem.b(EntityItem.java:203)
            at net.minecraft.server.EntityHuman.i(EntityHuman.java:212)
            at net.minecraft.server.EntityHuman.u(EntityHuman.java:204)
            at net.minecraft.server.EntityPlayer.u(EntityPlayer.java:203)
            at net.minecraft.server.EntityLiving.p_(EntityLiving.java:231)
            at net.minecraft.server.EntityHuman.p_(EntityHuman.java:90)
            at net.minecraft.server.EntityPlayer.a(EntityPlayer.java:160)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:272)
            at net.minecraft.server.Packet10Flying.a(SourceFile:126)
            at net.minecraft.server.NetworkManager.a(NetworkManager.java:195)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:370)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
     
  23. Offline

    NateBody

    I love this idea!

    but why isnt it possible to stack the items within the inventory?
     
  24. Offline

    DjDCH

    Very very strange. That should never happen. Can you tell me if that only happen with a specific user or anybody, every time or randomly, with a specific item stack or anything and a specific item size or anyone. If I can't figure out what is happening, I will need to create a specific output debug to know what's happening.

    The needed event hooks doesn't exist at this time. Once they will be implemented in Bukkit, that will be possible.
     
  25. Offline

    NateBody

    thanks for the reply!!

    i'll still use this plugin :)
     
  26. Offline

    Lead2Life

    I got that error with minecarts, bread, doors, signs, buckets and all items which aren't stackable normaly^^ and all players can cause it and the size doesn't matter
    This happens randomly! For expample: I have 6 stacked signs in my inventory and then I get a new one. Then Maybe I have 7 stacked signs in my inventory OR I have 6 stacked and 1 sign and that error is shown in console.
    So there isn't a high grade to delete the error cause you can just write /s^^
    Maybe it's just a bug in bukkit? I think it'll be deleted if bukkit got that "event hooks" which u told to NateBody and then the stacked items will be automatically stacked in inventory. Don't waste your time with that now :)
     
  27. Offline

    cidiantoby

    hey djdhc. i have been trying to get this plugin to change the stack values of blocks like dirt or cobblestone. Are you creating these item groups in the stacks.class file or are they being pulled from somewhere else. The reason is that im running 733 and im able to get the blocks go past 64 so if i could mine and make the stack size 256 that would be more efficient.
     
  28. Offline

    DjDCH

    Ok. From what you see, I still cannot figured out what is happening. This error is triggered because the plugin was ask to convert a player inventory that have not the normal size, which is 36. This should never happen. So, I will need to take a look to this.

    I have search about this. But, it seems that the stack size is block by Bukkit or the Minecraft code itself. So, no, it is not possible to stacking over 64.
     
  29. Offline

    Leemur

    This plugin stacked the 6 mushroom stews that i had, but when i clicked it (once) used all of them. Also, instead of giving me 6 wooden bowls back, it gave me just one.
     
  30. Offline

    xGhOsTkiLLeRx

    This is a bug from Minecraft, because you can't stack buckets and bowls normally...
    You have to unstack them before eating!

    Greets

    @DjDCH Possible to create a static download link (maybe with Dropbox) for
    CraftBukkitUpToDate?

    Would be great!
     
  31. Offline

    Nigel

    I notice earlyer the dev of this plugin stated it should work on 733 does this also apply to 740 and if so how error friendly is it atm as my hosting company removed it from there list becuase of crashes or somthing so If its better now I get them to add it again, also could he plugin heading reflect the confirmed tested bukkit version.
    thanks.

    P.s this seems to be the only plugin of its type i can find and i love the idear so thanks for your work in this area.
     

Share This Page