mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-10-31 01:03:44 +01:00 
			
		
		
		
	Config overhaul part 7
This commit is contained in:
		| @@ -21,7 +21,7 @@ public class Item { | |||||||
|     public static void itemchecks(Player player) { |     public static void itemchecks(Player player) { | ||||||
|         ItemStack inhand = player.getItemInHand(); |         ItemStack inhand = player.getItemInHand(); | ||||||
|  |  | ||||||
|         if (Config.chimaeraWingEnable && inhand.getTypeId() == Config.chimaeraId) { |         if (Config.getChimaeraEnabled() && inhand.getTypeId() == Config.getChimaeraItemId()) { | ||||||
|             chimaerawing(player); |             chimaerawing(player); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| @@ -32,9 +32,9 @@ public class Item { | |||||||
|         Block block = player.getLocation().getBlock(); |         Block block = player.getLocation().getBlock(); | ||||||
|         int amount = is.getAmount(); |         int amount = is.getAmount(); | ||||||
|  |  | ||||||
|         if (mcPermissions.getInstance().chimaeraWing(player) && is.getTypeId() == Config.chimaeraId) { |         if (mcPermissions.getInstance().chimaeraWing(player) && is.getTypeId() == Config.getChimaeraItemId()) { | ||||||
|             if (Skills.cooldownOver(PP.getRecentlyHurt(), 60) && amount >= Config.feathersConsumedByChimaeraWing) { |             if (Skills.cooldownOver(PP.getRecentlyHurt(), 60) && amount >= Config.getChimaeraCost()) { | ||||||
|                 player.setItemInHand(new ItemStack(Config.chimaeraId, amount - Config.feathersConsumedByChimaeraWing)); |                 player.setItemInHand(new ItemStack(Config.getChimaeraItemId(), amount - Config.getChimaeraCost())); | ||||||
|  |  | ||||||
|                 for (int y = 0; block.getY() + y < player.getWorld().getMaxHeight(); y++) { |                 for (int y = 0; block.getY() + y < player.getWorld().getMaxHeight(); y++) { | ||||||
|                     if (!block.getRelative(0, y, 0).getType().equals(Material.AIR)) { |                     if (!block.getRelative(0, y, 0).getType().equals(Material.AIR)) { | ||||||
| @@ -53,11 +53,11 @@ public class Item { | |||||||
|  |  | ||||||
|                 player.sendMessage(mcLocale.getString("Item.ChimaeraWing.Pass")); |                 player.sendMessage(mcLocale.getString("Item.ChimaeraWing.Pass")); | ||||||
|             } |             } | ||||||
|             else if (!Skills.cooldownOver(PP.getRecentlyHurt(), 60) && is.getAmount() >= Config.feathersConsumedByChimaeraWing) { |             else if (!Skills.cooldownOver(PP.getRecentlyHurt(), 60) && is.getAmount() >= Config.getChimaeraCost()) { | ||||||
|                 player.sendMessage(mcLocale.getString("Item.Injured.Wait", new Object[] {Skills.calculateTimeLeft(PP.getRecentlyHurt(), 60)})); |                 player.sendMessage(mcLocale.getString("Item.Injured.Wait", new Object[] {Skills.calculateTimeLeft(PP.getRecentlyHurt(), 60)})); | ||||||
|             } |             } | ||||||
|             else if (is.getAmount() <= Config.feathersConsumedByChimaeraWing) { |             else if (is.getAmount() <= Config.getChimaeraCost()) { | ||||||
|                 player.sendMessage(mcLocale.getString("Skills.NeedMore")+ " " + ChatColor.GRAY + m.prettyItemString(Config.chimaeraId)); |                 player.sendMessage(mcLocale.getString("Skills.NeedMore")+ " " + ChatColor.GRAY + m.prettyItemString(Config.getChimaeraItemId())); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -56,24 +56,32 @@ public class Config extends ConfigLoader{ | |||||||
|     public static Boolean donateMessage; |     public static Boolean donateMessage; | ||||||
|  |  | ||||||
|     /* Items */ |     /* Items */ | ||||||
|     public static Boolean chimaeraWingEnable; |     public static int getChimaeraCost() { return config.getInt("Items.Chimaera_Wing.Feather_Cost", 10); } | ||||||
|     public static int chimaeraId, feathersConsumedByChimaeraWing; |     public static int getChimaeraItemId() { return config.getInt("Items.Chimaera_Wing.Item_ID", 288); } | ||||||
|  |     public static boolean getChimaeraEnabled() { return config.getBoolean("Items.Chimaera_Wing.Enabled", true); } | ||||||
|  |  | ||||||
|     /* |     /* | ||||||
|      * ABILITY SETTINGS |      * ABILITY SETTINGS | ||||||
|      */ |      */ | ||||||
|  |  | ||||||
|     /* General Settings */ |     /* General Settings */ | ||||||
|     public static Boolean enableOnlyActivateWhenSneaking, enableAbilityMessages, enableAbilities; |     public static boolean getAbilityMessagesEnabled() { return config.getBoolean("Abilities.Messages", true); } | ||||||
|  |     public static boolean getAbilitiesEnabled() { return config.getBoolean("Abilities.Enabled", true); } | ||||||
|  |     public static boolean getAbilitiesOnlyActivateWhenSneaking() { return config.getBoolean("Abilities.Activation.Only_Activate_When_Sneaking", false); } | ||||||
|  |  | ||||||
|     /* Durability Settings */ |     /* Durability Settings */ | ||||||
|     public static Boolean toolsLoseDurabilityFromAbilities; |     public static boolean getAbilitiesDamageTools() { return config.getBoolean("Abilities.Tools.Durability_Loss_Enabled", true); } | ||||||
|     public static int abilityDurabilityLoss; |     public static int getAbilityToolDamage() { return config.getInt("Abilities.Tools.Durability_Loss", 2); } | ||||||
|  |  | ||||||
|     /* Cooldowns */ |     /* Cooldowns */ | ||||||
|     public static int superBreakerCooldown, blastMiningCooldown, greenTerraCooldown, |     public static int getAbilityCooldownGreenTerra() { return config.getInt("Abilities.Cooldowns.Green_Terra", 240); } | ||||||
|                       gigaDrillBreakerCooldown, treeFellerCooldown, berserkCooldown, |     public static int getAbilityCooldownSuperBreaker() { return config.getInt("Abilities.Cooldowns.Super_Breaker", 240); } | ||||||
|                       serratedStrikeCooldown, skullSplitterCooldown; |     public static int getAbilityCooldownGigaDrillBreaker() { return config.getInt("Abilities.Cooldowns.Giga_Drill_Breaker", 240); } | ||||||
|  |     public static int getAbilityCooldownTreeFeller() { return config.getInt("Abilities.Cooldowns.Tree_Feller", 240); } | ||||||
|  |     public static int getAbilityCooldownBerserk() { return config.getInt("Abilities.Cooldowns.Berserk", 240); } | ||||||
|  |     public static int getAbilityCooldownSerratedStrikes() { return config.getInt("Abilities.Cooldowns.Serrated_Strikes", 240); } | ||||||
|  |     public static int getAbilityCooldownSkullSplitter() { return config.getInt("Abilities.Cooldowns.Skull_Splitter", 240); } | ||||||
|  |     public static int getAbilityCooldownBlastMining() { return config.getInt("Abilities.Cooldowns.Blast_Mining", 60); } | ||||||
|  |  | ||||||
|     /* Thresholds */ |     /* Thresholds */ | ||||||
|     public static int getTreeFellerThreshold() { return config.getInt("Abilities.Limits.Tree_Feller_Threshold", 500); } |     public static int getTreeFellerThreshold() { return config.getInt("Abilities.Limits.Tree_Feller_Threshold", 500); } | ||||||
| @@ -83,7 +91,9 @@ public class Config extends ConfigLoader{ | |||||||
|      */ |      */ | ||||||
|  |  | ||||||
|     /* Tool Requirements */ |     /* Tool Requirements */ | ||||||
|     public static Boolean miningrequirespickaxe, excavationRequiresShovel, woodcuttingrequiresaxe; |     public static boolean getMiningRequiresTool() { return config.getBoolean("Skills.Mining.Requires_Pickaxe", true); } | ||||||
|  |     public static boolean getExcavationRequiresTool() { return config.getBoolean("Skills.Excavation.Requires_Shovel", true); } | ||||||
|  |     public static boolean getWoodcuttingRequiresTool() { return config.getBoolean("Skills.Woodcutting.Requires_Axe", true); } | ||||||
|  |  | ||||||
|     /* Excavation */ |     /* Excavation */ | ||||||
|     public static int getExcavationBaseXP() { return config.getInt("Experience.Excavation.Base", 40); } |     public static int getExcavationBaseXP() { return config.getInt("Experience.Excavation.Base", 40); } | ||||||
| @@ -307,9 +317,6 @@ public class Config extends ConfigLoader{ | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         enableAbilityMessages = config.getBoolean("Abilities.Messages", true); |  | ||||||
|         enableAbilities = config.getBoolean("Abilities.Enabled", true); |  | ||||||
|  |  | ||||||
|         donateMessage = config.getBoolean("Commands.mcmmo.Donate_Message", true); |         donateMessage = config.getBoolean("Commands.mcmmo.Donate_Message", true); | ||||||
|         xpGainsMobSpawners = config.getBoolean("Experience.Gains.Mobspawners.Enabled", false); |         xpGainsMobSpawners = config.getBoolean("Experience.Gains.Mobspawners.Enabled", false); | ||||||
|          |          | ||||||
| @@ -324,17 +331,6 @@ public class Config extends ConfigLoader{ | |||||||
|         showDisplayName = config.getBoolean("Spout.Party.HUD.Show_Display_Name", false); |         showDisplayName = config.getBoolean("Spout.Party.HUD.Show_Display_Name", false); | ||||||
|         partybar = config.getBoolean("Spout.Party.HUD.Enabled", true); |         partybar = config.getBoolean("Spout.Party.HUD.Enabled", true); | ||||||
|  |  | ||||||
|         enableOnlyActivateWhenSneaking = config.getBoolean("Abilities.Activation.Only_Activate_When_Sneaking", false); |  | ||||||
|  |  | ||||||
|         greenTerraCooldown = config.getInt("Abilities.Cooldowns.Green_Terra", 240); |  | ||||||
|         superBreakerCooldown = config.getInt("Abilities.Cooldowns.Super_Breaker", 240); |  | ||||||
|         gigaDrillBreakerCooldown = config.getInt("Abilities.Cooldowns.Giga_Drill_Breaker", 240); |  | ||||||
|         treeFellerCooldown = config.getInt("Abilities.Cooldowns.Tree_Feller", 240); |  | ||||||
|         berserkCooldown = config.getInt("Abilities.Cooldowns.Berserk", 240); |  | ||||||
|         serratedStrikeCooldown = config.getInt("Abilities.Cooldowns.Serrated_Strikes", 240); |  | ||||||
|         skullSplitterCooldown = config.getInt("Abilities.Cooldowns.Skull_Splitter", 240); |  | ||||||
|         blastMiningCooldown = config.getInt("Abilities.Cooldowns.Blast_Mining", 60); |  | ||||||
|  |  | ||||||
|         locale = config.getString("General.Locale", "en_us"); |         locale = config.getString("General.Locale", "en_us"); | ||||||
|         enableMotd = config.getBoolean("General.MOTD_Enabled", true); |         enableMotd = config.getBoolean("General.MOTD_Enabled", true); | ||||||
|         saveInterval = config.getInt("General.Save_Interval", 10); |         saveInterval = config.getInt("General.Save_Interval", 10); | ||||||
| @@ -346,18 +342,11 @@ public class Config extends ConfigLoader{ | |||||||
|         enableDirtToGrass = config.getBoolean("Skills.Herbalism.Green_Thumb.Dirt_To_Grass", true); |         enableDirtToGrass = config.getBoolean("Skills.Herbalism.Green_Thumb.Dirt_To_Grass", true); | ||||||
|  |  | ||||||
|         xpGainMultiplier = config.getInt("Experience.Gains.Multiplier.Global", 1); |         xpGainMultiplier = config.getInt("Experience.Gains.Multiplier.Global", 1); | ||||||
|         toolsLoseDurabilityFromAbilities = config.getBoolean("Abilities.Tools.Durability_Loss_Enabled", true); |  | ||||||
|         abilityDurabilityLoss = config.getInt("Abilities.Tools.Durability_Loss", 2); |  | ||||||
|          |          | ||||||
|         feathersConsumedByChimaeraWing = config.getInt("Items.Chimaera_Wing.Feather_Cost", 10); |  | ||||||
|         chimaeraId = config.getInt("Items.Chimaera_Wing.Item_ID", 288); |  | ||||||
|         chimaeraWingEnable = config.getBoolean("Items.Chimaera_Wing.Enabled", true); |  | ||||||
|          |          | ||||||
|         pvpxp = config.getBoolean("Experience.PVP.Rewards", true); |         pvpxp = config.getBoolean("Experience.PVP.Rewards", true); | ||||||
|  |  | ||||||
|         miningrequirespickaxe = config.getBoolean("Skills.Mining.Requires_Pickaxe", true); |          | ||||||
|         excavationRequiresShovel = config.getBoolean("Skills.Excavation.Requires_Shovel", true); |  | ||||||
|         woodcuttingrequiresaxe = config.getBoolean("Skills.Woodcutting.Requires_Axe", true); |  | ||||||
|         repairArmor = config.getBoolean("Skills.Repair.Can_Repair_Armor", true); |         repairArmor = config.getBoolean("Skills.Repair.Can_Repair_Armor", true); | ||||||
|         repairTools = config.getBoolean("Skills.Repair.Can_Repair_Tools", true); |         repairTools = config.getBoolean("Skills.Repair.Can_Repair_Tools", true); | ||||||
|         repairDiamondLevel = config.getInt("Skills.Repair.Diamond.Level_Required", 50); |         repairDiamondLevel = config.getInt("Skills.Repair.Diamond.Level_Required", 50); | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ import com.gmail.nossr50.skills.Mining; | |||||||
|  |  | ||||||
| public enum AbilityType { | public enum AbilityType { | ||||||
|     BERSERK( |     BERSERK( | ||||||
|             Config.berserkCooldown, |             Config.getAbilityCooldownBerserk(), | ||||||
|             "Unarmed.Skills.Berserk.On", |             "Unarmed.Skills.Berserk.On", | ||||||
|             "Unarmed.Skills.Berserk.Off", |             "Unarmed.Skills.Berserk.Off", | ||||||
|             "Unarmed.Skills.Berserk.Other.On", |             "Unarmed.Skills.Berserk.Other.On", | ||||||
| @@ -20,7 +20,7 @@ public enum AbilityType { | |||||||
|             "Unarmed.Skills.Berserk.Other.Off"), |             "Unarmed.Skills.Berserk.Other.Off"), | ||||||
|  |  | ||||||
|     SUPER_BREAKER( |     SUPER_BREAKER( | ||||||
|             Config.superBreakerCooldown, |             Config.getAbilityCooldownSuperBreaker(), | ||||||
|             "Mining.Skills.SuperBreaker.On", |             "Mining.Skills.SuperBreaker.On", | ||||||
|             "Mining.Skills.SuperBreaker.Off", |             "Mining.Skills.SuperBreaker.Off", | ||||||
|             "Mining.Skills.SuperBreaker.Other.On", |             "Mining.Skills.SuperBreaker.Other.On", | ||||||
| @@ -28,7 +28,7 @@ public enum AbilityType { | |||||||
|             "Mining.Skills.SuperBreaker.Other.Off"), |             "Mining.Skills.SuperBreaker.Other.Off"), | ||||||
|  |  | ||||||
|     GIGA_DRILL_BREAKER( |     GIGA_DRILL_BREAKER( | ||||||
|             Config.gigaDrillBreakerCooldown, |             Config.getAbilityCooldownGigaDrillBreaker(), | ||||||
|             "Excavation.Skills.GigaDrillBreaker.On", |             "Excavation.Skills.GigaDrillBreaker.On", | ||||||
|             "Excavation.Skills.GigaDrillBreaker.Off", |             "Excavation.Skills.GigaDrillBreaker.Off", | ||||||
|             "Excavation.Skills.GigaDrillBreaker.Other.On", |             "Excavation.Skills.GigaDrillBreaker.Other.On", | ||||||
| @@ -36,7 +36,7 @@ public enum AbilityType { | |||||||
|             "Excavation.Skills.GigaDrillBreaker.Other.Off"), |             "Excavation.Skills.GigaDrillBreaker.Other.Off"), | ||||||
|  |  | ||||||
|     GREEN_TERRA( |     GREEN_TERRA( | ||||||
|             Config.greenTerraCooldown, |             Config.getAbilityCooldownGreenTerra(), | ||||||
|             "Herbalism.Skills.GTe.On", |             "Herbalism.Skills.GTe.On", | ||||||
|             "Herbalism.Skills.GTe.Off", |             "Herbalism.Skills.GTe.Off", | ||||||
|             "Herbalism.Skills.GTe.Other.On", |             "Herbalism.Skills.GTe.Other.On", | ||||||
| @@ -44,7 +44,7 @@ public enum AbilityType { | |||||||
|             "Herbalism.Skills.GTe.Other.Off"), |             "Herbalism.Skills.GTe.Other.Off"), | ||||||
|  |  | ||||||
|     SKULL_SPLIITER( |     SKULL_SPLIITER( | ||||||
|             Config.skullSplitterCooldown, |             Config.getAbilityCooldownSkullSplitter(), | ||||||
|             "Axes.Skills.SS.On", |             "Axes.Skills.SS.On", | ||||||
|             "Axes.Skills.SS.Off", |             "Axes.Skills.SS.Off", | ||||||
|             "Axes.Skills.SS.Other.On", |             "Axes.Skills.SS.Other.On", | ||||||
| @@ -52,7 +52,7 @@ public enum AbilityType { | |||||||
|             "Axes.Skills.SS.Other.Off"), |             "Axes.Skills.SS.Other.Off"), | ||||||
|  |  | ||||||
|     TREE_FELLER( |     TREE_FELLER( | ||||||
|             Config.treeFellerCooldown, |             Config.getAbilityCooldownTreeFeller(), | ||||||
|             "Woodcutting.Skills.TreeFeller.On", |             "Woodcutting.Skills.TreeFeller.On", | ||||||
|             "Woodcutting.Skills.TreeFeller.Off", |             "Woodcutting.Skills.TreeFeller.Off", | ||||||
|             "Woodcutting.Skills.TreeFeller.Other.On", |             "Woodcutting.Skills.TreeFeller.Other.On", | ||||||
| @@ -60,7 +60,7 @@ public enum AbilityType { | |||||||
|             "Woodcutting.Skills.TreeFeller.Other.Off"), |             "Woodcutting.Skills.TreeFeller.Other.Off"), | ||||||
|  |  | ||||||
|     SERRATED_STRIKES( |     SERRATED_STRIKES( | ||||||
|             Config.serratedStrikeCooldown, |             Config.getAbilityCooldownSerratedStrikes(), | ||||||
|             "Swords.Skills.SS.On", |             "Swords.Skills.SS.On", | ||||||
|             "Swords.Skills.SS.Off", |             "Swords.Skills.SS.Off", | ||||||
|             "Swords.Skills.SS.Other.On", |             "Swords.Skills.SS.Other.On", | ||||||
| @@ -68,7 +68,7 @@ public enum AbilityType { | |||||||
|             "Swords.Skills.SS.Other.Off"), |             "Swords.Skills.SS.Other.Off"), | ||||||
|  |  | ||||||
|     BLAST_MINING( |     BLAST_MINING( | ||||||
|             Config.blastMiningCooldown, |             Config.getAbilityCooldownBlastMining(), | ||||||
|             null, |             null, | ||||||
|             null, |             null, | ||||||
|             "Mining.Blast.Other.On", |             "Mining.Blast.Other.On", | ||||||
|   | |||||||
| @@ -163,10 +163,10 @@ public class BlockListener implements Listener { | |||||||
|          */ |          */ | ||||||
|  |  | ||||||
|         if (mcPermissions.getInstance().mining(player) && Mining.canBeSuperBroken(mat)) { |         if (mcPermissions.getInstance().mining(player) && Mining.canBeSuperBroken(mat)) { | ||||||
|             if (Config.miningrequirespickaxe && ItemChecks.isMiningPick(inhand)) { |             if (Config.getMiningRequiresTool() && ItemChecks.isMiningPick(inhand)) { | ||||||
|                 Mining.miningBlockCheck(player, block); |                 Mining.miningBlockCheck(player, block); | ||||||
|             } |             } | ||||||
|             else if (!Config.miningrequirespickaxe) { |             else if (!Config.getMiningRequiresTool()) { | ||||||
|                 Mining.miningBlockCheck(player, block); |                 Mining.miningBlockCheck(player, block); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| @@ -176,10 +176,10 @@ public class BlockListener implements Listener { | |||||||
|          */ |          */ | ||||||
|  |  | ||||||
|         if (mcPermissions.getInstance().woodcutting(player) && mat.equals(Material.LOG)) { |         if (mcPermissions.getInstance().woodcutting(player) && mat.equals(Material.LOG)) { | ||||||
|             if (Config.woodcuttingrequiresaxe && ItemChecks.isAxe(inhand)) { |             if (Config.getWoodcuttingRequiresTool() && ItemChecks.isAxe(inhand)) { | ||||||
|                 WoodCutting.woodcuttingBlockCheck(player, block); |                 WoodCutting.woodcuttingBlockCheck(player, block); | ||||||
|             } |             } | ||||||
|             else if (!Config.woodcuttingrequiresaxe) { |             else if (!Config.getWoodcuttingRequiresTool()) { | ||||||
|                 WoodCutting.woodcuttingBlockCheck(player, block); |                 WoodCutting.woodcuttingBlockCheck(player, block); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| @@ -193,10 +193,10 @@ public class BlockListener implements Listener { | |||||||
|          */ |          */ | ||||||
|  |  | ||||||
|         if (Excavation.canBeGigaDrillBroken(mat) && mcPermissions.getInstance().excavation(player) && !block.hasMetadata("mcmmoPlacedBlock")) { |         if (Excavation.canBeGigaDrillBroken(mat) && mcPermissions.getInstance().excavation(player) && !block.hasMetadata("mcmmoPlacedBlock")) { | ||||||
|             if (Config.excavationRequiresShovel && ItemChecks.isShovel(inhand)) { |             if (Config.getExcavationRequiresTool() && ItemChecks.isShovel(inhand)) { | ||||||
|                 Excavation.excavationProcCheck(block, player); |                 Excavation.excavationProcCheck(block, player); | ||||||
|             } |             } | ||||||
|             else if (!Config.excavationRequiresShovel) { |             else if (!Config.getExcavationRequiresTool()) { | ||||||
|                 Excavation.excavationProcCheck(block, player); |                 Excavation.excavationProcCheck(block, player); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| @@ -255,11 +255,11 @@ public class BlockListener implements Listener { | |||||||
|             Herbalism.greenTerra(player, block); |             Herbalism.greenTerra(player, block); | ||||||
|         } |         } | ||||||
|         else if (PP.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER) && Skills.triggerCheck(player, block, AbilityType.GIGA_DRILL_BREAKER)) { |         else if (PP.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER) && Skills.triggerCheck(player, block, AbilityType.GIGA_DRILL_BREAKER)) { | ||||||
|             if (Config.excavationRequiresShovel && ItemChecks.isShovel(inhand)) { |             if (Config.getExcavationRequiresTool() && ItemChecks.isShovel(inhand)) { | ||||||
|                 event.setInstaBreak(true); |                 event.setInstaBreak(true); | ||||||
|                 Excavation.gigaDrillBreaker(player, block); |                 Excavation.gigaDrillBreaker(player, block); | ||||||
|             } |             } | ||||||
|             else if (!Config.excavationRequiresShovel) { |             else if (!Config.getExcavationRequiresTool()) { | ||||||
|                 event.setInstaBreak(true); |                 event.setInstaBreak(true); | ||||||
|                 Excavation.gigaDrillBreaker(player, block); |                 Excavation.gigaDrillBreaker(player, block); | ||||||
|             } |             } | ||||||
| @@ -277,23 +277,23 @@ public class BlockListener implements Listener { | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         else if (PP.getAbilityMode(AbilityType.SUPER_BREAKER) && Skills.triggerCheck(player, block, AbilityType.SUPER_BREAKER)) { |         else if (PP.getAbilityMode(AbilityType.SUPER_BREAKER) && Skills.triggerCheck(player, block, AbilityType.SUPER_BREAKER)) { | ||||||
|             if (Config.miningrequirespickaxe && ItemChecks.isMiningPick(inhand)) { |             if (Config.getMiningRequiresTool() && ItemChecks.isMiningPick(inhand)) { | ||||||
|                 event.setInstaBreak(true); |                 event.setInstaBreak(true); | ||||||
|                 Mining.SuperBreakerBlockCheck(player, block); |                 Mining.SuperBreakerBlockCheck(player, block); | ||||||
|             } |             } | ||||||
|             else if (!Config.miningrequirespickaxe) { |             else if (!Config.getMiningRequiresTool()) { | ||||||
|                 event.setInstaBreak(true); |                 event.setInstaBreak(true); | ||||||
|                 Mining.SuperBreakerBlockCheck(player, block); |                 Mining.SuperBreakerBlockCheck(player, block); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         else if (PP.getSkillLevel(SkillType.WOODCUTTING) >= LEAF_BLOWER_LEVEL && mat.equals(Material.LEAVES)) { |         else if (PP.getSkillLevel(SkillType.WOODCUTTING) >= LEAF_BLOWER_LEVEL && mat.equals(Material.LEAVES)) { | ||||||
|             if (Config.woodcuttingrequiresaxe && ItemChecks.isAxe(inhand)) { |             if (Config.getWoodcuttingRequiresTool() && ItemChecks.isAxe(inhand)) { | ||||||
|                 if (Skills.triggerCheck(player, block, AbilityType.LEAF_BLOWER)) { |                 if (Skills.triggerCheck(player, block, AbilityType.LEAF_BLOWER)) { | ||||||
|                     event.setInstaBreak(true); |                     event.setInstaBreak(true); | ||||||
|                     WoodCutting.leafBlower(player, block); |                     WoodCutting.leafBlower(player, block); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             else if (!Config.woodcuttingrequiresaxe && !inhand.getType().equals(Material.SHEARS)) { |             else if (!Config.getWoodcuttingRequiresTool() && !inhand.getType().equals(Material.SHEARS)) { | ||||||
|                 if (Skills.triggerCheck(player, block, AbilityType.LEAF_BLOWER)) { |                 if (Skills.triggerCheck(player, block, AbilityType.LEAF_BLOWER)) { | ||||||
|                     event.setInstaBreak(true); |                     event.setInstaBreak(true); | ||||||
|                     WoodCutting.leafBlower(player, block); |                     WoodCutting.leafBlower(player, block); | ||||||
|   | |||||||
| @@ -211,7 +211,7 @@ public class PlayerListener implements Listener { | |||||||
|             } |             } | ||||||
|  |  | ||||||
|             /* ACTIVATION CHECKS */ |             /* ACTIVATION CHECKS */ | ||||||
|             if (Config.enableAbilities && BlockChecks.abilityBlockCheck(mat)) { |             if (Config.getAbilitiesEnabled() && BlockChecks.abilityBlockCheck(mat)) { | ||||||
|                 if (!mat.equals(Material.DIRT) && !mat.equals(Material.GRASS) && !mat.equals(Material.SOIL)) { |                 if (!mat.equals(Material.DIRT) && !mat.equals(Material.GRASS) && !mat.equals(Material.SOIL)) { | ||||||
|                     Skills.activationCheck(player, SkillType.HERBALISM); |                     Skills.activationCheck(player, SkillType.HERBALISM); | ||||||
|                 } |                 } | ||||||
| @@ -244,7 +244,7 @@ public class PlayerListener implements Listener { | |||||||
|         case RIGHT_CLICK_AIR: |         case RIGHT_CLICK_AIR: | ||||||
|  |  | ||||||
|             /* ACTIVATION CHECKS */ |             /* ACTIVATION CHECKS */ | ||||||
|             if (Config.enableAbilities) { |             if (Config.getAbilitiesEnabled()) { | ||||||
|                 Skills.activationCheck(player, SkillType.AXES); |                 Skills.activationCheck(player, SkillType.AXES); | ||||||
|                 Skills.activationCheck(player, SkillType.EXCAVATION); |                 Skills.activationCheck(player, SkillType.EXCAVATION); | ||||||
|                 Skills.activationCheck(player, SkillType.HERBALISM); |                 Skills.activationCheck(player, SkillType.HERBALISM); | ||||||
|   | |||||||
| @@ -131,7 +131,7 @@ public class Excavation { | |||||||
|      * @param block The block to check |      * @param block The block to check | ||||||
|      */ |      */ | ||||||
|     public static void gigaDrillBreaker(Player player, Block block) { |     public static void gigaDrillBreaker(Player player, Block block) { | ||||||
|         Skills.abilityDurabilityLoss(player.getItemInHand(), Config.abilityDurabilityLoss); |         Skills.abilityDurabilityLoss(player.getItemInHand(), Config.getAbilityToolDamage()); | ||||||
|  |  | ||||||
|         if (!block.hasMetadata("mcmmoPlacedBlock")) { |         if (!block.hasMetadata("mcmmoPlacedBlock")) { | ||||||
|             FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player); |             FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player); | ||||||
|   | |||||||
| @@ -216,7 +216,7 @@ public class Mining { | |||||||
|     public static void SuperBreakerBlockCheck(Player player, Block block) { |     public static void SuperBreakerBlockCheck(Player player, Block block) { | ||||||
|         Material type = block.getType(); |         Material type = block.getType(); | ||||||
|         int tier = m.getTier(player.getItemInHand()); |         int tier = m.getTier(player.getItemInHand()); | ||||||
|         int durabilityLoss = Config.abilityDurabilityLoss; |         int durabilityLoss = Config.getAbilityToolDamage(); | ||||||
|         FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player); |         FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player); | ||||||
|  |  | ||||||
|         switch (type) { |         switch (type) { | ||||||
|   | |||||||
| @@ -80,7 +80,7 @@ public class Skills { | |||||||
|      * @param skill The skill the ability is tied to |      * @param skill The skill the ability is tied to | ||||||
|      */ |      */ | ||||||
|     public static void activationCheck(Player player, SkillType skill) { |     public static void activationCheck(Player player, SkillType skill) { | ||||||
|         if (Config.enableOnlyActivateWhenSneaking && !player.isSneaking()) { |         if (Config.getAbilitiesOnlyActivateWhenSneaking() && !player.isSneaking()) { | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|  |  | ||||||
| @@ -111,7 +111,7 @@ public class Skills { | |||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             if (Config.enableAbilityMessages) { |             if (Config.getAbilityMessagesEnabled()) { | ||||||
|                 player.sendMessage(tool.getRaiseTool()); |                 player.sendMessage(tool.getRaiseTool()); | ||||||
|             } |             } | ||||||
|  |  | ||||||
| @@ -349,7 +349,7 @@ public class Skills { | |||||||
|      * @param durabilityLoss The durability to remove from the item |      * @param durabilityLoss The durability to remove from the item | ||||||
|      */ |      */ | ||||||
|     public static void abilityDurabilityLoss(ItemStack inhand, int durabilityLoss) { |     public static void abilityDurabilityLoss(ItemStack inhand, int durabilityLoss) { | ||||||
|         if (Config.toolsLoseDurabilityFromAbilities) { |         if (Config.getAbilitiesDamageTools()) { | ||||||
|             if (!inhand.containsEnchantment(Enchantment.DURABILITY)) { |             if (!inhand.containsEnchantment(Enchantment.DURABILITY)) { | ||||||
|                 inhand.setDurability((short) (inhand.getDurability() + durabilityLoss)); |                 inhand.setDurability((short) (inhand.getDurability() + durabilityLoss)); | ||||||
|             } |             } | ||||||
|   | |||||||
| @@ -315,8 +315,8 @@ public class WoodCutting { | |||||||
|         FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player); |         FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player); | ||||||
|         mcMMO.p.getServer().getPluginManager().callEvent(armswing); |         mcMMO.p.getServer().getPluginManager().callEvent(armswing); | ||||||
|  |  | ||||||
|         if (Config.woodcuttingrequiresaxe) { |         if (Config.getWoodcuttingRequiresTool()) { | ||||||
|             Skills.abilityDurabilityLoss(player.getItemInHand(), Config.abilityDurabilityLoss); |             Skills.abilityDurabilityLoss(player.getItemInHand(), Config.getAbilityToolDamage()); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         if (Config.spoutEnabled) { |         if (Config.spoutEnabled) { | ||||||
| @@ -329,7 +329,7 @@ public class WoodCutting { | |||||||
|         for (Block x : toBeFelled) { |         for (Block x : toBeFelled) { | ||||||
|             if (x.getType().equals(Material.LOG)) { |             if (x.getType().equals(Material.LOG)) { | ||||||
|                 durabilityLoss++; |                 durabilityLoss++; | ||||||
|                 durabilityLoss = durabilityLoss + Config.abilityDurabilityLoss; |                 durabilityLoss = durabilityLoss + Config.getAbilityToolDamage(); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 nossr50
					nossr50