Fixed Crash with Extra Utilities.

Items in the ore dictionary values no longer fail to migrate.
Fixed "Meta Overlap detected" error.
Recipes now work with new Materials/Parts.
This commit is contained in:
AlgorithmX2 2014-05-06 12:08:48 -05:00
parent e60faf5ab0
commit 93aad6c53b
5 changed files with 16 additions and 48 deletions

View file

@ -49,7 +49,7 @@ public enum MaterialType
Cell1kPart(35, AEFeature.StorageCells), Cell4kPart(36, AEFeature.StorageCells), Cell16kPart(37, AEFeature.StorageCells), Cell64kPart(38, Cell1kPart(35, AEFeature.StorageCells), Cell4kPart(36, AEFeature.StorageCells), Cell16kPart(37, AEFeature.StorageCells), Cell64kPart(38,
AEFeature.StorageCells), EmptyStorageCell(39, AEFeature.StorageCells), AEFeature.StorageCells), EmptyStorageCell(39, AEFeature.StorageCells),
WoodenGear(39, AEFeature.GrindStone, "gearWood"), WoodenGear(40, AEFeature.GrindStone, "gearWood"),
Wireless(41, AEFeature.WirelessAccessTerminal), WirelessBooster(42, AEFeature.WirelessAccessTerminal), Wireless(41, AEFeature.WirelessAccessTerminal), WirelessBooster(42, AEFeature.WirelessAccessTerminal),

View file

@ -150,9 +150,6 @@ public class OldItemMaterial extends AEBaseItem implements IStorageComponent, IU
dmgToMaterial.put( newMaterialNum, mat ); dmgToMaterial.put( newMaterialNum, mat );
if ( mat.getOreName() != null )
OreDictionary.registerOre( mat.getOreName(), output.stack( 1 ) );
return output; return output;
} }
@ -177,22 +174,15 @@ public class OldItemMaterial extends AEBaseItem implements IStorageComponent, IU
return new MissingIcon( this ); return new MissingIcon( this );
} }
private String nameOf(ItemStack is)
{
if ( is == null )
return "null";
OldMaterialType mt = getTypeByStack( is );
if ( mt == null )
return "null";
return AEFeatureHandler.getName( OldItemMaterial.class, mt.name() );
}
@Override @Override
public String getUnlocalizedName(ItemStack is) public String getUnlocalizedName(ItemStack is)
{ {
return "item.appliedenergistics2." + nameOf( is ); return "AE2-OLD-ITEM";
}
@Override
public String getItemStackDisplayName(ItemStack par1ItemStack) {
return "AE2-OLD-ITEM";
} }
@Override @Override

View file

@ -148,30 +148,12 @@ public class OldItemPart extends AEBaseItem implements IPartItem, IItemGroup, II
@Override @Override
public String getUnlocalizedName(ItemStack is) public String getUnlocalizedName(ItemStack is)
{ {
return "item.appliedenergistics2." + getname( is ); return "PART";
} }
public String getname(ItemStack is)
{
return AEFeatureHandler.getName( OldItemPart.class, getTypeByStack( is ).name() );
}
@Override @Override
public String getItemStackDisplayName(ItemStack is) public String getItemStackDisplayName(ItemStack par1ItemStack) {
{ return "AE2-OLD-PART";
OldPartType pt = getTypeByStack( is );
if ( pt == null )
return "Unnamed";
Enum[] varients = pt.getVarients();
if ( varients != null )
return super.getItemStackDisplayName( is ) + " - " + varients[dmgToPart.get( is.getItemDamage() ).varient].toString();
if ( pt.getExtraName() != null )
return super.getItemStackDisplayName( is ) + " - " + pt.getExtraName().getLocal();
return super.getItemStackDisplayName( is );
} }
@Override @Override

View file

@ -88,8 +88,6 @@ public enum OldMaterialType
OldMaterialType(AEFeature part, String oreDictionary, Class<? extends Entity> c) { OldMaterialType(AEFeature part, String oreDictionary, Class<? extends Entity> c) {
features = EnumSet.of( part ); features = EnumSet.of( part );
oreName = oreDictionary; oreName = oreDictionary;
if ( OreDictionary.getOres( oreDictionary ).size() > 0 )
features.add( AEFeature.DuplicateItems );
droppedEntity = c; droppedEntity = c;
EntityRegistry.registerModEntity( droppedEntity, droppedEntity.getSimpleName(), EntityIds.get( droppedEntity ), AppEng.instance, 16, 4, true ); EntityRegistry.registerModEntity( droppedEntity, droppedEntity.getSimpleName(), EntityIds.get( droppedEntity ), AppEng.instance, 16, 4, true );
@ -98,8 +96,6 @@ public enum OldMaterialType
OldMaterialType(AEFeature part, String oreDictionary) { OldMaterialType(AEFeature part, String oreDictionary) {
features = EnumSet.of( part ); features = EnumSet.of( part );
oreName = oreDictionary; oreName = oreDictionary;
if ( OreDictionary.getOres( oreDictionary ).size() > 0 )
features.add( AEFeature.DuplicateItems );
} }
public ItemStack stack(int size) public ItemStack stack(int size)

View file

@ -78,19 +78,19 @@ public class AEItemResolver implements ISubItemResolver
{ {
String materialName = itemName.substring( itemName.indexOf( "." ) + 1 ); String materialName = itemName.substring( itemName.indexOf( "." ) + 1 );
MaterialType mt = MaterialType.valueOf( materialName ); MaterialType mt = MaterialType.valueOf( materialName );
itemName = itemName.substring( 0, itemName.indexOf( "." ) ); //itemName = itemName.substring( 0, itemName.indexOf( "." ) );
if ( mt.damageValue >= 0 ) if ( mt.damageValue >= 0 )
return new ResolverResult( itemName, mt.damageValue ); return new ResolverResult( "ItemMultiMaterial", mt.damageValue );
} }
if ( itemName.startsWith( "ItemPart." ) ) if ( itemName.startsWith( "ItemPart." ) )
{ {
String partName = itemName.substring( itemName.indexOf( "." ) + 1 ); String partName = itemName.substring( itemName.indexOf( "." ) + 1 );
PartType pt = PartType.valueOf( partName ); PartType pt = PartType.valueOf( partName );
itemName = itemName.substring( 0, itemName.indexOf( "." ) ); //itemName = itemName.substring( 0, itemName.indexOf( "." ) );
int dVal = ItemMultiPart.instance.getDamageByType( pt ); int dVal = ItemMultiPart.instance.getDamageByType( pt );
if ( dVal >= 0 ) if ( dVal >= 0 )
return new ResolverResult( itemName, dVal ); return new ResolverResult( "ItemMultiPart", dVal );
} }
} }
@ -111,6 +111,6 @@ public class AEItemResolver implements ISubItemResolver
} }
ItemStack is = partType.stack( col, 1 ); ItemStack is = partType.stack( col, 1 );
return new ResolverResult( "ItemPart", is.getItemDamage() ); return new ResolverResult( "ItemMultiPart", is.getItemDamage() );
} }
} }