mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
Updating permissions for consistency.
This commit is contained in:
@ -13,7 +13,6 @@ public class AcrobaticsManager {
|
||||
private Player player;
|
||||
private PlayerProfile profile;
|
||||
private int skillLevel;
|
||||
private Permissions permissionInstance = Permissions.getInstance();
|
||||
|
||||
public AcrobaticsManager (Player player) {
|
||||
this.player = player;
|
||||
@ -30,7 +29,7 @@ public class AcrobaticsManager {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if (!permissionInstance.roll(player)) {
|
||||
if (!Permissions.roll(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -41,7 +40,7 @@ public class AcrobaticsManager {
|
||||
|
||||
int randomChance = 1000;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.acrobatics")) {
|
||||
if (Permissions.luckyAcrobatics(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
@ -64,7 +63,7 @@ public class AcrobaticsManager {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if (!permissionInstance.dodge(player)) {
|
||||
if (!Permissions.dodge(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -72,7 +71,7 @@ public class AcrobaticsManager {
|
||||
|
||||
int randomChance = 4000;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.acrobatics")) {
|
||||
if (Permissions.luckyAcrobatics(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ public class RollEventHandler extends AcrobaticsEventHandler {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if (Permissions.getInstance().gracefulRoll(player)) {
|
||||
if (Permissions.gracefulRoll(player)) {
|
||||
this.isGraceful = player.isSneaking();
|
||||
}
|
||||
else {
|
||||
|
@ -16,7 +16,6 @@ public class ArcheryManager {
|
||||
private Player player;
|
||||
private PlayerProfile profile;
|
||||
private int skillLevel;
|
||||
private Permissions permissionsInstance;
|
||||
|
||||
private float dazeBonusMax = advancedConfig.getDazeBonusMax();
|
||||
private float dazeMaxBonusLevel = advancedConfig.getDazeMaxBonusLevel();
|
||||
@ -32,7 +31,6 @@ public class ArcheryManager {
|
||||
return;
|
||||
|
||||
this.skillLevel = profile.getSkillLevel(SkillType.ARCHERY);
|
||||
this.permissionsInstance = Permissions.getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -44,17 +42,14 @@ public class ArcheryManager {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if(permissionsInstance == null)
|
||||
return;
|
||||
|
||||
if (!permissionsInstance.trackArrows(player)) {
|
||||
if (!Permissions.trackArrows(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
ArrowTrackingEventHandler eventHandler = new ArrowTrackingEventHandler(this, livingEntity);
|
||||
|
||||
int randomChance = 100;
|
||||
if (player.hasPermission("mcmmo.perks.lucky.archery")) {
|
||||
if (Permissions.luckyArchery(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
final float chance = (float) (((double) retrieveBonusMax / (double) retrieveMaxBonusLevel) * skillLevel);
|
||||
@ -73,10 +68,7 @@ public class ArcheryManager {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if(permissionsInstance == null)
|
||||
return;
|
||||
|
||||
if (!permissionsInstance.daze(player)) {
|
||||
if (!Permissions.daze(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -84,7 +76,7 @@ public class ArcheryManager {
|
||||
|
||||
int randomChance = 100;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.archery")) {
|
||||
if (Permissions.luckyArchery(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
@ -104,10 +96,7 @@ public class ArcheryManager {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if(permissionsInstance == null)
|
||||
return;
|
||||
|
||||
if (!permissionsInstance.archeryBonus(player)) {
|
||||
if (!Permissions.archeryBonus(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ public class Axes {
|
||||
int randomChance = 100;
|
||||
double chance = (MAX_CHANCE / MAX_BONUS_LEVEL) * skillCheck;
|
||||
|
||||
if (attacker.hasPermission("mcmmo.perks.lucky.axes")) {
|
||||
if (Permissions.luckyAxes(attacker)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
@ -179,13 +179,13 @@ public class Axes {
|
||||
final double GREATER_IMPACT_MULTIPLIER = advancedConfig.getGreaterImpactModifier();
|
||||
final int GREATER_IMPACT_DAMAGE = advancedConfig.getGreaterImpactBonusDamage();
|
||||
|
||||
if (!Permissions.getInstance().greaterImpact(attacker)) {
|
||||
if (!Permissions.greaterImpact(attacker)) {
|
||||
return;
|
||||
}
|
||||
|
||||
int randomChance = 100;
|
||||
|
||||
if (attacker.hasPermission("mcmmo.perks.lucky.axes")) {
|
||||
if (Permissions.luckyAxes(attacker)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ public class Excavation {
|
||||
xp = Config.getInstance().getExcavationBaseXP();
|
||||
}
|
||||
|
||||
if (Permissions.getInstance().excavationTreasures(player)) {
|
||||
if (Permissions.excavationTreasures(player)) {
|
||||
switch (type) {
|
||||
case DIRT:
|
||||
treasures = TreasuresConfig.getInstance().excavationFromDirt;
|
||||
@ -99,7 +99,7 @@ public class Excavation {
|
||||
if (skillLevel >= treasure.getDropLevel()) {
|
||||
int randomChance = 100;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.excavation")) {
|
||||
if (Permissions.luckyExcavation(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
|
@ -107,13 +107,13 @@ public class Fishing {
|
||||
}
|
||||
|
||||
if (Config.getInstance().getFishingDropsEnabled() && rewards.size() > 0
|
||||
&& Permissions.getInstance().fishingTreasures(player)) {
|
||||
&& Permissions.fishingTreasures(player)) {
|
||||
FishingTreasure treasure = rewards.get(random.nextInt(rewards
|
||||
.size()));
|
||||
|
||||
int randomChance = 100;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.fishing")) {
|
||||
if (Permissions.luckyFishing(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
@ -167,12 +167,12 @@ public class Fishing {
|
||||
if (ItemChecks.isEnchantable(fishingResults)) {
|
||||
int randomChance = 100;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.fishing")) {
|
||||
if (Permissions.luckyFishing(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
if (random.nextInt(randomChance) <= ENCHANTMENT_CHANCE
|
||||
&& Permissions.getInstance().fishingMagic(player)) {
|
||||
&& Permissions.fishingMagic(player)) {
|
||||
for (Enchantment newEnchant : Enchantment.values()) {
|
||||
if (newEnchant.canEnchantItem(fishingResults)) {
|
||||
Map<Enchantment, Integer> resultEnchantments = fishingResults
|
||||
@ -226,7 +226,7 @@ public class Fishing {
|
||||
public static void shakeMob(PlayerFishEvent event) {
|
||||
int randomChance = 100;
|
||||
|
||||
if (event.getPlayer().hasPermission("mcmmo.perks.lucky.fishing")) {
|
||||
if (Permissions.luckyFishing(event.getPlayer())) {
|
||||
randomChance = (int) (randomChance * 1.25);
|
||||
}
|
||||
|
||||
@ -236,7 +236,7 @@ public class Fishing {
|
||||
|
||||
int dropChance = getShakeChance(lootTier);
|
||||
|
||||
if (event.getPlayer().hasPermission("mcmmo.perks.lucky.fishing")) {
|
||||
if (Permissions.luckyFishing(player)) {
|
||||
dropChance = (int) (dropChance * 1.25); // With lucky perk on max
|
||||
// level tier, its 100%
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ public class Herbalism {
|
||||
|
||||
int randomChance = 1000;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.herbalism")) {
|
||||
if (Permissions.luckyHerbalism(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ public class Herbalism {
|
||||
mat = Material.WHEAT;
|
||||
xp = Config.getInstance().getHerbalismXPWheat();
|
||||
|
||||
if (Permissions.getInstance().greenThumbWheat(player)) {
|
||||
if (Permissions.greenThumbWheat(player)) {
|
||||
greenThumbWheat(block, player, event, plugin);
|
||||
}
|
||||
}
|
||||
@ -154,7 +154,7 @@ public class Herbalism {
|
||||
mat = Material.NETHER_STALK;
|
||||
xp = Config.getInstance().getHerbalismXPNetherWart();
|
||||
|
||||
if (Permissions.getInstance().greenThumbNetherwart(player)) {
|
||||
if (Permissions.greenThumbNetherwart(player)) {
|
||||
greenThumbWheat(block, player, event, plugin);
|
||||
}
|
||||
}
|
||||
@ -211,7 +211,7 @@ public class Herbalism {
|
||||
xp = Config.getInstance().getHerbalismXPCocoa();
|
||||
|
||||
|
||||
if (Permissions.getInstance().greenThumbCocoa(player)) {
|
||||
if (Permissions.greenThumbCocoa(player)) {
|
||||
greenThumbWheat(block, player, event, plugin);
|
||||
}
|
||||
}
|
||||
@ -223,7 +223,7 @@ public class Herbalism {
|
||||
xp = Config.getInstance().getHerbalismXPCarrot();
|
||||
|
||||
|
||||
if (Permissions.getInstance().greenThumbCarrots(player)) {
|
||||
if (Permissions.greenThumbCarrots(player)) {
|
||||
greenThumbWheat(block, player, event, plugin);
|
||||
}
|
||||
}
|
||||
@ -234,7 +234,7 @@ public class Herbalism {
|
||||
mat = Material.POTATO;
|
||||
xp = Config.getInstance().getHerbalismXPPotato();
|
||||
|
||||
if (Permissions.getInstance().greenThumbPotatoes(player)) {
|
||||
if (Permissions.greenThumbPotatoes(player)) {
|
||||
greenThumbWheat(block, player, event, plugin);
|
||||
}
|
||||
}
|
||||
@ -254,7 +254,7 @@ public class Herbalism {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Permissions.getInstance().herbalismDoubleDrops(player)) {
|
||||
if (Permissions.herbalismDoubleDrops(player)) {
|
||||
ItemStack is = null;
|
||||
|
||||
if (customPlant) {
|
||||
@ -431,7 +431,7 @@ public class Herbalism {
|
||||
|
||||
int randomChance = 1500;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.herbalism")) {
|
||||
if (Permissions.luckyHerbalism(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
@ -491,7 +491,7 @@ public class Herbalism {
|
||||
|
||||
int randomChance = 1500;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.herbalism")) {
|
||||
if (Permissions.luckyHerbalism(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
|
@ -336,11 +336,11 @@ public class Mining {
|
||||
int randomChance = 100;
|
||||
int chance = (int) (((double) MAX_CHANCE / (double) MAX_BONUS_LEVEL) * skillCheck);
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.mining")) {
|
||||
if (Permissions.luckyMining(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
if (chance > random.nextInt(randomChance) && Permissions.getInstance().miningDoubleDrops(player)) {
|
||||
if (chance > random.nextInt(randomChance) && Permissions.miningDoubleDrops(player)) {
|
||||
if (player.getItemInHand().containsEnchantment(Enchantment.SILK_TOUCH)) {
|
||||
silkTouchDrops(block);
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ public class WoodCutting {
|
||||
}
|
||||
}
|
||||
|
||||
if (Permissions.getInstance().woodcutting(player)) {
|
||||
if (Permissions.woodcutting(player)) {
|
||||
Skills.xpProcessing(player, profile, SkillType.WOODCUTTING, xp);
|
||||
}
|
||||
}
|
||||
@ -353,11 +353,11 @@ public class WoodCutting {
|
||||
int randomChance = 100;
|
||||
int chance = (int) (((double) MAX_CHANCE / (double) MAX_BONUS_LEVEL) * skillLevel);
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.woodcutting")) {
|
||||
if (Permissions.luckyWoodcutting(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
if (chance > random.nextInt(randomChance) && Permissions.getInstance().woodcuttingDoubleDrops(player)) {
|
||||
if (chance > random.nextInt(randomChance) && Permissions.woodcuttingDoubleDrops(player)) {
|
||||
Config configInstance = Config.getInstance();
|
||||
ItemStack item;
|
||||
Location location;
|
||||
|
@ -27,7 +27,6 @@ public class Repair {
|
||||
|
||||
private static Random random = new Random();
|
||||
private static Config configInstance = Config.getInstance();
|
||||
private static Permissions permInstance = Permissions.getInstance();
|
||||
|
||||
static AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
|
||||
|
||||
@ -92,7 +91,7 @@ public class Repair {
|
||||
* @param is Item being repaired
|
||||
*/
|
||||
protected static void addEnchants(Player player, ItemStack is) {
|
||||
if(permInstance.arcaneBypass(player)) {
|
||||
if(Permissions.arcaneBypass(player)) {
|
||||
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Perfect"));
|
||||
return;
|
||||
}
|
||||
@ -104,7 +103,7 @@ public class Repair {
|
||||
|
||||
int rank = getArcaneForgingRank(Users.getProfile(player));
|
||||
|
||||
if (rank == 0 || !permInstance.arcaneForging(player)) {
|
||||
if (rank == 0 || !Permissions.arcaneForging(player)) {
|
||||
for (Enchantment x : enchants.keySet()) {
|
||||
is.removeEnchantment(x);
|
||||
}
|
||||
@ -120,7 +119,7 @@ public class Repair {
|
||||
|
||||
int randomChance = 100;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.repair")) {
|
||||
if (Permissions.luckyRepair(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
@ -244,7 +243,7 @@ public class Repair {
|
||||
if(skillLevel >= repairMasteryMaxBonusLevel) bonus = ((float) repairMasteryChanceMax / 100F);
|
||||
else bonus = (((float) skillLevel) / ((float) repairMasteryMaxBonusLevel)) * (((float) repairMasteryChanceMax) / 100F);
|
||||
|
||||
if (permInstance.repairMastery(player)) {
|
||||
if (Permissions.repairMastery(player)) {
|
||||
bonus = (((float) repairAmount) * bonus);
|
||||
repairAmount += (int) bonus;
|
||||
}
|
||||
@ -281,9 +280,9 @@ public class Repair {
|
||||
int chance = (int) (((double) MAX_CHANCE / (double) MAX_BONUS_LEVEL) * skillLevel);
|
||||
if (skillLevel >= MAX_BONUS_LEVEL) chance = MAX_CHANCE;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.repair")) randomChance = (int) (randomChance * 0.75);
|
||||
if (Permissions.luckyRepair(player)) randomChance = (int) (randomChance * 0.75);
|
||||
|
||||
if (chance > random.nextInt(randomChance) && permInstance.repairBonus(player)){
|
||||
if (chance > random.nextInt(randomChance) && Permissions.repairBonus(player)){
|
||||
player.sendMessage(LocaleLoader.getString("Repair.Skills.FeltEasy"));
|
||||
return true;
|
||||
}
|
||||
|
@ -18,13 +18,13 @@ public enum RepairItemType {
|
||||
public boolean getPermissions(Player player) {
|
||||
switch (this) {
|
||||
case ARMOR:
|
||||
return Permissions.getInstance().armorRepair(player);
|
||||
return Permissions.armorRepair(player);
|
||||
|
||||
case TOOL:
|
||||
return Permissions.getInstance().toolRepair(player);
|
||||
return Permissions.toolRepair(player);
|
||||
|
||||
case OTHER:
|
||||
return Permissions.getInstance().otherRepair(player);
|
||||
return Permissions.otherRepair(player);
|
||||
|
||||
default:
|
||||
return false;
|
||||
|
@ -23,28 +23,28 @@ public enum RepairMaterialType {
|
||||
public boolean getPermissions(Player player) {
|
||||
switch (this) {
|
||||
case STRING:
|
||||
return Permissions.getInstance().stringRepair(player);
|
||||
return Permissions.stringRepair(player);
|
||||
|
||||
case LEATHER:
|
||||
return Permissions.getInstance().leatherRepair(player);
|
||||
return Permissions.leatherRepair(player);
|
||||
|
||||
case WOOD:
|
||||
return Permissions.getInstance().woodRepair(player);
|
||||
return Permissions.woodRepair(player);
|
||||
|
||||
case STONE:
|
||||
return Permissions.getInstance().stoneRepair(player);
|
||||
return Permissions.stoneRepair(player);
|
||||
|
||||
case IRON:
|
||||
return Permissions.getInstance().ironRepair(player);
|
||||
return Permissions.ironRepair(player);
|
||||
|
||||
case GOLD:
|
||||
return Permissions.getInstance().goldRepair(player);
|
||||
return Permissions.goldRepair(player);
|
||||
|
||||
case DIAMOND:
|
||||
return Permissions.getInstance().diamondRepair(player);
|
||||
return Permissions.diamondRepair(player);
|
||||
|
||||
case OTHER:
|
||||
return Permissions.getInstance().otherMaterialRepair(player);
|
||||
return Permissions.otherMaterialRepair(player);
|
||||
|
||||
default:
|
||||
return false;
|
||||
|
@ -21,10 +21,9 @@ import com.gmail.nossr50.util.Users;
|
||||
public class Salvage {
|
||||
|
||||
private static Config configInstance = Config.getInstance();
|
||||
private static Permissions permInstance = Permissions.getInstance();
|
||||
|
||||
public static void handleSalvage(final Player player, final Location location, final ItemStack inHand) {
|
||||
if (!permInstance.salvage(player) || !configInstance.getSalvageEnabled()) {
|
||||
if (!Permissions.salvage(player) || !configInstance.getSalvageEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ public class SimpleRepairManager implements RepairManager {
|
||||
}
|
||||
|
||||
// Handle the enchants
|
||||
if (Config.getInstance().getArcaneForgingEnchantLossEnabled() && !Permissions.getInstance().arcaneBypass(player)) {
|
||||
if (Config.getInstance().getArcaneForgingEnchantLossEnabled() && !Permissions.arcaneBypass(player)) {
|
||||
// Generalize away enchantment work
|
||||
Repair.addEnchants(player, item);
|
||||
}
|
||||
|
@ -14,13 +14,11 @@ public class SwordsManager {
|
||||
private Player player;
|
||||
private PlayerProfile profile;
|
||||
private int skillLevel;
|
||||
private Permissions permissionsInstance;
|
||||
|
||||
public SwordsManager (Player player) {
|
||||
this.player = player;
|
||||
this.profile = Users.getProfile(player);
|
||||
this.skillLevel = profile.getSkillLevel(SkillType.SWORDS);
|
||||
this.permissionsInstance = Permissions.getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -32,10 +30,7 @@ public class SwordsManager {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if(permissionsInstance == null)
|
||||
return;
|
||||
|
||||
if (!permissionsInstance.swordsBleed(player)) {
|
||||
if (!Permissions.swordsBleed(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -46,7 +41,7 @@ public class SwordsManager {
|
||||
int bleedMaxLevel = AdvancedConfig.getInstance().getBleedMaxBonusLevel();
|
||||
int randomChance = 100;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.swords")) {
|
||||
if (Permissions.luckySwords(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
@ -62,10 +57,7 @@ public class SwordsManager {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if(permissionsInstance == null)
|
||||
return;
|
||||
|
||||
if (!permissionsInstance.counterAttack(player)) {
|
||||
if (!Permissions.counterAttack(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -77,7 +69,7 @@ public class SwordsManager {
|
||||
int counterMaxLevel = AdvancedConfig.getInstance().getCounterMaxBonusLevel();
|
||||
int randomChance = 100;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.swords")) {
|
||||
if (Permissions.luckySwords(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
@ -93,10 +85,7 @@ public class SwordsManager {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if(permissionsInstance == null)
|
||||
return;
|
||||
|
||||
if (!permissionsInstance.serratedStrikes(player)) {
|
||||
if (!Permissions.serratedStrikes(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -19,14 +19,12 @@ public class TamingManager {
|
||||
private Player player;
|
||||
private PlayerProfile profile;
|
||||
private int skillLevel;
|
||||
private Permissions permissionsInstance;
|
||||
private Config configInstance;
|
||||
|
||||
public TamingManager (Player player) {
|
||||
this.player = player;
|
||||
this.profile = Users.getProfile(player);
|
||||
this.skillLevel = profile.getSkillLevel(SkillType.TAMING);
|
||||
this.permissionsInstance = Permissions.getInstance();
|
||||
this.configInstance = Config.getInstance();
|
||||
}
|
||||
|
||||
@ -40,17 +38,14 @@ public class TamingManager {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if(permissionsInstance == null)
|
||||
return;
|
||||
|
||||
if (!permissionsInstance.fastFoodService(player)) {
|
||||
if (!Permissions.fastFoodService(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (skillLevel >= Taming.FAST_FOOD_SERVICE_ACTIVATION_LEVEL) {
|
||||
int randomChance = 100;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.taming")) {
|
||||
if (Permissions.luckyTaming(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
@ -71,10 +66,7 @@ public class TamingManager {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if(permissionsInstance == null)
|
||||
return;
|
||||
|
||||
if (!permissionsInstance.sharpenedClaws(player)) {
|
||||
if (!Permissions.sharpenedClaws(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -94,10 +86,7 @@ public class TamingManager {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if(permissionsInstance == null)
|
||||
return;
|
||||
|
||||
if (!permissionsInstance.gore(player)) {
|
||||
if (!Permissions.gore(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -107,7 +96,7 @@ public class TamingManager {
|
||||
int goreMaxLevel = AdvancedConfig.getInstance().getGoreMaxBonusLevel();
|
||||
int randomChance = 100;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.taming")) {
|
||||
if (Permissions.luckyTaming(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
@ -175,10 +164,7 @@ public class TamingManager {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if(permissionsInstance == null)
|
||||
return;
|
||||
|
||||
if (!permissionsInstance.beastLore(player)) {
|
||||
if (!Permissions.beastLore(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -197,10 +183,7 @@ public class TamingManager {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if(permissionsInstance == null)
|
||||
return;
|
||||
|
||||
if (!permissionsInstance.callOfTheWild(player)) {
|
||||
if (!Permissions.callOfTheWild(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -235,10 +218,7 @@ public class TamingManager {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if(permissionsInstance == null)
|
||||
return;
|
||||
|
||||
if (!permissionsInstance.environmentallyAware(player)) {
|
||||
if (!Permissions.environmentallyAware(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -273,10 +253,7 @@ public class TamingManager {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if(permissionsInstance == null)
|
||||
return;
|
||||
|
||||
if (!permissionsInstance.thickFur(player)) {
|
||||
if (!Permissions.thickFur(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -296,10 +273,7 @@ public class TamingManager {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if(permissionsInstance == null)
|
||||
return;
|
||||
|
||||
if (!permissionsInstance.shockProof(player)) {
|
||||
if (!Permissions.shockProof(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -13,13 +13,11 @@ public class UnarmedManager {
|
||||
private Player player;
|
||||
private PlayerProfile profile;
|
||||
private int skillLevel;
|
||||
private Permissions permissionsInstance;
|
||||
|
||||
public UnarmedManager (Player player) {
|
||||
this.player = player;
|
||||
this.profile = Users.getProfile(player);
|
||||
this.skillLevel = profile.getSkillLevel(SkillType.UNARMED);
|
||||
this.permissionsInstance = Permissions.getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -31,10 +29,7 @@ public class UnarmedManager {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if(permissionsInstance == null)
|
||||
return;
|
||||
|
||||
if (!permissionsInstance.disarm(player)) {
|
||||
if (!Permissions.disarm(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -47,7 +42,7 @@ public class UnarmedManager {
|
||||
int disarmMaxLevel = AdvancedConfig.getInstance().getDisarmMaxBonusLevel();
|
||||
int randomChance = 100;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.unarmed")) {
|
||||
if (Permissions.luckyUnarmed(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
@ -71,10 +66,7 @@ public class UnarmedManager {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if(permissionsInstance == null)
|
||||
return;
|
||||
|
||||
if (!permissionsInstance.deflect(player)) {
|
||||
if (!Permissions.deflect(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -84,7 +76,7 @@ public class UnarmedManager {
|
||||
int deflectMaxLevel = AdvancedConfig.getInstance().getDeflectMaxBonusLevel();
|
||||
int randomChance = 100;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.unarmed")) {
|
||||
if (Permissions.luckyUnarmed(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
@ -104,10 +96,7 @@ public class UnarmedManager {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if(permissionsInstance == null)
|
||||
return;
|
||||
|
||||
if (!permissionsInstance.unarmedBonus(player)) {
|
||||
if (!Permissions.unarmedBonus(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -127,10 +116,7 @@ public class UnarmedManager {
|
||||
if(defender == null)
|
||||
return false;
|
||||
|
||||
if(permissionsInstance == null)
|
||||
return false;
|
||||
|
||||
if (!permissionsInstance.ironGrip(defender)) {
|
||||
if (!Permissions.ironGrip(defender)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -140,7 +126,7 @@ public class UnarmedManager {
|
||||
int ironGripMaxLevel = AdvancedConfig.getInstance().getIronGripMaxBonusLevel();
|
||||
int randomChance = 100;
|
||||
|
||||
if (defender.hasPermission("mcmmo.perks.lucky.unarmed")) {
|
||||
if (Permissions.luckyUnarmed(defender)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user