Search By Mod ID

This commit is contained in:
AlgorithmX2
2014-07-02 21:09:17 -05:00
parent 4a88f87e2a
commit ab68154885
4 changed files with 41 additions and 1 deletions
+20
View File
@@ -18,6 +18,8 @@ import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IAETagCompound;
import appeng.util.Platform;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -273,6 +275,23 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
return def.displayName = Platform.getItemDisplayName( getItemStack() );
}
@SideOnly(Side.CLIENT)
public String getModID()
{
if ( def.uniqueID != null )
return getModName( def.uniqueID );
return getModName( def.uniqueID = GameRegistry.findUniqueIdentifierFor( def.item ) );
}
private String getModName(UniqueIdentifier uniqueIdentifier)
{
if ( uniqueIdentifier == null )
return "** Null";
return uniqueIdentifier.modId == null ? "** Null" : uniqueIdentifier.modId;
}
@Override
public IAEItemStack empty()
{
@@ -588,4 +607,5 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
{
return def.isOre != null;
}
}