AutoCollect Plugin

Discussion in 'Plugin Requests' started by Trill, Jan 16, 2015.

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

    Trill

    Hello, I would like an AutoCollect plugin where a player types /autocollect or /ac to enable the AutoCollect. AutoCollect is when a player breaks a block and it is automatically sent to the Player's inventory(Including the exp if it was an ore). If the player chooses to get rid of it then he would type /autocollect or /ac again and it would drop items normally(including the exp).
    There shouldn't be any permissions used for this because I want to use it as a default player usage.

    When a player types the command to turn autocollect on, it sends the player the message:
    [​IMG]
    And when they type the command to turn it off it sends the same thing but with Disabling instead.

    P.S. if a player had no more space in their inventory and they break a block with AutoCollect on then it would send them a message saying "[AC] Your inventory is already full!"

    I hope that this plugin is easy to make and not too stressing :)!
     
  2. Offline

    Krizeh

    Yeah, it's pretty easy. I'll do this right now.
     
  3. Offline

    Trill

    Last edited: Jan 16, 2015
  4. Offline

    Krizeh

    @Trill

    Yeah, sorry that it took so long. I was fooling around with my signature.

    Messages can be customized in the config.yml
    Permission node is "autocollect.use" without the quotation marks.
    Download here.

    EDIT: Oooops, forgot to add that Inventory full thing. Give me a second c:
     
  5. Offline

    Trill

    @Krizeh
    Have you added the Inventory Full thing yet?
     
  6. Offline

    Krizeh

    @Trill

    Here is the updated link with the inventory full option.
    You can also customize this message.
    Download here.
     
  7. Offline

    Trill

    @Krizeh
    I found a problem with the plugin!

    @Krizeh
    A small failure on your part. When I break a coal ore it gives me the ore. And when I break stone it gives me stone instead of cobblestone. Make sure to set it to give the player the drops of the block instead of the block itself.

    EDIT by Timtower: merged posts
     
    Last edited by a moderator: Jan 16, 2015
  8. Offline

    Trill

    Can anyone else make the plugin?
    Krizeh said he will not work on it.
     
  9. Offline

    Trill

    Bump
     
  10. Offline

    Permeer

    Last edited: Feb 2, 2015
  11. Offline

    Trill

    @Permeer
    Could you please add a Config File for this as you wrote disabling "desabling"
    And also when a player joins the server and uses the plugin, this happens:
    http://gyazo.com/eea6a00ae5951e1a8fac09393efcfe2c

    EDIT: Also consider updating to 1.7.9 as most servers don't use 1.7.2
     
    Last edited: Jan 25, 2015
  12. Offline

    Permeer

    @Trill

    Added Configurable messages.
     
  13. Offline

    Trill

    @Permeer
    The plugin works fine with 1.7.9
    You don't need to update it if you think it would be a waste of time.
     
  14. Offline

    timtower Administrator Administrator Moderator

    @Trill Most plugins don't need to be updated that much, certainly when they are only using the API.
     
  15. Offline

    Trill

    @Permeer
    How's the plugin getting along?
     
  16. Offline

    Permeer

  17. Offline

    Trill

    Sorry.. I didn't know that you added that.

    @Permeer
    Thanks for fixing the other bugs!
    But now when AC is enabled, it just drops the blocks

    EDIT: Ok, the Enabling and Disabling were just switched around.. No problem

    @Permeer I have just found a bug with the plugin.
    When my inventory is full, instead of sending me a message in chat with colors; It just sends me a message that has all the symbols! Remember to enable color coding with: replace all(& with /u00A7)

    InvFull: http://gyazo.com/97ce6e791be7b48851f96d05ca7f6620

    It also doesn't send the InvFull message that I put in the config. Remember to take the messages from the config file!

    EDIT by Timtower: merged posts
     
    Last edited by a moderator: Feb 2, 2015
  18. Offline

    Permeer

    @Trill , sorry by late , i was having some issues with eclipse.

    Link updated ( See the information post )
    - Inventory Full check and error message fixed.
     
    Last edited: Feb 2, 2015
  19. Offline

    Trill

    @Permeer
    Thanks :)

    @Permeer
    Could you add fortune support to the plugin for: diamond ore, emerald ore, and coal ore?
    You can use this fortune checking code that I made, to simply your life:
    Code:
                if (block == Material.GOLD_ORE)
                {
                    event.setCancelled(true);
                    event.getBlock().setType(Material.AIR);
                    player.giveExp((int) 1.0);
                    if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 0)
                    {
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, 1));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 1)
                    {
                        Random ran = new Random();
                        int gold1 = ran.nextInt(2) + 1;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold1));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 2)
                    {
                        Random ran = new Random();
                        int gold2 = ran.nextInt(3) + 1;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold2));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 3)
                    {
                        Random ran = new Random();
                        int gold3 = ran.nextInt(4) + 1;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold3));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 4)
                    {
                        Random ran = new Random();
                        int gold4 = ran.nextInt(3) + 2;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold4));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 5)
                    {
                        Random ran = new Random();
                        int gold5 = ran.nextInt(5) + 1;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold5));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 6)
                    {
                        Random ran = new Random();
                        int gold6 = ran.nextInt(5) + 2;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold6));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 7)
                    {
                        Random ran = new Random();
                        int gold7 = ran.nextInt(7) + 2;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold7));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 8)
                    {
                        Random ran = new Random();
                        int gold8 = ran.nextInt(8) + 2;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold8));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 9)
                    {
                        Random ran = new Random();
                        int gold9 = ran.nextInt(8) + 3;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold9));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 10)
                    {
                        Random ran = new Random();
                        int gold10 = ran.nextInt(8) + 4;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold10));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 11)
                    {
                        Random ran = new Random();
                        int gold11 = ran.nextInt(8) + 5;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold11));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 12)
                    {
                        Random ran = new Random();
                        int gold12 = ran.nextInt(9) + 5;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold12));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 13)
                    {
                        Random ran = new Random();
                        int gold13 = ran.nextInt(8) + 6;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold13));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 14)
                    {
                        Random ran = new Random();
                        int gold14 = ran.nextInt(8) + 7;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold14));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 15)
                    {
                        Random ran = new Random();
                        int gold15 = ran.nextInt(12) + 7;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold15));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 16)
                    {
                        Random ran = new Random();
                        int gold16 = ran.nextInt(11) + 8;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold16));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 17)
                    {
                        Random ran = new Random();
                        int gold17 = ran.nextInt(10) + 9;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold17));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 18)
                    {
                        Random ran = new Random();
                        int gold18 = ran.nextInt(10) + 9;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold18));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 19)
                    {
                        Random ran = new Random();
                        int gold19 = ran.nextInt(10) + 10;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold19));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 20)
                    {
                        Random ran = new Random();
                        int gold20 = ran.nextInt(11) + 10;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold20));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 21)
                    {
                        Random ran = new Random();
                        int gold21 = ran.nextInt(11) + 10;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold21));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 22)
                    {
                        Random ran = new Random();
                        int gold22 = ran.nextInt(11) + 11;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold22));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 23)
                    {
                        Random ran = new Random();
                        int gold23 = ran.nextInt(13) + 11;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold23));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 24)
                    {
                        Random ran = new Random();
                        int gold24 = ran.nextInt(11) + 13;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold24));
                    } else if (player.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) == 25)
                    {
                        Random ran = new Random();
                        int gold25 = ran.nextInt(10) + 14;
                        player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, gold25));
                    }
                  
                }
    EDIT: Make sure that the fortune checking goes up to at least 25 like I posted! :)
     
    Last edited by a moderator: Feb 3, 2015
  20. Offline

    Trill

  21. Offline

    Trill

  22. Offline

    Trill

Thread Status:
Not open for further replies.

Share This Page