Search in sources :

Example 1 with DeleteHomeEvent

use of io.github.nucleuspowered.nucleus.modules.home.events.DeleteHomeEvent in project Nucleus by NucleusPowered.

the class HomeHandler method removeHomeInternal.

public void removeHomeInternal(Cause cause, Home home) throws NucleusException {
    DeleteHomeEvent event = new DeleteHomeEvent(cause, home);
    postEvent(event);
    if (!Nucleus.getNucleus().getUserDataManager().get(home.getOwnersUniqueId()).get().get(HomeUserDataModule.class).deleteHome(home.getName())) {
        throw new NucleusException(Nucleus.getNucleus().getMessageProvider().getTextMessageWithFormat("command.home.delete.fail", home.getName()), NucleusException.ExceptionType.UNKNOWN_ERROR);
    }
}
Also used : DeleteHomeEvent(io.github.nucleuspowered.nucleus.modules.home.events.DeleteHomeEvent) NucleusException(io.github.nucleuspowered.nucleus.api.exceptions.NucleusException)

Aggregations

NucleusException (io.github.nucleuspowered.nucleus.api.exceptions.NucleusException)1 DeleteHomeEvent (io.github.nucleuspowered.nucleus.modules.home.events.DeleteHomeEvent)1