Started adding recipes to rv1 items.

This commit is contained in:
AlgorithmX2 2014-07-11 15:07:16 -05:00
parent c301819b5d
commit ef759c7a7e
2 changed files with 46 additions and 2 deletions

View file

@ -3,6 +3,7 @@ package appeng.core;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.util.WeightedRandomChestContent;
import net.minecraft.world.biome.BiomeGenBase;
@ -383,8 +384,21 @@ public class Registration
items.itemFacade = addFeature( ItemFacade.class );
items.itemCrystalSeed = addFeature( ItemCrystalSeed.class );
items.itemPaintBall = addFeature( ItemPaintBall.class );
ColoredItemDefinition pbreg,pbregl;
items.itemPaintBall = pbreg= new ColoredItemDefinition();
items.itemLumenPaintBall = pbregl= new ColoredItemDefinition();
AEItemDefinition pb= addFeature( ItemPaintBall.class );
for (AEColor c: AEColor.values() )
{
if ( c != AEColor.Transparent )
{
pbreg.add( c, new ItemStackSrc( pb.item(), c.ordinal() ) );
pbregl.add( c, new ItemStackSrc( pb.item(), 20 + c.ordinal() ) );
}
}
addFeature( ToolEraser.class );
addFeature( ToolMeteoritePlacer.class );
addFeature( ToolDebugCard.class );

View file

@ -22,6 +22,16 @@ public class AEItemResolver implements ISubItemResolver
if ( nameSpace.equals( AppEng.modid ) )
{
if ( itemName.startsWith( "PaintBall." ) )
{
return paintBall(AEApi.instance().items().itemPaintBall, itemName.substring( itemName.indexOf( "." ) + 1 ),false );
}
if ( itemName.startsWith( "LumenPaintBall." ) )
{
return paintBall(AEApi.instance().items().itemPaintBall, itemName.substring( itemName.indexOf( "." ) + 1 ), true );
}
if ( itemName.equals( "CableGlass" ) )
{
return new ResolverResultSet( "CableGlass", AEApi.instance().parts().partCableGlass.allStacks( 1 ) );
@ -97,6 +107,26 @@ public class AEItemResolver implements ISubItemResolver
return null;
}
private Object paintBall(AEColoredItemDefinition partType, String substring, boolean lumen)
{
AEColor col = AEColor.Transparent;
try
{
col = AEColor.valueOf( substring );
}
catch (Throwable t)
{
col = AEColor.Transparent;
}
if ( col == AEColor.Transparent )
return null;
ItemStack is = partType.stack( col, 1 );
return new ResolverResult( "ItemPaintBall", (lumen?20:0)+is.getItemDamage() );
}
private Object cableItem(AEColoredItemDefinition partType, String substring)
{
AEColor col = AEColor.Transparent;