Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions common/src/main/java/journeymap/api/v2/client/IClientAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import journeymap.api.v2.client.display.Displayable;
import journeymap.api.v2.client.event.MappingEvent;
import journeymap.api.v2.client.util.UIState;
import journeymap.api.v2.common.CommonAPI;
import journeymap.api.v2.common.waypoint.Waypoint;
import journeymap.api.v2.common.waypoint.WaypointGroup;
import net.minecraft.resources.ResourceKey;
Expand All @@ -42,7 +43,7 @@
* Definition for the JourneyMap Client API.
*/
@ParametersAreNonnullByDefault
public interface IClientAPI
public interface IClientAPI extends CommonAPI
{
String API_OWNER = "journeymap";
String API_VERSION = "2.0.0-SNAPSHOT";
Expand Down Expand Up @@ -268,7 +269,7 @@ void requestMapTile(String modId, ResourceKey<Level> dimension, Context.MapType

/**
* Removes a waypoint group.
* Setting deleteWaypoints to false, will move all waypoints in the Default group.
* Setting deleteWaypoints to false will move all waypoints in the Default group.
*
* @param group the group
* @param deleteWaypoints to delete all waypoints in group
Expand All @@ -277,7 +278,7 @@ void requestMapTile(String modId, ResourceKey<Level> dimension, Context.MapType

/**
* Removes groups for a modId.
* Setting deleteWaypoints to false, will move all waypoints in the Default group.
* Setting deleteWaypoints to false will move all waypoints in the Default group.
*
* @param modId - the modId
* @param deleteWaypoints to delete all waypoints in group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

package journeymap.api.v2.client;

import journeymap.api.v2.common.IJourneyMapPlugin;
import journeymap.api.v2.common.JourneyMapPlugin;
import journeymap.api.v2.common.event.ClientEventRegistry;

import javax.annotation.ParametersAreNonnullByDefault;
Expand All @@ -30,7 +32,7 @@
* Implementation classes must have a no-arg constructor and also have the {@link JourneyMapPlugin} annotation.
*/
@ParametersAreNonnullByDefault
public interface IClientPlugin
public interface IClientPlugin extends IJourneyMapPlugin<IClientAPI>
{
/**
* Called by JourneyMap during the init phase of mod loading. Your implementation
Expand All @@ -44,8 +46,4 @@ public interface IClientPlugin
*/
void initialize(final IClientAPI jmClientApi);

/**
* Used by JourneyMap to associate your mod id with your plugin instance.
*/
String getModId();
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@
* <p>
* Classes with this annotation must have a no-arg constructor
* and must also implement the {@link IClientPlugin} interface.
*
* @deprecated this will be removed, please use {@link journeymap.api.v2.common.JourneyMapPlugin}
* This will be removed when the API is out of snapshot phase.
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Deprecated(forRemoval = true, since = "2.0.0")
public @interface JourneyMapPlugin
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ public class BooleanOption extends Option<Boolean>

/**
* Boolean - creates a checkbox
* For tooltips, your i18n key plus .tooltip in your language json example mod.option.label and mod.option.label.tooltip
* For tooltips, your i18n key plus .tooltip in your language json example: "mod.option.label" and "mod.option.label.tooltip"
*
* @param category - The category;
* @param fieldName - The fieldName;
* @param label - The label, can be the display string or i18n key.
* @param label - The label can be the display string or i18n key.
* @param defaultValue - The default value
*/
public BooleanOption(OptionCategory category, String fieldName, String label, Boolean defaultValue)
Expand All @@ -21,13 +21,13 @@ public BooleanOption(OptionCategory category, String fieldName, String label, Bo

/**
* Boolean - creates a checkbox
* For tooltips, your i18n key plus .tooltip in your language json example mod.option.label and mod.option.label.tooltip
* For tooltips, your i18n key plus .tooltip in your language json example: "mod.option.label" and "mod.option.label.tooltip"
*
* @param category - The category;
* @param fieldName - The fieldName;
* @param label - The label, can be the display string or i18n key.
* @param label - The label can be the display string or i18n key.
* @param defaultValue - The default value
* @param isMaster - Makes this value first in the last, and if disabled the whole category is disabled.
* @param isMaster - Makes this value first in the list, and if disabled, the whole category is disabled.
*/
public BooleanOption(OptionCategory category, String fieldName, String label, Boolean defaultValue, Boolean isMaster)
{
Expand Down
198 changes: 0 additions & 198 deletions common/src/main/java/journeymap/api/v2/client/util/PluginHelper.java

This file was deleted.

This file was deleted.

5 changes: 5 additions & 0 deletions common/src/main/java/journeymap/api/v2/common/CommonAPI.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package journeymap.api.v2.common;

public interface CommonAPI
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package journeymap.api.v2.common;

import org.jetbrains.annotations.ApiStatus;

@ApiStatus.Internal
public interface IJourneyMapPlugin<T extends CommonAPI>
{
/**
* Used by JourneyMap to associate your mod id with your plugin instance.
*/
String getModId();

void initialize(final T api);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* JourneyMap API (http://journeymap.info)
* http://github.com/TeamJM/journeymap-api
*
* Copyright (c) 2011-2016 Techbrew. All Rights Reserved.
* The following limited rights are granted to you:
*
* You MAY:
* + Write your own code that uses the API source code in journeymap.* packages as a dependency.
* + Write and distribute your own code that uses, modifies, or extends the example source code in example.* packages
* + Fork and modify any source code for the purpose of submitting Pull Requests to the TeamJM/journeymap-api repository.
* Submitting new or modified code to the repository means that you are granting Techbrew all rights to the submitted code.
*
* You MAY NOT:
* - Distribute source code or classes (whether modified or not) from journeymap.* packages.
* - Submit any code to the TeamJM/journeymap-api repository with a different license than this one.
* - Use code or artifacts from the repository in any way not explicitly granted by this license.
*
*/

package journeymap.api.v2.common;

import journeymap.api.v2.client.IClientPlugin;
import journeymap.api.v2.server.IServerPlugin;

import javax.annotation.Nullable;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Used by JourneyMap to discover and classload plugin classes.
* <p>
* Classes with this annotation must have a no-arg constructor
* and must also implement the {@link IClientPlugin} interface for client plugins
* or {@link IServerPlugin} interface for server plugins.
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface JourneyMapPlugin
{
/**
* Mod Devs can supply the version of journeymap-api the mod was built against,
* so that it will not load the plugin if there is a breaking change.
*
* @return - The Api Version
*/
@Nullable
String apiVersion();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package journeymap.api.v2.common.tuple;

public record Tuple2<A, B>(A a, B b)
{
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package journeymap.api.v2.client.util.tuple;
package journeymap.api.v2.common.tuple;

public record Tuple3<A, B, C>(A a, B b, C c)
{
Expand Down
Loading