From 5faeff9e16f464ef21d5b0016cc3c2424d8cf862 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Sat, 18 May 2013 11:19:08 +0200 Subject: [PATCH] Fixed PMF metadata set --- src/pmf/Level.php | 8 +++----- ...uperflatGenerator.class.php => SuperflatGenerator.php} | 0 2 files changed, 3 insertions(+), 5 deletions(-) rename src/world/generator/{SuperflatGenerator.class.php => SuperflatGenerator.php} (100%) diff --git a/src/pmf/Level.php b/src/pmf/Level.php index 2c0c6d927e..350ed52acc 100644 --- a/src/pmf/Level.php +++ b/src/pmf/Level.php @@ -341,15 +341,13 @@ class PMFLevel extends PMF{ $old_b = ord($this->chunks[$index][$Y]{$bindex}); $old_m = ord($this->chunks[$index][$Y]{$mindex}); if(($y & 1) === 0){ - $o_m = $old_m & 0x0F; - $m = ($o_m << 4) | $meta; + $m = ($old_m & 0xF0) | $meta; }else{ - $o_m = $old_m >> 4; - $m = ($meta << 4) | $o_m; + $m = ($meta << 4) | ($old_m & 0x0F); } if($old_b !== $block or $old_m !== $m){ $this->chunks[$index][$Y]{$bindex} = chr($block); - $this->chunks[$index][$Y]{$mindex} = chr($m); + $this->chunks[$index][$Y]{$mindex} = chr($m); if(!isset($this->chunkChange[$index][$Y])){ $this->chunkChange[$index][$Y] = 1; }else{ diff --git a/src/world/generator/SuperflatGenerator.class.php b/src/world/generator/SuperflatGenerator.php similarity index 100% rename from src/world/generator/SuperflatGenerator.class.php rename to src/world/generator/SuperflatGenerator.php