mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
door fixes
This commit is contained in:
parent
fd5b103df7
commit
34d26d8463
1 changed files with 9 additions and 6 deletions
|
|
@ -107,13 +107,16 @@ class DoorBlock extends TransparentBlock{
|
|||
|
||||
|
||||
public static function neighborChanged(Level $level, $x, $y, $z, $nX, $nY, $nZ, $oldID){
|
||||
if($level->level->getBlockID($x, $y - 1, $z) == AIR){ //Replace with common break method
|
||||
$level->fastSetBlockUpdate($x, $y, $z, 0, 0);
|
||||
$id = $level->level->getBlockID($x, $y, $z);
|
||||
if($level->level->getBlockID($x, $y - 1, $z) == AIR){
|
||||
|
||||
[$id, $meta] = $level->level->getBlock($x, $y, $z);
|
||||
|
||||
$level->fastSetBlockUpdate($x, $y, $z, 0, 0);
|
||||
if(($meta & 8) == 0){
|
||||
if($id == DOOR_BLOCK) ServerAPI::request()->api->entity->drop(new Position($x+0.5, $y, $z+0.5, $level), BlockAPI::getItem(WOODEN_DOOR, 0, 1));
|
||||
elseif($id == IRON_DOOR_BLOCK) ServerAPI::request()->api->entity->drop(new Position($x+0.5, $y, $z+0.5, $level), BlockAPI::getItem(IRON_DOOR, 0, 1));
|
||||
}
|
||||
|
||||
if($id == 64) ServerAPI::request()->api->entity->drop(new Position($x+0.5, $y, $z+0.5, $level), BlockAPI::getItem(324, 0, 1));
|
||||
elseif($id == 71) ServerAPI::request()->api->entity->drop(new Position($x+0.5, $y, $z+0.5, $level), BlockAPI::getItem(330, 0, 1));
|
||||
|
||||
$top = $level->level->getBlockID($x, $y + 1, $z);
|
||||
if($top == IRON_DOOR_BLOCK || $top == DOOR_BLOCK){
|
||||
$level->fastSetBlockUpdate($x, $y + 1, $z, 0, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue