Skip to content

Commit

Permalink
PIF :: Add check left click
Browse files Browse the repository at this point in the history
  • Loading branch information
PresentKim committed Jan 16, 2018
1 parent 0cef92f commit a31f4b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ProtectItemFrame.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* @name ProtectItemFrame
* @main presentkim\singleton\ProtectItemFrame
* @version 1.0.0
* @version 1.0.1
* @api 3.0.0-ALPHA10
* @description Protect item frame by stick
* @author PresentKim
Expand Down Expand Up @@ -79,7 +79,7 @@ public function onPlayerInteractEvent(PlayerInteractEvent $event){
$player->sendMessage(TextFormat::RED . '[ProtectItemFrame] You don\'t have permission');
}
$event->setCancelled(true);
} elseif ($protected === self::PROTECTED_DROP && !$player->hasPermission('itemframe.protect.drop') || $protected === self::PROTECTED_ROTATE && !$player->hasPermission('itemframe.protect.rotate')) {
} elseif ($protected === self::PROTECTED_DROP && !$player->hasPermission('itemframe.protect.drop') && $event->getAction() === PlayerInteractEvent::LEFT_CLICK_BLOCK || $protected === self::PROTECTED_ROTATE && !$player->hasPermission('itemframe.protect.rotate')) {
$event->setCancelled(true);
}
}
Expand Down

0 comments on commit a31f4b2

Please sign in to comment.