mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 22:45:28 +00:00
World: do not attempt placement of itemblock if stack size is zero (#4410)
This doesn't make any sense, and also caused a crash.
This commit is contained in:
parent
d9b9aed2cc
commit
ee16a00c57
@ -1780,12 +1780,11 @@ class World implements ChunkManager{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($item->canBePlaced()){
|
if($item->isNull() or !$item->canBePlaced()){
|
||||||
$hand = $item->getBlock($face);
|
|
||||||
$hand->position($this, $blockReplace->getPosition()->x, $blockReplace->getPosition()->y, $blockReplace->getPosition()->z);
|
|
||||||
}else{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
$hand = $item->getBlock($face);
|
||||||
|
$hand->position($this, $blockReplace->getPosition()->x, $blockReplace->getPosition()->y, $blockReplace->getPosition()->z);
|
||||||
|
|
||||||
if($hand->canBePlacedAt($blockClicked, $clickVector, $face, true)){
|
if($hand->canBePlacedAt($blockClicked, $clickVector, $face, true)){
|
||||||
$blockReplace = $blockClicked;
|
$blockReplace = $blockClicked;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user