Library [1.8] ParticleEffect v1.7

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

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

    97WaterPolo

    LCastr0
    Particles are rendered by the client. If you are to far away the particles just won't render, or your current resource pack doesn't that the particles.
     
  2. Offline

    LCastr0

    I'm not THAT far, but I discovered the problem though. The MAX_VALUE from the ParticleEffect class was 16, just changed to 100 ;D
     
  3. Offline

    97WaterPolo

  4. LCastr0 you made it that the player can see the effect from distance that is longer than 16 blocks? :eek: if so, how? I cant find the MAX_VALUE thingy..
     
  5. Offline

    DarkBladee12

    Someone_Like_You LCastr0 Isn't the maximum range of particles 16 blocks in vanilla Minecraft? Because I put it there because I thought it was the real maximum range, so displaying them with a higher range wouldn't make any sense.
     
  6. DarkBladee12 Well, I dont know haha, just asking... Il check and edit
    EDIT: Its 16 max range, xD
     
  7. Offline

    LCastr0

    Nope... With 16 of max range, 10 blocks away, I can't see the particles. With the value of 100, I can.

    ParticleEffect class, search for
    Code:
    private static final double MAX_RANGE = 16;
    and Change to:
    Code:
    private static final double MAX_RANGE = 100;
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 29, 2015
  8. LCastr0 The max_range value was 20 no?... and thanks
     
  9. Offline

    LCastr0

    Oh, btw, forgot to say... (And didn't test..) Only works with the FIREWORK_SPARK...
     
  10. Offline

    Quaro

    How to set firework colors?
     
  11. Offline

    LCastr0

    I think it's not possible :/
     
  12. Looks really nice,
    could you add a pic or a video?
     
  13. Offline

    DarkBladee12

    bluegru I might add some pictures and a simple plugin with commands to test the particle effects soon!

    Quaro That's not possible with the methods that the current API provides. You could try to create a firework entity and call the method detonate on it instead to instantly display the effect. LCastr0 Ah well, seems like the range of the FIREWORKS_SPARK particle is increased, because you weren't able to see them if the firework rockets fly up high in the sky.

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

    LCastr0

    Ok :p
    Also, could you update it with a colored firework particle? :p (I saw the part about the color, too :p)
    And maybe colored note/mob_spell particles? :p
     
  15. Offline

    DarkBladee12

    LCastr0 It's currently not possible to color a firwork particle due to the Bukkit API. The note and mob spell particles can either have random colors or one specific color like I stated in the notes in the first post.
     
  16. Offline

    LCastr0

    Oh :/ (The specific color is green and white?)
     
  17. Offline

    DarkBladee12

    LCastr0 For mob spell it's black and for note it's green. These colors can be achieved by using a speed value of 0.
     
  18. Offline

    LCastr0

    Yeah, the thing about speed I know, thank you tho
     
  19. Offline

    ThunderKing54

    Code:
    07:29:12 [SCHWERWIEGEND] java.lang.ClassNotFoundException: net.minecraft.server.
    v1_5_R3.PacketPlayOutWorldParticles
    07:29:12 [SCHWERWIEGEND]        at org.bukkit.plugin.java.PluginClassLoader.find
    Class0(PluginClassLoader.java:70)
    07:29:12 [SCHWERWIEGEND]        at org.bukkit.plugin.java.PluginClassLoader.find
    Class(PluginClassLoader.java:53)
    07:29:12 [SCHWERWIEGEND]        at java.lang.ClassLoader.loadClass(Unknown Sourc
    e)
    07:29:12 [SCHWERWIEGEND]        at java.lang.ClassLoader.loadClass(Unknown Sourc
    e)
    07:29:12 [SCHWERWIEGEND]        at java.lang.Class.forName0(Native Method)
    07:29:12 [SCHWERWIEGEND]        at java.lang.Class.forName(Unknown Source)
    07:29:12 [SCHWERWIEGEND]        at me.ThunderKing.Scope.ReflectionHandler.getCla
    ss(ReflectionHandler.java:28)
    07:29:12 [SCHWERWIEGEND]        at me.ThunderKing.Scope.ReflectionHandler$Packet
    Type.getPacket(ReflectionHandler.java:545)
    07:29:12 [SCHWERWIEGEND]        at me.ThunderKing.Scope.ParticleEffect.<clinit>(
    ParticleEffect.java:223)
    07:29:12 [SCHWERWIEGEND]        at me.ThunderKing.Scope.Scope.onCommand(Scope.ja
    va:35780)
    07:29:12 [SCHWERWIEGEND]        at org.bukkit.command.PluginCommand.execute(Plug
    inCommand.java:44)
    07:29:12 [SCHWERWIEGEND]        at org.bukkit.command.SimpleCommandMap.dispatch(
    SimpleCommandMap.java:189)
    07:29:12 [SCHWERWIEGEND]        at org.bukkit.craftbukkit.v1_5_R3.CraftServer.di
    spatchCommand(CraftServer.java:523)
    07:29:12 [SCHWERWIEGEND]        at net.minecraft.server.v1_5_R3.PlayerConnection
    .handleCommand(PlayerConnection.java:965)
    07:29:12 [SCHWERWIEGEND]        at net.minecraft.server.v1_5_R3.PlayerConnection
    .chat(PlayerConnection.java:883)
    07:29:12 [SCHWERWIEGEND]        at net.minecraft.server.v1_5_R3.PlayerConnection
    .a(PlayerConnection.java:840)
    07:29:12 [SCHWERWIEGEND]        at net.minecraft.server.v1_5_R3.Packet3Chat.hand
    le(Packet3Chat.java:44)
    07:29:12 [SCHWERWIEGEND]        at net.minecraft.server.v1_5_R3.NetworkManager.b
    (NetworkManager.java:292)
    07:29:12 [SCHWERWIEGEND]        at net.minecraft.server.v1_5_R3.PlayerConnection
    .d(PlayerConnection.java:109)
    07:29:12 [SCHWERWIEGEND]        at net.minecraft.server.v1_5_R3.ServerConnection
    .b(SourceFile:35)
    07:29:12 [SCHWERWIEGEND]        at net.minecraft.server.v1_5_R3.DedicatedServerC
    onnection.b(SourceFile:30)
    07:29:12 [SCHWERWIEGEND]        at net.minecraft.server.v1_5_R3.MinecraftServer.
    r(MinecraftServer.java:581)
    07:29:12 [SCHWERWIEGEND]        at net.minecraft.server.v1_5_R3.DedicatedServer.
    r(DedicatedServer.java:226)
    07:29:12 [SCHWERWIEGEND]        at net.minecraft.server.v1_5_R3.MinecraftServer.
    q(MinecraftServer.java:477)
    07:29:12 [SCHWERWIEGEND]        at net.minecraft.server.v1_5_R3.MinecraftServer.
    run(MinecraftServer.java:410)
    07:29:12 [SCHWERWIEGEND]        at net.minecraft.server.v1_5_R3.ThreadServerAppl
    ication.run(SourceFile:573)
    07:29:12 [SCHWERWIEGEND] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'test
    5' in plugin ScopeByMe v2.0
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:18
    9)
            at org.bukkit.craftbukkit.v1_5_R3.CraftServer.dispatchCommand(CraftServe
    r.java:523)
            at net.minecraft.server.v1_5_R3.PlayerConnection.handleCommand(PlayerCon
    nection.java:965)
            at net.minecraft.server.v1_5_R3.PlayerConnection.chat(PlayerConnection.j
    ava:883)
            at net.minecraft.server.v1_5_R3.PlayerConnection.a(PlayerConnection.java
    :840)
            at net.minecraft.server.v1_5_R3.Packet3Chat.handle(Packet3Chat.java:44)
            at net.minecraft.server.v1_5_R3.NetworkManager.b(NetworkManager.java:292
    )
            at net.minecraft.server.v1_5_R3.PlayerConnection.d(PlayerConnection.java
    :109)
            at net.minecraft.server.v1_5_R3.ServerConnection.b(SourceFile:35)
            at net.minecraft.server.v1_5_R3.DedicatedServerConnection.b(SourceFile:3
    0)
            at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:5
    81)
            at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:2
    26)
            at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:4
    77)
            at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java
    :410)
            at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:5
    73)
    Caused by: me.ThunderKing.Scope.ParticleEffect$PacketInstantiationException: Pac
    ket instantiation failed
            at me.ThunderKing.Scope.ParticleEffect.instantiatePacket(ParticleEffect.
    java:296)
            at me.ThunderKing.Scope.ParticleEffect.instantiateIconCrackPacket(Partic
    leEffect.java:314)
            at me.ThunderKing.Scope.ParticleEffect.displayIconCrack(ParticleEffect.j
    ava:470)
            at me.ThunderKing.Scope.ParticleEffect.displayIconCrack(ParticleEffect.j
    ava:486)
            at me.ThunderKing.Scope.Scope.onCommand(Scope.java:35780)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
            ... 15 more
    Caused by: java.lang.NullPointerException
            at me.ThunderKing.Scope.ParticleEffect.instantiatePacket(ParticleEffect.
    java:294)
            ... 20 more
    I have a big problem i don't know if your library don't work on the 1.5.2 or i have do something wrong when i will spawn a effect it don't work and it cames a error
    and here my PlayEffect
    ParticleEffect.RED_DUST.display(p.getLocation(), 0.0F, 0.0F, 0.0F, 0, 1);
    I hope you can help me

    And i hope when it doesn't work on Version 1.5.2 you can let work it on 1.5.2 please
    When you can't Downgrade this then send me a code where i can spawn the RED_DUST particles.
     
  20. Offline

    DarkBladee12

  21. Offline

    ThunderKing54

    Code:
    public static String getDetailedList() {
            List<String> list = new ArrayList<String>();
            for (String name : NAME_MAP.keySet()) {
                list.add(name + "§7, §8" + NAME_MAP.get(name).getId());
            }
            return new GeneralUtil().getDetailedList(list);
        }
    
    Thank you very much it is very cool to spawn colored smoke at the first time it didn't work because there was a error in the code i have deleted this and it works perfectly thanks :)
     
  22. Thanks but how the heck do I use this? :/
     
  23. Offline

    DarkBladee12

    Connor2weirdness Umm make a class named ParticleEffect and one named ReflectionHandler and copy the code from the gists into these classes. Then you can simply call ParticleEffect.NAME.display(...);
     
  24. Thanks a lot!

    Another question: How does I use this? O. O
    I used *Particle Effect*.display but I have no idea what it's looking for. A location and four floats?

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

    leet4044

    Connor2weirdness ParticleEffect.EFFECT.display(loc, offsetX, offsetY, offsetZ, speed, amount);
     
  26. Tried, it only displays the effect at random places at random times.
     
  27. Offline

    Accyrsed

    I'm sorry, I can't exactly figure out how to work these particles fully. I understand how to spawn them, but I am trying to figure out other properties from them, but without said properties, the goal I have cannot be completed.

    The scenario goes as follows:

    I'm currently trying to create an RPG plugin that enables use of non-conventional weapons (for Minecraft), such as spears, flails, dual-wielded swords, and shields. However, given textures, I'm extremely limited to what I can create and how. After some thought, I realized that particles could easily be strung together in order to create a weapon from scratch. However, one thing that I've noticed is that all particles last a set amount of time and that the server has no control over them once it sends them out (I think), so I am unable to have my server kill all particles and send a new set. Is there a way to send "aged" particles that are set to despawn within 1-2 ticks, so that, by the time the server sends another set, the first will have despawned? I'm trying to work with block-break particles, but if those are not possible to work with, is it possible to work with potion particles or something? (And on that note, can potion particles be spawned by hex color (such as 0x00FF00)?) Lastly, if the aforementioned methods are impossible/unknown, is there a way to send a "delayed packet" (not a delayed "ActionListener") that clients read as having been sent "X amount of time in the past," with just enough delay that the "new" particle is considered "old" and is deleted within a short timeframe?

    I'm sorry this is vague and a relatively strange question. I've been trying to figure this out for a bit, but particles are not in my range of thought. This is the last piece of the puzzle that needs to be solved, albeit first on the list that needs to be done. I don't need much more than a simple explanation, or a small few lines of code to explain it. I get the basics of programming for these servers, but I just don't get the particle age section, that's all. Thank you for your time.
     
  28. Offline

    DarkBladee12

    Accyrsed Hey, sadly there's currently no way to change the display time of particles or make them appear in a specific color with the current API. This packet only provides a few options for particles but by far not all. I believe that most of the particle effects are hardcoded in Minecraft and thus some of their values can't be changed. I've also played around with particles quite a while and I figured out that the speed value can also change the color of the particles, for example if you use a speed value of 0 for the NOTE_SPELL particles they will all be colored green. However if you use any other number they will all appear in random colors and can't be set to a specific color like red.
     
  29. Offline

    97WaterPolo

    You can do a repeating task that keeps sending a new set ever tick, then cancel it based off a delayed scheduler.
     
  30. Offline

    Accyrsed

    DarkBladee12 Oh, okay. Thanks for letting me know. I was hoping that there might have been some option to determine the length that a particle is visible for. Since colors do not work, that leaves me with only block-break particles. In reality, I can't even say that that will work. I do understand that there is no way to limit a particular particle's time of existence, but is there a way to wipe all particles from the server once per tick?

    97WaterPolo Sorry, I don't exactly understand what you mean. I do understand the "repeating task," but I don't see what you mean by canceling it based on a "delayed scheduler." Would this delete the particle that was previously sent, or would it stop the particles from spawning? Sorry, it just makes a significant difference. I can stop particles from spawning, but I can't figure out how to despawn them -- that's where my issue lies. ((This is part of the code that I do not understand, at least the terminology and such. Could you maybe, if you wouldn't mind, write a small code snippet I may look at? I don't need anything large.))
     
Thread Status:
Not open for further replies.

Share This Page