Inactive [ECON] RepairChest v0.9.1 - Spend gold to fix your tools [1.4.6-R0.3]

Discussion in 'Inactive/Unsupported Plugins' started by DemmyDemon, May 1, 2011.

  1. Offline

    DemmyDemon

    RepairChest - Spend gold to fix your tools:
    Version: v0.9.1

    Inspired by one of my most favorite plugins ever, PhysicalShop, this provides a way to spend gold ingots on repairing tools.

    Simply slap a sign over a chest, make the first line "[Repair]", and you're done!
    Users will then put their damaged tools into the chest and right-click the sign while holding their hard earned gold ingots, and the tools in the chest will be repaired.
    Video demonstration by SeaborgiumMC (open)

    Thanks SeaborgiumMC

    Features:
    • Entirely gold-and-sign based. No commands, no economy plugins.
    • As easy to set up as you could hope for.
    • Updated to new Permissions system ("SuperPerm"), but entirely optional.
    • Configurable currency, in case you'd like to keep your valuable Gold Ingots.
    • Configurable prices, but with a sane default.
    • Configurable what is and isn't repairable.
    • Possibility of allowing partial repairs if the player is short on cash.
    • Repair chests are protected against explosions and destructive users.
    • Translatable: Strings built into the configuration.
    Download RepairChest

    Source Code

    Planned improvements
    • None, but feel free to suggest something and I probably won't be extending it any further.
    Permission nodes (open)


    repairchest.create - Place the Magic Sign
    repairchest.use - Use the repair chest, but even checking this permission is off by default.
    repairchest.destroy - Destroy the Magic Sign
    repairchest.testing - Access to /rc test command
    repairchest.reload - Access to /rc reload command

    Commands (open)

    /rc test - Severely damage the held tool
    /rc reload - Reload RepairChest's configuration

    Configuration (open)

    Default values:
    Code:
    verbose: false
    currency: 266
    baseCost: 0.01
    currencyName: g
    currencyString: Gold ingot
    partialRepair: false
    distributePartialRepair: false
    triggerString: "[Repair]"
    checkRepairPermission: false
    repairables: (looong list of integers)
    strings: (list of strings)
    verbose,boolean
    Should the plugin spew loads of irrelevant information to the console?
    Don't turn this on. Seriously. You'll just turn it back off again right away.

    currency,integer
    What item ID does your chosen currency have?
    Default is 266, which is the gold ingot. Perhaps you prefer 341, the Slime ball?
    I suggest you refer to http://www.minecraftdatavalues.com/ to get the ID of your preferred currency if you don't already know it.

    baseCost,double
    What should one point of damage cost to repair?
    The default here is 0.01, meaning you pay 1g for every 100 points of damage.
    Since it's not possible to pay in fractions of an item, it's rounded DOWN to the closest whole, but the price can never be 0.
    This means that even if the baseCost is 0.01 you still have to pay 1g to repair a stone pickax used only once.

    currencyName,string
    What do you refer to your currency as? "I'm rich! I have 200g!"
    It will be used without a preceding space, so set it to " slime balls", including the space, if you want it to say "34 points of damage costs 34 slime balls to repair." rather than "34 points of damage costs 34g to repair."

    currencyString,string
    The long name of your currency, used in the explaining text.
    This should match your currency, so the default is "Gold ingot"

    partialRepair,boolean
    Should it be allowed to only repair some of the items?
    Default here is false, so you can't repair unless you can afford to pay the full sum.

    distributePartialRepair,boolean
    Should partial repairs be distributed?
    If they are distributed, and you pay 1g to repair 5 tools, the 100 "repair credits" will be distributed evenly among them.
    If not, then it will repair the first tool first, then move on if there are "repair credits" left, then the next and the next until your gold is spent.

    checkRepairPermission, boolean
    By default, this is false, meaning that anyone can repair at a repair chest.
    If set to true, it checks the repairchest.use permission before allowing repairs.

    triggerString, string
    The string on signs you want to trigger the repair function with.
    The default is "[Repair]", but it could be "[Reparere]" or "[Fix]" or whatever you want.
    Just keep in mind that changing this will break any existing repair chests out there!

    repairables, list of integers
    Default repairables (open)

    repairables:
    - 256
    - 257
    - 258
    - 259
    - 261
    - 267
    - 268
    - 269
    - 270
    - 271
    - 272
    - 273
    - 274
    - 275
    - 276
    - 277
    - 278
    - 279
    - 283
    - 284
    - 285
    - 286
    - 290
    - 291
    - 292
    - 293
    - 294
    - 298
    - 299
    - 300
    - 301
    - 302
    - 303
    - 304
    - 305
    - 306
    - 307
    - 308
    - 309
    - 310
    - 311
    - 312
    - 313
    - 314
    - 315
    - 316
    - 317
    - 346
    - 359

    Just a looooong list of item IDs of what you want to be repairable.
    The default is all tools, all armors, all weapons, shears and the fishing pole.

    strings, list of strings
    Default strings (open)

    strings:
    spammy: VERBOSE MODE ON! This will get spammy!
    testNoConsole: Sorry, but the console can't have an item in it's hand...
    testNoEmptyHand: You can't test with an empty hand, man.
    testNearlyBroken: Your tool has been nearly broken...
    testNotSuitable: This item isn't suitable for this test.
    reloadedSuccessfully: RepairChest settings reloaded successfully!
    permissionDenied: Permission denied.
    invalidArgument: Invalid argument!
    cantAfford: You can't afford this repair!
    ding: Ding! Repair complete!
    usage: Right-click the sign with a currency item in your hand to pay.
    currencyIs: "The currency is:"
    nothing: Nothing to repair!
    noChest: Uh, there is no chest.
    usagePermissionDenied: Sorry, you don't have permission to use repair chests.
    removePermissionDenied: Permission denied! You can't remove repair chest signs.
    cantRemoveProtected: This block has a protected sign on it, and can't be removed.
    explosionBroadcast: Everyone, please refrain from blowing up repair chests. It's not nice.
    damagePoint: point
    plural: s
    ofDamageCosts: of damage costs
    toRepair: to repair.
    chestAuthorized: Repair chest authorized!
    chestDenied: Sorry, you lack permission to create repair chests!
    chestFirst: Chest first!

    This is for translating the plugin. If you don't already know how to do this, I suggest you play with it for a while, but no support will be given on translations!



    Changelog:

    Version 0.9.1, January 2nd 2013
    • Fixed "Could not find chest" issues that came with a breaking Bukkit change.
      The cardinal directions rotated (to match Minecraft), so I had to rotate the chest-finding method accordingly.
    Version 0.9, August 11th 2012
    • Updated for 1.3.1-R1
    • Repair permission checks is now configurable, and defaults to being off
    • What can and can't be repaired is now configurable
    • triggerString is now respected everywhere (...I hope!)
    • Other minor tweaks and fixes here and there.
    Version 0.8
    • Translatability introduced.
    • Updated for 1.1-R6 compatibility.
    • Made more stuff configurable.
    • Simplified language in the plugin a bit to aid in translatability.
    • Made sure "translatability" is a perfectly cromulent word.
    Version 0.7, January 30th 2012
    • Hop to new Bukkit Events system
    • Potential fix for strange bug that sometimes Enchantments go away. Unable to reproduce, so I have no idea if it's even RepairChest's fault, but hey, I have to try.
    Version 0.6.1, December 20th 2011
    • Fixed sign-on-side-of-chest support.
    • Added refusal to accept edible stuff as currency because of some weird Bukkit(?) bug.
    Older changelog (open)

    Version 0.6, December 13th 2011
    • Combined both commands into /rc, which takes an argument.
    • Thrown out old Permissions support, now 100% SuperPerms
    • Adjustment to API changes, fixing for some (Block.getRelative) and warning suppression for others (org.bukkit.util.config.Configuration).
    • Fixed some brokenness in the /rc test command
    Version 0.5, May 21st 2011
    • Testing shows the explosion resistance is dependable as far as I am able to test. Now considered a Real Feature.
    Version 0.4.2, May 14th 2011
    • No longer clobbers configuration changes on /reload
    • Added /rcreload and /rctest commands (/rctest was already there, but undocumented and called /repairchesttest)
    Version 0.4.1, May 10th 2011
    • Fixed the path and name of the configuration file. I hope.
    Version 0.4, May 9th 2011
    • Fixed the configuration directory not being created if needed.
    • Added partial repairs, in two variants "distributed" and "sequential" (See config options)
    Version 0.3, May 4th 2011
    • Fixed issue where currency was always referred to as "gold", and gold was required for transactions even when a different currency was set. (Thanks Bokou)
    Version 0.2, May 1st 2011
    • Configuration support
    • Working chest/sign protection. Still needs work...
    • Much cleaner code overall.
    Version 0.1, May 1st 2011
    • Initial release
     
    wavecom, kahlilnc, columb and 3 others like this.
  2. Offline

    wildsteelerfan

    cool!!! i exited!!! :D
     
  3. Offline

    Rofang

    Nice plugin. I switched to this one after it seemed the command-based repair plugin I'd been using just became too glitchy to use. Chest-based repairs weren't my ideal, but it works. I'm using redstone (331) as my repair currency with a cost of .05 for now, which seems reasonable.

    However, I'm noticing that armor repairs seem surprisingly cheap. I'm used to regarding armor as costly items, but I can repair an iron helmet for about the same price as a stone pickaxe, which just seems intuitively wrong to me. I guess the damage points armor items take are skimpy (and thus cheap to RepairChest) compared to the hardiness of tools, but given how expensive armor is to craft upfront, it seems to me that repairs should cost more (I value repairs by considering what it would cost me to make a new item from scratch). How about a setting to multiply armor costs by a custom value? For instance, say I want all armor to cost triple the normal damage-point calculation; it'd be nice to be able to put that into the config.
     
  4. Offline

    DemmyDemon

    Good point. I'll consider it, but for now there's a whole lot of other stuff that needs implementation in this plugin, and I have unexpectedly gained a life, so progress is slow.
     
    Rofang likes this.
  5. Offline

    gameacid13

    are you working on making this compatible with #1185?
     
  6. Offline

    DemmyDemon

    I didn't know it was broken!
    What seems to be the problem? I'm going to do an update-rush on this soon-ish as I've neglected it for far too long.
     
  7. Offline

    hannes92e

    I have a suggestions :)

    That it would cost more gold the more armor/wepons you have in the chest¨

    like 1 gold ea wepon /armor you have in there or else you can repair like a crazy person:p^^
     
  8. Offline

    DemmyDemon

    Eh, what? It charges for the amount of damage, and does not care how it is distributed. Why charge extra for the distribution? I must be misunderstsnding this somehow.
     
  9. Offline

    DemmyDemon

    Updated for, tested with and working on with RB 1597.
     
  10. Offline

    Bluestripe44

    Just a question, what happens to the gold or whatever currency is used? Does it just disappear?
     
  11. Offline

    DemmyDemon

    Yes, for now it's just gone. There's some perliminary work done on chest "ownership", where you can get the currency back out, but that's probably not going to happen since I'm not actively developing this.
    If you want to take over development, let me know :)
     
  12. Offline

    jron

    Does this work for enchanted equipment? Thanks!
     
  13. Offline

    DemmyDemon

    It has no impact on the enchantments at all.
     
  14. Offline

    jron

    Awesome! I think most people on my server are in agreement that not being able to repair enchanted gear kinda sucks, so this will be perfect for us.
     
  15. Offline

    GordonGrey

    Excellent work. Glad to see a plugin that keeps the enchantments after repair! Tested and working with the latest CB.
     
  16. Offline

    jron

    Just a suggestion, kind of on top of what @Rofang said earlier. Let's take diamond helmet vs sword for example: a diamond helmet take 5 diamonds and has 364 points of durability, and a diamond sword takes 2 diamonds but has 1,562 points of durability. So I see what he's saying about balance.

    Maybe instead of defining a set number of durability points that a currency repairs, what about using some sort of percentage based system? E.g. a single gold ingot repairs 10% of durability of a single item by determining the total durability of the first item in the chest. I don't know how you'd be able to handle repairing multiple items. I also don't know jack about minecraft plugin development so I could be speaking out of my ass here, but maybe it'll spark an idea.
     
  17. Offline

    DemmyDemon

    Yes, there's plenty of room for improvement, and that's just one of the things that might need some looking into.
    Currently, however, I don't have the time. Maybe in 2047, when I retire :-P
     
  18. Offline

    jron

    Totally understood, I barely have enough time to play the games I want, let alone get this far into the rabbit hole. Hopefully someone offers to help out with it.
     
  19. Offline

    ZeroZX4

    i set currency: 357 < cookie
    when i wanna fix my stuff it fix it but it dont take that god damn cookies and cookies r the only coin looking item in the game which u cant obtain normally

    i just want ask is it a bug or did i do something wrong ?

    im ussing Recommended Build: 1.0.1-R1

    and this is my config

    distributePartialRepair: true
    currencyName: z
    baseCost: 0.10
    verbose: false
    partialRepair: true
    currency: 357
     
  20. Offline

    DemmyDemon

    Please elaborate on "it dont take that god damn cookies"?
    What do you do, what did you expect to happen, and what happened in stead?
    What does it say when you left-click the sign? What does it say when you right-click the sign?
    Do you have enough god damn cookies on you to pay for the repair? (Yes I see the partialRepair feature is enabled, but what if the bug is there?) The more detail you give the more I can god damn help you.

    Thanks.
     
  21. Offline

    jron

    Lol, I want to give you a hug for that. Cheers
     
  22. Offline

    ZeroZX4

    ow man i thought u will understand bur from ur point of view i see now what i said was not so clear

    ok so

    like i said i set currency: 357 < cookie

    and when i put stuff to chest and LEFT CLICK the sign it tells me how much dmg items have and how much i need to pay for the repair

    but when i RIGHT CLICK it with empty hands it says that i need to click it with the cookie
    if price is higher than cookies i have in my hand (with partialRepair: FALSE) it says i cant afford it
    but
    if price is higher than cookies i have in my hand (with partialRepair: TRUE) it says Ding! Repair complete! but it dont take cookies from me even if i have 3 cookies and repair cost is 5 i can click it twice to pay for full repair and i still have 3 cookies in my hand just like i would be in creative mode but im in survival so wtf ?
    i tested that as admin and as normal user
    and for example Gold/Iron Ingot and Gold Nugget work just fine
    it take the amount of them as it should so like if i use gold nuggets as currency like right now i am it take them from my when i right click the sign earlier i was doing it with gold and iron ingot and it works too

    just that god dam cookies :D

    here is log when i turned on verbose when i needed to pay 5 cookies for repair and i was having 3 cookies with
    partialRepair: true
    (when i se partialRepair: FALSE it dont take my cookies when i right click sign to repair stuff)

    03:59 PM [INFO] [RepairChest 0.6 VERBOSE] Repair per item is 30 for 1 items, 30 credits.
    03:59 PM [INFO] [RepairChest 0.6 VERBOSE] Charging for the repair...
    03:59 PM [INFO] [RepairChest 0.6 VERBOSE] Poor bastard is now broke
    03:59 PM [INFO] [RepairChest 0.6 VERBOSE] Charging for the repair...
    03:59 PM [INFO] [RepairChest 0.6 VERBOSE] rich-- = 2
     
  23. Offline

    DemmyDemon

    Despite English not being my first language, and I suspect not your first language either, I managed to piece together what's going on.
    I've reproduced the problem, and I'm working on it now.

    The problem is that right after I empty the player's hand I request back what's in it, and it's being reported as AIR (nothing).
    So yeah, the server both thinks it's done as I've asked and at the same time doesn't do it.

    Very strange.

    [Edit]
    Update: This is reproducible for ALL edible/consumable items, from melon slices to bread.
    All I can do for now is to have all edible items fall back to GOLD_INGOT. :-(
     
  24. Offline

    ZeroZX4


    yea english isnt my 1st language and im not sure if i understand u good but lets just put it this way

    all food have the same bug > that what u was saying ?

    and u cant fix it for now ?

    anyway for me its like bonus/extra feature cause gold nuggets is ok with me i just wanted cookies so i have item that dont drop from anywaher and u cant get from anywhere in game beside cheating/hacking/gamemodes
    so ur plugin for me still is cool :)
     
  25. Offline

    DemmyDemon

    The bug is with all food, yes, and the bug is not in my code.
    I'll have to look into it deeper and search for the problem in CraftBukkit, so I can submit a proper bug report on it.
     
  26. Offline

    LeGenDaryX

    Do enchantments stay on the weapons after repairing?
     
  27. Offline

    DemmyDemon

    If you didn't read the thread, how will I know you'll read my response?
    In any event, yes, it doesn't touch enchantments at all.
     
  28. Offline

    LeGenDaryX

    Well sorry but i still can't find it in the thread?
    But thanks for answering im gonna use this on my server!
     
  29. Offline

    DemmyDemon

    It's right here, but it doesn't matter, I guess. Enjoy.
     
  30. Offline

    DonProtz

    Hi DemmyDemon,
    thx a lot. Very nice plugin, because it´s the first plugin that works on first try. Simple but great.
    Thx again, keep up the good work.
     
  31. Offline

    DemmyDemon

    Good to hear it serves you well! Enjoy!
     

Share This Page