mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02:00
SkillUtils cleanup, EventUtils creation
Move some functions in SkillUtils to more relevant locations. Begin work on utility class to handle all event calls.
This commit is contained in:
@ -20,7 +20,7 @@ public class ChildConfig extends AutoUpdateConfigLoader {
|
||||
|
||||
FamilyTree.clearRegistrations(); // when reloading, need to clear statics
|
||||
|
||||
for (SkillType skill : SkillType.childSkills()) {
|
||||
for (SkillType skill : SkillType.CHILD_SKILLS) {
|
||||
plugin.debug("Finding parents of " + skill.name());
|
||||
|
||||
EnumSet<SkillType> parentSkills = EnumSet.noneOf(SkillType.class);
|
||||
|
@ -22,6 +22,7 @@ import com.gmail.nossr50.runnables.skills.AbilityCooldownTask;
|
||||
import com.gmail.nossr50.skills.SkillManager;
|
||||
import com.gmail.nossr50.skills.mining.BlastMining.Tier;
|
||||
import com.gmail.nossr50.util.BlockUtils;
|
||||
import com.gmail.nossr50.util.EventUtils;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.ModUtils;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
@ -95,7 +96,7 @@ public class MiningManager extends SkillManager {
|
||||
Player player = getPlayer();
|
||||
Block targetBlock = player.getTargetBlock(BlockUtils.getTransparentBlocks(), BlastMining.MAXIMUM_REMOTE_DETONATION_DISTANCE);
|
||||
|
||||
if (targetBlock.getType() != Material.TNT || !SkillUtils.blockBreakSimulate(targetBlock, player, true) || !blastMiningCooldownOver()) {
|
||||
if (targetBlock.getType() != Material.TNT || !EventUtils.simulateBlockBreak(targetBlock, player, true) || !blastMiningCooldownOver()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.skills.SkillManager;
|
||||
import com.gmail.nossr50.skills.woodcutting.Woodcutting.ExperienceGainMethod;
|
||||
import com.gmail.nossr50.util.EventUtils;
|
||||
import com.gmail.nossr50.util.ItemUtils;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.ModUtils;
|
||||
@ -129,7 +130,7 @@ public class WoodcuttingManager extends SkillManager {
|
||||
for (BlockState blockState : treeFellerBlocks) {
|
||||
Block block = blockState.getBlock();
|
||||
|
||||
if (!SkillUtils.blockBreakSimulate(block, player, true)) {
|
||||
if (!EventUtils.simulateBlockBreak(block, player, true)) {
|
||||
break; // TODO: Shouldn't we use continue instead?
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user