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

    Bjourk

  3. Offline

    DjDCH

  4. Offline

    Bjourk

    It seems your plugin still works.
     
  5. Offline

    AnrDaemon

    Except for "/s" alias conflict with Essentials (reported), no problem with CB531 so far.
    Is there any news about event hooks? :)
    Or in meantime, could you please make a change to don't rearrange inventory upon stacking (VERY annoying!! Please just use first item found to stack the rest to it) and don't use items on quickbar for stacking, unless they are normally stackable. (Less annoying, but still takes time to unstack single shovel to start digging mud)
     
  6. Offline

    enkryptor

    Any hope for an auto-renew feature, without "/s" command?
     
  7. Offline

    DjDCH

    I know that PLAYER_PICKUPITEM is already implemented, but not for the other hooks. I will try to implement the PLAYER_PICKUPITEM hook and add a way to stack item in a chest. About the quickbar, I will check if I can do something about this.

    What do you mean by auto-renew ?
     
  8. Offline

    enkryptor

    I mean re-arranging stacks functionality, which works now only via a command. It's reasonable to do this automatically, so users won't have to type any commands to get their signs stacked, for instance.
     
  9. Offline

    AnrDaemon

    Read first part of his last message.
     
  10. Offline

    DjDCH

    This plugin has been tested and is compatible with the latest build #556, but it also compatible with the build #455, #493 and #531. I hope it will soon removed from the inactive forum.

    Yes, but I need something to trigger this automatic rebuild. I cannot execute a function at each frame or each time you click a block, that would be insane.
     
  11. Offline

    enkryptor

  12. Offline

    Celtic Minstrel

    It triggers on dropping an item and on the player doing something (basically, on mouse-click). Neither of those are especially suitable here; the hooks needed would be picking up an item as well as hooks to inventory transactions. Though I think both of those might exist in the bleeding-edge builds.
     
  13. Offline

    DjDCH

    Hum, nice plugin. In this case, I can at least try to do something in that style.

    Yeah, I really need the inventory transactions hooks to automated the inventory rebuild process. But at least, with the item pickup event, it will be a good starting point. About the other place that we need to add a stackability possibility, there are some event for chest, workbench or furnace ?
     
  14. Offline

    Celtic Minstrel

    Chest, workbench, and furnace would I think require the inventory transaction hooks.
     
  15. Offline

    AudieMurphy

    Doesn't seem to be working for me. =/

    Changed the stack size for cobblestone in the properties file to 100, but they won't stack to 100 in the game. I've already used /stackable as well.

    And in the properties file I've tried using:

    cobblestone=100
    04=100
    4=100

    None of them work. I've even tried stacking wooden doors. No luck.
     
  16. Offline

    Joeyy

    How about everytime the player opens his inventory?
     
  17. Offline

    woodzy

    you should add a permissons node to this so that only lets say premium mebers can use it =:)
     
  18. Offline

    DjDCH

    You cannot go over 64.
     
  19. Offline

    Tobei

    'Stackable 0.4.6 is enabled' during server start.
    players can use /stackable, but when invoked it provides no output and instantly hides the console.

    Can't seem to get the signs to stack, unless my inventory is full in which case i pickup items directly to page 2
    of my inventory (BackPack plugin) which stacks (seemingly) everything when it places pickups to another page..

    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
    
    # Amors items group. (Helmets, Chestplates, Leggings and Boots)
    @amors=64
    
    # Foods items group. (Apple, Mushroom Soup, Bread, Raw Porkchop, Cooked Porkchop, Golden Apple, Raw Fish, Cooked Fish and Cake)
    @foods=1
    
    # Vehicles items group. (Boat and Minecarts)
    @vehicles=1
    
    # Sign
    sign=64
    
    # Wooden Door and Iron Door
    wood_door=64
    iron_door=64
    
    # Wool
    wool=64
    
    # Empty bucket
    bucket=16
    
    # Storage Minecart and Powered Minecart
    storage_minecart=1
    powered_minecart=1
    
    Oh, and shouldn't the item group for helmets, chestplates and leggings etc... be called @armors instead of @amors?
     
  20. Offline

    Celtic Minstrel

    I mentioned that a week or so ago. Apparently he hasn't fixed it yet.
     
  21. Offline

    Tobei

    I updated a bunch of my plugins and now /stackable works. It still gives no output and hides the console as soon as its typed, but it does what it is intended to. Thanks :)
     
  22. Offline

    KimaEri

    Anyone know if this works with build 531?
     
  23. Offline

    Tobei

    @KimaEri just updating craftbukkit to build 556, seems to work with (nearly) everything out there.
     
  24. Offline

    Ruinheart

    Great mod! just one suggestion, could you add a feature that you could disable/enable "usable when stacked" on items such as food? so you can store food easier but cant be cheap by healing with a single stack of pork chops.
     
  25. Offline

    Celtic Minstrel

    That'd actually be exceedingly simple, just a case of "if(player.getItemInHand().getAmount() > 1) { ... }".
     
  26. Offline

    KimaEri

    @Tobei I'm just worried I'll have to update everything I currently use on the server. Trying not to do that so often.
     
  27. Offline

    NotoriousPyro

    This is broken in build 602:
    Code:
    2011-03-30 13:48:55 [SEVERE] PLAYER_ITEM loading Stackable v0.4.6 (Is it up to date?)
    java.lang.NoSuchFieldError: PLAYER_ITEM
        at com.djdch.stackable.Stackable.onEnable(Stackable.java:89)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:511)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:216)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:93)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:71)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
     
  28. Offline

    KimaEri

    Using build 531.
    /s wasn't working for me, possibly because I have Essentials?
    I also seem to not be able to add other items to be stacked like Lapis Lazuli.
     
  29. Offline

    Celtic Minstrel

    For Lapis Lazuli, that's probably because it has the same ID as ink sack. You could however set the stack size for ink sack and (I assume) it would also apply to lapis lazuli.
     
  30. Offline

    Kevin Forte

    Hate to ask, but has this been tested on 600+? :)
     
  31. Offline

    NotoriousPyro

Share This Page