Skip to content

Commit fd94bb4

Browse files
committed
start of server api and cleanup
1 parent df6be9a commit fd94bb4

13 files changed

Lines changed: 157 additions & 212 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ void requestMapTile(String modId, ResourceKey<Level> dimension, Context.MapType
268268

269269
/**
270270
* Removes a waypoint group.
271-
* Setting deleteWaypoints to false, will move all waypoints in the Default group.
271+
* Setting deleteWaypoints to false will move all waypoints in the Default group.
272272
*
273273
* @param group the group
274274
* @param deleteWaypoints to delete all waypoints in group
@@ -277,7 +277,7 @@ void requestMapTile(String modId, ResourceKey<Level> dimension, Context.MapType
277277

278278
/**
279279
* Removes groups for a modId.
280-
* Setting deleteWaypoints to false, will move all waypoints in the Default group.
280+
* Setting deleteWaypoints to false will move all waypoints in the Default group.
281281
*
282282
* @param modId - the modId
283283
* @param deleteWaypoints to delete all waypoints in group

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
package journeymap.api.v2.client;
2222

23+
import journeymap.api.v2.common.IJourneyMapPlugin;
24+
import journeymap.api.v2.common.JourneyMapPlugin;
2325
import journeymap.api.v2.common.event.ClientEventRegistry;
2426

2527
import javax.annotation.ParametersAreNonnullByDefault;
@@ -30,7 +32,7 @@
3032
* Implementation classes must have a no-arg constructor and also have the {@link JourneyMapPlugin} annotation.
3133
*/
3234
@ParametersAreNonnullByDefault
33-
public interface IClientPlugin
35+
public interface IClientPlugin extends IJourneyMapPlugin
3436
{
3537
/**
3638
* Called by JourneyMap during the init phase of mod loading. Your implementation
@@ -44,8 +46,4 @@ public interface IClientPlugin
4446
*/
4547
void initialize(final IClientAPI jmClientApi);
4648

47-
/**
48-
* Used by JourneyMap to associate your mod id with your plugin instance.
49-
*/
50-
String getModId();
5149
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@
3131
* <p>
3232
* Classes with this annotation must have a no-arg constructor
3333
* and must also implement the {@link IClientPlugin} interface.
34+
*
35+
* @deprecated this will be removed, please use {@link journeymap.api.v2.common.JourneyMapPlugin}
36+
* This will be removed when the API is out of snapshot phase.
3437
*/
3538
@Target(ElementType.TYPE)
3639
@Retention(RetentionPolicy.RUNTIME)
40+
@Deprecated(forRemoval = true, since = "2.0.0")
3741
public @interface JourneyMapPlugin
3842
{
3943
/**

common/src/main/java/journeymap/api/v2/client/util/PluginHelper.java

Lines changed: 0 additions & 198 deletions
This file was deleted.

common/src/main/java/journeymap/api/v2/client/util/tuple/Tuple2.java

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package journeymap.api.v2.common;
2+
3+
import org.jetbrains.annotations.ApiStatus;
4+
5+
@ApiStatus.Internal
6+
public interface IJourneyMapPlugin
7+
{
8+
/**
9+
* Used by JourneyMap to associate your mod id with your plugin instance.
10+
*/
11+
String getModId();
12+
13+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* JourneyMap API (http://journeymap.info)
3+
* http://github.com/TeamJM/journeymap-api
4+
*
5+
* Copyright (c) 2011-2016 Techbrew. All Rights Reserved.
6+
* The following limited rights are granted to you:
7+
*
8+
* You MAY:
9+
* + Write your own code that uses the API source code in journeymap.* packages as a dependency.
10+
* + Write and distribute your own code that uses, modifies, or extends the example source code in example.* packages
11+
* + Fork and modify any source code for the purpose of submitting Pull Requests to the TeamJM/journeymap-api repository.
12+
* Submitting new or modified code to the repository means that you are granting Techbrew all rights to the submitted code.
13+
*
14+
* You MAY NOT:
15+
* - Distribute source code or classes (whether modified or not) from journeymap.* packages.
16+
* - Submit any code to the TeamJM/journeymap-api repository with a different license than this one.
17+
* - Use code or artifacts from the repository in any way not explicitly granted by this license.
18+
*
19+
*/
20+
21+
package journeymap.api.v2.common;
22+
23+
import journeymap.api.v2.client.IClientPlugin;
24+
import journeymap.api.v2.server.IServerPlugin;
25+
26+
import javax.annotation.Nullable;
27+
import java.lang.annotation.ElementType;
28+
import java.lang.annotation.Retention;
29+
import java.lang.annotation.RetentionPolicy;
30+
import java.lang.annotation.Target;
31+
32+
/**
33+
* Used by JourneyMap to discover and classload plugin classes.
34+
* <p>
35+
* Classes with this annotation must have a no-arg constructor
36+
* and must also implement the {@link IClientPlugin} interface for client plugins
37+
* or {@link IServerPlugin} interface for server plugins.
38+
*/
39+
@Target(ElementType.TYPE)
40+
@Retention(RetentionPolicy.RUNTIME)
41+
public @interface JourneyMapPlugin
42+
{
43+
/**
44+
* Mod Devs can supply the version of journeymap-api the mod was built against,
45+
* so that it will not load the plugin if there is a breaking change.
46+
*
47+
* @return - The Api Version
48+
*/
49+
@Nullable
50+
String apiVersion();
51+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package journeymap.api.v2.common.tuple;
2+
3+
public record Tuple2<A, B>(A a, B b)
4+
{
5+
}

common/src/main/java/journeymap/api/v2/client/util/tuple/Tuple3.java renamed to common/src/main/java/journeymap/api/v2/common/tuple/Tuple3.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package journeymap.api.v2.client.util.tuple;
1+
package journeymap.api.v2.common.tuple;
22

33
public record Tuple3<A, B, C>(A a, B b, C c)
44
{

common/src/main/java/journeymap/api/v2/client/util/tuple/Tuple4.java renamed to common/src/main/java/journeymap/api/v2/common/tuple/Tuple4.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package journeymap.api.v2.client.util.tuple;
1+
package journeymap.api.v2.common.tuple;
22

33
public record Tuple4<A, B, C, D>(A a, B b, C c, D d)
44
{

0 commit comments

Comments
 (0)