mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-09 12:10:37 +01:00
Restrict spawn-egg dupe prevention to non-creative players.
This commit is contained in:
parent
650225da3e
commit
a10ddc9c37
@ -285,7 +285,9 @@ public class InventoryListener extends CheckListener {
|
|||||||
|
|
||||||
@EventHandler(ignoreCancelled = false, priority = EventPriority.LOWEST)
|
@EventHandler(ignoreCancelled = false, priority = EventPriority.LOWEST)
|
||||||
public final void onPlayerInteractEntity(final PlayerInteractEntityEvent event) {
|
public final void onPlayerInteractEntity(final PlayerInteractEntityEvent event) {
|
||||||
final ItemStack stack = event.getPlayer().getItemInHand();
|
final Player player = event.getPlayer();
|
||||||
|
if (player.getGameMode() == GameMode.CREATIVE) return;
|
||||||
|
final ItemStack stack = player.getItemInHand();
|
||||||
if (stack != null && stack.getTypeId() == Material.MONSTER_EGG.getId()){
|
if (stack != null && stack.getTypeId() == Material.MONSTER_EGG.getId()){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user