diff --git a/src/API/EntityAPI.php b/src/API/EntityAPI.php index 608e684c..c9d97122 100644 --- a/src/API/EntityAPI.php +++ b/src/API/EntityAPI.php @@ -154,7 +154,7 @@ class EntityAPI{ "y" => $spawnY, "z" => $spawnZ, "Health" => $this->hp[$type], - "isBaby" => 1, + "IsBaby" => 1, ]); $this->spawnToAll($entityit, $spawnLevel); $output .= "Baby " . $this->mobName[$type] . " spawned in " . $spawnX . ", " . $spawnY . ", " . $spawnZ . "."; diff --git a/src/Player.php b/src/Player.php index 26c06766..c76db12d 100755 --- a/src/Player.php +++ b/src/Player.php @@ -1812,7 +1812,7 @@ class Player{ } break; case MOB_SHEEP: - if($slot->getID() === SHEARS && $target->data["Sheared"] === 0){ //not sheared + if($slot->getID() === SHEARS && $target->data["Sheared"] === 0 && !$target->isBaby()){ //not sheared ServerAPI::request()->api->entity->drop(new Position($target->x + 0.5, $target->y, $target->z + 0.5, $target->level), BlockAPI::getItem(WOOL, $target->data["Color"], mt_rand(1, 3))); $target->data["Sheared"] = 1; //i hope it means sheared right? $target->updateMetadata(); diff --git a/src/material/block/attachable/SignPost.php b/src/material/block/attachable/SignPost.php index 930fd0a7..b9b5ef5b 100644 --- a/src/material/block/attachable/SignPost.php +++ b/src/material/block/attachable/SignPost.php @@ -1,6 +1,14 @@ 2, + 3 => 3, + 4 => 4, + 5 => 5, + ); + public function __construct($meta = 0){ parent::__construct(SIGN_POST, $meta, "Sign Post"); $this->isSolid = false; @@ -9,19 +17,13 @@ class SignPostBlock extends TransparentBlock{ } public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ - if($face !== 0){ - $faces = array( - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5, - ); - if(!isset($faces[$face])){ + if($target->isSolid && $face !== 0){ + if(!isset($this->faces[$face])){ $this->meta = floor((($player->entity->yaw + 180) * 16 / 360) + 0.5) & 0x0F; $this->level->setBlock($block, BlockAPI::get(SIGN_POST, $this->meta), true, false, true); return true; }else{ - $this->meta = $faces[$face]; + $this->meta = $this->faces[$face]; $this->level->setBlock($block, BlockAPI::get(WALL_SIGN, $this->meta, true, false, true)); return true; } diff --git a/src/material/block/plant/Beetroot.php b/src/material/block/plant/Beetroot.php index 67b743a5..d72bac13 100644 --- a/src/material/block/plant/Beetroot.php +++ b/src/material/block/plant/Beetroot.php @@ -57,9 +57,11 @@ class BeetrootBlock extends FlowableBlock{ $drops = array(); if($this->meta >= 0x07){ $drops[] = array(BEETROOT, 0, 1); - $drops[] = array(BEETROOT_SEEDS, 0, mt_rand(0, 3)); - }else{ - $drops[] = array(BEETROOT_SEEDS, 0, 1); + } + for($i = 0; $i < 3; ++$i){ + if(mt_rand(0,15) <= $this->meta){ //a way from 1.4.7 + $drops[] = array(BEETROOT_SEEDS, 0, 1); + } } return $drops; } diff --git a/src/material/block/plant/Carrot.php b/src/material/block/plant/Carrot.php index 3efb37e9..04f8e637 100644 --- a/src/material/block/plant/Carrot.php +++ b/src/material/block/plant/Carrot.php @@ -56,9 +56,12 @@ class CarrotBlock extends FlowableBlock{ public function getDrops(Item $item, Player $player){ $drops = array(); if($this->meta >= 0x07){ - $drops[] = array(CARROT, 0, mt_rand(1, 4)); - }else{ - $drops[] = array(CARROT, 0, 1); + $drops[] = array(CARROT, 0, mt_rand(1)); + } + for($i = 0; $i < 3; ++$i){ + if(mt_rand(0,15) <= $this->meta){ //a way from 1.4.7 + $drops[] = array(CARROT, 0, 1); + } } return $drops; } diff --git a/src/material/block/plant/Wheat.php b/src/material/block/plant/Wheat.php index 058642eb..51f166e5 100644 --- a/src/material/block/plant/Wheat.php +++ b/src/material/block/plant/Wheat.php @@ -60,7 +60,12 @@ class WheatBlock extends FlowableBlock{ $drops[] = array(WHEAT, 0, 1); $drops[] = array(WHEAT_SEEDS, 0, mt_rand(0, 3)); }else{ - $drops[] = array(WHEAT_SEEDS, 0, 1); + for($i = 0; $i < 3; ++$i){ + if(mt_rand(0,15) <= $this->meta){ //a way from 1.4.7 + $drops[] = array(WHEAT_SEEDS, 0, 1); + } + } + } return $drops; } diff --git a/src/material/item/generic/SignItem.php b/src/material/item/generic/SignItem.php index 2912237e..226f38ef 100644 --- a/src/material/item/generic/SignItem.php +++ b/src/material/item/generic/SignItem.php @@ -2,8 +2,8 @@ class SignItem extends Item{ public function __construct($meta = 0, $count = 1){ + parent::__construct(SIGN, 0, $count, "Sign"); $this->block = BlockAPI::get(SIGN_POST); $this->maxStackSize = 16; - parent::__construct(SIGN, 0, $count, "Sign"); } } \ No newline at end of file