1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-18 20:41:37 +02:00

Optimize sign interacts.

This commit is contained in:
KHobbits
2012-04-14 04:54:01 +01:00
parent f09e15a051
commit 45714bc5d5

View File

@@ -23,11 +23,10 @@ public class SignPlayerListener implements Listener
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onPlayerInteract(final PlayerInteractEvent event)
{
if (ess.getSettings().areSignsDisabled())
if (ess.getSettings().areSignsDisabled() || event.getAction() != Action.RIGHT_CLICK_BLOCK)
{
return;
}
final Block block = event.getClickedBlock();
if (block == null)
{
@@ -37,10 +36,6 @@ public class SignPlayerListener implements Listener
final int mat = block.getTypeId();
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();
for (EssentialsSign sign : ess.getSettings().enabledSigns())
{
@@ -61,7 +56,6 @@ public class SignPlayerListener implements Listener
{
event.setCancelled(true);
return;
}
}
}