RepairRecipe
RepairRecipe
This Plugin allows you to repair armour/weapons/tools with the base item needed to craft the item and keep the enchantments. Repair costs depend on damage of the item, amount of base items needed to craft the item and the level of the enchantments. To repair an item, drop the item and the base item into the workbench. The result is the repaired item with enchantments. And almost everything is configurable!
No special block or construction needed. Just use the workbench to repair items.
Latest Dev Version: only Bukkit 1.7.9-R0.2 (beta)
Development builds of this project can be acquired at the provided continuous integration server. These builds have not been approved by the BukkitDev staff. Use them at your own risk.
Version 0.4.9 - Source - Download - only Bukkit 1.6.4-R2.0
Version 0.4.8-beta - Download - only Bukkit 1.6.1-R0.1
Version 0.4.7 - Source - Download - only Bukkit 1.5.2-R0.1, 1.5.2-R1.0
Version 0.4.6-beta - Download - only Bukkit 1.5.1-R0.1
Version 0.4.5-beta - Download - only Bukkit 1.4.7-R1.0
Version 0.4.4 - Download - only Bukkit 1.4.7-R1.0
Example
- One iron ingot repairs 1/3 of an iron pickaxe without enchantments.
- One iron ingot repairs 1/9 of an iron pickaxe with a level 3 enchantment.
Usage explained by spitfire25565:
Features
- Repair items with base item and keep enchantments
- Configure base item and amount needed for a item to repair
**
new**
- Set a chance to randomly remove enchantments on repair (configurable globally and per group)
- Configure the costs for enchantment repair (configurable global and per group)
- Configure extra costs for special enchantments (configurable per enchant)
**
new**
- Over-Repair - waste no base item and allow to get items repaired over 100% durability
- Discounts for Groups - set a discount for your sponsors (configurable global and per group)
For every "per group" setting Vault is needed.
Default base items
- iron ingot for all iron tools, weapons, armour and shears
- iron ingot for chainmail armour (but cheaper than iron armour)
- leather for leather armour
- cobblestone for stone tools
- wooden planks for wood tools
- gold ingots for gold tools, weapons and armour
- diamond for diamond tools, weapons and armour
- string for bow and fishing rod
Installation
Put the RepairRecipe.jar into bukkits plugins folder. Configurations are setup automaticlly.
Standard Config is created automatically.
Configuration
allow_over_repair
To allow Over-Repair set this to true (Default false)
allow_over_repair: false #or true
keep_enchantments_chance
If you do not want to keep enchantments, set this to 0, if you want to keep them set to 100. (formerly as keep_enchantments: true/false)
Any value between is the chance you will keep the enchantments. But keep in mind, the dice can roll up to three times for each enchant. If you are lucky enough to keep the enchant, there will be another roll with the dice. If it hits you there, the enchant gets an random lower level. And don't trust the result view of the workbench. You can't forecast the roll!
keep_enchantments_chance: 100 #value between 0 (remove enchants) to 100 (keep enchants) keep_enchantments_chance_groups: {} #set it to different values foreach group
You can set this chance for each permission group, if you are using Vault. For non defined groups the global default is used.
keep_enchantments_chance: 10 # be a lucky bastard to keep any enchantment keep_enchantments_chance_groups: Sponsor: 100 # but don't mess with sponsors!
enchant_multiplier
Repairing items with enchantments is expensive. With this multiplier you can make it cheaper or make it even more expensive. If you set this to 0 there will be no extra costs to repair enchanted items.
enchant_multiplier: 100 #value between 0 (no extra costs for enchantments) and 200 (around 30 diamonds for a pick axe with a level 4 enchantment) enchant_multiplier_groups: {}
Its now possible to set this enchantment multiplier per group if Vault is enabled. Is this option is used, enchant_multiplier is the fallback if the user has no group or if the group is not listed.
enchant_multiplier: 100 # around 15 diamonds for a pick axe with a level 4 enchantment enchant_multiplier_groups: Sponsor: 20 # around 5 diamonds for a pick axe with a level 4 enchantment
special_enchant_multiplier
You think some enchantments should cost more than other? Or some enchants should be free? Then this option is for you!
special_enchant_multiplier: {} # default - all enchants have the same multiplier (100)
This multiplier is multiplied by `enchant_multiplier`. If you set `enchant_multiplier` to 0, this setting has no influence at all. Set this to for a enchant to 0 and this enchant will be free to repair.
Possible values: PROTECTION_ENVIRONMENTAL, PROTECTION_FIRE, PROTECTION_FALL, PROTECTION_EXPLOSIONS, PROTECTION_PROJECTILE, OXYGEN, WATER_WORKER, DAMAGE_ALL, DAMAGE_UNDEAD, DAMAGE_ARTHROPODS, KNOCKBACK, FIRE_ASPECT, LOOT_BONUS_MOBS, DIG_SPEED, SILK_TOUCH, DURABILITY, LOOT_BONUS_BLOCKS
special_enchant_multiplier: DURABILITY: 200 # value between 0 (for free) and 200
use_highest_enchant
With use highest enchant you have another option to regulate the price for enchanted items. If this is set to false the `enchant_multiplier` will be multiplied by the sum of all the levels of the enchants on the item. For a tool with Unbreaking II, Fortune III and Efficiency IV this would be nine times `enchant_multiplier`. If you set this option to true, only the highest enchant counts and it would only be four times `enchant_multiplier`
use_highest_enchant: false # or true
discount
With this option you can set discounts for the repair price. Its like the 10% bonus repair with the Minecraft repair function. A discount of 100 means it only costs one base item whatever the durability of the item is. If you turned on over repair the item will have a durability of 200% with discount 100. Use something like 80 to avoid this most of the time.
discount: 10 # value between 0 (no discount) to 100 (one base item) discount_groups: {}
Like most of the settings you can set this for each permission group, if vault is activated.
discount: 10 # around 14 diamonds for a pick axe with a level 4 enchantment (multiplier 100) discount: Sponsor: 25 # around 5 diamonds for a pick axe with a level 4 enchantment (multiplier 20)
base item configuration
If you want, it is possible to change the the base item and amount needed to repair an item with no enchants from 0% to 100% durability. To this base costs the enchantment costs will be added and after all the discount subtracted.
The item configuration is in the `items.yml`. If you remove an item there, it is not possible to repair it, until you add it again. But you can also additional items. If anyone wants to add none standard minecraft items, i will try to add this. Maybe it even works already? I have no experience with such plugins.
diamond_axe: # this is the item you want to repair (possible are names or ids) base_item: diamond # this is the base item, which you should add to the grid (possible are names or ids) base_amount: 3 # this is the amount of the base_item you need to repair the item from 0% to 100% durability
Because I like overkill, there are more options. None of the default recipes have this, so you have to manually add these if you want these. With these additional configs you can overwrite the repair behaviour for some special items. Like change the `keep_enchantments_chance`, `enchant_multiplier`, `allow_over_repair` and `use_highest_enchant`. This overwrites the default and group values for this setting. If you want the default/group values, remove the option or set it to `default`.
diamond_sword: # see above base_item: diamond # see above base_amount: 2 # see above keep_enchantments_chance: default # use the default value set in congig.yml (global/group) enchant_multiplier: 200 # repair costs for weapon enchantments are more valuable allow_over_repair: false # you are a PVP Server? Definitely set this to false for all armour and weapons. use_highest_enchant: true # high multiplier but only for the highest enchant, sounds fair? # more are coming (exp costs for repair? exp get for repair? economy costs? ...?)
MCStats
MCStats is free, open source and anonymous. All data is public and freely available for every plugin. (http://mcstats.org/learn-more/)
Quote:You are free to opt-out of submitting data whenever you wish. This will immediately stop sending data for any plugins that supports MCStats / Plugin Metrics. Simply edit plugins/PluginMetrics/config.yml and change opt-out: false to true
If you have any questions at all about how this service operates or anything else, please do visit us in IRC or email me directly: hidendra [at] mcstats.org
Permissions
- RepairRecipe.repair
- Player is allowed to repair items. Default: true
- RepairRecipe.repair.enchant
- Player is allowed to keep enchantments. Player without this permission, can repair their items, but will lose all enchantments. Default: true
- RepairRecipe.repair.overRepair
- Player is allowed to over repair items. Default: false
- RepairRecipe.admin
- Player can use the commands /repairrecipe reload and /repairrecipe debug
Commands
- /repairrecipe reload
- Reload the `config.yml` file. To reload `items.yml` restart the server.
- /repairrecipe debug [true|false]
- Enable debug mode. Many debug messages will appear in the server log and some to the player. Do not enable this as long as you do not want to report a bug.
Know Issues
- none yet
Please post bugs at https://github.com/attrib/RepairRecipe/issues?state=open - this way I get a email right away! I dont check the comments here regulary.
TODO
Don't know if this will happen, as there issn't much support for any of the features.
- get Exp from repairing items
- Exp costs to repair enchantments
- possibility to unenchant an item
- add economy support (suggested by OriginalMadman @ #2) - feedback needed
Credits
I want to thank everyone who gives me feedback and tests the plugin. If you help me, I will add you to this list ;)
- Coding: attrib
- Tester: Cyprias, Maresi, TimeSpawning
- Video by spitfire25565
- Additional Feature Requests and Ideas: Maresi, OriginalMadman
@Warkers
Couldn't reproduce the error posted from you. Please provide more infos, e.g. Bukkit Version, RepairRecipe Configuration and what exactly you did.
Be sure it is not the known issue, where the amount of a base item is not getting updated until you click on it or close the workbench/inventory. This is fixed in the Beta.
@marubal21
Couldn't reproduce both errors posted from you. Please provide more infos, e.g. Bukkit Version, RepairRecipe Configuration and what exactly you did. In particular the second bug of yours. This never happend to me, not even while developing (and while developing I got some very strang bugs ;) )
Released Beta v0.3.1 - Download
Because of the approval process from Bukkit, Betas are only released at Github. Deleted the released Beta from Bukkit.
@Warkers @SuperNyanNyan
Sounds like the same Bug. After the repair is done, do you click on base item stack to get the amount updated? If have 10 iron ingots in the workbench and the repair costs 2, after the repair it says you have 9 iron ingots, but if you click on the iron ingot then it updates the display and you have only 8. This is a known issue, which is fixed in Beta v0.3.
Can you please add your configuration to the Issue #14?
Only to clarify unenchanted item costs every time one item and enchanted takes all items added to the workbench?
@Maresi
NPE... I hate Java. Will have a look into it, after the other Bugs reported for v0.2.2
The Ticket if anyone has new Information, when this happens: Issue #13
Possible bug: With overrepair set to false, when I place a stack of base item in the crafting grid with the item I want to repair, it fully repairs the item using only one of the base item.
For example, a cobblestone pick on the verge of breaking can be repaired to full with one cobblestone, as long as I put a stack of more than one cobblestone on the workbench.
Hello, i have noticed 2 things that has happened to me with the latest version 0.2.2. I'm not sure if it's just a setting i need to change or not. but the 1st one is happens whenever i repair an item that is not enchanted it only requires 1 of the base item, for example i had an almost broken iron pick that i was able to repair with just 1 iron ingot when it should have at least taken 3. And the other is that if i just grab a stack of base item and put it with the item i need to repair the results are a repaired tool but it takes all of the base item away. Again example is with an iron sword, with a sword that i used only once as a test, when i went to repair it i placed 15 iron ingots with it and even though it did repair the sword it used all the iron i gave it in the process.
@attrib
http://pastebin.com/wc0LAdkx
I can't tell you what has going on when this happened cause I wasn't on, but I see it in the server log >.<
@attrib
Our server is testing it now.
New Beta Release v0.3
I can't believe it but I think I fixed this two know issues! But this also have a down side, this has to be tested. While developing I got some item dupe issues. I think I got them all, but I'm not sure.
With this bug fixed, it is also possible now to set discount to 100 and it will be free. But you need the base item to get the repair started but you get it back immediately.
Have fun with this and I'm happy if it works.
Smal notice: v0.2.2 works fine with Bukkit 1.3.1-R2.0
@attrib
I posted there as well with a short video of the bug. (I'm FrostyWolf)
Very good plugin i use in my serve
New Version is out (v0.2.2)
@Maresi
I decided I will ignore these bugs for now and posted a question into the forum. If nobody answers or have any clue, than this both issues will be there for a while.
Damn. Sounds like a bug. I get right on to it.
@Warkers
Yeah I just noticed this...your "fixed" formula is WAY worse then before. Everything is costing WAY to much to fix.
EDIT: Yeah, its WAY messed up...I have a Diamond Enchanted Sword with some damage on it. With the enchantment multiplier set to 100, it cost 17 to repair like...10% damage. With the multiplier dropped all the way to 5 it still cost 9.
Trying this plugin out. Simple, aside from known issues works well. It's a bit odd that to fully repair a tool costs more base material than to craft a new one. Not sure if that was an intended feature but I did see that repair costs are to be worked on. Good start!
@attrib
There a couple ways you can handle those issues:
1) Ignore them.
2) Spout.
3) Adopt a Avil/McMMO like repair system. (Iron Block you right click on, etc)
4) Add 2 and/or 3, and make it configurable in the config file to turn them on or off. This way, anyone that uses the plug in can chose between options 1-3.
Personally, I absolutely love it the way it is, and have always said that THIS is how the repair system should have worked in the first place, not this combined two of the same item nonsense.
EDIT: You and always make a post here: http://forums.bukkit.org/forums/plugin-development.5/ or hop in the bukkit dev IRC channel and ask for help, maybe someone knows some trick to get those items to refresh?
What bugs me the most are the two open know issues. Currently I have no idea if there is anything I can do about it. Sometimes I think thats the main reason why no other repair plugin uses the workbench. So the main question would be are these two Issues a deal breaker? Because if these are deal breakers, theoreticly there would be no sense to develop this plugin any further. But I would be happy to develop this plugin further. I like the way things work and I like the feedback I got till now. I hope that someday I get around these two issues. Currently the only solution I see, is that this could maybe fixed with a spout client plugin (but I never used spout before, so no guarantees, theoreticly this should fixes this) or with a little bit of luck with the upcoming official mod api by mojang. I only want to make this clear from the beginning.
I appreciate any feedback and please tell my if these both know issues are a main reason to not use this plugin! Because if so I will not add new features until I found a way around it. Even if these means that there will be no update for quite a while. Like I tried to explain, these both issues maybe sounds like easy task, but are complex in the way bukkit works. But if every body is happy like all the stuff works, this plugin will develop further. Now its every bodys turn to ask himself this question and post the answer here.
@Maresi
I think I can squeeze 1 and 2 in. Shouldn't be so hard (I hope ;) )
3 sounds like a good idea, but I have to think about it. It seems very complex to setup for the server admins, but it would be very flexible. Also I have to check how hard it is, to not use Item IDs, but this is surley no must have. This needs some refactoring on my side, which is not a bad thing, but takes time. So please don't expect this feature very soon. I think I put the most needed features (permissions, config) into 0.2 so this should be useable. If some find a major bug, I will release a 0.2.1. The next main release 0.4 will take some time, but if something is ready, I will release a version for testing purposes (as 0.3 - even numbers releases, odd numbers beta).
@attrib
In that case I have some more suggestions.
1) Make keep_enchantments keep_enchantments_chance: 100 <-Configurable percent chance to keep enchants on a repair.
2) use_highest_enchant: false <- When set to true, when calculating repair costs for a item with more then one enchant, it just uses the highest enchant instead of adding them all together.
3) When you get around to "make base item and amount configurable" I would suggest something along the lines of: http://pastebin.com/VgFqUXY2 You of course can set it up however you want, it's just a suggestion.
@Maresi
Thanks for the Testing. Did some testing myself today and fixed the bugs reported by you. Uploaded Version 0.2 and updated the description. As a notice, I will try to keep the Github README the Documentation for the Development Build/Alpha. The Bukkit page refers to the last know stable version.
1) Fixed
2) Fixed
3) Works as designed - as there are no more options.
4) Noticed myself and fixed it before I read your detailed description. Your Formular seems legit, maybe I tweak the current formular a little bit in the next release based on this idea. The main problem descibed is fixed, but a minimal influence on the base costs persists.
Discount are subtracted from the main costs.
@attrib
Ok, results from testing.
1) http://pastebin.com/k2gUyZRn <- Would not start with out vault.
2) http://pastebin.com/JX3DfHNv <- Trying to enchant something with out a permissions plugin installed throws up that error, repairs it to full for only 1 base item and removes enchant.
3) Configuration file only has 4 options in it when it generates, is that how it should be?
4) Tweaking the enchantment multiplier also seems to be tweaking the cost of non-enchanted items. For instance, I changed the enchantment multiplier to 25, and now a Iron Hoe that is almost broke only costs 1 to repair. Your repair cost equation probably needs some tweaking. It should look something like this (minus how ever you are handling discounts and what ever else):
BC == Base Cost
EL == Enchantment Level
EM == Enchantment Multipler (from config)
TR == Total Repair
TR == BC + ((EL * (EM/100)) * BC)
That way no matter what the Multiplier is set to, if there are no enchantments, the item still gets charged its base cost. EM/100 is to get the number in the config to a percentage. then you it would times that percentage result to the Enchantment level. Then take that result, and times it against the base cost, and then add one more base cost. If the enchant level is 0, the entire EL * EM/100 * BC will return 0, so the repair will only be base cost.
I added permissions, configuration, over repair and discounts for groups.
But currently it is not very well tested.
But if anyone want to test this alpha: v0.2-alpha1
As soon as I had the time to test it a little for myself, I publish this here.