2323import org .bukkit .configuration .ConfigurationSection ;
2424import org .bukkit .entity .Entity ;
2525import org .jetbrains .annotations .ApiStatus ;
26+ import org .jetbrains .annotations .NotNull ;
2627import org .jetbrains .annotations .Nullable ;
2728import org .mvplugins .multiverse .core .command .MVCommandManager ;
2829import org .mvplugins .multiverse .core .config .handle .MemoryConfigurationHandle ;
@@ -302,7 +303,8 @@ public PortalLocation getPortalLocation() {
302303 }
303304
304305 @ ApiStatus .AvailableSince ("5.2" )
305- public Try <Void > setActionType (ActionHandlerType <?, ?> actionType ) {
306+ public Try <Void > setActionType (@ NotNull ActionHandlerType <?, ?> actionType ) {
307+ Objects .requireNonNull (actionType , "actionType cannot be null" );
306308 return configHandle .set (configNodes .actionType , actionType .getName ());
307309 }
308310
@@ -327,24 +329,24 @@ public String getAction() {
327329 }
328330
329331 @ ApiStatus .AvailableSince ("5.2" )
330- public Try <Void > setActionHandler (ActionHandler <?, ?> action ) {
332+ public Try <Void > setActionHandler (@ NotNull ActionHandler <?, ?> action ) {
331333 Objects .requireNonNull (action , "action cannot be null" );
332334 return setActionType (action .getHandlerType ())
333335 .flatMap (v -> setAction (action .serialise ()));
334336 }
335337
336338 @ ApiStatus .AvailableSince ("5.2" )
337- public Attempt <? extends ActionHandler <?, ?>, ActionFailureReason > getActionHandler () {
339+ public @ NotNull Attempt <? extends ActionHandler <?, ?>, ActionFailureReason > getActionHandler () {
338340 return actionHandlerProvider .parseHandler (getActionType (), getAction ());
339341 }
340342
341343 @ ApiStatus .AvailableSince ("5.2" )
342- public Attempt <? extends ActionHandler <?, ?>, ActionFailureReason > getActionHandler (CommandSender sender ) {
344+ public @ NotNull Attempt <? extends ActionHandler <?, ?>, ActionFailureReason > getActionHandler (@ NotNull CommandSender sender ) {
343345 return actionHandlerProvider .parseHandler (sender , getActionType (), getAction ());
344346 }
345347
346348 @ ApiStatus .AvailableSince ("5.2" )
347- public Attempt <Void , ActionFailureReason > runActionFor (Entity entity ) {
349+ public @ NotNull Attempt <Void , ActionFailureReason > runActionFor (Entity entity ) {
348350 return getActionHandler (entity )
349351 .mapAttempt (actionHandler -> actionHandler .runAction (this , entity ))
350352 .onSuccess (() -> {
0 commit comments