Code Cleanup pt 3

This commit is contained in:
nossr50 2019-04-03 19:55:52 -07:00
parent 43037f8c13
commit 0ca0140348
44 changed files with 66 additions and 136 deletions

View File

@ -27,7 +27,7 @@ public class McImportCommand implements CommandExecutor {
} }
} }
public boolean importModConfig() { public void importModConfig() {
String importFilePath = mcMMO.getModDirectory() + File.separator + "import"; String importFilePath = mcMMO.getModDirectory() + File.separator + "import";
File importFile = new File(importFilePath, "import.log"); File importFile = new File(importFilePath, "import.log");
mcMMO.p.getLogger().info("Starting import of mod materials..."); mcMMO.p.getLogger().info("Starting import of mod materials...");
@ -69,17 +69,16 @@ public class McImportCommand implements CommandExecutor {
} }
materialNames.get(type).add(materialName); materialNames.get(type).add(materialName);
continue;
} }
} }
catch (FileNotFoundException e) { catch (FileNotFoundException e) {
mcMMO.p.getLogger().warning("Could not find " + importFile.getAbsolutePath() + " ! (No such file or directory)"); mcMMO.p.getLogger().warning("Could not find " + importFile.getAbsolutePath() + " ! (No such file or directory)");
mcMMO.p.getLogger().warning("Copy and paste latest.log to " + importFile.getParentFile().getAbsolutePath() + " and rename it to import.log"); mcMMO.p.getLogger().warning("Copy and paste latest.log to " + importFile.getParentFile().getAbsolutePath() + " and rename it to import.log");
return false; return;
} }
catch (Exception e) { catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return false; return;
} }
finally { finally {
tryClose(in); tryClose(in);
@ -88,7 +87,6 @@ public class McImportCommand implements CommandExecutor {
createOutput(materialNames); createOutput(materialNames);
mcMMO.p.getLogger().info("Import finished! Created " + fileAmount + " files!"); mcMMO.p.getLogger().info("Import finished! Created " + fileAmount + " files!");
return true;
} }
private void createOutput(HashMap<ModConfigType, ArrayList<String>> materialNames) { private void createOutput(HashMap<ModConfigType, ArrayList<String>> materialNames) {

View File

@ -94,10 +94,9 @@ public class PartyAllianceCommand implements TabExecutor {
} }
} }
private boolean printUsage() { private void printUsage() {
player.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.Help.0")); player.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.Help.0"));
player.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.Help.1")); player.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.Help.1"));
return true;
} }
@Override @Override

View File

@ -8,7 +8,6 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.TextComponentFactory; import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.random.RandomChanceSkill; import com.gmail.nossr50.util.random.RandomChanceSkill;
import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.random.RandomChanceUtil;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -30,7 +29,7 @@ public class AcrobaticsCommand extends SkillCommand {
protected void dataCalculations(Player player, float skillValue) { protected void dataCalculations(Player player, float skillValue) {
// ACROBATICS_DODGE // ACROBATICS_DODGE
if (canDodge) { if (canDodge) {
String[] dodgeStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.ACROBATICS_DODGE); String[] dodgeStrings = getAbilityDisplayValues(player, SubSkillType.ACROBATICS_DODGE);
dodgeChance = dodgeStrings[0]; dodgeChance = dodgeStrings[0];
dodgeChanceLucky = dodgeStrings[1]; dodgeChanceLucky = dodgeStrings[1];
} }
@ -71,7 +70,7 @@ public class AcrobaticsCommand extends SkillCommand {
graceChance = RandomChanceUtil.getRandomChanceExecutionChance(grace_rcs); graceChance = RandomChanceUtil.getRandomChanceExecutionChance(grace_rcs);
//damageThreshold = AdvancedConfig.getInstance().getRollDamageThreshold(); //damageThreshold = AdvancedConfig.getInstance().getRollDamageThreshold();
String[] rollStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.ACROBATICS_ROLL); String[] rollStrings = getAbilityDisplayValues(player, SubSkillType.ACROBATICS_ROLL);
//Format //Format
double rollChanceLucky = rollChance * 1.333D; double rollChanceLucky = rollChance * 1.333D;

View File

@ -6,7 +6,6 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.archery.Archery; import com.gmail.nossr50.skills.archery.Archery;
import com.gmail.nossr50.util.TextComponentFactory; import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.skills.CombatUtils; import com.gmail.nossr50.util.skills.CombatUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -32,14 +31,14 @@ public class ArcheryCommand extends SkillCommand {
protected void dataCalculations(Player player, float skillValue) { protected void dataCalculations(Player player, float skillValue) {
// ARCHERY_ARROW_RETRIEVAL // ARCHERY_ARROW_RETRIEVAL
if (canRetrieve) { if (canRetrieve) {
String[] retrieveStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.ARCHERY_ARROW_RETRIEVAL); String[] retrieveStrings = getAbilityDisplayValues(player, SubSkillType.ARCHERY_ARROW_RETRIEVAL);
retrieveChance = retrieveStrings[0]; retrieveChance = retrieveStrings[0];
retrieveChanceLucky = retrieveStrings[1]; retrieveChanceLucky = retrieveStrings[1];
} }
// ARCHERY_DAZE // ARCHERY_DAZE
if (canDaze) { if (canDaze) {
String[] dazeStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.ARCHERY_DAZE); String[] dazeStrings = getAbilityDisplayValues(player, SubSkillType.ARCHERY_DAZE);
dazeChance = dazeStrings[0]; dazeChance = dazeStrings[0];
dazeChanceLucky = dazeStrings[1]; dazeChanceLucky = dazeStrings[1];
} }

View File

@ -9,7 +9,6 @@ import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.CombatUtils; import com.gmail.nossr50.util.skills.CombatUtils;
import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -48,7 +47,7 @@ public class AxesCommand extends SkillCommand {
// CRITICAL HIT // CRITICAL HIT
if (canCritical) { if (canCritical) {
String[] criticalHitStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.AXES_CRITICAL_STRIKES); String[] criticalHitStrings = getAbilityDisplayValues(player, SubSkillType.AXES_CRITICAL_STRIKES);
critChance = criticalHitStrings[0]; critChance = criticalHitStrings[0];
critChanceLucky = criticalHitStrings[1]; critChanceLucky = criticalHitStrings[1];
} }

View File

@ -6,7 +6,6 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory; import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -45,7 +44,7 @@ public class HerbalismCommand extends SkillCommand {
// DOUBLE DROPS // DOUBLE DROPS
if (canDoubleDrop) { if (canDoubleDrop) {
String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.HERBALISM_DOUBLE_DROPS); String[] doubleDropStrings = getAbilityDisplayValues(player, SubSkillType.HERBALISM_DOUBLE_DROPS);
doubleDropChance = doubleDropStrings[0]; doubleDropChance = doubleDropStrings[0];
doubleDropChanceLucky = doubleDropStrings[1]; doubleDropChanceLucky = doubleDropStrings[1];
} }
@ -66,21 +65,21 @@ public class HerbalismCommand extends SkillCommand {
if (canGreenThumbBlocks || canGreenThumbPlants) { if (canGreenThumbBlocks || canGreenThumbPlants) {
greenThumbStage = RankUtils.getRank(player, SubSkillType.HERBALISM_GREEN_THUMB); greenThumbStage = RankUtils.getRank(player, SubSkillType.HERBALISM_GREEN_THUMB);
String[] greenThumbStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.HERBALISM_GREEN_THUMB); String[] greenThumbStrings = getAbilityDisplayValues(player, SubSkillType.HERBALISM_GREEN_THUMB);
greenThumbChance = greenThumbStrings[0]; greenThumbChance = greenThumbStrings[0];
greenThumbChanceLucky = greenThumbStrings[1]; greenThumbChanceLucky = greenThumbStrings[1];
} }
// HYLIAN LUCK // HYLIAN LUCK
if (hasHylianLuck) { if (hasHylianLuck) {
String[] hylianLuckStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.HERBALISM_HYLIAN_LUCK); String[] hylianLuckStrings = getAbilityDisplayValues(player, SubSkillType.HERBALISM_HYLIAN_LUCK);
hylianLuckChance = hylianLuckStrings[0]; hylianLuckChance = hylianLuckStrings[0];
hylianLuckChanceLucky = hylianLuckStrings[1]; hylianLuckChanceLucky = hylianLuckStrings[1];
} }
// SHROOM THUMB // SHROOM THUMB
if (canShroomThumb) { if (canShroomThumb) {
String[] shroomThumbStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.HERBALISM_SHROOM_THUMB); String[] shroomThumbStrings = getAbilityDisplayValues(player, SubSkillType.HERBALISM_SHROOM_THUMB);
shroomThumbChance = shroomThumbStrings[0]; shroomThumbChance = shroomThumbStrings[0];
shroomThumbChanceLucky = shroomThumbStrings[1]; shroomThumbChanceLucky = shroomThumbStrings[1];
} }

View File

@ -8,7 +8,6 @@ import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory; import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -54,7 +53,7 @@ public class MiningCommand extends SkillCommand {
// DOUBLE DROPS // DOUBLE DROPS
if (canDoubleDrop) { if (canDoubleDrop) {
String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.MINING_DOUBLE_DROPS); String[] doubleDropStrings = getAbilityDisplayValues(player, SubSkillType.MINING_DOUBLE_DROPS);
doubleDropChance = doubleDropStrings[0]; doubleDropChance = doubleDropStrings[0];
doubleDropChanceLucky = doubleDropStrings[1]; doubleDropChanceLucky = doubleDropStrings[1];
} }

View File

@ -12,7 +12,6 @@ import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory; import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -67,7 +66,7 @@ public class RepairCommand extends SkillCommand {
// SUPER REPAIR // SUPER REPAIR
if (canSuperRepair) { if (canSuperRepair) {
String[] superRepairStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.REPAIR_SUPER_REPAIR); String[] superRepairStrings = getAbilityDisplayValues(player, SubSkillType.REPAIR_SUPER_REPAIR);
superRepairChance = superRepairStrings[0]; superRepairChance = superRepairStrings[0];
superRepairChanceLucky = superRepairStrings[1]; superRepairChanceLucky = superRepairStrings[1];
} }

View File

@ -220,8 +220,8 @@ public abstract class SkillCommand implements TabExecutor {
return Math.min((int) skillValue, maxLevel) / rankChangeLevel; return Math.min((int) skillValue, maxLevel) / rankChangeLevel;
} }
protected String[] getAbilityDisplayValues(SkillActivationType skillActivationType, Player player, SubSkillType subSkill) { protected String[] getAbilityDisplayValues(Player player, SubSkillType subSkill) {
return RandomChanceUtil.calculateAbilityDisplayValues(skillActivationType, player, subSkill); return RandomChanceUtil.calculateAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, subSkill);
} }
protected String[] calculateLengthDisplayValues(Player player, float skillValue) { protected String[] calculateLengthDisplayValues(Player player, float skillValue) {

View File

@ -7,7 +7,6 @@ import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory; import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -46,7 +45,7 @@ public class SmeltingCommand extends SkillCommand {
// SECOND SMELT // SECOND SMELT
if (canSecondSmelt) { if (canSecondSmelt) {
String[] secondSmeltStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.SMELTING_SECOND_SMELT); String[] secondSmeltStrings = getAbilityDisplayValues(player, SubSkillType.SMELTING_SECOND_SMELT);
str_secondSmeltChance = secondSmeltStrings[0]; str_secondSmeltChance = secondSmeltStrings[0];
str_secondSmeltChanceLucky = secondSmeltStrings[1]; str_secondSmeltChanceLucky = secondSmeltStrings[1];
} }

View File

@ -9,7 +9,6 @@ import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.CombatUtils; import com.gmail.nossr50.util.skills.CombatUtils;
import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -37,7 +36,7 @@ public class SwordsCommand extends SkillCommand {
protected void dataCalculations(Player player, float skillValue) { protected void dataCalculations(Player player, float skillValue) {
// SWORDS_COUNTER_ATTACK // SWORDS_COUNTER_ATTACK
if (canCounter) { if (canCounter) {
String[] counterStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.SWORDS_COUNTER_ATTACK); String[] counterStrings = getAbilityDisplayValues(player, SubSkillType.SWORDS_COUNTER_ATTACK);
counterChance = counterStrings[0]; counterChance = counterStrings[0];
counterChanceLucky = counterStrings[1]; counterChanceLucky = counterStrings[1];
} }
@ -46,7 +45,7 @@ public class SwordsCommand extends SkillCommand {
if (canBleed) { if (canBleed) {
bleedLength = UserManager.getPlayer(player).getSwordsManager().getRuptureBleedTicks(); bleedLength = UserManager.getPlayer(player).getSwordsManager().getRuptureBleedTicks();
String[] bleedStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.SWORDS_RUPTURE); String[] bleedStrings = getAbilityDisplayValues(player, SubSkillType.SWORDS_RUPTURE);
bleedChance = bleedStrings[0]; bleedChance = bleedStrings[0];
bleedChanceLucky = bleedStrings[1]; bleedChanceLucky = bleedStrings[1];
} }

View File

@ -6,7 +6,6 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.taming.Taming; import com.gmail.nossr50.skills.taming.Taming;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory; import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -35,7 +34,7 @@ public class TamingCommand extends SkillCommand {
@Override @Override
protected void dataCalculations(Player player, float skillValue) { protected void dataCalculations(Player player, float skillValue) {
if (canGore) { if (canGore) {
String[] goreStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.TAMING_GORE); String[] goreStrings = getAbilityDisplayValues(player, SubSkillType.TAMING_GORE);
goreChance = goreStrings[0]; goreChance = goreStrings[0];
goreChanceLucky = goreStrings[1]; goreChanceLucky = goreStrings[1];
} }

View File

@ -8,7 +8,6 @@ import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.CombatUtils; import com.gmail.nossr50.util.skills.CombatUtils;
import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -40,7 +39,7 @@ public class UnarmedCommand extends SkillCommand {
protected void dataCalculations(Player player, float skillValue) { protected void dataCalculations(Player player, float skillValue) {
// UNARMED_ARROW_DEFLECT // UNARMED_ARROW_DEFLECT
if (canDeflect) { if (canDeflect) {
String[] deflectStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_ARROW_DEFLECT); String[] deflectStrings = getAbilityDisplayValues(player, SubSkillType.UNARMED_ARROW_DEFLECT);
deflectChance = deflectStrings[0]; deflectChance = deflectStrings[0];
deflectChanceLucky = deflectStrings[1]; deflectChanceLucky = deflectStrings[1];
} }
@ -54,7 +53,7 @@ public class UnarmedCommand extends SkillCommand {
// UNARMED_DISARM // UNARMED_DISARM
if (canDisarm) { if (canDisarm) {
String[] disarmStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_DISARM); String[] disarmStrings = getAbilityDisplayValues(player, SubSkillType.UNARMED_DISARM);
disarmChance = disarmStrings[0]; disarmChance = disarmStrings[0];
disarmChanceLucky = disarmStrings[1]; disarmChanceLucky = disarmStrings[1];
} }
@ -66,7 +65,7 @@ public class UnarmedCommand extends SkillCommand {
// IRON GRIP // IRON GRIP
if (canIronGrip) { if (canIronGrip) {
String[] ironGripStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_IRON_GRIP); String[] ironGripStrings = getAbilityDisplayValues(player, SubSkillType.UNARMED_IRON_GRIP);
ironGripChance = ironGripStrings[0]; ironGripChance = ironGripStrings[0];
ironGripChanceLucky = ironGripStrings[1]; ironGripChanceLucky = ironGripStrings[1];
} }

View File

@ -6,7 +6,6 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory; import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -46,7 +45,7 @@ public class WoodcuttingCommand extends SkillCommand {
} }
private void setDoubleDropClassicChanceStrings(Player player) { private void setDoubleDropClassicChanceStrings(Player player) {
String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.WOODCUTTING_HARVEST_LUMBER); String[] doubleDropStrings = getAbilityDisplayValues(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER);
doubleDropChance = doubleDropStrings[0]; doubleDropChance = doubleDropStrings[0];
doubleDropChanceLucky = doubleDropStrings[1]; doubleDropChanceLucky = doubleDropStrings[1];
} }

View File

@ -20,6 +20,7 @@ public class CustomEnumValueSerializer implements TypeSerializer<Enum> {
throw new ObjectMappingException("No value present in node " + value); throw new ObjectMappingException("No value present in node " + value);
} }
//noinspection RedundantCast
Optional<Enum> ret = (Optional) EnumLookup.lookupEnum(type.getRawType().asSubclass(Enum.class), Optional<Enum> ret = (Optional) EnumLookup.lookupEnum(type.getRawType().asSubclass(Enum.class),
enumConstant); // XXX: intellij says this cast is optional but it isnt enumConstant); // XXX: intellij says this cast is optional but it isnt
if (!ret.isPresent()) { if (!ret.isPresent()) {
@ -30,7 +31,7 @@ public class CustomEnumValueSerializer implements TypeSerializer<Enum> {
} }
@Override @Override
public void serialize(@NonNull TypeToken<?> type, @Nullable Enum obj, @NonNull ConfigurationNode value) throws ObjectMappingException { public void serialize(@NonNull TypeToken<?> type, @Nullable Enum obj, @NonNull ConfigurationNode value) {
value.setValue(HOCONUtil.serializeENUMName(obj.name())); value.setValue(HOCONUtil.serializeENUMName(obj.name()));
} }
} }

View File

@ -20,6 +20,7 @@ public class CustomEnumValueSerializerPartyFeature implements TypeSerializer<Enu
throw new ObjectMappingException("No value present in node " + value); throw new ObjectMappingException("No value present in node " + value);
} }
//noinspection RedundantCast
Optional<Enum> ret = (Optional) EnumLookup.lookupEnum(type.getRawType().asSubclass(Enum.class), Optional<Enum> ret = (Optional) EnumLookup.lookupEnum(type.getRawType().asSubclass(Enum.class),
enumConstant); // XXX: intellij says this cast is optional but it isnt enumConstant); // XXX: intellij says this cast is optional but it isnt
if (!ret.isPresent()) { if (!ret.isPresent()) {
@ -30,7 +31,7 @@ public class CustomEnumValueSerializerPartyFeature implements TypeSerializer<Enu
} }
@Override @Override
public void serialize(@NonNull TypeToken<?> type, @Nullable Enum obj, @NonNull ConfigurationNode value) throws ObjectMappingException { public void serialize(@NonNull TypeToken<?> type, @Nullable Enum obj, @NonNull ConfigurationNode value) {
value.setValue(HOCONUtil.serializeENUMName(obj.name())); value.setValue(HOCONUtil.serializeENUMName(obj.name()));
} }
} }

View File

@ -58,7 +58,7 @@ public class RepairableSerializer implements TypeSerializer<Repairable> {
} }
@Override @Override
public void serialize(TypeToken<?> type, Repairable obj, ConfigurationNode value) throws ObjectMappingException { public void serialize(TypeToken<?> type, Repairable obj, ConfigurationNode value) {
/*value.getNode("Item").setValue(HOCONUtil.serializeENUMName(obj.getItemMaterial().getKey().getKey())); /*value.getNode("Item").setValue(HOCONUtil.serializeENUMName(obj.getItemMaterial().getKey().getKey()));
value.getNode("Item-Used-To-Repair").setValue(HOCONUtil.serializeENUMName(obj.getRepairMaterials().getKey().getKey()));*/ value.getNode("Item-Used-To-Repair").setValue(HOCONUtil.serializeENUMName(obj.getRepairMaterials().getKey().getKey()));*/
@ -71,6 +71,7 @@ public class RepairableSerializer implements TypeSerializer<Repairable> {
private Enum getEnum(String enumConstant, TypeToken<?> type) throws ObjectMappingException private Enum getEnum(String enumConstant, TypeToken<?> type) throws ObjectMappingException
{ {
//noinspection RedundantCast
Optional<Enum> ret = (Optional) EnumLookup.lookupEnum(type.getRawType().asSubclass(Enum.class), Optional<Enum> ret = (Optional) EnumLookup.lookupEnum(type.getRawType().asSubclass(Enum.class),
enumConstant); // XXX: intellij says this cast is optional but it isnt enumConstant); // XXX: intellij says this cast is optional but it isnt

View File

@ -66,7 +66,7 @@ public class ConfigLeveling {
case WOODCUTTING: case WOODCUTTING:
return configSectionLevelCaps.getConfigSectionSkills().getWoodcutting().getLevelCap(); return configSectionLevelCaps.getConfigSectionSkills().getWoodcutting().getLevelCap();
case SMELTING: case SMELTING:
return configSectionLevelCaps.getConfigSectionSkills().getWoodcutting().getLevelCap(); return configSectionLevelCaps.getConfigSectionSkills().getSmelting().getLevelCap();
case SALVAGE: case SALVAGE:
return configSectionLevelCaps.getConfigSectionSkills().getSalvage().getLevelCap(); return configSectionLevelCaps.getConfigSectionSkills().getSalvage().getLevelCap();
default: default:
@ -105,7 +105,7 @@ public class ConfigLeveling {
case WOODCUTTING: case WOODCUTTING:
return configSectionLevelCaps.getConfigSectionSkills().getWoodcutting().isLevelCapEnabled(); return configSectionLevelCaps.getConfigSectionSkills().getWoodcutting().isLevelCapEnabled();
case SMELTING: case SMELTING:
return configSectionLevelCaps.getConfigSectionSkills().getWoodcutting().isLevelCapEnabled(); return configSectionLevelCaps.getConfigSectionSkills().getSmelting().isLevelCapEnabled();
case SALVAGE: case SALVAGE:
return configSectionLevelCaps.getConfigSectionSkills().getSalvage().isLevelCapEnabled(); return configSectionLevelCaps.getConfigSectionSkills().getSalvage().isLevelCapEnabled();
default: default:

View File

@ -101,12 +101,12 @@ public class Party {
return onlinePlayerNames; return onlinePlayerNames;
} }
public boolean addOnlineMember(Player player) { public void addOnlineMember(Player player) {
return onlineMembers.add(player); onlineMembers.add(player);
} }
public boolean removeOnlineMember(Player player) { public void removeOnlineMember(Player player) {
return onlineMembers.remove(player); onlineMembers.remove(player);
} }
public String getName() { public String getName() {
@ -308,7 +308,6 @@ public class Party {
break; break;
default: default:
return;
} }
} }

View File

@ -699,7 +699,6 @@ public class McMMOPlayer {
return; return;
default: default:
return;
} }
} }
@ -716,7 +715,6 @@ public class McMMOPlayer {
return; return;
default: default:
return;
} }
} }
@ -734,7 +732,6 @@ public class McMMOPlayer {
return; return;
default: default:
return;
} }
} }

View File

@ -174,7 +174,6 @@ public class EntityListener implements Listener {
mcMMO.getPlaceStore().setTrue(block); mcMMO.getPlaceStore().setTrue(block);
} }
} else if ((block.getType() == Material.REDSTONE_ORE)) { } else if ((block.getType() == Material.REDSTONE_ORE)) {
return;
} }
else { else {
if (mcMMO.getPlaceStore().isTrue(block)) { if (mcMMO.getPlaceStore().isTrue(block)) {
@ -248,7 +247,6 @@ public class EntityListener implements Listener {
event.setCancelled(true); event.setCancelled(true);
} }
return;
} }
} }
@ -564,7 +562,6 @@ public class EntityListener implements Listener {
return; return;
default: default:
return;
} }
} }
} }
@ -659,7 +656,6 @@ public class EntityListener implements Listener {
return; return;
default: default:
return;
} }
} }
@ -832,10 +828,6 @@ public class EntityListener implements Listener {
* RESTORES 4 HUNGER - RESTORES 6 1/2 HUNGER @ * RESTORES 4 HUNGER - RESTORES 6 1/2 HUNGER @
* 1000 * 1000
*/ */
if (Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_FARMERS_DIET)) {
event.setFoodLevel(UserManager.getPlayer(player).getHerbalismManager().farmersDiet(newFoodLevel));
}
return;
case COOKIE: /* RESTORES 1/2 HUNGER - RESTORES 2 HUNGER @ 1000 */ case COOKIE: /* RESTORES 1/2 HUNGER - RESTORES 2 HUNGER @ 1000 */
case MELON_SLICE: /* RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER @ 1000 */ case MELON_SLICE: /* RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER @ 1000 */
@ -859,7 +851,6 @@ public class EntityListener implements Listener {
return; return;
default: default:
return;
} }
} }

View File

@ -249,7 +249,6 @@ public class InventoryListener implements Listener {
AlchemyPotionBrewer.scheduleCheck(player, stand); AlchemyPotionBrewer.scheduleCheck(player, stand);
return; return;
default: default:
return;
} }
} }
else if (slot == InventoryType.SlotType.FUEL) { else if (slot == InventoryType.SlotType.FUEL) {

View File

@ -286,7 +286,6 @@ public class PlayerListener implements Listener {
return; return;
default: default:
return;
} }
} }
@ -388,7 +387,6 @@ public class PlayerListener implements Listener {
} }
return; return;
default: default:
return;
} }
} }

View File

@ -48,7 +48,6 @@ public class SelfListener implements Listener {
ScoreboardManager.handleLevelUp(player, skill); ScoreboardManager.handleLevelUp(player, skill);
if (!MainConfig.getInstance().getLevelUpEffectsEnabled()) { if (!MainConfig.getInstance().getLevelUpEffectsEnabled()) {
return;
} }
/*if ((event.getSkillLevel() % Config.getInstance().getLevelUpEffectsTier()) == 0) { /*if ((event.getSkillLevel() % Config.getInstance().getLevelUpEffectsTier()) == 0) {

View File

@ -486,13 +486,12 @@ public final class PartyManager {
} }
} }
public static boolean disbandAlliance(Player player, Party firstParty, Party secondParty){ public static void disbandAlliance(Player player, Party firstParty, Party secondParty){
if (!handlePartyChangeAllianceEvent(player, firstParty.getName(), secondParty.getName(), McMMOPartyAllianceChangeEvent.EventReason.DISBAND_ALLIANCE)) { if (!handlePartyChangeAllianceEvent(player, firstParty.getName(), secondParty.getName(), McMMOPartyAllianceChangeEvent.EventReason.DISBAND_ALLIANCE)) {
return false; return;
} }
PartyManager.disbandAlliance(firstParty, secondParty); PartyManager.disbandAlliance(firstParty, secondParty);
return true;
} }
private static void disbandAlliance(Party firstParty, Party secondParty) { private static void disbandAlliance(Party firstParty, Party secondParty) {

View File

@ -41,7 +41,7 @@ public class AbilityDisableTask extends BukkitRunnable {
case BERSERK: case BERSERK:
if (MainConfig.getInstance().getRefreshChunksEnabled()) { if (MainConfig.getInstance().getRefreshChunksEnabled()) {
resendChunkRadiusAt(player, 1); resendChunkRadiusAt(player);
} }
// Fallthrough // Fallthrough
@ -66,15 +66,15 @@ public class AbilityDisableTask extends BukkitRunnable {
new AbilityCooldownTask(mcMMOPlayer, ability).runTaskLaterAsynchronously(mcMMO.p, PerksUtils.handleCooldownPerks(player, ability.getCooldown()) * Misc.TICK_CONVERSION_FACTOR); new AbilityCooldownTask(mcMMOPlayer, ability).runTaskLaterAsynchronously(mcMMO.p, PerksUtils.handleCooldownPerks(player, ability.getCooldown()) * Misc.TICK_CONVERSION_FACTOR);
} }
private void resendChunkRadiusAt(Player player, int radius) { private void resendChunkRadiusAt(Player player) {
Chunk chunk = player.getLocation().getChunk(); Chunk chunk = player.getLocation().getChunk();
World world = player.getWorld(); World world = player.getWorld();
int chunkX = chunk.getX(); int chunkX = chunk.getX();
int chunkZ = chunk.getZ(); int chunkZ = chunk.getZ();
for (int x = chunkX - radius; x <= chunkX + radius; x++) { for (int x = chunkX - 1; x <= chunkX + 1; x++) {
for (int z = chunkZ - radius; z <= chunkZ + radius; z++) { for (int z = chunkZ - 1; z <= chunkZ + 1; z++) {
world.refreshChunk(x, z); world.refreshChunk(x, z);
} }
} }

View File

@ -59,16 +59,13 @@ public final class AlchemyPotionBrewer {
ItemStack ingredient = inventory.getIngredient() == null ? null : inventory.getIngredient().clone(); ItemStack ingredient = inventory.getIngredient() == null ? null : inventory.getIngredient().clone();
if (isEmpty(ingredient) || !isValidIngredient(player, ingredient)) { if (isEmpty(ingredient) || !isValidIngredient(player, ingredient)) {
return;
} }
else if (ingredient.getAmount() <= 1) { else if (ingredient.getAmount() <= 1) {
inventory.setIngredient(null); inventory.setIngredient(null);
return;
} }
else { else {
ingredient.setAmount(ingredient.getAmount() - 1); ingredient.setAmount(ingredient.getAmount() - 1);
inventory.setIngredient(ingredient); inventory.setIngredient(ingredient);
return;
} }
} }

View File

@ -96,7 +96,6 @@ public class Mining {
/*if (mcMMO.getModManager().isCustomMiningBlock(blockState)) { /*if (mcMMO.getModManager().isCustomMiningBlock(blockState)) {
Misc.dropItem(Misc.getBlockCenter(blockState), new ItemStack(blockState.getType())); Misc.dropItem(Misc.getBlockCenter(blockState), new ItemStack(blockState.getType()));
}*/ }*/
return;
} }
} }
@ -163,7 +162,6 @@ public class Mining {
/*if (mcMMO.getModManager().isCustomMiningBlock(blockState)) { /*if (mcMMO.getModManager().isCustomMiningBlock(blockState)) {
Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops()); Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops());
}*/ }*/
return;
} }
} }
} }

View File

@ -308,12 +308,10 @@ public final class BlockUtils {
case COBBLESTONE : case COBBLESTONE :
case DIRT : case DIRT :
case GRASS_PATH : case GRASS_PATH :
return true;
case STONE_BRICKS:
return true;
case COBBLESTONE_WALL: case COBBLESTONE_WALL:
case STONE_BRICKS:
return true; return true;
default : default :

View File

@ -175,11 +175,10 @@ public class EventUtils {
return event; return event;
} }
public static FakePlayerAnimationEvent callFakeArmSwingEvent(Player player) { public static void callFakeArmSwingEvent(Player player) {
FakePlayerAnimationEvent event = new FakePlayerAnimationEvent(player); FakePlayerAnimationEvent event = new FakePlayerAnimationEvent(player);
mcMMO.p.getServer().getPluginManager().callEvent(event); mcMMO.p.getServer().getPluginManager().callEvent(event);
return event;
} }
public static boolean handleLevelChangeEvent(Player player, PrimarySkillType skill, int levelsChanged, float xpRemoved, boolean isLevelUp, XPGainReason xpGainReason) { public static boolean handleLevelChangeEvent(Player player, PrimarySkillType skill, int levelsChanged, float xpRemoved, boolean isLevelUp, XPGainReason xpGainReason) {
@ -198,7 +197,7 @@ public class EventUtils {
return !isCancelled; return !isCancelled;
} }
public static boolean handleLevelChangeEventEdit(Player player, PrimarySkillType skill, int levelsChanged, float xpRemoved, boolean isLevelUp, XPGainReason xpGainReason, int oldLevel) { public static void handleLevelChangeEventEdit(Player player, PrimarySkillType skill, int levelsChanged, float xpRemoved, boolean isLevelUp, XPGainReason xpGainReason, int oldLevel) {
McMMOPlayerLevelChangeEvent event = isLevelUp ? new McMMOPlayerLevelUpEvent(player, skill, levelsChanged - oldLevel, xpGainReason) : new McMMOPlayerLevelDownEvent(player, skill, levelsChanged, xpGainReason); McMMOPlayerLevelChangeEvent event = isLevelUp ? new McMMOPlayerLevelUpEvent(player, skill, levelsChanged - oldLevel, xpGainReason) : new McMMOPlayerLevelDownEvent(player, skill, levelsChanged, xpGainReason);
mcMMO.p.getServer().getPluginManager().callEvent(event); mcMMO.p.getServer().getPluginManager().callEvent(event);
@ -211,7 +210,6 @@ public class EventUtils {
profile.addXp(skill, xpRemoved); profile.addXp(skill, xpRemoved);
} }
return !isCancelled;
} }
/** /**
@ -371,11 +369,10 @@ public class EventUtils {
return !isCancelled; return !isCancelled;
} }
public static McMMOPlayerAbilityDeactivateEvent callAbilityDeactivateEvent(Player player, SuperAbilityType ability) { public static void callAbilityDeactivateEvent(Player player, SuperAbilityType ability) {
McMMOPlayerAbilityDeactivateEvent event = new McMMOPlayerAbilityDeactivateEvent(player, PrimarySkillType.byAbility(ability)); McMMOPlayerAbilityDeactivateEvent event = new McMMOPlayerAbilityDeactivateEvent(player, PrimarySkillType.byAbility(ability));
mcMMO.p.getServer().getPluginManager().callEvent(event); mcMMO.p.getServer().getPluginManager().callEvent(event);
return event;
} }
public static McMMOPlayerFishingTreasureEvent callFishingTreasureEvent(Player player, ItemStack treasureDrop, int treasureXp, Map<Enchantment, Integer> enchants) { public static McMMOPlayerFishingTreasureEvent callFishingTreasureEvent(Player player, ItemStack treasureDrop, int treasureXp, Map<Enchantment, Integer> enchants) {
@ -385,11 +382,10 @@ public class EventUtils {
return event; return event;
} }
public static FakePlayerFishEvent callFakeFishEvent(Player player, FishHook hook) { public static void callFakeFishEvent(Player player, FishHook hook) {
FakePlayerFishEvent event = new FakePlayerFishEvent(player, null, hook, PlayerFishEvent.State.FISHING); FakePlayerFishEvent event = new FakePlayerFishEvent(player, null, hook, PlayerFishEvent.State.FISHING);
mcMMO.p.getServer().getPluginManager().callEvent(event); mcMMO.p.getServer().getPluginManager().callEvent(event);
return event;
} }
public static McMMOPlayerRepairCheckEvent callRepairCheckEvent(Player player, short durability, ItemStack repairMaterial, ItemStack repairedObject) { public static McMMOPlayerRepairCheckEvent callRepairCheckEvent(Player player, short durability, ItemStack repairMaterial, ItemStack repairedObject) {

View File

@ -217,13 +217,13 @@ public final class Permissions {
PluginManager pluginManager = server.getPluginManager(); PluginManager pluginManager = server.getPluginManager();
for (World world : server.getWorlds()) { for (World world : server.getWorlds()) {
addDynamicPermission("mcmmo.commands.ptp.world." + world.getName(), PermissionDefault.OP, pluginManager); addDynamicPermission("mcmmo.commands.ptp.world." + world.getName(), pluginManager);
} }
} }
private static void addDynamicPermission(String permissionName, PermissionDefault permissionDefault, PluginManager pluginManager) { private static void addDynamicPermission(String permissionName, PluginManager pluginManager) {
Permission permission = new Permission(permissionName); Permission permission = new Permission(permissionName);
permission.setDefault(permissionDefault); permission.setDefault(PermissionDefault.OP);
pluginManager.addPermission(permission); pluginManager.addPermission(permission);
} }
} }

View File

@ -11,57 +11,46 @@ import org.bukkit.block.Block;
public class NullChunkletManager implements ChunkletManager { public class NullChunkletManager implements ChunkletManager {
@Override @Override
public void loadChunklet(int cx, int cy, int cz, World world) { public void loadChunklet(int cx, int cy, int cz, World world) {
return;
} }
@Override @Override
public void unloadChunklet(int cx, int cy, int cz, World world) { public void unloadChunklet(int cx, int cy, int cz, World world) {
return;
} }
@Override @Override
public void loadChunk(int cx, int cz, World world) { public void loadChunk(int cx, int cz, World world) {
return;
} }
@Override @Override
public void unloadChunk(int cx, int cz, World world) { public void unloadChunk(int cx, int cz, World world) {
return;
} }
@Override @Override
public void chunkLoaded(int cx, int cz, World world) { public void chunkLoaded(int cx, int cz, World world) {
return;
} }
@Override @Override
public void chunkUnloaded(int cx, int cz, World world) { public void chunkUnloaded(int cx, int cz, World world) {
return;
} }
@Override @Override
public void saveWorld(World world) { public void saveWorld(World world) {
return;
} }
@Override @Override
public void unloadWorld(World world) { public void unloadWorld(World world) {
return;
} }
@Override @Override
public void loadWorld(World world) { public void loadWorld(World world) {
return;
} }
@Override @Override
public void saveAll() { public void saveAll() {
return;
} }
@Override @Override
public void unloadAll() { public void unloadAll() {
return;
} }
@Override @Override
@ -76,26 +65,21 @@ public class NullChunkletManager implements ChunkletManager {
@Override @Override
public void setTrue(int x, int y, int z, World world) { public void setTrue(int x, int y, int z, World world) {
return;
} }
@Override @Override
public void setTrue(Block block) { public void setTrue(Block block) {
return;
} }
@Override @Override
public void setFalse(int x, int y, int z, World world) { public void setFalse(int x, int y, int z, World world) {
return;
} }
@Override @Override
public void setFalse(Block block) { public void setFalse(Block block) {
return;
} }
@Override @Override
public void cleanUp() { public void cleanUp() {
return;
} }
} }

View File

@ -154,11 +154,8 @@ public class HashChunkManager implements ChunkManager {
public synchronized void unloadChunk(int cx, int cz, World world) { public synchronized void unloadChunk(int cx, int cz, World world) {
saveChunk(cx, cz, world); saveChunk(cx, cz, world);
if (store.containsKey(world.getName() + "," + cx + "," + cz)) {
store.remove(world.getName() + "," + cx + "," + cz);
//closeChunkStore(world, cx, cz); //closeChunkStore(world, cx, cz);
} store.remove(world.getName() + "," + cx + "," + cz);
} }
@Override @Override

View File

@ -147,15 +147,15 @@ public class McMMOSimpleRegionFile {
return file; return file;
} }
public synchronized boolean testCloseTimeout() { /* public synchronized boolean testCloseTimeout() {
/* *//*
if (System.currentTimeMillis() - TIMEOUT_TIME > lastAccessTime) { if (System.currentTimeMillis() - TIMEOUT_TIME > lastAccessTime) {
close(); close();
return true; return true;
} }
*/ *//*
return false; return false;
} }*/
public synchronized DataOutputStream getOutputStream(int x, int z) { public synchronized DataOutputStream getOutputStream(int x, int z) {
int index = getChunkIndex(x, z); int index = getChunkIndex(x, z);

View File

@ -13,7 +13,7 @@ public class NullChunkManager implements ChunkManager {
public void closeAll() {} public void closeAll() {}
@Override @Override
public ChunkStore readChunkStore(World world, int x, int z) throws IOException { public ChunkStore readChunkStore(World world, int x, int z) {
return null; return null;
} }

View File

@ -28,7 +28,6 @@ public class BlockStoreConversionMain implements Runnable {
} }
this.taskID = this.scheduler.runTaskLater(mcMMO.p, this, 1).getTaskId(); this.taskID = this.scheduler.runTaskLater(mcMMO.p, this, 1).getTaskId();
return;
} }
@Override @Override
@ -87,6 +86,5 @@ public class BlockStoreConversionMain implements Runnable {
this.world = null; this.world = null;
this.scheduler = null; this.scheduler = null;
this.converters = null; this.converters = null;
return;
} }
} }

View File

@ -29,7 +29,6 @@ public class BlockStoreConversionXDirectory implements Runnable {
} }
this.taskID = this.scheduler.runTaskLater(mcMMO.p, this, 1).getTaskId(); this.taskID = this.scheduler.runTaskLater(mcMMO.p, this, 1).getTaskId();
return;
} }
@Override @Override

View File

@ -41,7 +41,6 @@ public class BlockStoreConversionZDirectory implements Runnable {
} }
this.taskID = this.scheduler.runTaskLater(mcMMO.p, this, 1).getTaskId(); this.taskID = this.scheduler.runTaskLater(mcMMO.p, this, 1).getTaskId();
return;
} }
@Override @Override

View File

@ -115,7 +115,7 @@ public final class CommandUtils {
} }
public static boolean hasPlayerDataKey(CommandSender sender) { public static boolean hasPlayerDataKey(CommandSender sender) {
if (sender == null || !(sender instanceof Player)) { if (!(sender instanceof Player)) {
return false; return false;
} }

View File

@ -435,8 +435,6 @@ public class ScoreboardWrapper {
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
switch (sidebarType) { switch (sidebarType) {
case NONE:
break;
case SKILL_BOARD: case SKILL_BOARD:
Validate.notNull(targetSkill); Validate.notNull(targetSkill);

View File

@ -330,7 +330,7 @@ public final class CombatUtils {
Wolf wolf = (Wolf) damager; Wolf wolf = (Wolf) damager;
AnimalTamer tamer = wolf.getOwner(); AnimalTamer tamer = wolf.getOwner();
if (tamer != null && tamer instanceof Player && PrimarySkillType.TAMING.shouldProcess(target)) { if (tamer instanceof Player && PrimarySkillType.TAMING.shouldProcess(target)) {
Player master = (Player) tamer; Player master = (Player) tamer;
if (!Misc.isNPCEntity(master) && PrimarySkillType.TAMING.getPermissions(master)) { if (!Misc.isNPCEntity(master) && PrimarySkillType.TAMING.getPermissions(master)) {
@ -342,7 +342,7 @@ public final class CombatUtils {
Arrow arrow = (Arrow) damager; Arrow arrow = (Arrow) damager;
ProjectileSource projectileSource = arrow.getShooter(); ProjectileSource projectileSource = arrow.getShooter();
if (projectileSource != null && projectileSource instanceof Player && PrimarySkillType.ARCHERY.shouldProcess(target)) { if (projectileSource instanceof Player && PrimarySkillType.ARCHERY.shouldProcess(target)) {
Player player = (Player) projectileSource; Player player = (Player) projectileSource;
if (!Misc.isNPCEntity(player) && PrimarySkillType.ARCHERY.getPermissions(player)) { if (!Misc.isNPCEntity(player) && PrimarySkillType.ARCHERY.getPermissions(player)) {
@ -774,10 +774,10 @@ public final class CombatUtils {
return scaledModifiers; return scaledModifiers;
} }
public static EntityDamageByEntityEvent applyScaledModifiers(double initialDamage, double finalDamage, EntityDamageByEntityEvent event) { public static void applyScaledModifiers(double initialDamage, double finalDamage, EntityDamageByEntityEvent event) {
// No additional damage // No additional damage
if (initialDamage == finalDamage) { if (initialDamage == finalDamage) {
return event; return;
} }
for (DamageModifier modifier : DamageModifier.values()) { for (DamageModifier modifier : DamageModifier.values()) {
@ -793,7 +793,6 @@ public final class CombatUtils {
event.setDamage(modifier, finalDamage / initialDamage * event.getDamage(modifier)); event.setDamage(modifier, finalDamage / initialDamage * event.getDamage(modifier));
} }
return event;
} }
/** /**

View File

@ -74,7 +74,6 @@ public final class ParticleEffectUtils {
public static void playAbilityEnabledEffect(Player player) { public static void playAbilityEnabledEffect(Player player) {
if (!MainConfig.getInstance().getAbilityActivationEffectEnabled()) { if (!MainConfig.getInstance().getAbilityActivationEffectEnabled()) {
return;
} }
/* if (hasHeadRoom(player)) { /* if (hasHeadRoom(player)) {
@ -84,7 +83,6 @@ public final class ParticleEffectUtils {
public static void playAbilityDisabledEffect(Player player) { public static void playAbilityDisabledEffect(Player player) {
if (!MainConfig.getInstance().getAbilityDeactivationEffectEnabled()) { if (!MainConfig.getInstance().getAbilityDeactivationEffectEnabled()) {
return;
} }
/*if (hasHeadRoom(player)) { /*if (hasHeadRoom(player)) {

View File

@ -82,13 +82,11 @@ public class SoundManager {
case SKILL_UNLOCKED: case SKILL_UNLOCKED:
return Sound.UI_TOAST_CHALLENGE_COMPLETE; return Sound.UI_TOAST_CHALLENGE_COMPLETE;
case ABILITY_ACTIVATED_BERSERK: case ABILITY_ACTIVATED_BERSERK:
case TIRED:
return Sound.BLOCK_CONDUIT_AMBIENT; return Sound.BLOCK_CONDUIT_AMBIENT;
case ABILITY_ACTIVATED_GENERIC: case ABILITY_ACTIVATED_GENERIC:
return Sound.ITEM_TRIDENT_RIPTIDE_3; return Sound.ITEM_TRIDENT_RIPTIDE_3;
case DEFLECT_ARROWS: case DEFLECT_ARROWS:
return Sound.ENTITY_ENDER_EYE_DEATH;
case TIRED:
return Sound.BLOCK_CONDUIT_AMBIENT;
case BLEED: case BLEED:
return Sound.ENTITY_ENDER_EYE_DEATH; return Sound.ENTITY_ENDER_EYE_DEATH;
default: default:

View File

@ -68,7 +68,7 @@ public class WorldGuardManager {
Plugin plugin = getServer().getPluginManager().getPlugin("WorldGuard"); Plugin plugin = getServer().getPluginManager().getPlugin("WorldGuard");
// WorldGuard may not be loaded // WorldGuard may not be loaded
if (plugin == null || !(plugin instanceof WorldGuardPlugin)) { if (!(plugin instanceof WorldGuardPlugin)) {
return null; // Maybe you want throw an exception instead return null; // Maybe you want throw an exception instead
} }