Corrected Fence Gate activation

This commit is contained in:
Shoghi Cervantes Pueyo 2013-02-03 21:21:16 +01:00
parent 084acfab00
commit 9cdd616852

View File

@ -50,7 +50,13 @@ class FenceGateBlock extends TransparentBlock{
);
}
public function onActivate(BlockAPI $level, Item $item, Player $player){
$this->meta ^= 0x04;
$faces = array(
0 => 3,
1 => 0,
2 => 1,
3 => 2,
);
$this->meta = ($faces[$player->entity->getDirection()] & 0x03) | ((~$this->meta) & 0x04);
$level->setBlock($this, $this->id, $this->meta);
return true;
}