Correct sapbling, mushroom and reed placing

This commit is contained in:
Shoghi Cervantes Pueyo 2012-12-25 18:05:15 +01:00
parent 2d9c400392
commit b79374c13d
2 changed files with 26 additions and 2 deletions

View File

@ -16,9 +16,8 @@ __Check Milestones [here](https://github.com/shoghicp/PocketMine-MP/issues/miles
- Water/lava spread
- Fix spawn position resetting
- Correct block placement for beds
- Correct chest/furnace placement
- Players can often hear "echos" of their own block interactions' SFX (torch placed, block destroyed, etc. most noticeable when moving around as you place.)
- Mushroom placement requirements
- Reed placement requirements
## Beta (Survival)
- Mob spawning, item pick up

View File

@ -309,12 +309,37 @@ class BlockAPI{
switch($data["block"]){
case 6:
if($target[0] === 60){
break;
}
case 37:
case 38:
if($target[0] !== 2 and $target[0] !== 3){
return;
}
break;
case 39://Mushrooms
case 40:
$blockDown = $this->server->api->level->getBlock($data["x"], $data["y"] - 1, $data["z"]);
if(isset(Material::$transparent[$blockDown[0]])){
return;
}
break;
case 83: //Sugarcane
$blockDown = $this->server->api->level->getBlock($data["x"], $data["y"] - 1, $data["z"]);
if($blockDown[0] !== 2 and $blockDown[0] !== 3 and $blockDown[0] !== 12){
return;
}
$block0 = $this->server->api->level->getBlock($data["x"], $data["y"], $data["z"] + 1);
$block1 = $this->server->api->level->getBlock($data["x"], $data["y"], $data["z"] - 1);
$block2 = $this->server->api->level->getBlock($data["x"] + 1, $data["y"], $data["z"]);
$block3 = $this->server->api->level->getBlock($data["x"] - 1, $data["y"], $data["z"]);
if($block0[0] === 9 or $block0[0] === 8 or $block1[0] === 9 or $block1[0] === 8 or $block2[0] === 9 or $block2[0] === 8 or $block3[0] === 9 or $block3[0] === 8){
}else{
return;
}
break;
case 50: //Torch
if(isset(Material::$transparent[$target[0]])){
return;