Package appeng.api.features

Examples of appeng.api.features.IRecipeHandlerRegistry


  public void PreInit(FMLPreInitializationEvent event)
  {
    registerSpatial( false );

    IRecipeHandlerRegistry recipeRegistry = AEApi.instance().registries().recipes();
    recipeRegistry.addNewSubItemResolver( new AEItemResolver() );

    recipeRegistry.addNewCraftHandler( "hccrusher", HCCrusher.class );
    recipeRegistry.addNewCraftHandler( "mekcrusher", MekCrusher.class );
    recipeRegistry.addNewCraftHandler( "mekechamber", MekEnrichment.class );
    recipeRegistry.addNewCraftHandler( "grind", Grind.class );
    recipeRegistry.addNewCraftHandler( "crusher", Crusher.class );
    recipeRegistry.addNewCraftHandler( "grindfz", GrindFZ.class );
    recipeRegistry.addNewCraftHandler( "pulverizer", Pulverizer.class );
    recipeRegistry.addNewCraftHandler( "macerator", Macerator.class );

    recipeRegistry.addNewCraftHandler( "smelt", Smelt.class );
    recipeRegistry.addNewCraftHandler( "inscribe", Inscribe.class );
    recipeRegistry.addNewCraftHandler( "press", Press.class );

    recipeRegistry.addNewCraftHandler( "shaped", Shaped.class );
    recipeRegistry.addNewCraftHandler( "shapeless", Shapeless.class );

    RecipeSorter.register( "AE2-Facade", FacadeRecipe.class, Category.SHAPED, "" );
    RecipeSorter.register( "AE2-Shaped", ShapedRecipe.class, Category.SHAPED, "" );
    RecipeSorter.register( "AE2-Shapeless", ShapelessRecipe.class, Category.SHAPELESS, "" );
View Full Code Here


  private void processTokens(IRecipeLoader loader, String file, int line) throws RecipeError
  {
    try
    {
      IRecipeHandlerRegistry cr = AEApi.instance().registries().recipes();

      if ( tokens.isEmpty() )
        return;

      int split = tokens.indexOf( "->" );
      if ( split != -1 )
      {
        String operation = tokens.remove( 0 ).toLowerCase();

        if ( operation.equals( "alias" ) )
        {
          if ( tokens.size() == 3 && tokens.indexOf( "->" ) == 1 )
            data.aliases.put( tokens.get( 0 ), tokens.get( 2 ) );
          else
            throw new RecipeError( "Alias must have exactly 1 input and 1 output." );
        }
        else if ( operation.equals( "group" ) )
        {
          List<String> pre = tokens.subList( 0, split - 1 );
          List<String> post = tokens.subList( split, tokens.size() );

          List<List<IIngredient>> inputs = parseLines( pre );

          if ( inputs.size() == 1 && inputs.get( 0 ).size() > 0 && post.size() == 1 )
          {
            data.groups.put( post.get( 0 ), new GroupIngredient( post.get( 0 ), inputs.get( 0 ) ) );
          }
          else
            throw new RecipeError( "Group must have exactly 1 output, and 1 or more inputs." );
        }
        else if ( operation.equals( "ore" ) )
        {
          List<String> pre = tokens.subList( 0, split - 1 );
          List<String> post = tokens.subList( split, tokens.size() );

          List<List<IIngredient>> inputs = parseLines( pre );

          if ( inputs.size() == 1 && inputs.get( 0 ).size() > 0 && post.size() == 1 )
          {
            ICraftHandler ch = new OreRegistration( inputs.get( 0 ), post.get( 0 ) );
            addCrafting( ch );
          }
          else
            throw new RecipeError( "Group must have exactly 1 output, and 1 or more inputs in a single row." );
        }
        else
        {
          List<String> pre = tokens.subList( 0, split - 1 );
          List<String> post = tokens.subList( split, tokens.size() );

          List<List<IIngredient>> inputs = parseLines( pre );
          List<List<IIngredient>> outputs = parseLines( post );

          ICraftHandler ch = cr.getCraftHandlerFor( operation );

          if ( ch != null )
          {
            ch.setup( inputs, outputs );
            addCrafting( ch );
View Full Code Here

TOP

Related Classes of appeng.api.features.IRecipeHandlerRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.