2011-06-08 01:18:33 +00:00
|
|
|
package com.earth2me.essentials.signs;
|
|
|
|
|
2011-06-13 13:05:31 +00:00
|
|
|
import com.earth2me.essentials.Trade;
|
2011-06-08 01:18:33 +00:00
|
|
|
import com.earth2me.essentials.ChargeException;
|
|
|
|
import com.earth2me.essentials.IEssentials;
|
|
|
|
import com.earth2me.essentials.User;
|
|
|
|
import com.earth2me.essentials.Util;
|
|
|
|
|
|
|
|
|
|
|
|
public class SignHeal extends EssentialsSign
|
|
|
|
{
|
|
|
|
public SignHeal()
|
|
|
|
{
|
|
|
|
super("Heal");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
|
|
|
|
{
|
2011-06-13 13:05:31 +00:00
|
|
|
validateTrade(sign, 1, ess);
|
2011-06-08 01:18:33 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
|
|
|
|
{
|
2011-06-13 13:05:31 +00:00
|
|
|
final Trade charge = getTrade(sign, 1, ess);
|
2011-06-08 01:18:33 +00:00
|
|
|
charge.isAffordableFor(player);
|
|
|
|
player.setHealth(20);
|
|
|
|
player.sendMessage(Util.i18n("youAreHealed"));
|
|
|
|
charge.charge(player);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|