Fixed an issue where Parts/Blocks would not properly identify them selves with the proper ItemStack.

This commit is contained in:
AlgorithmX2
2014-02-09 01:55:44 -06:00
parent 7367502d75
commit 49da876b6f
9 changed files with 66 additions and 27 deletions
+4 -3
View File
@@ -19,6 +19,7 @@ import appeng.api.parts.IPartItem;
import appeng.core.AEConfig;
import appeng.core.features.AEFeature;
import appeng.core.features.AEFeatureHandler;
import appeng.core.features.ItemStackSrc;
import appeng.core.localization.GuiText;
import appeng.items.AEBaseItem;
import cpw.mods.fml.relauncher.Side;
@@ -47,10 +48,11 @@ public class ItemPart extends AEBaseItem implements IPartItem, IItemGroup
setHasSubtypes( true );
}
public ItemStack createPart(PartType mat, Enum varient)
public ItemStackSrc createPart(PartType mat, Enum varient)
{
try
{
// I think this still works?
ItemStack is = new ItemStack( this );
mat.getPart().getConstructor( ItemStack.class ).newInstance( is );
}
@@ -76,8 +78,7 @@ public class ItemPart extends AEBaseItem implements IPartItem, IItemGroup
if ( enabled )
{
int newPartNum = AEConfig.instance.get( "parts", name, AEConfig.instance.getFreePart() ).getInt();
ItemStack output = new ItemStack( this );
output.setItemDamage( newPartNum );
ItemStackSrc output = new ItemStackSrc( this, newPartNum );
PartTypeIst pti = new PartTypeIst();
pti.part = mat;