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:
Class:
All addon developers should have their abilities extend the AddonAbility class. First of all 2 methods need to be implemented
. The method
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
should follow after.
remove:
Used to remove the ability instance from the instances map. NOTE: If remove() is implemented YOU MUST CALL
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:
After that you will need to manage your abilities from somewhere
eg)
Multiple Instance Abilities:
If your ability is allowed more than one instance per player you will need to implement
by default getInstanceType returns InstanceType.SINGLE which means each player can only have one instance of the ability at one time.
eg)
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:
To get the default config in a class that implements ConfigLoadable:
An example implementation is shown below:
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
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()
Code:
remove()
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
remove:
Used to remove the ability instance from the instances map. NOTE: If remove() is implemented YOU MUST CALL
Code:
super.remove()
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");
}
}
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);
}
}
If your ability is allowed more than one instance per player you will need to implement
Code:
getInstanceType()
eg)
Code:
public class AnotherAbility extends AddonAbility {
// ... Other methods
@Override
public InstanceType getInstanceType() {
return InstanceType.MULTIPLE;
}
}
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;
Code:
config.get() - Gets the FileConfiguration object
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");
}
}
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: