Experimental scoreboard library for spigot

Related tags

App scoreboards
Overview

scoreboards

completely experimental. not suit for production

Testing Progress

  • Basic line updating
  • Basic title updating
  • Performance (should be fine)
  • Extensive testing on line updating

Our Focus

We focus to fix the (in my opinion) terrible way of handling scoreboards most (public) scoreboard APIs do, namely: most scoreboard APIs tend to update the entire scoreboard every X ticks, even if the line is static and will practically never change.

Well, how do we fix this? The way we aim to fix this is to give the option to individually update the entries, through for example, listeners and/or only updating a specific entry every X ticks (keyword - specific, not the entire board).

Despite sacrificing the easy implementations of classic (which, is a rather lazy approach) scoreboard APIs, we offer a unique, but modern approach to adding entries to the scoreboard. Examples can be found at the bottom of the README.md

Support

We currently only support bukkit-based platforms, such as spigot, paperspigot, or other forked platforms. It shouldn't be hard to port this to another platform if you wish to do so.

Examples

{ // this line will update everytime the player itself moves. it.to.x .roundToInt() .toString() } context.listen() .handle { // this line will update everytime the player moves. it.to.y .roundToInt() .toString() } .hide { // but wait! if the player's Y level is above 50, it won't be displayed. it.to.y >= 50 } .create() context.repeating() .cooldown(20L) // this means the entry here will update every 20 ticks (1 second, in minecraft) .hide { // hide the entry if the player's health is above 15 player.health >= 15.0 } .handle { // if the player's health is not above 15, display their health with the "Low health!" message. "Low health! ${player.health}" } .create() context.add("${ChatColor.GRAY}${ChatColor.STRIKETHROUGH}----------------") // like the example at the top, this is a static line and will never update. return@registerOnJoin context }">
        Scoreboards
            .registerOnJoin { player ->
                val context = ScoreboardContext(player)

                var reversing = false
                var current = "hey"

                context.title("")
                    .updateRepeating(10L) {
                        if (current.length <= 12 && !reversing)
                        {
                            current += "."
                        } else
                        {
                            reversing = true
                            current = current.substring(0..(current.length - 2))

                            if (current == "hey")
                            {
                                reversing = false
                            }
                        }

                        return@updateRepeating current
                    }
                    
                context.add("${ChatColor.GRAY}${ChatColor.STRIKETHROUGH}----------------") // this line is static, and it will never update.

                context.add<PlayerMoveEvent> { // this line will update everytime the player itself moves. 
                    it.to.x
                        .roundToInt()
                        .toString()
                }

                context.listen<PlayerMoveEvent>() 
                    .handle { // this line will update everytime the player moves.
                        it.to.y
                            .roundToInt()
                            .toString()
                    }
                    .hide { // but wait! if the player's Y level is above 50, it won't be displayed. 
                        it.to.y >= 50
                    }
                    .create()

                context.repeating()
                    .cooldown(20L) // this means the entry here will update every 20 ticks (1 second, in minecraft)
                    .hide { // hide the entry if the player's health is above 15
                        player.health >= 15.0
                    }
                    .handle { // if the player's health is not above 15, display their health with the "Low health!" message.
                        "Low health! ${player.health}"
                    }
                    .create()

                context.add("${ChatColor.GRAY}${ChatColor.STRIKETHROUGH}----------------") // like the example at the top, this is a static line and will never update.

                return@registerOnJoin context
            }
You might also like...
📱 AppListManager (Android Library) makes managing application and activity lists easy.
📱 AppListManager (Android Library) makes managing application and activity lists easy.

AppListManager (Android Library) AppListManager is easy to use Android library, which minimizes developing time when working on application or activit

An library to help android developers working easly with activities and fragments (Kotlin version)
An library to help android developers working easly with activities and fragments (Kotlin version)

AFM An library to help android developer working easly with activities and fragments (Kotlin) Motivation Accelerate the process and abstract the logic

Sample Project for Android Support Library 23.2
Sample Project for Android Support Library 23.2

SnapShot: Contains features Vector Drawable Animated Vector Drawable AppCompat DayNight theme Bottom Sheets Using BottomSheetDialog in day-night mode.

RoboDemo is a ShowCase library for Android to demonstrate to users how a given Activity works.
RoboDemo is a ShowCase library for Android to demonstrate to users how a given Activity works.

RoboDemo RoboDemo is a ShowCase library for Android to demonstrate to users how a given Activity works. A sample is available in the download area of

Examples for my Android GraphView library

Chart and Graph Library for Android GraphView - open source graph plotting library for Android GraphView is a library for Android to programmatically

RxJava architecture library for Android
RxJava architecture library for Android

Reference Architecture for Android using RxJava This is an ambitious reference project of what can be done with RxJava to create an app based on strea

Simple amazing Donut Progress library🚀
Simple amazing Donut Progress library🚀

DonutProgress 🚀 Now this readme is very poooor 😄 To implement As usual 😒 in project build.gradle: allprojects { repositories { ... maven {

Simple library to decompress files .zip, .rar, .cbz, .cbr in React Native.
Simple library to decompress files .zip, .rar, .cbz, .cbr in React Native.

Uncompress React Native Simple library to decompress files .zip, .rar, .cbz and .cbr in React Native. Installation yarn add uncompress-react-native o

Android library for finding connected devices on same WiFi network. It can provide IP Address, device name, MAC Address and vendor names.
Android library for finding connected devices on same WiFi network. It can provide IP Address, device name, MAC Address and vendor names.

Android WiFi Tools Android library for finding connected devices on the same WiFi network. It can provide IP Addresses, device names, MAC Address and

Owner
Patrick
@scalagg, @lmaodesign.
Patrick
Object-streams - An experimental library for dealing with legacy code

Object Streams Super experimental! no guarantees to the public API surface. At t

Ragunath Jawahar 5 Jan 18, 2022
Experimental Discord Mobile Rich Presence (Android)

MRPC Experimental Discord Mobile Rich Presence (Android) How does it work? It's pretty simple. Connect to the Discord Gateway as a normal Discord Clie

Duy Tran Khanh 41 Dec 25, 2022
Show worldwide headline. API/Glide library/recycler view/volley library/kotlin/xml/ chrome custom tabs

Show worldwide headline. API/Glide library/recycler view/volley library/kotlin/xml/ chrome custom tabs. -> you can click on headline and it will open an article of that news in the app(no need to go to chrome or any browser)

SUMIT KUMAR 5 Nov 28, 2022
A music picker library for React Native. Provides access to the system's UI for selecting songs from the phone's music library.

Expo Music Picker A music picker library for React Native. Provides access to the system's UI for selecting songs from the phone's music library. Supp

Bartłomiej Klocek 60 Dec 29, 2022
Utility Android app for generating color palettes of images using the Palette library. Written in Kotlin.

Palette Helper is a simple utility app made to generate color palettes of images using Google's fantastic Palette library. It's mostly a for-fun pet p

Zac Sweers 154 Nov 18, 2022
Android app built with MVP architectural approach and uses Marvel Comics API that allows developers everywhere to access information about Marvel's vast library of comics. :zap:

Villains & Heroes Android app built with MVP architectural approach and uses Marvel Comics API that allows developers everywhere to access information

André Mion 53 Jul 13, 2022
Library to change Android launcher App Icon and App Name programmatically !

AppIconNameChanger Change Android App launcher Icon and App Name programmatically ! Download Demo APK from HERE Kindly use the following links to use

Prabhakar Thota 587 Dec 29, 2022
:movie_camera: Movie discovery app showcasing Android best practices with Google's recommended architecture: MVVM + Repository + Offline support + Android Architecture Components + Paging library & Retrofit2.

Popular Movies Stage 1 + Stage 2 Discover the most popular and top rated movies playing. Movies data fetched using themoviedb.org API. ✨ Screenshots M

Yassin AJDI 189 Nov 26, 2022
📱 Android Library to implement Rich, Beautiful, Stylish 😍 Material Navigation View for your project with Material Design Guidelines. Easy to use.

Material NavigationView for Android ?? ?? Android Library to implement Rich, Beautiful Material Navigation View for your project with Material Design

Shreyas Patil 198 Dec 17, 2022
Utility Android app for generating color palettes of images using the Palette library. Written in Kotlin.

Palette Helper is a simple utility app made to generate color palettes of images using Google's fantastic Palette library. It's mostly a for-fun pet p

Zac Sweers 154 Nov 18, 2022