Skip to content

Commit

Permalink
Recipes module - workaround for JDK-8072596
Browse files Browse the repository at this point in the history
  • Loading branch information
walterhiggins committed Jun 7, 2015
1 parent fdd599c commit 6ab9581
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/js/modules/canary/recipes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 6ab9581

Please sign in to comment.