API Improvement : PaginationBuilder build()

Currently, the PaginationBuilder is sent directly to the CommandSource, like this:

paginationService.builder().title(Text.of("MyTitle")).contents(myContents).sendTo(target);

I think we should able to call build() like every builders to get an immutable PaginationList and then send it, like this:

PaginationList myList = paginationService.builder().title(Text.of("MyTitle")).contents(myContents).build();
myList.sendTo(target);

(I want to store in cache an immutable object)
Also, It should be nice if we could call sendTo(myMessageChannel) :blush:
Make MessageChannel generic if needed (MessageChannel<? extends MessageReceiver> to use MessageChannel<CommandSource>)
I let developers examine my proposal :grin:

2 Likes

I would have to agree…

You should probably post the issue on the issue tracker: https://github.com/SpongePowered/SpongeAPI/issues

I just linked this topic, but it’s done.
https://github.com/SpongePowered/SpongeAPI/issues/1010

I agree with this request