Package uk.co.oliwali.HawkEye.callbacks

Source Code of uk.co.oliwali.HawkEye.callbacks.RebuildCallback

package uk.co.oliwali.HawkEye.callbacks;

import org.bukkit.command.CommandSender;

import uk.co.oliwali.HawkEye.PlayerSession;
import uk.co.oliwali.HawkEye.Rebuild;
import uk.co.oliwali.HawkEye.database.SearchQuery.SearchError;
import uk.co.oliwali.HawkEye.util.Util;

/**
* Implementation of BaseCallback for use in rollback commands
* @author oliverw92
*/
public class RebuildCallback extends BaseCallback {

  private final PlayerSession session;
  private final CommandSender sender;

  public RebuildCallback(PlayerSession session) {
    this.session = session;
    sender = session.getSender();
    Util.sendMessage(sender, "&cSearching for matching results to rebuild...");
  }

  @Override
  public void execute() {
    session.setRollbackResults(results);
    new Rebuild(session);
  }

  @Override
  public void error(SearchError error, String message) {
    Util.sendMessage(session.getSender(), message);
  }

}
TOP

Related Classes of uk.co.oliwali.HawkEye.callbacks.RebuildCallback

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.