mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Fixing fishing a bit.
This commit is contained in:
parent
30b87e8035
commit
87c4f318a4
@ -153,7 +153,7 @@ public class Fishing {
|
|||||||
|
|
||||||
player.sendMessage(LocaleLoader.getString("Fishing.ItemFound"));
|
player.sendMessage(LocaleLoader.getString("Fishing.ItemFound"));
|
||||||
|
|
||||||
if (ItemChecks.isArmor(fishingResults) || ItemChecks.isTool(fishingResults)) {
|
if (ItemChecks.isEnchantable(fishingResults)) {
|
||||||
int randomChance = 100;
|
int randomChance = 100;
|
||||||
|
|
||||||
if (player.hasPermission("mcmmo.perks.lucky.fishing")) {
|
if (player.hasPermission("mcmmo.perks.lucky.fishing")) {
|
||||||
@ -205,7 +205,7 @@ public class Fishing {
|
|||||||
randomChance = (int) (randomChance * 0.75);
|
randomChance = (int) (randomChance * 0.75);
|
||||||
}
|
}
|
||||||
|
|
||||||
final int DROP_NUMBER = random.nextInt(randomChance);
|
final int DROP_NUMBER = random.nextInt(randomChance) + 1;
|
||||||
|
|
||||||
LivingEntity le = (LivingEntity) event.getCaught();
|
LivingEntity le = (LivingEntity) event.getCaught();
|
||||||
EntityType type = le.getType();
|
EntityType type = le.getType();
|
||||||
@ -385,7 +385,7 @@ public class Fishing {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WITCH:
|
case WITCH:
|
||||||
final int DROP_NUMBER_2 = random.nextInt(randomChance);
|
final int DROP_NUMBER_2 = random.nextInt(randomChance) + 1;
|
||||||
if (DROP_NUMBER > 97) {
|
if (DROP_NUMBER > 97) {
|
||||||
if(DROP_NUMBER_2 > 66) {
|
if(DROP_NUMBER_2 > 66) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.POTION, 1, (short) 8197));
|
Misc.dropItem(location, new ItemStack(Material.POTION, 1, (short) 8197));
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.gmail.nossr50.util;
|
package com.gmail.nossr50.util;
|
||||||
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.api.SpoutToolsAPI;
|
import com.gmail.nossr50.api.SpoutToolsAPI;
|
||||||
@ -463,4 +464,14 @@ public class ItemChecks {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks to see if an item is enchantable.
|
||||||
|
*
|
||||||
|
* @param is Item to check
|
||||||
|
* @return true if the item is enchantable, false otherwise
|
||||||
|
*/
|
||||||
|
public static boolean isEnchantable(ItemStack is) {
|
||||||
|
return isArmor(is) || isSword(is) || isAxe(is) || isShovel(is) || isPickaxe(is) || (is.getType() == Material.BOW);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user