Interface IClientAPI
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWaypoint(String modId, Waypoint waypoint) Adds a waypointvoidaddWaypointGroup(WaypointGroup group) Adds a Waypoint group to the system.voiddisableFeature(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, Context.MapType mapType, boolean enable) Note: This method IS NOT SUPPORTED for most mods.booleanexists(Displayable displayable) Check whether a displayable exists in the Client API.List<? extends WaypointGroup> Gets an immutable list of all waypoint groups.Returns all waypoints that journeymap has stored for the current game/server.getAllWaypoints(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Gets all waypoints for the provided dimension from all of journeymap's waypoints.getDataPath(String modId) This call gets the current user's data path for saving custom addon data specific to the game/world the user is playing in.getUIState(Context.UI ui) Returns the current UIState of the UI specified.getWaypoint(String modId, String guid) Gets the waypoint by display Id for the modId provided.getWaypointGroup(String groupGuid) Gets a waypoint group from the group's guid.getWaypointGroupByName(String modId, String name) Gets a waypoint group from the name.List<? extends WaypointGroup> getWaypointGroups(String modId) Gets all waypoint groups for a modid.getWaypoints(String modId) Gets all waypoints for the provided modIdGets the worldId for the current world.booleanGets the minimap enabled or disabled statebooleanplayerAccepts(String modId, DisplayType displayType) Check whether player will accept a type of Displayable from your mod.voidremove(Displayable displayable) Remove a displayable from the player's maps.voidRemove all displayables.voidremoveAll(String modId, DisplayType displayType) Remove all displayables by DisplayType from the player's maps.voidremoveAllWaypoints(String modId) Remove all waypoints.voidremoveWaypoint(String modId, Waypoint waypoint) Remove a waypoint.voidremoveWaypointGroup(WaypointGroup group, boolean deleteWaypoints) Removes a waypoint group.voidremoveWaypointGroups(String modId, boolean deleteWaypoints) Removes groups for a modId.voidrequestMapTile(String modId, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, Context.MapType mapType, net.minecraft.world.level.ChunkPos startChunk, net.minecraft.world.level.ChunkPos endChunk, Integer chunkY, int zoom, boolean showGrid, Consumer<com.mojang.blaze3d.platform.NativeImage> callback) Note: This method IS NOT SUPPORTED for most mods.voidshow(Displayable displayable) Add (or update) a displayable object to the player's maps.voidtoggleMinimap(boolean enable) Toggles the minimmap display
-
Field Details
-
API_OWNER
- See Also:
-
API_VERSION
- See Also:
-
-
Method Details
-
getUIState
Returns the current UIState of the UI specified.Note: Context.UI.Any is not a meaningful parameter value here and will just return null.
- Parameters:
ui- Should be one of: Fullscreen, Minimap, or Webmap- Returns:
- the current UIState of the UI specified.
-
show
Add (or update) a displayable object to the player's maps. If you modify a Displayable after it has been added, call this method again to ensure the maps reflect your changes.If an object of the same Displayable.Type from your mod with the same displayId has already been added, it will be replaced.
Has no effect on display types not accepted by the player.
- Parameters:
displayable- The object to display.- Throws:
Exception- if the Displayable can't be shown.- See Also:
-
remove
Remove a displayable from the player's maps. Has no effect on display types not accepted by the player.- Parameters:
displayable- The object to display.- See Also:
-
removeAll
Remove all displayables by DisplayType from the player's maps. Has no effect on display types not accepted by the player.- Parameters:
modId- Mod iddisplayType- Display type- See Also:
-
removeAll
Remove all displayables. Has no effect on display types not accepted by the player.- Parameters:
modId- Mod id- See Also:
-
exists
Check whether a displayable exists in the Client API. A return value of true means the Client API has the indicated displayable, but not necessarily that the player has made it visible.Always returns false if the display type is not accepted by the player.
- Parameters:
displayable- the object- See Also:
-
playerAccepts
Check whether player will accept a type of Displayable from your mod. (Like Displayables or Overlays).- Parameters:
modId- Mod iddisplayType- Display type to check- Returns:
- true if player accepts addition/removal of displayables
- See Also:
-
requestMapTile
void requestMapTile(String modId, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, Context.MapType mapType, net.minecraft.world.level.ChunkPos startChunk, net.minecraft.world.level.ChunkPos endChunk, @Nullable Integer chunkY, int zoom, boolean showGrid, Consumer<com.mojang.blaze3d.platform.NativeImage> callback) Note: This method IS NOT SUPPORTED for most mods. Misuse will lead to severe performance issues. Talk to Techbrew if you need to use this function.Asynchonrously request a BufferedImage map tile from JourneyMap. Requests may be throttled, so use sparingly. The largest image size that will be returned is 512x512 px.
- Parameters:
modId- Mod iddimension- The dimensionmapType- The map typestartChunk- The NW chunk of the tile.endChunk- The SW chunk of the tile.chunkY- The vertical chunk (slice) if the maptype isn't day/night/topozoom- The zoom level (0-8)showGrid- Whether to include to include the chunk grid overlaycallback- A callback function which will provide a BufferedImage when/if available. If it returns null, then no image available.
-
disableFeature
void disableFeature(@Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, Context.MapType mapType, boolean enable) Note: This method IS NOT SUPPORTED for most mods. Talk to Techbrew if you need to use this function.This call can be used to enable or disable map types and UIs in a specific dimension or all dimensions.
- Parameters:
dimension- The dimension. Use null for all dimensions.mapType- The map typeenable- True to enable, false to disable.
-
getDataPath
This call gets the current user's data path for saving custom addon data specific to the game/world the user is playing in.This is only valid when Journeymap is mapping. Mods ideally should store this value on
MappingEvent.Stage.MAPPING_STARTEDevent.Note: Will method return null if not in world or not mapping. The path is flushed right after
MappingEvent.Stage.MAPPING_STOPPED- Parameters:
modId- The ModId- Returns:
- a path similar to ./journeymap/data/{sp|mp}/{worldname}/addon-data/{modid}/
-
getAllWaypoints
Returns all waypoints that journeymap has stored for the current game/server. Modifying these waypoints will not change anything in game, they are just a copy.- Returns:
- - List of all waypoints.
-
getAllWaypoints
List<? extends Waypoint> getAllWaypoints(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Gets all waypoints for the provided dimension from all of journeymap's waypoints. Modifying these waypoints will not change anything in game, they are just a copy.- Parameters:
dim- - The dimension- Returns:
- The waypoints.
-
getWaypoint
Gets the waypoint by display Id for the modId provided.- Parameters:
modId- - The modIdguid- - The guid- Returns:
- The waypoint.
-
getWaypoints
Gets all waypoints for the provided modId- Parameters:
modId- - The modId- Returns:
- the waypoint list
-
removeWaypoint
Remove a waypoint.- Parameters:
modId- - The modIdwaypoint- - the waypoint
-
addWaypoint
Adds a waypoint- Parameters:
modId- - The modIdwaypoint- - the waypoint
-
removeAllWaypoints
Remove all waypoints.- Parameters:
modId- - The modId
-
addWaypointGroup
Adds a Waypoint group to the system. -
getWaypointGroup
Gets a waypoint group from the group's guid.- Parameters:
groupGuid- the guid- Returns:
- the group.
-
getWaypointGroupByName
Gets a waypoint group from the name. (not case-sensitive) If multiple are found, returns the first one.- Parameters:
modId- the modIdname- the group name- Returns:
- the group.
-
getWaypointGroups
Gets all waypoint groups for a modid.- Parameters:
modId- the modId- Returns:
- the immutable list of groups
-
getAllWaypointGroups
List<? extends WaypointGroup> getAllWaypointGroups()Gets an immutable list of all waypoint groups.- Returns:
- the immutable list of groups
-
removeWaypointGroup
Removes a waypoint group. Setting deleteWaypoints to false, will move all waypoints in the Default group.- Parameters:
group- the groupdeleteWaypoints- to delete all waypoints in group
-
removeWaypointGroups
Removes groups for a modId. Setting deleteWaypoints to false, will move all waypoints in the Default group.- Parameters:
modId- - the modIddeleteWaypoints- to delete all waypoints in group
-
getWorldId
String getWorldId()Gets the worldId for the current world.- Returns:
- worldId.
-
toggleMinimap
void toggleMinimap(boolean enable) Toggles the minimmap display- Parameters:
enable- - enable or disable
-
minimapEnabled
boolean minimapEnabled()Gets the minimap enabled or disabled state- Returns:
- - true or false
-