mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-03 04:55:28 +02:00
Fix compilation errors
This commit is contained in:
@@ -7,8 +7,7 @@ import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.skills.repair.Repair;
|
||||
import com.gmail.nossr50.skills.salvage.Salvage;
|
||||
import com.gmail.nossr50.util.random.RandomChanceSkill;
|
||||
import com.gmail.nossr50.util.random.RandomChanceUtil;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
@@ -68,7 +67,7 @@ public final class BlockUtils {
|
||||
*/
|
||||
public static boolean checkDoubleDrops(Player player, BlockState blockState, PrimarySkillType skillType, SubSkillType subSkillType) {
|
||||
if (mcMMO.p.getGeneralConfig().getDoubleDropsEnabled(skillType, blockState.getType()) && Permissions.isSubSkillEnabled(player, subSkillType)) {
|
||||
return RandomChanceUtil.checkRandomChanceExecutionSuccess(new RandomChanceSkill(player, subSkillType, true));
|
||||
return SkillUtils.isSkillRNGSuccessful(subSkillType, player);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -201,22 +200,22 @@ public final class BlockUtils {
|
||||
return mcMMO.getMaterialMapStore().isTreeFellerDestructible(material);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a given block should be affected by Flux Mining
|
||||
*
|
||||
* @param blockState The {@link BlockState} of the block to check
|
||||
* @return true if the block should affected by Flux Mining, false otherwise
|
||||
*/
|
||||
public static boolean affectedByFluxMining(BlockState blockState) {
|
||||
switch (blockState.getType()) {
|
||||
case IRON_ORE:
|
||||
case GOLD_ORE:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// /**
|
||||
// * Determine if a given block should be affected by Flux Mining
|
||||
// *
|
||||
// * @param blockState The {@link BlockState} of the block to check
|
||||
// * @return true if the block should affected by Flux Mining, false otherwise
|
||||
// */
|
||||
// public static boolean affectedByFluxMining(BlockState blockState) {
|
||||
// switch (blockState.getType()) {
|
||||
// case IRON_ORE:
|
||||
// case GOLD_ORE:
|
||||
// return true;
|
||||
//
|
||||
// default:
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* Determine if a given block can activate Herbalism abilities
|
||||
|
@@ -26,7 +26,7 @@ public final class MobHealthbarUtils {
|
||||
EntityDamageEvent lastDamageCause = player.getLastDamageCause();
|
||||
String replaceString = lastDamageCause instanceof EntityDamageByEntityEvent ? StringUtils.getPrettyEntityTypeString(((EntityDamageByEntityEvent) lastDamageCause).getDamager().getType()) : "a mob";
|
||||
|
||||
return deathMessage.replaceAll("(?:(\u00A7(?:[0-9A-FK-ORa-fk-or]))*(?:[\u2764\u25A0]{1,10})){1,2}", replaceString);
|
||||
return deathMessage.replaceAll("(?:(§(?:[0-9A-FK-ORa-fk-or]))*(?:[❤■]{1,10})){1,2}", replaceString);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -3,6 +3,7 @@ package com.gmail.nossr50.util.random;
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -35,9 +36,9 @@ public class ProbabilityFactory {
|
||||
}
|
||||
|
||||
//Probability ceiling is configurable in this type
|
||||
probabilityCeiling = AdvancedConfig.getInstance().getMaximumProbability(subSkillType);
|
||||
probabilityCeiling = mcMMO.p.getAdvancedConfig().getMaximumProbability(subSkillType);
|
||||
//The xCeiling is configurable in this type
|
||||
xCeiling = AdvancedConfig.getInstance().getMaxBonusLevel(subSkillType);
|
||||
xCeiling = mcMMO.p.getAdvancedConfig().getMaxBonusLevel(subSkillType);
|
||||
return new ProbabilityImpl(xPos, xCeiling, probabilityCeiling);
|
||||
case STATIC_CONFIGURABLE:
|
||||
try {
|
||||
@@ -69,11 +70,11 @@ public class ProbabilityFactory {
|
||||
private static double getStaticRandomChance(@NotNull SubSkillType subSkillType) throws InvalidStaticChance {
|
||||
switch (subSkillType) {
|
||||
case AXES_ARMOR_IMPACT:
|
||||
return AdvancedConfig.getInstance().getImpactChance();
|
||||
return mcMMO.p.getAdvancedConfig().getImpactChance();
|
||||
case AXES_GREATER_IMPACT:
|
||||
return AdvancedConfig.getInstance().getGreaterImpactChance();
|
||||
return mcMMO.p.getAdvancedConfig().getGreaterImpactChance();
|
||||
case TAMING_FAST_FOOD_SERVICE:
|
||||
return AdvancedConfig.getInstance().getFastFoodChance();
|
||||
return mcMMO.p.getAdvancedConfig().getFastFoodChance();
|
||||
default:
|
||||
throw new InvalidStaticChance();
|
||||
}
|
||||
|
@@ -12,8 +12,10 @@ import com.gmail.nossr50.events.skills.secondaryabilities.SubSkillEvent;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.metadata.ItemMetadataService;
|
||||
import com.gmail.nossr50.util.EventUtils;
|
||||
import com.gmail.nossr50.util.ItemUtils;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.NotificationManager;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.random.*;
|
||||
|
Reference in New Issue
Block a user