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

View file

@ -26,6 +26,14 @@ function createRecipe( recipe ){
} }
rows.push( new cmRecipeRow(recipe.shape[i], rr) ); 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); result = cmRecipe.createShapedRecipe( recipe.result, rows);
} else { } else {
result = cmRecipe.createShapelessRecipe( recipe.result, recipe.ingredients ); result = cmRecipe.createShapelessRecipe( recipe.result, recipe.ingredients );