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
@@ -37,7 +37,6 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.wrapper.PlayerInvWrapper;
import appeng.api.AEApi;
import appeng.api.config.Actionable;
import appeng.api.config.SecurityPermissions;
import appeng.api.implementations.guiobjects.IGuiItemObject;
@@ -64,6 +63,7 @@ import appeng.container.slot.InaccessibleSlot;
import appeng.container.slot.PlayerHotBarSlot;
import appeng.container.slot.PlayerInvSlot;
import appeng.core.AELog;
import appeng.core.Api;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.ConfigValuePacket;
import appeng.core.sync.packets.InventoryActionPacket;
@@ -658,7 +658,7 @@ public abstract class AEBaseContainer extends Container {
final ItemStack isg = player.inventory.getItemStack();
if (!isg.isEmpty() && releaseQty > 0) {
IAEItemStack ais = AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class)
IAEItemStack ais = Api.instance().storage().getStorageChannel(IItemStorageChannel.class)
.createStack(isg);
ais.setStackSize(1);
final IAEItemStack extracted = ais.copy();
@@ -737,7 +737,7 @@ public abstract class AEBaseContainer extends Container {
this.updateHeld(player);
}
} else {
IAEItemStack ais = AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class)
IAEItemStack ais = Api.instance().storage().getStorageChannel(IItemStorageChannel.class)
.createStack(player.inventory.getItemStack());
ais = Platform.poweredInsert(this.getPowerSource(), this.getCellInventory(), ais,
this.getActionSource());
@@ -777,7 +777,7 @@ public abstract class AEBaseContainer extends Container {
this.updateHeld(player);
}
} else {
IAEItemStack ais = AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class)
IAEItemStack ais = Api.instance().storage().getStorageChannel(IItemStorageChannel.class)
.createStack(player.inventory.getItemStack());
ais.setStackSize(1);
ais = Platform.poweredInsert(this.getPowerSource(), this.getCellInventory(), ais,
@@ -855,7 +855,7 @@ public abstract class AEBaseContainer extends Container {
return input;
}
final IAEItemStack ais = Platform.poweredInsert(this.getPowerSource(), this.getCellInventory(),
AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class).createStack(input),
Api.instance().storage().getStorageChannel(IItemStorageChannel.class).createStack(input),
this.getActionSource());
if (ais == null) {
return ItemStack.EMPTY;