Changed AbilityTypes from enum to constants

This commit is contained in:
ile123ile 2014-08-24 10:41:55 -07:00
parent 3d7b6e13c9
commit 5e83632004
42 changed files with 913 additions and 225 deletions

51
bukkit/bukkit.yml Normal file
View File

@ -0,0 +1,51 @@
# This is the main configuration file for Bukkit.
# As you can see, there's actually not that much to configure without any plugins.
# For a reference for any variable inside this file, check out the bukkit wiki at
# http://wiki.bukkit.org/Bukkit.yml
#
# If you need help on this file, feel free to join us on irc or leave a message
# on the forums asking for advice.
#
# IRC: #bukkit @ esper.net
# (If this means nothing to you, just go to http://webchat.esper.net/?channels=bukkit )
# Forums: http://forums.bukkit.org/forums/bukkit-help.6/
# Twitter: http://twitter.com/Craftbukkit
# Bug tracker: http://leaky.bukkit.org/
settings:
allow-end: true
warn-on-overload: true
spawn-radius: 16
permissions-file: permissions.yml
update-folder: update
ping-packet-limit: 100
use-exact-login-location: false
plugin-profiling: false
connection-throttle: 4000
query-plugins: true
deprecated-verbose: default
spawn-limits:
monsters: 70
animals: 15
water-animals: 5
ticks-per:
animal-spawns: 400
monster-spawns: 1
auto-updater:
enabled: true
on-broken:
- warn-console
- warn-ops
on-update:
- warn-console
- warn-ops
preferred-channel: rb
host: dl.bukkit.org
suggest-channels: true
database:
username: bukkit
isolation: SERIALIZABLE
driver: org.sqlite.JDBC
password: walrus
url: jdbc:sqlite:{DIR}{NAME}.db

56
bukkit/help.yml Normal file
View File

@ -0,0 +1,56 @@
# This is the help configuration file for Bukkit.
#
# By default you do not need to modify this file. Help topics for all plugin commands are automatically provided by
# or extracted from your installed plugins. You only need to modify this file if you wish to add new help pages to
# your server or override the help pages of existing plugin commands.
#
# This file is divided up into the following parts:
# -- general-topics: lists admin defined help topics
# -- index-topics: lists admin defined index topics
# -- amend-topics: lists topic amendments to apply to existing help topics
# -- ignore-plugins: lists any plugins that should be excluded from help
#
# Examples are given below. When amending command topic, the string <text> will be replaced with the existing value
# in the help topic. Color codes can be used in topic text. The color code character is & followed by 0-F.
# ================================================================
#
# Set this to true to list the individual command help topics in the master help.
# command-topics-in-master-index: true
#
# Each general topic will show up as a separate topic in the help index along with all the plugin command topics.
# general-topics:
# Rules:
# shortText: Rules of the server
# fullText: |
# &61. Be kind to your fellow players.
# &B2. No griefing.
# &D3. No swearing.
# permission: topics.rules
#
# Each index topic will show up as a separate sub-index in the help index along with all the plugin command topics.
# To override the default help index (displayed when the user executes /help), name the index topic "Default".
# index-topics:
# Ban Commands:
# shortText: Player banning commands
# preamble: Moderator - do not abuse these commands
# permission: op
# commands:
# - /ban
# - /ban-ip
# - /banlist
#
# Topic amendments are used to change the content of automatically generated plugin command topics.
# amended-topics:
# /stop:
# shortText: Stops the server cold....in its tracks!
# fullText: <text> - This kills the server.
# permission: you.dont.have
#
# Any plugin in the ignored plugins list will be excluded from help. The name must match the name displayed by
# the /plugins command. Ignore "Bukkit" to remove the standard bukkit commands from the index. Ignore "All"
# to completely disable automatic help topic generation.
# ignore-plugins:
# - PluginNameOne
# - PluginNameTwo
# - PluginNameThree

0
bukkit/permissions.yml Normal file
View File

View File

@ -0,0 +1,584 @@
#
# Advanced configuration
# Last updated on 1.5.01-SNAPSHOT-b${BUILD_NUMBER}
#
# For advanced users only! There is no need to change anything here.
#
# You can customize almost every aspect of every skill here.
# Its mainly here if you've customized the experience formula.
# Configure at what level you get better with certain abilities.
#
#####
#
# Settings for the Skills
###
Skills:
General:
Ability:
# IncreaseLevel: This setting will determine when the length of every ability gets longer with 1 second
# EnchantBuff: This setting determines how many enchant levels to use when buffing Super Breaker & Giga Drill Breaker
IncreaseLevel: 50
EnchantBuff: 5
#
# Settings for Acrobatics
###
Acrobatics:
Dodge:
# ChanceMax: Maximum chance of dodging when on <MaxBonusLevel> or higher
# MaxBonusLevel: On this level or higher, the dodge chance will not go higher than <ChanceMax>
# DamageModifier: Dodge damage will be divided by this modifier
ChanceMax: 20.0
MaxBonusLevel: 800
DamageModifier: 2.0
Roll:
# ChanceMax: Maximum chance of rolling when on <MaxBonusLevel> or higher
# MaxBonusLevel: On this level or higher, the roll chance will not go higher than <ChanceMax>
# DamageThreshold: The max damage a player can negate with a roll
ChanceMax: 100.0
MaxBonusLevel: 1000
DamageThreshold: 7.0
GracefulRoll:
# ChanceMax: Maximum chance of graceful rolling when on <MaxBonusLevel> or higher
# MaxBonusLevel: On this level or higher, the graceful roll chance will not go higher than <ChanceMax>
# DamageThreshold: The max damage a player can negate with a graceful roll
ChanceMax: 100.0
MaxBonusLevel: 500
DamageThreshold: 14.0
#
# Settings for Alchemy
###
Alchemy:
Catalysis:
# UnlockLevel: Alchemy level when the Catalysis ability unlocks
# MaxBonusLevel: Maximum bonus level of Catalysis, when a player reaches this level his brewing speed will be <MaxSpeed>
# MinSpeed: Minimum brewing speed allowed when at <UnlockLevel> or lower
# MaxSpeed: Maximum brewing speed allowed when at <MaxBonusLevel> or higher
UnlockLevel: 100
MaxBonusLevel: 1000
MinSpeed: 1.0
MaxSpeed: 4.0
# Rank_Levels: Alchemy level where rank gets unlocked
Rank_Levels:
Rank_1: 0
Rank_2: 125
Rank_3: 250
Rank_4: 375
Rank_5: 500
Rank_6: 625
Rank_7: 750
Rank_8: 875
#
# Settings for Archery
###
Archery:
SkillShot:
# IncreaseLevel: Every <IncreaseLevel> the skillshot bonus will go up by <IncreasePercentage>
# IncreasePercentage: This is a percentage value, 0.1 = 10%
# MaxBonus: When the <MaxBonus> has been reached, the bonus percentage will not go up anymore. 2.0 = 200%
IncreaseLevel: 50
IncreasePercentage: 0.1
MaxBonus: 2.0
MaxDamage: 9.0
Daze:
# ChanceMax: Maximum chance of causing daze to opponents when on <MaxBonusLevel> or higher
# MaxBonusLevel: Maximum bonus level of Daze, when a player reaches this level his chance of causing a daze will be <ChanceMax>
# Modifier: Extra damage for arrows that cause a daze (2 damage = 1 heart)
ChanceMax: 50.0
MaxBonusLevel: 1000
Modifier: 4.0
Retrieve:
# ChanceMax: Maximum chance of retrieving arrows when on <MaxBonusLevel> or higher
# MaxBonusLevel: Maximum bonus level for Arrow retrieval, at this level the chance of retrieving arrows from mobs is <ChanceMax>
ChanceMax: 100.0
MaxBonusLevel: 1000
# ForceMultiplier: Multiply the force of the bow by this for an XP boost.
ForceMultiplier: 2.0
#
# Settings for Axes
###
Axes:
AxeMastery:
# MaxBonus: Maximum bonus damage when on <MaxBonusLevel> or higher
# MaxBonusLevel: Level where <MaxBonus> is reached
MaxBonus: 4.0
MaxBonusLevel: 200
CriticalHit:
# ChanceMax: Maximum chance of causing a critical hit when on <MaxBonusLevel> or higher
# MaxBonusLevel: Level where <ChanceMax> of causing critical hits is reached
ChanceMax: 37.50
MaxBonusLevel: 750
# Damage modifier of critical hits for PVP / PVE, when causing a critical hit the damage gets multiplied by the modifier
PVP_Modifier: 1.5
PVE_Modifier: 2.0
GreaterImpact:
# Chance: Chance of hitting with GreaterImpact, mobs are knocked backwards when successful
# KnockbackModifier: Velocity modifier of GreaterImpact hits, this determines how great the knockback is
# BonusDamage: Extra damage for GreaterImpact hits
Chance: 25.0
KnockbackModifier: 1.5
BonusDamage: 2.0
ArmorImpact:
# IncreaseLevel: Every <IncreaseLevel> the durability damage goes up with 1
# Chance: Chance of hitting with ArmorImpact
# MaxPercentageDurabilityDamage: Durability damage cap for ArmorImpact, 20% means that you can never destroy a piece of armor in less than 5 hits
IncreaseLevel: 50
Chance: 25.0
MaxPercentageDurabilityDamage: 20.0
SkullSplitter:
# DamageModifier: Damage will get divided by this modifier
DamageModifier: 2.0
#
# Settings for Fishing
###
Fishing:
# Rank_Levels: Fishing level where rank gets unlocked
Rank_Levels:
Rank_1: 0
Rank_2: 125
Rank_3: 250
Rank_4: 375
Rank_5: 500
Rank_6: 625
Rank_7: 700
Rank_8: 875
ShakeChance:
Rank_1: 15.0
Rank_2: 15.0
Rank_3: 25.0
Rank_4: 35.0
Rank_5: 45.0
Rank_6: 55.0
Rank_7: 65.0
Rank_8: 75.0
# VanillaXPMultiplier: Vanilla XP gained from fishing is multiplied by these values.
VanillaXPMultiplier:
Rank_1: 1
Rank_2: 2
Rank_3: 3
Rank_4: 3
Rank_5: 4
Rank_6: 4
Rank_7: 5
Rank_8: 5
FishermansDiet:
# This determines when Fisherman's Diet adds extra hunger recovery to food
RankChange: 200
IceFishing:
# UnlockLevel: Fishing level when the Ice Fishing ability unlocks
UnlockLevel: 50
MasterAngler:
# UnlockLevel: Fishing level when the Master Angler ability unlocks
# BoatMultiplier: Catch rate is multiplied by this modifier
# BiomeModifier: Catch rate is multiplied by this modifier
UnlockLevel: 125
BoatModifier: 2.0
BiomeModifier: 2.0
#
# Settings for Herbalism
###
Herbalism:
FarmersDiet:
# This determines when Farmers Diet adds extra hunger recovery to food
RankChange: 200
GreenThumb:
# StageChange: Level value when the GreenThumb stage rank goes up
# ChanceMax: Maximum chance of GreenThumb when on <MaxBonusLevel> or higher
# MaxBonusLevel: On this level, GreenThumb chance will be <ChanceMax>
StageChange: 200
ChanceMax: 100.0
MaxBonusLevel: 1500
DoubleDrops:
# ChanceMax: Maximum chance of receiving double drops when on <MaxBonusLevel> or higher
# MaxBonusLevel: Level when <ChanceMax> of receiving double drops is reached
ChanceMax: 100.0
MaxBonusLevel: 1000
HylianLuck:
# ChanceMax: Maximum chance of Hylian Luck when on <MaxBonusLevel> or higher
# MaxBonusLevel: On this level, Hylian Luck chance will be <ChanceMax>
ChanceMax: 10.0
MaxBonusLevel: 1000
ShroomThumb:
# ChanceMax: Maximum chance of ShroomThumb when on <MaxBonusLevel> or higher
# MaxBonusLevel: On this level, ShroomThumb chance will be <ChanceMax>
ChanceMax: 50.0
MaxBonusLevel: 1500
#
# Settings for Mining
###
Mining:
DoubleDrops:
# ChanceMax: Maximum chance of receiving double drops when on <MaxBonusLevel> or higher
# MaxBonusLevel: Level when <ChanceMax> of receiving double drops is reached
ChanceMax: 100.0
MaxBonusLevel: 1000
# BlastMining_Rank: BlastMining rank unlocks
BlastMining:
Rank_Levels:
Rank_1: 125
Rank_2: 250
Rank_3: 375
Rank_4: 500
Rank_5: 625
Rank_6: 750
Rank_7: 875
Rank_8: 1000
# BlastDamageDecrease Ranks: % of damage reduced from TNT explosions
BlastDamageDecrease:
Rank_1: 0.0
Rank_2: 0.0
Rank_3: 0.0
Rank_4: 25.0
Rank_5: 25.0
Rank_6: 50.0
Rank_7: 50.0
Rank_8: 100.0
# OreBonus Ranks: % of extra ores received when Blast Mining
OreBonus:
Rank_1: 35.0
Rank_2: 40.0
Rank_3: 45.0
Rank_4: 50.0
Rank_5: 55.0
Rank_6: 60.0
Rank_7: 65.0
Rank_8: 70.0
# DebrisReduction_Rank: % of fewer non-ores received when Blast Mining
DebrisReduction:
Rank_1: 10.0
Rank_2: 20.0
Rank_3: 30.0
Rank_4: 30.0
Rank_5: 30.0
Rank_6: 30.0
Rank_7: 30.0
Rank_8: 30.0
# DropMultiplier Ranks: # of times each ore will drop
DropMultiplier:
Rank_1: 1
Rank_2: 1
Rank_3: 1
Rank_4: 1
Rank_5: 2
Rank_6: 2
Rank_7: 3
Rank_8: 3
# BlastRadiusModifier Ranks: Increases the blast radius by this amount
BlastRadiusModifier:
Rank_1: 1.0
Rank_2: 1.0
Rank_3: 2.0
Rank_4: 2.0
Rank_5: 3.0
Rank_6: 3.0
Rank_7: 4.0
Rank_8: 4.0
#
# Settings for Repair
###
Repair:
RepairMastery:
# MaxBonusPercentage: Maximum bonus percentage for Repair Mastery
# MaxBonusLevel: On this level, the maximum bonus is reached
MaxBonusPercentage: 200.0
MaxBonusLevel: 1000
SuperRepair:
# ChanceMax: Maximum chance of Super Repair when on <MaxBonusLevel> or higher
# MaxBonusLevel: On this level, Super Repair chance will be <ChanceMax>
ChanceMax: 100.0
MaxBonusLevel: 1000
ArcaneForging:
May_Lose_Enchants: true
Rank_Levels:
Rank_1: 125
Rank_2: 250
Rank_3: 375
Rank_4: 500
Rank_5: 625
Rank_6: 750
Rank_7: 875
Rank_8: 1000
Keep_Enchants_Chance:
Rank_1: 10.0
Rank_2: 20.0
Rank_3: 30.0
Rank_4: 40.0
Rank_5: 50.0
Rank_6: 50.0
Rank_7: 60.0
Rank_8: 60.0
Downgrades_Enabled: true
Downgrades_Chance:
Rank_1: 75.0
Rank_2: 50.0
Rank_3: 40.0
Rank_4: 30.0
Rank_5: 25.0
Rank_6: 20.0
Rank_7: 15.0
Rank_8: 10.0
#
# Settings for Salvage
###
Salvage:
# MaxPercentage: Maximum percentage of materials to be returned when Salvaging
# MaxPercentageLevel: On this level, the Salvage percentage will be <MaxPercentage>
MaxPercentage: 100.0
MaxPercentageLevel: 1000
# AdvancedSalvage_UnlockLevel: The level at which Advance Salvage become available
AdvancedSalvage:
UnlockLevel: 350
ArcaneSalvage:
# EnchantLossEnabled: When salvaging enchanted items, the enchants may be lost
# EnchantDowngradeEnabled: When salvaging enchanted items, the enchants may be downgraded
EnchantLossEnabled: true
EnchantDowngradeEnabled: true
Rank_Levels:
Rank_1: 125
Rank_2: 250
Rank_3: 375
Rank_4: 500
Rank_5: 625
Rank_6: 750
Rank_7: 875
Rank_8: 1000
# ExtractFullEnchant: Chance to extract the full enchant at each ArcaneSalvage rank
ExtractFullEnchant:
Rank_1: 2.5
Rank_2: 5.0
Rank_3: 7.5
Rank_4: 10.0
Rank_5: 12.5
Rank_6: 17.5
Rank_7: 25.0
Rank_8: 32.5
# ExtractPartialEnchant: Chance to extract the partial enchant at each ArcaneSalvage rank
ExtractPartialEnchant:
Rank_1: 2.0
Rank_2: 2.5
Rank_3: 5.0
Rank_4: 7.5
Rank_5: 10.0
Rank_6: 12.5
Rank_7: 15.0
Rank_8: 17.5
#
# Settings for Smelting
###
Smelting:
FuelEfficiency:
# Multiplier: The furnace burn time will be multiplied by this value.
# MaxBonusLevel: On this level, the efficiency multiplier will stop increasing
Multiplier: 3.0
MaxBonusLevel: 1000
SecondSmelt:
# ChanceMax: Maximum chance of triggering Second Smelt
# MaxBonusLevel: On this level, the chance to cause Second Smelt will be <ChanceMax>
ChanceMax: 100.0
MaxBonusLevel: 1000
FluxMining:
# UnlockLevel: Level when Flux Mining becomes available
# Chance: Chance for Flux Mining to activate
UnlockLevel: 250
Chance: 33.0
# Rank_Levels: Smelting level where rank gets unlocked
Rank_Levels:
Rank_1: 125
Rank_2: 250
Rank_3: 375
Rank_4: 500
Rank_5: 625
Rank_6: 750
Rank_7: 875
Rank_8: 1000
# VanillaXPMultiplier: Vanilla XP gained from smelting ores is multiplied by these values.
VanillaXPMultiplier:
Rank_1: 1
Rank_2: 2
Rank_3: 3
Rank_4: 3
Rank_5: 4
Rank_6: 4
Rank_7: 5
Rank_8: 5
#
# Settings for Swords
###
Swords:
Bleed:
# ChanceMax: Maximum chance of triggering bleeding
# MaxBonusLevel: On this level, the chance to cause Bleeding will be <ChanceMax>
ChanceMax: 75.0
MaxBonusLevel: 750
# These settings determine how long the Bleeding effect lasts
MaxTicks: 3
BaseTicks: 2
Counter:
# RequiresBlock: Determines if blocking is required to trigger counter attack
RequiresBlock: true
# ChanceMax: Maximum chance of triggering a counter attack
# MaxBonusLevel: On this level, the chance to Counter will be <ChanceMax>
ChanceMax: 30.0
MaxBonusLevel: 600
# DamageModifier: Damaged caused by the damager will get divided by this modifier and dealt back to the damager
DamageModifier: 2.0
SerratedStrikes:
# DamageModifier: Damage will get divided by this modifier
# BleedTicks: This determines how long the bleeding effect of SerratedStrikes lasts
DamageModifier: 4.0
BleedTicks: 5
#
# Settings for Taming
###
Taming:
Gore:
# ChanceMax: Maximum chance of triggering gore
# MaxBonusLevel: On this level, the chance to cause Gore will be <ChanceMax>
ChanceMax: 100.0
MaxBonusLevel: 1000
# BleedTicks: Determines the length of the bleeding effect
# Modifier: Damage will get multiplied by this modifier
BleedTicks: 2
Modifier: 2.0
FastFood:
# UnlockLevel: Level when FastFood unlocks
# Chance: The chance for wolves to heal hp when inflicting damage
UnlockLevel: 50
Chance: 50.0
EnvironmentallyAware:
# UnlockLevel: Level when EnvironmentallyAware unlocks
UnlockLevel: 100
ThickFur:
# UnlockLevel: Level when ThickFur unlocks
# Modifier: Damage will get divided by this modifier
UnlockLevel: 250
Modifier: 2.0
HolyHound:
# UnlockLevel: Level when HolyHound unlocks
UnlockLevel: 375
ShockProof:
# UnlockLevel: Level when ShockProof unlocks
# Modifier: Damage will get divided by this modifier
UnlockLevel: 500
Modifier: 6.0
SharpenedClaws:
# UnlockLevel: Level when SharpenedClaws unlocks
# Bonus: This bonus will get added to the damage caused
UnlockLevel: 750
Bonus: 2.0
CallOfTheWild:
# MinHorseJumpStrength: The minimum jump strength a summoned horse must have
# MaxHorseJumpStrength: The maximum jump strength a summoned horse can have
MinHorseJumpStrength: 0.7
MaxHorseJumpStrength: 2.0
#
# Settings for Unarmed
###
Unarmed:
Disarm:
# ChanceMax: Maximum chance of disarming other players
# MaxBonusLevel: Level when the maximum chance to disarm is reached
# AntiTheft: Determines if only the disarmed player can retrieve disarmed items
ChanceMax: 33.0
MaxBonusLevel: 1000
AntiTheft: false
Deflect:
# ChanceMax: Maximum chance of deflecting arrows
# MaxBonusLevel: Level when the maximum chance to deflect is reached
ChanceMax: 50.0
MaxBonusLevel: 1000
IronGrip:
# ChanceMax: Maximum chance of preventing being disarmed
# MaxBonusLevel: Level when the maximum chance to prevent being disarmed is reached
ChanceMax: 100.0
MaxBonusLevel: 1000
IronArm:
# BonusMin: Minimum bonus damage for unarmed
# BonusMax: Maximum bonus damage for unarmed
# IncreaseLevel: Bonus damage increases every increase level
BonusMin: 3.0
BonusMax: 8.0
IncreaseLevel: 50
#
# Settings for Woodcutting
###
Woodcutting:
LeafBlower:
# UnlockLevel: At this level, the passive ability LeafBlower unlocks
UnlockLevel: 100
DoubleDrops:
# ChanceMax: Maximum chance of receiving double drops
# MaxBonusLevel: Level when the maximum chance of receiving double drops is reached
ChanceMax: 100.0
MaxBonusLevel: 1000
#
# Customize the kraken!
###
Kraken:
Enabled: true
Tries_Before_Release: 50
Health: 50.0
Name: The Kraken
Attack_Interval_Seconds: 1
Attack_Damage: 1.0
Global_Effects: false
Allow_Escaping: false
Unleashed_Message:
Server: (PLAYER) has unleashed the kraken!
Player: THE KRAKEN HAS BEEN UNLEASHED!
Defeated_Message:
Escape: You have escaped from the kraken!
Killed: You have slain the kraken!

View File

@ -12,37 +12,37 @@ public final class AbilityAPI {
private AbilityAPI() {} private AbilityAPI() {}
public static boolean berserkEnabled(Player player) { public static boolean berserkEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(AbilityType.BERSERK); return UserManager.getPlayer(player).getAbilityMode(AbilityType.berserk);
} }
public static boolean gigaDrillBreakerEnabled(Player player) { public static boolean gigaDrillBreakerEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(AbilityType.GIGA_DRILL_BREAKER); return UserManager.getPlayer(player).getAbilityMode(AbilityType.gigaDrillBreaker);
} }
public static boolean greenTerraEnabled(Player player) { public static boolean greenTerraEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(AbilityType.GREEN_TERRA); return UserManager.getPlayer(player).getAbilityMode(AbilityType.greenTerra);
} }
public static boolean serratedStrikesEnabled(Player player) { public static boolean serratedStrikesEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(AbilityType.SERRATED_STRIKES); return UserManager.getPlayer(player).getAbilityMode(AbilityType.serratedStrikes);
} }
public static boolean skullSplitterEnabled(Player player) { public static boolean skullSplitterEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(AbilityType.SKULL_SPLITTER); return UserManager.getPlayer(player).getAbilityMode(AbilityType.skullSplitter);
} }
public static boolean superBreakerEnabled(Player player) { public static boolean superBreakerEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(AbilityType.SUPER_BREAKER); return UserManager.getPlayer(player).getAbilityMode(AbilityType.superBreaker);
} }
public static boolean treeFellerEnabled(Player player) { public static boolean treeFellerEnabled(Player player) {
return UserManager.getPlayer(player).getAbilityMode(AbilityType.TREE_FELLER); return UserManager.getPlayer(player).getAbilityMode(AbilityType.treeFeller);
} }
public static boolean isAnyAbilityEnabled(Player player) { public static boolean isAnyAbilityEnabled(Player player) {
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
for (AbilityType ability : AbilityType.values()) { for (AbilityType ability : AbilityType.getAbilities()) {
if (mcMMOPlayer.getAbilityMode(ability)) { if (mcMMOPlayer.getAbilityMode(ability)) {
return true; return true;
} }
@ -56,31 +56,31 @@ public final class AbilityAPI {
} }
public static void setBerserkCooldown(Player player, long cooldown) { public static void setBerserkCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(AbilityType.BERSERK, cooldown); UserManager.getPlayer(player).setAbilityDATS(AbilityType.berserk, cooldown);
} }
public static void setGigaDrillBreakerCooldown(Player player, long cooldown) { public static void setGigaDrillBreakerCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(AbilityType.GIGA_DRILL_BREAKER, cooldown); UserManager.getPlayer(player).setAbilityDATS(AbilityType.gigaDrillBreaker, cooldown);
} }
public static void setGreenTerraCooldown(Player player, long cooldown) { public static void setGreenTerraCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(AbilityType.GREEN_TERRA, cooldown); UserManager.getPlayer(player).setAbilityDATS(AbilityType.greenTerra, cooldown);
} }
public static void setSerratedStrikesCooldown(Player player, long cooldown) { public static void setSerratedStrikesCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(AbilityType.SERRATED_STRIKES, cooldown); UserManager.getPlayer(player).setAbilityDATS(AbilityType.serratedStrikes, cooldown);
} }
public static void setSkullSplitterCooldown(Player player, long cooldown) { public static void setSkullSplitterCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(AbilityType.SKULL_SPLITTER, cooldown); UserManager.getPlayer(player).setAbilityDATS(AbilityType.skullSplitter, cooldown);
} }
public static void setSuperBreakerCooldown(Player player, long cooldown) { public static void setSuperBreakerCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(AbilityType.SUPER_BREAKER, cooldown); UserManager.getPlayer(player).setAbilityDATS(AbilityType.superBreaker, cooldown);
} }
public static void setTreeFellerCooldown(Player player, long cooldown) { public static void setTreeFellerCooldown(Player player, long cooldown) {
UserManager.getPlayer(player).setAbilityDATS(AbilityType.TREE_FELLER, cooldown); UserManager.getPlayer(player).setAbilityDATS(AbilityType.treeFeller, cooldown);
} }
public static boolean isBleeding(LivingEntity entity) { public static boolean isBleeding(LivingEntity entity) {

View File

@ -644,7 +644,7 @@ public final class ExperienceAPI {
int powerLevel = 0; int powerLevel = 0;
PlayerProfile profile = getOfflineProfile(playerName); PlayerProfile profile = getOfflineProfile(playerName);
for (SkillType type : SkillType.nonChildSkills) { for (SkillType type : SkillType.getNonChildSkills()) {
powerLevel += profile.getSkillLevel(type); powerLevel += profile.getSkillLevel(type);
} }
@ -665,7 +665,7 @@ public final class ExperienceAPI {
int powerLevel = 0; int powerLevel = 0;
PlayerProfile profile = getOfflineProfile(uuid); PlayerProfile profile = getOfflineProfile(uuid);
for (SkillType type : SkillType.nonChildSkills) { for (SkillType type : SkillType.getNonChildSkills()) {
powerLevel += profile.getSkillLevel(type); powerLevel += profile.getSkillLevel(type);
} }

View File

@ -98,7 +98,7 @@ public abstract class ExperienceCommand implements TabExecutor {
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender); List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size())); return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
case 2: case 2:
return StringUtil.copyPartialMatches(args[1], SkillType.skillNames, new ArrayList<String>(SkillType.skillNames.size())); return StringUtil.copyPartialMatches(args[1], SkillType.getSkillNames(), new ArrayList<String>(SkillType.getSkillNames().size()));
default: default:
return ImmutableList.of(); return ImmutableList.of();
} }
@ -125,7 +125,7 @@ public abstract class ExperienceCommand implements TabExecutor {
protected void editValues(Player player, PlayerProfile profile, SkillType skill, int value) { protected void editValues(Player player, PlayerProfile profile, SkillType skill, int value) {
if (skill == null) { if (skill == null) {
for (SkillType skillType : SkillType.nonChildSkills) { for (SkillType skillType : SkillType.getNonChildSkills()) {
handleCommand(player, profile, skillType, value); handleCommand(player, profile, skillType, value);
} }

View File

@ -97,7 +97,7 @@ public class SkillresetCommand implements TabExecutor {
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender); List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size())); return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
case 2: case 2:
return StringUtil.copyPartialMatches(args[1], SkillType.skillNames, new ArrayList<String>(SkillType.skillNames.size())); return StringUtil.copyPartialMatches(args[1], SkillType.getSkillNames(), new ArrayList<String>(SkillType.getSkillNames().size()));
default: default:
return ImmutableList.of(); return ImmutableList.of();
} }
@ -148,7 +148,7 @@ public class SkillresetCommand implements TabExecutor {
protected void editValues(Player player, PlayerProfile profile, SkillType skill) { protected void editValues(Player player, PlayerProfile profile, SkillType skill) {
if (skill == null) { if (skill == null) {
for (SkillType skillType : SkillType.nonChildSkills) { for (SkillType skillType : SkillType.getNonChildSkills()) {
handleCommand(player, profile, skillType); handleCommand(player, profile, skillType);
} }

View File

@ -22,7 +22,7 @@ public class HardcoreCommand extends HardcoreModeCommand {
@Override @Override
protected boolean checkEnabled(SkillType skill) { protected boolean checkEnabled(SkillType skill) {
if (skill == null) { if (skill == null) {
for (SkillType skillType : SkillType.skillList) { for (SkillType skillType : SkillType.getSkillList()) {
if (!skillType.getHardcoreStatLossEnabled()) { if (!skillType.getHardcoreStatLossEnabled()) {
return false; return false;
} }
@ -52,7 +52,7 @@ public class HardcoreCommand extends HardcoreModeCommand {
private void toggle(boolean enable, SkillType skill) { private void toggle(boolean enable, SkillType skill) {
if (skill == null) { if (skill == null) {
for (SkillType skillType : SkillType.nonChildSkills) { for (SkillType skillType : SkillType.getNonChildSkills()) {
skillType.setHardcoreStatLossEnabled(enable); skillType.setHardcoreStatLossEnabled(enable);
} }
} }

View File

@ -22,7 +22,7 @@ public class VampirismCommand extends HardcoreModeCommand {
@Override @Override
protected boolean checkEnabled(SkillType skill) { protected boolean checkEnabled(SkillType skill) {
if (skill == null) { if (skill == null) {
for (SkillType skillType : SkillType.skillList) { for (SkillType skillType : SkillType.getSkillList()) {
if (!skillType.getHardcoreVampirismEnabled()) { if (!skillType.getHardcoreVampirismEnabled()) {
return false; return false;
} }
@ -52,7 +52,7 @@ public class VampirismCommand extends HardcoreModeCommand {
private void toggle(boolean enable, SkillType skill) { private void toggle(boolean enable, SkillType skill) {
if (skill == null) { if (skill == null) {
for (SkillType skillType : SkillType.nonChildSkills) { for (SkillType skillType : SkillType.getNonChildSkills()) {
skillType.setHardcoreVampirismEnabled(enable); skillType.setHardcoreVampirismEnabled(enable);
} }
} }

View File

@ -53,17 +53,17 @@ public class InspectCommand implements TabExecutor {
sender.sendMessage(LocaleLoader.getString("Inspect.OfflineStats", playerName)); sender.sendMessage(LocaleLoader.getString("Inspect.OfflineStats", playerName));
sender.sendMessage(LocaleLoader.getString("Stats.Header.Gathering")); sender.sendMessage(LocaleLoader.getString("Stats.Header.Gathering"));
for (SkillType skill : SkillType.gatheringSkills) { for (SkillType skill : SkillType.getGatheringSkills()) {
sender.sendMessage(CommandUtils.displaySkill(profile, skill)); sender.sendMessage(CommandUtils.displaySkill(profile, skill));
} }
sender.sendMessage(LocaleLoader.getString("Stats.Header.Combat")); sender.sendMessage(LocaleLoader.getString("Stats.Header.Combat"));
for (SkillType skill : SkillType.combatSkills) { for (SkillType skill : SkillType.getCombatSkills()) {
sender.sendMessage(CommandUtils.displaySkill(profile, skill)); sender.sendMessage(CommandUtils.displaySkill(profile, skill));
} }
sender.sendMessage(LocaleLoader.getString("Stats.Header.Misc")); sender.sendMessage(LocaleLoader.getString("Stats.Header.Misc"));
for (SkillType skill : SkillType.miscSkills) { for (SkillType skill : SkillType.getMiscSkills()) {
sender.sendMessage(CommandUtils.displaySkill(profile, skill)); sender.sendMessage(CommandUtils.displaySkill(profile, skill));
} }

View File

@ -45,7 +45,7 @@ public class MccooldownCommand implements TabExecutor {
player.sendMessage(LocaleLoader.getString("Commands.Cooldowns.Header")); player.sendMessage(LocaleLoader.getString("Commands.Cooldowns.Header"));
player.sendMessage(LocaleLoader.getString("mcMMO.NoSkillNote")); player.sendMessage(LocaleLoader.getString("mcMMO.NoSkillNote"));
for (AbilityType ability : AbilityType.values()) { for (AbilityType ability : AbilityType.getAbilities()) {
if (!ability.getPermissions(player)) { if (!ability.getPermissions(player)) {
continue; continue;
} }

View File

@ -70,7 +70,7 @@ public class MctopCommand implements TabExecutor {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) { public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) { switch (args.length) {
case 1: case 1:
return StringUtil.copyPartialMatches(args[0], SkillType.skillNames, new ArrayList<String>(SkillType.skillNames.size())); return StringUtil.copyPartialMatches(args[0], SkillType.getSkillNames(), new ArrayList<String>(SkillType.getSkillNames().size()));
default: default:
return ImmutableList.of(); return ImmutableList.of();
} }

View File

@ -303,17 +303,17 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
writer.append(":"); writer.append(":");
writer.append(profile.getSkillLevel(SkillType.taming)).append(":"); writer.append(profile.getSkillLevel(SkillType.taming)).append(":");
writer.append(profile.getSkillXpLevel(SkillType.taming)).append(":"); writer.append(profile.getSkillXpLevel(SkillType.taming)).append(":");
writer.append((int) profile.getAbilityDATS(AbilityType.BERSERK)).append(":"); writer.append((int) profile.getAbilityDATS(AbilityType.berserk)).append(":");
writer.append((int) profile.getAbilityDATS(AbilityType.GIGA_DRILL_BREAKER)).append(":"); writer.append((int) profile.getAbilityDATS(AbilityType.gigaDrillBreaker)).append(":");
writer.append((int) profile.getAbilityDATS(AbilityType.TREE_FELLER)).append(":"); writer.append((int) profile.getAbilityDATS(AbilityType.treeFeller)).append(":");
writer.append((int) profile.getAbilityDATS(AbilityType.GREEN_TERRA)).append(":"); writer.append((int) profile.getAbilityDATS(AbilityType.greenTerra)).append(":");
writer.append((int) profile.getAbilityDATS(AbilityType.SERRATED_STRIKES)).append(":"); writer.append((int) profile.getAbilityDATS(AbilityType.serratedStrikes)).append(":");
writer.append((int) profile.getAbilityDATS(AbilityType.SKULL_SPLITTER)).append(":"); writer.append((int) profile.getAbilityDATS(AbilityType.skullSplitter)).append(":");
writer.append((int) profile.getAbilityDATS(AbilityType.SUPER_BREAKER)).append(":"); writer.append((int) profile.getAbilityDATS(AbilityType.superBreaker)).append(":");
writer.append(":"); writer.append(":");
writer.append(profile.getSkillLevel(SkillType.fishing)).append(":"); writer.append(profile.getSkillLevel(SkillType.fishing)).append(":");
writer.append(profile.getSkillXpLevel(SkillType.fishing)).append(":"); writer.append(profile.getSkillXpLevel(SkillType.fishing)).append(":");
writer.append((int) profile.getAbilityDATS(AbilityType.BLAST_MINING)).append(":"); writer.append((int) profile.getAbilityDATS(AbilityType.blastMining)).append(":");
writer.append(System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR).append(":"); writer.append(System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR).append(":");
MobHealthbarType mobHealthbarType = profile.getMobHealthbarType(); MobHealthbarType mobHealthbarType = profile.getMobHealthbarType();
writer.append(mobHealthbarType == null ? Config.getInstance().getMobHealthbarDefault().toString() : mobHealthbarType.toString()).append(":"); writer.append(mobHealthbarType == null ? Config.getInstance().getMobHealthbarDefault().toString() : mobHealthbarType.toString()).append(":");
@ -367,7 +367,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
Map<SkillType, Integer> skills = new HashMap<SkillType, Integer>(); Map<SkillType, Integer> skills = new HashMap<SkillType, Integer>();
for (SkillType skill : SkillType.nonChildSkills) { for (SkillType skill : SkillType.getNonChildSkills()) {
skills.put(skill, getPlayerRank(playerName, playerStatHash.get(skill))); skills.put(skill, getPlayerRank(playerName, playerStatHash.get(skill)));
} }
@ -1077,7 +1077,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
private PlayerProfile loadFromLine(String[] character) { private PlayerProfile loadFromLine(String[] character) {
Map<SkillType, Integer> skills = getSkillMapFromLine(character); // Skill levels Map<SkillType, Integer> skills = getSkillMapFromLine(character); // Skill levels
Map<SkillType, Float> skillsXp = new HashMap<SkillType, Float>(); // Skill & XP Map<SkillType, Float> skillsXp = new HashMap<SkillType, Float>(); // Skill & XP
Map<AbilityType, Integer> skillsDATS = new EnumMap<AbilityType, Integer>(AbilityType.class); // Ability & Cooldown Map<AbilityType, Integer> skillsDATS = new HashMap<AbilityType, Integer>(); // Ability & Cooldown
MobHealthbarType mobHealthbarType; MobHealthbarType mobHealthbarType;
// TODO on updates, put new values in a try{} ? // TODO on updates, put new values in a try{} ?
@ -1097,17 +1097,17 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
skillsXp.put(SkillType.alchemy, (float) Integer.valueOf(character[40])); skillsXp.put(SkillType.alchemy, (float) Integer.valueOf(character[40]));
// Taming - Unused // Taming - Unused
skillsDATS.put(AbilityType.SUPER_BREAKER, Integer.valueOf(character[32])); skillsDATS.put(AbilityType.superBreaker, Integer.valueOf(character[32]));
// Repair - Unused // Repair - Unused
skillsDATS.put(AbilityType.TREE_FELLER, Integer.valueOf(character[28])); skillsDATS.put(AbilityType.treeFeller, Integer.valueOf(character[28]));
skillsDATS.put(AbilityType.BERSERK, Integer.valueOf(character[26])); skillsDATS.put(AbilityType.berserk, Integer.valueOf(character[26]));
skillsDATS.put(AbilityType.GREEN_TERRA, Integer.valueOf(character[29])); skillsDATS.put(AbilityType.greenTerra, Integer.valueOf(character[29]));
skillsDATS.put(AbilityType.GIGA_DRILL_BREAKER, Integer.valueOf(character[27])); skillsDATS.put(AbilityType.gigaDrillBreaker, Integer.valueOf(character[27]));
// Archery - Unused // Archery - Unused
skillsDATS.put(AbilityType.SERRATED_STRIKES, Integer.valueOf(character[30])); skillsDATS.put(AbilityType.serratedStrikes, Integer.valueOf(character[30]));
skillsDATS.put(AbilityType.SKULL_SPLITTER, Integer.valueOf(character[31])); skillsDATS.put(AbilityType.skullSplitter, Integer.valueOf(character[31]));
// Acrobatics - Unused // Acrobatics - Unused
skillsDATS.put(AbilityType.BLAST_MINING, Integer.valueOf(character[36])); skillsDATS.put(AbilityType.blastMining, Integer.valueOf(character[36]));
try { try {
mobHealthbarType = MobHealthbarType.valueOf(character[38]); mobHealthbarType = MobHealthbarType.valueOf(character[38]);

View File

@ -315,14 +315,14 @@ public final class SQLDatabaseManager implements DatabaseManager {
+ " mining = ?, woodcutting = ?, unarmed = ?" + " mining = ?, woodcutting = ?, unarmed = ?"
+ ", herbalism = ?, excavation = ?, swords = ?" + ", herbalism = ?, excavation = ?, swords = ?"
+ ", axes = ?, blast_mining = ? WHERE user_id = ?"); + ", axes = ?, blast_mining = ? WHERE user_id = ?");
statement.setLong(1, profile.getAbilityDATS(AbilityType.SUPER_BREAKER)); statement.setLong(1, profile.getAbilityDATS(AbilityType.superBreaker));
statement.setLong(2, profile.getAbilityDATS(AbilityType.TREE_FELLER)); statement.setLong(2, profile.getAbilityDATS(AbilityType.treeFeller));
statement.setLong(3, profile.getAbilityDATS(AbilityType.BERSERK)); statement.setLong(3, profile.getAbilityDATS(AbilityType.berserk));
statement.setLong(4, profile.getAbilityDATS(AbilityType.GREEN_TERRA)); statement.setLong(4, profile.getAbilityDATS(AbilityType.greenTerra));
statement.setLong(5, profile.getAbilityDATS(AbilityType.GIGA_DRILL_BREAKER)); statement.setLong(5, profile.getAbilityDATS(AbilityType.gigaDrillBreaker));
statement.setLong(6, profile.getAbilityDATS(AbilityType.SERRATED_STRIKES)); statement.setLong(6, profile.getAbilityDATS(AbilityType.serratedStrikes));
statement.setLong(7, profile.getAbilityDATS(AbilityType.SKULL_SPLITTER)); statement.setLong(7, profile.getAbilityDATS(AbilityType.skullSplitter));
statement.setLong(8, profile.getAbilityDATS(AbilityType.BLAST_MINING)); statement.setLong(8, profile.getAbilityDATS(AbilityType.blastMining));
statement.setInt(9, id); statement.setInt(9, id);
success = (statement.executeUpdate() != 0); success = (statement.executeUpdate() != 0);
statement.close(); statement.close();
@ -425,7 +425,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
try { try {
connection = getConnection(PoolIdentifier.MISC); connection = getConnection(PoolIdentifier.MISC);
for (SkillType skillType : SkillType.nonChildSkills) { for (SkillType skillType : SkillType.getNonChildSkills()) {
String skillName = skillType.getName().toLowerCase(); String skillName = skillType.getName().toLowerCase();
String sql = "SELECT COUNT(*) AS rank FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id WHERE " + skillName + " > 0 " + String sql = "SELECT COUNT(*) AS rank FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id WHERE " + skillName + " > 0 " +
"AND " + skillName + " > (SELECT " + skillName + " FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id " + "AND " + skillName + " > (SELECT " + skillName + " FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id " +
@ -1228,7 +1228,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
private PlayerProfile loadFromResult(String playerName, ResultSet result) throws SQLException { private PlayerProfile loadFromResult(String playerName, ResultSet result) throws SQLException {
Map<SkillType, Integer> skills = new HashMap<SkillType, Integer>(); // Skill & Level Map<SkillType, Integer> skills = new HashMap<SkillType, Integer>(); // Skill & Level
Map<SkillType, Float> skillsXp = new HashMap<SkillType, Float>(); // Skill & XP Map<SkillType, Float> skillsXp = new HashMap<SkillType, Float>(); // Skill & XP
Map<AbilityType, Integer> skillsDATS = new EnumMap<AbilityType, Integer>(AbilityType.class); // Ability & Cooldown Map<AbilityType, Integer> skillsDATS = new HashMap<AbilityType, Integer>(); // Ability & Cooldown
MobHealthbarType mobHealthbarType; MobHealthbarType mobHealthbarType;
UUID uuid; UUID uuid;
@ -1267,17 +1267,17 @@ public final class SQLDatabaseManager implements DatabaseManager {
skillsXp.put(SkillType.alchemy, result.getFloat(OFFSET_XP + 13)); skillsXp.put(SkillType.alchemy, result.getFloat(OFFSET_XP + 13));
// Taming - Unused - result.getInt(OFFSET_DATS + 1) // Taming - Unused - result.getInt(OFFSET_DATS + 1)
skillsDATS.put(AbilityType.SUPER_BREAKER, result.getInt(OFFSET_DATS + 2)); skillsDATS.put(AbilityType.superBreaker, result.getInt(OFFSET_DATS + 2));
// Repair - Unused - result.getInt(OFFSET_DATS + 3) // Repair - Unused - result.getInt(OFFSET_DATS + 3)
skillsDATS.put(AbilityType.TREE_FELLER, result.getInt(OFFSET_DATS + 4)); skillsDATS.put(AbilityType.treeFeller, result.getInt(OFFSET_DATS + 4));
skillsDATS.put(AbilityType.BERSERK, result.getInt(OFFSET_DATS + 5)); skillsDATS.put(AbilityType.berserk, result.getInt(OFFSET_DATS + 5));
skillsDATS.put(AbilityType.GREEN_TERRA, result.getInt(OFFSET_DATS + 6)); skillsDATS.put(AbilityType.greenTerra, result.getInt(OFFSET_DATS + 6));
skillsDATS.put(AbilityType.GIGA_DRILL_BREAKER, result.getInt(OFFSET_DATS + 7)); skillsDATS.put(AbilityType.gigaDrillBreaker, result.getInt(OFFSET_DATS + 7));
// Archery - Unused - result.getInt(OFFSET_DATS + 8) // Archery - Unused - result.getInt(OFFSET_DATS + 8)
skillsDATS.put(AbilityType.SERRATED_STRIKES, result.getInt(OFFSET_DATS + 9)); skillsDATS.put(AbilityType.serratedStrikes, result.getInt(OFFSET_DATS + 9));
skillsDATS.put(AbilityType.SKULL_SPLITTER, result.getInt(OFFSET_DATS + 10)); skillsDATS.put(AbilityType.skullSplitter, result.getInt(OFFSET_DATS + 10));
// Acrobatics - Unused - result.getInt(OFFSET_DATS + 11) // Acrobatics - Unused - result.getInt(OFFSET_DATS + 11)
skillsDATS.put(AbilityType.BLAST_MINING, result.getInt(OFFSET_DATS + 12)); skillsDATS.put(AbilityType.blastMining, result.getInt(OFFSET_DATS + 12));
try { try {
mobHealthbarType = MobHealthbarType.valueOf(result.getString(OFFSET_OTHER + 2)); mobHealthbarType = MobHealthbarType.valueOf(result.getString(OFFSET_OTHER + 2));
@ -1357,10 +1357,10 @@ public final class SQLDatabaseManager implements DatabaseManager {
resultSet = statement.executeQuery("SHOW INDEX FROM `" + tablePrefix + "skills` WHERE `Key_name` LIKE 'idx\\_%'"); resultSet = statement.executeQuery("SHOW INDEX FROM `" + tablePrefix + "skills` WHERE `Key_name` LIKE 'idx\\_%'");
resultSet.last(); resultSet.last();
if (resultSet.getRow() != SkillType.nonChildSkills.size()) { if (resultSet.getRow() != SkillType.getNonChildSkills().size()) {
mcMMO.p.getLogger().info("Indexing tables, this may take a while on larger databases"); mcMMO.p.getLogger().info("Indexing tables, this may take a while on larger databases");
for (SkillType skill : SkillType.nonChildSkills) { for (SkillType skill : SkillType.getNonChildSkills()) {
String skill_name = skill.getName().toLowerCase(); String skill_name = skill.getName().toLowerCase();
try { try {

View File

@ -8,5 +8,6 @@ public enum UpgradeType {
DROP_SQL_PARTY_NAMES, DROP_SQL_PARTY_NAMES,
DROP_SPOUT, DROP_SPOUT,
ADD_ALCHEMY, ADD_ALCHEMY,
ADD_UUIDS; ADD_UUIDS,
ADD_INDEX_NAMES;
} }

View File

@ -111,7 +111,7 @@ public class McMMOPlayer {
* If in the future someone wants to remove this, don't forget to also remove what is in the SkillType enum. - bm01 * If in the future someone wants to remove this, don't forget to also remove what is in the SkillType enum. - bm01
*/ */
try { try {
for (SkillType skillType : SkillType.skillList) { for (SkillType skillType : SkillType.getSkillList()) {
skillManagers.put(skillType, skillType.getManagerClass().getConstructor(McMMOPlayer.class).newInstance(this)); skillManagers.put(skillType, skillType.getManagerClass().getConstructor(McMMOPlayer.class).newInstance(this));
} }
} }
@ -120,7 +120,7 @@ public class McMMOPlayer {
mcMMO.p.getPluginLoader().disablePlugin(mcMMO.p); mcMMO.p.getPluginLoader().disablePlugin(mcMMO.p);
} }
for (AbilityType abilityType : AbilityType.values()) { for (AbilityType abilityType : AbilityType.getAbilities()) {
abilityMode.put(abilityType, false); abilityMode.put(abilityType, false);
abilityInformed.put(abilityType, true); // This is intended abilityInformed.put(abilityType, true); // This is intended
} }
@ -202,7 +202,7 @@ public class McMMOPlayer {
* Reset the mode of all abilities. * Reset the mode of all abilities.
*/ */
public void resetAbilityMode() { public void resetAbilityMode() {
for (AbilityType ability : AbilityType.values()) { for (AbilityType ability : AbilityType.getAbilities()) {
// Correctly disable and handle any special deactivate code // Correctly disable and handle any special deactivate code
new AbilityDisableTask(this, ability).run(); new AbilityDisableTask(this, ability).run();
} }
@ -389,7 +389,7 @@ public class McMMOPlayer {
public int getPowerLevel() { public int getPowerLevel() {
int powerLevel = 0; int powerLevel = 0;
for (SkillType type : SkillType.nonChildSkills) { for (SkillType type : SkillType.getNonChildSkills()) {
if (type.getPermissions(player)) { if (type.getPermissions(player)) {
powerLevel += getSkillLevel(type); powerLevel += getSkillLevel(type);
} }
@ -751,7 +751,7 @@ public class McMMOPlayer {
profile.setAbilityDATS(ability, System.currentTimeMillis() + (ticks * Misc.TIME_CONVERSION_FACTOR)); profile.setAbilityDATS(ability, System.currentTimeMillis() + (ticks * Misc.TIME_CONVERSION_FACTOR));
setAbilityMode(ability, true); setAbilityMode(ability, true);
if (ability == AbilityType.SUPER_BREAKER || ability == AbilityType.GIGA_DRILL_BREAKER) { if (ability == AbilityType.superBreaker || ability == AbilityType.gigaDrillBreaker) {
SkillUtils.handleAbilitySpeedIncrease(player); SkillUtils.handleAbilitySpeedIncrease(player);
} }
@ -773,7 +773,7 @@ public class McMMOPlayer {
return; return;
} }
for (AbilityType abilityType : AbilityType.values()) { for (AbilityType abilityType : AbilityType.getAbilities()) {
if (getAbilityMode(abilityType)) { if (getAbilityMode(abilityType)) {
return; return;
} }

View File

@ -43,11 +43,11 @@ public class PlayerProfile {
mobHealthbarType = Config.getInstance().getMobHealthbarDefault(); mobHealthbarType = Config.getInstance().getMobHealthbarDefault();
for (AbilityType abilityType : AbilityType.values()) { for (AbilityType abilityType : AbilityType.getAbilities()) {
abilityDATS.put(abilityType, 0); abilityDATS.put(abilityType, 0);
} }
for (SkillType skillType : SkillType.nonChildSkills) { for (SkillType skillType : SkillType.getNonChildSkills()) {
skills.put(skillType, 0); skills.put(skillType, 0);
skillsXp.put(skillType, 0F); skillsXp.put(skillType, 0F);
} }

View File

@ -1,5 +1,8 @@
package com.gmail.nossr50.datatypes.skills; package com.gmail.nossr50.datatypes.skills;
import java.util.List;
import java.util.ArrayList;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -7,82 +10,118 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.BlockUtils; import com.gmail.nossr50.util.BlockUtils;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.StringUtils;
public enum AbilityType { public class AbilityType {
BERSERK( private static List<AbilityType> abilityTypes = new ArrayList<AbilityType>();
public static final AbilityType berserk = new AbilityType(
"BERSERK",
"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",
"Unarmed.Skills.Berserk.Refresh", "Unarmed.Skills.Berserk.Refresh",
"Unarmed.Skills.Berserk.Other.Off"), "Unarmed.Skills.Berserk.Other.Off") {
@Override
public boolean blockCheck(BlockState blockState) {
return (BlockUtils.affectedByGigaDrillBreaker(blockState) || blockState.getType() == Material.SNOW);
}
};
SUPER_BREAKER( public static final AbilityType superBreaker = new AbilityType(
"SUPER_BREAKER",
"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",
"Mining.Skills.SuperBreaker.Refresh", "Mining.Skills.SuperBreaker.Refresh",
"Mining.Skills.SuperBreaker.Other.Off"), "Mining.Skills.SuperBreaker.Other.Off") {
@Override
public boolean blockCheck(BlockState blockState) {
return BlockUtils.affectedBySuperBreaker(blockState);
}
};
GIGA_DRILL_BREAKER( public static final AbilityType gigaDrillBreaker = new AbilityType(
"GIGA_DRILL_BREAKER",
"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",
"Excavation.Skills.GigaDrillBreaker.Refresh", "Excavation.Skills.GigaDrillBreaker.Refresh",
"Excavation.Skills.GigaDrillBreaker.Other.Off"), "Excavation.Skills.GigaDrillBreaker.Other.Off") {
@Override
public boolean blockCheck(BlockState blockState) {
return BlockUtils.affectedByGigaDrillBreaker(blockState);
}
};
GREEN_TERRA( public static final AbilityType greenTerra = new AbilityType(
"GREEN_TERRA",
"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",
"Herbalism.Skills.GTe.Refresh", "Herbalism.Skills.GTe.Refresh",
"Herbalism.Skills.GTe.Other.Off"), "Herbalism.Skills.GTe.Other.Off") {
@Override
public boolean blockCheck(BlockState blockState) {
return BlockUtils.canMakeMossy(blockState);
}
};
SKULL_SPLITTER( public static final AbilityType skullSplitter = new AbilityType(
"SKULL_SPLITTER",
"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",
"Axes.Skills.SS.Refresh", "Axes.Skills.SS.Refresh",
"Axes.Skills.SS.Other.Off"), "Axes.Skills.SS.Other.Off");
TREE_FELLER( public static final AbilityType treeFeller = new AbilityType(
"TREE_FELLER",
"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",
"Woodcutting.Skills.TreeFeller.Refresh", "Woodcutting.Skills.TreeFeller.Refresh",
"Woodcutting.Skills.TreeFeller.Other.Off"), "Woodcutting.Skills.TreeFeller.Other.Off") {
@Override
public boolean blockCheck(BlockState blockState) {
return BlockUtils.isLog(blockState);
}
};
SERRATED_STRIKES( public static final AbilityType serratedStrikes = new AbilityType(
"SERRATED_STRIKES",
"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",
"Swords.Skills.SS.Refresh", "Swords.Skills.SS.Refresh",
"Swords.Skills.SS.Other.Off"), "Swords.Skills.SS.Other.Off");
/** /**
* Has cooldown - but has to share a skill with Super Breaker, so needs special treatment * Has cooldown - but has to share a skill with Super Breaker, so needs special treatment
*/ */
BLAST_MINING( public static final AbilityType blastMining = new AbilityType(
"BLAST_MINING",
null, null,
null, null,
"Mining.Blast.Other.On", "Mining.Blast.Other.On",
"Mining.Blast.Refresh", "Mining.Blast.Refresh",
null), null);
;
private String name;
private String abilityOn; private String abilityOn;
private String abilityOff; private String abilityOff;
private String abilityPlayer; private String abilityPlayer;
private String abilityRefresh; private String abilityRefresh;
private String abilityPlayerOff; private String abilityPlayerOff;
private AbilityType(String abilityOn, String abilityOff, String abilityPlayer, String abilityRefresh, String abilityPlayerOff) { private AbilityType(String name, String abilityOn, String abilityOff, String abilityPlayer, String abilityRefresh, String abilityPlayerOff) {
this.abilityOn = abilityOn; this.name = name;
this.abilityOn = abilityOn;
this.abilityOff = abilityOff; this.abilityOff = abilityOff;
this.abilityPlayer = abilityPlayer; this.abilityPlayer = abilityPlayer;
this.abilityRefresh = abilityRefresh; this.abilityRefresh = abilityRefresh;
this.abilityPlayerOff = abilityPlayerOff; this.abilityPlayerOff = abilityPlayerOff;
abilityTypes.add(this);
} }
public int getCooldown() { public int getCooldown() {
@ -119,7 +158,7 @@ public enum AbilityType {
@Override @Override
public String toString() { public String toString() {
String baseString = name(); String baseString = name;
String[] substrings = baseString.split("_"); String[] substrings = baseString.split("_");
String formattedString = ""; String formattedString = "";
@ -145,34 +184,9 @@ public enum AbilityType {
* @return true if the player has permissions, false otherwise * @return true if the player has permissions, false otherwise
*/ */
public boolean getPermissions(Player player) { public boolean getPermissions(Player player) {
switch (this) { return player.hasPermission("mcmmo.ability."
case BERSERK: + SkillType.byAbility(this).getName().toLowerCase()
return Permissions.berserk(player); + "." + name.replace("_", "").toLowerCase());
case BLAST_MINING:
return Permissions.remoteDetonation(player);
case GIGA_DRILL_BREAKER:
return Permissions.gigaDrillBreaker(player);
case GREEN_TERRA:
return Permissions.greenTerra(player);
case SERRATED_STRIKES:
return Permissions.serratedStrikes(player);
case SKULL_SPLITTER:
return Permissions.skullSplitter(player);
case SUPER_BREAKER:
return Permissions.superBreaker(player);
case TREE_FELLER:
return Permissions.treeFeller(player);
default:
return false;
}
} }
/** /**
@ -182,24 +196,10 @@ public enum AbilityType {
* @return true if the block is affected by this ability, false otherwise * @return true if the block is affected by this ability, false otherwise
*/ */
public boolean blockCheck(BlockState blockState) { public boolean blockCheck(BlockState blockState) {
switch (this) { return false;
case BERSERK: }
return (BlockUtils.affectedByGigaDrillBreaker(blockState) || blockState.getType() == Material.SNOW);
case GIGA_DRILL_BREAKER: public static List<AbilityType> getAbilities() {
return BlockUtils.affectedByGigaDrillBreaker(blockState); return abilityTypes;
case GREEN_TERRA:
return BlockUtils.canMakeMossy(blockState);
case SUPER_BREAKER:
return BlockUtils.affectedBySuperBreaker(blockState);
case TREE_FELLER:
return BlockUtils.isLog(blockState);
default:
return false;
}
} }
} }

View File

@ -57,32 +57,32 @@ public class SkillType {
MISC MISC
} }
public static List<String> skillNames = new ArrayList<String>(); private static List<String> skillNames = new ArrayList<String>();
public static List<SkillType> skillList = new ArrayList<SkillType>(); private static List<SkillType> skillList = new ArrayList<SkillType>();
public static List<SkillType> childSkills = new ArrayList<SkillType>(); private static List<SkillType> childSkills = new ArrayList<SkillType>();
public static List<SkillType> nonChildSkills = new ArrayList<SkillType>(); private static List<SkillType> nonChildSkills = new ArrayList<SkillType>();
public static List<SkillType> combatSkills = new ArrayList<SkillType>(); private static List<SkillType> combatSkills = new ArrayList<SkillType>();
public static List<SkillType> gatheringSkills = new ArrayList<SkillType>(); private static List<SkillType> gatheringSkills = new ArrayList<SkillType>();
public static List<SkillType> miscSkills = new ArrayList<SkillType>(); private static List<SkillType> miscSkills = new ArrayList<SkillType>();
public static final SkillType acrobatics = createSkill("ACROBATICS" , AcrobaticsManager.class , AcrobaticsCommand.class , false, Color.WHITE, SkillUseType.MISC, ImmutableList.of(SecondaryAbility.DODGE, SecondaryAbility.GRACEFUL_ROLL, SecondaryAbility.ROLL)); public static final SkillType acrobatics = createSkill("ACROBATICS" , AcrobaticsManager.class , AcrobaticsCommand.class , false, Color.WHITE, SkillUseType.MISC, ImmutableList.of(SecondaryAbility.DODGE, SecondaryAbility.GRACEFUL_ROLL, SecondaryAbility.ROLL));
public static final SkillType alchemy = createSkill("ALCHEMY" , AlchemyManager.class , AlchemyCommand.class , false, Color.FUCHSIA, SkillUseType.MISC, ImmutableList.of(SecondaryAbility.CATALYSIS, SecondaryAbility.CONCOCTIONS)); public static final SkillType alchemy = createSkill("ALCHEMY" , AlchemyManager.class , AlchemyCommand.class , false, Color.FUCHSIA, SkillUseType.MISC, ImmutableList.of(SecondaryAbility.CATALYSIS, SecondaryAbility.CONCOCTIONS));
public static final SkillType archery = createSkill("ARCHERY" , ArcheryManager.class , ArcheryCommand.class , false, Color.MAROON, SkillUseType.COMBAT, ImmutableList.of(SecondaryAbility.DAZE, SecondaryAbility.RETRIEVE, SecondaryAbility.SKILL_SHOT)); public static final SkillType archery = createSkill("ARCHERY" , ArcheryManager.class , ArcheryCommand.class , false, Color.MAROON, SkillUseType.COMBAT, ImmutableList.of(SecondaryAbility.DAZE, SecondaryAbility.RETRIEVE, SecondaryAbility.SKILL_SHOT));
public static final SkillType axes = createSkill("AXES" , AxesManager.class , AxesCommand.class , false, Color.AQUA, SkillUseType.COMBAT, AbilityType.SKULL_SPLITTER, ToolType.AXE, ImmutableList.of(SecondaryAbility.ARMOR_IMPACT, SecondaryAbility.AXE_MASTERY, SecondaryAbility.CRITICAL_HIT, SecondaryAbility.GREATER_IMPACT)); public static final SkillType axes = createSkill("AXES" , AxesManager.class , AxesCommand.class , false, Color.AQUA, SkillUseType.COMBAT, AbilityType.skullSplitter, ToolType.AXE, ImmutableList.of(SecondaryAbility.ARMOR_IMPACT, SecondaryAbility.AXE_MASTERY, SecondaryAbility.CRITICAL_HIT, SecondaryAbility.GREATER_IMPACT));
public static final SkillType excavation = createSkill("EXCAVATION" , ExcavationManager.class , ExcavationCommand.class , false, Color.fromRGB(139, 69, 19), SkillUseType.GATHERING, AbilityType.GIGA_DRILL_BREAKER, ToolType.SHOVEL, ImmutableList.of(SecondaryAbility.EXCAVATION_TREASURE_HUNTER)); public static final SkillType excavation = createSkill("EXCAVATION" , ExcavationManager.class , ExcavationCommand.class , false, Color.fromRGB(139, 69, 19), SkillUseType.GATHERING, AbilityType.gigaDrillBreaker, ToolType.SHOVEL, ImmutableList.of(SecondaryAbility.EXCAVATION_TREASURE_HUNTER));
public static final SkillType fishing = createSkill("FISHING" , FishingManager.class , FishingCommand.class , false, Color.NAVY, SkillUseType.GATHERING, ImmutableList.of(SecondaryAbility.FISHERMANS_DIET, SecondaryAbility.FISHING_TREASURE_HUNTER, SecondaryAbility.ICE_FISHING, SecondaryAbility.MAGIC_HUNTER, SecondaryAbility.MASTER_ANGLER, SecondaryAbility.SHAKE)); public static final SkillType fishing = createSkill("FISHING" , FishingManager.class , FishingCommand.class , false, Color.NAVY, SkillUseType.GATHERING, ImmutableList.of(SecondaryAbility.FISHERMANS_DIET, SecondaryAbility.FISHING_TREASURE_HUNTER, SecondaryAbility.ICE_FISHING, SecondaryAbility.MAGIC_HUNTER, SecondaryAbility.MASTER_ANGLER, SecondaryAbility.SHAKE));
public static final SkillType herbalism = createSkill("HERBALISM" , HerbalismManager.class , HerbalismCommand.class , false, Color.GREEN, SkillUseType.GATHERING, AbilityType.GREEN_TERRA, ToolType.HOE, ImmutableList.of(SecondaryAbility.FARMERS_DIET, SecondaryAbility.GREEN_THUMB_PLANT, SecondaryAbility.GREEN_THUMB_BLOCK, SecondaryAbility.HERBALISM_DOUBLE_DROPS, SecondaryAbility.HYLIAN_LUCK, SecondaryAbility.SHROOM_THUMB)); public static final SkillType herbalism = createSkill("HERBALISM" , HerbalismManager.class , HerbalismCommand.class , false, Color.GREEN, SkillUseType.GATHERING, AbilityType.greenTerra, ToolType.HOE, ImmutableList.of(SecondaryAbility.FARMERS_DIET, SecondaryAbility.GREEN_THUMB_PLANT, SecondaryAbility.GREEN_THUMB_BLOCK, SecondaryAbility.HERBALISM_DOUBLE_DROPS, SecondaryAbility.HYLIAN_LUCK, SecondaryAbility.SHROOM_THUMB));
public static final SkillType mining = createSkill("MINING" , MiningManager.class , MiningCommand.class , false, Color.GRAY, SkillUseType.GATHERING, AbilityType.SUPER_BREAKER, ToolType.PICKAXE, ImmutableList.of(SecondaryAbility.MINING_DOUBLE_DROPS)); public static final SkillType mining = createSkill("MINING" , MiningManager.class , MiningCommand.class , false, Color.GRAY, SkillUseType.GATHERING, AbilityType.superBreaker, ToolType.PICKAXE, ImmutableList.of(SecondaryAbility.MINING_DOUBLE_DROPS));
public static final SkillType repair = createSkill("REPAIR" , RepairManager.class , RepairCommand.class , false, Color.SILVER, SkillUseType.MISC, ImmutableList.of(SecondaryAbility.ARCANE_FORGING, SecondaryAbility.REPAIR_MASTERY, SecondaryAbility.SUPER_REPAIR)); public static final SkillType repair = createSkill("REPAIR" , RepairManager.class , RepairCommand.class , false, Color.SILVER, SkillUseType.MISC, ImmutableList.of(SecondaryAbility.ARCANE_FORGING, SecondaryAbility.REPAIR_MASTERY, SecondaryAbility.SUPER_REPAIR));
public static final SkillType salvage = createSkill("SALVAGE" , SalvageManager.class , SalvageCommand.class , true, Color.ORANGE, SkillUseType.MISC, ImmutableList.of(SecondaryAbility.ADVANCED_SALVAGE, SecondaryAbility.ARCANE_SALVAGE)); public static final SkillType salvage = createSkill("SALVAGE" , SalvageManager.class , SalvageCommand.class , true, Color.ORANGE, SkillUseType.MISC, ImmutableList.of(SecondaryAbility.ADVANCED_SALVAGE, SecondaryAbility.ARCANE_SALVAGE));
public static final SkillType smelting = createSkill("SMELTING" , SmeltingManager.class , SmeltingCommand.class , true, Color.YELLOW, SkillUseType.MISC, ImmutableList.of(SecondaryAbility.FLUX_MINING, SecondaryAbility.FUEL_EFFICIENCY, SecondaryAbility.SECOND_SMELT)); public static final SkillType smelting = createSkill("SMELTING" , SmeltingManager.class , SmeltingCommand.class , true, Color.YELLOW, SkillUseType.MISC, ImmutableList.of(SecondaryAbility.FLUX_MINING, SecondaryAbility.FUEL_EFFICIENCY, SecondaryAbility.SECOND_SMELT));
public static final SkillType swords = createSkill("SWORDS" , SwordsManager.class , SwordsCommand.class , false, Color.fromRGB(178, 34, 34), SkillUseType.COMBAT, AbilityType.SERRATED_STRIKES, ToolType.SWORD, ImmutableList.of(SecondaryAbility.BLEED, SecondaryAbility.COUNTER)); public static final SkillType swords = createSkill("SWORDS" , SwordsManager.class , SwordsCommand.class , false, Color.fromRGB(178, 34, 34), SkillUseType.COMBAT, AbilityType.serratedStrikes, ToolType.SWORD, ImmutableList.of(SecondaryAbility.BLEED, SecondaryAbility.COUNTER));
public static final SkillType taming = createSkill("TAMING" , TamingManager.class , TamingCommand.class , false, Color.PURPLE, SkillUseType.COMBAT, ImmutableList.of(SecondaryAbility.BEAST_LORE, SecondaryAbility.CALL_OF_THE_WILD, SecondaryAbility.ENVIROMENTALLY_AWARE, SecondaryAbility.FAST_FOOD, SecondaryAbility.GORE, SecondaryAbility.HOLY_HOUND, SecondaryAbility.SHARPENED_CLAWS, SecondaryAbility.SHOCK_PROOF, SecondaryAbility.THICK_FUR)); public static final SkillType taming = createSkill("TAMING" , TamingManager.class , TamingCommand.class , false, Color.PURPLE, SkillUseType.COMBAT, ImmutableList.of(SecondaryAbility.BEAST_LORE, SecondaryAbility.CALL_OF_THE_WILD, SecondaryAbility.ENVIROMENTALLY_AWARE, SecondaryAbility.FAST_FOOD, SecondaryAbility.GORE, SecondaryAbility.HOLY_HOUND, SecondaryAbility.SHARPENED_CLAWS, SecondaryAbility.SHOCK_PROOF, SecondaryAbility.THICK_FUR));
public static final SkillType unarmed = createSkill("UNARMED" , UnarmedManager.class , UnarmedCommand.class , false, Color.BLACK, SkillUseType.COMBAT, AbilityType.BERSERK, ToolType.FISTS, ImmutableList.of(SecondaryAbility.BLOCK_CRACKER, SecondaryAbility.DEFLECT, SecondaryAbility.DISARM, SecondaryAbility.IRON_ARM, SecondaryAbility.IRON_GRIP)); public static final SkillType unarmed = createSkill("UNARMED" , UnarmedManager.class , UnarmedCommand.class , false, Color.BLACK, SkillUseType.COMBAT, AbilityType.berserk, ToolType.FISTS, ImmutableList.of(SecondaryAbility.BLOCK_CRACKER, SecondaryAbility.DEFLECT, SecondaryAbility.DISARM, SecondaryAbility.IRON_ARM, SecondaryAbility.IRON_GRIP));
public static final SkillType woodcutting = createSkill("WOODCUTTING", WoodcuttingManager.class , WoodcuttingCommand.class , false, Color.OLIVE, SkillUseType.GATHERING, AbilityType.TREE_FELLER, ToolType.AXE, ImmutableList.of(SecondaryAbility.LEAF_BLOWER, SecondaryAbility.WOODCUTTING_DOUBLE_DROPS)); public static final SkillType woodcutting = createSkill("WOODCUTTING", WoodcuttingManager.class , WoodcuttingCommand.class , false, Color.OLIVE, SkillUseType.GATHERING, AbilityType.treeFeller, ToolType.AXE, ImmutableList.of(SecondaryAbility.LEAF_BLOWER, SecondaryAbility.WOODCUTTING_DOUBLE_DROPS));
private String name; private String name;

View File

@ -211,7 +211,7 @@ public class BlockListener implements Listener {
ExcavationManager excavationManager = mcMMOPlayer.getExcavationManager(); ExcavationManager excavationManager = mcMMOPlayer.getExcavationManager();
excavationManager.excavationBlockCheck(blockState); excavationManager.excavationBlockCheck(blockState);
if (mcMMOPlayer.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER)) { if (mcMMOPlayer.getAbilityMode(AbilityType.gigaDrillBreaker)) {
excavationManager.gigaDrillBreaker(blockState); excavationManager.gigaDrillBreaker(blockState);
} }
} }
@ -301,12 +301,12 @@ public class BlockListener implements Listener {
ItemStack heldItem = player.getItemInHand(); ItemStack heldItem = player.getItemInHand();
if (HiddenConfig.getInstance().useEnchantmentBuffs()) { if (HiddenConfig.getInstance().useEnchantmentBuffs()) {
if ((ItemUtils.isPickaxe(heldItem) && !mcMMOPlayer.getAbilityMode(AbilityType.SUPER_BREAKER)) || (ItemUtils.isShovel(heldItem) && !mcMMOPlayer.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER))) { if ((ItemUtils.isPickaxe(heldItem) && !mcMMOPlayer.getAbilityMode(AbilityType.superBreaker)) || (ItemUtils.isShovel(heldItem) && !mcMMOPlayer.getAbilityMode(AbilityType.gigaDrillBreaker))) {
SkillUtils.removeAbilityBuff(heldItem); SkillUtils.removeAbilityBuff(heldItem);
} }
} }
else { else {
if ((mcMMOPlayer.getAbilityMode(AbilityType.SUPER_BREAKER) && !BlockUtils.affectedBySuperBreaker(blockState)) || (mcMMOPlayer.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER) && !BlockUtils.affectedByGigaDrillBreaker(blockState))) { if ((mcMMOPlayer.getAbilityMode(AbilityType.superBreaker) && !BlockUtils.affectedBySuperBreaker(blockState)) || (mcMMOPlayer.getAbilityMode(AbilityType.gigaDrillBreaker) && !BlockUtils.affectedByGigaDrillBreaker(blockState))) {
SkillUtils.handleAbilitySpeedDecrease(player); SkillUtils.handleAbilitySpeedDecrease(player);
} }
} }
@ -333,7 +333,7 @@ public class BlockListener implements Listener {
* *
* We don't need to check permissions here because they've already been checked for the ability to even activate. * We don't need to check permissions here because they've already been checked for the ability to even activate.
*/ */
if (mcMMOPlayer.getAbilityMode(AbilityType.TREE_FELLER) && BlockUtils.isLog(blockState) && Config.getInstance().getTreeFellerSoundsEnabled()) { if (mcMMOPlayer.getAbilityMode(AbilityType.treeFeller) && BlockUtils.isLog(blockState) && Config.getInstance().getTreeFellerSoundsEnabled()) {
player.playSound(blockState.getLocation(), Sound.FIZZ, Misc.FIZZ_VOLUME, Misc.getFizzPitch()); player.playSound(blockState.getLocation(), Sound.FIZZ, Misc.FIZZ_VOLUME, Misc.getFizzPitch());
} }
} }
@ -365,13 +365,13 @@ public class BlockListener implements Listener {
* *
* We don't need to check permissions here because they've already been checked for the ability to even activate. * We don't need to check permissions here because they've already been checked for the ability to even activate.
*/ */
if (mcMMOPlayer.getAbilityMode(AbilityType.GREEN_TERRA) && BlockUtils.canMakeMossy(blockState)) { if (mcMMOPlayer.getAbilityMode(AbilityType.greenTerra) && BlockUtils.canMakeMossy(blockState)) {
if (mcMMOPlayer.getHerbalismManager().processGreenTerra(blockState)) { if (mcMMOPlayer.getHerbalismManager().processGreenTerra(blockState)) {
blockState.update(true); blockState.update(true);
} }
} }
else if (mcMMOPlayer.getAbilityMode(AbilityType.BERSERK) && heldItem.getType() == Material.AIR) { else if (mcMMOPlayer.getAbilityMode(AbilityType.berserk) && heldItem.getType() == Material.AIR) {
if (AbilityType.BERSERK.blockCheck(block.getState()) && EventUtils.simulateBlockBreak(block, player, true)) { if (AbilityType.berserk.blockCheck(block.getState()) && EventUtils.simulateBlockBreak(block, player, true)) {
event.setInstaBreak(true); event.setInstaBreak(true);
player.playSound(block.getLocation(), Sound.ITEM_PICKUP, Misc.POP_VOLUME, Misc.getPopPitch()); player.playSound(block.getLocation(), Sound.ITEM_PICKUP, Misc.POP_VOLUME, Misc.getPopPitch());
} }

View File

@ -330,7 +330,7 @@ public class PlayerListener implements Listener {
} }
} }
if ((mcMMOPlayer.isUsingUnarmed() && ItemUtils.isSharable(dropStack)) || mcMMOPlayer.getAbilityMode(AbilityType.BERSERK)) { if ((mcMMOPlayer.isUsingUnarmed() && ItemUtils.isSharable(dropStack)) || mcMMOPlayer.getAbilityMode(AbilityType.berserk)) {
boolean pickupSuccess = Unarmed.handleItemPickup(player.getInventory(), drop); boolean pickupSuccess = Unarmed.handleItemPickup(player.getInventory(), drop);
boolean cancel = Config.getInstance().getUnarmedItemPickupDisabled() || pickupSuccess; boolean cancel = Config.getInstance().getUnarmedItemPickupDisabled() || pickupSuccess;
event.setCancelled(cancel); event.setCancelled(cancel);
@ -681,7 +681,7 @@ public class PlayerListener implements Listener {
String lowerCaseCommand = command.toLowerCase(); String lowerCaseCommand = command.toLowerCase();
// Do these ACTUALLY have to be lower case to work properly? // Do these ACTUALLY have to be lower case to work properly?
for (SkillType skill : SkillType.skillList) { for (SkillType skill : SkillType.getSkillList()) {
String skillName = skill.toString().toLowerCase(); String skillName = skill.toString().toLowerCase();
String localizedName = skill.getLocalizedName().toLowerCase(); String localizedName = skill.getLocalizedName().toLowerCase();

View File

@ -206,7 +206,8 @@ public class mcMMO extends JavaPlugin {
*/ */
@Override @Override
public void onDisable() { public void onDisable() {
try { try
{
Alchemy.finishAllBrews(); // Finish all partially complete AlchemyBrewTasks to prevent vanilla brewing continuation on restart Alchemy.finishAllBrews(); // Finish all partially complete AlchemyBrewTasks to prevent vanilla brewing continuation on restart
UserManager.saveAll(); // Make sure to save player information if the server shuts down UserManager.saveAll(); // Make sure to save player information if the server shuts down
UserManager.clearAll(); UserManager.clearAll();

View File

@ -49,7 +49,7 @@ public class McrankCommandDisplayTask extends BukkitRunnable {
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Heading")); sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Heading"));
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Player", playerName)); sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Player", playerName));
for (SkillType skill : SkillType.nonChildSkills) { for (SkillType skill : SkillType.getNonChildSkills()) {
if (!skill.getPermissions(player)) { if (!skill.getPermissions(player)) {
continue; continue;
} }
@ -60,6 +60,7 @@ public class McrankCommandDisplayTask extends BukkitRunnable {
rank = skills.get(null); rank = skills.get(null);
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Overall", (rank == null ? LocaleLoader.getString("Commands.mcrank.Unranked") : rank))); sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Overall", (rank == null ? LocaleLoader.getString("Commands.mcrank.Unranked") : rank)));
player.removeMetadata(mcMMO.databaseCommandKey, mcMMO.p);
} }
public void displayBoard() { public void displayBoard() {

View File

@ -59,7 +59,7 @@ public class FormulaConversionTask extends BukkitRunnable {
private void editValues(PlayerProfile profile) { private void editValues(PlayerProfile profile) {
mcMMO.p.debug("========================================================================"); mcMMO.p.debug("========================================================================");
mcMMO.p.debug("Conversion report for " + profile.getPlayerName() + ":"); mcMMO.p.debug("Conversion report for " + profile.getPlayerName() + ":");
for (SkillType skillType : SkillType.nonChildSkills) { for (SkillType skillType : SkillType.getNonChildSkills()) {
int oldLevel = profile.getSkillLevel(skillType); int oldLevel = profile.getSkillLevel(skillType);
int oldXPLevel = profile.getSkillXpLevel(skillType); int oldXPLevel = profile.getSkillXpLevel(skillType);
int totalOldXP = mcMMO.getFormulaManager().calculateTotalExperience(oldLevel, oldXPLevel); int totalOldXP = mcMMO.getFormulaManager().calculateTotalExperience(oldLevel, oldXPLevel);

View File

@ -32,20 +32,13 @@ public class AbilityDisableTask extends BukkitRunnable {
Player player = mcMMOPlayer.getPlayer(); Player player = mcMMOPlayer.getPlayer();
switch (ability) { if(ability == AbilityType.superBreaker || ability == AbilityType.gigaDrillBreaker) {
case SUPER_BREAKER: SkillUtils.handleAbilitySpeedDecrease(player);
case GIGA_DRILL_BREAKER: }
SkillUtils.handleAbilitySpeedDecrease(player); else if(ability == AbilityType.berserk) {
// Fallthrough if (Config.getInstance().getRefreshChunksEnabled()) {
resendChunkRadiusAt(player, 1);
case BERSERK: }
if (Config.getInstance().getRefreshChunksEnabled()) {
resendChunkRadiusAt(player, 1);
}
// Fallthrough
default:
break;
} }
EventUtils.callAbilityDeactivateEvent(player, ability); EventUtils.callAbilityDeactivateEvent(player, ability);

View File

@ -43,7 +43,7 @@ public class AxesManager extends SkillManager {
} }
public boolean canUseSkullSplitter(LivingEntity target) { public boolean canUseSkullSplitter(LivingEntity target) {
return target.isValid() && mcMMOPlayer.getAbilityMode(AbilityType.SKULL_SPLITTER) && Permissions.skullSplitter(getPlayer()); return target.isValid() && mcMMOPlayer.getAbilityMode(AbilityType.skullSplitter) && Permissions.skullSplitter(getPlayer());
} }
public boolean canActivateAbility() { public boolean canActivateAbility() {

View File

@ -22,7 +22,7 @@ public class ChildConfig extends AutoUpdateConfigLoader {
FamilyTree.clearRegistrations(); // when reloading, need to clear statics FamilyTree.clearRegistrations(); // when reloading, need to clear statics
for (SkillType skill : SkillType.childSkills) { for (SkillType skill : SkillType.getChildSkills()) {
plugin.debug("Finding parents of " + skill.getLocalizedName()); plugin.debug("Finding parents of " + skill.getLocalizedName());
Set<SkillType> parentSkills = new HashSet<SkillType>(); Set<SkillType> parentSkills = new HashSet<SkillType>();

View File

@ -65,7 +65,7 @@ public class HerbalismManager extends SkillManager {
} }
public boolean canGreenTerraBlock(BlockState blockState) { public boolean canGreenTerraBlock(BlockState blockState) {
return mcMMOPlayer.getAbilityMode(AbilityType.GREEN_TERRA) && BlockUtils.canMakeMossy(blockState); return mcMMOPlayer.getAbilityMode(AbilityType.greenTerra) && BlockUtils.canMakeMossy(blockState);
} }
public boolean canActivateAbility() { public boolean canActivateAbility() {
@ -73,7 +73,7 @@ public class HerbalismManager extends SkillManager {
} }
public boolean canGreenTerraPlant() { public boolean canGreenTerraPlant() {
return mcMMOPlayer.getAbilityMode(AbilityType.GREEN_TERRA); return mcMMOPlayer.getAbilityMode(AbilityType.greenTerra);
} }
/** /**

View File

@ -101,16 +101,16 @@ public class MiningManager extends SkillManager {
TNTPrimed tnt = player.getWorld().spawn(targetBlock.getLocation(), TNTPrimed.class); TNTPrimed tnt = player.getWorld().spawn(targetBlock.getLocation(), TNTPrimed.class);
SkillUtils.sendSkillMessage(player, AbilityType.BLAST_MINING.getAbilityPlayer(player)); SkillUtils.sendSkillMessage(player, AbilityType.blastMining.getAbilityPlayer(player));
player.sendMessage(LocaleLoader.getString("Mining.Blast.Boom")); player.sendMessage(LocaleLoader.getString("Mining.Blast.Boom"));
tnt.setMetadata(mcMMO.tntMetadataKey, mcMMOPlayer.getPlayerMetadata()); tnt.setMetadata(mcMMO.tntMetadataKey, mcMMOPlayer.getPlayerMetadata());
tnt.setFuseTicks(0); tnt.setFuseTicks(0);
targetBlock.setType(Material.AIR); targetBlock.setType(Material.AIR);
mcMMOPlayer.setAbilityDATS(AbilityType.BLAST_MINING, System.currentTimeMillis()); mcMMOPlayer.setAbilityDATS(AbilityType.blastMining, System.currentTimeMillis());
mcMMOPlayer.setAbilityInformed(AbilityType.BLAST_MINING, false); mcMMOPlayer.setAbilityInformed(AbilityType.blastMining, false);
new AbilityCooldownTask(mcMMOPlayer, AbilityType.BLAST_MINING).runTaskLaterAsynchronously(mcMMO.p, AbilityType.BLAST_MINING.getCooldown() * Misc.TICK_CONVERSION_FACTOR); new AbilityCooldownTask(mcMMOPlayer, AbilityType.blastMining).runTaskLaterAsynchronously(mcMMO.p, AbilityType.blastMining.getCooldown() * Misc.TICK_CONVERSION_FACTOR);
} }
/** /**
@ -285,7 +285,7 @@ public class MiningManager extends SkillManager {
} }
private boolean blastMiningCooldownOver() { private boolean blastMiningCooldownOver() {
int timeRemaining = mcMMOPlayer.calculateTimeRemaining(AbilityType.BLAST_MINING); int timeRemaining = mcMMOPlayer.calculateTimeRemaining(AbilityType.blastMining);
if (timeRemaining > 0) { if (timeRemaining > 0) {
getPlayer().sendMessage(LocaleLoader.getString("Skills.TooTired", timeRemaining)); getPlayer().sendMessage(LocaleLoader.getString("Skills.TooTired", timeRemaining));

View File

@ -39,7 +39,7 @@ public class SwordsManager extends SkillManager {
} }
public boolean canUseSerratedStrike() { public boolean canUseSerratedStrike() {
return mcMMOPlayer.getAbilityMode(AbilityType.SERRATED_STRIKES) && Permissions.serratedStrikes(getPlayer()); return mcMMOPlayer.getAbilityMode(AbilityType.serratedStrikes) && Permissions.serratedStrikes(getPlayer());
} }
/** /**

View File

@ -38,7 +38,7 @@ public class UnarmedManager extends SkillManager {
} }
public boolean canUseBerserk() { public boolean canUseBerserk() {
return mcMMOPlayer.getAbilityMode(AbilityType.BERSERK) && Permissions.berserk(getPlayer()); return mcMMOPlayer.getAbilityMode(AbilityType.berserk) && Permissions.berserk(getPlayer());
} }
public boolean canDisarm(LivingEntity target) { public boolean canDisarm(LivingEntity target) {

View File

@ -38,7 +38,7 @@ public class WoodcuttingManager extends SkillManager {
} }
public boolean canUseTreeFeller(ItemStack heldItem) { public boolean canUseTreeFeller(ItemStack heldItem) {
return mcMMOPlayer.getAbilityMode(AbilityType.TREE_FELLER) && Permissions.treeFeller(getPlayer()) && ItemUtils.isAxe(heldItem); return mcMMOPlayer.getAbilityMode(AbilityType.treeFeller) && Permissions.treeFeller(getPlayer()) && ItemUtils.isAxe(heldItem);
} }
protected boolean canGetDoubleDrops() { protected boolean canGetDoubleDrops() {

View File

@ -177,7 +177,7 @@ public class EventUtils {
experienceChanged = event.getExperienceChanged(); experienceChanged = event.getExperienceChanged();
PlayerProfile playerProfile = UserManager.getPlayer(player).getProfile(); PlayerProfile playerProfile = UserManager.getPlayer(player).getProfile();
for (SkillType skillType : SkillType.nonChildSkills) { for (SkillType skillType : SkillType.getNonChildSkills()) {
String skillName = skillType.toString(); String skillName = skillType.toString();
int playerSkillLevel = playerProfile.getSkillLevel(skillType); int playerSkillLevel = playerProfile.getSkillLevel(skillType);
@ -215,7 +215,7 @@ public class EventUtils {
McMMOPlayer killerPlayer = UserManager.getPlayer(killer); McMMOPlayer killerPlayer = UserManager.getPlayer(killer);
PlayerProfile victimProfile = UserManager.getPlayer(victim).getProfile(); PlayerProfile victimProfile = UserManager.getPlayer(victim).getProfile();
for (SkillType skillType : SkillType.nonChildSkills) { for (SkillType skillType : SkillType.getNonChildSkills()) {
String skillName = skillType.toString(); String skillName = skillType.toString();
int victimSkillLevel = victimProfile.getSkillLevel(skillType); int victimSkillLevel = victimProfile.getSkillLevel(skillType);

View File

@ -23,7 +23,7 @@ public final class HardcoreManager {
HashMap<String, Integer> levelChanged = new HashMap<String, Integer>(); HashMap<String, Integer> levelChanged = new HashMap<String, Integer>();
HashMap<String, Float> experienceChanged = new HashMap<String, Float>(); HashMap<String, Float> experienceChanged = new HashMap<String, Float>();
for (SkillType skillType : SkillType.nonChildSkills) { for (SkillType skillType : SkillType.getNonChildSkills()) {
if (!skillType.getHardcoreStatLossEnabled()) { if (!skillType.getHardcoreStatLossEnabled()) {
break; break;
} }
@ -62,7 +62,7 @@ public final class HardcoreManager {
HashMap<String, Integer> levelChanged = new HashMap<String, Integer>(); HashMap<String, Integer> levelChanged = new HashMap<String, Integer>();
HashMap<String, Float> experienceChanged = new HashMap<String, Float>(); HashMap<String, Float> experienceChanged = new HashMap<String, Float>();
for (SkillType skillType : SkillType.nonChildSkills) { for (SkillType skillType : SkillType.getNonChildSkills()) {
if (!skillType.getHardcoreVampirismEnabled()) { if (!skillType.getHardcoreVampirismEnabled()) {
break; break;
} }
@ -107,7 +107,7 @@ public final class HardcoreManager {
public static boolean isStatLossEnabled() { public static boolean isStatLossEnabled() {
boolean enabled = false; boolean enabled = false;
for (SkillType skillType : SkillType.nonChildSkills) { for (SkillType skillType : SkillType.getNonChildSkills()) {
if (skillType.getHardcoreStatLossEnabled()) { if (skillType.getHardcoreStatLossEnabled()) {
enabled = true; enabled = true;
break; break;
@ -125,7 +125,7 @@ public final class HardcoreManager {
public static boolean isVampirismEnabled() { public static boolean isVampirismEnabled() {
boolean enabled = false; boolean enabled = false;
for (SkillType skillType : SkillType.nonChildSkills) { for (SkillType skillType : SkillType.getNonChildSkills()) {
if (skillType.getHardcoreVampirismEnabled()) { if (skillType.getHardcoreVampirismEnabled()) {
enabled = true; enabled = true;
break; break;

View File

@ -85,7 +85,7 @@ public final class Motd {
* @param player Target player * @param player Target player
*/ */
public static void displayXpPerks(Player player) { public static void displayXpPerks(Player player) {
for (SkillType skill : SkillType.skillList) { for (SkillType skill : SkillType.getSkillList()) {
if (PerksUtils.handleXpPerks(player, 1, skill) > 1) { if (PerksUtils.handleXpPerks(player, 1, skill) > 1) {
player.sendMessage(PERK_PREFIX + LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Perks.XP.Name"), LocaleLoader.getString("Perks.XP.Desc"))); player.sendMessage(PERK_PREFIX + LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Perks.XP.Name"), LocaleLoader.getString("Perks.XP.Desc")));
return; return;
@ -126,7 +126,7 @@ public final class Motd {
* @param player Target player * @param player Target player
*/ */
public static void displayLuckyPerks(Player player) { public static void displayLuckyPerks(Player player) {
for (SkillType skill : SkillType.skillList) { for (SkillType skill : SkillType.getSkillList()) {
if (Permissions.lucky(player, skill)) { if (Permissions.lucky(player, skill)) {
player.sendMessage(PERK_PREFIX + LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Perks.Lucky.Name"), LocaleLoader.getString("Perks.Lucky.Desc.Login"))); player.sendMessage(PERK_PREFIX + LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Perks.Lucky.Name"), LocaleLoader.getString("Perks.Lucky.Desc.Login")));
return; return;

View File

@ -61,7 +61,7 @@ public final class CommandRegistrationManager {
private static String permissionsMessage = LocaleLoader.getString("mcMMO.NoPermission"); private static String permissionsMessage = LocaleLoader.getString("mcMMO.NoPermission");
private static void registerSkillCommands() { private static void registerSkillCommands() {
for (SkillType skill : SkillType.skillList) { for (SkillType skill : SkillType.getSkillList()) {
String commandName = skill.toString().toLowerCase(); String commandName = skill.toString().toLowerCase();
String localizedName = skill.getLocalizedName().toLowerCase(); String localizedName = skill.getLocalizedName().toLowerCase();

View File

@ -181,7 +181,7 @@ public final class CommandUtils {
* @param display The sender to display stats to * @param display The sender to display stats to
*/ */
public static void printGatheringSkills(Player inspect, CommandSender display) { public static void printGatheringSkills(Player inspect, CommandSender display) {
printGroupedSkillData(inspect, display, LocaleLoader.getString("Stats.Header.Gathering"), SkillType.gatheringSkills); printGroupedSkillData(inspect, display, LocaleLoader.getString("Stats.Header.Gathering"), SkillType.getGatheringSkills());
} }
public static void printGatheringSkills(Player player) { public static void printGatheringSkills(Player player) {
@ -195,7 +195,7 @@ public final class CommandUtils {
* @param display The sender to display stats to * @param display The sender to display stats to
*/ */
public static void printCombatSkills(Player inspect, CommandSender display) { public static void printCombatSkills(Player inspect, CommandSender display) {
printGroupedSkillData(inspect, display, LocaleLoader.getString("Stats.Header.Combat"), SkillType.combatSkills); printGroupedSkillData(inspect, display, LocaleLoader.getString("Stats.Header.Combat"), SkillType.getCombatSkills());
} }
public static void printCombatSkills(Player player) { public static void printCombatSkills(Player player) {
@ -209,7 +209,7 @@ public final class CommandUtils {
* @param display The sender to display stats to * @param display The sender to display stats to
*/ */
public static void printMiscSkills(Player inspect, CommandSender display) { public static void printMiscSkills(Player inspect, CommandSender display) {
printGroupedSkillData(inspect, display, LocaleLoader.getString("Stats.Header.Misc"), SkillType.miscSkills); printGroupedSkillData(inspect, display, LocaleLoader.getString("Stats.Header.Misc"), SkillType.getMiscSkills());
} }
public static void printMiscSkills(Player player) { public static void printMiscSkills(Player player) {

View File

@ -76,7 +76,7 @@ public class ScoreboardManager {
Collections.shuffle(colors, Misc.getRandom()); Collections.shuffle(colors, Misc.getRandom());
int i = 0; int i = 0;
for (SkillType type : SkillType.skillList) { for (SkillType type : SkillType.getSkillList()) {
// Include child skills // Include child skills
skillLabelBuilder.put(type, getShortenedName(colors.get(i) + type.getLocalizedName(), false)); skillLabelBuilder.put(type, getShortenedName(colors.get(i) + type.getLocalizedName(), false));
@ -84,7 +84,7 @@ public class ScoreboardManager {
abilityLabelBuilder.put(type.getAbility(), getShortenedName(colors.get(i) + type.getAbility().getName())); abilityLabelBuilder.put(type.getAbility(), getShortenedName(colors.get(i) + type.getAbility().getName()));
if (type == SkillType.mining) { if (type == SkillType.mining) {
abilityLabelBuilder.put(AbilityType.BLAST_MINING, getShortenedName(colors.get(i) + AbilityType.BLAST_MINING.getName())); abilityLabelBuilder.put(AbilityType.blastMining, getShortenedName(colors.get(i) + AbilityType.blastMining.getName()));
} }
} }
@ -94,7 +94,7 @@ public class ScoreboardManager {
} }
} }
else { else {
for (SkillType type : SkillType.skillList) { for (SkillType type : SkillType.getSkillList()) {
// Include child skills // Include child skills
skillLabelBuilder.put(type, getShortenedName(ChatColor.GREEN + type.getLocalizedName())); skillLabelBuilder.put(type, getShortenedName(ChatColor.GREEN + type.getLocalizedName()));
@ -102,14 +102,14 @@ public class ScoreboardManager {
abilityLabelBuilder.put(type.getAbility(), getShortenedName(ChatColor.AQUA + type.getAbility().getName())); abilityLabelBuilder.put(type.getAbility(), getShortenedName(ChatColor.AQUA + type.getAbility().getName()));
if (type == SkillType.mining) { if (type == SkillType.mining) {
abilityLabelBuilder.put(AbilityType.BLAST_MINING, getShortenedName(ChatColor.AQUA + AbilityType.BLAST_MINING.getName())); abilityLabelBuilder.put(AbilityType.blastMining, getShortenedName(ChatColor.AQUA + AbilityType.blastMining.getName()));
} }
} }
} }
} }
for (AbilityType type : AbilityType.values()) { for (AbilityType type : AbilityType.getAbilities()) {
abilityLabelSkillBuilder.put(type, getShortenedName((type == AbilityType.BLAST_MINING ? ChatColor.BLUE : ChatColor.AQUA) + type.getName())); abilityLabelSkillBuilder.put(type, getShortenedName((type == AbilityType.blastMining ? ChatColor.BLUE : ChatColor.AQUA) + type.getName()));
} }
skillLabels = skillLabelBuilder.build(); skillLabels = skillLabelBuilder.build();

View File

@ -428,10 +428,10 @@ public class ScoreboardWrapper {
if (targetSkill == SkillType.mining) { if (targetSkill == SkillType.mining) {
// Special-Case: Mining has two abilities, both with cooldowns // Special-Case: Mining has two abilities, both with cooldowns
Score cooldownSB = sidebarObjective.getScore(ScoreboardManager.abilityLabelsSkill.get(AbilityType.SUPER_BREAKER)); Score cooldownSB = sidebarObjective.getScore(ScoreboardManager.abilityLabelsSkill.get(AbilityType.superBreaker));
Score cooldownBM = sidebarObjective.getScore(ScoreboardManager.abilityLabelsSkill.get(AbilityType.BLAST_MINING)); Score cooldownBM = sidebarObjective.getScore(ScoreboardManager.abilityLabelsSkill.get(AbilityType.blastMining));
int secondsSB = Math.max(mcMMOPlayer.calculateTimeRemaining(AbilityType.SUPER_BREAKER), 0); int secondsSB = Math.max(mcMMOPlayer.calculateTimeRemaining(AbilityType.superBreaker), 0);
int secondsBM = Math.max(mcMMOPlayer.calculateTimeRemaining(AbilityType.BLAST_MINING), 0); int secondsBM = Math.max(mcMMOPlayer.calculateTimeRemaining(AbilityType.blastMining), 0);
cooldownSB.setScore(secondsSB); cooldownSB.setScore(secondsSB);
cooldownBM.setScore(secondsBM); cooldownBM.setScore(secondsBM);
@ -460,7 +460,7 @@ public class ScoreboardWrapper {
case COOLDOWNS_BOARD: case COOLDOWNS_BOARD:
boolean anyCooldownsActive = false; boolean anyCooldownsActive = false;
for (AbilityType ability : AbilityType.values()) { for (AbilityType ability : AbilityType.getAbilities()) {
int seconds = Math.max(mcMMOPlayer.calculateTimeRemaining(ability), 0); int seconds = Math.max(mcMMOPlayer.calculateTimeRemaining(ability), 0);
if (seconds != 0) { if (seconds != 0) {
@ -494,7 +494,7 @@ public class ScoreboardWrapper {
// Calculate power level here // Calculate power level here
int powerLevel = 0; int powerLevel = 0;
for (SkillType skill : SkillType.nonChildSkills) { // Don't include child skills, makes the list too long for (SkillType skill : SkillType.getNonChildSkills()) { // Don't include child skills, makes the list too long
int level = newProfile.getSkillLevel(skill); int level = newProfile.getSkillLevel(skill);
powerLevel += level; powerLevel += level;
@ -527,7 +527,7 @@ public class ScoreboardWrapper {
Integer rank; Integer rank;
Player player = mcMMO.p.getServer().getPlayerExact(playerName); Player player = mcMMO.p.getServer().getPlayerExact(playerName);
for (SkillType skill : SkillType.nonChildSkills) { for (SkillType skill : SkillType.getNonChildSkills()) {
if (!skill.getPermissions(player)) { if (!skill.getPermissions(player)) {
continue; continue;
} }

View File

@ -132,7 +132,7 @@ public class SkillUtils {
} }
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
SkillType skill = mcMMOPlayer.getAbilityMode(AbilityType.SUPER_BREAKER) ? SkillType.mining : SkillType.excavation; SkillType skill = mcMMOPlayer.getAbilityMode(AbilityType.superBreaker) ? SkillType.mining : SkillType.excavation;
int ticks = PerksUtils.handleActivationPerks(player, 2 + (mcMMOPlayer.getSkillLevel(skill) / AdvancedConfig.getInstance().getAbilityLength()), skill.getAbility().getMaxLength()) * Misc.TICK_CONVERSION_FACTOR; int ticks = PerksUtils.handleActivationPerks(player, 2 + (mcMMOPlayer.getSkillLevel(skill) / AdvancedConfig.getInstance().getAbilityLength()), skill.getAbility().getMaxLength()) * Misc.TICK_CONVERSION_FACTOR;
PotionEffect abilityBuff = new PotionEffect(PotionEffectType.FAST_DIGGING, duration + ticks, amplifier + 10); PotionEffect abilityBuff = new PotionEffect(PotionEffectType.FAST_DIGGING, duration + ticks, amplifier + 10);
@ -229,7 +229,7 @@ public class SkillUtils {
} }
private static boolean isLocalizedSkill(String skillName) { private static boolean isLocalizedSkill(String skillName) {
for (SkillType skill : SkillType.skillList) { for (SkillType skill : SkillType.getSkillList()) {
if (skillName.equalsIgnoreCase(LocaleLoader.getString(StringUtils.getCapitalized(skill.toString()) + ".SkillName"))) { if (skillName.equalsIgnoreCase(LocaleLoader.getString(StringUtils.getCapitalized(skill.toString()) + ".SkillName"))) {
return true; return true;
} }

View File

@ -7,3 +7,4 @@ Upgrades_Finished:
DROP_SQL_PARTY_NAMES: false DROP_SQL_PARTY_NAMES: false
DROP_SPOUT: false DROP_SPOUT: false
ADD_ALCHEMY: false ADD_ALCHEMY: false
ADD_INDEX_NAMES: true