1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Create a border particle

Discussion in 'Development' started by dbcooper, Oct 19, 2018.

  1. dbcooper

    dbcooper Spider Jockey

    Messages:
    32
    GitHub:
    dbcooper
    Hello,

    I currently have this old outdated code to create a border particle.
    PHP:
    for($x $startX$x <= $endX$x++){
      
    addParticle($x$y$startZ);
      
    addParticle($x$y$endZ);
    }
    for(
    $z $startZ 1$z $endZ$z++){
      
    addParticle($startX$y$z);
      
    addParticle($endX$y$z);
    }
    I was wondering if anyone knew of another way to create border particles every 5 blocks away. I currently use the spawn position and determine the distance from it to create my actual border type knock-back which uses the interval $size ($distance) which is set to 100 blocks away from the original spawn point of the world.

    Any-all help is appreciated.
    Thanks.
     
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    you know creating a border for the whole map despite no one was there will probably waste a lot of cpu right?
     
  3. dbcooper

    dbcooper Spider Jockey

    Messages:
    32
    GitHub:
    dbcooper
    So thats why my onMove border will work just fine. I was just wondering how to do the particles. I guess im going to do my second idea.
     
  4. dbcooper

    dbcooper Spider Jockey

    Messages:
    32
    GitHub:
    dbcooper
    I have 4 cpu’s so it doesn’t matter to me. I barely use 2 cores.
     
  5. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    waste CPU just means extra load and more lag
    PMMP dont really do well with threads, so you should get higher clock rate or reduce wasted load
    if you insist you should do something like
    only spawning border IF players are near it
     
  6. dbcooper

    dbcooper Spider Jockey

    Messages:
    32
    GitHub:
    dbcooper
    Now how would i do that? How would i even spawn the elder pargicles 5 blocks apart?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.