[1.8-1.19] Harmony Scoreboard | NMS Async | PlaceHolderAPI Support icon

[1.8-1.19] Harmony Scoreboard | NMS Async | PlaceHolderAPI Support -----

NMS Asnyc Lightweight Scoreboard Plugin




Added support for PAPI placeholders in animations.
Added a fix for 1.12.2
If you are running an older version of minecraft try downgrading to 2.6.5 if this version doesn't work.
I am currently recoding the plugin, this is the hopefully the last version before 3.0.0
----------, Jul 29, 2022

The plugin should now work just fine on 1.19
Didn't even notice it came out until now, sorry about that
----------, Jun 9, 2022

/hboard toggle works as intended
/hboard reload does enable events if they were previously disabled without restarting the server
----------, Jun 1, 2022

- Temporarily added color codes translation before proper hex implementation
- Potentially fixed the plugin not working on Java 8
----------, Apr 15, 2022

- Added Traditional Chinese locale (Thanks xMikux)
- Fixed bug with locales erroring out on console messages
- Fixed bug with 1.13-1.16 scoreboard titles
----------, Apr 5, 2022

Added locales for:
- German (Thanks Du_bist_kein_pro for doing the entire thing)
- Japanese (Thanks BaGuAr for adjustments)
- Romanian

Information about how to use them can be found here:
https://github.com/Oreoezi/HarmonyBoard/wiki/Languages

- Fixed a bug with condition matching (Thanks TiaTheFairy)
- Fixed a bug with scoreboards having broken colors (Thanks crston)
- Removed old code from Harmony 1.0 present in the command handler
- Added more preset scoreboards
- Fixed the old messy algorithm for choosing scoreboard templates.
----------, Apr 3, 2022

- Fixed a bug where changing worlds broke scoreboards (Thanks xMikux)
----------, Mar 17, 2022

Turns out I changed the %player% placeholder to %name% but did not change the default scoreboards.
----------, Mar 6, 2022

Added event system ( https://github.com/Oreoezi/HarmonyBoard/wiki/Scoreboards-and-Animations)

Changed player name placeholder from %player% to %name%

TODO:
  • HEX Support
  • Tidy the 1.17 code
  • Add more placeholders & event relevant ones
  • Document the new API
  • Native bungee support
----------, Mar 4, 2022

Fixed bugs with the /hboard scoreboard command
Made plugin compatible with bungeecord (Thanks Xyness)
Minor optimizations and code tidying (Thanks iGabyTM)
Added metrics

Did not remove old API, will try to document the new one better and with examples beforehand

TODO:
  • HEX Support
  • Event system
  • Add more placeholders
  • Document the new API
  • Native bungee support
----------, Feb 24, 2022

Old API will show a deprecated warning until removal in the next version. https://github.com/Oreoezi/HarmonyBoard/wiki/API-Usage

TODO:
  • HEX Support
  • Bungee support
  • Event system
  • Add more placeholders
----------, Feb 13, 2022

Added support for Oraxen glyphs.
Read the wiki for implementation example.
https://github.com/Oreoezi/HarmonyBoard/wiki/Scoreboards-and-Animations
----------, Jan 15, 2022

Full recode.
Config layout and API changed.
Read https://github.com/Oreoezi/HarmonyBoard/wiki for more information on the changes.
Use the github releases in case the build is unstable. https://github.com/Oreoezi/HarmonyBoard/releases/
----------, Jan 3, 2022

If you run versions later than 1.12 this version is unchanged.
If your server is running 1.8 keep in mind the plugin was only tested on 1.8.8 so any previous version isn't guaranteed to work.

Fixed flickering caused by old scoreboard method being used on legacy verisons (Thanks ItzFlip)
----------, Aug 17, 2021

From my testing everything worked accordingly, make sure to report any bugs on 1.17.
----------, Jun 13, 2021

- Fixed bug with /hboard scoreboard command
- Made all commands except /hboard toggle available to the console
- Updated plugin.yml to mention the plugin version (thanks Nonoritas)
- Updated plugin.yml to mention the API version (thanks KoxSosen)
----------, Apr 17, 2021

Thanks to hallowhead1 for helping me troubleshoot.
Thanks to Nononitas for reporting them to me too.
----------, Mar 30, 2021

Added toggle command messages (thanks Hallowhead1)
Added the ability to save toggle preferences with SQLite or MySQL (thanks howtoNhut)

config.yml and language.yml are backwards compatible, so if you don't want any of the new features you can leave them the same as they are.

Code (YAML):
enable_restricted_scoreboards : false
restricted_scoreboards
:
  scoreboard2
: "permission.for.scoreboard2"

enable_perworld_scoreboards
: false
world_scoreboards
:
  scoreboardworld
: "world"
  scoreboardend
: "world_the_end"
scoreboard_update_rate
: 1

save_scoreboard_preferences
: false

mysql
: false
host
: "127.0.0.1"
port
: 3306
username
: "root"
password
: "pass"
database
: "harmonyboard"

Code (YAML):
prefix : "&f[&bHarmony&f]"
messages
:
error
:
    nonplayer
: "You must be a player to run this command."
    no_permission
: "You do not have the required permission to perform this command."
    invalid_command
: "The command you were trying to perform does not exist."
    invalid_arguments
: "Please provide the right arguments for the command."
    invalid_player
: "Player does not exist or is not online."
  admin
:
    reloaded
: "Config successfully reloaded."
    toggle_on
: "Toggled scoreboard on successfully."
    toggle_off
: "Toggled scoreboard off successfully."
----------, Feb 23, 2021

As the title suggests, you can now put placeholders in scoreboard titles. This can cause flicker on legacy versions(1.12 or below) so that is why this feature is toggled off by default.

config.yml:
Code (YAML):
allow_placeholders_in_title : false
----------, Feb 21, 2021

Added /hboard toggle (requires harmonyboard.toggle permission to work).
(Thanks Hallowhead1)

Fixed "bug" that made scoreboards not enable by default after reloading (Thanks Hallowhead1).

Added new placeholders for showing the overworld coordinates in the nether: %posxow% and %poszow%

Added decimals to %posx% %posy% %posz% placeholders
----------, Feb 19, 2021

Added a new function for removing scoreboards from players in the API (thanks SkyyDaork).
Code (Java):
try {
    HarmonyBoardAPI. setScoreboard (player, "examplescoreboard" ) ;
    HarmonyBoardAPI. removeScoreboard (player ) ; // to remove it afterwards
} catch (HarmonyBoardException e ) {
    e. printStackTrace ( ) ;
}
Added new placeholders and symbols:

%health% - shows health as 20.0
%health_hearts% - shows health as ❤❤❤❤❤❤❤❤❤❤
%ping% - shows player's latency
%posx% - shows the X coordinate of the player's position
%posy% - shows the Y coordinate of the player's position
%posz% - shows the Z coordinate of the player's position

%heart% - ♥
%king% - ♔
%omega% - Ω
%queen% - ♕
%skull% - ☠
%star% - ★
%star_hollow% - ☆
%telephone% - ☏
----------, Feb 8, 2021

Despite those versions not being currently in use I still wanted to make sure the versions work as intended. If you are not on any of the two versions, this update doesn't change anything.
----------, Feb 6, 2021

This update switched to using scoreboard teams alongside not updating lines that didn't receive a change. By using the team prefix and suffix scoreboard lines can be 128 characters long.
This change was only applied from versions 1.13.2-1.16.5 due to the hard limit of characters that exists on older versions.
----------, Feb 5, 2021

Changes to scoreboards' and animations' configs were made. From now lines don't need to be labeled. (Thanks Andre_601 for the suggestion)
New configs look like this:
Code (YAML):
title : "Your Server Network"
lines
:
- "a%default%a" #Animations have the placeholder a%animation_name%a
- "Hello &b%player%&f,"
- " "
- "Online Players
: %online%"
- "  "
- "&byourserver.gg"
- "a%default%a "
Code (YAML):
 delay : 5 #number of ticks until the next line
  lines
:
  - "&a========================="
   - "&b========================="
   - "&c========================="

Added a new setting in config.yml for the scoreboard update rate. By default it is set to 1 (as in every tick, 2 being once every two ticks).
Code (YAML):
scoreboard_update_rate : 1
The delay in animations is still based on ticks and not affected by the update rate value. (Thanks Conclure for the suggestion)
----------, Jan 31, 2021

API
Harmony Scoreboard has an easy-to-use API for registering placeholders and changing the player's scoreboard.

If you want to register placeholders when your plugin loads, make sure to have Harmony Scoreboard as a dependency.

depend: [HarmonyScoreboard]

Registering Placeholders
Every placeholder needs to be of type HarmonyPlaceholder. Here is an example of a placeholder that replaces %health% with the player's health.

Code (Java):
public class HealthPlaceholder extends HarmonyPlaceholder {
   @Override
    public String getName ( ) {
        return "health" ;
    }
   @Override
    public String getValue (Player player ) {
        return String. valueOf (player. getHealth ( ) ) ;
    }
}
Then we need to register the placeholder. That can be easily done with

HarmonyBoardAPI.registerPlaceholder(new HealthPlaceholder());

All HarmonyBoardAPI functions are static, there is no need to create an instance.

In order to remove the placeholder, you can either remove it based on its instance or on its name.

Code (Java):
HarmonyBoardAPI. unregisterPlaceholder (healthplaceholder ) ;
HarmonyBoardAPI. unregisterPlaceholder ( "health" ) ;
Setting Scoreboards
You can set a player's scoreboard with the setScoreboard function. It takes as parameters the player and the name of the scoreboard you want to set. It bypasses and permission / world check.

Code (Java):
try {
   HarmonyBoardAPI. setScoreboard (player, "examplescoreboard" ) ;
} catch (HarmonyBoardException e ) {
   e. printStackTrace ( ) ;
}
HarmonyBoardException is thrown if the player is null or if the name of the scoreboard is invalid.
----------, Jan 31, 2021

Resource Information
Author:
----------
Total Downloads: 5,317
First Release: Jan 30, 2021
Last Update: Jul 29, 2022
Category: ---------------
All-Time Rating:
13 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings