mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-25 01:21:26 +01:00
Disable AFK when player damages entity.
This commit is contained in:
parent
56cfc47ef6
commit
e666c27d96
@ -68,17 +68,21 @@ public class EssentialsEntityListener implements Listener
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (eDefend instanceof Ageable && eAttack instanceof Player)
|
||||
else if (eAttack instanceof Player)
|
||||
{
|
||||
final Player player = (Player)eAttack;
|
||||
final ItemStack hand = player.getItemInHand();
|
||||
if (hand != null && hand.getType() == Material.MILK_BUCKET)
|
||||
final User player = ess.getUser(eAttack);
|
||||
player.updateActivity(true);
|
||||
if (eDefend instanceof Ageable)
|
||||
{
|
||||
((Ageable)eDefend).setBaby();
|
||||
hand.setType(Material.BUCKET);
|
||||
player.setItemInHand(hand);
|
||||
player.updateInventory();
|
||||
event.setCancelled(true);
|
||||
final ItemStack hand = player.getItemInHand();
|
||||
if (hand != null && hand.getType() == Material.MILK_BUCKET)
|
||||
{
|
||||
((Ageable)eDefend).setBaby();
|
||||
hand.setType(Material.BUCKET);
|
||||
player.setItemInHand(hand);
|
||||
player.updateInventory();
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user