mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-27 11:37:47 +01:00
Transformed the BlockFadeEvent handler into a switch.
This commit is contained in:
parent
31739c647b
commit
23766f20dd
@ -816,30 +816,32 @@ public void onBlockFade(BlockFadeEvent event) {
|
|||||||
ConfigurationManager cfg = plugin.getGlobalStateManager();
|
ConfigurationManager cfg = plugin.getGlobalStateManager();
|
||||||
WorldConfiguration wcfg = cfg.get(event.getBlock().getWorld());
|
WorldConfiguration wcfg = cfg.get(event.getBlock().getWorld());
|
||||||
|
|
||||||
int type = event.getBlock().getTypeId();
|
switch (event.getBlock().getTypeId()) {
|
||||||
|
case BlockID.ICE:
|
||||||
if (type == BlockID.ICE) {
|
|
||||||
if (wcfg.disableIceMelting) {
|
if (wcfg.disableIceMelting) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wcfg.useRegions && !plugin.getGlobalRegionManager().allows(
|
if (wcfg.useRegions && !plugin.getGlobalRegionManager().allows(
|
||||||
DefaultFlag.ICE_MELT, event.getBlock().getLocation())) {
|
DefaultFlag.ICE_MELT, event.getBlock().getLocation())) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (type == BlockID.SNOW) {
|
case BlockID.SNOW:
|
||||||
if (wcfg.disableSnowMelting) {
|
if (wcfg.disableSnowMelting) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wcfg.useRegions && !plugin.getGlobalRegionManager().allows(
|
if (wcfg.useRegions && !plugin.getGlobalRegionManager().allows(
|
||||||
DefaultFlag.SNOW_MELT, event.getBlock().getLocation())) {
|
DefaultFlag.SNOW_MELT, event.getBlock().getLocation())) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == BlockID.SOIL) {
|
if (type == BlockID.SOIL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user