• 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] Changes coming to ProjectKorra BETA 13

jacklin213

Staff member
Plugin Developer
Verified Member
Hello fello ProjectKorra members

I am here to announce the changes to ProjectKorra coming soon in BETA 13.
Note this is not a full changelog but a general summary. To see the full changelog please wait for the BETA to be released, the changelog will come out with the BETA thread.
Please read this thread carefully as this is directed to both developers and server owners

To start off I will announce that BETA 13 will break ALL addons as well as PK items, rpg
PK items and rpg will be updated as soon as possible when BETA 13 is released.

Addressing Server owners:
DO NOT
update to BETA 13 if your server uses addon abilities, this build has a lot of changes so give developers time to update their addons.
If your server is not addon dependent feel free to update to BETA 13 with highly improved performance. Backup everything before updating !!! including the plugin itself and its folders.
ProjectKorra is not responsible if things break on your server due to having outdated plugins/addons. If any bugs are discovered please post them to the bug reports thread here. Try to use a descriptive title name and include a copy of your error.log and debug.txt files

Addressing Addon developers:
The main changes that come with this build is the fact that all package names have changed. Download BETA 13 once it is released and update your addon with the new file. If your using eclipse you can fix all imports with (Ctrl + Shift + o).
The main change that is introduced in BETA 13 is the ability to let PK handle your abilities through our new ability system

We also have tighten security on some of our class's so you wont be access them like you have before. An example of this is BendingPlayer

What does tightened security mean for developers?
It just means you won't be able to modify fields in some class the way you have before, but worries we still provided a way for you guys to modify values. In class's like BendingPlayer all methods have been documented fully. We have provided getters and setters for fields we think you guys should be allowed to modify.

How to use new system ?
New class's and interfaces introduced for the new system include:
Interfaces:
  • ConfigLoadable - An interface which contains a Config object (Note: this is not the bukkit config object) see section on config loadable for more details.
  • Ability - A basic interface which extends ConfigLoadable

Class:
  • CoreAbility - The class that handles basic implementation of Ability and provides the basic functionality of an ability
  • AddonAbility - The class that addon abilities should extends.

All addon developers should have their abilities extend the AddonAbility class. First of all 2 methods need to be implemented
Code:
reloadVariables(), progress()
. The method
Code:
remove()
is optional, should only be implemented if extra things need to be handled by the ability eg) block reverting.

reloadVaribles:
Used to reload configuration variables, if not needed just leave the method to be empty

progress:
Used to "progress" the ability, if the ability were to be stopped remove() should be called. When remove is called
Code:
return false
should follow after.

remove:
Used to remove the ability instance from the instances map. NOTE: If remove() is implemented YOU MUST CALL
Code:
super.remove()
somewhere in the method or else the remove() will break

All constructors need to pass a player object and 2 methods need to be called.

A code example below:
Code:
public class MyAbility extends AddonAbility {
    private static String configString = config.get().getString("Config.Path.MyAbility.String");
    private static String world = config.get().getDouble("Config.Path.MyAbility.World");
    private Player player;
    private Location location;

    public MyAbility(Player player) {
         // containsPlayer is an in built method.
         if (containsPlayer(player, MyAbility.class)) {
             return;
         }
         reloadVariables();  // Called after initial checks to save memory
         this.player = player;
         this.location = player.getLocation();
         putInstance(player, this); // Must be called or ability will not work
    }

    @Override
    public boolean progress() {
        if (location.getWorld().getName().equalIgnoreCase(world)) {
            remove();
            return false;
        }
        // Do other stuff
        return true;
    }

    @Override
    public void reloadVariables() {
        configString = config.get().getString("Config.Path.String");
        world = config.get().getDouble("Config.Path.MyAbility.World");
    }
}
After that you will need to manage your abilities from somewhere
eg)
Code:
public class SomeClass {
   public void someMethod() {
       MyAbility.progressAll(MyAbility.class);
       //Calls progress for all instances of your ability
       //Also an inbuilt method
   }

   public void anotherMethod() {
       MyAbility.removeAll(MyAbility.class);
   }
}
Multiple Instance Abilities:

If your ability is allowed more than one instance per player you will need to implement
Code:
getInstanceType()
by default getInstanceType returns InstanceType.SINGLE which means each player can only have one instance of the ability at one time.

eg)
Code:
public class AnotherAbility extends AddonAbility {
     // ... Other methods

     @Override
     public InstanceType getInstanceType() {
         return InstanceType.MULTIPLE;
     }
}
The ConfigLoadable interface
This interface provides the reloadVariables() method that can be used in various class's.
This class also has a config object which can be used to get the default config as well as save, reload the default configuration.
Code Snipet from ConfigLoadable:
Code:
Config config = ConfigManager.defaultConfig;
To get the default config in a class that implements ConfigLoadable:
Code:
config.get() - Gets the FileConfiguration object
An example implementation is shown below:
Code:
public class MyClass implements ConfigLoadable() {
    private String someString = config.get().getString("Config.Path.String");

    public void reloadVariables() {
         someString = config.get().getString("Config.Path.String");
    }
}
tl:dr: This build breaks everything so brace yourselfs. Developers please read the documentation above, server owners backup before updating and don't update if you use a lot of addon abilites, give the developers some time to update their abilities

Thanks for taking time to read this, this thread will be updated if anything new pop's up. Hopefully with the new ability system it will be easier for developers to make abilities. If there are any questions feel free to ask them below

Your least seen developer
with much love
~ Jacklin213
 
Last edited:

Sorin

Verified Member
This makes me want to stop making addons :-/ Like I barely learn how to and now things are changing yet again. Thanks for flipping everything upside down on me pk devs :) (I feel bad for the people with a lot of addons like jedk1).
 

Sorin

Verified Member
And this is why JedCore exists. So when they anally fuck us all. I can update easy!
My point is that im sitin here working hard to learn to make things and the go a fucking change everything every fucking update. But props for thinkin ahead with the JedCore i'd rage quit if i had as many to update as you xD.
 

Ron

Verified Member
I will have to test and look into it...

Jacklin must be working really hard, and now Jed will too xD. Have mercy on both!
 

Mist

Staff member
Administrator
This makes me want to stop making addons :-/ Like I barely learn how to and now things are changing yet again. Thanks for flipping everything upside down on me pk devs :) (I feel bad for the people with a lot of addons like jedk1).
y u do dis! D:
Ikr (Officially pissed with the changes for addon development and the person that changed it)
Change isn't necessarily a bad thing. This Dev Build is absolutely HUGE, and this aspect is a necessary part. We would have had to change these things eventually.

I think you guys forget what Dev Builds are about -- they aren't meant to be run on every server. If you count stable builds only, you would barely have to update anything, but because people play every single dev build, you update for those (even though we advocate against using them). In the grand scheme of things, the last few addon ability changes have all been a part of 1.7.0, so had we not had Dev Builds, you would have only had to update your addons once.

Man ever since mist left, the pk updates are becoming a crap hole for addon development.
I actually approved of this addition.
 

Zafkiel

Verified Member
Change isn't necessarily a bad thing. This Dev Build is absolutely HUGE, and this aspect is a necessary part. We would have had to change these things eventually.

I think you guys forget what Dev Builds are about -- they aren't meant to be run on every server. If you count stable builds only, you would barely have to update anything, but because people play every single dev build, you update for those (even though we advocate against using them). In the grand scheme of things, the last few addon ability changes have all been a part of 1.7.0, so had we not had Dev Builds, you would have only had to update your addons once.


I actually approved of this addition.
Mist, will the performance upgrade will be REALLY noticeable ?? And will it be FPS improvement or the server lags caused by too many particles ??
 

Simplicitee

Staff member
Plugin Developer
Verified Member
That would defie the point of jedcore...
Not really, as JedCore gives you 40 some abilities by default. Going through the jedcore config and disabling all the other abilities just when you want one. That's a lot more work than just downloading the individual version and installing it.
 

Sorin

Verified Member
Change isn't necessarily a bad thing. This Dev Build is absolutely HUGE, and this aspect is a necessary part. We would have had to change these things eventually.

I think you guys forget what Dev Builds are about -- they aren't meant to be run on every server. If you count stable builds only, you would barely have to update anything, but because people play every single dev build, you update for those (even though we advocate against using them). In the grand scheme of things, the last few addon ability changes have all been a part of 1.7.0, so had we not had Dev Builds, you would have only had to update your addons once.


I actually approved of this addition.
But now I have to learn new things that make my brain hurt more than it did before when making an ability, I barley just learned how to manipulate blocks and make them start from selected source (Thank you @Finn_Bueno_ and @Simplicitee for teaching me btw), don't get me wrong but these changes are gonna confuse new coders like me, even though this will improve on a lot of things, i'm just a bit upset that some of the things i learned went out the window.
 
Top