Better door Hinges

This commit is contained in:
Shoghi Cervantes Pueyo 2013-02-04 23:03:41 +01:00
parent e07302b021
commit 34f0e5170b
3 changed files with 4 additions and 3 deletions

View File

@ -45,8 +45,9 @@ class DoorBlock extends TransparentBlock{
3 => 5,
);
$next = $level->getBlockFace($block, $face[(($direction + 2) % 4)]);
$next2 = $level->getBlockFace($block, $face[$direction]);
$metaUp = 0x08;
if($next->getID() === $this->id){ //Door hinge
if($next->getID() === $this->id or ($next2->isTransparent === false and $next->isTransparent === true)){ //Door hinge
$metaUp |= 0x01;
}
$level->setBlock($blockUp, $this->id, $metaUp); //Top

View File

@ -32,7 +32,7 @@ class IronDoorBlock extends DoorBlock{
}
public function getDrops(Item $item, Player $player){
return array(
array(330, 0, 1),
array(IRON_DOOR, 0, 1),
);
}
}

View File

@ -33,7 +33,7 @@ class WoodDoorBlock extends DoorBlock{
public function getDrops(Item $item, Player $player){
return array(
array(324, 0, 1),
array(WOODEN_DOOR, 0, 1),
);
}
}