mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-03 06:57:39 +01:00
Don't run AntiBuild checks on NPCs (#5365)
This commit is contained in:
parent
2828901927
commit
a4fb02f3e6
@ -192,6 +192,10 @@ public class EssentialsAntiBuildListener implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
public void onItemFrameInteract(final PlayerInteractEntityEvent event) {
|
||||
if (event.getPlayer().hasMetadata("NPC")) {
|
||||
return;
|
||||
}
|
||||
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
|
||||
if (!(event.getRightClicked() instanceof ItemFrame)) {
|
||||
@ -221,6 +225,10 @@ public class EssentialsAntiBuildListener implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
public void onArmorStandInteract(final PlayerInteractAtEntityEvent event) {
|
||||
if (event.getPlayer().hasMetadata("NPC")) {
|
||||
return;
|
||||
}
|
||||
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
|
||||
if (!(event.getRightClicked() instanceof ArmorStand)) {
|
||||
@ -319,6 +327,10 @@ public class EssentialsAntiBuildListener implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onPlayerInteract(final PlayerInteractEvent event) {
|
||||
if (event.getPlayer().hasMetadata("NPC")) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Do not return if cancelled, because the interact event has 2 cancelled states.
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
final ItemStack item = event.getItem();
|
||||
@ -415,6 +427,9 @@ public class EssentialsAntiBuildListener implements Listener {
|
||||
private class PlayerPickupItemListener implements Listener {
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void onPlayerPickupItem(final PlayerPickupItemEvent event) {
|
||||
if (event.getPlayer().hasMetadata("NPC")) {
|
||||
return;
|
||||
}
|
||||
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
final ItemStack item = event.getItem().getItemStack();
|
||||
|
Loading…
Reference in New Issue
Block a user