mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Tweaked a few switch statements.
This commit is contained in:
parent
bc58aff362
commit
8257fd8e7c
@ -399,7 +399,7 @@ public class Mining {
|
|||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,10 @@ public class BlockChecks {
|
|||||||
* @return true if the block should allow ability activation, false otherwise
|
* @return true if the block should allow ability activation, false otherwise
|
||||||
*/
|
*/
|
||||||
public static boolean abilityBlockCheck(Block block) {
|
public static boolean abilityBlockCheck(Block block) {
|
||||||
|
if (customBlocksEnabled && CustomBlocksConfig.getInstance().customAbilityBlocks.contains(new ItemStack(block.getTypeId(), 1, (short) 0, block.getData()))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
switch (block.getType()) {
|
switch (block.getType()) {
|
||||||
case BED_BLOCK:
|
case BED_BLOCK:
|
||||||
case BREWING_STAND:
|
case BREWING_STAND:
|
||||||
@ -94,19 +98,14 @@ public class BlockChecks {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (block.getTypeId() == Config.getInstance().getRepairAnvilId()) {
|
if (block.getTypeId() == Config.getInstance().getRepairAnvilId()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (customBlocksEnabled && CustomBlocksConfig.getInstance().customAbilityBlocks.contains(new ItemStack(block.getTypeId(), 1, (short) 0, block.getData()))) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a block type is an ore.
|
* Check if a block type is an ore.
|
||||||
|
@ -148,6 +148,7 @@ public class Combat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WOLF:
|
case WOLF:
|
||||||
Wolf wolf = (Wolf) damager;
|
Wolf wolf = (Wolf) damager;
|
||||||
|
|
||||||
@ -173,6 +174,7 @@ public class Combat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ARROW:
|
case ARROW:
|
||||||
LivingEntity shooter = ((Arrow) damager).getShooter();
|
LivingEntity shooter = ((Arrow) damager).getShooter();
|
||||||
|
|
||||||
@ -190,7 +192,6 @@ public class Combat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
archeryCheck((Player) shooter, target, event);
|
archeryCheck((Player) shooter, target, event);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user