Skip to content

Commit

Permalink
Closes #11, fixes right click interactions cancelling
Browse files Browse the repository at this point in the history
This was caused by the plugin checking for a claim at ChunkX 0 and ChunkZ 0 as a result of right clicking (to eat food, throw enderpearls, etc). So, if a faction claimed the (0,0) chunk, no one would be able to eat.
  • Loading branch information
Aericio committed Sep 5, 2020
1 parent fd7eafb commit d357c48
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/DaPigGuy/PiggyFactions/claims/ClaimsListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public function onCommandPreprocess(PlayerCommandPreprocessEvent $event): void
public function onInteract(PlayerInteractEvent $event): void
{
$tile = $event->getBlock()->getLevel()->getTile($event->getBlock());
if ($event->getAction() === PlayerInteractEvent::RIGHT_CLICK_AIR) return;
if (!$this->canAffectArea($event->getPlayer(), $event->getBlock(), $tile instanceof Container ? FactionPermission::CONTAINERS : FactionPermission::INTERACT)) $event->setCancelled();
}

Expand Down

1 comment on commit d357c48

@Matthww
Copy link

@Matthww Matthww commented on d357c48 Sep 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for solving the problem!

Please sign in to comment.