Removed AEApi
Moved all internal access to the internal `Api` class using a new static getter.
This commit is contained in:
@@ -46,7 +46,6 @@ import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.implementations.IUpgradeableHost;
|
||||
@@ -64,6 +63,7 @@ import appeng.api.util.AEColor;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.core.Api;
|
||||
import appeng.helpers.ICustomNameObject;
|
||||
import appeng.helpers.IPriorityHost;
|
||||
import appeng.me.helpers.AENetworkProxy;
|
||||
@@ -370,7 +370,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
ItemStack is = this.getItemStack(PartItemStack.NETWORK);
|
||||
|
||||
// Blocks and parts share the same soul!
|
||||
final IDefinitions definitions = AEApi.instance().definitions();
|
||||
final IDefinitions definitions = Api.instance().definitions();
|
||||
if (definitions.parts().iface().isSameAs(is)) {
|
||||
Optional<ItemStack> iface = definitions.blocks().iface().maybeStack(1);
|
||||
if (iface.isPresent()) {
|
||||
|
||||
@@ -19,7 +19,11 @@
|
||||
package appeng.parts;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -43,13 +47,20 @@ import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.api.exceptions.FailedConnectionException;
|
||||
import appeng.api.implementations.parts.ICablePart;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.parts.*;
|
||||
import appeng.api.parts.IFacadeContainer;
|
||||
import appeng.api.parts.IFacadePart;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartCollisionHelper;
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.api.parts.IPartItem;
|
||||
import appeng.api.parts.LayerFlags;
|
||||
import appeng.api.parts.PartItemStack;
|
||||
import appeng.api.parts.SelectedPart;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
@@ -58,6 +69,7 @@ import appeng.client.render.cablebus.CableBusRenderState;
|
||||
import appeng.client.render.cablebus.CableCoreType;
|
||||
import appeng.client.render.cablebus.FacadeRenderState;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.Api;
|
||||
import appeng.facade.FacadeContainer;
|
||||
import appeng.helpers.AEMultiTile;
|
||||
import appeng.me.GridConnection;
|
||||
@@ -359,7 +371,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
}
|
||||
|
||||
if (AEApi.instance().partHelper().getCableRenderMode().opaqueFacades) {
|
||||
if (Api.instance().partHelper().getCableRenderMode().opaqueFacades) {
|
||||
final IFacadeContainer fc = this.getFacadeContainer();
|
||||
for (final AEPartLocation side : AEPartLocation.SIDE_LOCATIONS) {
|
||||
final IFacadePart p = fc.getFacade(side);
|
||||
@@ -524,7 +536,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
final IGridNode cn = center.getGridNode();
|
||||
if (cn != null) {
|
||||
try {
|
||||
AEApi.instance().grid().createGridConnection(cn, sn);
|
||||
Api.instance().grid().createGridConnection(cn, sn);
|
||||
} catch (final FailedConnectionException e) {
|
||||
// ekk
|
||||
AELog.debug(e);
|
||||
@@ -1074,7 +1086,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
part.getBoxes(bch);
|
||||
}
|
||||
|
||||
if (AEApi.instance().partHelper().getCableRenderMode().opaqueFacades || forCollision) {
|
||||
if (Api.instance().partHelper().getCableRenderMode().opaqueFacades || forCollision) {
|
||||
if (s != AEPartLocation.INTERNAL) {
|
||||
final IFacadePart fp = fc.getFacade(s);
|
||||
if (fp != null) {
|
||||
|
||||
@@ -20,7 +20,6 @@ package appeng.parts;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
@@ -49,7 +48,6 @@ import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.api.definitions.IItems;
|
||||
import appeng.api.parts.IFacadePart;
|
||||
@@ -59,6 +57,7 @@ import appeng.api.parts.PartItemStack;
|
||||
import appeng.api.parts.SelectedPart;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.ClickPacket;
|
||||
@@ -204,7 +203,7 @@ public class PartPlacement {
|
||||
|
||||
BlockPos te_pos = pos;
|
||||
|
||||
final IBlockDefinition multiPart = AEApi.instance().definitions().blocks().multiPart();
|
||||
final IBlockDefinition multiPart = Api.instance().definitions().blocks().multiPart();
|
||||
if (host == null && pass == PlaceType.PLACE_ITEM) {
|
||||
Direction offset = null;
|
||||
|
||||
@@ -378,7 +377,7 @@ public class PartPlacement {
|
||||
}
|
||||
} else {
|
||||
final ItemStack held = event.getPlayer().getHeldItem(event.getHand());
|
||||
final IItems items = AEApi.instance().definitions().items();
|
||||
final IItems items = Api.instance().definitions().items();
|
||||
|
||||
boolean supportedItem = items.memoryCard().isSameAs(held);
|
||||
supportedItem |= items.colorApplicator().isSameAs(held);
|
||||
|
||||
@@ -46,7 +46,6 @@ import net.minecraftforge.client.model.data.IModelData;
|
||||
import net.minecraftforge.common.ToolType;
|
||||
import net.minecraftforge.common.util.FakePlayerFactory;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.networking.IGridNode;
|
||||
@@ -67,6 +66,7 @@ import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.settings.TickRates;
|
||||
import appeng.core.sync.packets.BlockTransitionEffectPacket;
|
||||
@@ -324,7 +324,7 @@ public class AnnihilationPlanePart extends BasicStatePart implements IGridTickab
|
||||
final IStorageGrid storage = this.getProxy().getStorage();
|
||||
final IEnergyGrid energy = this.getProxy().getEnergy();
|
||||
final IAEItemStack overflow = Platform.poweredInsert(energy,
|
||||
storage.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class)),
|
||||
storage.getInventory(Api.instance().storage().getStorageChannel(IItemStorageChannel.class)),
|
||||
itemToStore, this.mySrc);
|
||||
|
||||
this.isAccepting = overflow == null;
|
||||
@@ -540,7 +540,7 @@ public class AnnihilationPlanePart extends BasicStatePart implements IGridTickab
|
||||
for (final ItemStack itemStack : itemStacks) {
|
||||
final IAEItemStack itemToTest = AEItemStack.fromItemStack(itemStack);
|
||||
final IAEItemStack overflow = storage
|
||||
.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class))
|
||||
.getInventory(Api.instance().storage().getStorageChannel(IItemStorageChannel.class))
|
||||
.injectItems(itemToTest, Actionable.SIMULATE, this.mySrc);
|
||||
if (overflow == null || itemToTest.getStackSize() > overflow.getStackSize()) {
|
||||
canStore = true;
|
||||
|
||||
@@ -19,9 +19,6 @@
|
||||
package appeng.parts.automation;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.util.inv.IAEAppEngInventory;
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
package appeng.parts.automation;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import appeng.util.inv.IAEAppEngInventory;
|
||||
|
||||
@@ -28,7 +28,6 @@ import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
@@ -56,6 +55,7 @@ import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.UpgradeableContainer;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.settings.TickRates;
|
||||
import appeng.helpers.MultiCraftingTracker;
|
||||
@@ -127,7 +127,7 @@ public class ExportBusPart extends SharedItemBusPart implements ICraftingRequest
|
||||
try {
|
||||
final InventoryAdaptor destination = this.getHandler();
|
||||
final IMEMonitor<IAEItemStack> inv = this.getProxy().getStorage()
|
||||
.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class));
|
||||
.getInventory(Api.instance().storage().getStorageChannel(IItemStorageChannel.class));
|
||||
final IEnergyGrid energy = this.getProxy().getEnergy();
|
||||
final ICraftingGrid cg = this.getProxy().getCrafting();
|
||||
final FuzzyMode fzMode = (FuzzyMode) this.getConfigManager().getSetting(Settings.FUZZY_MODE);
|
||||
|
||||
@@ -52,7 +52,6 @@ import net.minecraftforge.client.model.data.IModelData;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
@@ -77,6 +76,7 @@ import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.FormationPlaneContainer;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.Api;
|
||||
import appeng.items.parts.PartModels;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.me.storage.MEInventoryHandler;
|
||||
@@ -96,7 +96,7 @@ public class FormationPlanePart extends AbstractFormationPlanePart<IAEItemStack>
|
||||
}
|
||||
|
||||
private final MEInventoryHandler<IAEItemStack> myHandler = new MEInventoryHandler<>(this,
|
||||
AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class));
|
||||
Api.instance().storage().getStorageChannel(IItemStorageChannel.class));
|
||||
private final AppEngInternalAEInventory Config = new AppEngInternalAEInventory(this, 63);
|
||||
|
||||
public FormationPlanePart(final ItemStack is) {
|
||||
@@ -114,7 +114,7 @@ public class FormationPlanePart extends AbstractFormationPlanePart<IAEItemStack>
|
||||
this.getInstalledUpgrades(Upgrades.INVERTER) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST);
|
||||
this.myHandler.setPriority(this.getPriority());
|
||||
|
||||
final IItemList<IAEItemStack> priorityList = AEApi.instance().storage()
|
||||
final IItemList<IAEItemStack> priorityList = Api.instance().storage()
|
||||
.getStorageChannel(IItemStorageChannel.class).createList();
|
||||
|
||||
final int slotsToUse = 18 + this.getInstalledUpgrades(Upgrades.CAPACITY) * 9;
|
||||
@@ -193,7 +193,7 @@ public class FormationPlanePart extends AbstractFormationPlanePart<IAEItemStack>
|
||||
@Override
|
||||
public List<IMEInventoryHandler> getCellArray(final IStorageChannel channel) {
|
||||
if (this.getProxy().isActive()
|
||||
&& channel == AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class)) {
|
||||
&& channel == Api.instance().storage().getStorageChannel(IItemStorageChannel.class)) {
|
||||
final List<IMEInventoryHandler> handler = new ArrayList<>(1);
|
||||
handler.add(this.myHandler);
|
||||
return handler;
|
||||
@@ -333,7 +333,7 @@ public class FormationPlanePart extends AbstractFormationPlanePart<IAEItemStack>
|
||||
|
||||
@Override
|
||||
public IStorageChannel<IAEItemStack> getChannel() {
|
||||
return AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class);
|
||||
return Api.instance().storage().getStorageChannel(IItemStorageChannel.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -349,7 +349,7 @@ public class FormationPlanePart extends AbstractFormationPlanePart<IAEItemStack>
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStackRepresentation() {
|
||||
return AEApi.instance().definitions().parts().formationPlane().maybeStack(1).orElse(ItemStack.EMPTY);
|
||||
return Api.instance().definitions().parts().formationPlane().maybeStack(1).orElse(ItemStack.EMPTY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,7 +25,6 @@ import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.RedstoneMode;
|
||||
@@ -46,6 +45,7 @@ import appeng.api.util.AECableType;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.UpgradeableContainer;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.settings.TickRates;
|
||||
import appeng.helpers.Reflected;
|
||||
@@ -92,10 +92,10 @@ public class ImportBusPart extends SharedItemBusPart implements IInventoryDestin
|
||||
|
||||
try {
|
||||
final IMEMonitor<IAEItemStack> inv = this.getProxy().getStorage()
|
||||
.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class));
|
||||
.getInventory(Api.instance().storage().getStorageChannel(IItemStorageChannel.class));
|
||||
|
||||
final IAEItemStack out = inv.injectItems(
|
||||
AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class).createStack(stack),
|
||||
Api.instance().storage().getStorageChannel(IItemStorageChannel.class).createStack(stack),
|
||||
Actionable.SIMULATE, this.source);
|
||||
if (out == null) {
|
||||
return true;
|
||||
@@ -152,7 +152,7 @@ public class ImportBusPart extends SharedItemBusPart implements IInventoryDestin
|
||||
this.itemsToSend = this.calculateItemsToSend();
|
||||
|
||||
final IMEMonitor<IAEItemStack> inv = this.getProxy().getStorage()
|
||||
.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class));
|
||||
.getInventory(Api.instance().storage().getStorageChannel(IItemStorageChannel.class));
|
||||
final IEnergyGrid energy = this.getProxy().getEnergy();
|
||||
|
||||
boolean Configured = false;
|
||||
@@ -199,7 +199,7 @@ public class ImportBusPart extends SharedItemBusPart implements IInventoryDestin
|
||||
}
|
||||
|
||||
if (!newItems.isEmpty()) {
|
||||
final IAEItemStack aeStack = AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class)
|
||||
final IAEItemStack aeStack = Api.instance().storage().getStorageChannel(IItemStorageChannel.class)
|
||||
.createStack(newItems);
|
||||
final IAEItemStack failed = Platform.poweredInsert(energy, inv, aeStack, this.source);
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.LevelType;
|
||||
import appeng.api.config.RedstoneMode;
|
||||
@@ -73,6 +72,7 @@ import appeng.api.util.IConfigManager;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.LevelEmitterContainer;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.helpers.Reflected;
|
||||
import appeng.items.parts.PartModels;
|
||||
@@ -252,7 +252,7 @@ public class LevelEmitterPart extends UpgradeablePart implements IEnergyWatcherH
|
||||
|
||||
// no more item stuff..
|
||||
this.getProxy().getStorage()
|
||||
.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class))
|
||||
.getInventory(Api.instance().storage().getStorageChannel(IItemStorageChannel.class))
|
||||
.removeListener(this);
|
||||
} catch (final GridAccessException e) {
|
||||
// :P
|
||||
@@ -264,11 +264,11 @@ public class LevelEmitterPart extends UpgradeablePart implements IEnergyWatcherH
|
||||
try {
|
||||
if (this.getInstalledUpgrades(Upgrades.FUZZY) > 0 || myStack == null) {
|
||||
this.getProxy().getStorage()
|
||||
.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class))
|
||||
.getInventory(Api.instance().storage().getStorageChannel(IItemStorageChannel.class))
|
||||
.addListener(this, this.getProxy().getGrid());
|
||||
} else {
|
||||
this.getProxy().getStorage()
|
||||
.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class))
|
||||
.getInventory(Api.instance().storage().getStorageChannel(IItemStorageChannel.class))
|
||||
.removeListener(this);
|
||||
|
||||
if (this.myWatcher != null) {
|
||||
@@ -277,7 +277,7 @@ public class LevelEmitterPart extends UpgradeablePart implements IEnergyWatcherH
|
||||
}
|
||||
|
||||
this.updateReportingValue(this.getProxy().getStorage()
|
||||
.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class)));
|
||||
.getInventory(Api.instance().storage().getStorageChannel(IItemStorageChannel.class)));
|
||||
} catch (final GridAccessException e) {
|
||||
// >.>
|
||||
}
|
||||
@@ -319,7 +319,7 @@ public class LevelEmitterPart extends UpgradeablePart implements IEnergyWatcherH
|
||||
@Override
|
||||
public void onStackChange(final IItemList o, final IAEStack fullStack, final IAEStack diffStack,
|
||||
final IActionSource src, final IStorageChannel chan) {
|
||||
if (chan == AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class)
|
||||
if (chan == Api.instance().storage().getStorageChannel(IItemStorageChannel.class)
|
||||
&& fullStack.equals(this.config.getAEStackInSlot(0))
|
||||
&& this.getInstalledUpgrades(Upgrades.FUZZY) == 0) {
|
||||
this.lastReportedValue = fullStack.getStackSize();
|
||||
@@ -358,7 +358,7 @@ public class LevelEmitterPart extends UpgradeablePart implements IEnergyWatcherH
|
||||
public void onListUpdate() {
|
||||
try {
|
||||
this.updateReportingValue(this.getProxy().getStorage()
|
||||
.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class)));
|
||||
.getInventory(Api.instance().storage().getStorageChannel(IItemStorageChannel.class)));
|
||||
} catch (final GridAccessException e) {
|
||||
// ;P
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.networking.IGridNode;
|
||||
@@ -62,6 +61,7 @@ import appeng.api.util.IConfigManager;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.InterfaceContainer;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.helpers.DualityInterface;
|
||||
import appeng.helpers.IInterfaceHost;
|
||||
@@ -270,7 +270,7 @@ public class InterfacePart extends BasicStatePart implements IGridTickable, ISto
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStackRepresentation() {
|
||||
return AEApi.instance().definitions().parts().iface().maybeStack(1).orElse(ItemStack.EMPTY);
|
||||
return Api.instance().definitions().parts().iface().maybeStack(1).orElse(ItemStack.EMPTY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,7 +28,6 @@ import java.util.Map;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.security.IActionSource;
|
||||
import appeng.api.networking.storage.IBaseMonitor;
|
||||
@@ -39,6 +38,7 @@ import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.Api;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.me.helpers.IGridProxyable;
|
||||
import appeng.me.storage.ITickingMonitor;
|
||||
@@ -191,7 +191,7 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
|
||||
|
||||
@Override
|
||||
public IItemStorageChannel getChannel() {
|
||||
return AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class);
|
||||
return Api.instance().storage().getStorageChannel(IItemStorageChannel.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,7 +26,6 @@ import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.networking.events.MENetworkCellArrayUpdate;
|
||||
import appeng.api.networking.events.MENetworkChannelsChanged;
|
||||
@@ -41,6 +40,7 @@ import appeng.api.storage.cells.ICellInventory;
|
||||
import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.core.Api;
|
||||
import appeng.helpers.IPriorityHost;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.parts.automation.UpgradeablePart;
|
||||
@@ -83,7 +83,7 @@ public abstract class SharedStorageBusPart extends UpgradeablePart
|
||||
* @return Storage channel
|
||||
*/
|
||||
public IStorageChannel getStorageChannel() {
|
||||
return AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class);
|
||||
return Api.instance().storage().getStorageChannel(IItemStorageChannel.class);
|
||||
}
|
||||
|
||||
protected abstract void resetCache();
|
||||
|
||||
@@ -37,7 +37,6 @@ import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.IncludeExclude;
|
||||
@@ -76,6 +75,7 @@ import appeng.capabilities.Capabilities;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.StorageBusContainer;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.settings.TickRates;
|
||||
import appeng.helpers.IInterfaceHost;
|
||||
@@ -235,7 +235,7 @@ public class StorageBusPart extends UpgradeablePart
|
||||
try {
|
||||
if (this.getProxy().isActive()) {
|
||||
this.getProxy().getStorage().postAlterationOfStoredItems(
|
||||
AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class), change, this.mySrc);
|
||||
Api.instance().storage().getStorageChannel(IItemStorageChannel.class), change, this.mySrc);
|
||||
}
|
||||
} catch (final GridAccessException e) {
|
||||
// :(
|
||||
@@ -306,7 +306,7 @@ public class StorageBusPart extends UpgradeablePart
|
||||
this.resetCacheLogic = 0;
|
||||
|
||||
final IMEInventory<IAEItemStack> in = this.getInternalHandler();
|
||||
IItemList<IAEItemStack> before = AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class)
|
||||
IItemList<IAEItemStack> before = Api.instance().storage().getStorageChannel(IItemStorageChannel.class)
|
||||
.createList();
|
||||
if (in != null) {
|
||||
before = in.getAvailableItems(before);
|
||||
@@ -320,7 +320,7 @@ public class StorageBusPart extends UpgradeablePart
|
||||
final IMEInventory<IAEItemStack> out = this.getInternalHandler();
|
||||
|
||||
if (in != out) {
|
||||
IItemList<IAEItemStack> after = AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class)
|
||||
IItemList<IAEItemStack> after = Api.instance().storage().getStorageChannel(IItemStorageChannel.class)
|
||||
.createList();
|
||||
if (out != null) {
|
||||
after = out.getAvailableItems(after);
|
||||
@@ -341,7 +341,7 @@ public class StorageBusPart extends UpgradeablePart
|
||||
IStorageMonitorableAccessor accessor = accessorOpt.orElse(null);
|
||||
IStorageMonitorable inventory = accessor.getInventory(this.mySrc);
|
||||
if (inventory != null) {
|
||||
return inventory.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class));
|
||||
return inventory.getInventory(Api.instance().storage().getStorageChannel(IItemStorageChannel.class));
|
||||
}
|
||||
|
||||
// So this could / can be a design decision. If the tile does support our custom
|
||||
@@ -427,14 +427,14 @@ public class StorageBusPart extends UpgradeablePart
|
||||
this.checkInterfaceVsStorageBus(target, this.getSide().getOpposite());
|
||||
|
||||
this.handler = new MEInventoryHandler<IAEItemStack>(inv,
|
||||
AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class));
|
||||
Api.instance().storage().getStorageChannel(IItemStorageChannel.class));
|
||||
|
||||
this.handler.setBaseAccess((AccessRestriction) this.getConfigManager().getSetting(Settings.ACCESS));
|
||||
this.handler.setWhitelist(this.getInstalledUpgrades(Upgrades.INVERTER) > 0 ? IncludeExclude.BLACKLIST
|
||||
: IncludeExclude.WHITELIST);
|
||||
this.handler.setPriority(this.priority);
|
||||
|
||||
final IItemList<IAEItemStack> priorityList = AEApi.instance().storage()
|
||||
final IItemList<IAEItemStack> priorityList = Api.instance().storage()
|
||||
.getStorageChannel(IItemStorageChannel.class).createList();
|
||||
|
||||
final int slotsToUse = 18 + this.getInstalledUpgrades(Upgrades.CAPACITY) * 9;
|
||||
@@ -507,7 +507,7 @@ public class StorageBusPart extends UpgradeablePart
|
||||
|
||||
@Override
|
||||
public List<IMEInventoryHandler> getCellArray(final IStorageChannel channel) {
|
||||
if (channel == AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class)) {
|
||||
if (channel == Api.instance().storage().getStorageChannel(IItemStorageChannel.class)) {
|
||||
final IMEInventoryHandler<IAEItemStack> out = this.getProxy().isActive() ? this.getInternalHandler() : null;
|
||||
if (out != null) {
|
||||
return Collections.singletonList(out);
|
||||
@@ -559,7 +559,7 @@ public class StorageBusPart extends UpgradeablePart
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStackRepresentation() {
|
||||
return AEApi.instance().definitions().parts().storageBus().maybeStack(1).orElse(ItemStack.EMPTY);
|
||||
return Api.instance().definitions().parts().storageBus().maybeStack(1).orElse(ItemStack.EMPTY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,7 +29,6 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.exceptions.FailedConnectionException;
|
||||
import appeng.api.networking.IGridConnection;
|
||||
import appeng.api.networking.IGridNode;
|
||||
@@ -39,6 +38,7 @@ import appeng.api.parts.IPartModel;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.helpers.Reflected;
|
||||
import appeng.items.parts.PartModels;
|
||||
@@ -168,7 +168,7 @@ public class ToggleBusPart extends BasicStatePart {
|
||||
if (this.getProxy().getNode() != null && this.getOuterProxy().getNode() != null) {
|
||||
if (intention) {
|
||||
try {
|
||||
this.connection = AEApi.instance().grid().createGridConnection(this.getProxy().getNode(),
|
||||
this.connection = Api.instance().grid().createGridConnection(this.getProxy().getNode(),
|
||||
this.getOuterProxy().getNode());
|
||||
} catch (final FailedConnectionException e) {
|
||||
// :(
|
||||
|
||||
@@ -27,7 +27,6 @@ import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.Direction;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.definitions.IParts;
|
||||
import appeng.api.implementations.parts.ICablePart;
|
||||
@@ -43,6 +42,7 @@ import appeng.api.util.AECableType;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.IReadOnlyCollection;
|
||||
import appeng.core.Api;
|
||||
import appeng.items.parts.ColoredPartItem;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.parts.AEBasePart;
|
||||
@@ -96,7 +96,7 @@ public class CablePart extends AEBasePart implements ICablePart {
|
||||
if (this.getCableColor() != newColor) {
|
||||
ItemStack newPart = null;
|
||||
|
||||
final IParts parts = AEApi.instance().definitions().parts();
|
||||
final IParts parts = Api.instance().definitions().parts();
|
||||
|
||||
if (this.getCableConnectionType() == AECableType.GLASS) {
|
||||
newPart = parts.cableGlass().stack(newColor, 1);
|
||||
|
||||
@@ -29,7 +29,6 @@ import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Hand;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.exceptions.FailedConnectionException;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.IGridNode;
|
||||
@@ -41,6 +40,7 @@ import appeng.api.parts.IPartModel;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.settings.TickRates;
|
||||
import appeng.hooks.TickHandler;
|
||||
import appeng.items.parts.PartModels;
|
||||
@@ -193,7 +193,7 @@ public class MEP2PTunnelPart extends P2PTunnelPart<MEP2PTunnelPart> implements I
|
||||
|
||||
for (final MEP2PTunnelPart me : newSides) {
|
||||
try {
|
||||
connections.getConnections().put(me.getGridNode(), new TunnelConnection(me, AEApi.instance()
|
||||
connections.getConnections().put(me.getGridNode(), new TunnelConnection(me, Api.instance()
|
||||
.grid().createGridConnection(this.outerProxy.getNode(), me.outerProxy.getNode())));
|
||||
} catch (final FailedConnectionException e) {
|
||||
final TileEntity start = this.getTile();
|
||||
|
||||
@@ -31,7 +31,6 @@ import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraftforge.client.model.data.IModelData;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.config.PowerUnits;
|
||||
@@ -48,6 +47,7 @@ import appeng.api.util.AEColor;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.client.render.cablebus.P2PTunnelFrequencyModelData;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.Api;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.me.cache.P2PCache;
|
||||
import appeng.me.cache.helpers.TunnelCollection;
|
||||
@@ -110,7 +110,7 @@ public abstract class P2PTunnelPart<T extends P2PTunnelPart> extends BasicStateP
|
||||
return super.getItemStack(type);
|
||||
}
|
||||
|
||||
final Optional<ItemStack> maybeMEStack = AEApi.instance().definitions().parts().p2PTunnelME().maybeStack(1);
|
||||
final Optional<ItemStack> maybeMEStack = Api.instance().definitions().parts().p2PTunnelME().maybeStack(1);
|
||||
if (maybeMEStack.isPresent()) {
|
||||
return maybeMEStack.get();
|
||||
}
|
||||
@@ -168,7 +168,7 @@ public abstract class P2PTunnelPart<T extends P2PTunnelPart> extends BasicStateP
|
||||
|
||||
final ItemStack is = player.getHeldItem(hand);
|
||||
|
||||
final TunnelType tt = AEApi.instance().registries().p2pTunnel().getTunnelTypeByItem(is);
|
||||
final TunnelType tt = Api.instance().registries().p2pTunnel().getTunnelTypeByItem(is);
|
||||
if (!is.isEmpty() && is.getItem() instanceof IMemoryCard) {
|
||||
final IMemoryCard mc = (IMemoryCard) is.getItem();
|
||||
final CompoundNBT data = mc.getData(is);
|
||||
@@ -208,7 +208,7 @@ public abstract class P2PTunnelPart<T extends P2PTunnelPart> extends BasicStateP
|
||||
{
|
||||
final ItemStack newType;
|
||||
|
||||
final IParts parts = AEApi.instance().definitions().parts();
|
||||
final IParts parts = Api.instance().definitions().parts();
|
||||
|
||||
switch (tt) {
|
||||
case LIGHT:
|
||||
|
||||
@@ -34,7 +34,6 @@ import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.implementations.parts.IStorageMonitorPart;
|
||||
import appeng.api.networking.security.IActionSource;
|
||||
import appeng.api.networking.storage.IStackWatcher;
|
||||
@@ -47,6 +46,7 @@ import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.client.render.TesrRenderHelper;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.localization.PlayerMessages;
|
||||
import appeng.helpers.Reflected;
|
||||
import appeng.me.GridAccessException;
|
||||
@@ -199,7 +199,7 @@ public abstract class AbstractMonitorPart extends AbstractDisplayPart
|
||||
}
|
||||
|
||||
this.updateReportingValue(this.getProxy().getStorage()
|
||||
.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class)));
|
||||
.getInventory(Api.instance().storage().getStorageChannel(IItemStorageChannel.class)));
|
||||
}
|
||||
} catch (final GridAccessException e) {
|
||||
// >.>
|
||||
|
||||
@@ -30,12 +30,12 @@ import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.wrapper.PlayerMainInvWrapper;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.networking.energy.IEnergySource;
|
||||
import appeng.api.parts.IPartModel;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.helpers.Reflected;
|
||||
import appeng.items.parts.PartModels;
|
||||
@@ -152,7 +152,7 @@ public class ConversionMonitorPart extends AbstractMonitorPart {
|
||||
try {
|
||||
final IEnergySource energy = this.getProxy().getEnergy();
|
||||
final IMEMonitor<IAEItemStack> cell = this.getProxy().getStorage()
|
||||
.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class));
|
||||
.getInventory(Api.instance().storage().getStorageChannel(IItemStorageChannel.class));
|
||||
|
||||
if (allItems) {
|
||||
if (this.getDisplayed() != null) {
|
||||
@@ -194,7 +194,7 @@ public class ConversionMonitorPart extends AbstractMonitorPart {
|
||||
|
||||
final IEnergySource energy = this.getProxy().getEnergy();
|
||||
final IMEMonitor<IAEItemStack> cell = this.getProxy().getStorage()
|
||||
.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class));
|
||||
.getInventory(Api.instance().storage().getStorageChannel(IItemStorageChannel.class));
|
||||
|
||||
input.setStackSize(count);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user