Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Remove particle

Comments in 'Plugin Development' started by TheMaks, Sep 14, 2015.

  1. TheMaks
    Offline

    TheMaks Active Member

    Joined:
    Jul 19, 2015
    Posts:
    58
    Minecraft User:
    TheMaks
    How remove floating text particle ?
  2. xionbig
    Offline

    xionbig Active Member Plugin Developer

    Joined:
    Jun 11, 2014
    Posts:
    106
    Plugins:
    2
    Minecraft User:
    NikoZazza
    I have done:
    PHP:
    $this->particle = new FloatingTextParticle(new Vector3($x$y$z), " """);
    $p->getLevel()->addParticle($this->particle);

    // ...............
    $this->particle->setInvisible(true);
    $p->getLevel()->addParticle($this->particle);
  3. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    But what if I have multiple FTPs?
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Then how do I know which particle you are trying to remove?
  5. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    FTP = file transfer protocol
    jojoe77777 likes this.
  6. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Just don't pick on those tiny things and start flame wars, OK? You understand what he means, and FTP can mean many things other than FileTransferProtocol.

    @Legoboy0215 so you don't even know what you are trying to do? Before you post a question, please make sure you know what you are trying to do.
    Andrey Nazarchuk and jojoe77777 like this.
  8. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    I am trying to remove a FTP (*Lazy me*) from a bunch of them in a world.
    For example, I have 20 FTPs in a world and I want to delete the one that has a specific vector.
  9. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Store the FTPs in an array with Level::blockHash() as the key.
  10. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    You don't know what sarcasm is, do you?
  11. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    You don't know him, do you? :D
    Sarcasm and sense of humor is what he lacks :p (No Offense)
    HotFireyDeath likes this.
  12. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    You know him better than I do! :eek: I didn't know that!
    HotFireyDeath likes this.
  13. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Sarcasm...
  14. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    PHP:
    public static function blockHash($x$y$z){
        return 
    PHP_INT_SIZE === ? (($x 0xFFFFFFF) << 35) | (($y &    0x7f) << 28) | ($z 0xFFFFFFF) : $x ":" $y .":"$z;
    }
    What does this do? Hash the block?
  15. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    spam....
  16. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    Trying to be a smart mouth?
    Legoboy0215 likes this.
  17. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Just shut up and do something constructive, OK?
    It returns a unique identifier that represents an XYZ match (i.e. a Vector3, although you aren't passing that object). For 64 bit systems, it returns an integer that combines the coords. For 32 bit systems, it returns a string that combines the coords. A notable advantage is that you can get the coords back from the hash.

    It basically gives a much better performance on 64 bit systems when you try to store values with coords as the key.
    jojoe77777 likes this.
  18. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Confused....
    Wait. It returns x:y:z like this?
  19. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Echo it out and see.
  20. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    On 32-bit systems, it returns "1:2:3" for (1, 2, 3)
    On 64-bit systems, it returns X×2^35+Y×2^28+Z.
    Legoboy0215 and jojoe77777 like this.

Share This Page

Advertisement