mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
Fix right click on signs
This commit is contained in:
parent
0319415f1b
commit
ee072e844b
1 changed files with 8 additions and 3 deletions
|
@ -20,14 +20,19 @@ public class SignPlayerListener implements Listener
|
||||||
this.ess = ess;
|
this.ess = ess;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOW)
|
||||||
public void onPlayerInteract(final PlayerInteractEvent event)
|
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;
|
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)
|
if (block == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue