From cf1764723f20d4fc804b57ccd6ccdb55a6559850 Mon Sep 17 00:00:00 2001 From: matt <4009945+MattBDev@users.noreply.github.com> Date: Tue, 12 Mar 2019 16:56:51 -0400 Subject: [PATCH] Fixes #2291 Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com> --- .../plotsquared/bukkit/listeners/PlayerEvents.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java index a56cf5b29..ac51d4c84 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java @@ -1769,6 +1769,13 @@ import java.util.regex.Pattern; if (area == null) { return; } + if (event.getAction() == Action.RIGHT_CLICK_AIR) { + Material item = event.getItem().getType(); + if (item.toString().toLowerCase().endsWith("egg")) { + event.setCancelled(true); + event.setUseItemInHand(Event.Result.DENY); + } + } ItemStack hand = player.getInventory().getItemInMainHand(); ItemStack offHand = player.getInventory().getItemInOffHand(); Material type = (hand == null) ? Material.AIR : hand.getType();