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

    You're wrong.
     
  3. Offline

    van_Grunz

    Very nice tool!

    Runs even with CB 1000.

    I have some bug reports:
    - Making shears stackable causes damage to the whole stack when used. Is it possible to protect them by splitting, like tools?
    - If all places except one in inventory is full and you continue to collect e.g. snowballs which are set to 64, they are only collected to the default of 16. While standing on snowballs and just take something in the inventory in the hand (and put it back without change) it collects again till the desired stack size.
    - Is it possible to make Stackable work while moving things in inventory (or even chests) around? The normal stack sizes are there taken, too. To stack again, the /s command must be used or the things thrown away for recollection. This would make Stackable nearly perfect.;)
    - When putting one stack of 64 snowballs to another stack of 64 snowballs, you have 127 snowballs in your hand and one left in the slot you've clicked in. You can have an even greater amount in your hand if you keep repeating this procedure.

    Will there be an advance to the actual CraftBukkit version?

    Besides, the debug mode was helpful to me. Nice job!

    Thanks in advance!:)
     
  4. Offline

    Celtic Minstrel

    It was my impression that if you were to continue to use the tool until it broke, it would reset the damage count and decrement the amount. At least, I recall that happening with fishing rods before he made them unstackable.

    In other words, it's like saying that the damaged one is only the top of the stack and all the rest are undamaged.


    Splitting the stack on the other hand may result in two damaged stacks. I don't think I tried that.
     
  5. Offline

    dominichello

    I am completely un-able to Add my own configured stack amounts to the config file. No matter what combination of using Items names OR Id# neither seems to work. My config looks like :

    Show Spoiler
    # Enable debug print in game
    enable-debug-print=false

    # Tools items group. (Shovels, Pickaxes, Axes, Hoes and Fishing Rod)
    @tools=10

    # 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

    # Blocks items group. (Cobblestone)
    @blocks=63

    # Cobblestone
    cobblestone=100

    # WOOD
    wood=100


    Im not sure whether the name is meant to be in caps or not or if it even makes a difference.

    I tried making that "block" group line as well but that didn't seem to help with the issue either :/ (the "63" was just a testing number...my real goal is to stack above 64, Potentially 200 a stack but i'm not sure MC can even handle above 64?)

    I'm running Bk1000
    Something worth noting i have Essentials installed as well and so /stack conflicts and doesn't work...i have to use /stackable
     
  6. Offline

    van_Grunz

    Here's the part of my config file which I created from the guidance of the initial post; This one allows me to configure EACH item in MC:

    Show Spoiler

    STONE=64
    GRASS=64
    DIRT=64
    COBBLESTONE=64
    WOOD=64
    SAPLING=64
    BEDROCK=64
    WATER=64
    STATIONARY_WATER=64
    LAVA=64
    STATIONARY_LAVA=64
    SAND=64
    GRAVEL=64
    GOLD_ORE=64
    IRON_ORE=64
    COAL_ORE=64
    LOG=64
    LEAVES=64
    SPONGE=64
    GLASS=64
    LAPIS_ORE=64
    LAPIS_BLOCK=64
    DISPENSER=64
    SANDSTONE=64
    NOTE_BLOCK=64
    BED_BLOCK=64
    POWERED_RAIL=64
    DETECTOR_RAIL=64
    PISTON_STICKY_BASE=64
    WEB=64
    LONG_GRASS=64
    DEAD_BUSH=64
    PISTON_BASE=64
    PISTON_EXTENSION=64
    WOOL=64
    PISTON_MOVING_PIECE=64
    YELLOW_FLOWER=64
    RED_ROSE=64
    BROWN_MUSHROOM=64
    RED_MUSHROOM=64
    GOLD_BLOCK=64
    IRON_BLOCK=64
    DOUBLE_STEP=64
    STEP=64
    BRICK=64
    TNT=64
    BOOKSHELF=64
    MOSSY_COBBLESTONE=64
    OBSIDIAN=64
    TORCH=64
    FIRE=64
    MOB_SPAWNER=64
    WOOD_STAIRS=64
    CHEST=64
    REDSTONE_WIRE=64
    DIAMOND_ORE=64
    DIAMOND_BLOCK=64
    WORKBENCH=64
    CROPS=64
    SOIL=64
    FURNACE=64
    BURNING_FURNACE=64
    SIGN_POST=64
    WOODEN_DOOR=64
    LADDER=64
    RAILS=64
    COBBLESTONE_STAIRS=64
    WALL_SIGN=64
    LEVER=64
    STONE_PLATE=64
    IRON_DOOR_BLOCK=64
    WOOD_PLATE=64
    REDSTONE_ORE=64
    GLOWING_REDSTONE_ORE=64
    REDSTONE_TORCH_OFF=64
    REDSTONE_TORCH_ON=64
    STONE_BUTTON=64
    SNOW=64
    ICE=64
    SNOW_BLOCK=64
    CACTUS=64
    CLAY=64
    SUGAR_CANE_BLOCK=64
    JUKEBOX=64
    FENCE=64
    PUMPKIN=64
    NETHERRACK=64
    SOUL_SAND=64
    GLOWSTONE=64
    PORTAL=64
    JACK_O_LANTERN=64
    CAKE_BLOCK=64
    DIODE_BLOCK_OFF=64
    DIODE_BLOCK_ON=64
    LOCKED_CHEST=64
    TRAP_DOOR=64
    IRON_SPADE=64
    IRON_PICKAXE=64
    IRON_AXE=64
    FLINT_AND_STEEL=64
    APPLE=64
    BOW=64
    ARROW=64
    COAL=64
    DIAMOND=64
    IRON_INGOT=64
    GOLD_INGOT=64
    IRON_SWORD=64
    WOOD_SWORD=64
    WOOD_SPADE=64
    WOOD_PICKAXE=64
    WOOD_AXE=64
    STONE_SWORD=64
    STONE_SPADE=64
    STONE_PICKAXE=64
    STONE_AXE=64
    DIAMOND_SWORD=64
    DIAMOND_SPADE=64
    DIAMOND_PICKAXE=64
    DIAMOND_AXE=64
    STICK=64
    BOWL=64
    MUSHROOM_SOUP=64
    GOLD_SWORD=64
    GOLD_SPADE=64
    GOLD_PICKAXE=64
    GOLD_AXE=64
    STRING=64
    FEATHER=64
    SULPHUR=64
    WOOD_HOE=64
    STONE_HOE=64
    IRON_HOE=64
    DIAMOND_HOE=64
    GOLD_HOE=64
    SEEDS=64
    WHEAT=64
    BREAD=64
    LEATHER_HELMET=64
    LEATHER_CHESTPLATE=64
    LEATHER_LEGGINGS=64
    LEATHER_BOOTS=64
    CHAINMAIL_HELMET=64
    CHAINMAIL_CHESTPLATE=64
    CHAINMAIL_LEGGINGS=64
    CHAINMAIL_BOOTS=64
    IRON_HELMET=64
    IRON_CHESTPLATE=64
    IRON_LEGGINGS=64
    IRON_BOOTS=64
    DIAMOND_HELMET=64
    DIAMOND_CHESTPLATE=64
    DIAMOND_LEGGINGS=64
    DIAMOND_BOOTS=64
    GOLD_HELMET=64
    GOLD_CHESTPLATE=64
    GOLD_LEGGINGS=64
    GOLD_BOOTS=64
    FLINT=64
    PORK=64
    GRILLED_PORK=64
    PAINTING=64
    GOLDEN_APPLE=64
    SIGN=64
    WOOD_DOOR=64
    BUCKET=64
    WATER_BUCKET=64
    LAVA_BUCKET=64
    MINECART=64
    SADDLE=64
    IRON_DOOR=64
    REDSTONE=64
    SNOW_BALL=64
    BOAT=64
    LEATHER=64
    MILK_BUCKET=64
    CLAY_BRICK=64
    CLAY_BALL=64
    SUGAR_CANEv
    PAPER=64
    BOOK=64
    SLIME_BALL=64
    STORAGE_MINECART=64
    POWERED_MINECART=64
    EGG=64
    COMPASS=64
    FISHING_ROD=64
    WATCH=64
    GLOWSTONE_DUST=64
    RAW_FISH=64
    COOKED_FISH=64
    INK_SACK=64
    BONE=64
    SUGAR=64
    CAKE=64
    BED=64
    DIODE=64
    COOKIE=64
    MAP=64
    SHEARS=64
    GOLD_RECORD=64
    GREEN_RECORD=64


    All other (origin) entries in the config file are commented out. I don't know whether groups and single items agree with each other.

    Maybe you should set the value to a valid number. By default, Stacks larger 64 are not supported by MC (possibly create infinite stacks?). Just like I wrote: Taking two 64 stacks one after the other in the hand while in inventory screen makes temporarily 127 items held in the hand, but not placeable. This is caused by stackable while a bug (?) in MC doesn't let interact stacks of the same type with each other, e.g. two pickaxes having different durabilities. This behaviour is also documented in MinecraftWiki.

    Ah, it was my fault. There's a problem with entities while using tools on them (I'm sorry I didn't have this in mind). Actually, I have no other ideas except watching such stacks chaging durability from FULL to FULL-1 (and then implement stack protection) which may work with ANY tool.

    In the other hand, your method doesn't work with AutoRepair. If the autorepair feature is enabled, the tool will be restored until your thought way will be able to strike (I don't think AutoRepair ever considered stacked tools), manual repair of course dito, saving the whole stack. It's only possible to combine both ways with disabled AutoRepair feature.
    Als long as AutoRepair is cost-free, this is no problem at all, just a cosmetic issue. On the other hand do many people like economy in Minecraft.

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

    dominichello

    Thnkx Van_Grunz :) seems a shame u cant stack more than 64..ive got a double chest full of cobblestone that id love to put into 1 stack :)
     
  8. Offline

    Celtic Minstrel

    Should actually be possible to have any stack size less than 128.
     
  9. Offline

    bartbergmans

    Can you make permissions support? I only want it available for the VIP group.
     
  10. Offline

    FuturaEX

    it's not working for me....

    EDIT: can i use this with RB 1000 ?
     
  11. Offline

    Clucky

    Sometimes when you eat one apple, you eats all of them. Is this a bug with RB 1000?
     
  12. Offline

    MafyaKingpin

    For some reason I am not finding the .jar file in the zip... ?
     
  13. Offline

    peng_bears

    found a dupe bug with arrows

    I used the config to specify each item individually and made arrows 64 and it created an arrow duping bug.

    Will try a config that only specifies normally nonstackable items like signs and use that instead and will report if there is still the dupe bug.

    Edit: Redid the config only specifying what we wanted to be different than the natural stacking and it worked fine no more dupe bug. May be something about having arrow=64 in the config that caused it.
     
  14. Offline

    Brazzled

    I have a question. If I was to have 5 low/used durability swords, e.g. I have used at least once, and I have 1 brand new sword. If I stack all 6 swords, will they all become full durability? If this is a YES, is there a way so you can only stack new items. If it is a NO, then yay!
     
  15. Offline

    van_Grunz

    You can only stack tools with the same durability (can be found out with several server- and client-sided extensions). But yes, it is possible to use stackable tools for infinite usage. You only need to stack used tools with exactly the same durability at a minimum of two tools and exchange it with a new/full repaired tool in your inventory with a single left click -- that's it. Works even with golden tools, tested by myself.

    Due to this, some admins do disable stackable tools on their servers.
    Note that this is not a bug of Stackable. If you make (somehow) tool stacks, you can vice versa exchange a brand new 64'er stack with a nearly broken tool. As a result, you get 64 nearly broken tools and one new.

    Shears are an exception: They are currently used in a stack, so all Shears in that stack get used up.
     
  16. Offline

    exirem

    hey epic plugin but i got a question, is it possible to make it like u just drag the food over the other food and i will stack couse i dont like that you need to write /stackable or something like that
     
  17. Offline

    0xDEADMEAT

    idk if anyone has noticed, but all items that dont normally stack dont make a sound when picked up, while normally stackable items make the sound. Is this just a bug?
     
  18. Offline

    sfxworks

    ...is it still compatible?
     
  19. Offline

    Monkah

    How about permissions support?
     
  20. Offline

    Teletupiekiller

    here are the the /stack permission

    - 'worldguard.stack'
     
  21. Offline

    Celtic Minstrel

    That's in WorldGuard, not Stackable.
     
  22. Offline

    noneandnonly

    It was a really great plugin and very helpful, did a great job and is still working for me (even on RB 1060), but the time has come that food will be stackable by itself with update 1.8. Some might still need this plugin, but I think the developer stopped somewhere in the beginning of 2011.​
    People might still need it for signs, doors or whatever, but I'll not use this anymore and just send a big THANKS to the plugin developer, because that was some great work and is still working for me (shortly before 1.8).​
    Thanks a lot again and I hope you have a great time and maybe update this whenever.​
    See ya and I hope you're just fine at the moment,​
    NoNe aNd NoNly.​
     
  23. Offline

    bluehasia

    i got 1060 and does not work right..i got cooked porkchop to stack but that was it and it only stacked once up to 27 and not 32
     
  24. Offline

    G1R Productions

    Can someone please update this plugin, if it doesn't work. Also would this work for a modd'd items.
     
  25. Offline

    someguy817

    in your plugins/Stackable/stackable.properties
    # Storage Minecart and Powered Minecart
    storage_minecart=64
    powered_minecart=64

    add this in the plugin/stackable/stackable.properties file
    # Storage Minecart and Powered Minecart
    storage_minecart=64
    powered_minecart=64
    furnace=64
    chest=64

    add this in the plugin/stackable/stackable.properties file

    # Storage Minecart and Powered Minecart
    storage_minecart=64
    powered_minecart=64
    arrows=64

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

    Celtic Minstrel

    Wrong. That's not what he was talking about at all.
     
  27. Offline

    Darq

    Ohh boy. Handy for creative servers that get annoyed with having items stack in their inventory when stacks are infinite anyway. I'll try this and see what happens after setting everything to 1.

    Edit: Not only does it not work right; (you can still grab stacks of 64, just no pick up more than set) but it doesn't have all the blocks. Though I was just looking through the source and it's damn easy to add the blocks.
     
  28. Offline

    ibreaktoucher

    the link with the names is broken!! can you tell me the name of an water bucket?
     
  29. Offline

    Celtic Minstrel

    water_bucket probably?
     
  30. Offline

    Bjourk

    Any hope of revival?
     
  31. Offline

    Celtic Minstrel

    Maybe when the inventory hooks are finally implemented?
     

Share This Page