[Suggestion/Request] Expose MarkerAPI to Crafttweaker/Modtweaker?
Targren opened this issue ยท 7 comments
Just a humble request.
For context of what I'd like to do, my thought was to add a ZenScript that would allow players to right-click a block with their Antique Atlas and automatically add a marker (details specified by the script) at their location.
E.g., something like this for mob spawners (incomplete demonstration of concept)
events.onPlayerInteract(function(event as crafttweaker.event.PlayerInteractEvent){
if (<antiqueatlas:antique_atlas>.matches(event.player.currentItem)) {
if ((<minecraft:mob_spawner>.asBlock()) in (event.block)){
//Getting world, dimension, atlas IDs etc...
//visibleAhead...maybe? Not sure what it does
mods.AntiqueAtlas.MarkerAPI.putMarker(worldID, visibleAhead, "skull", spawnerMob + " spawner", event.player.x, event.player.z);
}
}
I'm not sure it's worthwhile to anyone but me, but I figured it wouldn't hurt to suggest it. Thanks.
Yeah, the idea was inspired by getting tired of creepers sneaking up on me while I was marking Geolosys samples in SevTech. :) I just didn't use it as an example since I was hoping to present a more universal utility. :)
Would definetely lead me to use AA instead of other mapping mods, as I find it more aesthetically pleasing and immersive :D
Expanding that system to allow easily defined markers to be made could lead to some interesting uses :D from marking chests, to ore deposits, to any other resource.
I should mention that there is a marker API. I haven't put up a 1.12.2 release on github yet, but if you want to, you can use this to markers appear at will from outside of the mod. It might be some time until I can get figure out craft tweaker.
Cloning the repository, checking out 1.12.2, and grunt build
will get you the sources jar, even if I didn't release it. It's how I made AntiqueAtlasOverlay before it was integrated into the mod.
@Kenkron Yeah, what I was suggesting is a CraftTweaker interface to that API itself, so that ZenScripts could access it. Learning modern Forge modding is on my to-do list, so it's just a question of whether it takes me longer to figure that out than it takes you to figure out CT. ;)
Seems like Targren figured it out, there is a mod doing this: https://minecraft.curseforge.com/projects/antique-atlas-crafttweaker-api-adapter?gameCategorySlug=mc-mods&projectID=294725