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

Remove all fire in a world?

Comments in 'Plugin Development' started by Legoboy0215, Aug 7, 2015.

  1. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Is it possible to remove all fire in a world?
  2. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    same problem here... dont find a way to cleanup the map from fire

    try to write the coords from interact event with 259 in array
    and overwrite them with air but this is buggy
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Prevent fire from spawning. Otherwise, use WorldEditArt.
    Legoboy0215 likes this.
  4. HOST
    Offline

    HOST Active Member

    Joined:
    Mar 15, 2015
    Posts:
    52
    Minecraft User:
    HOST
    hello,
    we i experienced the same when griefers abused the fire and made it like (hell)
    i used ban item plugin to ban fire and tnt but its better to ban flint and steal ;)
    i banned it for months now and no complains are being made
  5. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    the problem is that i need it for survival/hungergames... so flint/fire ban or prevent from spawning is not the answer
  6. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    I can't ban it. This is an HG game lol.
  7. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    i will try now something but i think it will be laggy xD

    PHP:
    for($x $startX$x <= $endX; ++$x)
    {
        for(
    $y $startY$y <= $endY; ++$y)
       {
            for(
    $z $startZ$z <= $endZ; ++$z)
            {
                if(
    $this->getOwner()->getServer()->getLevelByName("$level")->getBlockIdAt($x$y$z) == 51)
                  {
                      
    $this->getOwner()->getServer()->getLevelByName("$level")->setBlockIdAt($x$y$z0);
                      
    $this->getOwner()->getLogger()->info("Fire removed");
                  }
           }
       }
    }
    please guys dont punch me :rolleyes:
  8. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    IT WORKS and its not so much laggy as i think befor =) we can use it !!!!

    the start timer from 30sec is important because some devices have a 15sec freeze screen
    Last edited: Aug 7, 2015
    Legoboy0215 and jojoe77777 like this.
  9. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    PHP:
    public function onBlockPlace(BlockPlaceEvent $event){
    $block $event->getBlock
    if($event->getBlock()->getId() === 51){ // Fire
    $this->fire[] = new Position($block->getFloorX(), $block->getFloorY(), $block->getFloorZ(), $block->getLevel());
    }
    if(
    $block->getId() === 30){ // Cobweb
    $this->cobweb[] =new Position($block->getFloorX(), $block->getFloorY(), $block->getFloorZ(), $block->getLevel());
    }
    return 
    true;
    }

    public function 
    clearWorld(){
    foreach(
    $this->fire as $fire){
    $fire->getLevel()->setBlock(new Vector3($fire->x$fire->y$fire->z), Block::AIR);
    }
    foreach(
    $this->cobweb as $cobweb){
    $cobweb->getLevel()->setBlock(new Vector3($cobweb->x$cobweb->y$cobweb->zBlock::AIR));
    }
    }
    Legoboy0215 likes this.
  10. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    you dont set a fire by placeblockevent...
  11. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    ok
    PHP:
    public function onPlayerInteract(PlayerInteractEvent $event){
    $block $event->getBlock();
    if(
    $event->getItem()->getId() === 259 and $block->getId() !== 0){
    $this->fire[] = new Position($block->getFloorX(), $block->getFloorY(), $block->getFloorZ(), $block->getLevel());
    }
    }
  12. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    and you forgott by Y +1
  13. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    In where???
  14. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Can u show me the $x y z you set? Please :p
  15. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    i check all blocks between the setted arena positions from config

    PHP:
    $pos1 explode(","$this->getOwner()->arena1areapos1); 
    $pos2 explode(","$this->getOwner()->arena1areapos2);


    $startX $pos1[0];
    $endX $pos2[0];
    $startY $pos1[1];
    $endY $pos2[1];
    $startZ $pos1[2];
    $endZ $pos2[2];
  16. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Oh...
  17. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    this is why i think befor it will be laggy... and it is... but the arena is not soo big and this freeze is ok

Share This Page

Advertisement