Giter VIP home page Giter VIP logo

adventure-text-feature-pagination's Introduction

adventure-text-feature-pagination

GitHub Workflow Status (branch) MIT License Maven Central Sonatype Nexus (Snapshots)

A basic pagination system for text in the adventure library.

See the documentation for more information about the adventure library.

Contributing

We appreciate contributions of any type. For any new features or typo-fix/style changes, please open an issue or come talk to us in our Discord first so we make sure you're going in the right direction for the project.

All the adventure projects are built with Gradle, require at least JDK 8, and use a common checkstyle configuration. Please make sure all tests pass, license headers are updated, and checkstyle passes to help us review your contribution.

adventure-text-feature-pagination is released under the terms of the MIT License.

adventure-text-feature-pagination's People

Contributors

dependabot[bot] avatar jpenilla avatar kashike avatar renovate-bot avatar renovate[bot] avatar zml2008 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

adventure-text-feature-pagination's Issues

Footer is always longer than header with Pagination

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: 53
image

Width: 50
image

With longer title, width 50
image

Width 50 with dummy data to cause pagination
image

smol title
image

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

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/build.yml
gradle
settings.gradle
  • org.gradle.toolchains.foojay-resolver-convention 0.8.0
build.gradle
  • net.kyori.indra 3.1.3
  • net.kyori.indra.publishing.sonatype 3.1.3
  • net.kyori.indra.licenser.spotless 3.1.3
  • io.github.gradle-nexus.publish-plugin 2.0.0-rc-2
  • net.kyori:adventure-api 4.16.0
  • com.google.guava:guava-testlib 33.1.0-jre
  • com.google.truth:truth 1.4.2
  • com.google.truth.extensions:truth-java8-extension 1.4.2
  • org.junit:junit-bom 5.10.2
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 8.7

  • Check this box to trigger a request for Renovate to run again on this repository

[Feature Request] Pagination - Allow custom footer rendering

It would be great if we could render the footer in a similar way to the header - that is have renderFooter (and maybe renderFooterButtons) be in the Pagination.Renderer Interface instead of the PaginationImpl class. This would allow for arranging the previous and next buttons in a desired way among other custom formatting

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.