Fixed block-pick on crops giving the crop block itself

This commit is contained in:
Dylan K. Taylor
2017-11-03 12:17:38 +00:00
parent 42ed03fd02
commit 451f5d0cd7
8 changed files with 33 additions and 3 deletions

View File

@@ -2580,9 +2580,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
public function handleBlockPickRequest(BlockPickRequestPacket $packet) : bool{
$block = $this->level->getBlockAt($packet->blockX, $packet->blockY, $packet->blockZ);
//TODO: this doesn't handle crops correctly (need more API work)
$item = Item::get($block->getItemId(), $block->getVariant());
$item = $block->getPickedItem();
if($packet->addUserData){
$tile = $this->getLevel()->getTile($block);
if($tile instanceof Tile){