FilterLandPermanent filter = new FilterLandPermanent();
filter.add(new ControllerIdPredicate(playerId));
int landsToSacrifice = (int) Math.ceil(game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) / 3.0);
if (landsToSacrifice > 0) {
Target target = new TargetLandPermanent(landsToSacrifice, landsToSacrifice, filter, true);
target.choose(Outcome.Sacrifice, playerId, source.getSourceId(), game);
for (UUID permanentId : target.getTargets()) {
Permanent permanent = game.getPermanent(permanentId);
if (permanent != null) {
permanent.sacrifice(source.getSourceId(), game);
}