Library EffectLib - Manage your effects the nice way. (Text/Image in Particles)

Discussion in 'Resources' started by Slikey, Apr 21, 2014.

Thread Status:
Not open for further replies.
  1. I know, that bukkit is not thread-safe, but i though sending lot's of packets is probably better in a second thread.
    I guess it's cleverer to send the packets in the main-thread, but would it be possible to synchronise the "playerlist" from the CraftWorld with the synchronised() annotation using the particle-sending-api included in EffectLib?
  2. Offline


    I've got a bit of a question:

    I'm getting a NoClassDefFoundError on init... Do you know where I'm going wrong?
    Show Spoiler

    1. org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: de/slikey/effectlib/EffectLib
    2. at ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    3. at org.bukkit.plugin.SimplePluginManager.loadPlugin( ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    4. at org.bukkit.plugin.SimplePluginManager.loadPlugins( [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    5. at org.bukkit.craftbukkit.v1_7_R3.CraftServer.loadPlugins( [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    6. at org.bukkit.craftbukkit.v1_7_R3.CraftServer.reload( [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    7. at org.bukkit.Bukkit.reload( [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    8. at org.bukkit.command.defaults.ReloadCommand.execute( [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    9. at org.bukkit.command.SimpleCommandMap.dispatch( [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    10. at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand( [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    11. at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchServerCommand( [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    12. at net.minecraft.server.v1_7_R3.DedicatedServer.aB( [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    13. at net.minecraft.server.v1_7_R3.DedicatedServer.v( [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    14. at net.minecraft.server.v1_7_R3.MinecraftServer.u( [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    15. at [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    16. at [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    17. Caused by: java.lang.NoClassDefFoundError: de/slikey/effectlib/EffectLib
    18. at com.QuarkTheAwesome.BasicParticleText.BasicParticleText.<init>( ~[?:?]
    19. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.7.0_40]
    20. at sun.reflect.NativeConstructorAccessorImpl.newInstance( ~[?:1.7.0_40]
    21. at sun.reflect.DelegatingConstructorAccessorImpl.newInstance( ~[?:1.7.0_40]
    22. at java.lang.reflect.Constructor.newInstance( ~[?:1.7.0_40]
    23. at java.lang.Class.newInstance( ~[?:1.7.0_40]
    24. at<init>( ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    25. at ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    26. ... 14 more
    27. Caused by: java.lang.ClassNotFoundException: de.slikey.effectlib.EffectLib
    28. at$ ~[?:1.7.0_40]
    29. at$ ~[?:1.7.0_40]
    30. at Method) ~[?:1.7.0_40]
    31. at ~[?:1.7.0_40]
    32. at ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    33. at ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    34. at java.lang.ClassLoader.loadClass( ~[?:1.7.0_40]
    35. at java.lang.ClassLoader.loadClass( ~[?:1.7.0_40]
    36. at com.QuarkTheAwesome.BasicParticleText.BasicParticleText.<init>( ~[?:?]
    37. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.7.0_40]
    38. at sun.reflect.NativeConstructorAccessorImpl.newInstance( ~[?:1.7.0_40]
    39. at sun.reflect.DelegatingConstructorAccessorImpl.newInstance( ~[?:1.7.0_40]
    40. at java.lang.reflect.Constructor.newInstance( ~[?:1.7.0_40]
    41. at java.lang.Class.newInstance( ~[?:1.7.0_40]
    42. at<init>( ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    43. at ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    44. ... 14 more

    I'm not really sure what's going on: I stuck the lib in the plugins folder, set the dependency to compile in Maven: I just have no idea. Anyway, line 15 of is:
    1. EffectLib lib = EffectLib.instance();

    I'm really not sure, can you help?

    P.S I'm using 2.1-SNAPSHOT from
  3. Offline


    Packets are sent in an async thread anyway. That is handled by netty. So no need for you to cover that.

    Did you add the EffectLib to the plugin dependencies in the plugin.yml?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Oct 29, 2015
  4. Offline


    Slikey You have to do that? Oops. :3

    One other thing, how do you set the location of a TextEffect? There's no location property: is it the stepX and Y?

  5. Offline



    Nevermind. Finally figured it out on my own.
  6. Offline


    Okay... New Question...
    Is there a way to store multiple effects in a list or hashmap?
    I need to keep track of them and it seems like my variables are restricted to whatever type effect I am using.


    //Main Class
    ConcurrentHashmap efxmap<Player,WarpEffect> = new ConcurrentHashMap<Player, WarpEffect>();
    private void dostuff() {
    //depending on some factors
    if(condtion1 == true) { //do this effect
    ]WarpEffect effect = new WarpEffect(plugin.getEM());
    } else { //do this effect instead...
    VortexEffect effect = new VortexEffect(plugin.getEM());
    //now set up the effect
    effect.particle = ParticleEffect.FLAME;
    The above code works until you add in the second effect, as effect is already defined as a WarpEffect but I would like to apply a different effect in the same class depending on what the user does. The ONLY part that changes in the code would be the effect type and possible a couple effect paramaters... If i cant store them differently in the hashmap I will have to create a hashmap per effect :(

    I tried doing this:
    Effect effect = null;

    then later
    effect = new VortexEffect();

    but the compiler complans and wants effect to be of the type VortexEffect instead of Effect..
  7. Offline


    @dNiymCheck your Imports. You maybe used the Bukkit Class "Effect"
  8. Offline


    You're exactly right, I did have a bukkit effect imported. That should work now!

    How about item's as particles?
    Such as if I wanted to make a smoke effect or helixeffect and spawn dropped items that vanish after a few seconds?
    theres another plugin that uses this and its called the itemspray effect. You specify the item_id and (less importantly to me)data such as color. and it "sprays" out whatever item you have selected.

    this is the effect look:

    Ideally i would like to be able to spawn a ring of swords (or whatever particles) around a player and have them rotate around / fly outward before they hit the ground.
  9. Offline


    You guys might know that I am a bit late xD
    Another bad thing in 1.8: DMCA. No fixing for the particle rendering, at least until Sponge is out. Or another system. Or if Bukkit is revived lol
  10. Offline


    Stop derailing threads, seriously.
  11. Offline


    any thoughts on the possibilities of us getting items icons as particle effects? Some of these effects would be pretty sweet as a spray of swords or diamonds :D
  12. Slikey How do I make that text! I so want some example code for that!
  13. Offline


  14. Offline


    Slikey How can i make a particle follow a player? I was trying to make it run for a time but only works in the first time:
    1. final CylinderLocationEffect effect = new CylinderLocationEffect(em, p.getLocation());
    3. effect.particle = ParticleEffect.ENCHANTMENT_TABLE;
    5. effect.height = 4;
    6. effect.iterations = 10;
    8. effect.start();
    10. Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
    11. public void run() {
    12. effect.start();
    13. }
    14. }, 20);
    16. Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
    17. public void run() {
    18. effect.start();
    19. }
    20. }, 40);
    22. Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
    23. public void run() {
    24. effect.start();
    25. }
    26. }, 60);
    28. Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
    29. public void run() {
    30. effect.start();
    31. }
    32. }, 80);
    34. Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
    35. public void run() {
    36. effect.start();
    37. }
    38. }, 100);
  15. Offline


    Why do you start it 5 times...
  16. Offline


    LCastr0 For "follow" de player
  17. Offline


    But you don't need that...
  18. Offline


    Use a repeating task.
  19. Offline


    teej107 Could you give me an example?
  20. Offline


  21. Offline


    teej107 It only works 2 times, i need that it works 20 times. or more
  22. Offline


    When can we download the new plugin version with annimatedballeffect? Also, can you make it so that it follow the player and never ends unless the player turns it off? thank you for being soo awesome
  23. Offline


    When I try to make any effect work like this:
    AnimatedBallEffect balleffect = new AnimatedBallEffect(em);
    It gives me a ClassNotFoundException: de.slikey.effectlib.effect.<Class of effect I'm using> when I use the command.
  24. Offline


    LCastr0 I saw your video where you showed the AnimatedBallEffect, On that post you also putted a source link on github but the link is down, Can you send me the source please? Its a very cool effect :D
  25. Offline


    The effect wasn't made by me, and it's already on EffectLib
  26. Offline


  27. Offline


  28. Offline


    LCastr0 Im trying to create the animatedball effect, But it doesn't spawn.. I get the error: Caused by: java.lang.IllegalArgumentException: EffectManager cannot be null!
    To spawn it in I use
                              AnimatedBallEffect balleffect = new AnimatedBallEffect(em);
                              balleffect.period = 10;
                              balleffect.particle = ParticleEffect.FIREWORKS_SPARK;
  29. Offline


  30. Offline


Thread Status:
Not open for further replies.

Share This Page