Skip to content

Commit 5fc1b9c

Browse files
committed
fixes issue #254
1 parent dae4905 commit 5fc1b9c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/js/modules/utils/utils.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,12 @@ exports.getMousePos = function getMousePos( player ) {
300300
if ( !player.getTargetBlock ) {
301301
return null;
302302
}
303-
targetedBlock = player.getTargetBlock( null, 5 );
303+
try {
304+
targetedBlock = player.getTargetBlock( null, 5 );
305+
}catch (e){
306+
// spigot 1.8.7 adds new overload which causes problems with JDK 7
307+
targetedBlock = player['getTargetBlock(java.util.Set,int)'](null, 5 );
308+
}
304309
if ( targetedBlock == null || targetedBlock.isEmpty() ) {
305310
return null;
306311
}

0 commit comments

Comments
 (0)