mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
commit
2e120abe3a
@ -178,6 +178,10 @@ public class Config extends AutoUpdateConfigLoader {
|
|||||||
reason.add("Abilities.Limits.Tree_Feller_Threshold should be greater than 0!");
|
reason.add("Abilities.Limits.Tree_Feller_Threshold should be greater than 0!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getFishingLureModifier() < 0) {
|
||||||
|
reason.add("Abilities.Fishing.Lure_Modifier should be at least 0!");
|
||||||
|
}
|
||||||
|
|
||||||
if (getDetonatorItem() == null) {
|
if (getDetonatorItem() == null) {
|
||||||
reason.add("Skills.Mining.Detonator_Item is invalid!");
|
reason.add("Skills.Mining.Detonator_Item is invalid!");
|
||||||
}
|
}
|
||||||
@ -481,6 +485,7 @@ public class Config extends AutoUpdateConfigLoader {
|
|||||||
public boolean getFishingDropsEnabled() { return config.getBoolean("Skills.Fishing.Drops_Enabled", true); }
|
public boolean getFishingDropsEnabled() { return config.getBoolean("Skills.Fishing.Drops_Enabled", true); }
|
||||||
public boolean getFishingOverrideTreasures() { return config.getBoolean("Skills.Fishing.Override_Vanilla_Treasures", true); }
|
public boolean getFishingOverrideTreasures() { return config.getBoolean("Skills.Fishing.Override_Vanilla_Treasures", true); }
|
||||||
public boolean getFishingExtraFish() { return config.getBoolean("Skills.Fishing.Extra_Fish", true); }
|
public boolean getFishingExtraFish() { return config.getBoolean("Skills.Fishing.Extra_Fish", true); }
|
||||||
|
public double getFishingLureModifier() { return config.getDouble("Skills.Fishing.Lure_Modifier", 4.0D); }
|
||||||
|
|
||||||
/* Mining */
|
/* Mining */
|
||||||
public Material getDetonatorItem() { return Material.matchMaterial(config.getString("Skills.Mining.Detonator_Name", "FLINT_AND_STEEL")); }
|
public Material getDetonatorItem() { return Material.matchMaterial(config.getString("Skills.Mining.Detonator_Name", "FLINT_AND_STEEL")); }
|
||||||
|
@ -134,6 +134,9 @@ public class FishingManager extends SkillManager {
|
|||||||
if (player.getInventory().getItemInMainHand().getType() == Material.FISHING_ROD) {
|
if (player.getInventory().getItemInMainHand().getType() == Material.FISHING_ROD) {
|
||||||
player.getInventory().setItemInMainHand(null);
|
player.getInventory().setItemInMainHand(null);
|
||||||
}
|
}
|
||||||
|
else if (player.getInventory().getItemInOffHand().getType() == Material.FISHING_ROD) {
|
||||||
|
player.getInventory().setItemInOffHand(null);
|
||||||
|
}
|
||||||
|
|
||||||
LivingEntity kraken = (LivingEntity) world.spawnEntity(player.getEyeLocation(), (Misc.getRandom().nextInt(100) == 0 ? EntityType.CHICKEN : EntityType.SQUID));
|
LivingEntity kraken = (LivingEntity) world.spawnEntity(player.getEyeLocation(), (Misc.getRandom().nextInt(100) == 0 ? EntityType.CHICKEN : EntityType.SQUID));
|
||||||
kraken.setCustomName(AdvancedConfig.getInstance().getKrakenName());
|
kraken.setCustomName(AdvancedConfig.getInstance().getKrakenName());
|
||||||
@ -475,7 +478,18 @@ public class FishingManager extends SkillManager {
|
|||||||
*/
|
*/
|
||||||
private FishingTreasure getFishingTreasure() {
|
private FishingTreasure getFishingTreasure() {
|
||||||
double diceRoll = Misc.getRandom().nextDouble() * 100;
|
double diceRoll = Misc.getRandom().nextDouble() * 100;
|
||||||
diceRoll -= getPlayer().getInventory().getItemInMainHand().getEnchantmentLevel(Enchantment.LUCK);
|
int luck;
|
||||||
|
|
||||||
|
if (getPlayer().getInventory().getItemInMainHand().getType() == Material.FISHING_ROD) {
|
||||||
|
luck = getPlayer().getInventory().getItemInMainHand().getEnchantmentLevel(Enchantment.LUCK);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// We know something was caught, so if the rod wasn't in the main hand it must be in the offhand
|
||||||
|
luck = getPlayer().getInventory().getItemInOffHand().getEnchantmentLevel(Enchantment.LUCK);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rather than subtracting luck (and causing a minimum 3% chance for every drop), scale by luck.
|
||||||
|
diceRoll *= (1.0 - luck * Config.getInstance().getFishingLureModifier() / 100);
|
||||||
|
|
||||||
FishingTreasure treasure = null;
|
FishingTreasure treasure = null;
|
||||||
|
|
||||||
|
@ -188,6 +188,10 @@ public class SkillUtils {
|
|||||||
* @param maxDamageModifier the amount to adjust the max damage by
|
* @param maxDamageModifier the amount to adjust the max damage by
|
||||||
*/
|
*/
|
||||||
public static void handleDurabilityChange(ItemStack itemStack, int durabilityModifier, double maxDamageModifier) {
|
public static void handleDurabilityChange(ItemStack itemStack, int durabilityModifier, double maxDamageModifier) {
|
||||||
|
if (itemStack.hasItemMeta() && itemStack.getItemMeta().isUnbreakable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Material type = itemStack.getType();
|
Material type = itemStack.getType();
|
||||||
short maxDurability = mcMMO.getRepairableManager().isRepairable(type) ? mcMMO.getRepairableManager().getRepairable(type).getMaximumDurability() : type.getMaxDurability();
|
short maxDurability = mcMMO.getRepairableManager().isRepairable(type) ? mcMMO.getRepairableManager().getRepairable(type).getMaximumDurability() : type.getMaxDurability();
|
||||||
durabilityModifier = (int) Math.min(durabilityModifier / (itemStack.getEnchantmentLevel(Enchantment.DURABILITY) + 1), maxDurability * maxDamageModifier);
|
durabilityModifier = (int) Math.min(durabilityModifier / (itemStack.getEnchantmentLevel(Enchantment.DURABILITY) + 1), maxDurability * maxDamageModifier);
|
||||||
|
@ -330,6 +330,7 @@ Skills:
|
|||||||
Override_Vanilla_Treasures: true
|
Override_Vanilla_Treasures: true
|
||||||
# Always catch fish, even when treasure is found
|
# Always catch fish, even when treasure is found
|
||||||
Extra_Fish: false
|
Extra_Fish: false
|
||||||
|
Lure_Modifier: 4.0
|
||||||
Herbalism:
|
Herbalism:
|
||||||
Level_Cap: 0
|
Level_Cap: 0
|
||||||
Prevent_AFK_Leveling: true
|
Prevent_AFK_Leveling: true
|
||||||
|
Loading…
Reference in New Issue
Block a user