mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-08 03:50:06 +01: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;
|
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 New Issue
Block a user