Library [1.8] ParticleEffect v1.7

Discussion in 'Resources' started by DarkBladee12, Jun 20, 2013.

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

    JamieSinn

    Last edited by a moderator: Oct 29, 2015
  2. Offline

    mkezar

    i get this big error when trying to spawn a heart particle on command:
    ERROR (open)

    [08:01:30 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'mwzombie' in plugin MegaWallsKits v1.0
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:140) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:624) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PlayerConnection.handleCommand(PlayerConnection.java:1058) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java:919) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(SourceFile:37) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(SourceFile:9) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_31]
    at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_31]
    at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:643) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:284) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:598) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:506) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_31]
    Caused by: java.lang.NoSuchMethodError: org.bukkit.Bukkit.getOnlinePlayers()[Lorg/bukkit/entity/Player;
    at de.slikey.effectlib.util.ParticleEffect$ParticlePacket.sendTo(ParticleEffect.java:1209) ~[?:?]
    at de.slikey.effectlib.util.ParticleEffect.display(ParticleEffect.java:590) ~[?:?]
    at plugins.mkezar.Kits.onCommand(Kits.java:58) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    ... 14 more


    EDIT: What Do I Do?

    EDIT: Figured It Out. It Combatted With EffectLib
     
    Last edited: Jun 26, 2015
  3. Offline

    Raydond123

    For some reason whenever I try to use the #fromName(String name) method, it simply returns null for me even though it's a particle that exists.

    I even added a broadcast message and it put out "SPELL_WITCH".
     
  4. Offline

    andreaskal

    ehmm... i were pretty noob about bukkit coding cause i started do it for some days ago so how do i make particles using EventHandler ? i has tried alot of youtube videos but it wont work:'( i have made the 2 classes succesfully but when i try to use a particles like this
    • ParticleEffect.NAME.display(Vector direction, float speed, Location center, double range)
    i can't figure out how to use this and activate it!

    Please help!

    Can i get a very simple example please? because i don't know how to use this:D

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

    Gartenzaun

    Hello, is there a way to display a particle and cancel it after a tick? I don't want to get a line of particles when walking around, I just want to pop up one particle and remove it when I walk on. (I tried already with Packets, but it doesn't work :( ). This is my code for the particle effect (Barrier), but it creates the "line":

    Code:
    ParticleEffect.BARRIER.display(0, 0, 0, 1, 1, p.getLocation(), p);
    Thanks for your answers!
     
  6. Offline

    DarkBladee12

    @andreaskal
    An example would be
    Code:
    ParticleEffect.CRIT.display(new Vector(1,1,1), 1F, new Location(Bukkit.getWorld("world"), 123, 456, 789), 20);
    However only particle effects with the DIRECTIONAL property can be used in this method.


    @Gartenzaun
    There's currently no way to make particles disappear after a specific amount of time. It's kinda hard-coded how long a particle stays and it can only be influenced by the speed value for some effects. The BARRIER effect however will stay pretty long compared to others.
     
    Last edited: Jul 18, 2015
  7. Offline

    andreaskal

    like this because it doesn't work :(

    Udklip.PNG
     
  8. Offline

    Gartenzaun

    Do you know any particle, which stays really short and is clearly visible?
     
  9. Offline

    DarkBladee12

    @andreaskal
    What doesn't work exactly? And btw you should replace the location/vector with other parameters.


    @Gartenzaun
    A particle which stays for a really short amount of time is CRIT or CRIT_MAGIC for example.
     
    Last edited: Jul 18, 2015
  10. Offline

    andreaskal

    i think location should be something like player.getLocation
    but what with vector ?
     
  11. Offline

    DarkBladee12

    @andreaskal
    Well the vector defines the direction the particle will fly to. (using new Vector(0, 0, 0) will make it stay at the location where you displayed it)
     
  12. Offline

    andreaskal

    still won't work :(

    Udklip.PNG

    it just says "An internal error ocurred..."

    and i don't have something like effectlib installed :D

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

    DarkBladee12

    @andreaskal
    Well this error likely occurred because you tried to display a particle effect which is not DIRECTIONAL with the method for directional ones. For this effect you'd have to use
    Code:
    ParticleEffect.DRIP_WATER.display(1F, 1F, 1F, 1F, 10, new Location(Bukkit.getWorld("world"), 123, 456, 789), 20);
     
  14. Offline

    andreaskal

    still don't work idk why ;(
     
  15. Offline

    DarkBladee12

    @andreaskal
    Please be more precise if you're saying something doesn't work and posting error logs if you have any would help too!
     
  16. Offline

    andreaskal

    there were no errors (in eclipse, console or minecraft)
    upload_2015-7-18_18-54-14.png
     
  17. Offline

    DarkBladee12

    @andreaskal
    If there are now errors, what doesn't work??? Btw you should still change the location to the one of the player that executed the command for example.
     
  18. Offline

    andreaskal

    when i use /particleeffect it says Particles but no particles are showing but what should i change the location to ?
     
  19. I wrote a plugin that has arrow trails but when i use the flame particle it just flickers and flies all over the place while other trails do not.

    This is the line i use:
    ParticleEffect.FLAME.display(0,0,0,1, 1, projectile.getLocation(), 1);

    This works normal for all trails exept flame. Help?

    Here you can see it in action, You can see the particles going everywhere. You dont really see the flickering because its a low fps (Gifs :l) but its clearly there when you shoot it
    [​IMG]
     
    Last edited: Jul 19, 2015
  20. Offline

    Deleted user

    How can I color the Particles?!
    I can't instantiate ParticleColor...
     
  21. Offline

    DarkBladee12

    @VexareHD
    Use the methods which require the ParticleColor parameter, but instead of trying to instantiate ParticleColor use OrdinaryColor or NoteColor. The NoteColor class is just there for the NOTE particle effect, since the color of it is based on the note and not on some rgb values. Furthermore you have to check if the effect you want to display is colorable, because if it's not it won't work and throw an exception!
     
  22. Offline

    Deleted user

    @DarkBladee12
    Thanks a lot!
    But I don't get how to use OrdinaryColor...
    And how can I spawn colored particles with an amount?
    Could you add a short Code Example?
     
  23. Offline

    DarkBladee12

    @VexareHD
    Well an example would be
    Code:
    Player player = Bukkit.getPlayer("DarkBlade12");
    ParticleEffect.SPELL_MOB.display(new OrdinaryColor(213, 27, 27), player.getLocation(), 20);
    If you want to display the particle more than one time just use a for-loop which executes the display method.
     
  24. Offline

    Deleted user

    @DarkBladee12
    This was very helpful. But I've got one last question:
    Why can't I color Firework Sparks???
    Or: How can I?
     
  25. Offline

    DarkBladee12

    @VexareHD
    The FIREWORKS_SPARK particle is currently not colorable, it must be some kind of hard-coded stuff which colors the firework particles.
     
  26. Offline

    andreaskal

  27. Offline

    mkezar

    @DarkBladee12 I get an error in the ParticleEffect for the import com.darkblade12.particleefect.reflectionUtils.PackageType; What do I do?
     
  28. Offline

    DarkBladee12

    @andreaskal
    This should work fine, but you should change the new Location(...) to player.getLocation().

    @mkezar

    You have to copy the ReflectionUtils class too and import it afterwards.
     
  29. Offline

    andreaskal

    thanks! it works but what shall i change the 123, 456, 789 to ?
    Udklip.PNG
     
  30. @andreaskal
    Remove the whole "new Location(...)" and put "player.getLocation()"
     
    andreaskal likes this.
Thread Status:
Not open for further replies.

Share This Page