Fix tr’s item manipulation weakness
gerzytet opened this issue · 7 comments
Tr’s executors and placeholders are strong in many areas, but they lack ways to work with items.
The problem is that we offer access to items and information about those items, but always at the same time.
For example, $helditemid can get the held item and find its ID but you can’t use the held item somewhere else and you can’t find the ID of a different item.
The solution is to split it into 2 separate placeholders: $id:{item} and $helditem
Similar splits need to happen for other placeholders and executors.
Some other functionality is missing altogether and splitting existing executors won’t fix it.
Here’s a list of executors and placeholders that would be necessary to support the most common uses of items (that I know of):
Placeholders:
General:
- - $helditem
- - $offhanditem
- - $playerinv:{slot}
- - $id:{item}
- - $name:{item}
- - $lore:{item} (returns the whole lore as a multi line string)
- - $idname:{item} (the material name)
- Inventory trigger:
- - $slot:{index} (preparing for #191 )
Executors:
General:
- - #sethelditem {item}
- - #setslot {slot}, {item}
- - #setoffhand {item}
- - #setplayerinv {slot}, {item}
- - #setlore {lore}, {item}
- - #setname {name}, {item}
- Inventory trigger:
You may be tempted to put this off until 3.1 or later, but I believe this deserves to be added to 3.0. So far, the biggest accomplishments for 3.0 have been:
- /trg timings, from wysohn
- the PAPI extension, from pro_snape
- executor validation, from me
All of these only benefit users doing very specific things.
However, lots of users ask about item manipulation, since it’s a common use case.
Sounds good since we will have to add Trigger specific Executors and Placeholders (#163), so we can do this alongside the new Executors and Placeholders.
But we will have to finish the validation system first
@wysohn
I finished all unit tests each. However, $playerinv, $slot, #SETPLAYERINV, #SETSLOT weren't implemented in sponge since I have no idea how to set/get item on specific slot.
If these things are implemented and tested in-game, everything is done.
@rkdrns4747
Which of the listed items are done? Is #229 addressed?
I'm trying to wrap up everything for 3.0.0, so let me know the progression.
I also edited the original proposal so that we can use the checklist. Just check the part where you have finished, then I can work on the rest. It would be great if you can finish all of them though.
(Finished means 1.implemented, 2.unit tests are written, and 3.tested in-game)
@rkdrns4747
Nice, I will cover that part. It is indeed kind of complex since Sponge team still do not have documentation of how inventory system work. It's somewhat hard to explain too anyway.
@wysohn Are they test-required?
@rkdrns4747
I've done the non-functional testing with the Sponge server open, but you are free to test it on your own.
More test is always better.
@wysohn alright