Skip to content

Commit 48e54a2

Browse files
committed
add common api
1 parent fd150de commit 48e54a2

6 files changed

Lines changed: 14 additions & 6 deletions

File tree

common/src/main/java/journeymap/api/v2/client/IClientAPI.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import journeymap.api.v2.client.display.Displayable;
2727
import journeymap.api.v2.client.event.MappingEvent;
2828
import journeymap.api.v2.client.util.UIState;
29+
import journeymap.api.v2.common.CommonAPI;
2930
import journeymap.api.v2.common.waypoint.Waypoint;
3031
import journeymap.api.v2.common.waypoint.WaypointGroup;
3132
import net.minecraft.resources.ResourceKey;
@@ -42,7 +43,7 @@
4243
* Definition for the JourneyMap Client API.
4344
*/
4445
@ParametersAreNonnullByDefault
45-
public interface IClientAPI
46+
public interface IClientAPI extends CommonAPI
4647
{
4748
String API_OWNER = "journeymap";
4849
String API_VERSION = "2.0.0-SNAPSHOT";

common/src/main/java/journeymap/api/v2/client/IClientPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* Implementation classes must have a no-arg constructor and also have the {@link JourneyMapPlugin} annotation.
3333
*/
3434
@ParametersAreNonnullByDefault
35-
public interface IClientPlugin extends IJourneyMapPlugin
35+
public interface IClientPlugin extends IJourneyMapPlugin<IClientAPI>
3636
{
3737
/**
3838
* Called by JourneyMap during the init phase of mod loading. Your implementation
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package journeymap.api.v2.common;
2+
3+
public interface CommonAPI
4+
{
5+
}

common/src/main/java/journeymap/api/v2/common/IJourneyMapPlugin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
import org.jetbrains.annotations.ApiStatus;
44

55
@ApiStatus.Internal
6-
public interface IJourneyMapPlugin
6+
public interface IJourneyMapPlugin<T extends CommonAPI>
77
{
88
/**
99
* Used by JourneyMap to associate your mod id with your plugin instance.
1010
*/
1111
String getModId();
1212

13+
void initialize(final T api);
1314
}

common/src/main/java/journeymap/api/v2/server/IServerAPI.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package journeymap.api.v2.server;
22

3+
import journeymap.api.v2.common.CommonAPI;
34
import journeymap.api.v2.common.waypoint.Waypoint;
45
import net.minecraft.server.level.ServerPlayer;
56

@@ -10,7 +11,7 @@
1011
* Currently unused, just a placeholder. Please do not code any of this as it will likely change.
1112
*/
1213
@Deprecated
13-
public interface IServerAPI
14+
public interface IServerAPI extends CommonAPI
1415
{
1516
/**
1617
* Gets all the waypoints stored for the target Server Player.

common/src/main/java/journeymap/api/v2/server/IServerPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* <p>
99
* Implementation classes must have a no-arg constructor and also have the {@link JourneyMapPlugin} annotation.
1010
*/
11-
public interface IServerPlugin extends IJourneyMapPlugin
11+
public interface IServerPlugin extends IJourneyMapPlugin<IServerAPI>
1212
{
1313
/**
1414
* Called by JourneyMap during the init phase of mod loading. Your implementation
@@ -19,6 +19,6 @@ public interface IServerPlugin extends IJourneyMapPlugin
1919
*
2020
* @param jmServerApi Client API implementation
2121
*/
22+
@Override
2223
void initialize(final IServerAPI jmServerApi);
23-
2424
}

0 commit comments

Comments
 (0)