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
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
the problem is that i need it for survival/hungergames... so flint/fire ban or prevent from spawning is not the answer
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, $z, 0); $this->getOwner()->getLogger()->info("Fire removed"); } } }} please guys dont punch me
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
PHP: public function onBlockPlace(BlockPlaceEvent $event){$block = $event->getBlockif($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->z, Block::AIR));}}
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());}}
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];
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