Transformed the BlockFadeEvent handler into a switch.

This commit is contained in:
TomyLobo 2013-06-07 14:33:58 +02:00
parent 31739c647b
commit 23766f20dd

View File

@ -816,30 +816,32 @@ public void onBlockFade(BlockFadeEvent event) {
ConfigurationManager cfg = plugin.getGlobalStateManager();
WorldConfiguration wcfg = cfg.get(event.getBlock().getWorld());
int type = event.getBlock().getTypeId();
if (type == BlockID.ICE) {
switch (event.getBlock().getTypeId()) {
case BlockID.ICE:
if (wcfg.disableIceMelting) {
event.setCancelled(true);
return;
}
if (wcfg.useRegions && !plugin.getGlobalRegionManager().allows(
DefaultFlag.ICE_MELT, event.getBlock().getLocation())) {
event.setCancelled(true);
return;
}
}
break;
if (type == BlockID.SNOW) {
case BlockID.SNOW:
if (wcfg.disableSnowMelting) {
event.setCancelled(true);
return;
}
if (wcfg.useRegions && !plugin.getGlobalRegionManager().allows(
DefaultFlag.SNOW_MELT, event.getBlock().getLocation())) {
event.setCancelled(true);
return;
}
break;
}
if (type == BlockID.SOIL) {