| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
API_OWNER |
static java.lang.String |
API_VERSION |
| Modifier and Type | Method and Description |
|---|---|
void |
addWaypoint(java.lang.String modId,
Waypoint waypoint)
Adds a waypoint
|
void |
addWaypointGroup(WaypointGroup group)
Adds a Waypoint group to the system.
|
void |
disableFeature(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension,
Context.MapType mapType,
boolean enable)
Note: This method IS NOT SUPPORTED for most mods.
|
boolean |
exists(Displayable displayable)
Check whether a displayable exists in the Client API.
|
java.util.List<? extends WaypointGroup> |
getAllWaypointGroups()
Gets an immutable list of all waypoint groups.
|
java.util.List<? extends Waypoint> |
getAllWaypoints()
Returns all waypoints that journeymap has stored for the current game/server.
|
java.util.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.
|
java.io.File |
getDataPath(java.lang.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.
|
UIState |
getUIState(Context.UI ui)
Returns the current UIState of the UI specified.
|
Waypoint |
getWaypoint(java.lang.String modId,
java.lang.String guid)
Gets the waypoint by display Id for the modId provided.
|
WaypointGroup |
getWaypointGroup(java.lang.String groupGuid)
Gets a waypoint group from the group's guid.
|
WaypointGroup |
getWaypointGroupByName(java.lang.String modId,
java.lang.String name)
Gets a waypoint group from the name.
|
java.util.List<? extends WaypointGroup> |
getWaypointGroups(java.lang.String modId)
Gets all waypoint groups for a modid.
|
java.util.List<? extends Waypoint> |
getWaypoints(java.lang.String modId)
Gets all waypoints for the provided modId
|
java.lang.String |
getWorldId()
Gets the worldId for the current world.
|
boolean |
minimapEnabled()
Gets the minimap enabled or disabled state
|
boolean |
playerAccepts(java.lang.String modId,
DisplayType displayType)
Check whether player will accept a type of Displayable from your mod.
|
void |
remove(Displayable displayable)
Remove a displayable from the player's maps.
|
void |
removeAll(java.lang.String modId)
Remove all displayables.
|
void |
removeAll(java.lang.String modId,
DisplayType displayType)
Remove all displayables by DisplayType from the player's maps.
|
void |
removeAllWaypoints(java.lang.String modId)
Remove all waypoints.
|
void |
removeWaypoint(java.lang.String modId,
Waypoint waypoint)
Remove a waypoint.
|
void |
removeWaypointGroup(WaypointGroup group,
boolean deleteWaypoints)
Removes a waypoint group.
|
void |
removeWaypointGroups(java.lang.String modId,
boolean deleteWaypoints)
Removes groups for a modId.
|
void |
requestMapTile(java.lang.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,
java.lang.Integer chunkY,
int zoom,
boolean showGrid,
java.util.function.Consumer<com.mojang.blaze3d.platform.NativeImage> callback)
Asynchronously request a map tile image from JourneyMap.
|
void |
show(Displayable displayable)
Add (or update) a displayable object to the player's maps.
|
void |
toggleMinimap(boolean enable)
Toggles the minimmap display
|
static final java.lang.String API_OWNER
static final java.lang.String API_VERSION
@Nullable UIState getUIState(Context.UI ui)
Note: Context.UI.Any is not a meaningful parameter value here and will just return null.
ui - Should be one of: Fullscreen, Minimap, or Webmapvoid show(Displayable displayable) throws java.lang.Exception
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.
displayable - The object to display.java.lang.Exception - if the Displayable can't be shown.playerAccepts(String, DisplayType)void remove(Displayable displayable)
displayable - The object to display.playerAccepts(String, DisplayType)void removeAll(java.lang.String modId,
DisplayType displayType)
modId - Mod iddisplayType - Display typeplayerAccepts(String, DisplayType)void removeAll(java.lang.String modId)
modId - Mod idplayerAccepts(String, DisplayType)boolean exists(Displayable displayable)
Always returns false if the display type is not accepted by the player.
displayable - the objectplayerAccepts(String, DisplayType)boolean playerAccepts(java.lang.String modId,
DisplayType displayType)
modId - Mod iddisplayType - Display type to checkDisplayTypevoid requestMapTile(java.lang.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
java.lang.Integer chunkY,
int zoom,
boolean showGrid,
java.util.function.Consumer<com.mojang.blaze3d.platform.NativeImage> callback)
modId - The calling mod's iddimension - The dimensionmapType - The map typestartChunk - The NW chunk of the tileendChunk - The SE chunk of the tilechunkY - The vertical chunk (slice) if the map type isn't day/night/topozoom - The zoom level (0-8)showGrid - Whether to include the chunk grid overlaycallback - A callback which will receive the NativeImage when available, or null if unavailablevoid disableFeature(@Nullable
net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension,
Context.MapType mapType,
boolean enable)
This call can be used to enable or disable map types and UIs in a specific dimension or all dimensions.
dimension - The dimension. Use null for all dimensions.mapType - The map typeenable - True to enable, false to disable.@Nullable java.io.File getDataPath(java.lang.String modId)
This is only valid when Journeymap is mapping. Mods ideally should store this value on
MappingEvent.Stage#MAPPING_STARTED event.
Note: Will method return null if not in world or not mapping.
The path is flushed right after
MappingEvent.Stage#MAPPING_STOPPED
modId - The ModIdjava.util.List<? extends Waypoint> getAllWaypoints()
java.util.List<? extends Waypoint> getAllWaypoints(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim)
dim - - The dimension@Nullable Waypoint getWaypoint(java.lang.String modId, java.lang.String guid)
modId - - The modIdguid - - The guidjava.util.List<? extends Waypoint> getWaypoints(java.lang.String modId)
modId - - The modIdvoid removeWaypoint(java.lang.String modId,
Waypoint waypoint)
modId - - The modIdwaypoint - - the waypointvoid addWaypoint(java.lang.String modId,
Waypoint waypoint)
modId - - The modIdwaypoint - - the waypointvoid removeAllWaypoints(java.lang.String modId)
modId - - The modIdvoid addWaypointGroup(WaypointGroup group)
WaypointGroup getWaypointGroup(java.lang.String groupGuid)
groupGuid - the guidWaypointGroup getWaypointGroupByName(java.lang.String modId, java.lang.String name)
name - the group namemodId - the modIdjava.util.List<? extends WaypointGroup> getWaypointGroups(java.lang.String modId)
modId - the modIdjava.util.List<? extends WaypointGroup> getAllWaypointGroups()
void removeWaypointGroup(WaypointGroup group, boolean deleteWaypoints)
group - the groupdeleteWaypoints - to delete all waypoints in groupvoid removeWaypointGroups(java.lang.String modId,
boolean deleteWaypoints)
modId - - the modIddeleteWaypoints - to delete all waypoints in groupjava.lang.String getWorldId()
void toggleMinimap(boolean enable)
enable - - enable or disableboolean minimapEnabled()