Package com.seibel.distanthorizons.api
Class DhApi
java.lang.Object
com.seibel.distanthorizons.api.DhApi
This is the masthead of the API, almost everything you could want to do
can be achieved from here.
For example: you can access singletons which handle the config or event binding.
Q: Why should I use this class instead of just getting the API singleton I need?
A: This way there is a lower chance of your code breaking if we change something on our end. For example, if we realized there is a much better way of handling dependency injection we would keep the interface the same so your code doesn't have to change. Whereas if you were directly referencing the concrete object we replaced, there would be issues.
For example: you can access singletons which handle the config or event binding.
Q: Why should I use this class instead of just getting the API singleton I need?
A: This way there is a lower chance of your code breaking if we change something on our end. For example, if we realized there is a much better way of handling dependency injection we would keep the interface the same so your code doesn't have to change. Whereas if you were directly referencing the concrete object we replaced, there would be issues.
- Since:
- API 1.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
WARNING: All objects in this class will be null until after DH initializes for the first time. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IDhApiEventInjector
Used to bind/unbind Distant Horizons Api events.static final String
This is just a humorous way to reference theREAD_ME
constant string and hopefully peak a few people's attention vs the relatively boring "readMe".static final IOverrideInjector
<IDhApiOverrideable> Used to bind overrides to change Distant Horizons' core behavior.static final String
If you can see this Java Doc, this can be ignored.static final IDhApiWorldGeneratorOverrideRegister
Used to bind/unbind Distant Horizons Api events. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
This version should only be updated when breaking changes are introduced to the Distant Horizons API.static int
This version should be updated whenever new methods are added to the Distant Horizons API.static int
This version should be updated whenever non-breaking fixes are added to the Distant Horizons API.static boolean
Returns true if the mod is a development version, false if it is a release version.static String
Returns the mod's semantic version number in the format: Major.Minor.Patch with optional extensions "-a" for alpha, "-b" for beta, and -dev for unstable development builds.static int
Returns the network protocol version.static String
This is just a humorous way to reference theREAD_ME
constant string and hopefully peak a few people's attention vs the relatively boring "readMe".static boolean
Returns true if the thread this method was called from is owned by Distant Horizons.static String
readMe()
-
Field Details
-
READ_ME
If you can see this Java Doc, this can be ignored.
This is just to let you know that Javadocs are available and that you should use the API jar instead of the full mod jar.
Note: Don't use this string in your code. It may change and is only for reference.- See Also:
-
HEY_YOU_YOURE_FINALLY_AWAKE
This is just a humorous way to reference theREAD_ME
constant string and hopefully peak a few people's attention vs the relatively boring "readMe".- See Also:
-
events
Used to bind/unbind Distant Horizons Api events.- Since:
- API 1.0.0
-
worldGenOverrides
Used to bind/unbind Distant Horizons Api events.- Since:
- API 1.0.0
-
overrides
Used to bind overrides to change Distant Horizons' core behavior.- Since:
- API 1.0.0
-
-
Constructor Details
-
DhApi
public DhApi()
-
-
Method Details
-
readMe
-
heyYou_YoureFinallyAwake
This is just a humorous way to reference theREAD_ME
constant string and hopefully peak a few people's attention vs the relatively boring "readMe". -
getApiMajorVersion
public static int getApiMajorVersion()This version should only be updated when breaking changes are introduced to the Distant Horizons API.- Since:
- API 1.0.0
-
getApiMinorVersion
public static int getApiMinorVersion()This version should be updated whenever new methods are added to the Distant Horizons API.- Since:
- API 1.0.0
-
getApiPatchVersion
public static int getApiPatchVersion()This version should be updated whenever non-breaking fixes are added to the Distant Horizons API.- Since:
- API 1.0.0
-
getModVersion
Returns the mod's semantic version number in the format: Major.Minor.Patch with optional extensions "-a" for alpha, "-b" for beta, and -dev for unstable development builds.
Examples: "1.6.9-a", "1.7.0-a-dev", "2.1.0-b", "3.0.0", "3.1.4-dev"- Since:
- API 1.0.0
-
getIsDevVersion
public static boolean getIsDevVersion()Returns true if the mod is a development version, false if it is a release version.- Since:
- API 1.0.0
-
getNetworkProtocolVersion
public static int getNetworkProtocolVersion()Returns the network protocol version.- Since:
- API 1.0.0
-
isDhThread
public static boolean isDhThread()Returns true if the thread this method was called from is owned by Distant Horizons.- Since:
- API 2.0.0
-