-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
This may be a mistake on my end, attempting to integrate this API with my recent works and having some difficulty with pagination. No matter what I attempt to do, the footer is always slightly longer than the header. I've attempted at this point any number of fixes and tried digging for some potential solutions.
I do know this is still a very new feature, so I figured I'd at least provide a bug report for my findings to see if it helps
Version: 3.0.2
Using text-serializer-gson
,text-feature-pagination
, and text-api
with text-bukkit-adapter
Platform is Paper
Width 50 with dummy data to cause pagination
Code (In Kotlin) ((An abomination of formatting, I apologize in advance))
return Pagination.builder().line { cs ->
cs.character('=')
}.width(53).build(TextComponent.of("Charters").color(TextColor.GOLD), Pagination.Renderer.RowRenderer { value, index ->
return@RowRenderer listOf(if (value == null) TextComponent.of("${index + 1}. ").color(TextColor.YELLOW).content("ERR?").color(TextColor.RED) else
TextComponent.of("${index + 1}. ")
.color(TextColor.YELLOW)
.append(TextComponent.of(value.name).color(TextColor.GRAY))
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to view this charter").color(TextColor.GRAY)))
.clickEvent(ClickEvent.of(ClickEvent.Action.RUN_COMMAND, "/charter info ${value.name}")))
}, Pagination.PageCommandFunction { page -> "/charter list -page $page" })
val rendered = settlementService.buildSettlementPagination().render(settlementService.dummyData().sortedBy { settlement -> settlement.name }, page)
rendered.forEach { comp ->
TextAdapter.sendComponent(p, comp)
}
Metadata
Metadata
Assignees
Labels
No labels