• Hello Guest! Did you know that ProjectKorra has an official Discord server? A lot of discussion about the official server, development process, and community discussion happens over there. Feel free to join now by clicking the link below.

    Join the Discord Server

ProjectKorra 1.10.0. And the future.

StrangeOne101

Staff member
Plugin Developer
Moderator
Verified Member
Hi everyone! As you may have seen via our GitHub or community discord, we have just released ProjectKorra version 1.10.0 - our first release in a while!

This update doesn't have a name per se, but it introduces a whole lot of new changes! One of which is the ability for elements to now use hex color codes for their colors! This means there are now over 16 million colors to choose from for each element color! Check out some of the screenshots below!


If you want to see a full changelog of this update and what it brings (especially to server owners), you can check that out HERE!

We also want to take the time to talk about the future of ProjectKorra Core.

A lot of our community has noticed that updates are getting slower and slower. And we want to acknowledge that. A lot of our core team members don't have the same amount of time to dedicate to ProjectKorra as they previously have, as they've become busy with just... life. But that isn't their fault. Life gets busy.

So going forward, ProjectKorra Core will be undergoing 2 major changes in regards to releases:

  1. The versioning of ProjectKorra is going to change to better reflect content/bug fix releases. This update, 1.10.0, contains a lot of content, but if we find major bugs with it, we will no longer wait months to release fixes for them. Instead, we will post a minor bug fix release as 1.10.X. For standard updates, we will update the middle number. E.g. 1.11.0
  2. Releases are now going to contain less content, but will be released faster. This means that 1.11.0 may not contain as much "content" as 1.10.0, but will be released much sooner than if we wait for content to pile up.

Additionally, going forward, one of the things we are going to strive to do is better tailor ProjectKorra Core toward server owners. Right now, we understand that a lot of servers run their own version of ProjectKorra using their own modifications. We want to change ProjectKorra Core to better fit everyone so no one has to modify Core to be happy with its contents.

If you are a server owner struggling with this, please let us know what we can do differently! We welcome suggestions on what we can do to help improve the plugin!

Also, if you are a developer and want to join the team to help improve ProjectKorra, please, do apply! We'd love to have more people on the team to help improve ProjectKorra! We are also open to casual pull requests on GitHub if that's your thing!

That's all for now! But please let us know what you think in the thread below! We will also have notes for developers in the post bellow!
 

StrangeOne101

Staff member
Plugin Developer
Moderator
Verified Member
Hi all. There are a LOT of developer changes to note in this update, so let's take a quick look.

Color, and how it has broken some addons
As you might have seen, we have introduced hex color support for elements in this update. Unfortunately, this will break some addons. Any addons or side plugins that mention Element#getColor() will break. Side plugins will likely need an update.

If you need to update, do so by removing the old org.bukkit.ChatColor import and using net.md_5.bungee.api.ChatColor instead. If you haven't got any of those imports, recompiling with 1.10.0 is enough to fix the issue.

OfflineBendingPlayer
The most significant change in this update is that we now support offline players! This will not break any existing addons.

BendingPlayer now extends OfflineBendingPlayer and any information that persists offline (their bending, binds, cooldowns, etc) is now stored as fields in OfflineBendingPlayer. You can still access everything like normal through BendingPlayer.

BendingPlayer#getBendingPlayer(@NotNull Player player) still returns online bending players only. To get an OfflineBendingPlayer object, you'll need to use OfflineBendingPlayer BendingPlayer#getOrLoadOffline(@NotNull OfflinePlayer player)
OR
CompleteableFuture<OfflineBendingPlayer> BendingPlayer#getOrLoadOfflineAsync(@NotNull OfflinePlayer player)

If you don't get the object async, the thread will halt until it is fetched from the database. We don't recommend you do this unless you are doing this on another thread already. Instead, it is better to use the async method like this:

Java:
BendingPlayer.getOrLoadOfflineAsync(player).thenAccept(oBPlayer -> {
    if (oBPlayer instanceof BendingPlayer) {
        //The player is online and has the normal BendingPlayer functions
    }

    //Do your stuff with the bending player here
});
This will create an anonymous function that will run after the object is fetched from the data.base (or instantly if they are online or already cached).

Additionally, OfflineBendingPlayer objects are cached for a default of 30 seconds after they are pulled from the database. Anytime the player data is accessed again, the 30 seconds will renew and they won't be unloaded for another 30 seconds. You can also change this by using offlineBendingPlayer.uncacheAfter(long milliseconds)

Any player that logs out is automatically converted to an OfflineBendingPlayer and is kept loaded for 5 minutes. That way, if they log back in during that time, the data doesn't have to be fetched from the database again.

Region Protection
We have moved all region protection stuff to the new RegionProtection class.

It features two main methods of note.
  • void registerRegionProtection(@NotNull JavaPlugin plugin, @NotNull RegionProtectionHook hook) to register new region protection for ProjectKorra.
  • As well as boolean isRegionProtected(@NotNull Player player, @Nullable Location location, @Nullable CoreAbility ability) to check whether a location is region protected or not. All addons should use this from now on instead of the method in GeneralMethods
GeneralMethods is no longer used to check region protection. However, the existing methods are deprecated and call the new API in order not to break any addons.

RegionProtectionHook is an interface we define that checks whether the plugin will protect the provided location from bending. It returning true means that bending will be prevented.

Other changes
  • Added TempFallingBlock class from JedCore.
  • Added PlayerSwingEvent for addon developers. This is better than the interact or animation event as it contains all the checks PK does to make sure users aren't interacting with anything. E.g. if a player interacts on a block and opens a GUI, an ability shouldn't be used
  • Added MultiSubElement class - a class for subelements that have more than 1 parent element (e.g. mudbending for water and earth). Not finalized; may be changed in future.
  • Added CanBendHook interface and BendingPlayer#registerCanBendHook for adding custom canBend checks
  • Added playPlantbendingParticles method to PlantAbility
  • GeneralMethods
From this point on, we are going to be trying to reduce the use of GeneralMethods. For the sake of not breaking the API, we will leave deprecated methods in it, but going forward, we will be actively moving things out from it when we get the chance to.

So if you see any deprecated method in the addon you are using, try not to use it. It may be removed at some point
 
Last edited:

DanielCandA

Verified Member
How has ProjectKorra managed to stay relevant and innovative in the Avatar Mod community for nearly a decade, and what new features or updates can we expect from them in the future?
 
Top