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

    Kevin Forte

    No need to be rude about it, I skimmed through the most recent posts and I must have missed that one.
     
  3. Offline

    Tobei

  4. Offline

    DjDCH

    No I haven't tested and it surely don't work anyway. I hope that I will have time to update before this week-end.
     
  5. Offline

    Bjourk

    Thanks. Looking forward to it!
     
  6. Offline

    Nytemare3701

    Request: Permission support, so items can change stackability per-group.
     
  7. Offline

    Celtic Minstrel

    I think that's something that's better to leave until CraftBukkit permissions are available, since it'll be a lot easier to do with them.
     
  8. Offline

    Driiper

    status on this plugin? when will it be updated?
     
  9. Offline

    JayDee85

    I believe he said he had hoped to update it before this weekend. But I'd guess soonish...
     
  10. Offline

    Leemur

    works, but with 1 error:
    "player item error"

    please fix if you can the bug with buckets
    (when you use stackable buckets on lava or on water your buckets became 1)

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

    harakiwi

    It "works" with some weird bugs

    Code:
    00:28:24 [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:514)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:216)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:94)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:72)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:215)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:202)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:142)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:257)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    
     
  12. Offline

    Kane

    @DjDCH how about a feature to remove stacked items or something. For example past bugs from other plugins has caused stack food. I find this badddd. How about an ability to remove it?
     
  13. Offline

    Leemur

    will be fine to add stackable in chests.
     
  14. Offline

    overlordror

    Thanks for this! I know notch made it so that food isn't stackable to keep people from exploring massive dungeons and cavern systems without any repercussions but the ability to take a 10 stack of food with you is an amazing one. Keep up the great work!
     
  15. Offline

    Tobei

    I miss this plugin...
     
  16. Offline

    teamdest

    Hey, until the OP gets an update out, I changed about 2 lines of code and got the plugin working again without any major issues. You're welcome to take it apart, and I'm more than happy to send you the source if you'd like, but I haven't uploaded it to git or anything.

    http://pbarletta.com/Stackable.jar

    please don't do anything weird to that, it's personal hosting, not much bandwidth.
     
  17. Offline

    MineralMC

  18. Offline

    DjDCH

    Ok everybody, I currently coding for update the plugin. Follow me on twitter to know where I am with the coding.

    Version 0.5 released

    Finally! The new version of this plugin is out! :p Firstly, this release fix the issues that appear with all the recent modification that was made to the bukkit code. Now, Stackable work with the latest recommended build (now 670). Secondly, I have added the alias /stack. Thirdly, the /stackable command (and also the aliases) work on chest. Only need to aim the chest and type the command. Fourthly, the Pickup event is now implemented. Any item stack that you will pickup will be added accordingly to the stack size define in the config file.

    I was thinking about some other feature to add tomorrow, but I have forget since I am too tired. I will surly remember. I have already known bug. Check in the ChangeLog. If you think about something that I have forgot, please tell me. So, have fun! :D

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

    Ben Quincy

    are there any nodes for permissions or no?
     
  20. Offline

    DjDCH

    No, not for the moment. As I don't see the needs of permission, I will wait until Bukkit embed its own permission. From what I know, it not done yet (but tell me if I am wrong).
     
  21. Offline

    Tobei

    Code:
    2011-04-09 18:39:59 [SEVERE] Could not pass event PLAYER_PICKUP_ITEM to Stackable
    java.lang.IllegalArgumentException: Invalid inventory size; expected 36
        at org.bukkit.craftbukkit.inventory.CraftInventory.setContents(CraftInventory.java:46)
        at com.djdch.stackable.StackableInventory.loadInventory(StackableInventory.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(StackablePlayerListener.java:44)
        at org.bukkit.plugin.java.JavaPluginLoader$16.execute(JavaPluginLoader.java:294)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
        at net.minecraft.server.EntityItem.b(EntityItem.java:204)
        at net.minecraft.server.EntityHuman.i(EntityHuman.java:204)
        at net.minecraft.server.EntityHuman.r(EntityHuman.java:196)
        at net.minecraft.server.EntityPlayer.r(EntityPlayer.java:199)
        at net.minecraft.server.EntityLiving.f_(EntityLiving.java:231)
        at net.minecraft.server.EntityHuman.f_(EntityHuman.java:90)
        at net.minecraft.server.EntityPlayer.a(EntityPlayer.java:156)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:230)
        at net.minecraft.server.Packet10Flying.a(SourceFile:126)
        at net.minecraft.server.NetworkManager.a(NetworkManager.java:198)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    Using Stackable 0.5 with CraftBukkit b670
     
  22. Offline

    KeTonic

    well i have one question about the tool stacking, you say you cant stack them all in one stack as them all will be damage. But why do this work in the original version of both craftbukkit and minecraft_server. Just spawn 64 of any tool, you will get one stack of 63 and one single tool. They can then be used as one stack in you hotbar without all of them getting damage from you using one.

    This also goes for minecarts, appels or anything else that should not be stackable.
    Why can´t you make use of this "glitch"?
     
  23. Offline

    DjDCH

    Strange. We are using the same version for both and I don't get this error. Are you getting this error for each item that you pickup or only some of it ? Also, can you tell me the other plugin (or mod ?) that you are using. Because, the error is caused by an invalid inventory size and this should never happen without any mod that edit the inventory size.

    Have you tested the latest version ? Because, you are describing me problem that I have fix in the latest version of Stackable. If you haven't tested yet, test it, and if you have tested it, re-explain me your issue/thought.
     
  24. Offline

    KeTonic

    Sorry if i was unclear, English is not my native language so bare with me =)

    I was just wondering about the fact that if you spawn, via the /give command, lets say 64 pickaxe and you will be given 63 in a stack and 1 by it self. If you put the stack of 63 in you hotbar (and just trow away the single one) you can use them without splitting the stack and they will not all take damage at the same time. This works for axes, shovel, swords, minecarts and appels, only problem is you can restack them if you mange to split any item.

    As from what i tested today Stackable will split the stack so you only have 1 in your hotbar and the rest in a stack in your bag, for tools atleast.

    So my question was, is there no way to use this glitch that is in the game already to keep tools in one stack all the time.
     
  25. Offline

    Celtic Minstrel

    I am pretty sure this is impossible.
     
  26. Offline

    MisanthropX

    Hi mister @DJDCH,
    I run into problems stacking gold and green records.. (we use them as currency and can be made out of gold and iron ingots - using cookbook)
    they are stackable up to 64 - even if i set that it should be only 50, it stacks up to 64.
    it has also a very weird behaviour.
    I can't explain correctly but they,, somehow stack, but when stacking, 1 record always leaves behin.
    e.g.: (imagine that they are green records)

    phase1:
    [diamond]x10[air][diamond]x20
    phase2:
    [diamond]x10->[air]<-[diamond]x20
    phase3:
    [diamond]x1[diamond]x38[diamond]x1
    phase4:
    [diamond]x1<-[diamond]x38[diamond]x1
    phase5:
    [diamond]x38<-[diamond]x1[diamond]x1

    I have no idea what I did wrong,
    I installid it how I were meant to and typed gold_record: and green_record (took value from enumeration list)
    they are stackable up to 64.

    Also another thing: are you able to stack more than 64?
    I once gave myself something 5000 times and it stacked up by giving the item :confused:
    Thanks a lot in advance! you do a great job here
     
  27. Offline

    KeTonic

    Well i just did it on my test server with no addons, plus minecraft original server. So yes it works, try it your self with the /give command. /give ketonic 277 64 in my case. As long you dont split the stack it will just tick down the numbers of shovels.

    As i said, english is not my native language so if i missed something or misunderstand it blame my english skills :p
     
  28. Offline

    Celtic Minstrel

    I just checked, and you appear to be correct. Maybe it's something Notch changed in 1.4, because I'm pretty sure the entire stack would disappear if you did that in 1.3.
     
  29. Offline

    KeTonic

    Well no its nothing new in 1.4, i was able to do that in 1.3 too. I have done like this since i started my own server witch was in 1.3 (lol, yes i am a newb).
     
  30. Offline

    DjDCH

    Strange. Which version of Stackable and Craftbukkit are you using ? Also, the "phases" that you describe me, are you getting this with the /stackable command or when pickingup an item ?

    In older version of minecraft (surely before 1.3, before beta I think), when you are using a stack of tool, that was damaging all the stack. It seams to have change now. But, since we still cannot split the stack without damaging the rest of the stack. The Stack Protection feature stay a good thing.
     
  31. Offline

    MisanthropX

    using craftbukkit 670, stackable: latest: 0.5

    I used cookbook to make records craftable, because I use them as currency.
    Cookbook works perfect, but when the 50 records are in my inventory, and I go to a lumberjack to get
    1 stack planks for 25 records: thats easy, just rightclicking 50 records to have half of them in the hand and drop them out of the inventory to give him the records.
    but if someone is giving me records, lets say 40, (25+40)I have 64 and 1 record then . A full stack, even if i have chosen 50 as max stackable for records :S

    I have chosen the correct name, tried it lowercased and uppercased written.

    I hope this will help you in any way, I try to experiment a bit more around today

    //EDIT: Just have seen that the latest recommended shrinked to 699 back
     

Share This Page