Skip to content

Commit

Permalink
TRying to fix issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
xBeastMode committed Mar 10, 2016
1 parent c6dc2e4 commit 975bd3d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/xbeastmode/hg/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -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;
}
}
}

0 comments on commit 975bd3d

Please sign in to comment.