RepairDispenser
Overview
version: 0.3.1
| craftbukkit: #2149
| Source
Description
RepairDispenser is a plugin that will allow players to repair their tools and equipment using raw materials by placing both into a Dispenser and dispensing it (requires some kind of redstone power source, like a button or pressure plate). The raw material required is whatever material is needed to make the item being repaired (ex. Diamond Pickaxe requires a Diamond as a raw material). The amount repaired is based on the amount of raw material required to initially make the item (ex. Diamond Pickaxe is repaired 33% (1/3) for each Diamond).
One of the major benefits of RepairDispenser is that the repaired item's enchantments will not be removed. This allows players to fully use those hard-to-get enchanted items without worrying about them eventually being destroyed. Also, since the raw materials required are the core component of the tool already, it is not imbalanced either.
Usage
How to use RepairDispenser:
- Build regular dispenser.
- Attach button/lever/pressure plate/redstone signal to dispenser.
- Open dispenser and place tool + raw material inside dispenser.
- Press/use the button/lever/pressure plate/redstone signal.
- Rejoice as your repaired item is dispensed!
FAQ
- Can I repair bows and fishing rods?
Of course! To repair bows and fishing rods, use String as the raw material.
- My server is still running a version of Bukkit before 2149! Use RepairDispenser 0.3.0 if you are running a build before 2149.
Config Options
Quote from the Config File:over-repair: [ true | false ] - Allow items to be over-repaired (ie. if a 99% pickaxe is repaired with 1 raw material, it will have 132% durability instead of 100% durability, preventing the raw material from being "wasted" on a 1% repair).
Commands
There are no commands.
Permissions
There are no permissions (as dispensers can be triggered by non-players, so having permissions is useless).
To Do List
My current to-do list:
- Add a config option to change raw materials for items. Current implementation doesn't support it, though.
- Add a config option to set the percentage repaired per raw material item.
- Add a chat message for how much was repaired.
- Add a check command to see what's needed for repair.
Change Log
View the Change Log.
Credits
- slipcor for helping with the banner's screenshot!
- garbagemule for inspiration and code help along the way!
@kahlilnc Tried breaking things while in creative, but can't seem to reproduce it... :(
@AgnateHeartstone
I think I was in creative may of caused it ? If thats not it I will try again.
Can you make this for a Sign too? And then iconomy... There isn't a plugin for that.
@kahlilnc So I'm testing this now, and I can't seem to reproduce it. Any chance you can PM me with your list of plugins and the steps you take to get this bug?
@SirMonsterSlayer As in a command that you can type to repair, or the ability to charge for repairs?
Would be cool if you could set up per command "repair dispenser" so I can get a blacksmith ? =)
@Paril101 Yeah, should be on Github... check the Source link at the top of the page. :) I don't use the native dev.bukkit repo. ^_^
Hey, Agnate, just to let you know I'm going to clone the repo and mess with it, see if I can come up with anything neat.
EDIT: Oh, is the code not public?
Damn, you fixed the lose-enchantment thing - I was exploiting this to reset my crappy enchants D:
@ryuklikesapples Yeah, I could add that. Will have to wait until the weekend, though.
@kahlilnc I'll definitely look into this. Are you using any other plugins? If so, would you be so kind as to run a local server with just RepairDispenser and try the same action again? (I won't be home now for a couple days, so I can't test myself). Just want to make sure it's not a conflict with another plugin.
I put goldpick in dispenser and goldbar, destroyed dispenser then another pick popped out. DUPPPPPPE
Awesome. Removed mcmmo so this will replace the repairing XD
Is it possible to actually ADD an over-repair option?
@AgnateHeartstone
I really don't think conservation is a good trade-off for complete unreadability and the simplicity to break an entire file based on one missed space. XML is perfect, incredibly easy to parse in a small amount of code (can't say the same for YML), and can even be parsed via regexps if it's done properly (again, good luck with that with YML).
I'll test it out in a bit!
-P
@Paril101 Well, the config would be mega-simple, so YML wouldn't matter. Sadly, YML parsers are built into Bukkit, which is why people use them. Just gotta get used to not using tabs or extra spaces (think conservation!).
With that note, version 0.1.1 is out. This fixes the over-repairing bug for sure, and hopefully that lost-item bug (I never actually found it, but took a guess as to why it was disappearing). Please confirm that they're fixed, though, as I'm rushing to entertain company as we speak! ^_^
@AgnateHeartstone
I suppose. It does depend on the server though; I allow my players to use OreDetector (server-side plugin) on my server, just to make it a bit less tedious to find rare ores and dungeons.
A configuration file would be nice, but please, PLEAAAAAASE don't use YML; I'd love XML, but dear jesus anything but YML; even ini would be better than YML D:
@Paril101 I do agree with you about the shovel, but that's pretty much the only tool that I can a bit OP for repairs. If you're playing full legit multiplayer, though, diamonds are so rare that you're about 10% likely to actually even make a shovel, as it's basically a waste of diamond. :P
I'll probably implement a config at some point, though.
Also, just my two cents: it shouldn't take the amount of materials needed to construct it, in my opinion. I think it'd be better if a raw material repaired a fixed amount of uses (like 120 per diamond, etc), because as it stands, it seems a bit OP if you can repair the shovel with one diamond to full (although it DOES make sense, it still seems OP to me, especially if you're trying to save enchantments)...
@AgnateHeartstone
I can actually reproduce it easily - I just threw my now-green axe back into the dispenser with one diamond, and it spewed out an axe with a lot more durability than it should have. And it's also doing it for the shovel and the pickaxe now.. strange.
As for your last raw material thing: it's not a bad idea, but it would really upset those with "Minecraft OCD" so to speak, who would hate to not be able to repair an item back to full durability.
@Paril101 Yeah, I figured it must have over-calculated. Not sure how it would have done that, but I know the fix. I think what happened was that it calculated the minimum, so the last "repair" diamond gave it additional durability (probably about 300 uses).
I was just going to Math.max it (to prevent it going over), but should I *not* use the "last" raw material if it doesn't get full use? So, for instance, if it needs 2 diamonds for repair, but 1 diamond would repair it back to 95%, you'd be wasting a "full" diamond on the last 5%. Hmm...
Thanks for the offer! Usually my issue is getting the bug to be reproducible. Once we've got that, it's time to System.out.println. ^_^