Creative Only Mode.
This commit is contained in:
parent
441018a6bb
commit
86792da253
1 changed files with 19 additions and 0 deletions
|
@ -266,11 +266,21 @@ public class RecipeHandler implements IRecipeHandler
|
|||
return in;
|
||||
}
|
||||
|
||||
class CreativeOnlyException extends Exception
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 1294198926500186893L;
|
||||
|
||||
};
|
||||
|
||||
@Override
|
||||
public void parseRecipes(IRecipeLoader loader, String path)
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( creativeOnly() )
|
||||
throw new CreativeOnlyException();
|
||||
|
||||
BufferedReader reader = null;
|
||||
try
|
||||
{
|
||||
|
@ -368,6 +378,10 @@ public class RecipeHandler implements IRecipeHandler
|
|||
reader.close();
|
||||
processTokens( loader, path, line );
|
||||
}
|
||||
catch (CreativeOnlyException e)
|
||||
{
|
||||
AELog.warning( "Recipes are Currently Disabled" );
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
AELog.error( e );
|
||||
|
@ -376,6 +390,11 @@ public class RecipeHandler implements IRecipeHandler
|
|||
}
|
||||
}
|
||||
|
||||
private boolean creativeOnly()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private void processTokens(IRecipeLoader loader, String file, int line) throws RecipeError
|
||||
{
|
||||
try
|
||||
|
|
Loading…
Reference in a new issue