From 7acdb0dd3fe1bf6563a0d2e22a7e83e5cb4c9d21 Mon Sep 17 00:00:00 2001 From: "beN39sGroup (Blue Electric)" Date: Sun, 17 Nov 2013 09:39:40 +0900 Subject: [PATCH] Fix Performance Problem Welcome, TPS! --- src/material/block/liquid/Water.php | 2 +- src/pmf/Level.php | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/material/block/liquid/Water.php b/src/material/block/liquid/Water.php index 751420358..8aa36470c 100644 --- a/src/material/block/liquid/Water.php +++ b/src/material/block/liquid/Water.php @@ -121,7 +121,7 @@ class WaterBlock extends LiquidBlock{ $b = $this->getSide($side); if($b instanceof WaterBlock) { - if( $this->getSourceCount() >= 2) + if( $this->getSourceCount() >= 2 && $level != 0x00) { $this->level->setBlock($this, new WaterBlock(0), false, false, true); } diff --git a/src/pmf/Level.php b/src/pmf/Level.php index 73091db12..56f035fcc 100644 --- a/src/pmf/Level.php +++ b/src/pmf/Level.php @@ -469,11 +469,14 @@ class PMFLevel extends PMF{ ++$this->chunkChange[$index][$Y]; } $this->chunkChange[$index][-1] = true; - $pos = new Position($x, $y, $z, $this->level); - for($side = 0; $side <= 5; ++$side) + if($old_b instanceof LiquidBlock) { - $b = $pos->getSide($side); - ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($b, 0, 0, $this->level), 10, BLOCK_UPDATE_NORMAL); + $pos = new Position($x, $y, $z, $this->level); + for($side = 0; $side <= 5; ++$side) + { + $b = $pos->getSide($side); + ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($b, 0, 0, $this->level), 10, BLOCK_UPDATE_NORMAL); + } } return true; }