Inactive [FUN] Salvage V 1.2 - Salvage tools/armour into their raw components [1.2.5-R5.0]

Discussion in 'Inactive/Unsupported Plugins' started by JeroenV, Jul 29, 2012.

  1. Offline


    Salvage - For people with too many armour pieces or tools:
    Version: v1.2

    The Salvage plugin is very easy to use. It salvages any tool/armour ranging from wood to diamond into its raw components.
    All you have to do is hold the item in your hand and type /Salvage. The plugin takes damage into account, it gives you the amount of items based on the amount of Durability it has left.

    You can also use /SalvageAll wich automatically dismantles all the tools/armour you have in your inventory.

    • Dismantles items/armour into its raw components.
    • Option to dismantle all the items/armour in your inventory.
    • Commands:


    • Version 1.2
    I worked out all the bugs and improved the slot searching methods. I also added a message saying what item you salvaged as requested my UltraMC. I tried to do the suggestion of StevenSaurus, but after 5 hours of trail and error I had to give up. It eventually kept throwing up errors of the PlayerInteract event and I couldnd find out what the actual problem was. So sorry stevensaurus. I hope you enjoy version 1.2!
    • Version 1.1
    I worked out all the bugs and made an improved version of the items on durability system and even implemented it for the /salvageall command to avoid people cheating. Next on the list is working on the bugs/suggestions that people might send in.

    • Version 1.0
    I added the /dismantle all feature before releasing it to the public.Due to the plugin just beeing up there isn't much to note here, if you do find bugs please pm me and I'll fix them asap.Suggestions are also always welcome!​
  2. Offline


    Make it /dismantle AND /salvage please :)
  3. Offline


    I highly suggest not using it untill I get all the bugs out of the plugin. I thought I did a very clean search through everything before releasing but it seems there are still some bugs. I'm going to harden them out first.

    I'm sorry for the inconvience.

    It will most likely only take a few minutes.

    And just because I will also improve it in the meantime making the amounts of raw components change directly from the percentage, so at 80% 10 diamonds would become 8.
  4. Offline


    It does not load with the server. /plugman load Salvage outputs error, it gives no error or any output at server start:
    plugman load Salvage
    21:59:16 [WARNING] Unexpected exception while parsing console command
    org.bukkit.command.CommandException: Unhandled exception executing command 'plugman' in plugin PlugMan v1.6.8
            at org.bukkit.command.PluginCommand.execute(
            at org.bukkit.command.SimpleCommandMap.dispatch(
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(
            at org.bukkit.craftbukkit.CraftServer.dispatchServerCommand(
            at net.minecraft.server.MinecraftServer.b(
            at net.minecraft.server.MinecraftServer.w(
    Caused by: java.lang.NullPointerException
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(
            at me.ryanclancy000.plugman.PlugManCommands.loadPlugin(
            at me.ryanclancy000.plugman.PlugMan.doCommand(
            at me.ryanclancy000.plugman.PlugMan.onCommand(
            at org.bukkit.command.PluginCommand.execute(
            ... 7 more
    Java Version 1.7.0
    Craftbukkit Version CraftBukkit, git-Bukkit-1.2.5-R5.0-b2262jnks (MC: 1.2.5)
    Bukkit Version 1.2.5-R5.0
  5. Offline


    I'll look into that too. Sorry for the problems, I'm just starting out. There weren't any startup problems though, the bugs I'm clearing were because of some for loops giving too much items. I'll look into plugman, haven't heard of it before.

    Greets, Jeroen V.
  6. Offline


    As I've said:
    - I have no info in console that plugin started nor not
    - Command do not work
    - When I want to force load it with Plugin Menager (PlugMan) it gives that error
  7. Offline


    I just uploaded version 1.1, it's an improved version of everything and should have taken care of the start up bug. It works on my private testing server.

    Feel free to give feedback, I'll be working on perfecting this plugin.

    Greets, Jeroen V.
  8. Offline


    It works great on my local machine! Testing @ 90 online players now.

    Can I request:
    - configurable output message with colors (for translation and customisation)
    - more detailed output message like "You have salvaged %itemName into %outputNumber %outputItem
    - salvaging woode tools (why not if leather is salvageable?)

    As a someone who wants to learn how to develop plugin as such, can I ask you for instructions how you did that plugin?

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


    Once you get all of the kinks worked out, you should implement a BLOCK that does this. (i.e. Gold Block?)

    I'll be looking forward to this being finished.
  10. Offline


    "salvage block" you say? naa...

    But if you really want it: hmm... its dangerous - what if player accidenatly hits it? I am up to "Salvage block" but only if there will be prompt "Do you realy want to destroy %listAllItemsThatWillBeSalvaged?" and you have to type /ok, if not done in 10 seconds it will time out.
  11. Offline


    I was able to complete 2 of your requests. I added a more detailed output message when you salvage an item, I also made wooden tools salvageable plus I improved the slot searching method so now it will salvage the item that you have in your hand rather than the first item of the kind the script finds in your inventory.

    I also saw your post that you want to get into coding, I highly suggest you follow this tutorial: did have a bit of pre-knowledge though.)

    If you want to get a look into how this plugin works I can put the code into a pastebin link.

    Greets, Jeroen V.

    I put 5 hours trying to get your block idea to work but I'm sorry I couldnd do it. Perhaps when my coding skills are improved, I didn't see any problem with my coding though but it kept throwing up errors that it couldnd call the PlayerInteractEvent correctly so I was powerless.. I'm really sorry, I'll do my best to get it done in one of the future updates.

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


    Testing Salvage 1.2 @ 90 players.

    Why it says its 1.0 when its 1.2?
    07:28:46 [INFO] [Salvage] Disabling Salvage v1.0
    07:28:46 [INFO] [Salvage] Enabling Salvage v1.0
    07:28:46 [INFO] [PlugMan] Salvage Reloaded!
    Maybe I need a hard reset, coz it do not enables salvagin wooden tools.

    Edit: hard reset gave nothing. are you sure this link is good?

    @JeroenV I am not Java programmer so I have no right to say this but your code is bad. What if you are going to change let's say I want to get itemDurability/itemStack/2 (half of raw materials)? You will edit every single method for each item do you?

    Can't you do a global function like I do things in PHP?
    FunctionSalvageThis (itemID) {
      #here it consideres all things and outputs raw materials for $itemID classed in separate line (like chest gives X raw material, pickaxe Y raw material, boots Z etc.)
    if CommandSend == '/salvage'; {
      FunctionSalvageThis (heldItem'sID) #calling here a function
    It could help for example in "Salvage block" implemening. Imagine statement
    if playerHitBlock { if thisBlockIsGoldBlock { if playerHeldsAnItem { if thisItemIsSalvageable
      FunctionSalvageThis(heldItem = itemID);
    } } } }
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 27, 2016
  13. Offline


    Yeah, for some reason the link (although it had the right url) directed you to the 1.0 version. I guess it was because I edited it in the simplified version and the url must have sticked to the string without me noticing.

    Yeah, about the code. There probably is a way more simplified version of this, like I said I'm also just starting out (I read the tutorial and after that instantly made salvage) I plan to learn the things on the way by making smaller plugins. I get what you mean and I should probably get some more java lessons (lol), I'm happy with what I got though and since I tend to keep every method exactly the same still so I can use the 'Replace/find' function of eclipse to just edit stuff easily without it taking ages.

    Greets, Jeroen V.
  14. Offline


    yeah if it works than its cool :D

    wtf link still shows
    13:34:19 [INFO] [Salvage] Disabling Salvage v1.0
    13:34:19 [INFO] [Salvage] Enabling Salvage v1.0
    13:34:19 [INFO] [PlugMan] Salvage Reloaded!

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


    Ah, well. Thanks a lot for your efforts, still a cool plugin!
  16. Offline


    Check if you put the file in right, when I download the file it's the 1.2 version. I can upload it with some other website if you'd like.
  17. Offline


    2012-08-02 07:13:30 [INFO] [Salvage] Loading Salvage v1.2
    2012-08-02 07:13:33 [INFO] [Salvage] Enabling Salvage v1.2
    Seems cool, testing. My players love it.

    Feature request:
    /salvageall - if outputting more than 9 raw materials it shall give block, like diamond block or gold/iron block.

    My players are complaining that using /salvageall after months of storing crap gives them too much daimonds and they have to "waste" time for making diamond block from them.

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


    Can you put it on BukkitDev?
  19. Offline


    Greetings I also enjoy this plugin and would be interested in having you do other things as may I get in touch with you best?

Share This Page