Optional switch to ignore damage value and/or enchantment #843


  • New
  • Accepted
Open
Assigned to acrobotpl
  • _ForgeUser7883532 created this issue May 4, 2014

    I'm looking for a way to buy items from other players, items that can have damage value and/or enchants. eg to buy diamond picks (id 278), regardless of their condition, and/or enchantment. Couldnt find any documented info on that issue, like wildcards or simmilar, but i did tried ingame with several friends, here are my conclusions:

    1. If you set just item ID , in this example 278, other players can only sell you brand new diamond picks.
    2. To cover every possible value of damaged picks i need to make 1300+ chest shops.
    3. To cover all possible enchanted picks ... with all possible damage values ... well you get the picture.

    I could use a simple solution, optional switch in ID line of Sign used to create chest shop, to ignore damage value and or enchants string on selling ...

    unless you know better way ...

  • _ForgeUser7883532 added the tags New Enhancment May 4, 2014
  • AcrobotPL posted a comment May 4, 2014

    Sorry, but not really that possible. All the items are different to Bukkit, and, even worse, one can't see whether an item is damaged or the damage value is used as an indicator of type (such as logs/wool).

  • _ForgeUser7883532 posted a comment May 5, 2014

    I dont know if it is possible or not, and i'm not java programer, but i am C programmer, i do know that strings can be clipped and/or truncated, so to summarize my opinion i could immagine situation where 2 items that begin with same 3 strings can be treated of the same type (that is example not a rule), however i do understand that some items begin with 1, some with 2 and some with 3 chars. That makes evaluation somewhat difficult, but not impossible considering damage values are sepparated with colons.

    So basicly sample string "278:1200#1c" can be clipped to colon mark and then evaluated against another , also clipped string. Let me show example of another aproach "diamond_Pick:1200#1c". Again colon is a mark.

    Also i didnt asked it to be appliable to just any item, but those player chooses to buy in chest shop (as owner of chest, other players do sell to owner).

    Let me be more specific on what i expected to acomplish: I as player place chest shop to buy all diamond picks from others, damaged enchanted just any diamond pick for the same price.

    Now, if you need more information i'll be glad to explain.

    Regards, and thank you for response.


    Edited May 5, 2014
  • _ForgeUser7883532 removed a tag Waiting May 5, 2014
  • _ForgeUser7883532 added a tag Replied May 5, 2014
  • AcrobotPL posted a comment May 6, 2014

    @gusartranzit: Go Hah, sorry, but it is not the issue of string trimming - that part is really easy. What is hard is Notch's fault - from current code's standpoint, I have no idea if the damage value is a property of a material (such as colour) or its durability (how many times it had been used).

    But even if we figured it out, how could it be written on the sign? Remember, that we have to regain backwards-compatibility with older signs and we're limited to 15 characters per line of the sign.

  • AcrobotPL removed a tag Replied May 6, 2014
  • AcrobotPL added a tag Waiting May 6, 2014
  • _ForgeUser7883532 posted a comment May 6, 2014

    k, i see your point, let me try another aproach:

    third line - B for buy price S for sell price C for sell price with trimming item strings.

    S = C , with difference of trimming item strings

    that covers limits of sign strings

    4th line - item ID, no other data

    So to use C in third line is to ignore, not to know propperty, or whatsoever, but to ignore it.

    lets say i put C 10 in third line (players sell items to chest for 10 with trimming)

    and put 17 in fourth line (oak log)

    now id of spruce is 17:1 birch 17:2 etc

    chest shop accepts any log, just ignore values behind 17, you don't need to know them, you need to ignore them.

    Ok now wool

    C 10 in third line (players selling items to chest for 10 with trimming)

    4th line id 35 (white wool)

    now orange is 35:1 magenta 35:2 etc

    Chest shop accepts any wool i dont care what colour, again i need to ignore data value, dont want to know it.

    lets move on, diamond picks

    C 10 in 3rd line

    4th line id 278

    chest shop accepts any diamond pick, doesnt care how many times used, or how it is enchanted, again, just ignore values behind ID, dont need to know them.

    i would be idiot to put both B and C (hypotetical) on that chest in third line, basicly i need just C.

    Alright i understand its Notch's fault that you dont have idea if the damage value is propperty of material or its durability, but i'm not asking you to know it, i ask to ignore it.

    Thank you for your time spent on this issue, i am sure being a hard-case, and i appologize if it causes problems.

    Regards

  • _ForgeUser7883532 removed a tag Waiting May 6, 2014
  • _ForgeUser7883532 added a tag Replied May 6, 2014
  • AcrobotPL posted a comment May 7, 2014

    @gusartranzit: Go And what about the prices? Surely we can't just accept a damaged pick with the same price as a new pick. Now, how do we know it's damaged? We want to accept all log types with the same price per item, because in this case, the durability is not an indicator of "brokenness".

  • _ForgeUser7883532 posted a comment May 8, 2014

    Prices? Thats the whole point, same price for any picks, i realy doubt anyone will sell new pick there, only very damaged picks close to breaking, whole point is to buy of those very damaged picks from other players, repair them and sell them for a new price in different chest. Same idea goes for armors too. Something like blacksmiths shope and services. Idea came to my mind to stimulate economy on server, rather than to waste very-depleted picks, armors and such.

    Players are not dumb, they will not sell picks if they dont want to for the named price, but if they are willing, they are most welcome, i will not argue their choice.

    As side-effect same option will allow logs , wool and stuff like that to be sold at single chest instead of multiple chests. Saves space. And yes any logs and any wool at same price. Thats general idea.

  • AcrobotPL posted a comment May 9, 2014

    @gusartranzit: Go Hmm, I guess I could implement that. However, if anyone complains, I will direct them to you ;)

  • AcrobotPL removed a tag Replied May 9, 2014
  • AcrobotPL added a tag Accepted May 9, 2014
  • _ForgeUser7883532 posted a comment May 9, 2014

    Top man, thanks.

  • Atrius_97 posted a comment Jul 19, 2014

    Has this been implemented yet? I've been looking for a way to make a shop ignore data values and make the chest just pick a random item, regardless of extra data. If this exists already, could someone please tell me how to create a chest shop that ignores extra data as described below?


    Edited Jul 19, 2014
  • AcrobotPL posted a comment Jul 20, 2014

    Not yet, sorry - been concentrating on the UUID switch.


To post a comment, please login or register a new account.