Skip to content

First beta release of v3

Pre-release
Pre-release
Compare
Choose a tag to compare
@derklaro derklaro released this 19 Oct 18:36
· 70 commits to v3 since this release
1a55f43

NPC-Lib Version 3 Beta

The third version of the library was in development for quite some time now and has some exciting changes compared to v2:

  • The whole implementation is platform independant with the current version supporting bukkit and minestom (more java platforms like sponge or bedrock like nukkit are planned).
  • When devloping with the library there are no longer hard dependencies on external stuff (like ProtocolLib) which was a big problem in v2. This does not mean that the lib became less flexible, most of the stuff is still available.

Changes for developers

As the lib was completely rewritten and abstracted there is close to nothing that you can take over from v2. There are currently no examples available in the library source (they will get there asap) but you can take a look into an existing implementation in CloudNet for now. An example how to create a npc & pool for bukkit can be found here: NPC Pool creation, NPC creation, NPC Event subscriptions.

Some important stuff to know:

  • The accessor how worlds are converted between the api and bukkit can either be based on the world name or the world key. By default the accessor will be choosen based on the server version (>= 1.16.5 -> key based, < 1.16.5 -> name based). If you want to change that behaviour use NpcPlatformBuilder#worldAccessor with either BukkitWorldAccessor.nameBasedAccessor() or BukkitWorldAccessor.keyBasedAccessor().
  • Some useful methods to convert things between the platform and lib api are available in <Platform-Name>PlatformUtil (for example BukkitPlatformUtil).
  • Using some implementation details to get access to a hidden thing is not supported anymore. If you need something and want support for it please report it to the issue tracker, so that we can discuss the problem.

Dependencies

At the moment the library is only available from jitpack. We will look into publising the library to a different repository like central soon, as there were some noteable problems with the jitpack recently.

Bug reports & Feature requests

If you found an issue with v3 or want to request a new feature please do so on the issue tracker.