Workaround PlayerInteract with Air Event Bukkit-issue (eye of ender, etc.)
This commit is contained in:
parent
a1a041fc36
commit
2477ec8f81
1 changed files with 2 additions and 2 deletions
|
@ -64,7 +64,7 @@ public class PlayerListener implements Listener {
|
||||||
* @return The relevant "isCancelled"
|
* @return The relevant "isCancelled"
|
||||||
*/
|
*/
|
||||||
public static boolean isCancelled(PlayerInteractEvent event) {
|
public static boolean isCancelled(PlayerInteractEvent event) {
|
||||||
return event.isCancelled() || (event.useInteractedBlock() == Event.Result.DENY && event.useItemInHand() == Event.Result.DENY);
|
return (event.useInteractedBlock() == Event.Result.DENY && event.useItemInHand() == Event.Result.DENY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
@ -162,7 +162,7 @@ public class PlayerListener implements Listener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler // Do not use ignoreCancelled here, as some AIR-Interacts are interpreted as isCancelled by default
|
||||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||||
if (!isCancelled(event) && event.getPlayer().getGameMode() == GameMode.CREATIVE) {
|
if (!isCancelled(event) && event.getPlayer().getGameMode() == GameMode.CREATIVE) {
|
||||||
if (event.getItem() != null && mod.getConfig().getBlockUse().isListed(event.getItem())) {
|
if (event.getItem() != null && mod.getConfig().getBlockUse().isListed(event.getItem())) {
|
||||||
|
|
Loading…
Reference in a new issue