From 4e4c392adeee9ab180f495b965e6b6ce075ac314 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Mon, 6 Nov 2023 19:58:25 +0300 Subject: [PATCH] everlasting fire fix, small bugfixes --- src/API/LevelAPI.php | 3 +++ src/entity/Entity.php | 9 ++++++--- src/material/block/liquid/LavaBlock.php | 5 ++++- src/material/block/liquid/WaterBlock.php | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/API/LevelAPI.php b/src/API/LevelAPI.php index 71b415b2..8fcb2ff6 100644 --- a/src/API/LevelAPI.php +++ b/src/API/LevelAPI.php @@ -167,6 +167,9 @@ class LevelAPI{ break; case "save-all": $output .= "Saving...\n"; + foreach($this->server->clients as $p){ + $p->sendChat("Saving world, server might lag a bit..."); + } $save = $this->server->saveEnabled; $this->server->saveEnabled = true; $this->saveAll(); diff --git a/src/entity/Entity.php b/src/entity/Entity.php index 58a5895b..b1a9c09e 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -395,9 +395,6 @@ class Entity extends Position } else{ $hasUpdate = true; } - if(($this->player instanceof Player) and ($this->player->gamemode & 0x01) === CREATIVE){ // Remove fire effects in next tick - $this->fire = 1; - } } $startX = floor($this->boundingBox->minX); @@ -470,6 +467,9 @@ class Entity extends Position if ($this->inBlock(new Vector3($x, $y, $z))) { $this->harm(5, "lava"); $this->fire = 300; + if($this->isPlayer() and ($this->player->gamemode & 0x01) === CREATIVE){ + $this->fire = 1; + } $this->updateMetadata(); $hasUpdate = true; } @@ -478,6 +478,9 @@ class Entity extends Position if ($this->inBlock(new Vector3($x, $y, $z))) { $this->harm(1, "fire"); $this->fire = 300; + if($this->isPlayer() and ($this->player->gamemode & 0x01) === CREATIVE){ + $this->fire = 1; + } $this->updateMetadata(); $hasUpdate = true; } diff --git a/src/material/block/liquid/LavaBlock.php b/src/material/block/liquid/LavaBlock.php index 832f688b..5d6bff7a 100644 --- a/src/material/block/liquid/LavaBlock.php +++ b/src/material/block/liquid/LavaBlock.php @@ -69,9 +69,12 @@ class LavaBlock extends LiquidBlock implements LightingBlock{ /*if($this->checkWater()){ return; }*/ - $falling = $this->meta >> 3; $down = $this->getSide(0); + if($down instanceof WaterBlock) { + $this->level->fastSetBlockUpdate($down->x, $down->y, $down->z, STONE, 0, true); + return; + } $from = $this->getFrom(); if($from !== null || $level == 0x00){ diff --git a/src/material/block/liquid/WaterBlock.php b/src/material/block/liquid/WaterBlock.php index d49cb318..e6ecc512 100644 --- a/src/material/block/liquid/WaterBlock.php +++ b/src/material/block/liquid/WaterBlock.php @@ -34,7 +34,7 @@ class WaterBlock extends LiquidBlock{ } $b = $this->getSide($side); if($b instanceof LavaBlock){ - $level = $b->meta & 0x06; + $level = $b->meta & 0x07; if($level == 0x00){ $this->level->setBlock($b, new ObsidianBlock(), false, false, true); }else{