From ada2662627f305910a74cfff87187aab90aa778e Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Thu, 27 Dec 2012 17:35:40 +0100 Subject: [PATCH] Fixed placing Saplings in farmland --- README.md | 70 +++++++++++++++++++++------------------- classes/API/BlockAPI.php | 17 +++------- 2 files changed, 41 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index eaf062d4e..44dfba37f 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,37 @@ - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +``` +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . +You should have received a copy of the GNU Lesser General Public License +along with this program. If not, see . - - - / \ - / \ - / PocketMine \ - / MP \ - |\ @shoghicp /| - |. \ / .| - | .. \ / .. | - | .. | .. | - | .. | .. | - \ | / - \ | / - \ | / - \ | / - + - + / \ + / \ + / PocketMine \ +/ MP \ +|\ @shoghicp /| +|. \ / .| +| .. \ / .. | +| .. | .. | +| .. | .. | +\ | / + \ | / + \ | / + \ | / + +``` + +# PocketMine-MP -PocketMine-MP -============= Github repo: https://github.com/shoghicp/PocketMine-MP Server (and client) Minecraft Pocket Edition library written in PHP. @@ -42,24 +44,24 @@ Check the wiki! https://github.com/shoghicp/PocketMine-MP/wiki **Tested in: `v4.0.0, v5.0.0`** -Current features of the server: -------------------------------- +## Current features of the server: + * Full Creative mode! * Plugin API * Custom world generation * Update Channels!! (stable / dev) -How to contact me ------------------ +## How to contact me + * Email - * Twitter - [@shoghicp](https://twitter.com/shoghicp) * Via IRC - #mcdevs or #mcpedevs on *irc.freenode.net* (or just /msg me there) * [MinecraftForums profile](http://www.minecraftforum.net/user/1476633-shoghicp/) -Third-party Libraries Used --------------------------- -* __[PHP NBT](https://github.com/TheFrozenFire/PHP-NBT-Decoder-Encoder/blob/master/nbt.class.php)__ by [TheFrozenFire](https://github.com/TheFrozenFire): Class for reading in NBT-format files +## Third-party Libraries Used + +* __[PHP NBT](https://github.com/TheFrozenFire/PHP-NBT-Decoder-Encoder/blob/master/nbt.class.php)__ by _[TheFrozenFire](https://github.com/TheFrozenFire)_: Class for reading in NBT-format files * __[Math_BigInteger](http://phpseclib.sourceforge.net/math/intro.html)__ by _[phpseclib](http://phpseclib.sourceforge.net/)_: Pure-PHP arbitrary precission integer arithmetic library * __[Spyc](https://github.com/mustangostang/spyc/blob/master/Spyc.php)__ by _[Vlad Andersen](https://github.com/mustangostang)_: A simple YAML loader/dumper class for PHP \ No newline at end of file diff --git a/classes/API/BlockAPI.php b/classes/API/BlockAPI.php index 11d1c990b..f20c5394f 100644 --- a/classes/API/BlockAPI.php +++ b/classes/API/BlockAPI.php @@ -193,17 +193,10 @@ class BlockAPI{ case 59: case 105: if($data["block"] === 351 and $data["meta"] === 0x0F){ //Bonemeal - switch($target[0]){ - case 59: - case 105: - $data["block"] = $target[0]; - $data["meta"] = 0x07; - $this->server->trigger("player.block.place", $data); - $this->updateBlocksAround($data["x"], $data["y"], $data["z"], BLOCK_UPDATE_NORMAL); - break; - case 6: - break; - } + $data["block"] = $target[0]; + $data["meta"] = 0x07; + $this->server->trigger("player.block.place", $data); + $this->updateBlocksAround($data["x"], $data["y"], $data["z"], BLOCK_UPDATE_NORMAL); $cancelPlace = true; } break; @@ -296,7 +289,7 @@ class BlockAPI{ switch($data["block"]){ case 6: if($target[0] === 60){ - return false; + break; } case 37: case 38: