Library [1.8] ParticleLib

Discussion in 'Resources' started by caseif, Nov 28, 2014.

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

    caseif

    I finished up work last night on updating one of my internal libraries to 1.8, and I thought I'd share it here. Since Mojang changed the constructor for particle packets in 1.8, most if not all exisitng libraries do not function with it. My library should work for Minecraft versions going back to 1.6 and possibly even before, though I haven't tested it for that. It's simple enough to use, and consists of a single class.

    To create a particle effect:
    Code:java
    1. ParticleEffect effect = new ParticleEffect(ParticleEffect.ParticleType.FLAME, 0.02, 5, 0.0001);

    You can then send it to players with:
    Code:java
    1. effect.sendToLocation(someLocation);

    Source: https://github.com/mproncace/ParticleLib
     
    Last edited: Dec 13, 2014
    BrickBoy55, Orange Tabby and Skionz like this.
  2. Offline

    ArthurMaker

    I wonder what is the "ITEM_TAKE" effect... xD
     
  3. Offline

    ChipDev

    Ok.. Why this over @Darkbladde13 "s?
     
  4. Offline

    zDylann

    Thanks for this, is there anyway you can add a way to apply offsets to the particles? This is something that previous libraries support. I'm unsure if the 1.8 constructors allow for offsets anymore.

    EDIT: Nvm, saw how you managed radius. :D You should definitely consider adding some offSet args.
     
  5. Offline

    Esophose

    ShadyPotato
    This is a great replacement for the previous particle lib I was using.
    Agreeing with zDylann that you should split up the radius argument into offset x y z.
    How would you display a specific icon crack as a particle? Such as a melon slice.
     
  6. Offline

    caseif

    I'll be sure to do that in a future commit. Currently, it's not possible to pass data values, but I intend to add that feature very soon as well (probably at the same time as the separate radius arguments).
     
  7. Offline

    timtower Administrator Administrator Moderator

    Removed offtopic conversation.
     
  8. Offline

    caseif

    Thanks :D
     
  9. Offline

    MinecraftMart

    How to import a library... sorry im not very good at this importing stuff :p
     
  10. Offline

    JigokuSaru

    Hi, First of great Library. It works great. But im having a complication i cant figure out.
    Code:
    @EventHandler
       public void onBlockPlace(BlockPlaceEvent e){
         loc = (Location) e.getBlock().getLocation().add(0.5,1,0.5);
         if(e.getBlock().getType() != null){
           if(e.getBlock().getType() == Material.ANVIL){
            
              id = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){
               public void run(){
                 PE = new ParticleEffect(ParticleEffect.ParticleType.HEART, .5,1,0);
                 PE.sendToLocation(loc);
               }          
             }, 0, 20);
    as you can see i want all anvils to have the heart effect to them but, when ever i place more anvils the original effect gets moved then a new set is added as well so if i have 3 anvils, i have one anvil with 3 sets going a once, any help here?
     
  11. Offline

    RingOfStorms

    Just a note that the icon crack packet, unless it changed in 1.8, is not something that you can reliably use. The reason is because the icon crack packet will show a different item depending on its resolution, so someone with a 32bit pack will see a different item than someone with a 16bit pack. So the only time you should really use this particle is for random particles/colors or if you force a resourcepack on the player and you know what the item will be shown as.
     
  12. Offline

    NoLife

    @RingOfStorms
    Like i see it you use the same variable to hold the Particle(PE). Try to use a list instead to hold each of the particles. So you store ALL the packets, maybe it will work. I'm New ro bukkit and coding, but i have S problem like This yesterday, and this work for me. I have also never user particles. But you can always try ;)
     
  13. How to use particle BLOCKCRACK?
    Fort example I want to play BLOCKCRACK of Stone.
     
    Last edited: Aug 7, 2015
  14. Offline

    caseif

    You can use the generic effect with ParticleType.BLOCK_CRACK. However, particle data (i..e. block type) isn't supported by the class at the moment. I may add this if I get the chance, but I can't make any promises.
     
  15. Please try to add this and other datas. I will really appreciate this.
     
Thread Status:
Not open for further replies.

Share This Page