jpenilla / squaremap

squaremap is a minimalistic and lightweight world map viewer for Minecraft servers, using the vanilla map rendering style
https://modrinth.com/plugin/squaremap
Other
338 stars 41 forks source link

API docs for making addons are scarce #231

Open talwat opened 5 months ago

talwat commented 5 months ago

Hi!

I'm making a custom land claim plugin, and I wanted to use the squaremap API to display claims on the map. Unfortunately, in the wiki, there is only one section about the "basics" that uses a bunch of terminology that isn't really explained.

So, I wanted to ask how I would go about learning the squaremap API and actually making something, despite the limited amount of information. This issue also serves just to ask whether the API docs will eventually be written or not.

TaggartMaher commented 2 months ago

@talwat Did you ever figure it out? I am also making a plugin and I cannot, for the life of me understand how to use this api. Chatgpt is tripping giving me something like this Squaremap squaremap = (Squaremap) getServer().getPluginManager().getPlugin("Squaremap"); WorldIdentifier overworld_identifier = WorldIdentifier.create("minecraft", "overworld"); Optional overworld = squaremap.getWorldIfEnabled(overworld_identifier); if (overworld.isPresent()) { Marker marker = Marker.icon(Point.of(55, 55), Icon.rectangle(Point.of(0, 0), Point.of(10, 10))., 10); }

    i cannot get it to work. Is there any other projects that have got this to work?
talwat commented 2 months ago

Yeah, eventually, but squaremap is pretty similar to dynmap so as a desperate last attempt I checked the dynmap docs to fill in the gaps & used intellisense to find the right classes. It's all we have for now.

You could also take a look at my project to get an idea of how it works.