Merge pull request #51 from Psithief/projectiles-2
Fixes players being able to throw items if right-clicking blocks.
This commit is contained in:
commit
d1b8a73f91
|
@ -251,7 +251,7 @@ public class PlayerListener extends ModifyworldListener {
|
||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
if (action == Action.RIGHT_CLICK_AIR) { //RIGHT_CLICK_AIR is cancelled by default.
|
if (action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK) { //RIGHT_CLICK_AIR is cancelled by default.
|
||||||
switch (player.getItemInHand().getType()) {
|
switch (player.getItemInHand().getType()) {
|
||||||
case POTION: //Only check splash potions.
|
case POTION: //Only check splash potions.
|
||||||
if ((player.getItemInHand().getDurability() & 0x4000) != 0x4000) {
|
if ((player.getItemInHand().getDurability() & 0x4000) != 0x4000) {
|
||||||
|
@ -267,7 +267,9 @@ public class PlayerListener extends ModifyworldListener {
|
||||||
event.getPlayer().updateInventory();
|
event.getPlayer().updateInventory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
if (action == Action.RIGHT_CLICK_AIR) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue