mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-24 18:18:20 +01:00
Fix PlayerInteractEvent error on pre-1.9 servers, fixes #594
This commit is contained in:
parent
84acca7152
commit
f7b806bd63
@ -189,11 +189,13 @@ public class PlayerListener implements Listener {
|
||||
@SuppressWarnings("deprecation") // since 1.13
|
||||
@EventHandler
|
||||
public void onPlayerInteract(PlayerInteractEvent evt) {
|
||||
EquipmentSlot e = evt.getHand(); //Get the hand of the event and set it to 'e'.
|
||||
if (e == null) {
|
||||
return;
|
||||
EquipmentSlot e = null;
|
||||
try {
|
||||
e = evt.getHand();
|
||||
} catch (NoSuchMethodError err) {
|
||||
// Do nothing, getHand() not present pre-1.9
|
||||
}
|
||||
if (e.equals(EquipmentSlot.HAND)) { //If the event is fired by HAND (main hand)
|
||||
if (e == null || e.equals(EquipmentSlot.HAND)) { //If the event is fired by HAND (main hand)
|
||||
if (plugin.checkQuester(evt.getPlayer().getUniqueId()) == false) {
|
||||
|
||||
if (evt.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
|
||||
|
Loading…
Reference in New Issue
Block a user