mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 04:29:43 +00:00
Fix for placing blocks where no block exists
This commit is contained in:
parent
000ba5de52
commit
29a5041ef1
1 changed files with 6 additions and 0 deletions
|
|
@ -183,6 +183,12 @@ class BlockAPI{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$target = $this->server->api->level->getBlock($data["x"], $data["y"], $data["z"]);
|
$target = $this->server->api->level->getBlock($data["x"], $data["y"], $data["z"]);
|
||||||
|
if($target[0] === 0){ //If no block exists
|
||||||
|
$this->cancelAction($target);
|
||||||
|
$block = $this->server->api->level->getBlockFace($target, $data["face"]);
|
||||||
|
return $this->cancelAction($block);
|
||||||
|
}
|
||||||
|
|
||||||
$cancelPlace = false;
|
$cancelPlace = false;
|
||||||
if(isset(Material::$activable[$target[0]])){
|
if(isset(Material::$activable[$target[0]])){
|
||||||
switch($target[0]){
|
switch($target[0]){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue