mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-27 20:57:35 +01:00
add ProjectileLaunch listener.
This commit is contained in:
parent
accd209e84
commit
b9dce03af5
@ -8,6 +8,7 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.*;
|
||||
import org.bukkit.event.player.PlayerEggThrowEvent;
|
||||
|
||||
public class AuthMeEntityListener implements Listener {
|
||||
|
||||
@ -119,4 +120,18 @@ public class AuthMeEntityListener implements Listener {
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onProjectileLaunch(ProjectileLaunchEvent event) {
|
||||
Entity entity = (Entity) event.getEntity().getShooter();
|
||||
if (entity == null || !(entity instanceof Player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Utils.checkAuth((Player) entity)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user