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

    kaasinees

    i dont have a folder called settings.yml....

    Another suggestion:

    allow multiple items to be used for repairing.

    config example:

    Code:
    items:
    [tab]itemid:repairvalue
    [tab]itemid:repairvalue
    
    also if the item used to repair has a durability variable(tools etc) than remove what is repaired/repairvalue of the item.

    for example i use iron pickaxe to repair and 1 durability can fix 50 durability of the items in a chest, instead of they iron pickaxe being destroyed it will off 2 durability if it fixed 70 durability of items.
     
  3. Offline

    DemmyDemon

    Not sure I follow there, kaasinees.
    You want to be able to spend 1 durability off one tool to fix 50 durability on another?
    As in "free repairs for anyone with two tools on them"?

    Sorry, I don't see the upside to that.

    As for the "multiple currency items", if there's more people that want/need it, I'll look into it.
    For now, however, I'm enjoying the simplicity of a gold-based economy on my server, so I won't be using it myself...

    0.4.1 will be released shortly, fixing the configuration file/path problem, hopefully.
    [Edit] Done!
     
  4. Offline

    kaasinees

    Well right now i am using stone pickaxe for repair... It would be cool if i could add iron pickaxe for repair. And it would be cool to link the pickaxes durability to the repairing.
     
  5. Offline

    DemmyDemon

    If I were to do that, it would be a 1:1 transfer of durability, at the very least.
    If you want cheats to repair all your items, just get adminCMD or something?
     
  6. Offline

    DragonSupremacy

    How exactly can I configure the settings.yml to charge iConomy money?
     
  7. Offline

    DemmyDemon

    You don't. There is no iConomy support.
     
  8. Offline

    DragonSupremacy

    Ah, I see. It's a bit of a shame.. your plugin has the permission nodes, but no iConomy option, Blacksmith/ToolRepair has iConomy but no Permissions set up currently :p

    Perhaps the code can be combined, to make iConomy optional for this plugin?
     
  9. Offline

    DemmyDemon

    The main reason I'm not doing iConomy support is because my server doesn't use iConomy at all, and none of the users are interested in an abstract economy.
    That means that if I were to implement iConomy, even as an optional part, I would never spot the bugs in it during my own day-to-day operations.

    Also, iConomy and it's dependencies are pretty heavy duty stuff, and half the point of RepairChest is to be as light-weight as possible.

    Workaround: Set up a chest shop next to the repair chest, where people can buy Slime Balls (or whatever) for use in the repairs?
     
  10. Offline

    DragonSupremacy

    Well, the main reason for me to ask for iConomy is this:

    If an item is "used up" for repairs, that item is effectively removed from the game and thus the economy. Seeing as how the production server I am moderator on is a no-item-spawn server, it's less then desirable.
     
  11. Offline

    DemmyDemon

    No, it's not.

    It's not removed from the economy, it is invested in the tool. That tool is then used to mine blocks, so the gold you put into repairing the pickax goes into finding more gold. Only if you DO NOT repair the pickax is anything removed from the game/economy: The pickax breaks completely and is not recoverable.
     
  12. Offline

    DemmyDemon

    New release, 0.4.2.
    Highly recommended, as 0.4.1 and earlier will clobber any changes made to the configuration file if you /reload...
    Oooops.
     
  13. Offline

    kaasinees

    request grouping for permission nodes.
    rc.cmd.* (the commands)
    and
    rc.use.* (create use destroy)
     
  14. Offline

    DemmyDemon

    Good idea, but I don't want to change the permission nodes now. I'm working on a more generic framework for myself, for implementing Permissions, and it will (among other things) make migrating from one permission set to another quite a bit easier.
    When that happens, sure, I'll group them.

    I'll probably have "use" on it's own, however.
    rc.command.*
    rc.admin.*
    rc.use
     
  15. Offline

    DemmyDemon

    No changes and no new version, but I just tested RepairChest with 860, and found it to be working perfectly.
     
  16. Offline

    insertt

    Its working perfectly, it is a really great idea and i've implemented on my server,thanks :)
     
  17. Offline

    DemmyDemon

    You're very welcome. Let me know if you have any suggestions for improvements!
     
  18. Offline

    kaasinees

    Do you think you can add multiple currencies?
     
  19. Offline

    DemmyDemon

    Urrr, like what? 3 gold = 7 eggs = 12 snowballs?
    The way we solved it on my server is to use PhysicalShop to exchange other stuff for gold (and also buying said "other stuff" for gold, of course).
    1 diamond = 64 gold = 4096 coal
     
  20. Offline

    fatmarley

    So I like the idea of gold ingots or slimeballs...but is there anyway to set ownership on the repairchests, so that certain people can collect teh spent gold/slime?
     
  21. Offline

    DemmyDemon

    The spent gold/slime/wood/stone/whatever-you-want is converted into magical pixie dust that is sprinkled on the tool to make it all better. There is no retrieving it.
     
  22. Offline

    fatmarley

    So as a request, that is a no?

     
  23. Offline

    DemmyDemon

    Oh, sorry, it looked so much like a question I didn't realize it was a feature request.
    How should it work? For me, this seems completely useless, but if you detail it a bit more I could probably make it an optional feature.
     
  24. Offline

    fatmarley

    Long story short.... Click sign with gold ingot, gold ingot goes to a private chest of the owner of the sign...or hangs in limbo, player comes online and does something like /repair collect and he collects the gold ingots spent at his sign.

    Thanks a bunch if you can do this.
     
  25. Offline

    DemmyDemon

    Hmm, sure, it's relatively easy to do, but what does this player invest in the repair chest?
    If I do this, I'll also make creating a repair chest (optionally) cost something, so investing monies in a repair chest is a good idea only if you find a good spot for it...
    ...or something.

    Also, where does the material that repairs the chest come from?
     
  26. Offline

    HSAR

    Well, the ability to repair items is not something the average user has, so what you'd be adding is a way for the server operator to define a way to "earn" a repair chest creation abilities, in whichever way he/she pleases.

    I would suggest having a portion of the profits stored for the "owner", and a portion used to repair. Of course, you can't have portions of an ingot, so it'd probably run along the lines of "one ingot/item per X ingots/items inserted vanishes into the repair mechanism".
     
  27. Offline

    fatmarley

    Hsar is on the right track i think.
     
  28. Offline

    DemmyDemon

    HSAR, I think you've found an excellent solution.
    I was thinking of building something into the plugin to make it possible to see if the repair chest is in use, by storing just how much repairing it's doing, and this can tie right into that.
    It'll be great!
     
  29. Offline

    Joeyderijk

    How do i add a Wall Sign to my chest?Ö, it doesnt work for me :(
     
  30. Offline

    DemmyDemon

    Put the chest next to a wall, and put a sign over it on that wall.
    Now you have a wall sign above your chest.
     
  31. Offline

    Joeyderijk

    Oww haha, thanks ;p
     

Share This Page