From 9cdd616852fe77fcf8b30151e7383ec3fff15a79 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Sun, 3 Feb 2013 21:21:16 +0100 Subject: [PATCH] Corrected Fence Gate activation --- src/classes/material/block/solid/FenceGate.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/classes/material/block/solid/FenceGate.php b/src/classes/material/block/solid/FenceGate.php index dadfdf87..1c6ad0a2 100644 --- a/src/classes/material/block/solid/FenceGate.php +++ b/src/classes/material/block/solid/FenceGate.php @@ -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; }