Search in sources :

Example 1 with ModifyHomeEvent

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

the class HomeHandler method modifyHomeInternal.

public void modifyHomeInternal(Cause cause, Home home, Location<World> location, Vector3d rotation) throws NucleusException {
    ModifyHomeEvent event = new ModifyHomeEvent(cause, home, location);
    postEvent(event);
    // Just in case.
    if (!Nucleus.getNucleus().getUserDataManager().getUnchecked(home.getUser()).get(HomeUserDataModule.class).setHome(home.getName(), location, rotation, true)) {
        throw new NucleusException(Nucleus.getNucleus().getMessageProvider().getTextMessageWithFormat("command.sethome.seterror", home.getName()), NucleusException.ExceptionType.UNKNOWN_ERROR);
    }
}
Also used : ModifyHomeEvent(io.github.nucleuspowered.nucleus.modules.home.events.ModifyHomeEvent) NucleusException(io.github.nucleuspowered.nucleus.api.exceptions.NucleusException)

Aggregations

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