Solved EffectLib Problem

Discussion in 'Plugin Development' started by jensdeboom, Sep 30, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    jensdeboom

    Hey all,
    I'm trying to use EffectLib (https://forums.bukkit.org/threads/e...-the-nice-way-text-image-in-particles.259879/) but I don't find any updated posts on how to make this work.
    In the resources I find, it tells me to do it like this:
    Code:java
    1. AnimatedBallEffect balleffect = new AnimatedBallEffect(em, p.getLocation());
    2. balleffect.start();

    However, if I make it like that, it gives me an error saying that I can only use:
    new AnimatedBallPlayerLocationEffect(EffectManager);
    But if I try to make it work like this:
    Code:java
    1. AnimatedBallEffect balleffect = new AnimatedBallEffect(em);
    2. balleffect.setLocation(p.getLocation());
    3. balleffect.start();

    I get no errors but it doesn't make the effect in-game.
    I have this problem with every effect of EffectLib so if anyone can explain me how this works/link me to a resource, that'd be great. Otherwise, if none is familiar with EffectLib, does anyone know how I could just use certain effects by using the source code (https://github.com/Slikey/EffectLib...ikey/effectlib/effect/AnimatedBallEffect.java) in my own project?

    - Jens

    EDIT: This is my onEnable():
    Code:java
    1. private EffectManager em;
    2.  
    3. public void onEnable(){
    4. getServer().getPluginManager().registerEvents(this, this);
    5. EffectLib lib = EffectLib.instance();
    6. em = new EffectManager(lib);
    7. }
     
  2. Offline

    Deleted user

  3. Offline

    jensdeboom

    As I already said in the OP, I tried that, but if I try it with effect.setEntity(); the effect doesn't get created. If you scroll down on that page you can see the demo. If I make it that way, it gives me an error because I can only use new AnimatedBallEffect(EffectManager); I already stated all of this in the OP.

    Anyone?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 14, 2016
  4. Offline

    Monkey_Swag

  5. Offline

    Skionz

    jensdeboom
    Are you trying to make a sphere? You can make a nested for loop with the inner one creating a ring of particles and the outer one incrementing the radius. You can calculate y by using
    Code:java
    1. double y = Math.sqrt((Math.pow(radius, 2) - Math.pow(x, 2) - Math.pow(z, 2)));
     
  6. Offline

    jensdeboom


    Skionz
    I trying to make something like this: https://forums.bukkit.org/threads/shaped-particle-effects.303388/ . I know it can be done with EffectLib but I can't get it to work.

    Skionz Monkey_Swag Ok so now when I try it like this:
    Code:
    AnimatedBallEffect balleffect = new AnimatedBallEffect(em);
    balleffect.setLocation(p.getLocation());
    balleffect.start();
    It gives me a ClassNotFoundException: de.slikey.effectlib.effect.<Class of effect I'm using>

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 14, 2016
  7. Offline

    Skionz

    jensdeboom likes this.
  8. Offline

    jensdeboom

    Skionz
    Wow I'm stupid... I have been developing all kinds of plugins for over 1 year now and but I normally don't use APIs. So I forgot to put it in my plugins folder. I can't access my computer atm but that will obviously solve the problem. Thanks for your help.
     
    Skionz likes this.
Thread Status:
Not open for further replies.

Share This Page