• 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

New Element Bug

Darius

New Member
Allright. I am trying to code a new Element, but I encounter some little errors. After I made the side plugin, created a class with "public static final Element myElement = new Element("MyElement")" I made the class "MyElementAbility".
Then after I made the first move, the element and move were not showing up. No error, nothing.
The Information class of my move was like "public class MyAbilityInformation extends MyElementAbility { ". It din't work so I tried it like: "public class MyAbilityInformation extends ElementalAbility implements AddonAbility" and I set the "getElement()" method to return MyElementClass.MyElement.
It worked like this, but only if I would have used the "/pk help MyAbility" command every time the server started. But I would have to choose MyElement and bind the move every time it restarted. I tried to copy paste the ChiAbility as MyElementAbility and only change the package and element, but it didn't work.
 

StrangeOne101

Staff member
Plugin Developer
Moderator
Verified Member
It sounds like there's a few things going on here. I'd say it's a combination of bugs on both PK's end and yours.

1. Try make your ability class extend your custom element class. Then register it in your main class with CoreAbility.registerPluginAbilities(plugin, package). This should be your plugin instance and the package to your classes in a string (e.g. I use com.strangeone101 for my packages, so I use that)
2. I know there is bugs with how PK loads abilities that aren't stock, so this could effect the element as well. It'd be more safe to restart the server while testing and not doing /reload. Try that and see if it's any better
 

Darius

New Member
It sounds like there's a few things going on here. I'd say it's a combination of bugs on both PK's end and yours.

1. Try make your ability class extend your custom element class. Then register it in your main class with CoreAbility.registerPluginAbilities(plugin, package). This should be your plugin instance and the package to your classes in a string (e.g. I use com.strangeone101 for my packages, so I use that)
2. I know there is bugs with how PK loads abilities that aren't stock, so this could effect the element as well. It'd be more safe to restart the server while testing and not doing /reload. Try that and see if it's any better
Error:

[19:07:41 ERROR]: Error occurred while enabling Elements v1.0 (Is it up to date?)
java.util.NoSuchElementException
at sun.misc.CompoundEnumeration.nextElement(Unknown Source) ~[?:1.8.0_131]
at com.projectkorra.projectkorra.ability.util.AbilityLoader.<init>(AbilityLoader.java:44) ~[?:?]
at com.projectkorra.projectkorra.ability.CoreAbility.registerPluginAbilities(CoreAbility.java:525) ~[?:?]
at com.darius.Element.Elemente.onEnable(Elemente.java:16) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:292) ~[spigot.jar:git-Spigot-72c2605-251a5b6]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) [spigot.jar:git-Spigot-72c2605-251a5b6]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot.jar:git-Spigot-72c2605-251a5b6]
at org.bukkit.craftbukkit.v1_10_R1.CraftServer.enablePlugin(CraftServer.java:373) [spigot.jar:git-Spigot-72c2605-251a5b6]
at org.bukkit.craftbukkit.v1_10_R1.CraftServer.enablePlugins(CraftServer.java:323) [spigot.jar:git-Spigot-72c2605-251a5b6]
at org.bukkit.craftbukkit.v1_10_R1.CraftServer.reload(CraftServer.java:747) [spigot.jar:git-Spigot-72c2605-251a5b6]
at org.bukkit.Bukkit.reload(Bukkit.java:539) [spigot.jar:git-Spigot-72c2605-251a5b6]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [spigot.jar:git-Spigot-72c2605-251a5b6]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot.jar:git-Spigot-72c2605-251a5b6]
at org.bukkit.craftbukkit.v1_10_R1.CraftServer.dispatchCommand(CraftServer.java:647) [spigot.jar:git-Spigot-72c2605-251a5b6]
at org.bukkit.craftbukkit.v1_10_R1.CraftServer.dispatchServerCommand(CraftServer.java:633) [spigot.jar:git-Spigot-72c2605-251a5b6]
at net.minecraft.server.v1_10_R1.DedicatedServer.aL(DedicatedServer.java:438) [spigot.jar:git-Spigot-72c2605-251a5b6]
at net.minecraft.server.v1_10_R1.DedicatedServer.D(DedicatedServer.java:401) [spigot.jar:git-Spigot-72c2605-251a5b6]
at net.minecraft.server.v1_10_R1.MinecraftServer.C(MinecraftServer.java:668) [spigot.jar:git-Spigot-72c2605-251a5b6]
at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:567) [spigot.jar:git-Spigot-72c2605-251a5b6]

Elemente is my element's main class. I added CoreAbility.registerPluginAbilities(plugin, "com.darius.Abilities"); plugin is an instance of my element and the package is my ability's package.
 
Last edited:

StrangeOne101

Staff member
Plugin Developer
Moderator
Verified Member
Error:

[19:07:41 ERROR]: Error occurred while enabling Elements v1.0 (Is it up to date?)
java.util.NoSuchElementException
at sun.misc.CompoundEnumeration.nextElement(Unknown Source) ~[?:1.8.0_131]
at com.projectkorra.projectkorra.ability.util.AbilityLoader.<init>(AbilityLoader.java:44) ~[?:?]
at com.projectkorra.projectkorra.ability.CoreAbility.registerPluginAbilities(CoreAbility.java:525) ~[?:?]
- snip -

Elemente is my element's main class. I added CoreAbility.registerPluginAbilities(plugin, "com.darius.Abilities"); plugin is an instance of my element and the package is my ability's package.
This appears to be a ProjectKorra issue with ability loading. You aren't the only one having this issue, so try using 1.8.3 for now (shouldn't be an issue since you are on 1.10). Hopefully we'll get it resolved sometime soon.
 

StrangeOne101

Staff member
Plugin Developer
Moderator
Verified Member
After some testing, we found that this only happens with plugins that aren't built with maven. All plugins that are, including ProjectKorra, work fine.

I know it's not great but this appears to be the only solution until we get this fixed lol. Hope that helps
 
Top