fixes issue #254

This commit is contained in:
walterhiggins 2015-06-07 15:15:42 +01:00
parent dae490565b
commit 5fc1b9cb05

View file

@ -300,7 +300,12 @@ exports.getMousePos = function getMousePos( player ) {
if ( !player.getTargetBlock ) { if ( !player.getTargetBlock ) {
return null; return null;
} }
try {
targetedBlock = player.getTargetBlock( null, 5 ); 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() ) { if ( targetedBlock == null || targetedBlock.isEmpty() ) {
return null; return null;
} }