BiggerMaxStacks

Discussion in 'Plugin Requests' started by ChavitaHD, Dec 31, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    ChavitaHD

    Plugin Name: BiggerStacks
    Usable for everyone: Yes
    What must it do: Make the MaxStackSize to 120 blocks in a stack. Work with the plugin http://dev.bukkit.org/bukkit-plugins/autopickup/

    Commands: None

    Permissions: None

    <Edit by mrCookieSlime: Removed Skype and paid resource.>
     
    Last edited by a moderator: Dec 31, 2014
  2. Offline

    pie_flavor

    Ain't possible. Minecraft client code says that items can only be up to 64 stacks. If someone can do this while retaining the little white number and not fooling around with metadata and lore, I will personally send them flowers.
     
  3. Offline

    BrentHogeling

    @ChavitaHD Well, @pie_flavor was kind of right, by default the max is 64 and you can't pick up anymore then that a stack, doesn't mean you can't give players more then 64 by using code, but naturally you can't set it so players will pick up items even if they have 64, sorry.
     
  4. Offline

    drpk

    @ChavitaHD they may be using a modified version of craftbukkit.
     
  5. @BrentHogeling It may be possible by just setting a itemstack to 128, never tried it before. I think I will though, I will edit my post with my findings.
     
  6. Offline

    BrentHogeling

    @bwfcwalshy He wants everything to default, so when you pick up an item it will stack beyond 64. Edit. I didn't realize exactly what he was asking for, if you are setting items constantly in an inventory then yes, more then possible, but to work with the plugin will it need a re-write? :p
     
  7. Offline

    ChavitaHD

    Also my server just freezes and says TIME OUT and then 30 seconds later it says the server is up its like the server cant handel it self and then stops for a second and then continues. Here is my log. - http://hastebin.com/mezobokoju.hs
     
  8. Offline

    5chris100

    For anyone who wants to do this:

    Code:
    @EventHandler(priority = EventPriority.LOWEST) // So it detects it ASAP
    public void onPickup(PlayerPickupItemEvent e) {
        // Don't want to be modifying the item if it was cancelled in the first place ;)if (e.isCancelled()) return;
        ItemStack itemPickedUp = e.getItem().getItemStack();
        int pickedUpAmt = itemPickedUp.getAmount();
        Player p = e.getPlayer();
        if (!(p.getInventory().contains(itemPickedUp))) return; // The inventory doesn't have the item already, so it can be naturally dropped.
    
        // The inventory has the item already, so let's add to it!
        int invPosition = 0;
        for (ItemStack item : p.getInventory().getContents())
            if (item.getType() == itemPickedUp.getType()) break;
            else invPosition++;
        int invItemAmt = p.getInventory().getItem(invPosition).getAmount();
        // Make sure that the amount doesn't go over 120!
        int overflow = ((pickedUpAmt + invItemAmt <= 120) ? 0 : ((pickedUpAmt + invItemAmt) - 120));
        itemPickedUp.setAmount((pickedUpAmt + invItemAmt > 120) ? 120 : (pickedUpAmt + invItemAmt));
        p.getInventory().setItem(invPosition, itemPickedUp);
        if (overflow != 0) { // The combined amount was more than 120!
            if (p.getInventory().firstEmpty() >= 0)
                p.getInventory().setItem(p.getInventory().firstEmpty(), new ItemStack(itemPickedUp.getType(), overflow)); // The inventory has an empty slot, so let's put the item in there!
            else p.getWorld().dropItemNaturally(e.getItem().getLocation(), new ItemStack(itemPickedUp.getType(), overflow)); // The inventory doesn't have an empty slot, so let's drop the remains where the original location was.
        }
    }
    EDIT: I have no clue if this is compatible with OP's requested plugin. This was just from memory and with the JavaDocs, so if someone can confirm if it does or not, that'd be great. ;)
     
  9. Offline

    ChavitaHD

    How would i get this done?
     
  10. Offline

    5chris100

    You can have a Java developer create it. Would you like me to do it? I suppose I have some free time now, so I can just copy-paste it.
     
  11. Offline

    ChavitaHD

    if you can that would be awesome also can you make it work with the plugin http://dev.bukkit.org/bukkit-plugins/autopickup/
     
  12. Offline

    5chris100

    I'll have it finished in a moment.
    What exactly do you mean by that?
     
  13. Offline

    ChavitaHD

    I use http://dev.bukkit.org/bukkit-plugins/autopickup/ for my fortune blocks and for blocks to be automatically picked up and put into players inventory's.

    If possible can you make it so the plugin your making me can automatically place blocks that are broken into the players inventory and if you can fortune on certain blocks. If you don't want to that OK, but i need this plugin to work with the plugin i mentioned. I need the blocks to go into the players inventory's.
     
  14. Offline

    5chris100

    I'll try my best to.
     
  15. Offline

    ChavitaHD

    Hey man thanks for the help but i need more help :/
    What does this mean INFO Lag Notice - Slow Economy Response - Request took over 38.891ms!
    I have my iConomy on a MySQL ran from my host.
     
  16. Offline

    5chris100

    Well, considering iConomy is almost 3 years old, I would recommend using a newer economy system. I've been thinking about creating one, so you could use that if you want. I have no idea when it would be finished, though, so you may want to use another for the time being. EssentialsEconomy is well-built, so I would recommend that.
     
  17. Offline

    ChavitaHD

    Can you have the plugin done by tonight?
     
Thread Status:
Not open for further replies.

Share This Page