mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 19:54:44 +02:00
Fixed a bug which caused advanced.yml not to respect every MaxChance node
This commit is contained in:
@ -12,6 +12,7 @@ public class Taming {
|
||||
public static final int FAST_FOOD_SERVICE_ACTIVATION_CHANCE = advancedConfig.getFastFoodChance();
|
||||
public static final int FAST_FOOD_SERVICE_ACTIVATION_LEVEL = advancedConfig.getFastFoodUnlock();
|
||||
|
||||
public static final int GORE_CHANCE_MAX = AdvancedConfig.getInstance().getGoreChanceMax();
|
||||
public static final int GORE_BLEED_TICKS = advancedConfig.getGoreBleedTicks();
|
||||
public static final int GORE_MAX_BONUS_LEVEL = advancedConfig.getGoreMaxBonusLevel();
|
||||
public static final int GORE_MULTIPLIER = advancedConfig.getGoreModifier();
|
||||
|
@ -8,7 +8,6 @@ import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
@ -103,15 +102,15 @@ public class TamingManager {
|
||||
|
||||
GoreEventHandler eventHandler = new GoreEventHandler(this, event);
|
||||
|
||||
int goreChanceMax = AdvancedConfig.getInstance().getGoreChanceMax();
|
||||
int goreMaxLevel = AdvancedConfig.getInstance().getGoreMaxBonusLevel();
|
||||
int randomChance = 100;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.taming")) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
final float chance = (float) (((double) goreChanceMax / (double) goreMaxLevel) * skillLevel);
|
||||
float chance = (float) (((double) Taming.GORE_CHANCE_MAX / (double) Taming.GORE_MAX_BONUS_LEVEL) * skillLevel);
|
||||
if (chance > Taming.GORE_CHANCE_MAX) chance = Taming.GORE_CHANCE_MAX;
|
||||
|
||||
if (chance > Taming.getRandom().nextInt(randomChance)) {
|
||||
eventHandler.modifyEventDamage();
|
||||
eventHandler.applyBleed();
|
||||
|
Reference in New Issue
Block a user