Skip to content

5.3 ScoreboardAPI + MC 1.18 Support Update

Compare
Choose a tag to compare
@herby2212 herby2212 released this 05 Apr 10:45
· 14 commits to master since this release

General

  • Optimized use of functions
  • Fixed ItemEnchant class for newer MC versions
  • Added support for all MC 1.18 versions
    • For all functions and classes except Glow and the HoloAPI
  • Updated debugger for newly supported version
  • Implements #3

ActionBar

  • Switched to 1.17+ internal classes for creating the ActionBar for MC 1.17 and above

Title

  • When title and subtitle timings are the same the native and non NMS function is used
    • This is to be in-line with the newer development approaches introduced in 1.17

ScoreboardAPI

  • New class called TTA_Scoreboards which features several new API calls for creating and managing a scoreboard
  • This scoreboard has the following features:
    • Anti-Flicker
    • Full support for all MC versions between 1.8 and 1.18
    • A animated title with a 1s refresh interval
      • The updating is handled by TTA only a List<String> needs to be provided for the several title iterations
    • 48 Character support for pre 1.13.2 MC versions
      • Content can easily be provided via List<String> for the several rows
      • The content can be updated on a per row basis

A new scoreboard gets created the following way:

  • new TTA_Scoreboards(Player player, List<String> headerContent, List<String> content);

The new methods are the following:

  • TTA_Scoreboards.getPlayer(); - returns the set player of the scoreboard
  • TTA_Scoreboards.updateTitle(); - updates title to the next iteration in the list
    • gets automatically executed by TTA every second
  • TTA_Scoreboards.updateTitleData(List<String> newTitle); - updates the current list of titles
    • animated title gets stopped while updating and the continues with the first element of the updated list
  • TTA_Scoreboards.updateRow(int row, String content); - updates a selected row of the scoreboard
    • The counting is, if looking on the scoreboard, downwards starting at 0 for the first row and 15 for the last row
  • TTA_Scoreboards.updateContent(List<String> rowContents); - updates all rows at once with the provided list of contents
    • if not enough rows are provided the left ones retain their value
    • if provided with null all rows get refreshed with their existing value
  • TTA_Scoreboards.remove(); - deletes the scoreboard and removes it from the player
    • should be executed on PlayerQuitEvent

The new static methods are the following:

  • TTA_Scoreboards.getScoreboards(); - returns a collection of all created TTA_Scoreboards
  • TTA_Scoreboards.getScoreboardByPlayer(Player player); - returns the TTA_Scoreboard for this player