Remove duplicate checks.

This commit is contained in:
GJ 2013-01-29 12:02:32 -05:00
parent 60041a1253
commit 20f6a55df2

View File

@ -8,13 +8,11 @@ import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.material.MaterialData;
import org.getspout.spoutapi.sound.SoundEffect; import org.getspout.spoutapi.sound.SoundEffect;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.TreasuresConfig; import com.gmail.nossr50.config.TreasuresConfig;
import com.gmail.nossr50.config.mods.CustomBlocksConfig;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure; import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure;
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent; import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
@ -36,9 +34,6 @@ public class Excavation {
* @param player The player who broke the block * @param player The player who broke the block
*/ */
public static void excavationProcCheck(Block block, Player player) { public static void excavationProcCheck(Block block, Player player) {
if (player == null)
return;
Material type = block.getType(); Material type = block.getType();
Location location = block.getLocation(); Location location = block.getLocation();
@ -50,12 +45,6 @@ public class Excavation {
int xp; int xp;
ItemStack item = (new MaterialData(block.getTypeId(), block.getData())).toItemStack(1);
if (Config.getInstance().getBlockModsEnabled() && CustomBlocksConfig.getInstance().customExcavationBlocks.contains(item)) {
xp = ModChecks.getCustomBlock(block).getXpGain();
}
else {
switch (type) { switch (type) {
case CLAY: case CLAY:
xp = Config.getInstance().getExcavationClayXP(); xp = Config.getInstance().getExcavationClayXP();
@ -86,10 +75,9 @@ public class Excavation {
break; break;
default: default:
xp = 0; xp = ModChecks.getCustomBlock(block).getXpGain();;
break; break;
} }
}
if (Permissions.excavationTreasures(player)) { if (Permissions.excavationTreasures(player)) {
switch (type) { switch (type) {
@ -154,9 +142,6 @@ public class Excavation {
* @param block The block to check * @param block The block to check
*/ */
public static void gigaDrillBreaker(Player player, Block block) { public static void gigaDrillBreaker(Player player, Block block) {
if (player == null)
return;
SkillTools.abilityDurabilityLoss(player.getItemInHand(), Misc.toolDurabilityLoss); SkillTools.abilityDurabilityLoss(player.getItemInHand(), Misc.toolDurabilityLoss);
if (!mcMMO.placeStore.isTrue(block) && Misc.blockBreakSimulate(block, player, true)) { if (!mcMMO.placeStore.isTrue(block) && Misc.blockBreakSimulate(block, player, true)) {