Removed AEApi
Moved all internal access to the internal `Api` class using a new static getter.
This commit is contained in:
+5
-5
@@ -43,7 +43,6 @@ import com.google.common.collect.Multimap;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.IGrid;
|
||||
@@ -76,6 +75,7 @@ import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.core.Api;
|
||||
import appeng.crafting.CraftingJob;
|
||||
import appeng.crafting.CraftingLink;
|
||||
import appeng.crafting.CraftingLinkNexus;
|
||||
@@ -224,7 +224,7 @@ public class CraftingGridCache
|
||||
|
||||
// update the stuff that was in the list...
|
||||
this.storageGrid.postAlterationOfStoredItems(
|
||||
AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class), oldItems.keySet(),
|
||||
Api.instance().storage().getStorageChannel(IItemStorageChannel.class), oldItems.keySet(),
|
||||
new BaseActionSource());
|
||||
|
||||
// re-create list..
|
||||
@@ -257,7 +257,7 @@ public class CraftingGridCache
|
||||
}
|
||||
|
||||
this.storageGrid.postAlterationOfStoredItems(
|
||||
AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class), this.craftableItems.keySet(),
|
||||
Api.instance().storage().getStorageChannel(IItemStorageChannel.class), this.craftableItems.keySet(),
|
||||
new BaseActionSource());
|
||||
}
|
||||
|
||||
@@ -322,7 +322,7 @@ public class CraftingGridCache
|
||||
public List<IMEInventoryHandler> getCellArray(final IStorageChannel<?> channel) {
|
||||
final List<IMEInventoryHandler> list = new ArrayList<>(1);
|
||||
|
||||
if (channel == AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class)) {
|
||||
if (channel == Api.instance().storage().getStorageChannel(IItemStorageChannel.class)) {
|
||||
list.add(this);
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@ public class CraftingGridCache
|
||||
|
||||
@Override
|
||||
public IStorageChannel<IAEItemStack> getChannel() {
|
||||
return AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class);
|
||||
return Api.instance().storage().getStorageChannel(IItemStorageChannel.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -28,7 +28,6 @@ import java.util.Map;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.SetMultimap;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
@@ -49,6 +48,7 @@ import appeng.api.storage.cells.ICellProvider;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.core.Api;
|
||||
import appeng.me.helpers.BaseActionSource;
|
||||
import appeng.me.helpers.GenericInterestManager;
|
||||
import appeng.me.helpers.MachineSource;
|
||||
@@ -71,7 +71,7 @@ public class GridStorageCache implements IStorageGrid {
|
||||
this.storageNetworks = new IdentityHashMap<>();
|
||||
this.storageMonitors = new IdentityHashMap<>();
|
||||
|
||||
AEApi.instance().storage().storageChannels()
|
||||
Api.instance().storage().storageChannels()
|
||||
.forEach(channel -> this.storageMonitors.put(channel, new NetworkMonitor<>(this, channel)));
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -28,7 +28,6 @@ import java.util.Set;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.features.AEFeature;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.IGrid;
|
||||
@@ -47,6 +46,7 @@ import appeng.api.networking.pathing.IPathingGrid;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.stats.IAdvancementTrigger;
|
||||
import appeng.me.GridConnection;
|
||||
@@ -287,7 +287,7 @@ public class PathGridCache implements IPathingGrid {
|
||||
final IAdvancementTrigger lastBracket = this.getAchievementBracket(this.lastChannels);
|
||||
if (currentBracket != lastBracket && currentBracket != null) {
|
||||
for (final IGridNode n : this.requireChannels) {
|
||||
PlayerEntity player = AEApi.instance().registries().players().findPlayer(n.getPlayerID());
|
||||
PlayerEntity player = Api.instance().registries().players().findPlayer(n.getPlayerID());
|
||||
if (player instanceof ServerPlayerEntity) {
|
||||
currentBracket.trigger((ServerPlayerEntity) player);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user