From 5fc1b9cb0575315bf5379fea0199efbccd2b9b63 Mon Sep 17 00:00:00 2001 From: walterhiggins Date: Sun, 7 Jun 2015 15:15:42 +0100 Subject: [PATCH] fixes issue #254 --- src/main/js/modules/utils/utils.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/js/modules/utils/utils.js b/src/main/js/modules/utils/utils.js index 69385cb..82ed01f 100644 --- a/src/main/js/modules/utils/utils.js +++ b/src/main/js/modules/utils/utils.js @@ -300,7 +300,12 @@ exports.getMousePos = function getMousePos( player ) { if ( !player.getTargetBlock ) { return null; } - targetedBlock = player.getTargetBlock( null, 5 ); + try { + targetedBlock = player.getTargetBlock( null, 5 ); + }catch (e){ + // spigot 1.8.7 adds new overload which causes problems with JDK 7 + targetedBlock = player['getTargetBlock(java.util.Set,int)'](null, 5 ); + } if ( targetedBlock == null || targetedBlock.isEmpty() ) { return null; }