Skip to content

2.0.0 Pre-Release 7

Pre-release
Pre-release

Choose a tag to compare

@wallenjos01 wallenjos01 released this 24 May 04:37
· 63 commits to master since this release

This release brings support for 1.20.6, new SQL and Messenger modules, and greater stability.

  • The mod now supports up to version 1.20.6. This includes an API for the new item component system.
    • Server support for item components can be queried with the GameVersion feature ITEM_COMPONENTS.
    • On supported servers, components can be updated with ItemStack::loadComponent and removed with ItemStack::removeComponent
    • For unsupported server versions, the functions for interacting with item NBT now refer to "custom data" rather than "tags" (For example: ItemStack::getTag() is now ItemStack::getCustomData()
      • Calling these functions on versions which support components will instead use the minecraft:custom_data tag.
    • Built-in ItemStack abstractions, such as ItemStack::getName, ItemStack::getLore will automatically change their behavior based on the version of the server.
  • Added a PagedInventoryGUI class. This class can hold an arbitrary number of item entries.
    • The size of each page is determined by a SizeProvider instance. By default, there are two types: fixed and dynamic.
      • A fixed size provider will always return the rows specified during its creation.
      • A dynamic size provider will change its size depending on how many entries are in the GUI.
  • Added a module for connecting to SQL databases: midnightcore:sql
    • Database connection prefixes can be defined in the module's configuration.
    • It is intended for mods that use the API to allow the server admin to declare a preset and any relevant overrides in that mod's configuration.
    • The preset system is designed to allow server administrators to declare their database details once, rather than once for each mod which uses SQL.
    • This module is disabled by default, and needs to be enabled manually via the config or by /mcore module enable midnightcore:sql in order for mods to use it. Mods that require it may fail to start if the module is disabled.
  • Added a module for communicating with other servers on the network: midnightcore:messenger
    • Not to be confused with the existing midnightcore:messaging module, which has now been renamed to midnightcore:plugin_message
    • This module is designed to allow individual backend servers to communicate with one another without having to worry about server infrastructure.
    • By default, only one messenger type is available: plugin_message
      • This messenger type leverages the built in custom payload packets to send messages between a backend server and a proxy over an existing player connection.
      • This messenger type requires a proxy server also running MidnightCore to be connected to the server. As of now, only Velocity is supported.
      • For large networks, or for networks which use an end-to-end encrypted system such as MidnightProxy, this messenger type will not work. It is instead recommended to use the AMQP Messenger.
      • Similarly to the SQL module, messenger instances are defined as presets, which other mods should reference. This is so messenger details can be defined once, rather than once per mod.
  • Removed the concept of component content resolution.
    • Now all components should be able to be converted and sent to the player directly.
    • All unresolved components should use the UnresolvedComponent class.
  • 1.20.5+ servers on Fabric and Spigot now support changing the number format on scoreboards.
    • This means the numbers on the right hand side of scoreboards can be styled, replaced, or removed.
    • Use CustomScoreboard::setNumberFormat to change the number format.
    • Format types STYLED and FIXED require a (unresolved) component as an argument. The STYLED format type will only inherit the style of the component, while the FIXED format type will use that entire component in place of the number.
  • Fixed a lot of bugs, especially concerning plugin messages and older Spigot versions.
  • The spigot version of the mod is now compiled against 3 different Java versions.
    • The version supporting Spigot 1.8-1.16 is compiled against Java 8
    • The version supporting Spigot 1.17-1.20.4 is compiled against Java 17
    • The version supporting Spigot 1.20.5-1.20.6 is compiled against Java 21

Some known (minor) issues:

  • Currently, on Spigot 1.20.2+, applying a skin to a player or loading a savepoint causes that player to think its lost its status effects for a bit. It appears that the server sends effect updates periodically, so it will eventually fix itself, but it is not ideal nonetheless.
  • The Java 8 Spigot builds shadow SLF4J simple, for a consistent logging framework across versions. This causes logs sent from the mod on those versions to repeat the thread name. It also appears that Log4j will always mark messages sent from SLF4J simple as warnings. Ideally I would shadow log4j-slf4j2-impl instead, but from my initial findings it looks like the version of Log4j used by Spigot <= 1.16 is too old to properly support it.