From 975bd3df7f76dc78a2d7fe06b6755afe998bc987 Mon Sep 17 00:00:00 2001 From: xBeastMode Date: Thu, 10 Mar 2016 13:17:58 -0800 Subject: [PATCH] TRying to fix issues. --- src/xbeastmode/hg/Events.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/xbeastmode/hg/Events.php b/src/xbeastmode/hg/Events.php index 314385e..d4aed85 100644 --- a/src/xbeastmode/hg/Events.php +++ b/src/xbeastmode/hg/Events.php @@ -89,7 +89,7 @@ public function onInteract(PlayerInteractEvent $e) public function onMove(PlayerMoveEvent $e){ $player = $e->getPlayer(); if(!isset(HGManagement::$data[$e->getPlayer()->getName()])) return; - if(isset(HGGame::getApi()->players[HGManagement::$data[$player->getName()]])){ + if(isset(HGManagement::$players[HGManagement::$data[$e->getPlayer()->getName()]][$player->getName()])){ $from = clone $e->getFrom(); $to = $e->getTo(); $from->yaw = $to->yaw; @@ -127,7 +127,7 @@ public function onKill(PlayerDeathEvent $e){ public function onQuit(PlayerQuitEvent $e){ $player = $e->getPlayer(); if(!isset(HGManagement::$data[$player->getName()])) return; - if(isset(HGGame::getApi()->players[HGManagement::$data[$player->getName()]])) { + if(isset(HGGame::getApi()->players[HGManagement::$data[$player->getName()]][spl_object_hash($player)])) { $pqge = new PlayerQuitGameEvent($this->main, $player, HGManagement::$data[$player->getName()]); $this->main->getServer()->getPluginManager()->callEvent($pqge); if($pqge->isCancelled()) return; @@ -155,7 +155,7 @@ public function onBlockBreak(BlockBreakEvent $e){ $player = $e->getPlayer(); $b = $e->getBlock(); if(!isset(HGManagement::$data[$player->getName()])) return; - if(isset(HGGame::getApi()->players[HGManagement::$data[$player->getName()]])) { + if(isset(HGGame::getApi()->players[HGManagement::$data[$player->getName()]][spl_object_hash($player)])) { HGManagement::$BBlocks[HGManagement::$data[$player->getName()]][] = $b; } } @@ -166,8 +166,9 @@ public function onBlockPlace(BlockPlaceEvent $e){ $player = $e->getPlayer(); $b = $e->getBlock(); if(!isset(HGManagement::$data[$player->getName()])) return; - if(isset(HGGame::getApi()->players[HGManagement::$data[$player->getName()]])) { + if(isset(HGGame::getApi()->players[HGManagement::$data[$player->getName()]][spl_object_hash($player)])) { HGManagement::$PBlocks[HGManagement::$data[$player->getName()]][] = $b; } } } +