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

    Gimmic

    Might want to add fish/cooked fish to the food group.
    Testing doing them by item ID on next server reboot.

    edit: doing them by name worked fine, etc: raw_fish=64

    A suggestion for feature-add would be to make smelting function properly. Currently you can toss a pile of food onto the oven, but it will not stack the cooked items. You have to pull the cooked item out of the slot for it to start cooking the next one on the stack.
     
  3. Offline

    DjDCH

    Version 0.4.1 released

    Small update, no big change. Only add the raw fish and the cooked fish to the food items group, since I forgot to add it. Thanks to Gimmic.

    Unless the proper event hooks has been implement without I notice it, this will be added when the hooks will be added.
     
  4. Offline

    Bradley-san

    Interesting to note that if you take something that is only meant to be a stack of say, 8, and drag it onto another stack of the same item the stacks will still add and go above what you set as the stack limit. Did it with apples, they were limited to a stack of 8 but still could be manually stacked to 64 using the stated method.

    Not sure if it is a bug, but I figured I'd throw it out there anyway. Awesome plug in.
     
  5. Offline

    Seth.D

    I think you forgot to add Flint and Steel to the tools group.
     
  6. Offline

    Ray

    Flint and steel can already be stacked up to 64 by default. You dont need this tool for these ;P
     
  7. Offline

    DjDCH

    Not a bug. It's just not implemented yet. I need specific event hooks that bukkit have not implemented. But, as soon as bukkit release these hooks, I will work to completely automatize the process, so you wont need anymore to manualy send a command to the server.

    That's not a mistake, it's intentional. Flint and steel is a special tool, and also a source of griefing, so I don't include it in the tool item group.

    Stackable will be able in his final version to also reduce the stackability of a already stackable item. So, if you set a stack size for the flint and steel, is not for a bigger stack, but for a more lower stack size.
     
  8. Offline

    Bilbo_248

    Great idea !

    Need stackable easy option for standard material !
     
  9. Offline

    jswill

    it would be great to have the option of how many stacks of each item you can have in your inventory,
    and limits per stack of over 64.

    but great plugin nonetheless!
     
  10. Offline

    DjDCH

    Version 0.4.2 released

    I forgot to add the bow to the weapon item group. I have also re-design the classes name. So, this is a small update.

    Likewise, I have made a new plugin call HiddenDoor if you want to take a look. ;)

    The default configuration is the easy options. :p

    This is not the purpose of this plugin. And I don't see why we would want to limit the number of stack of a specific item.
     
  11. Offline

    Cool12309

    If this hasn't been asked before/isn't in this already:

    Can we have snowball stack config?
     
  12. Offline

    DjDCH

    Code:
    # For stack of 64 snow ball:
    snow_ball=64
    # or:
    332=64
    Simple as that ! ;)
     
  13. Offline

    Badzilla

    I'm running CraftBucket 186 and Stackable seems to be broken.
    Console message follows:

    2011-02-01 11:49:22 [INFO] Badzilla issued server command: stackable
    Feb 1, 2011 11:49:22 AM org.bukkit.plugin.SimplePluginManager callEvent
    SEVERE: Could not pass event PLAYER_COMMAND to Stackable
    java.lang.NoSuchMethodError: org.bukkit.inventory.ItemStack.getDamage()B
    at com.djdch.bukkit.stackable.StackablePlayerListener.rebuildStacks(Stac
    kablePlayerListener.java:135)
    at com.djdch.bukkit.stackable.StackablePlayerListener.onPlayerCommand(St
    ackablePlayerListener.java:62)
    at org.bukkit.plugin.java.JavaPluginLoader$3.execute(JavaPluginLoader.ja
    va:133)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:60)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:213)
    at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:590)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:563)
    at net.minecraft.server.Packet3Chat.a(SourceFile:24)
    at net.minecraft.server.NetworkManager.a(SourceFile:232)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:71)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:104)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:276)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:202)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    2011-02-01 11:49:22 [INFO] Badzilla issued server command: stackable
     
  14. Offline

    DjDCH

    I will try to take a look today. Thanks for reporting.
     
  15. Offline

    Sansai86

    also broke atm. in CB #202. [​IMG]
     
  16. Offline

    DjDCH

    Version 0.4.3 released

    Fix code for the new Bukkit/Craftbukkit version. Work with Craftbukkit build 210.
     
  17. Offline

    DeNarr

    So what happens when you try to use a stacked item? For instance, filling a stack of 16 buckets with water? Or using a stack of 5 swords? Would they all get damaged?
     
  18. Offline

    Soul Reaper

    for some reason I can't make signs stackable or weapons on 238
     
  19. Offline

    DjDCH

    Since what you tell here is a bug, I am currently working on a solution. There are many things to monitor for ensure to not miss that any of these situation. I hope I will release soon the patch.

    I tested and I don't see any problems.
     
  20. Offline

    Sansai86

    dont really understand that "Implement all event hooks" is that going to make things stackable without the command? [​IMG]
     
  21. Offline

    Ray

    Yes - thats how it should worked when these hocks, requiered for this plugin, are implemented :)
     
  22. Offline

    DjDCH

    I hope so. But, no guarantee.
     
  23. Offline

    Sansai86

    arh ok, that would be really nice :)
    --- merged: Feb 7, 2011 4:09 PM ---
    This stopped working @ CraftBukkit #271 : No error log, its simply dosent respond.
     
  24. Offline

    DjDCH

    All is working fine for me. Have you try both commands ?
     
  25. Offline

    Daveyo

    i hate to say this man, but other mods already have the /stack command and it works like a charm. What would really make this stand apart is stacking without using /s. I mean, that would take this addon on from "oh" to "Get on my level son."
     
  26. Offline

    DjDCH

    Just read what we said above. The needed hooks are not implemented yet. So I cannot do this. But, I want to. So, wait. And notice that my plugin provide you the ability to entirely configure which item is stackable and which is not. When bukkit will be finish, this plugin would be awesome. I hope. :D
     
  27. Offline

    Daveyo

    sounds good, yes it does have that as increased functionality.
     
  28. Offline

    DeNarr

    I didn't even know those were current bugs, I was just listing some of the obvious problems that I could see needing to be overcome for this type of mod. Do you know when you plan on releasing a patch to fix it?
     
  29. Offline

    DjDCH

    I currently have problems with the onEntityDamageByEntity hook (it doesn't get triggered). Since this is not stopping the plugin from working, it not urgent to release this patch. So, i will take time to check and correctly finish that, and after I release a new version.
     
  30. Offline

    bdot

    Not functioning on CB290+.

    /stackable does nothing, aside from moving items into players quickbar if there are empty slots (but not stacked)
    /s throws "Invalid command syntax. Did you forget an argument?"

    Edit: /s seems to be conflicting with another plugin I have that uses that alias. /stackable still doesn't work though.

    neither give errors or feedback in console.
     
  31. Offline

    DjDCH

    What you're telling me here prove me that stackable work correctly. I think you have simply forgot to configure the plugin. Check the stackable.properties in the stackable directory (in the plugins directory).

    Exactly. I don't know which plugin, so check all your installed plugins to determinate which one is conflicting. I'm interesting to know the plugin who have set the same command.
     

Share This Page