mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-09-06 21:18:03 +02:00
Listener Cleanup
This commit is contained in:
parent
d72f831519
commit
0e0a96b6d8
@ -20,7 +20,6 @@ public class EssentialsBlockListener implements Listener
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onBlockPlace(final BlockPlaceEvent event)
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
// Do not rely on getItemInHand();
|
||||
// http://leaky.bukkit.org/issues/663
|
||||
final ItemStack is = Util.convertBlockToItem(event.getBlockPlaced());
|
||||
@ -28,6 +27,7 @@ public class EssentialsBlockListener implements Listener
|
||||
{
|
||||
return;
|
||||
}
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
final boolean unlimitedForUser = user.hasUnlimited(is);
|
||||
if (unlimitedForUser && user.getGameMode() == GameMode.SURVIVAL)
|
||||
{
|
||||
|
@ -383,6 +383,7 @@ public class Settings implements ISettings
|
||||
noGodWorlds = new HashSet<String>(config.getStringList("no-god-in-worlds"));
|
||||
enabledSigns = _getEnabledSigns();
|
||||
teleportInvulnerability = _isTeleportInvulnerability();
|
||||
disableItemPickupWhileAfk = _getDisableItemPickupWhileAfk();
|
||||
itemSpawnBl = _getItemSpawnBlacklist();
|
||||
kits = _getKits();
|
||||
chatFormats.clear();
|
||||
@ -695,9 +696,15 @@ public class Settings implements ISettings
|
||||
{
|
||||
return config.getBoolean("register-back-in-listener", false);
|
||||
}
|
||||
private boolean disableItemPickupWhileAfk;
|
||||
|
||||
@Override
|
||||
public boolean getDisableItemPickupWhileAfk()
|
||||
{
|
||||
return disableItemPickupWhileAfk;
|
||||
}
|
||||
|
||||
private boolean _getDisableItemPickupWhileAfk()
|
||||
{
|
||||
return config.getBoolean("disable-item-pickup-while-afk", true);
|
||||
}
|
||||
@ -746,7 +753,6 @@ public class Settings implements ISettings
|
||||
{
|
||||
this.metricsEnabled = metricsEnabled;
|
||||
}
|
||||
|
||||
private boolean teleportInvulnerability;
|
||||
|
||||
@Override
|
||||
|
@ -25,10 +25,10 @@ public class SignBlockListener implements Listener
|
||||
this.ess = ess;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onBlockBreak(final BlockBreakEvent event)
|
||||
{
|
||||
if (event.isCancelled() || ess.getSettings().areSignsDisabled())
|
||||
if (ess.getSettings().areSignsDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -76,10 +76,10 @@ public class SignBlockListener implements Listener
|
||||
return false;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onSignChange(final SignChangeEvent event)
|
||||
{
|
||||
if (event.isCancelled() || ess.getSettings().areSignsDisabled())
|
||||
if (ess.getSettings().areSignsDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -107,10 +107,10 @@ public class SignBlockListener implements Listener
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void onBlockPlace(final BlockPlaceEvent event)
|
||||
{
|
||||
if (event.isCancelled() || ess.getSettings().areSignsDisabled())
|
||||
if (ess.getSettings().areSignsDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -141,10 +141,10 @@ public class SignBlockListener implements Listener
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void onBlockBurn(final BlockBurnEvent event)
|
||||
{
|
||||
if (event.isCancelled() || ess.getSettings().areSignsDisabled())
|
||||
if (ess.getSettings().areSignsDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -169,10 +169,10 @@ public class SignBlockListener implements Listener
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void onBlockIgnite(final BlockIgniteEvent event)
|
||||
{
|
||||
if (event.isCancelled() || ess.getSettings().areSignsDisabled())
|
||||
if (ess.getSettings().areSignsDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -43,10 +43,10 @@ public class SignEntityListener implements Listener
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void onEntityChangeBlock(final EntityChangeBlockEvent event)
|
||||
{
|
||||
if (event.isCancelled() || ess.getSettings().areSignsDisabled())
|
||||
if (ess.getSettings().areSignsDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -20,10 +20,10 @@ public class SignPlayerListener implements Listener
|
||||
this.ess = ess;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void onPlayerInteract(final PlayerInteractEvent event)
|
||||
{
|
||||
if (event.isCancelled() || ess.getSettings().areSignsDisabled())
|
||||
if (ess.getSettings().areSignsDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -33,8 +33,8 @@ public class SignPlayerListener implements Listener
|
||||
{
|
||||
return;
|
||||
}
|
||||
final int mat = block.getTypeId();
|
||||
if (mat == Material.SIGN_POST.getId() || mat == Material.WALL_SIGN.getId())
|
||||
|
||||
if (block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN)
|
||||
{
|
||||
if (event.getAction() != Action.RIGHT_CLICK_BLOCK)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user