Refactored GrinderRegistry. (#2644)

* Refactored GrinderRegistry.

Changed IGrinderRegistry#getRecipes to return an unmodifiable collection.
Added a way to remove recipes explicitly instead the internal list.
Added a cache to lookup recipes instead of iterating a list.

Renamed IGrinderEntry to IGrinderRecipe
Made IGrindRecipe immutable for easy caching.

Improved GrinderLogging and Exception Handling
JEI Workaround as it expects a List instead Collection.

* Added blacklist of explicit oredict names for the grindstone.

This can be used should the automatic recipe generation create unintended
loopholes.
This commit is contained in:
yueh
2016-12-02 23:47:50 +01:00
committed by GitHub
parent c405e725b2
commit eb1e86cacb
10 changed files with 361 additions and 265 deletions
@@ -22,16 +22,16 @@ package appeng.integration.modules.jei;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import appeng.api.features.IGrinderEntry;
import appeng.api.features.IGrinderRecipe;
class GrinderRecipeHandler implements IRecipeHandler<IGrinderEntry>
class GrinderRecipeHandler implements IRecipeHandler<IGrinderRecipe>
{
@Override
public Class<IGrinderEntry> getRecipeClass()
public Class<IGrinderRecipe> getRecipeClass()
{
return IGrinderEntry.class;
return IGrinderRecipe.class;
}
@Override
@@ -41,19 +41,19 @@ class GrinderRecipeHandler implements IRecipeHandler<IGrinderEntry>
}
@Override
public String getRecipeCategoryUid( IGrinderEntry recipe )
public String getRecipeCategoryUid( IGrinderRecipe recipe )
{
return GrinderRecipeCategory.UID;
}
@Override
public IRecipeWrapper getRecipeWrapper( IGrinderEntry recipe )
public IRecipeWrapper getRecipeWrapper( IGrinderRecipe recipe )
{
return new GrinderRecipeWrapper( recipe );
}
@Override
public boolean isRecipeValid( IGrinderEntry recipe )
public boolean isRecipeValid( IGrinderRecipe recipe )
{
return true;
}