Removed AEApi

Moved all internal access to the internal `Api` class using a new static
getter.
This commit is contained in:
yueh
2020-07-11 19:40:34 +02:00
parent d18eabe1fc
commit 0d43ca15be
168 changed files with 757 additions and 677 deletions
+19
View File
@@ -18,6 +18,7 @@
package appeng.core;
import appeng.api.AEAddon;
import appeng.api.IAppEngApi;
import appeng.api.features.IRegistryContainer;
import appeng.api.networking.IGridHelper;
@@ -31,8 +32,26 @@ import appeng.core.features.registries.PartModels;
import appeng.core.features.registries.RegistryContainer;
public final class Api implements IAppEngApi {
/**
* While permitting public access, directly using {@link Api#instance()} is not
* recommended except in very special cases.
*/
public static final Api INSTANCE = new Api();
/**
* Use primarily to access the API.
*
* Using {@link IAppEngApi} intentionally to avoid using functionality not
* exposed by accident.
*
* In some cases we might have to access the API before it is announced via
* {@link AEAddon}, otherwise we could just inject it into AE2 itself.
*/
public static IAppEngApi instance() {
return INSTANCE;
}
private final ApiPart partHelper;
// private MovableTileRegistry MovableRegistry = new MovableTileRegistry();