MehVahdJukaar / mapatlases-neoforge

GNU General Public License v3.0
21 stars 5 forks source link

How I can add render custom stuff on the map? #101

Open slava110 opened 4 months ago

slava110 commented 4 months ago

Hi! I'm developing a mod with claiming system. I'd like to render claims on the map, but I'm not sure what's the best way to do it:

  1. Mixin into vanilla code and create custom decorations
  2. Use Moonlight library to add custom decorations (not preferrable, additional dependency)
  3. Find a way in your mod to render custom stuff directly Would be cool to have some sort of API to render custom stuff on the map (with the ability to add toggleable buttons on the side).
MehVahdJukaar commented 4 months ago

Hi. So map atlases functions very different from other map mods as it's not client sided and it's driven by the existing map system the game has. This means that adding and drawing stuff there is not as easy as it seems. I have a system that allows to easily add custom map markers. Moonligjt is a hard dependency of map atlases as it uses a bunch of it's map related features and all it's custom markers and pins are done this way. I'll go into more detail once you give me more info on what exactly you want to do, for instance do you want to add stuff to a Map or just the map atlases screen?

slava110 commented 4 months ago

I want to add overlays to the map rendered on the screen and I want to add additional overlay toggle button (see image below). I don't want to add extra item data if possible. I have 2 concepts for claiming system.

  1. Simple claiming system. Allow players to claim areas of the world freely (similar to WorldGuard): image
  2. Divide world into regions at generation and allow players to claim these regions (something similar to TownyProvinces)
MehVahdJukaar commented 4 months ago

Right so those boxes would not be map decorations at all as for one they would not belong to any map in particular and because even if they did they would span across multiple maps. It would be a sort of overlay applied to the screen. This requires some new code as nothing in the mod works like that. I'll see if I can come up with something but feel free to looking into making a pull request.

slava110 commented 4 months ago

Okay, thanks c: I'll submit pull request when other stuff in my mod will be ready for production (if we'll decide to actually use MapAtlases on our server)