mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
ACTUALLY fix issue with fishing enchantments. Also updated the
changelog.
This commit is contained in:
parent
c0b3a4e929
commit
0dfd2fe9ef
@ -8,10 +8,8 @@ Key:
|
||||
- Removal
|
||||
|
||||
Version 1.3.13-dev
|
||||
+ Added task to prune old and powerless users from the SQL database.
|
||||
*** WARNING: THIS WILL RUN AUTOMATICALLY ON YOUR DB. IF YOU ARE WORRIED ***
|
||||
*** ABOUT DATA LOSS, BACK UP YOUR SQL DATA BEFORE INSTALLING THIS BUILD ***
|
||||
+ Added Craftbukkit 1.4.6 compatibility
|
||||
+ Added task & command to prune old and powerless users from the SQL database.
|
||||
+ Added Craftbukkit 1.4.6 / 1.4.7 compatibility
|
||||
+ Added new /mcrank command for showing a players leader board ranking for all skills in one place
|
||||
+ Added a configurable durability cap for ArmorImpact to advanced.yml
|
||||
+ Added the version number to /mcmmo
|
||||
@ -44,9 +42,11 @@ Version 1.3.13-dev
|
||||
= Fixed a bug which caused a potentially infinite recursion in a btree structure
|
||||
= Fixed a NPE with custom blocks
|
||||
= Fixed a bug with Blast Mining never dropping debris blocks
|
||||
= Fixed a bug with conflicting fishing enchantments
|
||||
! GJ stopped being a lazy slacker and got stuff done
|
||||
! Nossr50 actually committed something
|
||||
! Changed code that uses SpoutPlugin to make it compatible with the latest version
|
||||
! Changed Reimplemented skill level and power level caps.
|
||||
! Reimplemented skill level and power level caps.
|
||||
! Moved Arcane Forging and Fishing setting from config.yml to advanced.yml
|
||||
! Overall SQL query improvements
|
||||
! Reduced number of SQL queries for mcTop command from 11 to 1, speeding it up immensely
|
||||
|
@ -2,7 +2,6 @@ package com.gmail.nossr50.skills.gathering;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Location;
|
||||
@ -164,14 +163,18 @@ public class Fishing {
|
||||
*/
|
||||
if (Misc.getRandom().nextInt(randomChance) <= (lootTier * magicHunterMultiplier) && Permissions.fishingMagic(player)) {
|
||||
for (Enchantment newEnchant : Enchantment.values()) {
|
||||
boolean conflicts = false;
|
||||
|
||||
if (newEnchant.canEnchantItem(fishingResults)) {
|
||||
Map<Enchantment, Integer> resultEnchantments = fishingResults.getEnchantments();
|
||||
specificChance++;
|
||||
|
||||
for (Enchantment oldEnchant : resultEnchantments.keySet()) {
|
||||
if (oldEnchant.conflictsWith(newEnchant))
|
||||
for (Enchantment oldEnchant : fishingResults.getEnchantments().keySet()) {
|
||||
conflicts = oldEnchant.conflictsWith(newEnchant);
|
||||
|
||||
if (conflicts) {
|
||||
specificChance--;
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* CHANCE OF GETTING EACH ENCHANTMENT
|
||||
@ -184,7 +187,7 @@ public class Fishing {
|
||||
* 12.5% - 7th Enchantment
|
||||
* 11.11% - 8th Enchantment
|
||||
*/
|
||||
if (Misc.getRandom().nextInt(specificChance) < 1) {
|
||||
if (!conflicts && Misc.getRandom().nextInt(specificChance) < 1) {
|
||||
enchanted = true;
|
||||
int randomEnchantLevel = Misc.getRandom().nextInt(newEnchant.getMaxLevel()) + 1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user