SentixDev / squaremarker

Simple marker addon for squaremap.
14 stars 4 forks source link

Command added to set a marker at a given location: setat #27

Closed Wolfdv1 closed 2 months ago

Wolfdv1 commented 2 months ago

Usage example:

/marker setat minecraft:overworld 144.5 -1900 Testmarker https://icon-library.com/images/test-icon/test-icon-4.jpg

Sets a new marker on the squaremap, in the minecraft:overworld dimension, at coordinates x=144.5 z=-1900 with the name Testmarker and this url

Provided that namespace:dimensionpath is a valid dimension currently registered on the map, x, z are valid numbers (doubles). (if the name or url are left out, the default 'set' command behavior of setting a nameless default marker holds)

Suggestion from Issues#7
jpenilla commented 2 months ago

This needs to make proper use of cloud, ie marker setat <world> <position> <name> [icon_url] using keyedWorldParser(), location2DParser(), stringParser() and greedyStringParser().

Wolfdv1 commented 2 months ago

Yeah this was my first approach, I struggled to find any documentation on Minecraft specific parsers- only saw the general ones in base cloud, and these were understandably unhappy to work.

Started writing my own parsers and suggestion managers however it quickly got out of hand- so just reverted to the style of parsing without using suggestions like the other existing commands use. Wanted something that would work, even if it lacked some UX goodness.

Now I know the ootb parsers do exist, should I revert my local commits to when I was using individual parsers, and update the pr with these?

The only other snag I caught with UX was for suggestions on the dimension- couldn't find a way to dynamically update the command with the latest list of valid dimensions/worlds from squaremap - since the command is registered on initialisation (and even before Squaremap API is initialised) if I should go ahead, do you have any suggestions for what I should look into to keep the suggestions for this always up to date?

Wolfdv1 commented 2 months ago

Hi, unless I am mistaken keyedWorldParser is for paper only, and location2DParser for craftbukkit servers only- I see no way making more use of cloud with these, unless I am mistaken? -regardless might abandon this, since its working for what I need, and codespace wise it makes proper use of cloud as much as the other commands in this addon haha!