mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-21 05:51:56 +02:00
Prevent sign healing when the player is recently dead.
This commit is contained in:
@@ -24,6 +24,10 @@ public class SignHeal extends EssentialsSign
|
|||||||
@Override
|
@Override
|
||||||
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
|
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
|
||||||
{
|
{
|
||||||
|
if (player.getHealth() == 0)
|
||||||
|
{
|
||||||
|
throw new SignException(_("healDead"));
|
||||||
|
}
|
||||||
final Trade charge = getTrade(sign, 1, ess);
|
final Trade charge = getTrade(sign, 1, ess);
|
||||||
charge.isAffordableFor(player);
|
charge.isAffordableFor(player);
|
||||||
player.setHealth(20);
|
player.setHealth(20);
|
||||||
|
Reference in New Issue
Block a user