Closed riddle closed 9 years ago
NBT for gui items is already in, just as in beacons, put
Awesome 😃
Is this all from this issue? I dont really get what the first part means - should every compass have custom nbt added by default? Also, it already has custom "name" on move/display.
I dont really get what the first part means - should every compass have custom nbt added by default?
Yes, through ProtocolLib, using Nanobot template. Look at how spells use dynamic templates. Otherwise there is no discoverability of this feature.
@eliadil Can you continue here? You know better where you store wanted data.
Just add bunch of NanobotUtil.replaceStringInItem here: https://github.com/CoreNetwork/Mantle/blob/development/src/main/java/us/corenetwork/mantle/restockablechests/CompassProtocolListener.java#L70
(For example like here: https://github.com/CoreNetwork/Mantle/blob/development/src/main/java/us/corenetwork/mantle/beacons/GUIBeaconStatus.java#L104)
Sure, I'll think what to display & when ;] Thanks for help.
Not sure at this hour, but I think nanobotUtil.replacestringinitem returns a copy of item stack. Wouldnt that require changing item in players inventory?
I copypasted needed code directly to compassProtocolListener for now.
Right, completely forgot about that. There was reason why I copy it though (which I also can't remember right now, damn).
I want every compass to display information in its label what to do with it. It can be applied when normal compass enters inventory, no issue with that.
When used, Compass should have a dynamic template when hovered displaying distance in its name and selected category in label. I can make a Nanobot template, just need variable support. ProtocolLib can be used to make it dynamic.
On top of that, separate templates for the GUI itself: