mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-25 02:27:33 +01:00
Optimize sign interacts.
This commit is contained in:
parent
8b9ff2c58a
commit
45de85dae2
@ -23,11 +23,10 @@ public class SignPlayerListener implements Listener
|
|||||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||||
public void onPlayerInteract(final PlayerInteractEvent event)
|
public void onPlayerInteract(final PlayerInteractEvent event)
|
||||||
{
|
{
|
||||||
if (ess.getSettings().areSignsDisabled())
|
if (ess.getSettings().areSignsDisabled() || event.getAction() != Action.RIGHT_CLICK_BLOCK)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final Block block = event.getClickedBlock();
|
final Block block = event.getClickedBlock();
|
||||||
if (block == null)
|
if (block == null)
|
||||||
{
|
{
|
||||||
@ -37,10 +36,6 @@ public class SignPlayerListener implements Listener
|
|||||||
final int mat = block.getTypeId();
|
final int mat = block.getTypeId();
|
||||||
if (mat == Material.SIGN_POST.getId() || mat == Material.WALL_SIGN.getId())
|
if (mat == Material.SIGN_POST.getId() || mat == Material.WALL_SIGN.getId())
|
||||||
{
|
{
|
||||||
if (event.getAction() != Action.RIGHT_CLICK_BLOCK)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final Sign csign = (Sign)block.getState();
|
final Sign csign = (Sign)block.getState();
|
||||||
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||||
{
|
{
|
||||||
@ -61,7 +56,6 @@ public class SignPlayerListener implements Listener
|
|||||||
{
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user