mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-30 12:44:45 +02:00
MASSIVE Permissions overhaul. Added a handful of new permissions,
renamed a few more. Changed Green Terra to handle blocks based on perms rather than the config file. For more details, read the diff.
This commit is contained in:
@ -119,7 +119,7 @@ public final class Fishing {
|
||||
treasureXp = treasure.getXp();
|
||||
ItemStack treasureDrop = treasure.getDrop();
|
||||
|
||||
if (Permissions.fishingMagic(player) && beginMagicHunter(player, skillLevel, treasureDrop, player.getWorld().hasStorm())) {
|
||||
if (Permissions.magicHunter(player) && beginMagicHunter(player, skillLevel, treasureDrop, player.getWorld().hasStorm())) {
|
||||
player.sendMessage(LocaleLoader.getString("Fishing.MagicFound"));
|
||||
}
|
||||
|
||||
@ -130,7 +130,9 @@ public final class Fishing {
|
||||
}
|
||||
|
||||
mcMMOPlayer.beginXpGain(SkillType.FISHING, Config.getInstance().getFishingBaseXP() + treasureXp);
|
||||
event.setExpToDrop(event.getExpToDrop() * getVanillaXpMultiplier(skillLevel));
|
||||
if (Permissions.vanillaXpBoost(player, SkillType.FISHING)) {
|
||||
event.setExpToDrop(event.getExpToDrop() * getVanillaXpMultiplier(skillLevel));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -141,7 +143,7 @@ public final class Fishing {
|
||||
* @return Chosen treasure
|
||||
*/
|
||||
private static FishingTreasure checkForTreasure(Player player, int skillLevel) {
|
||||
if (!Config.getInstance().getFishingDropsEnabled() || !Permissions.fishingTreasures(player)) {
|
||||
if (!Config.getInstance().getFishingDropsEnabled() || !Permissions.fishingTreasureHunter(player)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -161,7 +163,7 @@ public final class Fishing {
|
||||
|
||||
FishingTreasure treasure = rewards.get(Misc.getRandom().nextInt(rewards.size()));
|
||||
ItemStack treasureDrop = treasure.getDrop();
|
||||
int activationChance = PerksUtils.handleLuckyPerks(Permissions.luckyFishing(player));
|
||||
int activationChance = PerksUtils.handleLuckyPerks(player, SkillType.FISHING);
|
||||
|
||||
if (Misc.getRandom().nextDouble() * activationChance > treasure.getDropChance()) {
|
||||
return null;
|
||||
@ -190,7 +192,7 @@ public final class Fishing {
|
||||
return false;
|
||||
}
|
||||
|
||||
int activationChance = PerksUtils.handleLuckyPerks(Permissions.luckyFishing(player));
|
||||
int activationChance = PerksUtils.handleLuckyPerks(player, SkillType.FISHING);
|
||||
|
||||
if (storm) {
|
||||
activationChance = (int) (activationChance * 0.909);
|
||||
|
@ -51,9 +51,9 @@ public class FishingCommand extends SkillCommand {
|
||||
|
||||
@Override
|
||||
protected void permissionsCheck() {
|
||||
canTreasureHunt = Permissions.fishingTreasures(player);
|
||||
canMagicHunt = Permissions.fishingMagic(player);
|
||||
canShake = Permissions.shakeMob(player);
|
||||
canTreasureHunt = Permissions.fishingTreasureHunter(player);
|
||||
canMagicHunt = Permissions.magicHunter(player);
|
||||
canShake = Permissions.shake(player);
|
||||
canFishermansDiet = Permissions.fishermansDiet(player);
|
||||
}
|
||||
|
||||
|
@ -19,8 +19,8 @@ import org.bukkit.potion.PotionType;
|
||||
import com.gmail.nossr50.skills.fishing.Fishing.Tier;
|
||||
import com.gmail.nossr50.skills.utilities.CombatTools;
|
||||
import com.gmail.nossr50.skills.utilities.PerksUtils;
|
||||
import com.gmail.nossr50.skills.utilities.SkillType;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
|
||||
public final class ShakeMob {
|
||||
private ShakeMob() {}
|
||||
@ -33,7 +33,7 @@ public final class ShakeMob {
|
||||
* @param skillLevel Fishing level of the player
|
||||
*/
|
||||
public static void process(Player player, LivingEntity mob, int skillLevel) {
|
||||
int activationChance = PerksUtils.handleLuckyPerks(Permissions.luckyFishing(player));
|
||||
int activationChance = PerksUtils.handleLuckyPerks(player, SkillType.FISHING);
|
||||
|
||||
if (getShakeProbability(skillLevel) <= Misc.getRandom().nextInt(activationChance)) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user