Description
A simple API Adapter to allow CraftTweaker ZenScripts to access the Antique Atlas MarkerAPI methods to add markers and global markers to in-game Atlases. This is primarily a tool for modpack makers who wish to use the MarkerAPI without having to write a new mod - for example, to add a tool that automatically adds map markers when clicked on certain ores (see example), though Zenscript-savvy players may find it useful to add quality-of-life tweaks to their own local games.
Requires:
CraftTweaker (12.2-4.1.13)
Antique Atlas (1.12.2-4.5.0)
You will probably need to import the adapters into your ZenScript
import mods.AAMarkerAPI;
import mods.AAMarker;
Methods
AAMarker mods.AAMarkerAPI.putMarker(IWorld w, boolean visibleAhead, int atlasID, String markerType, String label, int x, int z)
AAMarker mods.AAMarkerAPI.putMarker(IWorld w, boolean visibleAhead, int atlasID, String markerType, String label, double x, double z)
AAMarker mods.AAMarkerAPI.putGlobalMarker(IWorld w, boolean visibleAhead, String markerType, String label, int x, int z)
AAMarker mods.AAMarkerAPI.putGlobalMarker(IWorld w, boolean visibleAhead, String markerType, String label, double x, double z)
int mods.AAMarkerAPI.putMarkerI(IWorld w, boolean visibleAhead, int atlasID, String markerType, String label, int x, int z)
int mods.AAMarkerAPI.putMarkerI(IWorld w, boolean visibleAhead, int atlasID, String markerType, String label, double x, double z)
int mods.AAMarkerAPI.putGlobalMarkerI(IWorld w, boolean visibleAhead, String markerType, String label, int x, int z)
int mods.AAMarkerAPI.putGlobalMarkerI(IWorld w, boolean visibleAhead, String markerType, String label, double x, double z)
void mods.AAMarkerAPI.deleteMarker(IWorld w, int atlasID, int markerID)
void mods.AAMarkerAPI.deleteGlobalMarker(IWorld w, int markerID)
The "double" overloads round off the given double-precision coordinates (such as those retrievable from crafttweaker.api.player.IPlayer) to integers, but otherwise function identically.
For more details on markerTypes and labels, see The Antique Atlas wiki
A Quick and Dirty Example ZS
import crafttweaker.events.IEventManager;
import crafttweaker.player.IPlayer;
import mods.AAMarkerAPI;
import mods.AAMarker;
//Clicking (left- or right-) on a the specified blocks with an Antique Atlas item in-hand will add a marker to that atlas
//Clicking on a spawner will add a marker with the "skull" icon, and the diamond ore will use the "diamond" icon
events.onPlayerInteract(function(event as crafttweaker.event.PlayerInteractEvent){
if (<antiqueatlas:antique_atlas:*>.matches(event.player.currentItem)) {
var atlasID as int;
var x as double;
var z as double;
var mkI as int;
var mkAAM as AAMarker;
if (!event.world.isRemote()){
atlasID = event.player.currentItem.metadata;
x = event.player.x;
z = event.player.z;
if ((<minecraft:mob_spawner>.asBlock()) in (event.block)){
mods.AAMarkerAPI.putMarker(event.world, false, atlasID, "skull", event.block.displayName , x, z);
event.player.sendMessage("Marker added");
event.cancel();
}
if ((<minecraft:diamond_ore>.asBlock()) in (event.block)){
mkI = mods.AAMarkerAPI.putMarkerI(event.world, false, atlasID, "diamond", event.block.displayName , x, z);
event.player.sendMessage("Marker added");
event.cancel();
}
if ((<minecraft:dirt>.asBlock()) in (event.block)){
mkAAM = mods.AAMarkerAPI.putMarker(event.world, false, atlasID, "google", event.block.displayName , x, z);
event.player.sendMessage("Marker added");
event.player.sendMessage("Nah, nevermind");
mods.AAMarkerAPI.deleteMarker(event.world, atlasID, mkAAM.getId());
event.player.sendMessage("Marker Deleted");
event.cancel();
}
}
}
});
AD
Become Premium to remove Ads!
What means Verified?
-
Compatibility: The mod should be compatible with the latest version of Minecraft and be clearly labeled with its supported versions.
-
Functionality: The mod should work as advertised and not cause any game-breaking bugs or crashes.
-
Security: The mod should not contain any malicious code or attempts to steal personal information.
-
Performance: The mod should not cause a significant decrease in the game's performance, such as by causing lag or reducing frame rates.
-
Originality: The mod should be original and not a copy of someone else's work.
-
Up-to-date: The mod should be regularly updated to fix bugs, improve performance, and maintain compatibility with the latest version of Minecraft.
-
Support: The mod should have an active developer who provides support and troubleshooting assistance to users.
-
License: The mod should be released under a clear and open source license that allows others to use, modify, and redistribute the code.
-
Documentation: The mod should come with clear and detailed documentation on how to install and use it.
AD
Become Premium to remove Ads!
How to Install
Download Forge & Java
Download Forge from the offical Site or here. If you dont have Java installed then install it now from here. After Downloading Forge you can run the file with Java.
Prepare
Lounch Minecraft and select your Forge istallation as Version this will create a Folder called Mods.
Add Mods
Type Win+R and type %appdata% and open the .minecraft Folder. There will you find your Folder called Mods. Place all Mods you want to play in this Folder
Enjoy
You are now Ready. Re-start your Game and start Playing.