Recipes module - workaround for JDK-8072596

This commit is contained in:
Walter Higgins 2015-06-07 10:09:53 +01:00
parent fdd599ca97
commit 6ab9581a62
1 changed files with 8 additions and 0 deletions

View File

@ -26,6 +26,14 @@ function createRecipe( recipe ){
}
rows.push( new cmRecipeRow(recipe.shape[i], rr) );
}
/*
wph 20150607 short-term workaround for nashorn defect
https://bugs.openjdk.java.net/browse/JDK-8072596
*/
if ( typeof Java !== 'undefined' && typeof Java.type === 'function' ) {
var RecipeRowArrayType = Java.type('net.canarymod.api.inventory.recipes.RecipeRow[]');
rows = Java.to( rows, RecipeRowArrayType );
}
result = cmRecipe.createShapedRecipe( recipe.result, rows);
} else {
result = cmRecipe.createShapelessRecipe( recipe.result, recipe.ingredients );