mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Remove no longer needed DualSupport classes, we crossed that road long ago.
This commit is contained in:
parent
de0ac51b3d
commit
2aade8b7ff
@ -15,7 +15,6 @@ import org.bukkit.material.SmoothBrick;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.skills.repair.Repair;
|
||||
import com.gmail.nossr50.skills.salvage.Salvage;
|
||||
import com.gmail.nossr50.util.temp.DualSupport;
|
||||
|
||||
public final class BlockUtils {
|
||||
private BlockUtils() {}
|
||||
@ -65,10 +64,21 @@ public final class BlockUtils {
|
||||
case HOPPER:
|
||||
case TRAPPED_CHEST:
|
||||
case IRON_DOOR:
|
||||
case IRON_TRAPDOOR:
|
||||
case ACACIA_DOOR:
|
||||
case SPRUCE_DOOR:
|
||||
case BIRCH_DOOR:
|
||||
case JUNGLE_DOOR:
|
||||
case DARK_OAK_DOOR:
|
||||
case ACACIA_FENCE:
|
||||
case DARK_OAK_FENCE:
|
||||
case BIRCH_FENCE:
|
||||
case JUNGLE_FENCE:
|
||||
case ARMOR_STAND:
|
||||
return false;
|
||||
|
||||
default:
|
||||
return DualSupport.canActivateAbilities(blockState) && !isMcMMOAnvil(blockState) && !mcMMO.getModManager().isCustomAbilityBlock(blockState);
|
||||
return !isMcMMOAnvil(blockState) && !mcMMO.getModManager().isCustomAbilityBlock(blockState);
|
||||
}
|
||||
}
|
||||
|
||||
@ -163,10 +173,12 @@ public final class BlockUtils {
|
||||
case SANDSTONE:
|
||||
case STAINED_CLAY:
|
||||
case STONE:
|
||||
case PRISMARINE:
|
||||
case RED_SANDSTONE:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return DualSupport.affectedBySuperBreaker(blockState) || isOre(blockState) || mcMMO.getModManager().isCustomMiningBlock(blockState);
|
||||
return isOre(blockState) || mcMMO.getModManager().isCustomMiningBlock(blockState);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@ import org.bukkit.entity.Animals;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Guardian;
|
||||
import org.bukkit.entity.IronGolem;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -48,7 +49,6 @@ import com.gmail.nossr50.util.MobHealthbarUtils;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.temp.CompatableGuardianXP;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
public final class CombatUtils {
|
||||
@ -467,6 +467,7 @@ public final class CombatUtils {
|
||||
switch (type) {
|
||||
case BAT:
|
||||
case SQUID:
|
||||
case RABBIT:
|
||||
baseXP = ExperienceConfig.getInstance().getAnimalsXP();
|
||||
break;
|
||||
|
||||
@ -506,19 +507,15 @@ public final class CombatUtils {
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (type.name().equals("RABBIT")) {
|
||||
baseXP = ExperienceConfig.getInstance().getAnimalsXP();
|
||||
break;
|
||||
}
|
||||
if (type.name().equals("ENDERMITE")) {
|
||||
case GUARDIAN:
|
||||
if (((Guardian) target).isElder()) {
|
||||
baseXP = ExperienceConfig.getInstance().getElderGuardianXP();
|
||||
} else {
|
||||
baseXP = ExperienceConfig.getInstance().getCombatXP(type);
|
||||
break;
|
||||
}
|
||||
if (type.name().equals("GUARDIAN")) {
|
||||
baseXP = CompatableGuardianXP.get(target);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
baseXP = 1.0;
|
||||
mcMMO.getModManager().addCustomEntity(target);
|
||||
break;
|
||||
|
@ -1,17 +0,0 @@
|
||||
package com.gmail.nossr50.util.temp;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Guardian;
|
||||
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
|
||||
public class CompatableGuardianXP {
|
||||
public static double get(Entity target) {
|
||||
if (((Guardian) target).isElder()) {
|
||||
return ExperienceConfig.getInstance().getElderGuardianXP();
|
||||
} else {
|
||||
return ExperienceConfig.getInstance().getCombatXP(EntityType.GUARDIAN);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package com.gmail.nossr50.util.temp;
|
||||
|
||||
import org.bukkit.block.BlockState;
|
||||
|
||||
public class DualSupport {
|
||||
|
||||
public static boolean canActivateAbilities(BlockState blockState) {
|
||||
String mat = blockState.getType().name();
|
||||
return !mat.equals("IRON_TRAPDOOR") && !mat.equals("ACACIA_DOOR") && !mat.equals("SPRUCE_DOOR") && !mat.equals("BIRCH_DOOR")
|
||||
&& !mat.equals("JUNGLE_DOOR") && !mat.equals("DARK_OAK_DOOR") && !mat.equals("ACACIA_FENCE") && !mat.equals("DARK_OAK_FENCE")
|
||||
&& !mat.equals("BIRCH_FENCE") && !mat.equals("JUNGLE_FENCE") && !mat.equals("ARMOR_STAND");
|
||||
}
|
||||
|
||||
public static boolean affectedBySuperBreaker(BlockState blockState) {
|
||||
String mat = blockState.getType().name();
|
||||
return mat.equals("PRISMARINE") || mat.equals("RED_SANDSTONE");
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user