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);
}
}
Aggregations