• 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

[IMPORTANT] How to Update Addons with PK 1.8 BETA 10

Simplicitee

Staff member
Plugin Developer
Hello community. Great to see you. Hey you, guy in the gray shirt, is that a new haircut? Well you look great.

Wanna hear a nerd joke?
"What did the computer do for lunch? He got a byte to eat"
Hahaha that's a classic. Not really. I'm terrible at jokes.

I have to inform you that I bring good and bad news. I'm going to say the bad news first, just to rip it off like a bandage.

ProjectKorra 1.8 BETA 10 will break most if not all addons. We are sorry to do this to you developers and server owners again.

Now don't get upset yet, there is still the good news. This time we prepared, and all the side plugins will be updated to work with this new beta (and maybe have a few new features of their own) immediately. I mean literally, they will be out the same time Core is uploaded, given a few minutes difference. And as some of you are aware, Jed has updated his side plugins already and uploaded them. So most of you should be fine.

To server owners:
Not all addon developers have the time to update their addons right away. I apologize for this slight inconvenience, but I do suggest removing any outdated addons and updating to BETA 10, as it includes a lot of bug fixes, new features, and much more. We developers have spent countless hours working on this and making it good enough for a release. @Coolade himself spent literal hours at his computer making and fixing the new ability system.

Please be patient with developers and don't spam their threads asking them to update, it's not helping anyone. And before reporting any bugs to anyone or on any plugin, make sure that you've updated everything and that everything matches to BETA 10.
Now if you would like to get the most out of this new beta, I would suggest copying your current config.yml to a safe location, and then regenerating it. This will provide the newest config file which does have changes.

One big change you should know about is how SubElements are stored. As of now, they have been moved to the database, similar to how elements are stored. SubElements can also now be removed or added with the remove/add commands. Choosing an element will, for now, give the player all the subelements for that element. They still will need the ability permissions to use abilities.

To developers:
The new ability system is amazing. It is so much less work for you guys to make addons now. But this means you'll have to change a lot within your addon, but nothing too complex or difficult I promise you.

So you know that class you have in your abilities that extends AbilityModule? Well good news, you don't need it anymore! Now don't go deleting it right away, you'll still need the information in it. If you feel comfortable with deleting it and redoing the information in it, go ahead and do that. But to make up for this lost class, you will have to go to your main ability class where you progress the ability, and have it extend an Ability class. Here's a little explanation on the Ability classes:

The Ability classes are a group of classes that define the base of an ability. These classes will store any required information and also give you methods needed for that ability. Ability classes are based off of Elements and SubElements. Here they are:
[Elemental] -- [Corresponding Subs]
AirAbility -- FlightAbility, SpiritualAbility
EarthAbility -- LavaAbility, MetalAbility, SandAbility
FireAbility -- CombustionAbility, LightningAbility
WaterAbility -- BloodAbility, HealingAbility, IceAbility, PlantAbility
ChiAbility
If your ability is a SubElement ability, do not extend the corresponding Element ability class.

There are also classes for other types of abilities, ComboAbility and MultiAbility. These classes are implemented.

These Ability classes are better explained through hands on experience with them. Here's an example of what a class header would look like:
Java:
public class Example extends AirAbility implements ComboAbility {
Something else you'll want to do is for your constructor, call super(player); and start();
If you have a remove method, call super.remove(); These are necessary changes.

Any instances, player, and bendingplayer variables you may have, remove them. Those are all handled through CoreAbility now and you don't need them in your class. You also need to remove any progressAll() or similar methods (Not the progress() method. That is required) because ProjectKorra will handle progressing abilities also.

Finally, the best change in my opinion, remove your path.yml file. You don't need it anymore! It's useless now.

So for an example, here's how a basic ability class header and constructor looks:
Java:
public class DirtThrow extends EarthAbility {

    public DirtThrow(Player player) {
        super(player);
        start();
    }
}
And if you override the remove method:
Java:
@Override
public void remove() {
    super.remove();
    //Other code
}
Another change we made, and this isn't for the ability system, is that you guys can now make your own elements and subelements! This is something some of you have probably wanted for a while. To make your own element, just create a new variable like this:
Java:
Element test = new Element("test");
The "test" is a String for the name of the Element. This is very similar to making a new SubElement:
Java:
SubElement test = new SubElement("subtest", parentElement);
Again, the String "subtest" is for the name, but this time you need a parent element, which is the Element which the sub is a part of. For elements and subelements, do not worry about doing anything else besides making the variable. ProjectKorra will handle the rest of the work. And these elements and subelements will show up wherever the default ones would.

One more big change we made was the way subelements are stored. They used to be permission based, but now they no longer are. They are stored in the database similar to how elements are, and in BendingPlayer there is a method called getSubElements() which will return an arraylist of the bendingplayer's subelements. Whenever you change what subelements a player has, make sure to call this method afterwards: GeneralMethods.saveSubElements(bPlayer);

tl;dr
No, go read it. This is an important update.

Thank you, have a nice day.
 

StrangeOne101

Staff member
Plugin Developer
Moderator
Just a note to developers for a few forgotten things :)

Regarding
the API
There was a bit of a code shift in this update, along with the current ability system update. You might find some things to be missing so I'll help clear up the confusion with that.

BendingPlayer
You'll see BendingPlayer has also gone walkabouts in this update. That's okay! It has been tidied up a lot now, so instead of using GeneralMethods.getBendingPlayer(...) to get BendingPlayer objects, you should now use BendingPlayer.getBendingPlayer(...) instead.

You will also notice all canBend, canBind methods, etc, have also been moved here. These methods now take in a CoreAbility object instead of a string as well. This doesn't have to be an instance of an ability if you don't have one either, as you can just do CoreAbility.getAbility(abilityName) to get an instance that isn't actually functioning (this way, the CoreAbility object still retains all move information). More on CoreAbility bellow.

CoreAbility
One that wasn't clarified very well above was the fact that yes, CoreAbility has returned. Unlike the previous CoreAbility, the methods used now are a lot more efficient, cleaner and in general are much better to use. All Elemental abilities (as mentioned above) all stem from CoreAbility now, so once again you know longer need to store your own instance of your move; CoreAbility does this for you. Apart from that @Simplicitee got it covered :)

AirMethods, FireMethods, WaterMethods, EarthMethods, ChiMethods
Ew, what ugly names, am I right? Well you'll be pleased to know these are gone! All previously existing methods are now built into the core element ability classes. So if you want to play the airbending sound or display the firebending particles, you can do so inside your own ability class (if it extends AirAbility, you have all the AirMethod methods, if it extends FireAbility, you have all the fire methods. You get the idea! Of course all SubElement classes stem from these as well so this will still work for the likes of SandAbility, LavaAbility, PlantAbility, etc). If you don't have access to an instance of one of the abilities, most of these methods are static so you can use them right from EarthAbility, AirAbility, WaterAbility, etc.


We still may have forgotten a thing or two, so if you do have any questions, please feel free to ask. Hope that helps slightly :)
 
Top