From 6b87e36bb37c89c791d7c4e7683c6f144eb51a07 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Thu, 1 May 2014 00:41:19 -0500 Subject: [PATCH] Bug: #0386 - Memory Card not detect flat ME Interface Interface parts can share Settings with bocks. --- parts/AEBasePart.java | 10 +++++++++- parts/misc/PartInterface.java | 13 +++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/parts/AEBasePart.java b/parts/AEBasePart.java index 5f4bab9a..4e1b4265 100644 --- a/parts/AEBasePart.java +++ b/parts/AEBasePart.java @@ -19,6 +19,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.AEApi; import appeng.api.config.Upgrades; import appeng.api.implementations.IUpgradeableHost; import appeng.api.implementations.items.IMemoryCard; @@ -370,7 +371,14 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea if ( memCardIS != null && useStandardMemoryCard() && memCardIS.getItem() instanceof IMemoryCard ) { IMemoryCard memc = (IMemoryCard) memCardIS.getItem(); - String name = getItemStack( PartItemStack.Network ).getUnlocalizedName(); + + ItemStack is = getItemStack( PartItemStack.Network ); + + // Blocks and parts share the same soul! + if ( AEApi.instance().parts().partInterface.sameAs( is ) ) + is = AEApi.instance().blocks().blockInterface.stack( 1 ); + + String name = is.getUnlocalizedName(); if ( player.isSneaking() ) { diff --git a/parts/misc/PartInterface.java b/parts/misc/PartInterface.java index 8264707f..3fc20e63 100644 --- a/parts/misc/PartInterface.java +++ b/parts/misc/PartInterface.java @@ -24,6 +24,7 @@ import appeng.api.storage.IMEMonitor; import appeng.api.storage.IStorageMonitorable; import appeng.api.storage.data.IAEFluidStack; import appeng.api.storage.data.IAEItemStack; +import appeng.api.util.IConfigManager; import appeng.client.texture.CableBusTextures; import appeng.core.sync.GuiBridge; import appeng.helpers.DualityInterface; @@ -223,6 +224,18 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISeg return duality.getStorage().getInventoryStackLimit(); } + @Override + public IConfigManager getConfigManager() + { + return duality.getConfigManager(); + } + + @Override + public IInventory getInventoryByName(String name) + { + return duality.getInventoryByName( name ); + } + @Override public void markDirty() {