mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-08-25 04:37:44 +00:00
Fix right click on signs
This commit is contained in:
parent
0319415f1b
commit
ee072e844b
|
@ -20,14 +20,19 @@ public class SignPlayerListener implements Listener
|
|||
this.ess = ess;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onPlayerInteract(final PlayerInteractEvent event)
|
||||
{
|
||||
if (ess.getSettings().areSignsDisabled() || event.getAction() != Action.RIGHT_CLICK_BLOCK)
|
||||
if (ess.getSettings().areSignsDisabled() || (event.getAction() != Action.RIGHT_CLICK_BLOCK && event.getAction() != Action.RIGHT_CLICK_AIR))
|
||||
{
|
||||
return;
|
||||
}
|
||||
final Block block = event.getClickedBlock();
|
||||
final Block block;
|
||||
if (event.isCancelled() && event.getAction() == Action.RIGHT_CLICK_AIR) {
|
||||
block = event.getPlayer().getTargetBlock(null, 5);
|
||||
} else {
|
||||
block = event.getClickedBlock();
|
||||
}
|
||||
if (block == null)
|
||||
{
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue