mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-05 03:53:41 +00:00
Disable AFK when player damages entity.
This commit is contained in:
parent
56cfc47ef6
commit
e666c27d96
1 changed files with 13 additions and 9 deletions
|
@ -68,9 +68,12 @@ public class EssentialsEntityListener implements Listener
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (eDefend instanceof Ageable && eAttack instanceof Player)
|
else if (eAttack instanceof Player)
|
||||||
|
{
|
||||||
|
final User player = ess.getUser(eAttack);
|
||||||
|
player.updateActivity(true);
|
||||||
|
if (eDefend instanceof Ageable)
|
||||||
{
|
{
|
||||||
final Player player = (Player)eAttack;
|
|
||||||
final ItemStack hand = player.getItemInHand();
|
final ItemStack hand = player.getItemInHand();
|
||||||
if (hand != null && hand.getType() == Material.MILK_BUCKET)
|
if (hand != null && hand.getType() == Material.MILK_BUCKET)
|
||||||
{
|
{
|
||||||
|
@ -82,6 +85,7 @@ public class EssentialsEntityListener implements Listener
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||||
public void onEntityDamage(final EntityDamageEvent event)
|
public void onEntityDamage(final EntityDamageEvent event)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue