@Override
public boolean transactAgreedDeal(ItemParserResult res, final EventRaiser seller, final Player player) {
// res.getAmount() is currently ignored.
final Sheep sheep = player.getSheep();
if (sheep != null) {
if (seller.getEntity().squaredDistance(sheep) > 5 * 5) {
seller.say("I can't see that sheep from here! Bring it over so I can assess it properly.");
} else if (getValue(res, sheep) < SheepSellerNPC.BUYING_PRICE) {
// prevent newbies from selling their sheep too early
seller.say("Nah, that sheep looks too skinny. Feed it with red berries, and come back when it has become fatter.");
} else {
seller.say("Thanks! Here is your money.");
payPlayer(res, player);
player.removeSheep(sheep);
player.notifyWorldAboutChanges();
if(seller.getEntity() instanceof SheepBuyerSpeakerNPC) {
((SheepBuyerSpeakerNPC)seller.getEntity()).moveSheep(sheep);
} else {
// only to prevent that an error occurs and the sheep does not disappear
sheep.getZone().remove(sheep);
}
return true;
}
} else {