mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Modified drop rates for Fishing's Shake ability. Also reverted spacing to match the rest of the project.
This commit is contained in:
parent
3a467b3da4
commit
a56f805787
@ -209,12 +209,12 @@ public class Fishing {
|
|||||||
|
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
final PlayerProfile profile = Users.getProfile(player);
|
final PlayerProfile profile = Users.getProfile(player);
|
||||||
int lootTier = getFishingLootTier(profile);
|
int lootTier = getFishingLootTier(profile);
|
||||||
|
|
||||||
int dropChance = getShakeChance(lootTier);
|
int dropChance = getShakeChance(lootTier);
|
||||||
|
|
||||||
if (event.getPlayer().hasPermission("mcmmo.perks.lucky.fishing")) {
|
if (event.getPlayer().hasPermission("mcmmo.perks.lucky.fishing")) {
|
||||||
dropChance = (int) (dropChance * 1.25); //With lucky perk on max level tier, its 100%
|
dropChance = (int) (dropChance * 1.25); //With lucky perk on max level tier, its 100%
|
||||||
}
|
}
|
||||||
|
|
||||||
final int DROP_CHANCE = random.nextInt(100);
|
final int DROP_CHANCE = random.nextInt(100);
|
||||||
@ -226,200 +226,204 @@ public class Fishing {
|
|||||||
|
|
||||||
if (DROP_CHANCE < dropChance) {
|
if (DROP_CHANCE < dropChance) {
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case BLAZE:
|
case BLAZE:
|
||||||
Misc.dropItem(location, new ItemStack(Material.BLAZE_ROD));
|
Misc.dropItem(location, new ItemStack(Material.BLAZE_ROD));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CAVE_SPIDER:
|
case CAVE_SPIDER:
|
||||||
if (DROP_NUMBER > 50) {
|
if (DROP_NUMBER > 50) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.SPIDER_EYE));
|
Misc.dropItem(location, new ItemStack(Material.SPIDER_EYE));
|
||||||
} else {
|
} else {
|
||||||
Misc.dropItem(location, new ItemStack(Material.STRING));
|
Misc.dropItem(location, new ItemStack(Material.STRING));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHICKEN:
|
case CHICKEN:
|
||||||
if (DROP_NUMBER > 66) {
|
if (DROP_NUMBER > 66) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.FEATHER));
|
Misc.dropItem(location, new ItemStack(Material.FEATHER));
|
||||||
} else if (DROP_NUMBER > 33) {
|
} else if (DROP_NUMBER > 33) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.RAW_CHICKEN));
|
Misc.dropItem(location, new ItemStack(Material.RAW_CHICKEN));
|
||||||
} else {
|
} else {
|
||||||
Misc.dropItem(location, new ItemStack(Material.EGG));
|
Misc.dropItem(location, new ItemStack(Material.EGG));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case COW:
|
case COW:
|
||||||
if (DROP_NUMBER > 99) {
|
if (DROP_NUMBER > 95) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.MILK_BUCKET));
|
Misc.dropItem(location, new ItemStack(Material.MILK_BUCKET));
|
||||||
} else if (DROP_NUMBER > 50) {
|
} else if (DROP_NUMBER > 50) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.LEATHER));
|
Misc.dropItem(location, new ItemStack(Material.LEATHER));
|
||||||
} else {
|
} else {
|
||||||
Misc.dropItem(location, new ItemStack(Material.RAW_BEEF));
|
Misc.dropItem(location, new ItemStack(Material.RAW_BEEF));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CREEPER:
|
case CREEPER:
|
||||||
if (DROP_NUMBER > 99) {
|
if (DROP_NUMBER > 95) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.SKULL_ITEM, 1, (short) 4));
|
Misc.dropItem(location, new ItemStack(Material.SKULL_ITEM, 1, (short) 4));
|
||||||
} else {
|
} else {
|
||||||
Misc.dropItem(location, new ItemStack(Material.SULPHUR));
|
Misc.dropItem(location, new ItemStack(Material.SULPHUR));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ENDERMAN:
|
case ENDERMAN:
|
||||||
Misc.dropItem(location, new ItemStack(Material.ENDER_PEARL));
|
Misc.dropItem(location, new ItemStack(Material.ENDER_PEARL));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GHAST:
|
case GHAST:
|
||||||
if (DROP_NUMBER > 50) {
|
if (DROP_NUMBER > 50) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.SULPHUR));
|
Misc.dropItem(location, new ItemStack(Material.SULPHUR));
|
||||||
} else {
|
} else {
|
||||||
Misc.dropItem(location, new ItemStack(Material.GHAST_TEAR));
|
Misc.dropItem(location, new ItemStack(Material.GHAST_TEAR));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IRON_GOLEM:
|
case IRON_GOLEM:
|
||||||
if (DROP_NUMBER > 99) {
|
if (DROP_NUMBER > 95) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.PUMPKIN));
|
Misc.dropItem(location, new ItemStack(Material.PUMPKIN));
|
||||||
} else if (DROP_NUMBER > 90) {
|
} else if (DROP_NUMBER > 85) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.IRON_INGOT));
|
Misc.dropItem(location, new ItemStack(Material.IRON_INGOT));
|
||||||
} else {
|
} else {
|
||||||
Misc.dropItem(location, new ItemStack(Material.RED_ROSE));
|
Misc.dropItem(location, new ItemStack(Material.RED_ROSE));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MAGMA_CUBE:
|
case MAGMA_CUBE:
|
||||||
Misc.dropItem(location, new ItemStack(Material.MAGMA_CREAM));
|
Misc.dropItem(location, new ItemStack(Material.MAGMA_CREAM));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MUSHROOM_COW:
|
case MUSHROOM_COW:
|
||||||
if (DROP_NUMBER > 99) {
|
if (DROP_NUMBER > 95) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.MILK_BUCKET));
|
Misc.dropItem(location, new ItemStack(Material.MILK_BUCKET));
|
||||||
} else if (DROP_NUMBER > 98) {
|
} else if (DROP_NUMBER > 90) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.MUSHROOM_SOUP));
|
Misc.dropItem(location, new ItemStack(Material.MUSHROOM_SOUP));
|
||||||
} else if (DROP_NUMBER > 66) {
|
} else if (DROP_NUMBER > 60) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.LEATHER));
|
Misc.dropItem(location, new ItemStack(Material.LEATHER));
|
||||||
} else if (DROP_NUMBER > 33) {
|
} else if (DROP_NUMBER > 30) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.RAW_BEEF));
|
Misc.dropItem(location, new ItemStack(Material.RAW_BEEF));
|
||||||
} else {
|
} else {
|
||||||
Misc.dropItems(location, new ItemStack(Material.RED_MUSHROOM), 3);
|
Misc.dropItem(location, new ItemStack(Material.RED_MUSHROOM));
|
||||||
}
|
Misc.randomDropItems(location, new ItemStack(Material.RED_MUSHROOM), 50, 2);
|
||||||
break;
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case PIG:
|
case PIG:
|
||||||
Misc.dropItem(location, new ItemStack(Material.PORK));
|
Misc.dropItem(location, new ItemStack(Material.PORK));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PIG_ZOMBIE:
|
case PIG_ZOMBIE:
|
||||||
if (DROP_NUMBER > 50) {
|
if (DROP_NUMBER > 50) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.ROTTEN_FLESH));
|
Misc.dropItem(location, new ItemStack(Material.ROTTEN_FLESH));
|
||||||
} else {
|
} else {
|
||||||
Misc.dropItem(location, new ItemStack(Material.GOLD_NUGGET));
|
Misc.dropItem(location, new ItemStack(Material.GOLD_NUGGET));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SHEEP:
|
case SHEEP:
|
||||||
final Sheep sheep = (Sheep) le;
|
final Sheep sheep = (Sheep) le;
|
||||||
|
|
||||||
if (!sheep.isSheared()) {
|
if (!sheep.isSheared()) {
|
||||||
final Wool wool = new Wool();
|
final Wool wool = new Wool();
|
||||||
wool.setColor(sheep.getColor());
|
wool.setColor(sheep.getColor());
|
||||||
|
|
||||||
final ItemStack theWool = wool.toItemStack();
|
final ItemStack theWool = wool.toItemStack();
|
||||||
theWool.setAmount(1 + random.nextInt(6));
|
theWool.setAmount(1 + random.nextInt(6));
|
||||||
|
|
||||||
Misc.dropItem(location, theWool);
|
Misc.dropItem(location, theWool);
|
||||||
sheep.setSheared(true);
|
sheep.setSheared(true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SKELETON:
|
case SKELETON:
|
||||||
if (((CraftSkeleton) le).getHandle().getSkeletonType() == 1) {
|
if (((CraftSkeleton) le).getHandle().getSkeletonType() == 1) {
|
||||||
if (DROP_NUMBER > 97) {
|
if (DROP_NUMBER > 95) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.SKULL_ITEM, 1, (short) 1));
|
Misc.dropItem(location, new ItemStack(Material.SKULL_ITEM, 1, (short) 1));
|
||||||
} else if (DROP_NUMBER > 50) {
|
} else if (DROP_NUMBER > 50) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.BONE));
|
Misc.dropItem(location, new ItemStack(Material.BONE));
|
||||||
} else {
|
} else {
|
||||||
Misc.dropItems(location, new ItemStack(Material.COAL), 3);
|
Misc.dropItem(location, new ItemStack(Material.COAL));
|
||||||
}
|
Misc.randomDropItems(location, new ItemStack(Material.COAL), 50, 2);
|
||||||
} else {
|
}
|
||||||
if (DROP_NUMBER > 99) {
|
} else {
|
||||||
Misc.dropItem(location, new ItemStack(Material.SKULL_ITEM));
|
if (DROP_NUMBER > 95) {
|
||||||
} else if (DROP_NUMBER > 50) {
|
Misc.dropItem(location, new ItemStack(Material.SKULL_ITEM));
|
||||||
Misc.dropItem(location, new ItemStack(Material.BONE));
|
} else if (DROP_NUMBER > 50) {
|
||||||
} else {
|
Misc.dropItem(location, new ItemStack(Material.BONE));
|
||||||
Misc.dropItems(location, new ItemStack(Material.ARROW), 3);
|
} else {
|
||||||
}
|
Misc.dropItem(location, new ItemStack(Material.ARROW));
|
||||||
}
|
Misc.randomDropItems(location, new ItemStack(Material.ARROW), 50, 2);
|
||||||
break;
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case SLIME:
|
case SLIME:
|
||||||
Misc.dropItem(location, new ItemStack(Material.SLIME_BALL));
|
Misc.dropItem(location, new ItemStack(Material.SLIME_BALL));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SNOWMAN:
|
case SNOWMAN:
|
||||||
if (DROP_NUMBER > 99) {
|
if (DROP_NUMBER > 95) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.PUMPKIN));
|
Misc.dropItem(location, new ItemStack(Material.PUMPKIN));
|
||||||
} else {
|
} else {
|
||||||
Misc.dropItems(location, new ItemStack(Material.SNOW_BALL), 5);
|
Misc.dropItem(location, new ItemStack(Material.SNOW_BALL));
|
||||||
}
|
Misc.randomDropItems(location, new ItemStack(Material.SNOW_BALL), 50, 4);
|
||||||
break;
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case SPIDER:
|
case SPIDER:
|
||||||
if (DROP_NUMBER > 50) {
|
if (DROP_NUMBER > 50) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.SPIDER_EYE));
|
Misc.dropItem(location, new ItemStack(Material.SPIDER_EYE));
|
||||||
} else {
|
} else {
|
||||||
Misc.dropItem(location, new ItemStack(Material.STRING));
|
Misc.dropItem(location, new ItemStack(Material.STRING));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SQUID:
|
case SQUID:
|
||||||
Misc.dropItem(location, new ItemStack(Material.INK_SACK, 1, (short) 0, (byte) 0x0));
|
Misc.dropItem(location, new ItemStack(Material.INK_SACK, 1, (short) 0, (byte) 0x0));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WITCH:
|
case WITCH:
|
||||||
final int DROP_NUMBER_2 = random.nextInt(randomChance) + 1;
|
final int DROP_NUMBER_2 = random.nextInt(randomChance) + 1;
|
||||||
if (DROP_NUMBER > 97) {
|
if (DROP_NUMBER > 95) {
|
||||||
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));
|
||||||
} else if (DROP_NUMBER_2 > 33) {
|
} else if (DROP_NUMBER_2 > 33) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.POTION, 1, (short) 8195));
|
Misc.dropItem(location, new ItemStack(Material.POTION, 1, (short) 8195));
|
||||||
} else {
|
} else {
|
||||||
Misc.dropItem(location, new ItemStack(Material.POTION, 1, (short) 8194));
|
Misc.dropItem(location, new ItemStack(Material.POTION, 1, (short) 8194));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (DROP_NUMBER_2 > 88) {
|
if (DROP_NUMBER_2 > 88) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.GLASS_BOTTLE));
|
Misc.dropItem(location, new ItemStack(Material.GLASS_BOTTLE));
|
||||||
} else if (DROP_NUMBER_2 > 75) {
|
} else if (DROP_NUMBER_2 > 75) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.GLOWSTONE_DUST));
|
Misc.dropItem(location, new ItemStack(Material.GLOWSTONE_DUST));
|
||||||
} else if (DROP_NUMBER_2 > 63) {
|
} else if (DROP_NUMBER_2 > 63) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.SULPHUR));
|
Misc.dropItem(location, new ItemStack(Material.SULPHUR));
|
||||||
} else if (DROP_NUMBER_2 > 50) {
|
} else if (DROP_NUMBER_2 > 50) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.REDSTONE));
|
Misc.dropItem(location, new ItemStack(Material.REDSTONE));
|
||||||
} else if (DROP_NUMBER_2 > 38) {
|
} else if (DROP_NUMBER_2 > 38) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.SPIDER_EYE));
|
Misc.dropItem(location, new ItemStack(Material.SPIDER_EYE));
|
||||||
} else if (DROP_NUMBER_2 > 25) {
|
} else if (DROP_NUMBER_2 > 25) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.STICK));
|
Misc.dropItem(location, new ItemStack(Material.STICK));
|
||||||
} else if (DROP_NUMBER_2 > 13) {
|
} else if (DROP_NUMBER_2 > 13) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.SUGAR));
|
Misc.dropItem(location, new ItemStack(Material.SUGAR));
|
||||||
} else {
|
} else {
|
||||||
Misc.dropItem(location, new ItemStack(Material.POTION));
|
Misc.dropItem(location, new ItemStack(Material.POTION));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ZOMBIE:
|
case ZOMBIE:
|
||||||
if (DROP_NUMBER > 99) {
|
if (DROP_NUMBER > 95) {
|
||||||
Misc.dropItem(location, new ItemStack(Material.SKULL_ITEM, 1, (short) 2));
|
Misc.dropItem(location, new ItemStack(Material.SKULL_ITEM, 1, (short) 2));
|
||||||
} else {
|
} else {
|
||||||
Misc.dropItem(location, new ItemStack(Material.ROTTEN_FLESH));
|
Misc.dropItem(location, new ItemStack(Material.ROTTEN_FLESH));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Combat.dealDamage(le, 1);
|
Combat.dealDamage(le, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user