From a2c0a02d30e327706ffd37bbe459ed3216ba987a Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 9 Feb 2019 03:03:21 -0800 Subject: [PATCH 01/28] Planning this out is actually quite hard, getting sleepy now so I'll flesh this out tomorrow. --- .../com/gmail/nossr50/datatypes/Block.java | 10 ++++++ .../nossr50/datatypes/BlockProperty.java | 8 +++++ .../gmail/nossr50/datatypes/BlockState.java | 8 +++++ .../datatypes/TargetMinecraftVersion.java | 13 ++++++++ .../nossr50/platform/AbstractPlatform.java | 8 +++++ .../com/gmail/nossr50/platform/Platform.java | 33 +++++++++++++++++++ .../platform/PlatformSoftwareType.java | 10 ++++++ 7 files changed, 90 insertions(+) create mode 100644 core/src/main/java/com/gmail/nossr50/datatypes/Block.java create mode 100644 core/src/main/java/com/gmail/nossr50/datatypes/BlockProperty.java create mode 100644 core/src/main/java/com/gmail/nossr50/datatypes/BlockState.java create mode 100644 core/src/main/java/com/gmail/nossr50/datatypes/TargetMinecraftVersion.java create mode 100644 core/src/main/java/com/gmail/nossr50/platform/AbstractPlatform.java create mode 100644 core/src/main/java/com/gmail/nossr50/platform/Platform.java create mode 100644 core/src/main/java/com/gmail/nossr50/platform/PlatformSoftwareType.java diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/Block.java b/core/src/main/java/com/gmail/nossr50/datatypes/Block.java new file mode 100644 index 000000000..0fd095d76 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/datatypes/Block.java @@ -0,0 +1,10 @@ +package com.gmail.nossr50.datatypes; + +/** + * Represents a container of properties and values for a Block + * @see BlockProperty + * @see BlockState + */ +public interface Block { + +} diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/BlockProperty.java b/core/src/main/java/com/gmail/nossr50/datatypes/BlockProperty.java new file mode 100644 index 000000000..58c307e9c --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/datatypes/BlockProperty.java @@ -0,0 +1,8 @@ +package com.gmail.nossr50.datatypes; + +/** + * BlockProperties are key value pairs for a blocks state + */ +public interface BlockProperty { + +} diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/BlockState.java b/core/src/main/java/com/gmail/nossr50/datatypes/BlockState.java new file mode 100644 index 000000000..2d4652ee3 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/datatypes/BlockState.java @@ -0,0 +1,8 @@ +package com.gmail.nossr50.datatypes; + +/** + * Representation of the state for a Block + */ +public interface BlockState { + +} diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/TargetMinecraftVersion.java b/core/src/main/java/com/gmail/nossr50/datatypes/TargetMinecraftVersion.java new file mode 100644 index 000000000..47e4b7683 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/datatypes/TargetMinecraftVersion.java @@ -0,0 +1,13 @@ +package com.gmail.nossr50.datatypes; + +import com.gmail.nossr50.platform.Platform; + +/** + * Constants for targeted versions of MC + * @see Platform#getTargetMinecraftVersion() + */ +public class TargetMinecraftVersion { + public static final String MC_VERSION_1_8_8 = "1_8_8"; + public static final String MC_VERSION_1_12_2 = "1_12_2"; + public static final String MC_VERSION_1_13_2 = "1_13_2"; +} diff --git a/core/src/main/java/com/gmail/nossr50/platform/AbstractPlatform.java b/core/src/main/java/com/gmail/nossr50/platform/AbstractPlatform.java new file mode 100644 index 000000000..85c2616aa --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/platform/AbstractPlatform.java @@ -0,0 +1,8 @@ +package com.gmail.nossr50.platform; + +/** + * This is the implementation of the Platform Interface + */ +public abstract class AbstractPlatform implements Platform { + +} diff --git a/core/src/main/java/com/gmail/nossr50/platform/Platform.java b/core/src/main/java/com/gmail/nossr50/platform/Platform.java new file mode 100644 index 000000000..7c953f889 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/platform/Platform.java @@ -0,0 +1,33 @@ +package com.gmail.nossr50.platform; + +/** + * Represents the current API Platform + * mcMMO supports multiple platforms, so that abstraction is handled through this interface + */ +public interface Platform { + + /** + * Gets the name of the Platform + * @return name of this platform + */ + String getPlatformName(); + + /** + * Gets the version of this platform + * @return the current version of this platform + */ + String getPlatformVersion(); + + /** + * Gets the target version of Minecraft for this platform + * @return this platform's target minecraft version + */ + String getTargetMinecraftVersion(); + + /** + * Whether or not this platform has been loaded + * @return true if the platform is loaded + */ + Boolean isPlatformLoaded(); + +} diff --git a/core/src/main/java/com/gmail/nossr50/platform/PlatformSoftwareType.java b/core/src/main/java/com/gmail/nossr50/platform/PlatformSoftwareType.java new file mode 100644 index 000000000..15c19c069 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/platform/PlatformSoftwareType.java @@ -0,0 +1,10 @@ +package com.gmail.nossr50.platform; + +/** + * Constants representing the software the platform belongs to + */ +public enum PlatformSoftwareType { + NMS, + BUKKIT, + SPONGE +} From b40b206bf5a24457cad2f12672eaea1f99479529 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 9 Feb 2019 19:38:31 -0800 Subject: [PATCH 02/28] Fleshing out Abstractions for World, Location, Block, BlockState --- .../com/gmail/nossr50/datatypes/Block.java | 10 ----- .../nossr50/datatypes/BlockProperty.java | 8 ---- .../gmail/nossr50/datatypes/BlockState.java | 8 ---- .../com/gmail/nossr50/datatypes/Location.java | 32 ++++++++++++++ .../com/gmail/nossr50/datatypes/Property.java | 9 ++++ .../com/gmail/nossr50/datatypes/World.java | 5 +++ .../gmail/nossr50/datatypes/block/Block.java | 38 ++++++++++++++++ .../nossr50/datatypes/block/BlockState.java | 44 +++++++++++++++++++ .../TargetMinecraftVersion.java | 4 +- 9 files changed, 129 insertions(+), 29 deletions(-) delete mode 100644 core/src/main/java/com/gmail/nossr50/datatypes/Block.java delete mode 100644 core/src/main/java/com/gmail/nossr50/datatypes/BlockProperty.java delete mode 100644 core/src/main/java/com/gmail/nossr50/datatypes/BlockState.java create mode 100644 core/src/main/java/com/gmail/nossr50/datatypes/Location.java create mode 100644 core/src/main/java/com/gmail/nossr50/datatypes/Property.java create mode 100644 core/src/main/java/com/gmail/nossr50/datatypes/World.java create mode 100644 core/src/main/java/com/gmail/nossr50/datatypes/block/Block.java create mode 100644 core/src/main/java/com/gmail/nossr50/datatypes/block/BlockState.java rename core/src/main/java/com/gmail/nossr50/{datatypes => platform}/TargetMinecraftVersion.java (79%) diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/Block.java b/core/src/main/java/com/gmail/nossr50/datatypes/Block.java deleted file mode 100644 index 0fd095d76..000000000 --- a/core/src/main/java/com/gmail/nossr50/datatypes/Block.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.gmail.nossr50.datatypes; - -/** - * Represents a container of properties and values for a Block - * @see BlockProperty - * @see BlockState - */ -public interface Block { - -} diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/BlockProperty.java b/core/src/main/java/com/gmail/nossr50/datatypes/BlockProperty.java deleted file mode 100644 index 58c307e9c..000000000 --- a/core/src/main/java/com/gmail/nossr50/datatypes/BlockProperty.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.gmail.nossr50.datatypes; - -/** - * BlockProperties are key value pairs for a blocks state - */ -public interface BlockProperty { - -} diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/BlockState.java b/core/src/main/java/com/gmail/nossr50/datatypes/BlockState.java deleted file mode 100644 index 2d4652ee3..000000000 --- a/core/src/main/java/com/gmail/nossr50/datatypes/BlockState.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.gmail.nossr50.datatypes; - -/** - * Representation of the state for a Block - */ -public interface BlockState { - -} diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/Location.java b/core/src/main/java/com/gmail/nossr50/datatypes/Location.java new file mode 100644 index 000000000..39e361d2e --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/datatypes/Location.java @@ -0,0 +1,32 @@ +package com.gmail.nossr50.datatypes; + +/** + * This class represents a Location in MC + * Locations have a world and x, y, and z axis values + */ +public interface Location { + + /** + * Returns the position of this location on the x-axis + * @return x-axis position + */ + double getX(); + + /** + * Returns the position of this location on the y-axis + * @return y-axis position + */ + double getY(); + + /** + * Returns the position of this location on the z-axis + * @return z-axis position + */ + double getZ(); + + /** + * The world for this Location + * @return the world of this location + */ + World getWorld(); +} diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/Property.java b/core/src/main/java/com/gmail/nossr50/datatypes/Property.java new file mode 100644 index 000000000..778c1f04f --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/datatypes/Property.java @@ -0,0 +1,9 @@ +package com.gmail.nossr50.datatypes; + +/** + * Properties are Comparable key value pairs for a blocks state + * In MC this exists in three forms, Integer, Booleans, and Enums + */ +public interface Property> { + +} diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/World.java b/core/src/main/java/com/gmail/nossr50/datatypes/World.java new file mode 100644 index 000000000..42b01e6a1 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/datatypes/World.java @@ -0,0 +1,5 @@ +package com.gmail.nossr50.datatypes; + +public interface World { + +} diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/block/Block.java b/core/src/main/java/com/gmail/nossr50/datatypes/block/Block.java new file mode 100644 index 000000000..95a738ad9 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/datatypes/block/Block.java @@ -0,0 +1,38 @@ +package com.gmail.nossr50.datatypes.block; + +import com.gmail.nossr50.datatypes.Property; + +/** + * Represents a container of properties and values for a Block + * @see Property + * @see BlockState + */ +public class Block { + + private final String unlocalizedName; //The name before it is localized (english) + private BlockState blockState; + + public Block(String unlocalizedName, BlockState blockState) + { + this.unlocalizedName = unlocalizedName; + this.blockState = blockState; + } + + /** + * Gets the name of this block in English + * @return name of this block in English + */ + public String getUnlocalizedName() + { + return unlocalizedName; + } + + /** + * Gets the state of this block + * @return the state of this block + */ + public BlockState getBlockState() + { + return blockState; + } +} diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/block/BlockState.java b/core/src/main/java/com/gmail/nossr50/datatypes/block/BlockState.java new file mode 100644 index 000000000..ee4df050a --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/datatypes/block/BlockState.java @@ -0,0 +1,44 @@ +package com.gmail.nossr50.datatypes.block; + +import com.gmail.nossr50.datatypes.Property; +import com.google.common.collect.ImmutableMap; + +import java.util.Collection; + +/** + * Representation of the state for a Block + * This tries to mirror MC internals, but only the parts mcMMO cares about + */ +public interface BlockState { + //This is the immutable map of all properties for this block state + ImmutableMap, Comparable> getImmutablePropertyMap(); + + //This will return the keyset for properties on this block state + Collection> getPropertyKeyset(); + + //TODO: I don't know if we need to mirror the cycling of properties + + /** + * Get the value for the given property key + * @param property the property key + * @param the type of property + * @return the value, can be null + */ + > T getPropertyValue(Property property); + + /** + * This will attempt to find a matching property for this block state + * @param property the property we want to match + * @param value the value we are trying to match + * @param the type of the property + * @param the type of the value + * @return the matching property on this block state, can be null + */ + , V extends T> BlockState findProperty(Property property, V value); + + /** + * This returns the block that this state belongs to + * @return the parent Block + */ + Block getBlock(); +} diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/TargetMinecraftVersion.java b/core/src/main/java/com/gmail/nossr50/platform/TargetMinecraftVersion.java similarity index 79% rename from core/src/main/java/com/gmail/nossr50/datatypes/TargetMinecraftVersion.java rename to core/src/main/java/com/gmail/nossr50/platform/TargetMinecraftVersion.java index 47e4b7683..84148259b 100644 --- a/core/src/main/java/com/gmail/nossr50/datatypes/TargetMinecraftVersion.java +++ b/core/src/main/java/com/gmail/nossr50/platform/TargetMinecraftVersion.java @@ -1,6 +1,4 @@ -package com.gmail.nossr50.datatypes; - -import com.gmail.nossr50.platform.Platform; +package com.gmail.nossr50.platform; /** * Constants for targeted versions of MC From 380d4be9c9bc0b277cc7a80e0f585854a5dc1385 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 9 Feb 2019 21:03:28 -0800 Subject: [PATCH 03/28] Moving stuff into the core package and fleshing out some more abstractions --- .../com/gmail/nossr50/api/AbilityAPI.java | 6 +-- .../java/com/gmail/nossr50/api/ChatAPI.java | 4 +- .../com/gmail/nossr50/api/ExperienceAPI.java | 16 +++--- .../java/com/gmail/nossr50/api/PartyAPI.java | 10 ++-- .../java/com/gmail/nossr50/api/SkillAPI.java | 2 +- .../gmail/nossr50/chat/AdminChatManager.java | 2 +- .../com/gmail/nossr50/chat/ChatManager.java | 4 +- .../nossr50/chat/ChatManagerFactory.java | 2 +- .../gmail/nossr50/chat/PartyChatManager.java | 4 +- .../gmail/nossr50/commands/MHDCommand.java | 10 ++-- .../nossr50/commands/McImportCommand.java | 2 +- .../nossr50/commands/McabilityCommand.java | 2 +- .../nossr50/commands/McconvertCommand.java | 6 +-- .../gmail/nossr50/commands/McgodCommand.java | 2 +- .../gmail/nossr50/commands/McmmoCommand.java | 2 +- .../nossr50/commands/McnotifyCommand.java | 4 +- .../nossr50/commands/McrefreshCommand.java | 2 +- .../nossr50/commands/McscoreboardCommand.java | 2 +- .../gmail/nossr50/commands/ToggleCommand.java | 4 +- .../gmail/nossr50/commands/XprateCommand.java | 2 +- .../commands/chat/AdminChatCommand.java | 2 +- .../nossr50/commands/chat/ChatCommand.java | 10 ++-- .../nossr50/commands/chat/McChatSpy.java | 2 +- .../commands/chat/PartyChatCommand.java | 10 ++-- .../database/ConvertDatabaseCommand.java | 10 ++-- .../commands/database/McpurgeCommand.java | 2 +- .../commands/database/McremoveCommand.java | 2 +- .../commands/database/MmoshowdbCommand.java | 4 +- .../commands/experience/AddlevelsCommand.java | 6 +-- .../commands/experience/AddxpCommand.java | 10 ++-- .../experience/ConvertExperienceCommand.java | 4 +- .../experience/ExperienceCommand.java | 8 +-- .../commands/experience/MmoeditCommand.java | 6 +-- .../experience/SkillresetCommand.java | 10 ++-- .../commands/hardcore/HardcoreCommand.java | 4 +- .../hardcore/HardcoreModeCommand.java | 2 +- .../commands/hardcore/VampirismCommand.java | 4 +- .../commands/party/PartyAcceptCommand.java | 4 +- .../party/PartyChangeOwnerCommand.java | 4 +- .../party/PartyChangePasswordCommand.java | 4 +- .../nossr50/commands/party/PartyCommand.java | 6 +-- .../commands/party/PartyCreateCommand.java | 4 +- .../commands/party/PartyDisbandCommand.java | 4 +- .../commands/party/PartyInfoCommand.java | 12 ++--- .../commands/party/PartyInviteCommand.java | 8 +-- .../commands/party/PartyItemShareCommand.java | 12 ++--- .../commands/party/PartyJoinCommand.java | 6 +-- .../commands/party/PartyKickCommand.java | 4 +- .../commands/party/PartyLockCommand.java | 4 +- .../commands/party/PartyQuitCommand.java | 6 +-- .../commands/party/PartyRenameCommand.java | 6 +-- .../commands/party/PartyXpShareCommand.java | 10 ++-- .../alliance/PartyAllianceAcceptCommand.java | 4 +- .../party/alliance/PartyAllianceCommand.java | 10 ++-- .../alliance/PartyAllianceDisbandCommand.java | 6 +-- .../alliance/PartyAllianceInviteCommand.java | 6 +-- .../party/teleport/PtpAcceptAnyCommand.java | 4 +- .../party/teleport/PtpAcceptCommand.java | 6 +-- .../commands/party/teleport/PtpCommand.java | 14 +++--- .../party/teleport/PtpToggleCommand.java | 4 +- .../commands/player/InspectCommand.java | 10 ++-- .../commands/player/MccooldownCommand.java | 8 +-- .../commands/player/McrankCommand.java | 6 +-- .../commands/player/McstatsCommand.java | 4 +- .../nossr50/commands/player/MctopCommand.java | 8 +-- .../commands/skills/AcrobaticsCommand.java | 6 +-- .../commands/skills/AlchemyCommand.java | 6 +-- .../commands/skills/ArcheryCommand.java | 4 +- .../nossr50/commands/skills/AxesCommand.java | 6 +-- .../commands/skills/ExcavationCommand.java | 4 +- .../commands/skills/FishingCommand.java | 12 ++--- .../commands/skills/HerbalismCommand.java | 4 +- .../commands/skills/MiningCommand.java | 6 +-- .../commands/skills/MmoInfoCommand.java | 6 +-- .../commands/skills/RepairCommand.java | 8 +-- .../commands/skills/SalvageCommand.java | 6 +-- .../nossr50/commands/skills/SkillCommand.java | 12 ++--- .../commands/skills/SkillGuideCommand.java | 2 +- .../commands/skills/SmeltingCommand.java | 6 +-- .../commands/skills/SwordsCommand.java | 8 +-- .../commands/skills/TamingCommand.java | 4 +- .../commands/skills/UnarmedCommand.java | 6 +-- .../commands/skills/WoodcuttingCommand.java | 4 +- .../{ => core}/datatypes/LimitedSizeList.java | 2 +- .../datatypes/MobHealthbarType.java | 2 +- .../{ => core}/datatypes/chat/ChatMode.java | 2 +- .../datatypes/database/DatabaseType.java | 2 +- .../datatypes/database/PlayerStat.java | 2 +- .../datatypes/database/UpgradeType.java | 2 +- .../datatypes/experience/FormulaType.java | 2 +- .../datatypes/experience/SkillXpGain.java | 4 +- .../datatypes/experience/XPGainReason.java | 2 +- .../datatypes/experience/XPGainSource.java | 2 +- .../interactions/NotificationType.java | 2 +- .../datatypes/json/CustomBaseComponent.java | 2 +- .../{ => core}/datatypes/json/McMMOUrl.java | 2 +- .../datatypes/json/McMMOWebLinks.java | 2 +- .../{ => core}/datatypes/meta/OldName.java | 2 +- .../datatypes/mods/CustomBlock.java | 2 +- .../datatypes/mods/CustomEntity.java | 2 +- .../{ => core}/datatypes/mods/CustomTool.java | 2 +- .../datatypes/party/ItemShareType.java | 2 +- .../{ => core}/datatypes/party/Party.java | 6 +-- .../datatypes/party/PartyFeature.java | 4 +- .../datatypes/party/PartyLeader.java | 2 +- .../datatypes/party/PartyTeleportRecord.java | 4 +- .../{ => core}/datatypes/party/ShareMode.java | 2 +- .../datatypes/player/McMMOPlayer.java | 30 ++++++------ .../datatypes/player/PlayerProfile.java | 18 +++---- .../datatypes/player/UniqueDataType.java | 2 +- .../{ => core}/datatypes/skills/ItemType.java | 2 +- .../datatypes/skills/MaterialType.java | 2 +- .../datatypes/skills/ModConfigType.java | 2 +- .../datatypes/skills/PrimarySkillType.java | 4 +- .../datatypes/skills/SubSkillFlags.java | 2 +- .../datatypes/skills/SubSkillType.java | 2 +- .../datatypes/skills/SuperAbilityType.java | 4 +- .../{ => core}/datatypes/skills/ToolType.java | 2 +- .../skills/alchemy/AlchemyPotion.java | 2 +- .../datatypes/skills/alchemy/PotionStage.java | 2 +- .../skills/interfaces/ChildSkill.java | 4 +- .../skills/interfaces/CoreSkill.java | 4 +- .../skills/interfaces/Localized.java | 2 +- .../datatypes/skills/interfaces/Skill.java | 4 +- .../datatypes/skills/interfaces/Toolable.java | 2 +- .../skills/progression/Progression.java | 4 +- .../skills/subskills/AbstractSubSkill.java | 14 +++--- .../acrobatics/AcrobaticsSubSkill.java | 10 ++-- .../skills/subskills/acrobatics/Roll.java | 20 ++++---- .../subskills/interfaces/InteractType.java | 2 +- .../subskills/interfaces/Interaction.java | 2 +- .../skills/subskills/interfaces/Rank.java | 2 +- .../skills/subskills/interfaces/SubSkill.java | 4 +- .../interfaces/SubSkillProperties.java | 2 +- .../treasure/EnchantmentTreasure.java | 2 +- .../treasure/ExcavationTreasure.java | 2 +- .../datatypes/treasure/FishingTreasure.java | 2 +- .../datatypes/treasure/HylianTreasure.java | 2 +- .../{ => core}/datatypes/treasure/Rarity.java | 2 +- .../datatypes/treasure/ShakeTreasure.java | 2 +- .../datatypes/treasure/Treasure.java | 4 +- .../McMMOPlayerExperienceEvent.java | 6 +-- .../McMMOPlayerLevelChangeEvent.java | 4 +- .../experience/McMMOPlayerLevelDownEvent.java | 4 +- .../experience/McMMOPlayerLevelUpEvent.java | 4 +- .../experience/McMMOPlayerXpGainEvent.java | 4 +- .../events/party/McMMOPartyLevelUpEvent.java | 2 +- .../events/party/McMMOPartyXpGainEvent.java | 2 +- .../skills/McMMOPlayerNotificationEvent.java | 2 +- .../events/skills/McMMOPlayerSkillEvent.java | 4 +- .../McMMOPlayerAbilityActivateEvent.java | 2 +- .../McMMOPlayerAbilityDeactivateEvent.java | 2 +- .../abilities/McMMOPlayerAbilityEvent.java | 4 +- .../skills/alchemy/McMMOPlayerBrewEvent.java | 2 +- .../alchemy/McMMOPlayerCatalysisEvent.java | 2 +- .../fishing/McMMOPlayerFishingEvent.java | 2 +- .../repair/McMMOPlayerRepairCheckEvent.java | 2 +- .../salvage/McMMOPlayerSalvageCheckEvent.java | 2 +- .../secondaryabilities/SubSkillEvent.java | 6 +-- .../SubSkillRandomCheckEvent.java | 4 +- .../unarmed/McMMOPlayerDisarmEvent.java | 2 +- .../nossr50/listeners/BlockListener.java | 16 +++--- .../nossr50/listeners/EntityListener.java | 16 +++--- .../nossr50/listeners/InteractionManager.java | 8 +-- .../nossr50/listeners/InventoryListener.java | 10 ++-- .../nossr50/listeners/PlayerListener.java | 14 +++--- .../gmail/nossr50/listeners/SelfListener.java | 10 ++-- .../nossr50/listeners/WorldListener.java | 4 +- .../gmail/nossr50/locale/LocaleLoader.java | 2 +- .../main/java/com/gmail/nossr50/mcMMO.java | 18 +++---- .../com/gmail/nossr50/party/PartyManager.java | 22 ++++----- .../com/gmail/nossr50/party/ShareHandler.java | 18 +++---- .../nossr50/runnables/SaveTimerTask.java | 4 +- .../runnables/backups/CleanBackupsTask.java | 2 +- .../commands/McrankCommandAsyncTask.java | 2 +- .../commands/McrankCommandDisplayTask.java | 4 +- .../commands/MctopCommandAsyncTask.java | 4 +- .../commands/MctopCommandDisplayTask.java | 6 +-- .../database/DatabaseConversionTask.java | 2 +- .../database/FormulaConversionTask.java | 12 ++--- .../database/UUIDUpdateAsyncTask.java | 6 +-- .../runnables/database/UserPurgeTask.java | 2 +- .../runnables/items/ChimaeraWingWarmup.java | 4 +- .../runnables/items/TeleportationWarmup.java | 4 +- .../runnables/party/PartyAutoKickTask.java | 4 +- .../runnables/party/PartyChatTask.java | 4 +- .../player/ClearRegisteredXPGainTask.java | 4 +- .../player/PlayerProfileLoadingTask.java | 8 +-- .../player/PlayerProfileSaveTask.java | 2 +- .../runnables/skills/AbilityCooldownTask.java | 6 +-- .../runnables/skills/AbilityDisableTask.java | 8 +-- .../runnables/skills/AlchemyBrewTask.java | 6 +-- .../runnables/skills/AwardCombatXpTask.java | 8 +-- .../runnables/skills/BleedTimerTask.java | 4 +- .../skills/ExperienceBarHideTask.java | 4 +- .../skills/SkillUnlockNotificationTask.java | 4 +- .../runnables/skills/ToolLowerTask.java | 8 +-- .../gmail/nossr50/skills/SkillManager.java | 8 +-- .../nossr50/skills/acrobatics/Acrobatics.java | 4 +- .../skills/acrobatics/AcrobaticsManager.java | 10 ++-- .../gmail/nossr50/skills/alchemy/Alchemy.java | 4 +- .../skills/alchemy/AlchemyManager.java | 12 ++--- .../skills/alchemy/AlchemyPotionBrewer.java | 8 +-- .../gmail/nossr50/skills/archery/Archery.java | 4 +- .../skills/archery/ArcheryManager.java | 10 ++-- .../com/gmail/nossr50/skills/axes/Axes.java | 4 +- .../nossr50/skills/axes/AxesManager.java | 14 +++--- .../nossr50/skills/child/ChildConfig.java | 4 +- .../nossr50/skills/child/FamilyTree.java | 2 +- .../nossr50/skills/excavation/Excavation.java | 6 +-- .../skills/excavation/ExcavationManager.java | 12 ++--- .../gmail/nossr50/skills/fishing/Fishing.java | 6 +-- .../skills/fishing/FishingManager.java | 24 ++++----- .../skills/herbalism/HerbalismManager.java | 22 ++++----- .../nossr50/skills/mining/BlastMining.java | 8 +-- .../gmail/nossr50/skills/mining/Mining.java | 2 +- .../nossr50/skills/mining/MiningManager.java | 16 +++--- .../nossr50/skills/repair/ArcaneForging.java | 2 +- .../gmail/nossr50/skills/repair/Repair.java | 4 +- .../nossr50/skills/repair/RepairManager.java | 14 +++--- .../skills/repair/repairables/Repairable.java | 4 +- .../repair/repairables/RepairableFactory.java | 4 +- .../repair/repairables/SimpleRepairable.java | 4 +- .../gmail/nossr50/skills/salvage/Salvage.java | 4 +- .../skills/salvage/SalvageManager.java | 12 ++--- .../salvage/salvageables/Salvageable.java | 4 +- .../salvageables/SalvageableFactory.java | 4 +- .../salvageables/SimpleSalvageable.java | 4 +- .../nossr50/skills/smelting/Smelting.java | 6 +-- .../skills/smelting/SmeltingManager.java | 12 ++--- .../gmail/nossr50/skills/swords/Swords.java | 2 +- .../nossr50/skills/swords/SwordsManager.java | 14 +++--- .../gmail/nossr50/skills/taming/Taming.java | 2 +- .../nossr50/skills/taming/TamingManager.java | 16 +++--- .../skills/taming/TrackedTamingEntity.java | 2 +- .../gmail/nossr50/skills/unarmed/Unarmed.java | 2 +- .../skills/unarmed/UnarmedManager.java | 16 +++--- .../skills/woodcutting/Woodcutting.java | 4 +- .../woodcutting/WoodcuttingManager.java | 14 +++--- .../com/gmail/nossr50/util/BlockUtils.java | 2 +- .../com/gmail/nossr50/util/ChimaeraWing.java | 8 +-- .../com/gmail/nossr50/util/EventUtils.java | 20 ++++---- .../gmail/nossr50/util/HardcoreManager.java | 10 ++-- .../gmail/nossr50/util/HolidayManager.java | 6 +-- .../com/gmail/nossr50/util/ItemUtils.java | 2 +- .../java/com/gmail/nossr50/util/Misc.java | 2 +- .../gmail/nossr50/util/MobHealthbarUtils.java | 8 +-- .../com/gmail/nossr50/util/ModManager.java | 8 +-- .../java/com/gmail/nossr50/util/Motd.java | 4 +- .../com/gmail/nossr50/util/Permissions.java | 10 ++-- .../com/gmail/nossr50/util/StringUtils.java | 4 +- .../nossr50/util/TextComponentFactory.java | 16 +++--- .../commands/CommandRegistrationManager.java | 4 +- .../nossr50/util/commands/CommandUtils.java | 10 ++-- .../util/experience/ExperienceBarManager.java | 4 +- .../util/experience/ExperienceBarWrapper.java | 4 +- .../util/experience/FormulaManager.java | 6 +-- .../util/player/NotificationManager.java | 10 ++-- .../util/random/RandomChanceSkill.java | 8 +-- .../util/random/RandomChanceSkillStatic.java | 2 +- .../nossr50/util/random/RandomChanceUtil.java | 8 +-- .../util/scoreboards/ScoreboardManager.java | 14 +++--- .../util/scoreboards/ScoreboardWrapper.java | 14 +++--- .../nossr50/util/skills/CombatUtils.java | 12 ++--- .../util/skills/ParticleEffectUtils.java | 2 +- .../gmail/nossr50/util/skills/PerksUtils.java | 2 +- .../gmail/nossr50/util/skills/RankUtils.java | 14 +++--- .../gmail/nossr50/util/skills/SkillUtils.java | 22 ++++----- .../nossr50/util/sounds/SoundManager.java | 2 +- .../nossr50/util/upgrade/UpgradeManager.java | 4 +- .../shatt/backup/ZipLibrary.java | 2 +- .../java/com/gmail/nossr50/McmmoCore.java | 5 -- .../com/gmail/nossr50/core/McmmoCore.java | 5 ++ .../config/experience/ExperienceConfig.java | 12 ++--- .../core}/config/mods/ArmorConfigManager.java | 2 +- .../core}/config/mods/BlockConfigManager.java | 2 +- .../core}/config/mods/CustomArmorConfig.java | 8 +-- .../core}/config/mods/CustomBlockConfig.java | 6 +-- .../core}/config/mods/CustomEntityConfig.java | 6 +-- .../core}/config/mods/CustomToolConfig.java | 10 ++-- .../config/mods/EntityConfigManager.java | 2 +- .../core}/config/mods/ToolConfigManager.java | 2 +- .../core}/config/party/ItemWeightConfig.java | 4 +- .../core/config/skills}/AdvancedConfig.java | 8 +-- .../skills}/AutoUpdateConfigLoader.java | 2 +- .../nossr50/core/config/skills}/Config.java | 12 ++--- .../core/config/skills}/ConfigLoader.java | 2 +- .../core/config/skills}/CoreSkillsConfig.java | 6 +-- .../core/config/skills}/HiddenConfig.java | 2 +- .../core/config/skills}/RankConfig.java | 6 +-- .../core/config/skills}/SoundConfig.java | 2 +- .../core/config/skills}/WorldBlacklist.java | 2 +- .../config/skills/alchemy/PotionConfig.java | 3 +- .../config/skills/repair/RepairConfig.java | 4 +- .../skills/repair/RepairConfigManager.java | 0 .../config/skills/salvage/SalvageConfig.java | 4 +- .../skills/salvage/SalvageConfigManager.java | 0 .../core}/config/treasure/TreasureConfig.java | 5 +- .../gmail/nossr50/core/data}/UserManager.java | 4 +- .../core/data}/blockmeta/ChunkletManager.java | 2 +- .../blockmeta/ChunkletManagerFactory.java | 4 +- .../core/data}/blockmeta/ChunkletStore.java | 2 +- .../data}/blockmeta/ChunkletStoreFactory.java | 2 +- .../data}/blockmeta/HashChunkletManager.java | 2 +- .../data}/blockmeta/NullChunkletManager.java | 2 +- .../blockmeta/PrimitiveChunkletStore.java | 2 +- .../blockmeta/PrimitiveExChunkletStore.java | 2 +- .../blockmeta/chunkmeta/ChunkManager.java | 2 +- .../chunkmeta/ChunkManagerFactory.java | 4 +- .../data}/blockmeta/chunkmeta/ChunkStore.java | 4 +- .../chunkmeta/ChunkStoreFactory.java | 2 +- .../blockmeta/chunkmeta/HashChunkManager.java | 4 +- .../chunkmeta/McMMOSimpleChunkBuffer.java | 2 +- .../chunkmeta/McMMOSimpleRegionFile.java | 2 +- .../blockmeta/chunkmeta/NullChunkManager.java | 2 +- .../chunkmeta/PrimitiveChunkStore.java | 4 +- .../conversion/BlockStoreConversionMain.java | 4 +- .../BlockStoreConversionXDirectory.java | 4 +- .../BlockStoreConversionZDirectory.java | 14 +++--- .../core/data}/database/DatabaseManager.java | 10 ++-- .../database/DatabaseManagerFactory.java | 10 ++-- .../database/FlatfileDatabaseManager.java | 44 ++++++++--------- .../data}/database/SQLDatabaseManager.java | 42 ++++++++-------- .../nossr50/core/datatypes/AbstractWorld.java | 49 +++++++++++++++++++ .../{ => core}/datatypes/Location.java | 2 +- .../nossr50/core/datatypes/Nameable.java | 15 ++++++ .../gmail/nossr50/core/datatypes/Named.java | 13 +++++ .../nossr50/core/datatypes/Property.java | 37 ++++++++++++++ .../gmail/nossr50/core/datatypes/World.java | 9 ++++ .../{ => core}/datatypes/block/Block.java | 4 +- .../datatypes/block/BlockState.java | 4 +- .../nossr50/core/datatypes/entity/Entity.java | 24 +++++++++ .../nossr50/core/datatypes/entity/Living.java | 33 +++++++++++++ .../nossr50/core/datatypes/entity/Player.java | 21 ++++++++ .../core/datatypes/event/Cancellable.java | 19 +++++++ .../nossr50/core/datatypes/event/Event.java | 8 +++ .../core/datatypes/event/EventType.java | 13 +++++ .../{ => core}/platform/AbstractPlatform.java | 2 +- .../nossr50/{ => core}/platform/Platform.java | 7 ++- .../core/platform/PlatformSoftwareType.java | 10 ++++ .../platform/TargetMinecraftVersion.java | 2 +- .../core/platform/drivers/PlatformDriver.java | 20 ++++++++ .../platform/drivers/PlatformEventDriver.java | 8 +++ .../com/gmail/nossr50/datatypes/Property.java | 9 ---- .../com/gmail/nossr50/datatypes/World.java | 5 -- .../platform/PlatformSoftwareType.java | 10 ---- 346 files changed, 1239 insertions(+), 981 deletions(-) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/LimitedSizeList.java (96%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/MobHealthbarType.java (60%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/chat/ChatMode.java (93%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/database/DatabaseType.java (90%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/database/PlayerStat.java (79%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/database/UpgradeType.java (86%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/experience/FormulaType.java (84%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/experience/SkillXpGain.java (92%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/experience/XPGainReason.java (87%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/experience/XPGainSource.java (80%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/interactions/NotificationType.java (94%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/json/CustomBaseComponent.java (80%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/json/McMMOUrl.java (95%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/json/McMMOWebLinks.java (95%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/meta/OldName.java (86%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/mods/CustomBlock.java (92%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/mods/CustomEntity.java (96%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/mods/CustomTool.java (91%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/party/ItemShareType.java (95%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/party/Party.java (98%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/party/PartyFeature.java (94%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/party/PartyLeader.java (88%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/party/PartyTeleportRecord.java (93%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/party/ShareMode.java (91%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/player/McMMOPlayer.java (97%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/player/PlayerProfile.java (95%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/player/UniqueDataType.java (52%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/ItemType.java (54%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/MaterialType.java (94%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/ModConfigType.java (95%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/PrimarySkillType.java (99%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/SubSkillFlags.java (96%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/SubSkillType.java (99%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/SuperAbilityType.java (98%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/ToolType.java (97%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/alchemy/AlchemyPotion.java (98%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/alchemy/PotionStage.java (97%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/interfaces/ChildSkill.java (59%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/interfaces/CoreSkill.java (82%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/interfaces/Localized.java (88%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/interfaces/Skill.java (71%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/interfaces/Toolable.java (86%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/progression/Progression.java (69%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/subskills/AbstractSubSkill.java (79%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/subskills/acrobatics/AcrobaticsSubSkill.java (88%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/subskills/acrobatics/Roll.java (96%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/subskills/interfaces/InteractType.java (80%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/subskills/interfaces/Interaction.java (91%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/subskills/interfaces/Rank.java (87%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/subskills/interfaces/SubSkill.java (93%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/skills/subskills/interfaces/SubSkillProperties.java (64%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/treasure/EnchantmentTreasure.java (92%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/treasure/ExcavationTreasure.java (82%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/treasure/FishingTreasure.java (78%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/treasure/HylianTreasure.java (81%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/treasure/Rarity.java (85%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/treasure/ShakeTreasure.java (81%) rename bukkit/src/main/java/com/gmail/nossr50/{ => core}/datatypes/treasure/Treasure.java (91%) delete mode 100644 core/src/main/java/com/gmail/nossr50/McmmoCore.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/McmmoCore.java rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/config/experience/ExperienceConfig.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/config/mods/ArmorConfigManager.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/config/mods/BlockConfigManager.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/config/mods/CustomArmorConfig.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/config/mods/CustomBlockConfig.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/config/mods/CustomEntityConfig.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/config/mods/CustomToolConfig.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/config/mods/EntityConfigManager.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/config/mods/ToolConfigManager.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/config/party/ItemWeightConfig.java (91%) rename {bukkit/src/main/java/com/gmail/nossr50/config => core/src/main/java/com/gmail/nossr50/core/config/skills}/AdvancedConfig.java (99%) rename {bukkit/src/main/java/com/gmail/nossr50/config => core/src/main/java/com/gmail/nossr50/core/config/skills}/AutoUpdateConfigLoader.java (99%) rename {bukkit/src/main/java/com/gmail/nossr50/config => core/src/main/java/com/gmail/nossr50/core/config/skills}/Config.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50/config => core/src/main/java/com/gmail/nossr50/core/config/skills}/ConfigLoader.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50/config => core/src/main/java/com/gmail/nossr50/core/config/skills}/CoreSkillsConfig.java (88%) rename {bukkit/src/main/java/com/gmail/nossr50/config => core/src/main/java/com/gmail/nossr50/core/config/skills}/HiddenConfig.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50/config => core/src/main/java/com/gmail/nossr50/core/config/skills}/RankConfig.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50/config => core/src/main/java/com/gmail/nossr50/core/config/skills}/SoundConfig.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50/config => core/src/main/java/com/gmail/nossr50/core/config/skills}/WorldBlacklist.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/config/skills/alchemy/PotionConfig.java (99%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/config/skills/repair/RepairConfig.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/config/skills/repair/RepairConfigManager.java (100%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/config/skills/salvage/SalvageConfig.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/config/skills/salvage/SalvageConfigManager.java (100%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/config/treasure/TreasureConfig.java (99%) rename {bukkit/src/main/java/com/gmail/nossr50/util/player => core/src/main/java/com/gmail/nossr50/core/data}/UserManager.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/ChunkletManager.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/ChunkletManagerFactory.java (74%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/ChunkletStore.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/ChunkletStoreFactory.java (82%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/HashChunkletManager.java (99%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/NullChunkletManager.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/PrimitiveChunkletStore.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/PrimitiveExChunkletStore.java (99%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/chunkmeta/ChunkManager.java (99%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/chunkmeta/ChunkManagerFactory.java (71%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/chunkmeta/ChunkStore.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/chunkmeta/ChunkStoreFactory.java (82%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/chunkmeta/HashChunkManager.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/chunkmeta/McMMOSimpleChunkBuffer.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/chunkmeta/McMMOSimpleRegionFile.java (99%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/chunkmeta/NullChunkManager.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/chunkmeta/PrimitiveChunkStore.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/conversion/BlockStoreConversionMain.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/conversion/BlockStoreConversionXDirectory.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50/util => core/src/main/java/com/gmail/nossr50/core/data}/blockmeta/conversion/BlockStoreConversionZDirectory.java (92%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core/data}/database/DatabaseManager.java (93%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core/data}/database/DatabaseManagerFactory.java (92%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core/data}/database/FlatfileDatabaseManager.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core/data}/database/SQLDatabaseManager.java (98%) create mode 100644 core/src/main/java/com/gmail/nossr50/core/datatypes/AbstractWorld.java rename core/src/main/java/com/gmail/nossr50/{ => core}/datatypes/Location.java (93%) create mode 100644 core/src/main/java/com/gmail/nossr50/core/datatypes/Nameable.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/datatypes/Named.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/datatypes/Property.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/datatypes/World.java rename core/src/main/java/com/gmail/nossr50/{ => core}/datatypes/block/Block.java (88%) rename core/src/main/java/com/gmail/nossr50/{ => core}/datatypes/block/BlockState.java (93%) create mode 100644 core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Entity.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Living.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Player.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/datatypes/event/Cancellable.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/datatypes/event/Event.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/datatypes/event/EventType.java rename core/src/main/java/com/gmail/nossr50/{ => core}/platform/AbstractPlatform.java (75%) rename core/src/main/java/com/gmail/nossr50/{ => core}/platform/Platform.java (78%) create mode 100644 core/src/main/java/com/gmail/nossr50/core/platform/PlatformSoftwareType.java rename core/src/main/java/com/gmail/nossr50/{ => core}/platform/TargetMinecraftVersion.java (88%) create mode 100644 core/src/main/java/com/gmail/nossr50/core/platform/drivers/PlatformDriver.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/platform/drivers/PlatformEventDriver.java delete mode 100644 core/src/main/java/com/gmail/nossr50/datatypes/Property.java delete mode 100644 core/src/main/java/com/gmail/nossr50/datatypes/World.java delete mode 100644 core/src/main/java/com/gmail/nossr50/platform/PlatformSoftwareType.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/api/AbilityAPI.java b/bukkit/src/main/java/com/gmail/nossr50/api/AbilityAPI.java index 5922ecbe6..9013f7652 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/api/AbilityAPI.java +++ b/bukkit/src/main/java/com/gmail/nossr50/api/AbilityAPI.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.api; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.runnables.skills.BleedTimerTask; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/api/ChatAPI.java b/bukkit/src/main/java/com/gmail/nossr50/api/ChatAPI.java index 7e4434316..042305654 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/api/ChatAPI.java +++ b/bukkit/src/main/java/com/gmail/nossr50/api/ChatAPI.java @@ -3,9 +3,9 @@ package com.gmail.nossr50.api; import com.gmail.nossr50.chat.ChatManager; import com.gmail.nossr50.chat.ChatManagerFactory; import com.gmail.nossr50.chat.PartyChatManager; -import com.gmail.nossr50.datatypes.chat.ChatMode; +import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; diff --git a/bukkit/src/main/java/com/gmail/nossr50/api/ExperienceAPI.java b/bukkit/src/main/java/com/gmail/nossr50/api/ExperienceAPI.java index 3c58b9afe..36d1deeef 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/api/ExperienceAPI.java +++ b/bukkit/src/main/java/com/gmail/nossr50/api/ExperienceAPI.java @@ -1,17 +1,17 @@ package com.gmail.nossr50.api; import com.gmail.nossr50.api.exceptions.*; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.experience.FormulaType; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.experience.XPGainSource; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.player.PlayerProfile; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.experience.FormulaType; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.experience.XPGainSource; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.child.FamilyTree; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.block.BlockState; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/api/PartyAPI.java b/bukkit/src/main/java/com/gmail/nossr50/api/PartyAPI.java index ebe0e63b1..fb5964472 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/api/PartyAPI.java +++ b/bukkit/src/main/java/com/gmail/nossr50/api/PartyAPI.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.api; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.party.Party; -import com.gmail.nossr50.datatypes.party.PartyLeader; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.party.PartyLeader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.OfflinePlayer; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/api/SkillAPI.java b/bukkit/src/main/java/com/gmail/nossr50/api/SkillAPI.java index ee230bc72..720421ea2 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/api/SkillAPI.java +++ b/bukkit/src/main/java/com/gmail/nossr50/api/SkillAPI.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.api; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import java.util.ArrayList; import java.util.Arrays; diff --git a/bukkit/src/main/java/com/gmail/nossr50/chat/AdminChatManager.java b/bukkit/src/main/java/com/gmail/nossr50/chat/AdminChatManager.java index 2c9d6ce56..e7ebbfd7f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/chat/AdminChatManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/chat/AdminChatManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.chat; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.events.chat.McMMOAdminChatEvent; import org.bukkit.plugin.Plugin; diff --git a/bukkit/src/main/java/com/gmail/nossr50/chat/ChatManager.java b/bukkit/src/main/java/com/gmail/nossr50/chat/ChatManager.java index a7d5311bb..5c77e9a12 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/chat/ChatManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/chat/ChatManager.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.chat; -import com.gmail.nossr50.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.events.chat.McMMOChatEvent; import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; diff --git a/bukkit/src/main/java/com/gmail/nossr50/chat/ChatManagerFactory.java b/bukkit/src/main/java/com/gmail/nossr50/chat/ChatManagerFactory.java index 308e736df..bf476ea5a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/chat/ChatManagerFactory.java +++ b/bukkit/src/main/java/com/gmail/nossr50/chat/ChatManagerFactory.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.chat; -import com.gmail.nossr50.datatypes.chat.ChatMode; +import com.gmail.nossr50.core.datatypes.chat.ChatMode; import org.bukkit.plugin.Plugin; import java.util.HashMap; diff --git a/bukkit/src/main/java/com/gmail/nossr50/chat/PartyChatManager.java b/bukkit/src/main/java/com/gmail/nossr50/chat/PartyChatManager.java index ac4a32065..271fcb3db 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/chat/PartyChatManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/chat/PartyChatManager.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.chat; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.party.Party; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; import com.gmail.nossr50.runnables.party.PartyChatTask; import org.bukkit.plugin.Plugin; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java index 3d8c2d445..4138e2582 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.database.FlatfileDatabaseManager; -import com.gmail.nossr50.database.SQLDatabaseManager; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.database.FlatfileDatabaseManager; +import com.gmail.nossr50.core.data.database.SQLDatabaseManager; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McImportCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McImportCommand.java index 1eac84979..14f6dd891 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McImportCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McImportCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands; -import com.gmail.nossr50.datatypes.skills.ModConfigType; +import com.gmail.nossr50.core.datatypes.skills.ModConfigType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McabilityCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McabilityCommand.java index 0628b9364..f251b728a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McabilityCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McabilityCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McconvertCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McconvertCommand.java index e104b61d2..f9a518873 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McconvertCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McconvertCommand.java @@ -2,9 +2,9 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.commands.database.ConvertDatabaseCommand; import com.gmail.nossr50.commands.experience.ConvertExperienceCommand; -import com.gmail.nossr50.database.DatabaseManagerFactory; -import com.gmail.nossr50.datatypes.database.DatabaseType; -import com.gmail.nossr50.datatypes.experience.FormulaType; +import com.gmail.nossr50.core.data.database.DatabaseManagerFactory; +import com.gmail.nossr50.core.datatypes.database.DatabaseType; +import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McgodCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McgodCommand.java index 1867c4672..ff03c8226 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McgodCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McgodCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java index db9a15486..a87672a55 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.commands.party.PartySubcommandType; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Permissions; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java index eb6139f33..10d12c2fb 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McrefreshCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McrefreshCommand.java index 9cc0ed3c1..93b277bb4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McrefreshCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McrefreshCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McscoreboardCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McscoreboardCommand.java index 305aae98e..f9ccf4503 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McscoreboardCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McscoreboardCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.commands.CommandUtils; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/ToggleCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/ToggleCommand.java index 11256ecbd..9195e57c9 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/ToggleCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/ToggleCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java index 9f76e736e..85f35576b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands; -import com.gmail.nossr50.config.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/AdminChatCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/AdminChatCommand.java index 41f3746b5..dfc0a7c78 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/AdminChatCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/AdminChatCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.chat; -import com.gmail.nossr50.datatypes.chat.ChatMode; +import com.gmail.nossr50.core.datatypes.chat.ChatMode; import org.bukkit.command.CommandSender; public class AdminChatCommand extends ChatCommand { diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java index 0d9b8fcd0..f315f5d71 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java @@ -2,14 +2,14 @@ package com.gmail.nossr50.commands.chat; import com.gmail.nossr50.chat.ChatManager; import com.gmail.nossr50.chat.ChatManagerFactory; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.chat.ChatMode; -import com.gmail.nossr50.datatypes.party.PartyFeature; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.chat.ChatMode; +import com.gmail.nossr50.core.datatypes.party.PartyFeature; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/McChatSpy.java b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/McChatSpy.java index 87ef2285f..6a471f16e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/McChatSpy.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/McChatSpy.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands.chat; import com.gmail.nossr50.commands.ToggleCommand; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java index 606329eeb..a39b535f5 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.commands.chat; import com.gmail.nossr50.chat.PartyChatManager; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.chat.ChatMode; -import com.gmail.nossr50.datatypes.party.Party; -import com.gmail.nossr50.datatypes.party.PartyFeature; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.chat.ChatMode; +import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java index a7834ee03..8d4816436 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.commands.database; -import com.gmail.nossr50.database.DatabaseManager; -import com.gmail.nossr50.database.DatabaseManagerFactory; -import com.gmail.nossr50.datatypes.database.DatabaseType; -import com.gmail.nossr50.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.data.database.DatabaseManager; +import com.gmail.nossr50.core.data.database.DatabaseManagerFactory; +import com.gmail.nossr50.core.datatypes.database.DatabaseType; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.database.DatabaseConversionTask; import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java index 3e53140e1..1a3948496 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.database; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/database/McremoveCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/database/McremoveCommand.java index 5fe1ca89a..25446135a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/database/McremoveCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/database/McremoveCommand.java @@ -3,7 +3,7 @@ package com.gmail.nossr50.commands.database; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/database/MmoshowdbCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/database/MmoshowdbCommand.java index 2b4ca7d76..c02e5688a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/database/MmoshowdbCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/database/MmoshowdbCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands.database; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.database.DatabaseManagerFactory; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.database.DatabaseManagerFactory; import com.gmail.nossr50.locale.LocaleLoader; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java index 22cc3e6f3..db3bc73e9 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.experience; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.player.PlayerProfile; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Permissions; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddxpCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddxpCommand.java index f79c8b9ca..91ec3a2a8 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddxpCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddxpCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.experience; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.experience.XPGainSource; -import com.gmail.nossr50.datatypes.player.PlayerProfile; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.experience.XPGainSource; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java index 973214a78..253fec7ec 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.experience; -import com.gmail.nossr50.datatypes.experience.FormulaType; +import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.database.FormulaConversionTask; import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java index 120cbb853..58dae952b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.experience; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.player.PlayerProfile; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.OfflinePlayer; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java index d5d6de39a..1f0ccb1b2 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.experience; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.player.PlayerProfile; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Permissions; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java index 16a28d720..9cacf213f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.commands.experience; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.player.PlayerProfile; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.OfflinePlayer; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java index 6375265b2..fcc4d427f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands.hardcore; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Permissions; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreModeCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreModeCommand.java index 2a59a45b4..f252ad48e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreModeCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreModeCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.hardcore; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.commands.CommandUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java index 854871e05..253d56822 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands.hardcore; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Permissions; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyAcceptCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyAcceptCommand.java index 86543a3a2..b69649a83 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyAcceptCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyAcceptCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java index 5c4e4a55a..f31bcffe1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.OfflinePlayer; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangePasswordCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangePasswordCommand.java index 0c2065df0..cd57094db 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangePasswordCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangePasswordCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java index 994ff69f2..1e443fe1b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java @@ -3,12 +3,12 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.commands.chat.PartyChatCommand; import com.gmail.nossr50.commands.party.alliance.PartyAllianceCommand; import com.gmail.nossr50.commands.party.teleport.PtpCommand; -import com.gmail.nossr50.datatypes.party.Party; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCreateCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCreateCommand.java index 681972d69..b0e649fdc 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCreateCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCreateCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java index 8e6459676..b033b30a1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java index 6dc6c9017..c5aff1d4a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.party.Party; -import com.gmail.nossr50.datatypes.party.PartyFeature; -import com.gmail.nossr50.datatypes.party.ShareMode; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.party.PartyFeature; +import com.gmail.nossr50.core.datatypes.party.ShareMode; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java index 9a203c202..bdf8d3c79 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.party.Party; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java index 81c47a1d7..0b0067636 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.party.ItemShareType; -import com.gmail.nossr50.datatypes.party.Party; -import com.gmail.nossr50.datatypes.party.PartyFeature; -import com.gmail.nossr50.datatypes.party.ShareMode; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.party.ItemShareType; +import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.party.PartyFeature; +import com.gmail.nossr50.core.datatypes.party.ShareMode; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyJoinCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyJoinCommand.java index 88ea326ef..1a101e684 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyJoinCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyJoinCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.datatypes.party.Party; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java index 2c45077a2..b9aea6d2a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.OfflinePlayer; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java index b12668902..842ab1bfc 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java index 0f32b29b7..853b45c10 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.datatypes.party.Party; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java index bcc574ba1..d72d5ae0d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.datatypes.party.Party; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java index 2214a82dc..9af76d9cd 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.party.Party; -import com.gmail.nossr50.datatypes.party.PartyFeature; -import com.gmail.nossr50.datatypes.party.ShareMode; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.party.PartyFeature; +import com.gmail.nossr50.core.datatypes.party.ShareMode; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceAcceptCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceAcceptCommand.java index fc57d1ba4..8652b980d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceAcceptCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceAcceptCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.party.alliance; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java index fa91b02ea..ccab1ae8b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.commands.party.alliance; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.party.Party; -import com.gmail.nossr50.datatypes.party.PartyFeature; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.party.PartyFeature; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.ChatColor; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceDisbandCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceDisbandCommand.java index e3529285d..8b3e01044 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceDisbandCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceDisbandCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.party.alliance; -import com.gmail.nossr50.datatypes.party.Party; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceInviteCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceInviteCommand.java index b0c41455d..dd08b73e5 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceInviteCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceInviteCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.party.alliance; -import com.gmail.nossr50.datatypes.party.Party; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java index a58044f26..b3c28dc5d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.party.teleport; -import com.gmail.nossr50.datatypes.party.PartyTeleportRecord; +import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java index b66f909e4..7528eeb4e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.party.teleport; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.party.PartyTeleportRecord; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.SkillUtils; import org.bukkit.World; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java index da8c5a05f..88bc48294 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.party.teleport; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.config.WorldBlacklist; -import com.gmail.nossr50.datatypes.party.Party; -import com.gmail.nossr50.datatypes.party.PartyFeature; -import com.gmail.nossr50.datatypes.party.PartyTeleportRecord; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.skills.WorldBlacklist; +import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.party.PartyFeature; +import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.party.PartyManager; @@ -14,7 +14,7 @@ import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.SkillUtils; import com.gmail.nossr50.worldguard.WorldGuardManager; import com.gmail.nossr50.worldguard.WorldGuardUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java index 1a669cb5c..fea809e3d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.party.teleport; -import com.gmail.nossr50.datatypes.party.PartyTeleportRecord; +import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java index bcdf611c0..02e7f3c02 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.commands.player; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.player.PlayerProfile; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java index f9baec207..2136c1af3 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.player; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java index b2dd01241..814811daa 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.commands.player; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.commands.McrankCommandAsyncTask; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java index bbcf51095..a53e92f21 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.player; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java index dc9acb3b5..93de2eb1a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.commands.player; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.commands.MctopCommandAsyncTask; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java index 1588cbd77..0913fd400 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.listeners.InteractionManager; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.TextComponentFactory; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AlchemyCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AlchemyCommand.java index c896ac9c4..4692742fc 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AlchemyCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AlchemyCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.alchemy.AlchemyManager; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.TextComponentFactory; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.RankUtils; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java index 37fe92f67..ebb7411cf 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.archery.Archery; import com.gmail.nossr50.util.TextComponentFactory; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java index b4518bc4f..fd45671aa 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.axes.Axes; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.TextComponentFactory; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java index 0274c03fd..43e5a3500 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.TextComponentFactory; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java index fcc1c0d69..996bc5e0b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java @@ -1,16 +1,16 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.treasure.TreasureConfig; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.treasure.Rarity; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.treasure.TreasureConfig; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.treasure.Rarity; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.fishing.Fishing; import com.gmail.nossr50.skills.fishing.FishingManager; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.TextComponentFactory; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.RankUtils; import net.md_5.bungee.api.chat.TextComponent; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java index caff87ad5..d788de937 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.TextComponentFactory; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java index 174444d7f..16bf12c3f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.mining.MiningManager; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.TextComponentFactory; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java index 95dc29458..54cf7b915 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.listeners.InteractionManager; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java index cd41d6ac8..0a5cb9dc3 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.datatypes.skills.MaterialType; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.repair.ArcaneForging; @@ -11,7 +11,7 @@ import com.gmail.nossr50.skills.repair.RepairManager; import com.gmail.nossr50.skills.repair.repairables.Repairable; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.TextComponentFactory; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java index 7577c4c54..4b11c0039 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.salvage.Salvage; import com.gmail.nossr50.skills.salvage.SalvageManager; import com.gmail.nossr50.util.TextComponentFactory; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.RankUtils; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java index 49e512a2c..c907b2d74 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java @@ -1,17 +1,17 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.child.FamilyTree; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.TextComponentFactory; import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.util.skills.PerksUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillGuideCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillGuideCommand.java index 6f34f77b1..ed7d7152e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillGuideCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillGuideCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.StringUtils; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java index e4028df22..e53afc4e4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.smelting.Smelting; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.TextComponentFactory; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java index 927cdad6f..2c413c4f7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.TextComponentFactory; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java index fb613544e..69a142348 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.taming.Taming; import com.gmail.nossr50.util.Permissions; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java index 59ce4f09f..1fa09d0db 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.TextComponentFactory; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java index daec5581d..4428181ba 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.TextComponentFactory; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/LimitedSizeList.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/LimitedSizeList.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java index c57b4996f..6cf5a1a01 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/LimitedSizeList.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes; +package com.gmail.nossr50.core.datatypes; import org.bukkit.Location; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/MobHealthbarType.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/MobHealthbarType.java similarity index 60% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/MobHealthbarType.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/MobHealthbarType.java index 3c67df798..aa938ab70 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/MobHealthbarType.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/MobHealthbarType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes; +package com.gmail.nossr50.core.datatypes; public enum MobHealthbarType { HEARTS, diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/chat/ChatMode.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java similarity index 93% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/chat/ChatMode.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java index 1596faf2a..039742acc 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/chat/ChatMode.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.chat; +package com.gmail.nossr50.core.datatypes.chat; import com.gmail.nossr50.locale.LocaleLoader; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/database/DatabaseType.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/database/DatabaseType.java similarity index 90% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/database/DatabaseType.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/database/DatabaseType.java index c8e089ab6..95ca8a16a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/database/DatabaseType.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/database/DatabaseType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.database; +package com.gmail.nossr50.core.datatypes.database; public enum DatabaseType { FLATFILE, diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/database/PlayerStat.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/database/PlayerStat.java similarity index 79% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/database/PlayerStat.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/database/PlayerStat.java index 825be52ba..6b81a51d6 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/database/PlayerStat.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/database/PlayerStat.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.database; +package com.gmail.nossr50.core.datatypes.database; public class PlayerStat { public String name; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/database/UpgradeType.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/database/UpgradeType.java similarity index 86% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/database/UpgradeType.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/database/UpgradeType.java index c09864811..56812b44d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/database/UpgradeType.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/database/UpgradeType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.database; +package com.gmail.nossr50.core.datatypes.database; public enum UpgradeType { ADD_FISHING, diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/experience/FormulaType.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/FormulaType.java similarity index 84% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/experience/FormulaType.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/FormulaType.java index ea428d812..27bf84bca 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/experience/FormulaType.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/FormulaType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.experience; +package com.gmail.nossr50.core.datatypes.experience; public enum FormulaType { LINEAR, diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/experience/SkillXpGain.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/experience/SkillXpGain.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java index a6d645f39..18138d08d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/experience/SkillXpGain.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.datatypes.experience; +package com.gmail.nossr50.core.datatypes.experience; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import java.util.concurrent.Delayed; import java.util.concurrent.TimeUnit; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/experience/XPGainReason.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/XPGainReason.java similarity index 87% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/experience/XPGainReason.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/XPGainReason.java index 12557bf21..4b71c86b5 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/experience/XPGainReason.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/XPGainReason.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.experience; +package com.gmail.nossr50.core.datatypes.experience; public enum XPGainReason { PVP, diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/experience/XPGainSource.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/XPGainSource.java similarity index 80% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/experience/XPGainSource.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/XPGainSource.java index 20a801a15..07ce33055 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/experience/XPGainSource.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/XPGainSource.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.experience; +package com.gmail.nossr50.core.datatypes.experience; public enum XPGainSource { SELF, diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/interactions/NotificationType.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/interactions/NotificationType.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/interactions/NotificationType.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/interactions/NotificationType.java index 87787b8b2..648d49060 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/interactions/NotificationType.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/interactions/NotificationType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.interactions; +package com.gmail.nossr50.core.datatypes.interactions; /** * This class helps define the types of information interactions we will have with players diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/json/CustomBaseComponent.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/json/CustomBaseComponent.java similarity index 80% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/json/CustomBaseComponent.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/json/CustomBaseComponent.java index 9fab71ae6..70193bfb1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/json/CustomBaseComponent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/json/CustomBaseComponent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.json; +package com.gmail.nossr50.core.datatypes.json; import net.md_5.bungee.api.chat.BaseComponent; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/json/McMMOUrl.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOUrl.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/json/McMMOUrl.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOUrl.java index f09a0e88d..4b64d42ff 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/json/McMMOUrl.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOUrl.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.json; +package com.gmail.nossr50.core.datatypes.json; public class McMMOUrl { public static final String urlWebsite = "https://www.mcmmo.org"; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/json/McMMOWebLinks.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/json/McMMOWebLinks.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java index 0dbad85db..86ee8ffec 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/json/McMMOWebLinks.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.json; +package com.gmail.nossr50.core.datatypes.json; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.StringUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/meta/OldName.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java similarity index 86% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/meta/OldName.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java index b300f92cc..cf827eae4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/meta/OldName.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.meta; +package com.gmail.nossr50.core.datatypes.meta; import com.gmail.nossr50.mcMMO; import org.bukkit.metadata.FixedMetadataValue; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/mods/CustomBlock.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomBlock.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/mods/CustomBlock.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomBlock.java index 65e9d6121..572e05f65 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/mods/CustomBlock.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomBlock.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.mods; +package com.gmail.nossr50.core.datatypes.mods; public class CustomBlock { private int xpGain; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/mods/CustomEntity.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomEntity.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/mods/CustomEntity.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomEntity.java index 2d89d1547..d99c279aa 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/mods/CustomEntity.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomEntity.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.mods; +package com.gmail.nossr50.core.datatypes.mods; import org.bukkit.inventory.ItemStack; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/mods/CustomTool.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomTool.java similarity index 91% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/mods/CustomTool.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomTool.java index 93c24dfab..8d2d9edbf 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/mods/CustomTool.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomTool.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.mods; +package com.gmail.nossr50.core.datatypes.mods; public class CustomTool { private double xpMultiplier; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/party/ItemShareType.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/party/ItemShareType.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java index faa1b6599..e7dca7a1b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/party/ItemShareType.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.party; +package com.gmail.nossr50.core.datatypes.party; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.ItemUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/party/Party.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/party/Party.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java index 0c2ad94a4..a449f0f30 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/party/Party.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java @@ -1,8 +1,8 @@ -package com.gmail.nossr50.datatypes.party; +package com.gmail.nossr50.core.datatypes.party; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.experience.FormulaType; +import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.party.PartyManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/party/PartyFeature.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/party/PartyFeature.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java index 55fa2688f..222593b4b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/party/PartyFeature.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.datatypes.party; +package com.gmail.nossr50.core.datatypes.party; import com.gmail.nossr50.commands.party.PartySubcommandType; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/party/PartyLeader.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyLeader.java similarity index 88% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/party/PartyLeader.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyLeader.java index 3292b3723..20ebf1f59 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/party/PartyLeader.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyLeader.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.party; +package com.gmail.nossr50.core.datatypes.party; import java.util.UUID; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/party/PartyTeleportRecord.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java similarity index 93% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/party/PartyTeleportRecord.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java index 50c2f8fee..cb568d60e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/party/PartyTeleportRecord.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.datatypes.party; +package com.gmail.nossr50.core.datatypes.party; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.util.Misc; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/party/ShareMode.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java similarity index 91% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/party/ShareMode.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java index 778ed08e6..b1649b167 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/party/ShareMode.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.party; +package com.gmail.nossr50.core.datatypes.party; import com.gmail.nossr50.util.commands.CommandUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java index 4b9613ce1..93c993e57 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java @@ -1,19 +1,19 @@ -package com.gmail.nossr50.datatypes.player; +package com.gmail.nossr50.core.datatypes.player; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.config.WorldBlacklist; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.skills.WorldBlacklist; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.chat.ChatMode; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.experience.XPGainSource; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.mods.CustomTool; -import com.gmail.nossr50.datatypes.party.Party; -import com.gmail.nossr50.datatypes.party.PartyTeleportRecord; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; -import com.gmail.nossr50.datatypes.skills.ToolType; +import com.gmail.nossr50.core.datatypes.chat.ChatMode; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.experience.XPGainSource; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.mods.CustomTool; +import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.datatypes.skills.ToolType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.party.PartyManager; @@ -43,7 +43,7 @@ import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.experience.ExperienceBarManager; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.util.skills.ParticleEffectUtils; import com.gmail.nossr50.util.skills.PerksUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java index 454002b68..e0c3ca446 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java @@ -1,17 +1,17 @@ -package com.gmail.nossr50.datatypes.player; +package com.gmail.nossr50.core.datatypes.player; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.MobHealthbarType; -import com.gmail.nossr50.datatypes.experience.FormulaType; -import com.gmail.nossr50.datatypes.experience.SkillXpGain; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.datatypes.MobHealthbarType; +import com.gmail.nossr50.core.datatypes.experience.FormulaType; +import com.gmail.nossr50.core.datatypes.experience.SkillXpGain; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.player.PlayerProfileSaveTask; import com.gmail.nossr50.skills.child.FamilyTree; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableMap; import java.util.HashMap; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/player/UniqueDataType.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/player/UniqueDataType.java similarity index 52% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/player/UniqueDataType.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/player/UniqueDataType.java index 8728c9b7f..a5ec4d48a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/player/UniqueDataType.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/player/UniqueDataType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.player; +package com.gmail.nossr50.core.datatypes.player; public enum UniqueDataType { CHIMAERA_WING_DATS diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/ItemType.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/ItemType.java similarity index 54% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/ItemType.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/ItemType.java index f0d786d73..4bcb54ae4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/ItemType.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/ItemType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.skills; +package com.gmail.nossr50.core.datatypes.skills; public enum ItemType { ARMOR, diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/MaterialType.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/MaterialType.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/MaterialType.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/MaterialType.java index 62f7ed160..e93aac73d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/MaterialType.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/MaterialType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.skills; +package com.gmail.nossr50.core.datatypes.skills; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/ModConfigType.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/ModConfigType.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/ModConfigType.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/ModConfigType.java index df951d783..9c317042f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/ModConfigType.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/ModConfigType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.skills; +package com.gmail.nossr50.core.datatypes.skills; public enum ModConfigType { BLOCKS, diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/PrimarySkillType.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/PrimarySkillType.java similarity index 99% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/PrimarySkillType.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/PrimarySkillType.java index 796755ab4..171077723 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/PrimarySkillType.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/PrimarySkillType.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.datatypes.skills; +package com.gmail.nossr50.core.datatypes.skills; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/SubSkillFlags.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillFlags.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/SubSkillFlags.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillFlags.java index ed4626935..6e2225860 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/SubSkillFlags.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillFlags.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.skills; +package com.gmail.nossr50.core.datatypes.skills; public class SubSkillFlags { /* diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/SubSkillType.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillType.java similarity index 99% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/SubSkillType.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillType.java index c6a88be82..817e0ad53 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/SubSkillType.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.skills; +package com.gmail.nossr50.core.datatypes.skills; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.StringUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/SuperAbilityType.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/SuperAbilityType.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/SuperAbilityType.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/SuperAbilityType.java index b89365279..4e7e45527 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/SuperAbilityType.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/SuperAbilityType.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.datatypes.skills; +package com.gmail.nossr50.core.datatypes.skills; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.util.BlockUtils; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/ToolType.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/ToolType.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/ToolType.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/ToolType.java index 2d50ebac4..35b9ffc4c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/ToolType.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/ToolType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.skills; +package com.gmail.nossr50.core.datatypes.skills; import com.gmail.nossr50.util.ItemUtils; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/alchemy/AlchemyPotion.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/AlchemyPotion.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/alchemy/AlchemyPotion.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/AlchemyPotion.java index 1f522679a..14246e199 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/alchemy/AlchemyPotion.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/AlchemyPotion.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.skills.alchemy; +package com.gmail.nossr50.core.datatypes.skills.alchemy; import com.gmail.nossr50.config.skills.alchemy.PotionConfig; import org.bukkit.Color; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/alchemy/PotionStage.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/PotionStage.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/alchemy/PotionStage.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/PotionStage.java index 70da6d529..10e0e6d39 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/alchemy/PotionStage.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/PotionStage.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.skills.alchemy; +package com.gmail.nossr50.core.datatypes.skills.alchemy; import org.bukkit.Material; import org.bukkit.potion.PotionData; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/interfaces/ChildSkill.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/ChildSkill.java similarity index 59% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/interfaces/ChildSkill.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/ChildSkill.java index 0bfee0108..a80aad1bd 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/interfaces/ChildSkill.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/ChildSkill.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.datatypes.skills.interfaces; +package com.gmail.nossr50.core.datatypes.skills.interfaces; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; public interface ChildSkill extends Skill { /** diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/interfaces/CoreSkill.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/CoreSkill.java similarity index 82% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/interfaces/CoreSkill.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/CoreSkill.java index 51d4913ce..bb45b4027 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/interfaces/CoreSkill.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/CoreSkill.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.datatypes.skills.interfaces; +package com.gmail.nossr50.core.datatypes.skills.interfaces; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; /** * This interface is mostly here to maintain backwards compatibility with other mcMMO plugins diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/interfaces/Localized.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Localized.java similarity index 88% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/interfaces/Localized.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Localized.java index 468e19c1d..52b9e0181 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/interfaces/Localized.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Localized.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.skills.interfaces; +package com.gmail.nossr50.core.datatypes.skills.interfaces; /** * Localized interface represents skills which have localizations diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/interfaces/Skill.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Skill.java similarity index 71% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/interfaces/Skill.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Skill.java index 68cf7180e..3cf20c3bf 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/interfaces/Skill.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Skill.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.datatypes.skills.interfaces; +package com.gmail.nossr50.core.datatypes.skills.interfaces; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; public interface Skill { /** diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/interfaces/Toolable.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Toolable.java similarity index 86% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/interfaces/Toolable.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Toolable.java index 7b817bea1..3bbe737bd 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/interfaces/Toolable.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Toolable.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.skills.interfaces; +package com.gmail.nossr50.core.datatypes.skills.interfaces; import org.bukkit.inventory.ItemStack; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/progression/Progression.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/progression/Progression.java similarity index 69% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/progression/Progression.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/progression/Progression.java index 30f00e0aa..bac3e885e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/progression/Progression.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/progression/Progression.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.datatypes.skills.progression; +package com.gmail.nossr50.core.datatypes.skills.progression; -import com.gmail.nossr50.datatypes.skills.subskills.interfaces.InteractType; +import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.InteractType; import org.bukkit.event.Event; public interface Progression { diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/AbstractSubSkill.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/AbstractSubSkill.java similarity index 79% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/AbstractSubSkill.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/AbstractSubSkill.java index 2e7c9a1f5..12ff29dee 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/AbstractSubSkill.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/AbstractSubSkill.java @@ -1,11 +1,11 @@ -package com.gmail.nossr50.datatypes.skills.subskills; +package com.gmail.nossr50.core.datatypes.skills.subskills; -import com.gmail.nossr50.config.CoreSkillsConfig; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.subskills.interfaces.Interaction; -import com.gmail.nossr50.datatypes.skills.subskills.interfaces.Rank; -import com.gmail.nossr50.datatypes.skills.subskills.interfaces.SubSkill; -import com.gmail.nossr50.datatypes.skills.subskills.interfaces.SubSkillProperties; +import com.gmail.nossr50.core.config.skills.CoreSkillsConfig; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.Interaction; +import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.Rank; +import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.SubSkill; +import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.SubSkillProperties; import com.gmail.nossr50.locale.LocaleLoader; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/AcrobaticsSubSkill.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/AcrobaticsSubSkill.java similarity index 88% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/AcrobaticsSubSkill.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/AcrobaticsSubSkill.java index db6ba2cc7..30da16ad7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/AcrobaticsSubSkill.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/AcrobaticsSubSkill.java @@ -1,9 +1,9 @@ -package com.gmail.nossr50.datatypes.skills.subskills.acrobatics; +package com.gmail.nossr50.core.datatypes.skills.subskills.acrobatics; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; -import com.gmail.nossr50.datatypes.skills.subskills.interfaces.InteractType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.InteractType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.StringUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/Roll.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/Roll.java index 0355c8821..ee634836f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/Roll.java @@ -1,20 +1,20 @@ -package com.gmail.nossr50.datatypes.skills.subskills.acrobatics; +package com.gmail.nossr50.core.datatypes.skills.subskills.acrobatics; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.LimitedSizeList; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.player.PlayerProfile; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.LimitedSizeList; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceSkill; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.PerksUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/interfaces/InteractType.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/InteractType.java similarity index 80% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/interfaces/InteractType.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/InteractType.java index fcd2eaa46..110e53898 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/interfaces/InteractType.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/InteractType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.skills.subskills.interfaces; +package com.gmail.nossr50.core.datatypes.skills.subskills.interfaces; /** * This class is used to determine event registrations for SubSkill interactions diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/interfaces/Interaction.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Interaction.java similarity index 91% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/interfaces/Interaction.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Interaction.java index 1e0357c7a..9527fb7cb 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/interfaces/Interaction.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Interaction.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.skills.subskills.interfaces; +package com.gmail.nossr50.core.datatypes.skills.subskills.interfaces; import com.gmail.nossr50.mcMMO; import org.bukkit.event.Event; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/interfaces/Rank.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Rank.java similarity index 87% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/interfaces/Rank.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Rank.java index 7e6267f18..161ecb880 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/interfaces/Rank.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Rank.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.skills.subskills.interfaces; +package com.gmail.nossr50.core.datatypes.skills.subskills.interfaces; public interface Rank { /** diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/interfaces/SubSkill.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkill.java similarity index 93% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/interfaces/SubSkill.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkill.java index 1bd26403d..96f382750 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/interfaces/SubSkill.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkill.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.datatypes.skills.subskills.interfaces; +package com.gmail.nossr50.core.datatypes.skills.subskills.interfaces; -import com.gmail.nossr50.datatypes.skills.interfaces.Skill; +import com.gmail.nossr50.core.datatypes.skills.interfaces.Skill; import net.md_5.bungee.api.chat.ComponentBuilder; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/interfaces/SubSkillProperties.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkillProperties.java similarity index 64% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/interfaces/SubSkillProperties.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkillProperties.java index 018cb7d8f..a57988613 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/interfaces/SubSkillProperties.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkillProperties.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.skills.subskills.interfaces; +package com.gmail.nossr50.core.datatypes.skills.subskills.interfaces; public interface SubSkillProperties { boolean isSuperAbility(); diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/EnchantmentTreasure.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/EnchantmentTreasure.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/EnchantmentTreasure.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/EnchantmentTreasure.java index 2f9d2519d..6fc8f1c77 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/EnchantmentTreasure.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/EnchantmentTreasure.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.treasure; +package com.gmail.nossr50.core.datatypes.treasure; import org.bukkit.enchantments.Enchantment; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/ExcavationTreasure.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ExcavationTreasure.java similarity index 82% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/ExcavationTreasure.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ExcavationTreasure.java index 0145e30eb..9454c501c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/ExcavationTreasure.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ExcavationTreasure.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.treasure; +package com.gmail.nossr50.core.datatypes.treasure; import org.bukkit.inventory.ItemStack; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/FishingTreasure.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/FishingTreasure.java similarity index 78% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/FishingTreasure.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/FishingTreasure.java index b26975313..5954bd860 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/FishingTreasure.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/FishingTreasure.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.treasure; +package com.gmail.nossr50.core.datatypes.treasure; import org.bukkit.inventory.ItemStack; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/HylianTreasure.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/HylianTreasure.java similarity index 81% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/HylianTreasure.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/HylianTreasure.java index b465d42d7..81b4d8b04 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/HylianTreasure.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/HylianTreasure.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.treasure; +package com.gmail.nossr50.core.datatypes.treasure; import org.bukkit.inventory.ItemStack; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/Rarity.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Rarity.java similarity index 85% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/Rarity.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Rarity.java index 40cddb737..3216d9d26 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/Rarity.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Rarity.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.treasure; +package com.gmail.nossr50.core.datatypes.treasure; public enum Rarity { RECORD, diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/ShakeTreasure.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ShakeTreasure.java similarity index 81% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/ShakeTreasure.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ShakeTreasure.java index 255acee82..342203a1f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/ShakeTreasure.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ShakeTreasure.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes.treasure; +package com.gmail.nossr50.core.datatypes.treasure; import org.bukkit.inventory.ItemStack; diff --git a/bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/Treasure.java b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Treasure.java similarity index 91% rename from bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/Treasure.java rename to bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Treasure.java index 04ce7cca7..be1e69bb1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/datatypes/treasure/Treasure.java +++ b/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Treasure.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.datatypes.treasure; +package com.gmail.nossr50.core.datatypes.treasure; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import org.bukkit.inventory.ItemStack; public abstract class Treasure { diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java index 78592b03b..c9cc14e2e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.events.experience; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelChangeEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelChangeEvent.java index bf23d4443..b9ffc9598 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelChangeEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelChangeEvent.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.events.experience; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import org.bukkit.entity.Player; /** diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelDownEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelDownEvent.java index 3834726f8..1f03196d6 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelDownEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelDownEvent.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.events.experience; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java index 062dd4a2a..d51bc5569 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.events.experience; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerXpGainEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerXpGainEvent.java index d789fde70..553bfcca5 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerXpGainEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerXpGainEvent.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.events.experience; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyLevelUpEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyLevelUpEvent.java index 0fcdabd7a..521a10d5e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyLevelUpEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyLevelUpEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.party; -import com.gmail.nossr50.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.party.Party; import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyXpGainEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyXpGainEvent.java index 16dbd95a2..91f76c6c0 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyXpGainEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyXpGainEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.party; -import com.gmail.nossr50.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.party.Party; import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java index 1cb182dcc..cc71c4f54 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.skills; -import com.gmail.nossr50.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java index b9a5af433..03598dc24 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.events.skills; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; import org.bukkit.event.player.PlayerEvent; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityActivateEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityActivateEvent.java index 7b0db958b..51845ae66 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityActivateEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityActivateEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.skills.abilities; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityDeactivateEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityDeactivateEvent.java index 384b61c92..df03a14ec 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityDeactivateEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityDeactivateEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.skills.abilities; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import org.bukkit.entity.Player; public class McMMOPlayerAbilityDeactivateEvent extends McMMOPlayerAbilityEvent { diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityEvent.java index bb1fd5f3a..39c7054dc 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityEvent.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.events.skills.abilities; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerBrewEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerBrewEvent.java index 1611fc178..a44a266c7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerBrewEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerBrewEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.skills.alchemy; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; import org.bukkit.block.Block; import org.bukkit.block.BlockState; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerCatalysisEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerCatalysisEvent.java index c4dbcc7d3..e779dd8de 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerCatalysisEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerCatalysisEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.skills.alchemy; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerFishingEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerFishingEvent.java index 96cde8b6b..c24c12b6a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerFishingEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerFishingEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.skills.fishing; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/repair/McMMOPlayerRepairCheckEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/repair/McMMOPlayerRepairCheckEvent.java index 638f8c202..9b0f94866 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/repair/McMMOPlayerRepairCheckEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/repair/McMMOPlayerRepairCheckEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.skills.repair; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java index 0a44c2621..172f3bc66 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.skills.salvage; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java index 30351d9e3..a94deef33 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.events.skills.secondaryabilities; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java index c1a90a425..c158ab653 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.events.skills.secondaryabilities; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; import org.bukkit.entity.Player; public class SubSkillRandomCheckEvent extends SubSkillEvent { diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/unarmed/McMMOPlayerDisarmEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/unarmed/McMMOPlayerDisarmEvent.java index 0859a37d1..4452c2f19 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/unarmed/McMMOPlayerDisarmEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/unarmed/McMMOPlayerDisarmEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.skills.unarmed; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index 8ecf5f9d8..3e5f96cd4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.listeners; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.config.HiddenConfig; -import com.gmail.nossr50.config.WorldBlacklist; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.skills.HiddenConfig; +import com.gmail.nossr50.core.config.skills.WorldBlacklist; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; -import com.gmail.nossr50.datatypes.skills.ToolType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.datatypes.skills.ToolType; import com.gmail.nossr50.events.fake.FakeBlockBreakEvent; import com.gmail.nossr50.events.fake.FakeBlockDamageEvent; import com.gmail.nossr50.mcMMO; @@ -23,7 +23,7 @@ import com.gmail.nossr50.util.BlockUtils; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.SkillUtils; import com.gmail.nossr50.util.sounds.SoundManager; import com.gmail.nossr50.util.sounds.SoundType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 78be30273..20e757954 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.listeners; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.config.WorldBlacklist; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.skills.WorldBlacklist; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.meta.OldName; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.subskills.interfaces.InteractType; +import com.gmail.nossr50.core.datatypes.meta.OldName; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.InteractType; import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent; import com.gmail.nossr50.events.fake.FakeEntityDamageEvent; import com.gmail.nossr50.events.fake.FakeEntityTameEvent; @@ -22,7 +22,7 @@ import com.gmail.nossr50.skills.taming.TamingManager; import com.gmail.nossr50.util.BlockUtils; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.CombatUtils; import com.gmail.nossr50.worldguard.WorldGuardManager; import com.gmail.nossr50.worldguard.WorldGuardUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java index a2b1dd01d..17542c9db 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.listeners; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; -import com.gmail.nossr50.datatypes.skills.subskills.interfaces.InteractType; -import com.gmail.nossr50.datatypes.skills.subskills.interfaces.Interaction; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.InteractType; +import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.Interaction; import com.gmail.nossr50.mcMMO; import org.bukkit.event.Event; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java index ea1ab8433..e6fa90c40 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.listeners; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.config.WorldBlacklist; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.skills.WorldBlacklist; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.events.fake.FakeBrewEvent; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.player.PlayerUpdateInventoryTask; @@ -11,7 +11,7 @@ import com.gmail.nossr50.skills.alchemy.Alchemy; import com.gmail.nossr50.skills.alchemy.AlchemyPotionBrewer; import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.SkillUtils; import com.gmail.nossr50.worldguard.WorldGuardManager; import com.gmail.nossr50.worldguard.WorldGuardUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 263b2598e..fa9f2e564 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -3,13 +3,13 @@ package com.gmail.nossr50.listeners; import com.gmail.nossr50.chat.ChatManager; import com.gmail.nossr50.chat.ChatManagerFactory; import com.gmail.nossr50.chat.PartyChatManager; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.config.WorldBlacklist; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.skills.WorldBlacklist; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.chat.ChatMode; -import com.gmail.nossr50.datatypes.party.Party; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.chat.ChatMode; +import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.party.ShareHandler; @@ -23,7 +23,7 @@ import com.gmail.nossr50.skills.salvage.Salvage; import com.gmail.nossr50.skills.salvage.SalvageManager; import com.gmail.nossr50.skills.taming.TamingManager; import com.gmail.nossr50.util.*; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.SkillUtils; import com.gmail.nossr50.util.sounds.SoundManager; import com.gmail.nossr50.util.sounds.SoundType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java index 433263300..f2cc07c73 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.listeners; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent; import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent; import com.gmail.nossr50.events.skills.abilities.McMMOPlayerAbilityActivateEvent; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.worldguard.WorldGuardManager; import com.gmail.nossr50.worldguard.WorldGuardUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/WorldListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/WorldListener.java index 2261fb732..c72d49d27 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/WorldListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/WorldListener.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.listeners; -import com.gmail.nossr50.config.WorldBlacklist; +import com.gmail.nossr50.core.config.skills.WorldBlacklist; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.blockmeta.conversion.BlockStoreConversionMain; +import com.gmail.nossr50.core.data.blockmeta.conversion.BlockStoreConversionMain; import org.bukkit.Chunk; import org.bukkit.World; import org.bukkit.block.BlockState; diff --git a/bukkit/src/main/java/com/gmail/nossr50/locale/LocaleLoader.java b/bukkit/src/main/java/com/gmail/nossr50/locale/LocaleLoader.java index 0262b4e81..0b75cadb7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/locale/LocaleLoader.java +++ b/bukkit/src/main/java/com/gmail/nossr50/locale/LocaleLoader.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.locale; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.mcMMO; import org.bukkit.ChatColor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java b/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java index 8b426c025..1a06cec8c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java @@ -1,6 +1,5 @@ package com.gmail.nossr50; -import com.gmail.nossr50.config.*; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.config.mods.ArmorConfigManager; import com.gmail.nossr50.config.mods.BlockConfigManager; @@ -9,11 +8,12 @@ import com.gmail.nossr50.config.mods.ToolConfigManager; import com.gmail.nossr50.config.skills.alchemy.PotionConfig; import com.gmail.nossr50.config.skills.repair.RepairConfigManager; import com.gmail.nossr50.config.skills.salvage.SalvageConfigManager; -import com.gmail.nossr50.config.treasure.TreasureConfig; -import com.gmail.nossr50.database.DatabaseManager; -import com.gmail.nossr50.database.DatabaseManagerFactory; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.subskills.acrobatics.Roll; +import com.gmail.nossr50.core.config.treasure.TreasureConfig; +import com.gmail.nossr50.core.config.skills.*; +import com.gmail.nossr50.core.data.database.DatabaseManager; +import com.gmail.nossr50.core.data.database.DatabaseManagerFactory; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.subskills.acrobatics.Roll; import com.gmail.nossr50.listeners.*; import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.runnables.CheckDateTask; @@ -34,11 +34,11 @@ import com.gmail.nossr50.skills.salvage.salvageables.Salvageable; import com.gmail.nossr50.skills.salvage.salvageables.SalvageableManager; import com.gmail.nossr50.skills.salvage.salvageables.SimpleSalvageableManager; import com.gmail.nossr50.util.*; -import com.gmail.nossr50.util.blockmeta.chunkmeta.ChunkManager; -import com.gmail.nossr50.util.blockmeta.chunkmeta.ChunkManagerFactory; +import com.gmail.nossr50.core.data.blockmeta.chunkmeta.ChunkManager; +import com.gmail.nossr50.core.data.blockmeta.chunkmeta.ChunkManagerFactory; import com.gmail.nossr50.util.commands.CommandRegistrationManager; import com.gmail.nossr50.util.experience.FormulaManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.upgrade.UpgradeManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/party/PartyManager.java b/bukkit/src/main/java/com/gmail/nossr50/party/PartyManager.java index 011cb15d7..99f6437da 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/party/PartyManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/party/PartyManager.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.party; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.chat.ChatMode; -import com.gmail.nossr50.datatypes.database.UpgradeType; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.party.ItemShareType; -import com.gmail.nossr50.datatypes.party.Party; -import com.gmail.nossr50.datatypes.party.PartyLeader; -import com.gmail.nossr50.datatypes.party.ShareMode; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.chat.ChatMode; +import com.gmail.nossr50.core.datatypes.database.UpgradeType; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.party.ItemShareType; +import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.party.PartyLeader; +import com.gmail.nossr50.core.datatypes.party.ShareMode; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import com.gmail.nossr50.events.party.McMMOPartyAllianceChangeEvent; import com.gmail.nossr50.events.party.McMMOPartyChangeEvent; import com.gmail.nossr50.locale.LocaleLoader; @@ -17,7 +17,7 @@ import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.sounds.SoundManager; import com.gmail.nossr50.util.sounds.SoundType; import org.bukkit.OfflinePlayer; diff --git a/bukkit/src/main/java/com/gmail/nossr50/party/ShareHandler.java b/bukkit/src/main/java/com/gmail/nossr50/party/ShareHandler.java index 0cdafff8f..d5db714c4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/party/ShareHandler.java +++ b/bukkit/src/main/java/com/gmail/nossr50/party/ShareHandler.java @@ -1,16 +1,16 @@ package com.gmail.nossr50.party; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.party.ItemWeightConfig; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.experience.XPGainSource; -import com.gmail.nossr50.datatypes.party.ItemShareType; -import com.gmail.nossr50.datatypes.party.Party; -import com.gmail.nossr50.datatypes.party.ShareMode; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.experience.XPGainSource; +import com.gmail.nossr50.core.datatypes.party.ItemShareType; +import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.party.ShareMode; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/SaveTimerTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/SaveTimerTask.java index 240c52178..62478590a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/SaveTimerTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/SaveTimerTask.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.runnables; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.runnables.player.PlayerProfileSaveTask; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.scheduler.BukkitRunnable; public class SaveTimerTask extends BukkitRunnable { diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/backups/CleanBackupsTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/backups/CleanBackupsTask.java index ac7cdcab7..b307855b7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/backups/CleanBackupsTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/backups/CleanBackupsTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.runnables.backups; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.mcMMO; import org.bukkit.scheduler.BukkitRunnable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/McrankCommandAsyncTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/McrankCommandAsyncTask.java index 7311b50bf..2f61e0cf0 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/McrankCommandAsyncTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/McrankCommandAsyncTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.runnables.commands; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import org.apache.commons.lang.Validate; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/McrankCommandDisplayTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/McrankCommandDisplayTask.java index 333aa166d..9f55aa331 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/McrankCommandDisplayTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/McrankCommandDisplayTask.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.runnables.commands; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandAsyncTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandAsyncTask.java index 387175cf7..7bccd7c50 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandAsyncTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandAsyncTask.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.runnables.commands; -import com.gmail.nossr50.datatypes.database.PlayerStat; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.database.PlayerStat; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import org.apache.commons.lang.Validate; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandDisplayTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandDisplayTask.java index 664a1da10..08a454d33 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandDisplayTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandDisplayTask.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.runnables.commands; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.database.PlayerStat; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.database.PlayerStat; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/database/DatabaseConversionTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/database/DatabaseConversionTask.java index eaf30befe..a9517b8af 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/database/DatabaseConversionTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/database/DatabaseConversionTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.runnables.database; -import com.gmail.nossr50.database.DatabaseManager; +import com.gmail.nossr50.core.data.database.DatabaseManager; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/database/FormulaConversionTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/database/FormulaConversionTask.java index f818cebba..c70f872b1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/database/FormulaConversionTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/database/FormulaConversionTask.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.runnables.database; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.database.DatabaseManager; -import com.gmail.nossr50.datatypes.experience.FormulaType; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.player.PlayerProfile; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.data.database.DatabaseManager; +import com.gmail.nossr50.core.datatypes.experience.FormulaType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.CommandSender; import org.bukkit.scheduler.BukkitRunnable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/database/UUIDUpdateAsyncTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/database/UUIDUpdateAsyncTask.java index 5719a7e80..128afe88c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/database/UUIDUpdateAsyncTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/database/UUIDUpdateAsyncTask.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.runnables.database; -import com.gmail.nossr50.config.HiddenConfig; -import com.gmail.nossr50.database.DatabaseManager; -import com.gmail.nossr50.datatypes.database.UpgradeType; +import com.gmail.nossr50.core.config.skills.HiddenConfig; +import com.gmail.nossr50.core.data.database.DatabaseManager; +import com.gmail.nossr50.core.datatypes.database.UpgradeType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.uuid.UUIDFetcher; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/database/UserPurgeTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/database/UserPurgeTask.java index db8d83f3d..ec8e4a92d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/database/UserPurgeTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/database/UserPurgeTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.runnables.database; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.mcMMO; import org.bukkit.scheduler.BukkitRunnable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/items/ChimaeraWingWarmup.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/items/ChimaeraWingWarmup.java index 5e267a56a..300259029 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/items/ChimaeraWingWarmup.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/items/ChimaeraWingWarmup.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.runnables.items; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.ChimaeraWing; import com.gmail.nossr50.util.ItemUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/items/TeleportationWarmup.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/items/TeleportationWarmup.java index 3a72c3790..13d725e90 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/items/TeleportationWarmup.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/items/TeleportationWarmup.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.runnables.items; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.util.EventUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/party/PartyAutoKickTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/party/PartyAutoKickTask.java index 987d1893f..ecb54be46 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/party/PartyAutoKickTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/party/PartyAutoKickTask.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.runnables.party; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.party.Party; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.party.PartyManager; import org.bukkit.OfflinePlayer; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/party/PartyChatTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/party/PartyChatTask.java index ff4b4999f..ea515b5af 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/party/PartyChatTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/party/PartyChatTask.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.runnables.party; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.party.Party; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.locale.LocaleLoader; import org.bukkit.ChatColor; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/player/ClearRegisteredXPGainTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/player/ClearRegisteredXPGainTask.java index 2c281ee88..552e89940 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/player/ClearRegisteredXPGainTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/player/ClearRegisteredXPGainTask.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.runnables.player; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.scheduler.BukkitRunnable; public class ClearRegisteredXPGainTask extends BukkitRunnable { diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileLoadingTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileLoadingTask.java index 2f5e561f1..c212297bd 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileLoadingTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileLoadingTask.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.runnables.player; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.commands.McScoreboardKeepTask; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import org.bukkit.Server; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileSaveTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileSaveTask.java index 414896983..d2b9e8388 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileSaveTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileSaveTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.runnables.player; -import com.gmail.nossr50.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import org.bukkit.scheduler.BukkitRunnable; public class PlayerProfileSaveTask extends BukkitRunnable { diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AbilityCooldownTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AbilityCooldownTask.java index 55a31084d..cd5592bfc 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AbilityCooldownTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AbilityCooldownTask.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.runnables.skills; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.util.player.NotificationManager; import org.bukkit.scheduler.BukkitRunnable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AbilityDisableTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AbilityDisableTask.java index ff26b7ab0..81c4415c3 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AbilityDisableTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AbilityDisableTask.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.runnables.skills; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Misc; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AlchemyBrewTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AlchemyBrewTask.java index c7fb56760..fc07d6000 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AlchemyBrewTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AlchemyBrewTask.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.runnables.skills; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.events.skills.alchemy.McMMOPlayerBrewEvent; import com.gmail.nossr50.events.skills.alchemy.McMMOPlayerCatalysisEvent; import com.gmail.nossr50.mcMMO; @@ -9,7 +9,7 @@ import com.gmail.nossr50.skills.alchemy.Alchemy; import com.gmail.nossr50.skills.alchemy.AlchemyPotionBrewer; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.BlockState; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AwardCombatXpTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AwardCombatXpTask.java index d7aee1718..601fbc527 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AwardCombatXpTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AwardCombatXpTask.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.runnables.skills; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.experience.XPGainSource; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.experience.XPGainSource; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import org.bukkit.entity.LivingEntity; import org.bukkit.scheduler.BukkitRunnable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/BleedTimerTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/BleedTimerTask.java index aaffd0a88..f669e7c8d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/BleedTimerTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/BleedTimerTask.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.runnables.skills; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.MobHealthbarUtils; import com.gmail.nossr50.util.player.NotificationManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/ExperienceBarHideTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/ExperienceBarHideTask.java index 23e78909c..c8f1ee933 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/ExperienceBarHideTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/ExperienceBarHideTask.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.runnables.skills; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.util.experience.ExperienceBarManager; import org.bukkit.scheduler.BukkitRunnable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/SkillUnlockNotificationTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/SkillUnlockNotificationTask.java index 2e23e42eb..7aae9c6aa 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/SkillUnlockNotificationTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/SkillUnlockNotificationTask.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.runnables.skills; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.util.player.NotificationManager; import org.bukkit.scheduler.BukkitRunnable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/ToolLowerTask.java b/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/ToolLowerTask.java index bff688e4f..a41bd92ed 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/ToolLowerTask.java +++ b/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/ToolLowerTask.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.runnables.skills; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.ToolType; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.ToolType; import com.gmail.nossr50.util.player.NotificationManager; import org.bukkit.scheduler.BukkitRunnable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/SkillManager.java b/bukkit/src/main/java/com/gmail/nossr50/skills/SkillManager.java index ccfd3fe8f..10495533e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/SkillManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/SkillManager.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.skills; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.experience.XPGainSource; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.experience.XPGainSource; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/acrobatics/Acrobatics.java b/bukkit/src/main/java/com/gmail/nossr50/skills/acrobatics/Acrobatics.java index 1c72521f8..f2d061578 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/acrobatics/Acrobatics.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/acrobatics/Acrobatics.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.skills.acrobatics; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; public final class Acrobatics { diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java b/bukkit/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java index 49bf29a09..eadc63076 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.skills.acrobatics; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/Alchemy.java b/bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/Alchemy.java index 478957de6..500640afd 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/Alchemy.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/Alchemy.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.skills.alchemy; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.skills.AlchemyBrewTask; import com.gmail.nossr50.util.skills.RankUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyManager.java b/bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyManager.java index 01c8e7665..d7acbb81b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyManager.java @@ -2,12 +2,12 @@ package com.gmail.nossr50.skills.alchemy; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.config.skills.alchemy.PotionConfig; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.experience.XPGainSource; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.alchemy.PotionStage; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.experience.XPGainSource; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.alchemy.PotionStage; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.skills.RankUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java b/bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java index 9d1f902ca..e53bbf12e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.skills.alchemy; import com.gmail.nossr50.config.skills.alchemy.PotionConfig; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.alchemy.AlchemyPotion; -import com.gmail.nossr50.datatypes.skills.alchemy.PotionStage; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.alchemy.AlchemyPotion; +import com.gmail.nossr50.core.datatypes.skills.alchemy.PotionStage; import com.gmail.nossr50.events.fake.FakeBrewEvent; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.player.PlayerUpdateInventoryTask; import com.gmail.nossr50.runnables.skills.AlchemyBrewCheckTask; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.Material; import org.bukkit.block.BlockState; import org.bukkit.block.BrewingStand; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/archery/Archery.java b/bukkit/src/main/java/com/gmail/nossr50/skills/archery/Archery.java index 25e5d2ec5..0b76e5eb6 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/archery/Archery.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/archery/Archery.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.skills.archery; -import com.gmail.nossr50.config.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.skills.RankUtils; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java b/bukkit/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java index 32e38190b..84a4ab289 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.skills.archery; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.SkillActivationType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/axes/Axes.java b/bukkit/src/main/java/com/gmail/nossr50/skills/axes/Axes.java index 2dd7e0e29..a34bcf8e5 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/axes/Axes.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/axes/Axes.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.skills.axes; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.skills.RankUtils; import org.bukkit.entity.LivingEntity; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/axes/AxesManager.java b/bukkit/src/main/java/com/gmail/nossr50/skills/axes/AxesManager.java index 4a15bb45d..d4b071737 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/axes/AxesManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/axes/AxesManager.java @@ -1,16 +1,16 @@ package com.gmail.nossr50.skills.axes; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; -import com.gmail.nossr50.datatypes.skills.ToolType; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.datatypes.skills.ToolType; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.*; import org.bukkit.entity.LivingEntity; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/child/ChildConfig.java b/bukkit/src/main/java/com/gmail/nossr50/skills/child/ChildConfig.java index 91a0c419f..4d6f9f987 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/child/ChildConfig.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/child/ChildConfig.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.skills.child; -import com.gmail.nossr50.config.AutoUpdateConfigLoader; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.config.skills.AutoUpdateConfigLoader; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.util.StringUtils; import org.bukkit.configuration.file.YamlConfiguration; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/child/FamilyTree.java b/bukkit/src/main/java/com/gmail/nossr50/skills/child/FamilyTree.java index 72ecbe530..df78202d3 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/child/FamilyTree.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/child/FamilyTree.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.skills.child; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import java.util.Collections; import java.util.EnumSet; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/excavation/Excavation.java b/bukkit/src/main/java/com/gmail/nossr50/skills/excavation/Excavation.java index 1f369d942..d91d78c65 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/excavation/Excavation.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/excavation/Excavation.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.skills.excavation; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.config.treasure.TreasureConfig; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure; +import com.gmail.nossr50.core.config.treasure.TreasureConfig; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.treasure.ExcavationTreasure; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.StringUtils; import org.bukkit.block.BlockState; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java b/bukkit/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java index 077caded0..55dc6a3ae 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.skills.excavation; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.treasure.ExcavationTreasure; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/fishing/Fishing.java b/bukkit/src/main/java/com/gmail/nossr50/skills/fishing/Fishing.java index 8d2c72694..33f0a1515 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/fishing/Fishing.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/fishing/Fishing.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.skills.fishing; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.treasure.TreasureConfig; -import com.gmail.nossr50.datatypes.treasure.ShakeTreasure; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.treasure.TreasureConfig; +import com.gmail.nossr50.core.datatypes.treasure.ShakeTreasure; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.adapter.BiomeAdapter; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java b/bukkit/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java index f35477434..b70b66f8e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java @@ -1,18 +1,18 @@ package com.gmail.nossr50.skills.fishing; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.config.treasure.TreasureConfig; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.treasure.EnchantmentTreasure; -import com.gmail.nossr50.datatypes.treasure.FishingTreasure; -import com.gmail.nossr50.datatypes.treasure.Rarity; -import com.gmail.nossr50.datatypes.treasure.ShakeTreasure; +import com.gmail.nossr50.core.config.treasure.TreasureConfig; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.treasure.EnchantmentTreasure; +import com.gmail.nossr50.core.datatypes.treasure.FishingTreasure; +import com.gmail.nossr50.core.datatypes.treasure.Rarity; +import com.gmail.nossr50.core.datatypes.treasure.ShakeTreasure; import com.gmail.nossr50.events.skills.fishing.McMMOPlayerFishingTreasureEvent; import com.gmail.nossr50.events.skills.fishing.McMMOPlayerShakeEvent; import com.gmail.nossr50.skills.SkillManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java b/bukkit/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java index 6a248020b..615262ace 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java @@ -1,17 +1,17 @@ package com.gmail.nossr50.skills.herbalism; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.config.treasure.TreasureConfig; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.mods.CustomBlock; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; -import com.gmail.nossr50.datatypes.skills.ToolType; -import com.gmail.nossr50.datatypes.treasure.HylianTreasure; +import com.gmail.nossr50.core.config.treasure.TreasureConfig; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.mods.CustomBlock; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.datatypes.skills.ToolType; +import com.gmail.nossr50.core.datatypes.treasure.HylianTreasure; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.skills.HerbalismBlockUpdaterTask; import com.gmail.nossr50.skills.SkillManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/mining/BlastMining.java b/bukkit/src/main/java/com/gmail/nossr50/skills/mining/BlastMining.java index 0d53226ae..8bf6005db 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/mining/BlastMining.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/mining/BlastMining.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.skills.mining; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.RankUtils; import org.bukkit.Material; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/mining/Mining.java b/bukkit/src/main/java/com/gmail/nossr50/skills/mining/Mining.java index 91e5d156e..cd805062c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/mining/Mining.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/mining/Mining.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.skills.mining; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java b/bukkit/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java index 69ceac9a9..c04e55461 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.skills.mining; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.skills.AbilityCooldownTask; import com.gmail.nossr50.skills.SkillManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/ArcaneForging.java b/bukkit/src/main/java/com/gmail/nossr50/skills/repair/ArcaneForging.java index f7ea4fd70..cb3f98834 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/ArcaneForging.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/repair/ArcaneForging.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.skills.repair; -import com.gmail.nossr50.config.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; public class ArcaneForging { diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/Repair.java b/bukkit/src/main/java/com/gmail/nossr50/skills/repair/Repair.java index 6820c1b1f..45ebd010c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/Repair.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/repair/Repair.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.skills.repair; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.Config; import org.bukkit.Material; public class Repair { diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java b/bukkit/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java index 6dc981941..56909867a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.skills.repair; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/Repairable.java b/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/Repairable.java index d58fb0ed1..6468c46f1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/Repairable.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/Repairable.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.skills.repair.repairables; -import com.gmail.nossr50.datatypes.skills.ItemType; -import com.gmail.nossr50.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.datatypes.skills.ItemType; +import com.gmail.nossr50.core.datatypes.skills.MaterialType; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/RepairableFactory.java b/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/RepairableFactory.java index adaa80ef8..6d72225a6 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/RepairableFactory.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/RepairableFactory.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.skills.repair.repairables; -import com.gmail.nossr50.datatypes.skills.ItemType; -import com.gmail.nossr50.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.datatypes.skills.ItemType; +import com.gmail.nossr50.core.datatypes.skills.MaterialType; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/SimpleRepairable.java b/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/SimpleRepairable.java index 595a032cc..c8e26c4c3 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/SimpleRepairable.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/SimpleRepairable.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.skills.repair.repairables; -import com.gmail.nossr50.datatypes.skills.ItemType; -import com.gmail.nossr50.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.datatypes.skills.ItemType; +import com.gmail.nossr50.core.datatypes.skills.MaterialType; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/Salvage.java b/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/Salvage.java index 4eddcfb6e..7cd8ef3af 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/Salvage.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/Salvage.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.skills.salvage; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.Config; import org.bukkit.Material; public class Salvage { diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java b/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java index 9ff30053a..41cf74b76 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.skills.salvage; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/Salvageable.java b/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/Salvageable.java index cb3459e26..cc1d20564 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/Salvageable.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/Salvageable.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.skills.salvage.salvageables; -import com.gmail.nossr50.datatypes.skills.ItemType; -import com.gmail.nossr50.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.datatypes.skills.ItemType; +import com.gmail.nossr50.core.datatypes.skills.MaterialType; import org.bukkit.Material; public interface Salvageable { diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SalvageableFactory.java b/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SalvageableFactory.java index 982b3b5e7..eafad00ab 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SalvageableFactory.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SalvageableFactory.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.skills.salvage.salvageables; -import com.gmail.nossr50.datatypes.skills.ItemType; -import com.gmail.nossr50.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.datatypes.skills.ItemType; +import com.gmail.nossr50.core.datatypes.skills.MaterialType; import org.bukkit.Material; public class SalvageableFactory { diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SimpleSalvageable.java b/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SimpleSalvageable.java index 6a6bce6b5..715426165 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SimpleSalvageable.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SimpleSalvageable.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.skills.salvage.salvageables; -import com.gmail.nossr50.datatypes.skills.ItemType; -import com.gmail.nossr50.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.datatypes.skills.ItemType; +import com.gmail.nossr50.core.datatypes.skills.MaterialType; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/smelting/Smelting.java b/bukkit/src/main/java/com/gmail/nossr50/skills/smelting/Smelting.java index 67c8cb5ff..e8ba7e03a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/smelting/Smelting.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/smelting/Smelting.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.skills.smelting; -import com.gmail.nossr50.config.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.skills.RankUtils; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/smelting/SmeltingManager.java b/bukkit/src/main/java/com/gmail/nossr50/skills/smelting/SmeltingManager.java index 6cc041e02..1ac510cf1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/smelting/SmeltingManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/smelting/SmeltingManager.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.skills.smelting; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.experience.XPGainSource; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.experience.XPGainSource; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.skills.mining.Mining; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/swords/Swords.java b/bukkit/src/main/java/com/gmail/nossr50/skills/swords/Swords.java index c6d49eb5f..159d3a565 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/swords/Swords.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/swords/Swords.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.skills.swords; -import com.gmail.nossr50.config.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; public class Swords { public static int bleedMaxTicks = AdvancedConfig.getInstance().getRuptureMaxTicks(); diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java b/bukkit/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java index 6d43fa769..b6c62dcb4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java @@ -1,16 +1,16 @@ package com.gmail.nossr50.skills.swords; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; -import com.gmail.nossr50.datatypes.skills.ToolType; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.datatypes.skills.ToolType; import com.gmail.nossr50.runnables.skills.BleedTimerTask; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.CombatUtils; import com.gmail.nossr50.util.skills.RankUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/taming/Taming.java b/bukkit/src/main/java/com/gmail/nossr50/skills/taming/Taming.java index 1313c4c46..40fdd5570 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/taming/Taming.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/taming/Taming.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.skills.taming; -import com.gmail.nossr50.config.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; import org.bukkit.EntityEffect; import org.bukkit.entity.*; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java b/bukkit/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java index d6c21e6b1..b8079e619 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.skills.taming; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.events.fake.FakeEntityTameEvent; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; @@ -17,7 +17,7 @@ import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceSkillStatic; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.ParticleEffectUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/taming/TrackedTamingEntity.java b/bukkit/src/main/java/com/gmail/nossr50/skills/taming/TrackedTamingEntity.java index 51bb6afb7..67b543e8f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/taming/TrackedTamingEntity.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/taming/TrackedTamingEntity.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.skills.taming; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.skills.CombatUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/unarmed/Unarmed.java b/bukkit/src/main/java/com/gmail/nossr50/skills/unarmed/Unarmed.java index 7f4c25c1c..4e795e594 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/unarmed/Unarmed.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/unarmed/Unarmed.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.skills.unarmed; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.util.sounds.SoundManager; import com.gmail.nossr50.util.sounds.SoundType; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java b/bukkit/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java index b3c081497..853ac9c62 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.skills.unarmed; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; -import com.gmail.nossr50.datatypes.skills.ToolType; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.datatypes.skills.ToolType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.EventUtils; @@ -14,7 +14,7 @@ import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.SkillActivationType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java b/bukkit/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java index 078170a18..595eff6cd 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.skills.woodcutting; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.BlockUtils; import com.gmail.nossr50.util.Misc; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java b/bukkit/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java index fc65fb450..63efc6f7b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.skills.woodcutting; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.mods.CustomBlock; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.mods.CustomBlock; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.skills.woodcutting.Woodcutting.ExperienceGainMethod; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/BlockUtils.java b/bukkit/src/main/java/com/gmail/nossr50/util/BlockUtils.java index 6066e3da2..2c57b42b1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/BlockUtils.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/BlockUtils.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.util; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.repair.Repair; import com.gmail.nossr50.skills.salvage.Salvage; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/ChimaeraWing.java b/bukkit/src/main/java/com/gmail/nossr50/util/ChimaeraWing.java index b8897d945..e1738c3bf 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/ChimaeraWing.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/ChimaeraWing.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.util; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.items.ChimaeraWingWarmup; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.CombatUtils; import com.gmail.nossr50.util.skills.SkillUtils; import com.gmail.nossr50.util.sounds.SoundManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/EventUtils.java b/bukkit/src/main/java/com/gmail/nossr50/util/EventUtils.java index e807e01c2..41a1fabe1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/EventUtils.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/EventUtils.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.util; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.experience.XPGainSource; -import com.gmail.nossr50.datatypes.party.Party; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.player.PlayerProfile; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; -import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.experience.XPGainSource; +import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.events.experience.McMMOPlayerLevelChangeEvent; import com.gmail.nossr50.events.experience.McMMOPlayerLevelDownEvent; import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent; @@ -30,7 +30,7 @@ import com.gmail.nossr50.events.skills.secondaryabilities.SubSkillEvent; import com.gmail.nossr50.events.skills.unarmed.McMMOPlayerDisarmEvent; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.CombatUtils; import org.bukkit.block.Block; import org.bukkit.enchantments.Enchantment; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/HardcoreManager.java b/bukkit/src/main/java/com/gmail/nossr50/util/HardcoreManager.java index 944df8cac..4ade50c0f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/HardcoreManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/HardcoreManager.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.util; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.player.PlayerProfile; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import java.util.HashMap; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/HolidayManager.java b/bukkit/src/main/java/com/gmail/nossr50/util/HolidayManager.java index e1d88462c..a56f79c14 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/HolidayManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/HolidayManager.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.util; import com.gmail.nossr50.commands.skills.AprilCommand; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.ParticleEffectUtils; import com.gmail.nossr50.util.sounds.SoundManager; import com.gmail.nossr50.util.sounds.SoundType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/ItemUtils.java b/bukkit/src/main/java/com/gmail/nossr50/util/ItemUtils.java index 2ee2f1936..daa15b982 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/ItemUtils.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/ItemUtils.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.util; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.party.ItemWeightConfig; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/Misc.java b/bukkit/src/main/java/com/gmail/nossr50/util/Misc.java index fc9fb9e68..0b6dca19f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/Misc.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/Misc.java @@ -3,7 +3,7 @@ package com.gmail.nossr50.util; import com.gmail.nossr50.events.items.McMMOItemSpawnEvent; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableSet; import org.bukkit.Location; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java b/bukkit/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java index 9c40f8aa6..3f4aa12b1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.util; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.MobHealthbarType; -import com.gmail.nossr50.datatypes.meta.OldName; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.MobHealthbarType; +import com.gmail.nossr50.core.datatypes.meta.OldName; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.MobHealthDisplayUpdaterTask; import org.bukkit.ChatColor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/ModManager.java b/bukkit/src/main/java/com/gmail/nossr50/util/ModManager.java index 025775801..8201328cd 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/ModManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/ModManager.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.util; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.mods.CustomArmorConfig; import com.gmail.nossr50.config.mods.CustomBlockConfig; import com.gmail.nossr50.config.mods.CustomEntityConfig; import com.gmail.nossr50.config.mods.CustomToolConfig; -import com.gmail.nossr50.datatypes.mods.CustomBlock; -import com.gmail.nossr50.datatypes.mods.CustomEntity; -import com.gmail.nossr50.datatypes.mods.CustomTool; +import com.gmail.nossr50.core.datatypes.mods.CustomBlock; +import com.gmail.nossr50.core.datatypes.mods.CustomEntity; +import com.gmail.nossr50.core.datatypes.mods.CustomTool; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.repair.repairables.Repairable; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/Motd.java b/bukkit/src/main/java/com/gmail/nossr50/util/Motd.java index a4ca18754..0d627523d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/Motd.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/Motd.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.util; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.skills.PerksUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/Permissions.java b/bukkit/src/main/java/com/gmail/nossr50/util/Permissions.java index cda3cf831..bb9342e71 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/Permissions.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/Permissions.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.util; import com.gmail.nossr50.commands.party.PartySubcommandType; -import com.gmail.nossr50.datatypes.skills.ItemType; -import com.gmail.nossr50.datatypes.skills.MaterialType; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.datatypes.skills.ItemType; +import com.gmail.nossr50.core.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.mcMMO; import org.bukkit.Material; import org.bukkit.Server; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/StringUtils.java b/bukkit/src/main/java/com/gmail/nossr50/util/StringUtils.java index 31d1e77d4..163c1078a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/StringUtils.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/StringUtils.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.util; -import com.gmail.nossr50.datatypes.party.PartyFeature; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.datatypes.party.PartyFeature; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; import org.bukkit.Material; import org.bukkit.block.data.Ageable; import org.bukkit.block.data.BlockData; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/TextComponentFactory.java b/bukkit/src/main/java/com/gmail/nossr50/util/TextComponentFactory.java index 31192c431..7adbd744a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/TextComponentFactory.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/TextComponentFactory.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.util; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.config.RankConfig; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.json.McMMOUrl; -import com.gmail.nossr50.datatypes.json.McMMOWebLinks; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.skills.RankConfig; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.json.McMMOUrl; +import com.gmail.nossr50.core.datatypes.json.McMMOWebLinks; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.listeners.InteractionManager; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.skills.RankUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java b/bukkit/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java index d05de745b..1a7810e3e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java @@ -17,8 +17,8 @@ import com.gmail.nossr50.commands.party.PartyCommand; import com.gmail.nossr50.commands.party.teleport.PtpCommand; import com.gmail.nossr50.commands.player.*; import com.gmail.nossr50.commands.skills.*; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.StringUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java b/bukkit/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java index c23f06298..796701593 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.util.commands; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.player.PlayerProfile; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.StringUtils; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.SkillUtils; import com.google.common.collect.ImmutableList; import org.bukkit.OfflinePlayer; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/experience/ExperienceBarManager.java b/bukkit/src/main/java/com/gmail/nossr50/util/experience/ExperienceBarManager.java index e21843c8a..fca840ea5 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/experience/ExperienceBarManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/experience/ExperienceBarManager.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.util.experience; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.runnables.skills.ExperienceBarHideTask; import org.bukkit.plugin.Plugin; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/experience/ExperienceBarWrapper.java b/bukkit/src/main/java/com/gmail/nossr50/util/experience/ExperienceBarWrapper.java index 9fcad6fbb..231362b74 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/experience/ExperienceBarWrapper.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/experience/ExperienceBarWrapper.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.util.experience; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.StringUtils; import org.bukkit.Server; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/experience/FormulaManager.java b/bukkit/src/main/java/com/gmail/nossr50/util/experience/FormulaManager.java index ad2145f05..a445f595a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/experience/FormulaManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/experience/FormulaManager.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.util.experience; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.experience.FormulaType; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.experience.FormulaType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import org.bukkit.configuration.file.YamlConfiguration; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/player/NotificationManager.java b/bukkit/src/main/java/com/gmail/nossr50/util/player/NotificationManager.java index 3558bf5e7..629cebf3f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/player/NotificationManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/player/NotificationManager.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.util.player; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.events.skills.McMMOPlayerNotificationEvent; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.TextComponentFactory; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceSkill.java b/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceSkill.java index 3502e84bc..ecde9fad3 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceSkill.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceSkill.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.util.random; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; public class RandomChanceSkill implements RandomChanceExecution { diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceSkillStatic.java b/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceSkillStatic.java index 0e00849f7..8aa996b12 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceSkillStatic.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceSkillStatic.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.util.random; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import org.bukkit.entity.Player; public class RandomChanceSkillStatic extends RandomChanceSkill { diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceUtil.java b/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceUtil.java index 6bb213c5e..77e379c7d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceUtil.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceUtil.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.util.random; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.events.skills.secondaryabilities.SubSkillEvent; import com.gmail.nossr50.events.skills.secondaryabilities.SubSkillRandomCheckEvent; import com.gmail.nossr50.util.EventUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardManager.java b/bukkit/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardManager.java index 1e9347e59..c7d01f424 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardManager.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.util.scoreboards; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.database.PlayerStat; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.player.PlayerProfile; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.database.PlayerStat; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardWrapper.java b/bukkit/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardWrapper.java index d2cc8da3d..286877578 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardWrapper.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardWrapper.java @@ -1,17 +1,17 @@ package com.gmail.nossr50.util.scoreboards; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.database.PlayerStat; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.player.PlayerProfile; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.datatypes.database.PlayerStat; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.events.scoreboard.*; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.child.FamilyTree; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager.SidebarType; import org.apache.commons.lang.Validate; import org.bukkit.ChatColor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java b/bukkit/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java index 6cac512cc..b25df64eb 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.util.skills; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent; import com.gmail.nossr50.events.fake.FakeEntityDamageEvent; import com.gmail.nossr50.mcMMO; @@ -21,7 +21,7 @@ import com.gmail.nossr50.skills.unarmed.Unarmed; import com.gmail.nossr50.skills.unarmed.UnarmedManager; import com.gmail.nossr50.util.*; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableMap; import org.bukkit.GameMode; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java b/bukkit/src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java index ba2f3bb57..366b944a4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.util.skills; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.mcMMO; import org.bukkit.*; import org.bukkit.FireworkEffect.Type; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java b/bukkit/src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java index 1247c8272..04282a97b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.util.skills; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.util.Permissions; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java b/bukkit/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java index 21ba0a678..dc98da67b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.util.skills; -import com.gmail.nossr50.config.RankConfig; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; -import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.config.skills.RankConfig; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.listeners.InteractionManager; import com.gmail.nossr50.runnables.skills.SkillUnlockNotificationTask; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java b/bukkit/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java index ae1d75474..7f11b8387 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java @@ -1,22 +1,22 @@ package com.gmail.nossr50.util.skills; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.config.HiddenConfig; -import com.gmail.nossr50.datatypes.experience.XPGainReason; -import com.gmail.nossr50.datatypes.experience.XPGainSource; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.skills.HiddenConfig; +import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.datatypes.experience.XPGainSource; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.core.data.UserManager; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/sounds/SoundManager.java b/bukkit/src/main/java/com/gmail/nossr50/util/sounds/SoundManager.java index 73a4905e1..28090eb89 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/sounds/SoundManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/sounds/SoundManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.util.sounds; -import com.gmail.nossr50.config.SoundConfig; +import com.gmail.nossr50.core.config.skills.SoundConfig; import com.gmail.nossr50.util.Misc; import org.bukkit.Location; import org.bukkit.Sound; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/upgrade/UpgradeManager.java b/bukkit/src/main/java/com/gmail/nossr50/util/upgrade/UpgradeManager.java index 082376c0e..f49c8d973 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/upgrade/UpgradeManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/util/upgrade/UpgradeManager.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.util.upgrade; -import com.gmail.nossr50.config.ConfigLoader; -import com.gmail.nossr50.datatypes.database.UpgradeType; +import com.gmail.nossr50.core.config.skills.ConfigLoader; +import com.gmail.nossr50.core.datatypes.database.UpgradeType; import java.util.Arrays; import java.util.EnumSet; diff --git a/bukkit/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java b/bukkit/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java index 4f46c8699..5e1e942de 100644 --- a/bukkit/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java +++ b/bukkit/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java @@ -1,6 +1,6 @@ package net.shatteredlands.shatt.backup; -import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.mcMMO; import java.io.File; diff --git a/core/src/main/java/com/gmail/nossr50/McmmoCore.java b/core/src/main/java/com/gmail/nossr50/McmmoCore.java deleted file mode 100644 index f84cfb30a..000000000 --- a/core/src/main/java/com/gmail/nossr50/McmmoCore.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.gmail.nossr50; - -public class McmmoCore { - -} diff --git a/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java b/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java new file mode 100644 index 000000000..f2b27a659 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java @@ -0,0 +1,5 @@ +package com.gmail.nossr50.core; + +public class McmmoCore { + +} diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java index 22c7de84d..c7890622f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java @@ -1,10 +1,10 @@ -package com.gmail.nossr50.config.experience; +package com.gmail.nossr50.core.config.experience; -import com.gmail.nossr50.config.AutoUpdateConfigLoader; -import com.gmail.nossr50.datatypes.experience.FormulaType; -import com.gmail.nossr50.datatypes.skills.MaterialType; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.alchemy.PotionStage; +import com.gmail.nossr50.core.config.skills.AutoUpdateConfigLoader; +import com.gmail.nossr50.core.datatypes.experience.FormulaType; +import com.gmail.nossr50.core.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.alchemy.PotionStage; import com.gmail.nossr50.util.StringUtils; import org.bukkit.Material; import org.bukkit.block.data.BlockData; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/mods/ArmorConfigManager.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/ArmorConfigManager.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/config/mods/ArmorConfigManager.java rename to core/src/main/java/com/gmail/nossr50/core/config/mods/ArmorConfigManager.java index 95f979e59..991294864 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/mods/ArmorConfigManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/ArmorConfigManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.config.mods; +package com.gmail.nossr50.core.config.mods; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.ModManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/mods/BlockConfigManager.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/BlockConfigManager.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/config/mods/BlockConfigManager.java rename to core/src/main/java/com/gmail/nossr50/core/config/mods/BlockConfigManager.java index 2b3c397ff..c094f6782 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/mods/BlockConfigManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/BlockConfigManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.config.mods; +package com.gmail.nossr50.core.config.mods; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.ModManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/mods/CustomArmorConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/config/mods/CustomArmorConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java index 01a23f3ce..1ebaacaf2 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/mods/CustomArmorConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java @@ -1,8 +1,8 @@ -package com.gmail.nossr50.config.mods; +package com.gmail.nossr50.core.config.mods; -import com.gmail.nossr50.config.ConfigLoader; -import com.gmail.nossr50.datatypes.skills.ItemType; -import com.gmail.nossr50.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.config.skills.ConfigLoader; +import com.gmail.nossr50.core.datatypes.skills.ItemType; +import com.gmail.nossr50.core.datatypes.skills.MaterialType; import com.gmail.nossr50.skills.repair.repairables.Repairable; import com.gmail.nossr50.skills.repair.repairables.RepairableFactory; import com.gmail.nossr50.util.skills.SkillUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/mods/CustomBlockConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/config/mods/CustomBlockConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java index 2b30ec0cf..58a836471 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/mods/CustomBlockConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.config.mods; +package com.gmail.nossr50.core.config.mods; -import com.gmail.nossr50.config.ConfigLoader; -import com.gmail.nossr50.datatypes.mods.CustomBlock; +import com.gmail.nossr50.core.config.skills.ConfigLoader; +import com.gmail.nossr50.core.datatypes.mods.CustomBlock; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/mods/CustomEntityConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/config/mods/CustomEntityConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java index 95ef1e5d1..ed3263ca4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/mods/CustomEntityConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.config.mods; +package com.gmail.nossr50.core.config.mods; -import com.gmail.nossr50.config.ConfigLoader; -import com.gmail.nossr50.datatypes.mods.CustomEntity; +import com.gmail.nossr50.core.config.skills.ConfigLoader; +import com.gmail.nossr50.core.datatypes.mods.CustomEntity; import org.apache.commons.lang.ClassUtils; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/mods/CustomToolConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/config/mods/CustomToolConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java index 915face2b..e0e7249a5 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/mods/CustomToolConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java @@ -1,9 +1,9 @@ -package com.gmail.nossr50.config.mods; +package com.gmail.nossr50.core.config.mods; -import com.gmail.nossr50.config.ConfigLoader; -import com.gmail.nossr50.datatypes.mods.CustomTool; -import com.gmail.nossr50.datatypes.skills.ItemType; -import com.gmail.nossr50.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.config.skills.ConfigLoader; +import com.gmail.nossr50.core.datatypes.mods.CustomTool; +import com.gmail.nossr50.core.datatypes.skills.ItemType; +import com.gmail.nossr50.core.datatypes.skills.MaterialType; import com.gmail.nossr50.skills.repair.repairables.Repairable; import com.gmail.nossr50.skills.repair.repairables.RepairableFactory; import com.gmail.nossr50.util.skills.SkillUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/mods/EntityConfigManager.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/EntityConfigManager.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/config/mods/EntityConfigManager.java rename to core/src/main/java/com/gmail/nossr50/core/config/mods/EntityConfigManager.java index 1ccedadea..05d6e2968 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/mods/EntityConfigManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/EntityConfigManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.config.mods; +package com.gmail.nossr50.core.config.mods; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.ModManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/mods/ToolConfigManager.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/ToolConfigManager.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/config/mods/ToolConfigManager.java rename to core/src/main/java/com/gmail/nossr50/core/config/mods/ToolConfigManager.java index 0a4873056..e7cc09e18 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/mods/ToolConfigManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/ToolConfigManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.config.mods; +package com.gmail.nossr50.core.config.mods; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.ModManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/party/ItemWeightConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java similarity index 91% rename from bukkit/src/main/java/com/gmail/nossr50/config/party/ItemWeightConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java index 6e84bd8f6..df57b7d32 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/party/ItemWeightConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.config.party; +package com.gmail.nossr50.core.config.party; -import com.gmail.nossr50.config.ConfigLoader; +import com.gmail.nossr50.core.config.skills.ConfigLoader; import com.gmail.nossr50.util.StringUtils; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/AdvancedConfig.java similarity index 99% rename from bukkit/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/skills/AdvancedConfig.java index cfbc7f7a6..72fe7bc85 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/AdvancedConfig.java @@ -1,8 +1,8 @@ -package com.gmail.nossr50.config; +package com.gmail.nossr50.core.config.skills; -import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.mcMMO; import net.md_5.bungee.api.ChatColor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/AutoUpdateConfigLoader.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/AutoUpdateConfigLoader.java similarity index 99% rename from bukkit/src/main/java/com/gmail/nossr50/config/AutoUpdateConfigLoader.java rename to core/src/main/java/com/gmail/nossr50/core/config/skills/AutoUpdateConfigLoader.java index 439eef220..09f32b1e2 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/AutoUpdateConfigLoader.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/AutoUpdateConfigLoader.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.config; +package com.gmail.nossr50.core.config.skills; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/Config.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/Config.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/config/Config.java rename to core/src/main/java/com/gmail/nossr50/core/config/skills/Config.java index 64e96bd14..7145c6216 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/Config.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/Config.java @@ -1,10 +1,10 @@ -package com.gmail.nossr50.config; +package com.gmail.nossr50.core.config.skills; -import com.gmail.nossr50.database.SQLDatabaseManager; -import com.gmail.nossr50.datatypes.MobHealthbarType; -import com.gmail.nossr50.datatypes.party.PartyFeature; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.data.database.SQLDatabaseManager; +import com.gmail.nossr50.core.datatypes.MobHealthbarType; +import com.gmail.nossr50.core.datatypes.party.PartyFeature; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.util.StringUtils; import org.bukkit.Material; import org.bukkit.block.data.BlockData; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/ConfigLoader.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/ConfigLoader.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/config/ConfigLoader.java rename to core/src/main/java/com/gmail/nossr50/core/config/skills/ConfigLoader.java index 025fe981b..d98cd94bd 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/ConfigLoader.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/ConfigLoader.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.config; +package com.gmail.nossr50.core.config.skills; import com.gmail.nossr50.mcMMO; import org.bukkit.configuration.file.FileConfiguration; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/CoreSkillsConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/CoreSkillsConfig.java similarity index 88% rename from bukkit/src/main/java/com/gmail/nossr50/config/CoreSkillsConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/skills/CoreSkillsConfig.java index 269ee30f2..f08b41db7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/CoreSkillsConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/CoreSkillsConfig.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.config; +package com.gmail.nossr50.core.config.skills; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.util.StringUtils; public class CoreSkillsConfig extends AutoUpdateConfigLoader { diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/HiddenConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/HiddenConfig.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/config/HiddenConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/skills/HiddenConfig.java index edf89885d..497bcfc44 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/HiddenConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/HiddenConfig.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.config; +package com.gmail.nossr50.core.config.skills; import com.gmail.nossr50.mcMMO; import org.bukkit.configuration.file.YamlConfiguration; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/RankConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/RankConfig.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/config/RankConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/skills/RankConfig.java index f5a1a7e71..651c67bce 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/RankConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/RankConfig.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.config; +package com.gmail.nossr50.core.config.skills; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; import java.util.ArrayList; import java.util.List; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/SoundConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/SoundConfig.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/config/SoundConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/skills/SoundConfig.java index 1bd215461..05604f686 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/SoundConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/SoundConfig.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.config; +package com.gmail.nossr50.core.config.skills; import com.gmail.nossr50.util.sounds.SoundType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/WorldBlacklist.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/WorldBlacklist.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/config/WorldBlacklist.java rename to core/src/main/java/com/gmail/nossr50/core/config/skills/WorldBlacklist.java index a37b89b3e..f7364e96a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/WorldBlacklist.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/WorldBlacklist.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.config; +package com.gmail.nossr50.core.config.skills; import com.gmail.nossr50.mcMMO; import org.bukkit.World; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/skills/alchemy/PotionConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java similarity index 99% rename from bukkit/src/main/java/com/gmail/nossr50/config/skills/alchemy/PotionConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java index 1c8ae0f13..0b38de157 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/skills/alchemy/PotionConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java @@ -1,14 +1,13 @@ package com.gmail.nossr50.config.skills.alchemy; import com.gmail.nossr50.config.ConfigLoader; -import com.gmail.nossr50.datatypes.skills.alchemy.AlchemyPotion; +import com.gmail.nossr50.core.datatypes.skills.alchemy.AlchemyPotion; import com.gmail.nossr50.mcMMO; import org.bukkit.ChatColor; import org.bukkit.Color; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.inventory.ItemStack; -import org.bukkit.potion.*; import java.util.ArrayList; import java.util.HashMap; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/skills/repair/RepairConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/config/skills/repair/RepairConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java index b7a85d197..42993c1df 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/skills/repair/RepairConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.config.skills.repair; import com.gmail.nossr50.config.ConfigLoader; -import com.gmail.nossr50.datatypes.skills.ItemType; -import com.gmail.nossr50.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.datatypes.skills.ItemType; +import com.gmail.nossr50.core.datatypes.skills.MaterialType; import com.gmail.nossr50.skills.repair.repairables.Repairable; import com.gmail.nossr50.skills.repair.repairables.RepairableFactory; import com.gmail.nossr50.util.ItemUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/skills/repair/RepairConfigManager.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfigManager.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/config/skills/repair/RepairConfigManager.java rename to core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfigManager.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/skills/salvage/SalvageConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/config/skills/salvage/SalvageConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java index b9a137478..e476b6751 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/skills/salvage/SalvageConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.config.skills.salvage; import com.gmail.nossr50.config.ConfigLoader; -import com.gmail.nossr50.datatypes.skills.ItemType; -import com.gmail.nossr50.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.datatypes.skills.ItemType; +import com.gmail.nossr50.core.datatypes.skills.MaterialType; import com.gmail.nossr50.skills.salvage.salvageables.Salvageable; import com.gmail.nossr50.skills.salvage.salvageables.SalvageableFactory; import com.gmail.nossr50.util.ItemUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/skills/salvage/SalvageConfigManager.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfigManager.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/config/skills/salvage/SalvageConfigManager.java rename to core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfigManager.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/config/treasure/TreasureConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java similarity index 99% rename from bukkit/src/main/java/com/gmail/nossr50/config/treasure/TreasureConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java index 075b09d2c..a645ffb50 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/config/treasure/TreasureConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java @@ -1,7 +1,6 @@ -package com.gmail.nossr50.config.treasure; +package com.gmail.nossr50.core.config.treasure; -import com.gmail.nossr50.config.ConfigLoader; -import com.gmail.nossr50.datatypes.treasure.*; +import com.gmail.nossr50.core.config.skills.ConfigLoader; import com.gmail.nossr50.util.EnchantmentUtils; import com.gmail.nossr50.util.StringUtils; import org.bukkit.ChatColor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/player/UserManager.java b/core/src/main/java/com/gmail/nossr50/core/data/UserManager.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/util/player/UserManager.java rename to core/src/main/java/com/gmail/nossr50/core/data/UserManager.java index 3c5411bc9..d49d3d88e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/player/UserManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/UserManager.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.util.player; +package com.gmail.nossr50.core.data; -import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.OfflinePlayer; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkletManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManager.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkletManager.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManager.java index e3e3d0b2e..35deedab1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkletManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.blockmeta; +package com.gmail.nossr50.core.data.blockmeta; import org.bukkit.World; import org.bukkit.block.Block; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkletManagerFactory.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManagerFactory.java similarity index 74% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkletManagerFactory.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManagerFactory.java index 39f8732d3..33367e204 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkletManagerFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManagerFactory.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.util.blockmeta; +package com.gmail.nossr50.core.data.blockmeta; -import com.gmail.nossr50.config.HiddenConfig; +import com.gmail.nossr50.core.config.skills.HiddenConfig; public class ChunkletManagerFactory { public static ChunkletManager getChunkletManager() { diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkletStore.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletStore.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkletStore.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletStore.java index 5514df13c..3b3955028 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkletStore.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletStore.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.blockmeta; +package com.gmail.nossr50.core.data.blockmeta; import java.io.Serializable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkletStoreFactory.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletStoreFactory.java similarity index 82% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkletStoreFactory.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletStoreFactory.java index 1fb4a315a..a4d323530 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkletStoreFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletStoreFactory.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.blockmeta; +package com.gmail.nossr50.core.data.blockmeta; public class ChunkletStoreFactory { protected static ChunkletStore getChunkletStore() { diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/HashChunkletManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/HashChunkletManager.java similarity index 99% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/HashChunkletManager.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/HashChunkletManager.java index f591cdafa..ace73a8a3 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/HashChunkletManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/HashChunkletManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.blockmeta; +package com.gmail.nossr50.core.data.blockmeta; import com.gmail.nossr50.mcMMO; import org.bukkit.World; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/NullChunkletManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/NullChunkletManager.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/NullChunkletManager.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/NullChunkletManager.java index 89bd46967..844dfec6f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/NullChunkletManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/NullChunkletManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.blockmeta; +package com.gmail.nossr50.core.data.blockmeta; import org.bukkit.World; import org.bukkit.block.Block; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/PrimitiveChunkletStore.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveChunkletStore.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/PrimitiveChunkletStore.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveChunkletStore.java index 8dfe3cb8d..7e896b6b0 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/PrimitiveChunkletStore.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveChunkletStore.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.blockmeta; +package com.gmail.nossr50.core.data.blockmeta; public class PrimitiveChunkletStore implements ChunkletStore { private static final long serialVersionUID = -3453078050608607478L; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/PrimitiveExChunkletStore.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveExChunkletStore.java similarity index 99% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/PrimitiveExChunkletStore.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveExChunkletStore.java index 187ad0dff..3cf766574 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/PrimitiveExChunkletStore.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveExChunkletStore.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.blockmeta; +package com.gmail.nossr50.core.data.blockmeta; import java.io.Externalizable; import java.io.IOException; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManager.java similarity index 99% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkManager.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManager.java index 3cf9b1faa..b48b05c68 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.blockmeta.chunkmeta; +package com.gmail.nossr50.core.data.blockmeta.chunkmeta; import org.bukkit.World; import org.bukkit.block.Block; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkManagerFactory.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManagerFactory.java similarity index 71% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkManagerFactory.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManagerFactory.java index 2b4d90349..20c249afd 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkManagerFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManagerFactory.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.util.blockmeta.chunkmeta; +package com.gmail.nossr50.core.data.blockmeta.chunkmeta; -import com.gmail.nossr50.config.HiddenConfig; +import com.gmail.nossr50.core.config.skills.HiddenConfig; public class ChunkManagerFactory { public static ChunkManager getChunkManager() { diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkStore.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkStore.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkStore.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkStore.java index d4f585f9a..d231133c7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkStore.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkStore.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.util.blockmeta.chunkmeta; +package com.gmail.nossr50.core.data.blockmeta.chunkmeta; -import com.gmail.nossr50.util.blockmeta.ChunkletStore; +import com.gmail.nossr50.core.data.blockmeta.ChunkletStore; import java.io.Serializable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkStoreFactory.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkStoreFactory.java similarity index 82% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkStoreFactory.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkStoreFactory.java index 53528ab66..6bbd9c3ed 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkStoreFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkStoreFactory.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.blockmeta.chunkmeta; +package com.gmail.nossr50.core.data.blockmeta.chunkmeta; import org.bukkit.World; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/HashChunkManager.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/HashChunkManager.java index 7667bbabd..3fbd3487e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/HashChunkManager.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.util.blockmeta.chunkmeta; +package com.gmail.nossr50.core.data.blockmeta.chunkmeta; +import com.gmail.nossr50.core.data.blockmeta.blockmeta.conversion.BlockStoreConversionZDirectory; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.blockmeta.conversion.BlockStoreConversionZDirectory; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.BlockState; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/McMMOSimpleChunkBuffer.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/McMMOSimpleChunkBuffer.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/McMMOSimpleChunkBuffer.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/McMMOSimpleChunkBuffer.java index c2f158b95..d9d1781d8 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/McMMOSimpleChunkBuffer.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/McMMOSimpleChunkBuffer.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ -package com.gmail.nossr50.util.blockmeta.chunkmeta; +package com.gmail.nossr50.core.data.blockmeta.chunkmeta; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/McMMOSimpleRegionFile.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/McMMOSimpleRegionFile.java similarity index 99% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/McMMOSimpleRegionFile.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/McMMOSimpleRegionFile.java index 6a506d2ef..96107af81 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/McMMOSimpleRegionFile.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/McMMOSimpleRegionFile.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ -package com.gmail.nossr50.util.blockmeta.chunkmeta; +package com.gmail.nossr50.core.data.blockmeta.chunkmeta; import java.io.*; import java.util.ArrayList; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/NullChunkManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/NullChunkManager.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/NullChunkManager.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/NullChunkManager.java index 3081b0938..a83a98b33 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/NullChunkManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/NullChunkManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.blockmeta.chunkmeta; +package com.gmail.nossr50.core.data.blockmeta.chunkmeta; import org.bukkit.World; import org.bukkit.block.Block; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/PrimitiveChunkStore.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/PrimitiveChunkStore.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java index d1866acab..8af3897f2 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/PrimitiveChunkStore.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.util.blockmeta.chunkmeta; +package com.gmail.nossr50.core.data.blockmeta.chunkmeta; -import com.gmail.nossr50.util.blockmeta.ChunkletStore; +import com.gmail.nossr50.core.data.blockmeta.ChunkletStore; import org.bukkit.Bukkit; import org.bukkit.World; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/conversion/BlockStoreConversionMain.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/conversion/BlockStoreConversionMain.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java index 9558e429e..3d9d1e8f1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/conversion/BlockStoreConversionMain.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.util.blockmeta.conversion; +package com.gmail.nossr50.core.data.blockmeta.conversion; -import com.gmail.nossr50.config.HiddenConfig; +import com.gmail.nossr50.core.config.skills.HiddenConfig; import com.gmail.nossr50.mcMMO; import org.bukkit.scheduler.BukkitScheduler; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/conversion/BlockStoreConversionXDirectory.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionXDirectory.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/conversion/BlockStoreConversionXDirectory.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionXDirectory.java index c05beb8ab..e262acf49 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/conversion/BlockStoreConversionXDirectory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionXDirectory.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.util.blockmeta.conversion; +package com.gmail.nossr50.core.data.blockmeta.conversion; -import com.gmail.nossr50.config.HiddenConfig; +import com.gmail.nossr50.core.config.skills.HiddenConfig; import com.gmail.nossr50.mcMMO; import org.bukkit.scheduler.BukkitScheduler; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/conversion/BlockStoreConversionZDirectory.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionZDirectory.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/conversion/BlockStoreConversionZDirectory.java rename to core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionZDirectory.java index 5c182b55b..029f33430 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/blockmeta/conversion/BlockStoreConversionZDirectory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionZDirectory.java @@ -1,12 +1,12 @@ -package com.gmail.nossr50.util.blockmeta.conversion; +package com.gmail.nossr50.core.data.blockmeta.conversion; +import com.gmail.nossr50.core.data.blockmeta.ChunkletStore; +import com.gmail.nossr50.core.data.blockmeta.HashChunkletManager; +import com.gmail.nossr50.core.data.blockmeta.PrimitiveChunkletStore; +import com.gmail.nossr50.core.data.blockmeta.PrimitiveExChunkletStore; +import com.gmail.nossr50.core.data.blockmeta.chunkmeta.HashChunkManager; +import com.gmail.nossr50.core.data.blockmeta.chunkmeta.PrimitiveChunkStore; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.blockmeta.ChunkletStore; -import com.gmail.nossr50.util.blockmeta.HashChunkletManager; -import com.gmail.nossr50.util.blockmeta.PrimitiveChunkletStore; -import com.gmail.nossr50.util.blockmeta.PrimitiveExChunkletStore; -import com.gmail.nossr50.util.blockmeta.chunkmeta.HashChunkManager; -import com.gmail.nossr50.util.blockmeta.chunkmeta.PrimitiveChunkStore; import org.bukkit.scheduler.BukkitScheduler; import java.io.File; diff --git a/bukkit/src/main/java/com/gmail/nossr50/database/DatabaseManager.java b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java similarity index 93% rename from bukkit/src/main/java/com/gmail/nossr50/database/DatabaseManager.java rename to core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java index 47be98437..bdd928b7f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/database/DatabaseManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java @@ -1,10 +1,10 @@ -package com.gmail.nossr50.database; +package com.gmail.nossr50.core.data.database; import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.database.DatabaseType; -import com.gmail.nossr50.datatypes.database.PlayerStat; -import com.gmail.nossr50.datatypes.player.PlayerProfile; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.database.DatabaseType; +import com.gmail.nossr50.core.datatypes.database.PlayerStat; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import java.util.List; import java.util.Map; diff --git a/bukkit/src/main/java/com/gmail/nossr50/database/DatabaseManagerFactory.java b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManagerFactory.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/database/DatabaseManagerFactory.java rename to core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManagerFactory.java index 1fb6555dc..d999a11bd 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/database/DatabaseManagerFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManagerFactory.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.database; +package com.gmail.nossr50.core.data.database; import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.database.DatabaseType; +import com.gmail.nossr50.core.datatypes.database.DatabaseType; import com.gmail.nossr50.mcMMO; public class DatabaseManagerFactory { @@ -58,13 +58,13 @@ public class DatabaseManagerFactory { public static DatabaseManager createDatabaseManager(DatabaseType type) { switch (type) { - case FLATFILE: + case DatabaseType.FLATFILE: return new FlatfileDatabaseManager(); - case SQL: + case DatabaseType.SQL: return new SQLDatabaseManager(); - case CUSTOM: + case DatabaseType.CUSTOM: try { return createDefaultCustomDatabaseManager(); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java b/core/src/main/java/com/gmail/nossr50/core/data/database/FlatfileDatabaseManager.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java rename to core/src/main/java/com/gmail/nossr50/core/data/database/FlatfileDatabaseManager.java index 907638b54..0c33fcad0 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/FlatfileDatabaseManager.java @@ -1,15 +1,15 @@ -package com.gmail.nossr50.database; +package com.gmail.nossr50.core.data.database; import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.MobHealthbarType; -import com.gmail.nossr50.datatypes.database.DatabaseType; -import com.gmail.nossr50.datatypes.database.PlayerStat; -import com.gmail.nossr50.datatypes.database.UpgradeType; -import com.gmail.nossr50.datatypes.player.PlayerProfile; -import com.gmail.nossr50.datatypes.player.UniqueDataType; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.datatypes.MobHealthbarType; +import com.gmail.nossr50.core.datatypes.database.DatabaseType; +import com.gmail.nossr50.core.datatypes.database.PlayerStat; +import com.gmail.nossr50.core.datatypes.database.UpgradeType; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.player.UniqueDataType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.database.UUIDUpdateAsyncTask; import com.gmail.nossr50.util.Misc; @@ -1229,31 +1229,31 @@ public final class FlatfileDatabaseManager implements DatabaseManager { private int getSkillIndex(PrimarySkillType skill) { switch (skill) { - case ACROBATICS: + case PrimarySkillType.ACROBATICS: return SKILLS_ACROBATICS; - case ALCHEMY: + case PrimarySkillType.ALCHEMY: return SKILLS_ALCHEMY; - case ARCHERY: + case PrimarySkillType.ARCHERY: return SKILLS_ARCHERY; - case AXES: + case PrimarySkillType.AXES: return SKILLS_AXES; - case EXCAVATION: + case PrimarySkillType.EXCAVATION: return SKILLS_EXCAVATION; - case FISHING: + case PrimarySkillType.FISHING: return SKILLS_FISHING; - case HERBALISM: + case PrimarySkillType.HERBALISM: return SKILLS_HERBALISM; - case MINING: + case PrimarySkillType.MINING: return SKILLS_MINING; - case REPAIR: + case PrimarySkillType.REPAIR: return SKILLS_REPAIR; - case SWORDS: + case PrimarySkillType.SWORDS: return SKILLS_SWORDS; - case TAMING: + case PrimarySkillType.TAMING: return SKILLS_TAMING; - case UNARMED: + case PrimarySkillType.UNARMED: return SKILLS_UNARMED; - case WOODCUTTING: + case PrimarySkillType.WOODCUTTING: return SKILLS_WOODCUTTING; default: throw new RuntimeException("Primary Skills only"); diff --git a/bukkit/src/main/java/com/gmail/nossr50/database/SQLDatabaseManager.java b/core/src/main/java/com/gmail/nossr50/core/data/database/SQLDatabaseManager.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/database/SQLDatabaseManager.java rename to core/src/main/java/com/gmail/nossr50/core/data/database/SQLDatabaseManager.java index 04c8d533b..cf668ba01 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/database/SQLDatabaseManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/SQLDatabaseManager.java @@ -1,15 +1,15 @@ -package com.gmail.nossr50.database; +package com.gmail.nossr50.core.data.database; import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.MobHealthbarType; -import com.gmail.nossr50.datatypes.database.DatabaseType; -import com.gmail.nossr50.datatypes.database.PlayerStat; -import com.gmail.nossr50.datatypes.database.UpgradeType; -import com.gmail.nossr50.datatypes.player.PlayerProfile; -import com.gmail.nossr50.datatypes.player.UniqueDataType; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.datatypes.MobHealthbarType; +import com.gmail.nossr50.core.datatypes.database.DatabaseType; +import com.gmail.nossr50.core.datatypes.database.PlayerStat; +import com.gmail.nossr50.core.datatypes.database.UpgradeType; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.player.UniqueDataType; +import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.database.UUIDUpdateAsyncTask; import com.gmail.nossr50.util.Misc; @@ -961,50 +961,50 @@ public final class SQLDatabaseManager implements DatabaseManager { statement = connection.createStatement(); switch (upgrade) { - case ADD_FISHING: + case UpgradeType.ADD_FISHING: checkUpgradeAddFishing(statement); break; - case ADD_BLAST_MINING_COOLDOWN: + case UpgradeType.ADD_BLAST_MINING_COOLDOWN: checkUpgradeAddBlastMiningCooldown(statement); break; - case ADD_SQL_INDEXES: + case UpgradeType.ADD_SQL_INDEXES: checkUpgradeAddSQLIndexes(statement); break; - case ADD_MOB_HEALTHBARS: + case UpgradeType.ADD_MOB_HEALTHBARS: checkUpgradeAddMobHealthbars(statement); break; - case DROP_SQL_PARTY_NAMES: + case UpgradeType.DROP_SQL_PARTY_NAMES: checkUpgradeDropPartyNames(statement); break; - case DROP_SPOUT: + case UpgradeType.DROP_SPOUT: checkUpgradeDropSpout(statement); break; - case ADD_ALCHEMY: + case UpgradeType.ADD_ALCHEMY: checkUpgradeAddAlchemy(statement); break; - case ADD_UUIDS: + case UpgradeType.ADD_UUIDS: checkUpgradeAddUUIDs(statement); return; - case ADD_SCOREBOARD_TIPS: + case UpgradeType.ADD_SCOREBOARD_TIPS: checkUpgradeAddScoreboardTips(statement); return; - case DROP_NAME_UNIQUENESS: + case UpgradeType.DROP_NAME_UNIQUENESS: checkNameUniqueness(statement); return; - case ADD_SKILL_TOTAL: + case UpgradeType.ADD_SKILL_TOTAL: checkUpgradeSkillTotal(connection); break; - case ADD_UNIQUE_PLAYER_DATA: + case UpgradeType.ADD_UNIQUE_PLAYER_DATA: checkUpgradeAddUniqueChimaeraWing(statement); break; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/AbstractWorld.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/AbstractWorld.java new file mode 100644 index 000000000..17fee1929 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/AbstractWorld.java @@ -0,0 +1,49 @@ +package com.gmail.nossr50.core.datatypes; + +import java.util.Objects; + +/** + * A World in MC + * Stuff mcMMO does not require will not be in this class + */ +public abstract class AbstractWorld implements World { + + private final String worldName; + + public AbstractWorld(String worldName) + { + this.worldName = worldName; + } + + /** + * Gets the name of this World + * + * @return the name of this world + */ + @Override + public String getName() { + return worldName; + } + + /** + * Compares this object to another to see if they are equal + * @param o the other object + * @return true if they are equal + */ + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof AbstractWorld)) return false; + AbstractWorld that = (AbstractWorld) o; + return worldName.equals(that.worldName); + } + + /** + * The hash code for the object, used for comparisons + * @return hash code for this object + */ + @Override + public int hashCode() { + return Objects.hash(worldName); + } +} diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/Location.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/Location.java similarity index 93% rename from core/src/main/java/com/gmail/nossr50/datatypes/Location.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/Location.java index 39e361d2e..041f07c9a 100644 --- a/core/src/main/java/com/gmail/nossr50/datatypes/Location.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/Location.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.datatypes; +package com.gmail.nossr50.core.datatypes; /** * This class represents a Location in MC diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/Nameable.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/Nameable.java new file mode 100644 index 000000000..fe61ef493 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/Nameable.java @@ -0,0 +1,15 @@ +package com.gmail.nossr50.core.datatypes; + +public interface Nameable extends Named { + /** + * Change the name for this entity + * @param newName the new name of this entity + */ + void setName(String newName); + + /** + * Returns the original name for this entity before any renaming + * @return the original name of this entity + */ + String getOriginalName(); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/Named.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/Named.java new file mode 100644 index 000000000..2eb1dcd8d --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/Named.java @@ -0,0 +1,13 @@ +package com.gmail.nossr50.core.datatypes; + +/** + * A lot of Objects in MC have names + * This is what this class is for + */ +public interface Named { + /** + * Returns the name of this entity + * @return this entity + */ + String getName(); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/Property.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/Property.java new file mode 100644 index 000000000..1cfa6fe6d --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/Property.java @@ -0,0 +1,37 @@ +package com.gmail.nossr50.core.datatypes; + +import java.util.Collection; + +/** + * Properties are Comparable key value pairs for a blocks state + * In MC this exists in three forms, Integer, Booleans, and Enums + * + * This class partially mirrors MC Internals + * + */ +public interface Property> { + /** + * The name of the Property + * @return name of this property + */ + String getName(); + + /** + * A collection of allowed values for this property + * @return the allowed values for this property + */ + Collection getAllowedValues(); + + /** + * The class of the value for this particular property + * @return the value's class + */ + Class getValueClass(); + + /** + * The name for a specific value + * @param value the value to match + * @return the name of this value + */ + String getName(T value); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/World.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/World.java new file mode 100644 index 000000000..9554279aa --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/World.java @@ -0,0 +1,9 @@ +package com.gmail.nossr50.core.datatypes; + +public interface World { + /** + * Gets the name of this World + * @return the name of this world + */ + String getName(); +} diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/block/Block.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/block/Block.java similarity index 88% rename from core/src/main/java/com/gmail/nossr50/datatypes/block/Block.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/block/Block.java index 95a738ad9..b542d47a0 100644 --- a/core/src/main/java/com/gmail/nossr50/datatypes/block/Block.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/block/Block.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.datatypes.block; +package com.gmail.nossr50.core.datatypes.block; -import com.gmail.nossr50.datatypes.Property; +import com.gmail.nossr50.core.datatypes.Property; /** * Represents a container of properties and values for a Block diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/block/BlockState.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/block/BlockState.java similarity index 93% rename from core/src/main/java/com/gmail/nossr50/datatypes/block/BlockState.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/block/BlockState.java index ee4df050a..5e67265aa 100644 --- a/core/src/main/java/com/gmail/nossr50/datatypes/block/BlockState.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/block/BlockState.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.datatypes.block; +package com.gmail.nossr50.core.datatypes.block; -import com.gmail.nossr50.datatypes.Property; +import com.gmail.nossr50.core.datatypes.Property; import com.google.common.collect.ImmutableMap; import java.util.Collection; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Entity.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Entity.java new file mode 100644 index 000000000..92975d92e --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Entity.java @@ -0,0 +1,24 @@ +package com.gmail.nossr50.core.datatypes.entity; + +import com.gmail.nossr50.core.datatypes.Location; +import com.gmail.nossr50.core.datatypes.Named; + +import java.util.UUID; + +/** + * Entities can be a lot of things in MC + * Entities can be monsters, animals, players, etc... + */ +public interface Entity extends Location, Named { + /** + * The UUID for this entity + * @return this entity's UUID + */ + UUID getUUID(); + + /** + * The Location for this entity + * @return this entity's location + */ + Location getLocation(); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Living.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Living.java new file mode 100644 index 000000000..1ad54b282 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Living.java @@ -0,0 +1,33 @@ +package com.gmail.nossr50.core.datatypes.entity; + +/** + * Living means you can die, you have health, and you can be damaged + */ +public interface Living { + /** + * Whether or not this entity is still alive + * @return true if the entity is alive + */ + Boolean isAlive(); + + /** + * Change the health of an entity + * @param newHealth the new health value for the entity + */ + void setHealth(int newHealth); + + /** + * Damage an entity + * This damage will be reduced by any defensive modifiers such as armor + * @param damage the damage to deal to this entity + */ + void damage(int damage); + + /** + * Damage an entity and attribute it to a source + * This damage will be reduced by any defensive modifiers such as armor + * @param source the source responsible for the damage + * @param damage the damage to deal to this entity + */ + void damage(Entity source, int damage); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Player.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Player.java new file mode 100644 index 000000000..730e6566a --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Player.java @@ -0,0 +1,21 @@ +package com.gmail.nossr50.core.datatypes.entity; + +import com.gmail.nossr50.core.datatypes.Nameable; + +/** + * Players + */ +public interface Player extends Living, Nameable { + + /** + * Players are not always online + * @return true if the player is online + */ + Boolean isOnline(); + + /** + * Gets the McMMOPlayer for this Player + * @return the associated McMMOPlayer, can be null + */ + McMMOPlayer getMcMMOPlayer(); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/event/Cancellable.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/event/Cancellable.java new file mode 100644 index 000000000..4ba1938d3 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/event/Cancellable.java @@ -0,0 +1,19 @@ +package com.gmail.nossr50.core.datatypes.event; + +/** + * This class handles cancellations for an event + */ +public interface Cancellable { + + /** + * Whether or not the event is cancelled + * @return true if cancelled + */ + Boolean isCancelled(); + + /** + * Sets an events cancellation to b + * @param b + */ + void setCancelled(boolean b); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/event/Event.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/event/Event.java new file mode 100644 index 000000000..40df44a2e --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/event/Event.java @@ -0,0 +1,8 @@ +package com.gmail.nossr50.core.datatypes.event; + +/** + * Represents an event for a given API + */ +public interface Event { + +} diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/event/EventType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/event/EventType.java new file mode 100644 index 000000000..5cc5716cb --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/event/EventType.java @@ -0,0 +1,13 @@ +package com.gmail.nossr50.core.datatypes.event; + +/** + * Different platforms have different event systems + * These ENUMs will be the magic number for what kind of event we are targeting + */ +public enum EventType { + //TODO: These are being based on the bukkit events mcMMO has used, the values will most likely change + EVENT_BLOCK_PISTON_EXTEND, + EVENT_BLOCK_PISTON_RETRACT, + //Currently not sure I need this class, so I'll refrain from adding more events atm... + +} diff --git a/core/src/main/java/com/gmail/nossr50/platform/AbstractPlatform.java b/core/src/main/java/com/gmail/nossr50/core/platform/AbstractPlatform.java similarity index 75% rename from core/src/main/java/com/gmail/nossr50/platform/AbstractPlatform.java rename to core/src/main/java/com/gmail/nossr50/core/platform/AbstractPlatform.java index 85c2616aa..f5c3042c0 100644 --- a/core/src/main/java/com/gmail/nossr50/platform/AbstractPlatform.java +++ b/core/src/main/java/com/gmail/nossr50/core/platform/AbstractPlatform.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.platform; +package com.gmail.nossr50.core.platform; /** * This is the implementation of the Platform Interface diff --git a/core/src/main/java/com/gmail/nossr50/platform/Platform.java b/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java similarity index 78% rename from core/src/main/java/com/gmail/nossr50/platform/Platform.java rename to core/src/main/java/com/gmail/nossr50/core/platform/Platform.java index 7c953f889..3822fc6e0 100644 --- a/core/src/main/java/com/gmail/nossr50/platform/Platform.java +++ b/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.platform; +package com.gmail.nossr50.core.platform; /** * Represents the current API Platform @@ -30,4 +30,9 @@ public interface Platform { */ Boolean isPlatformLoaded(); + /** + * Gets the PlatformSoftwareType for this platform + * @return this PlatformSoftwareType + */ + PlatformSoftwareType getPlatformSoftwareType(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/platform/PlatformSoftwareType.java b/core/src/main/java/com/gmail/nossr50/core/platform/PlatformSoftwareType.java new file mode 100644 index 000000000..69a927033 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/platform/PlatformSoftwareType.java @@ -0,0 +1,10 @@ +package com.gmail.nossr50.core.platform; + +/** + * ENUMs representing the software the platform belongs to + */ +public enum PlatformSoftwareType { + NMS, + BUKKIT, + SPONGE +} diff --git a/core/src/main/java/com/gmail/nossr50/platform/TargetMinecraftVersion.java b/core/src/main/java/com/gmail/nossr50/core/platform/TargetMinecraftVersion.java similarity index 88% rename from core/src/main/java/com/gmail/nossr50/platform/TargetMinecraftVersion.java rename to core/src/main/java/com/gmail/nossr50/core/platform/TargetMinecraftVersion.java index 84148259b..0452128dd 100644 --- a/core/src/main/java/com/gmail/nossr50/platform/TargetMinecraftVersion.java +++ b/core/src/main/java/com/gmail/nossr50/core/platform/TargetMinecraftVersion.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.platform; +package com.gmail.nossr50.core.platform; /** * Constants for targeted versions of MC diff --git a/core/src/main/java/com/gmail/nossr50/core/platform/drivers/PlatformDriver.java b/core/src/main/java/com/gmail/nossr50/core/platform/drivers/PlatformDriver.java new file mode 100644 index 000000000..571b097d3 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/platform/drivers/PlatformDriver.java @@ -0,0 +1,20 @@ +package com.gmail.nossr50.core.platform.drivers; + +import com.gmail.nossr50.core.platform.Platform; + +/** + * Platform Drivers will handled translating our abstraction into instructions for various APIs + */ +public interface PlatformDriver { + /** + * Return the platform for this Driver + * @return this platform + */ + Platform getPlatform(); + + /** + * Gets the target MC Version for this driver + * @return the target MC Version for this driver + */ + String getTargetMinecraftVersion(); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/platform/drivers/PlatformEventDriver.java b/core/src/main/java/com/gmail/nossr50/core/platform/drivers/PlatformEventDriver.java new file mode 100644 index 000000000..186134435 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/platform/drivers/PlatformEventDriver.java @@ -0,0 +1,8 @@ +package com.gmail.nossr50.core.platform.drivers; + +/** + * This driver handles instructions for events for a platform + */ +public interface PlatformEventDriver extends PlatformDriver { + +} diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/Property.java b/core/src/main/java/com/gmail/nossr50/datatypes/Property.java deleted file mode 100644 index 778c1f04f..000000000 --- a/core/src/main/java/com/gmail/nossr50/datatypes/Property.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.gmail.nossr50.datatypes; - -/** - * Properties are Comparable key value pairs for a blocks state - * In MC this exists in three forms, Integer, Booleans, and Enums - */ -public interface Property> { - -} diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/World.java b/core/src/main/java/com/gmail/nossr50/datatypes/World.java deleted file mode 100644 index 42b01e6a1..000000000 --- a/core/src/main/java/com/gmail/nossr50/datatypes/World.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.gmail.nossr50.datatypes; - -public interface World { - -} diff --git a/core/src/main/java/com/gmail/nossr50/platform/PlatformSoftwareType.java b/core/src/main/java/com/gmail/nossr50/platform/PlatformSoftwareType.java deleted file mode 100644 index 15c19c069..000000000 --- a/core/src/main/java/com/gmail/nossr50/platform/PlatformSoftwareType.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.gmail.nossr50.platform; - -/** - * Constants representing the software the platform belongs to - */ -public enum PlatformSoftwareType { - NMS, - BUKKIT, - SPONGE -} From 4d4dad0ccbd95d4688f02c53d92e8889c3086356 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 9 Feb 2019 21:14:45 -0800 Subject: [PATCH 04/28] Moving stuff around, what a mess this is going to be. --- .../core/config/experience/ExperienceConfig.java | 8 ++++---- .../core/config/mods/CustomArmorConfig.java | 4 ++-- .../core/config/mods/CustomBlockConfig.java | 2 +- .../core/config/mods/CustomEntityConfig.java | 2 +- .../core/config/mods/CustomToolConfig.java | 6 +++--- .../core/config/skills/AdvancedConfig.java | 6 +++--- .../gmail/nossr50/core/config/skills/Config.java | 8 ++++---- .../core/config/skills/CoreSkillsConfig.java | 4 ++-- .../nossr50/core/config/skills/RankConfig.java | 4 ++-- .../core/config/skills/alchemy/PotionConfig.java | 2 +- .../core/config/skills/repair/RepairConfig.java | 4 ++-- .../config/skills/salvage/SalvageConfig.java | 4 ++-- .../com/gmail/nossr50/core/data/UserManager.java | 2 +- .../blockmeta/chunkmeta/PrimitiveChunkStore.java | 3 +-- .../core/data/database/DatabaseManager.java | 8 ++++---- .../data/database/DatabaseManagerFactory.java | 2 +- .../data/database/FlatfileDatabaseManager.java | 16 ++++++++-------- .../core/data/database/SQLDatabaseManager.java | 16 ++++++++-------- .../nossr50/core/datatypes/LimitedSizeList.java | 3 +-- .../nossr50/core/datatypes/MobHealthbarType.java | 0 .../nossr50/core/datatypes/chat/ChatMode.java | 0 .../core/datatypes/database/DatabaseType.java | 0 .../core/datatypes/database/PlayerStat.java | 0 .../core/datatypes/database/UpgradeType.java | 0 .../core/datatypes/experience/FormulaType.java | 0 .../core/datatypes/experience/SkillXpGain.java | 0 .../core/datatypes/experience/XPGainReason.java | 0 .../core/datatypes/experience/XPGainSource.java | 0 .../datatypes/interactions/NotificationType.java | 0 .../core/datatypes/json/CustomBaseComponent.java | 0 .../nossr50/core/datatypes/json/McMMOUrl.java | 0 .../core/datatypes/json/McMMOWebLinks.java | 0 .../nossr50/core/datatypes/meta/OldName.java | 0 .../nossr50/core/datatypes/mods/CustomBlock.java | 0 .../core/datatypes/mods/CustomEntity.java | 0 .../nossr50/core/datatypes/mods/CustomTool.java | 0 .../core/datatypes/party/ItemShareType.java | 0 .../nossr50/core/datatypes/party/Party.java | 0 .../core/datatypes/party/PartyFeature.java | 0 .../core/datatypes/party/PartyLeader.java | 0 .../datatypes/party/PartyTeleportRecord.java | 0 .../nossr50/core/datatypes/party/ShareMode.java | 0 .../core/datatypes/player/McMMOPlayer.java | 6 +++--- .../core/datatypes/player/PlayerProfile.java | 2 +- .../core/datatypes/player/UniqueDataType.java | 0 .../nossr50/core/datatypes/skills/ItemType.java | 0 .../core/datatypes/skills/MaterialType.java | 0 .../core/datatypes/skills/ModConfigType.java | 0 .../core/datatypes/skills/PrimarySkillType.java | 0 .../core/datatypes/skills/SubSkillFlags.java | 0 .../core/datatypes/skills/SubSkillType.java | 0 .../core/datatypes/skills/SuperAbilityType.java | 0 .../nossr50/core/datatypes/skills/ToolType.java | 0 .../datatypes/skills/alchemy/AlchemyPotion.java | 0 .../datatypes/skills/alchemy/PotionStage.java | 0 .../datatypes/skills/interfaces/ChildSkill.java | 0 .../datatypes/skills/interfaces/CoreSkill.java | 0 .../datatypes/skills/interfaces/Localized.java | 0 .../core/datatypes/skills/interfaces/Skill.java | 0 .../datatypes/skills/interfaces/Toolable.java | 0 .../skills/progression/Progression.java | 0 .../skills/subskills/AbstractSubSkill.java | 2 +- .../subskills/acrobatics/AcrobaticsSubSkill.java | 0 .../skills/subskills/acrobatics/Roll.java | 2 +- .../subskills/interfaces/InteractType.java | 0 .../skills/subskills/interfaces/Interaction.java | 0 .../skills/subskills/interfaces/Rank.java | 0 .../skills/subskills/interfaces/SubSkill.java | 0 .../subskills/interfaces/SubSkillProperties.java | 0 .../datatypes/treasure/EnchantmentTreasure.java | 0 .../datatypes/treasure/ExcavationTreasure.java | 0 .../core/datatypes/treasure/FishingTreasure.java | 0 .../core/datatypes/treasure/HylianTreasure.java | 0 .../nossr50/core/datatypes/treasure/Rarity.java | 0 .../core/datatypes/treasure/ShakeTreasure.java | 0 .../core/datatypes/treasure/Treasure.java | 0 .../core/{datatypes => mcmmo}/AbstractWorld.java | 2 +- .../core/{datatypes => mcmmo}/Location.java | 2 +- .../core/{datatypes => mcmmo}/Nameable.java | 2 +- .../nossr50/core/{datatypes => mcmmo}/Named.java | 2 +- .../core/{datatypes => mcmmo}/Property.java | 2 +- .../nossr50/core/{datatypes => mcmmo}/World.java | 2 +- .../core/{datatypes => mcmmo}/block/Block.java | 4 ++-- .../{datatypes => mcmmo}/block/BlockState.java | 4 ++-- .../core/{datatypes => mcmmo}/entity/Entity.java | 6 +++--- .../core/{datatypes => mcmmo}/entity/Living.java | 2 +- .../core/{datatypes => mcmmo}/entity/Player.java | 5 +++-- .../{datatypes => mcmmo}/event/Cancellable.java | 2 +- .../core/{datatypes => mcmmo}/event/Event.java | 2 +- .../{datatypes => mcmmo}/event/EventType.java | 2 +- 90 files changed, 77 insertions(+), 78 deletions(-) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java (96%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/MobHealthbarType.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/database/DatabaseType.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/database/PlayerStat.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/database/UpgradeType.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/experience/FormulaType.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/experience/XPGainReason.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/experience/XPGainSource.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/interactions/NotificationType.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/json/CustomBaseComponent.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOUrl.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomBlock.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomEntity.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomTool.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyLeader.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/player/UniqueDataType.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/ItemType.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/MaterialType.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/ModConfigType.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/PrimarySkillType.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillFlags.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillType.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/SuperAbilityType.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/ToolType.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/AlchemyPotion.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/PotionStage.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/ChildSkill.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/CoreSkill.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Localized.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Skill.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Toolable.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/progression/Progression.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/AbstractSubSkill.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/AcrobaticsSubSkill.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/Roll.java (99%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/InteractType.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Interaction.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Rank.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkill.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkillProperties.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/treasure/EnchantmentTreasure.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ExcavationTreasure.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/treasure/FishingTreasure.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/treasure/HylianTreasure.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Rarity.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ShakeTreasure.java (100%) rename {bukkit => core}/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Treasure.java (100%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => mcmmo}/AbstractWorld.java (96%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => mcmmo}/Location.java (93%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => mcmmo}/Nameable.java (89%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => mcmmo}/Named.java (83%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => mcmmo}/Property.java (95%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => mcmmo}/World.java (76%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => mcmmo}/block/Block.java (88%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => mcmmo}/block/BlockState.java (93%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => mcmmo}/entity/Entity.java (73%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => mcmmo}/entity/Living.java (94%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => mcmmo}/entity/Player.java (69%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => mcmmo}/event/Cancellable.java (86%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => mcmmo}/event/Event.java (61%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => mcmmo}/event/EventType.java (89%) diff --git a/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java index c7890622f..7c27e25f1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.core.config.experience; import com.gmail.nossr50.core.config.skills.AutoUpdateConfigLoader; -import com.gmail.nossr50.core.datatypes.experience.FormulaType; -import com.gmail.nossr50.core.datatypes.skills.MaterialType; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.alchemy.PotionStage; +import com.gmail.nossr50.core.mcmmo.experience.FormulaType; +import com.gmail.nossr50.core.mcmmo.skills.MaterialType; +import com.gmail.nossr50.core.mcmmo.skills.PrimarySkillType; +import com.gmail.nossr50.core.mcmmo.skills.alchemy.PotionStage; import com.gmail.nossr50.util.StringUtils; import org.bukkit.Material; import org.bukkit.block.data.BlockData; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java index 1ebaacaf2..915fd6cfa 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.core.config.mods; import com.gmail.nossr50.core.config.skills.ConfigLoader; -import com.gmail.nossr50.core.datatypes.skills.ItemType; -import com.gmail.nossr50.core.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.mcmmo.skills.ItemType; +import com.gmail.nossr50.core.mcmmo.skills.MaterialType; import com.gmail.nossr50.skills.repair.repairables.Repairable; import com.gmail.nossr50.skills.repair.repairables.RepairableFactory; import com.gmail.nossr50.util.skills.SkillUtils; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java index 58a836471..2c2afadc1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.config.mods; import com.gmail.nossr50.core.config.skills.ConfigLoader; -import com.gmail.nossr50.core.datatypes.mods.CustomBlock; +import com.gmail.nossr50.core.mcmmo.mods.CustomBlock; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java index ed3263ca4..e0ebd99de 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.config.mods; import com.gmail.nossr50.core.config.skills.ConfigLoader; -import com.gmail.nossr50.core.datatypes.mods.CustomEntity; +import com.gmail.nossr50.core.mcmmo.mods.CustomEntity; import org.apache.commons.lang.ClassUtils; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java index e0e7249a5..1f3a429b0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.core.config.mods; import com.gmail.nossr50.core.config.skills.ConfigLoader; -import com.gmail.nossr50.core.datatypes.mods.CustomTool; -import com.gmail.nossr50.core.datatypes.skills.ItemType; -import com.gmail.nossr50.core.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.mcmmo.mods.CustomTool; +import com.gmail.nossr50.core.mcmmo.skills.ItemType; +import com.gmail.nossr50.core.mcmmo.skills.MaterialType; import com.gmail.nossr50.skills.repair.repairables.Repairable; import com.gmail.nossr50.skills.repair.repairables.RepairableFactory; import com.gmail.nossr50.util.skills.SkillUtils; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/AdvancedConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/AdvancedConfig.java index 72fe7bc85..13dc1a48e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/AdvancedConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/AdvancedConfig.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.core.config.skills; -import com.gmail.nossr50.core.datatypes.interactions.NotificationType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.mcmmo.interactions.NotificationType; +import com.gmail.nossr50.core.mcmmo.skills.SubSkillType; +import com.gmail.nossr50.core.mcmmo.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.mcMMO; import net.md_5.bungee.api.ChatColor; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/Config.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/Config.java index 7145c6216..6fea3abc7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/Config.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/Config.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.core.config.skills; import com.gmail.nossr50.core.data.database.SQLDatabaseManager; -import com.gmail.nossr50.core.datatypes.MobHealthbarType; -import com.gmail.nossr50.core.datatypes.party.PartyFeature; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.mcmmo.MobHealthbarType; +import com.gmail.nossr50.core.mcmmo.party.PartyFeature; +import com.gmail.nossr50.core.mcmmo.skills.PrimarySkillType; +import com.gmail.nossr50.core.mcmmo.skills.SuperAbilityType; import com.gmail.nossr50.util.StringUtils; import org.bukkit.Material; import org.bukkit.block.data.BlockData; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/CoreSkillsConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/CoreSkillsConfig.java index f08b41db7..4f7fcb753 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/CoreSkillsConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/CoreSkillsConfig.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.config.skills; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.mcmmo.skills.PrimarySkillType; +import com.gmail.nossr50.core.mcmmo.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.util.StringUtils; public class CoreSkillsConfig extends AutoUpdateConfigLoader { diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/RankConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/RankConfig.java index 651c67bce..0f169b27d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/RankConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/RankConfig.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.config.skills; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.mcmmo.skills.SubSkillType; +import com.gmail.nossr50.core.mcmmo.skills.subskills.AbstractSubSkill; import java.util.ArrayList; import java.util.List; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java index 0b38de157..1bdf70c9c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.config.skills.alchemy; import com.gmail.nossr50.config.ConfigLoader; -import com.gmail.nossr50.core.datatypes.skills.alchemy.AlchemyPotion; +import com.gmail.nossr50.core.mcmmo.skills.alchemy.AlchemyPotion; import com.gmail.nossr50.mcMMO; import org.bukkit.ChatColor; import org.bukkit.Color; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java index 42993c1df..b676c0ad3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.config.skills.repair; import com.gmail.nossr50.config.ConfigLoader; -import com.gmail.nossr50.core.datatypes.skills.ItemType; -import com.gmail.nossr50.core.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.mcmmo.skills.ItemType; +import com.gmail.nossr50.core.mcmmo.skills.MaterialType; import com.gmail.nossr50.skills.repair.repairables.Repairable; import com.gmail.nossr50.skills.repair.repairables.RepairableFactory; import com.gmail.nossr50.util.ItemUtils; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java index e476b6751..76c540838 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.config.skills.salvage; import com.gmail.nossr50.config.ConfigLoader; -import com.gmail.nossr50.core.datatypes.skills.ItemType; -import com.gmail.nossr50.core.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.mcmmo.skills.ItemType; +import com.gmail.nossr50.core.mcmmo.skills.MaterialType; import com.gmail.nossr50.skills.salvage.salvageables.Salvageable; import com.gmail.nossr50.skills.salvage.salvageables.SalvageableFactory; import com.gmail.nossr50.util.ItemUtils; diff --git a/core/src/main/java/com/gmail/nossr50/core/data/UserManager.java b/core/src/main/java/com/gmail/nossr50/core/data/UserManager.java index d49d3d88e..0768f4829 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/UserManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/UserManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.data; -import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.mcmmo.player.McMMOPlayer; import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.OfflinePlayer; diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java index 8af3897f2..58388c6bf 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java @@ -1,8 +1,7 @@ package com.gmail.nossr50.core.data.blockmeta.chunkmeta; import com.gmail.nossr50.core.data.blockmeta.ChunkletStore; -import org.bukkit.Bukkit; -import org.bukkit.World; +import com.gmail.nossr50.core.mcmmo.World; import java.io.IOException; import java.io.ObjectInputStream; diff --git a/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java index bdd928b7f..d8ccae273 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.core.data.database; import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.core.datatypes.database.DatabaseType; -import com.gmail.nossr50.core.datatypes.database.PlayerStat; -import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.mcmmo.database.DatabaseType; +import com.gmail.nossr50.core.mcmmo.database.PlayerStat; +import com.gmail.nossr50.core.mcmmo.player.PlayerProfile; +import com.gmail.nossr50.core.mcmmo.skills.PrimarySkillType; import java.util.List; import java.util.Map; diff --git a/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManagerFactory.java b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManagerFactory.java index d999a11bd..d1e4bc497 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManagerFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManagerFactory.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.data.database; import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.core.datatypes.database.DatabaseType; +import com.gmail.nossr50.core.mcmmo.database.DatabaseType; import com.gmail.nossr50.mcMMO; public class DatabaseManagerFactory { diff --git a/core/src/main/java/com/gmail/nossr50/core/data/database/FlatfileDatabaseManager.java b/core/src/main/java/com/gmail/nossr50/core/data/database/FlatfileDatabaseManager.java index 0c33fcad0..0fa7ad213 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/database/FlatfileDatabaseManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/FlatfileDatabaseManager.java @@ -2,14 +2,14 @@ package com.gmail.nossr50.core.data.database; import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.core.datatypes.MobHealthbarType; -import com.gmail.nossr50.core.datatypes.database.DatabaseType; -import com.gmail.nossr50.core.datatypes.database.PlayerStat; -import com.gmail.nossr50.core.datatypes.database.UpgradeType; -import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.datatypes.player.UniqueDataType; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.mcmmo.MobHealthbarType; +import com.gmail.nossr50.core.mcmmo.database.DatabaseType; +import com.gmail.nossr50.core.mcmmo.database.PlayerStat; +import com.gmail.nossr50.core.mcmmo.database.UpgradeType; +import com.gmail.nossr50.core.mcmmo.player.PlayerProfile; +import com.gmail.nossr50.core.mcmmo.player.UniqueDataType; +import com.gmail.nossr50.core.mcmmo.skills.PrimarySkillType; +import com.gmail.nossr50.core.mcmmo.skills.SuperAbilityType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.database.UUIDUpdateAsyncTask; import com.gmail.nossr50.util.Misc; diff --git a/core/src/main/java/com/gmail/nossr50/core/data/database/SQLDatabaseManager.java b/core/src/main/java/com/gmail/nossr50/core/data/database/SQLDatabaseManager.java index cf668ba01..d05476b61 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/database/SQLDatabaseManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/SQLDatabaseManager.java @@ -2,14 +2,14 @@ package com.gmail.nossr50.core.data.database; import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.core.datatypes.MobHealthbarType; -import com.gmail.nossr50.core.datatypes.database.DatabaseType; -import com.gmail.nossr50.core.datatypes.database.PlayerStat; -import com.gmail.nossr50.core.datatypes.database.UpgradeType; -import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.datatypes.player.UniqueDataType; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.mcmmo.MobHealthbarType; +import com.gmail.nossr50.core.mcmmo.database.DatabaseType; +import com.gmail.nossr50.core.mcmmo.database.PlayerStat; +import com.gmail.nossr50.core.mcmmo.database.UpgradeType; +import com.gmail.nossr50.core.mcmmo.player.PlayerProfile; +import com.gmail.nossr50.core.mcmmo.player.UniqueDataType; +import com.gmail.nossr50.core.mcmmo.skills.PrimarySkillType; +import com.gmail.nossr50.core.mcmmo.skills.SuperAbilityType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.database.UUIDUpdateAsyncTask; import com.gmail.nossr50.util.Misc; diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java index 6cf5a1a01..36aa98d47 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java @@ -1,7 +1,6 @@ package com.gmail.nossr50.core.datatypes; - -import org.bukkit.Location; +import com.gmail.nossr50.core.mcmmo.Location; public class LimitedSizeList { public Location[] limitedSizeOrderedList; diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/MobHealthbarType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/MobHealthbarType.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/MobHealthbarType.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/MobHealthbarType.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/database/DatabaseType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/database/DatabaseType.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/database/DatabaseType.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/database/DatabaseType.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/database/PlayerStat.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/database/PlayerStat.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/database/PlayerStat.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/database/PlayerStat.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/database/UpgradeType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/database/UpgradeType.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/database/UpgradeType.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/database/UpgradeType.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/FormulaType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/FormulaType.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/FormulaType.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/experience/FormulaType.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/XPGainReason.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/XPGainReason.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/XPGainReason.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/experience/XPGainReason.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/XPGainSource.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/XPGainSource.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/experience/XPGainSource.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/experience/XPGainSource.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/interactions/NotificationType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/interactions/NotificationType.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/interactions/NotificationType.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/interactions/NotificationType.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/json/CustomBaseComponent.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/json/CustomBaseComponent.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/json/CustomBaseComponent.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/json/CustomBaseComponent.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOUrl.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOUrl.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOUrl.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOUrl.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomBlock.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomBlock.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomBlock.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomBlock.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomEntity.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomEntity.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomEntity.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomEntity.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomTool.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomTool.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomTool.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomTool.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyLeader.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyLeader.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyLeader.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyLeader.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java index 93c993e57..a54450686 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java @@ -4,15 +4,15 @@ import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.skills.WorldBlacklist; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; -import com.gmail.nossr50.core.datatypes.mods.CustomTool; -import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.datatypes.chat.ChatMode; +import com.gmail.nossr50.core.datatypes.mods.CustomTool; +import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.skills.ToolType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java index e0c3ca446..e02db264e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java @@ -3,11 +3,11 @@ package com.gmail.nossr50.core.datatypes.player; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.datatypes.MobHealthbarType; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.datatypes.experience.SkillXpGain; import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.datatypes.MobHealthbarType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.player.PlayerProfileSaveTask; import com.gmail.nossr50.skills.child.FamilyTree; diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/player/UniqueDataType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/UniqueDataType.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/player/UniqueDataType.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/player/UniqueDataType.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/ItemType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/ItemType.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/ItemType.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/ItemType.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/MaterialType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/MaterialType.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/MaterialType.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/MaterialType.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/ModConfigType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/ModConfigType.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/ModConfigType.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/ModConfigType.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/PrimarySkillType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/PrimarySkillType.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/PrimarySkillType.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/PrimarySkillType.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillFlags.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillFlags.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillFlags.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillFlags.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillType.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillType.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillType.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/SuperAbilityType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/SuperAbilityType.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/SuperAbilityType.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/SuperAbilityType.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/ToolType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/ToolType.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/ToolType.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/ToolType.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/AlchemyPotion.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/AlchemyPotion.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/AlchemyPotion.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/AlchemyPotion.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/PotionStage.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/PotionStage.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/PotionStage.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/PotionStage.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/ChildSkill.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/ChildSkill.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/ChildSkill.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/ChildSkill.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/CoreSkill.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/CoreSkill.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/CoreSkill.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/CoreSkill.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Localized.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Localized.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Localized.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Localized.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Skill.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Skill.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Skill.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Skill.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Toolable.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Toolable.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Toolable.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Toolable.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/progression/Progression.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/progression/Progression.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/progression/Progression.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/progression/Progression.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/AbstractSubSkill.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/AbstractSubSkill.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/AbstractSubSkill.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/AbstractSubSkill.java index 12ff29dee..b12d8af0d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/AbstractSubSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/AbstractSubSkill.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.core.datatypes.skills.subskills; import com.gmail.nossr50.core.config.skills.CoreSkillsConfig; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.Interaction; import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.Rank; import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.SubSkill; import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.SubSkillProperties; +import com.gmail.nossr50.core.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/AcrobaticsSubSkill.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/AcrobaticsSubSkill.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/AcrobaticsSubSkill.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/AcrobaticsSubSkill.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/Roll.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/Roll.java similarity index 99% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/Roll.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/Roll.java index ee634836f..72c3855f6 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/Roll.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/Roll.java @@ -3,9 +3,9 @@ package com.gmail.nossr50.core.datatypes.skills.subskills.acrobatics; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.datatypes.LimitedSizeList; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.LimitedSizeList; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import com.gmail.nossr50.core.datatypes.skills.SubSkillType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/InteractType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/InteractType.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/InteractType.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/InteractType.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Interaction.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Interaction.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Interaction.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Interaction.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Rank.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Rank.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Rank.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Rank.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkill.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkill.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkill.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkill.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkillProperties.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkillProperties.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkillProperties.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkillProperties.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/EnchantmentTreasure.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/EnchantmentTreasure.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/EnchantmentTreasure.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/EnchantmentTreasure.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ExcavationTreasure.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ExcavationTreasure.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ExcavationTreasure.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ExcavationTreasure.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/FishingTreasure.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/FishingTreasure.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/FishingTreasure.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/FishingTreasure.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/HylianTreasure.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/HylianTreasure.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/HylianTreasure.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/HylianTreasure.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Rarity.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Rarity.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Rarity.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Rarity.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ShakeTreasure.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ShakeTreasure.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ShakeTreasure.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ShakeTreasure.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Treasure.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Treasure.java similarity index 100% rename from bukkit/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Treasure.java rename to core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Treasure.java diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/AbstractWorld.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/AbstractWorld.java similarity index 96% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/AbstractWorld.java rename to core/src/main/java/com/gmail/nossr50/core/mcmmo/AbstractWorld.java index 17fee1929..e16eb44b7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/AbstractWorld.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/AbstractWorld.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes; +package com.gmail.nossr50.core.mcmmo; import java.util.Objects; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/Location.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Location.java similarity index 93% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/Location.java rename to core/src/main/java/com/gmail/nossr50/core/mcmmo/Location.java index 041f07c9a..52c6ae403 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/Location.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Location.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes; +package com.gmail.nossr50.core.mcmmo; /** * This class represents a Location in MC diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/Nameable.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java similarity index 89% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/Nameable.java rename to core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java index fe61ef493..87981f308 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/Nameable.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes; +package com.gmail.nossr50.core.mcmmo; public interface Nameable extends Named { /** diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/Named.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Named.java similarity index 83% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/Named.java rename to core/src/main/java/com/gmail/nossr50/core/mcmmo/Named.java index 2eb1dcd8d..63c20a99d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/Named.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Named.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes; +package com.gmail.nossr50.core.mcmmo; /** * A lot of Objects in MC have names diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/Property.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Property.java similarity index 95% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/Property.java rename to core/src/main/java/com/gmail/nossr50/core/mcmmo/Property.java index 1cfa6fe6d..ccb92d9aa 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/Property.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Property.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes; +package com.gmail.nossr50.core.mcmmo; import java.util.Collection; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/World.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/World.java similarity index 76% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/World.java rename to core/src/main/java/com/gmail/nossr50/core/mcmmo/World.java index 9554279aa..04c4569c4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/World.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/World.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes; +package com.gmail.nossr50.core.mcmmo; public interface World { /** diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/block/Block.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Block.java similarity index 88% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/block/Block.java rename to core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Block.java index b542d47a0..588905bdc 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/block/Block.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Block.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.core.datatypes.block; +package com.gmail.nossr50.core.mcmmo.block; -import com.gmail.nossr50.core.datatypes.Property; +import com.gmail.nossr50.core.mcmmo.Property; /** * Represents a container of properties and values for a Block diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/block/BlockState.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/BlockState.java similarity index 93% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/block/BlockState.java rename to core/src/main/java/com/gmail/nossr50/core/mcmmo/block/BlockState.java index 5e67265aa..444485f04 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/block/BlockState.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/BlockState.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.core.datatypes.block; +package com.gmail.nossr50.core.mcmmo.block; -import com.gmail.nossr50.core.datatypes.Property; +import com.gmail.nossr50.core.mcmmo.Property; import com.google.common.collect.ImmutableMap; import java.util.Collection; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Entity.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Entity.java similarity index 73% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Entity.java rename to core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Entity.java index 92975d92e..401adce52 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Entity.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Entity.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.core.datatypes.entity; +package com.gmail.nossr50.core.mcmmo.entity; -import com.gmail.nossr50.core.datatypes.Location; -import com.gmail.nossr50.core.datatypes.Named; +import com.gmail.nossr50.core.mcmmo.Location; +import com.gmail.nossr50.core.mcmmo.Named; import java.util.UUID; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Living.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Living.java similarity index 94% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Living.java rename to core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Living.java index 1ad54b282..05ff0153c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Living.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Living.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.entity; +package com.gmail.nossr50.core.mcmmo.entity; /** * Living means you can die, you have health, and you can be damaged diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Player.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java similarity index 69% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Player.java rename to core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java index 730e6566a..328f5dd69 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/entity/Player.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java @@ -1,6 +1,7 @@ -package com.gmail.nossr50.core.datatypes.entity; +package com.gmail.nossr50.core.mcmmo.entity; -import com.gmail.nossr50.core.datatypes.Nameable; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.mcmmo.Nameable; /** * Players diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/event/Cancellable.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/Cancellable.java similarity index 86% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/event/Cancellable.java rename to core/src/main/java/com/gmail/nossr50/core/mcmmo/event/Cancellable.java index 4ba1938d3..6237f4447 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/event/Cancellable.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/Cancellable.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.event; +package com.gmail.nossr50.core.mcmmo.event; /** * This class handles cancellations for an event diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/event/Event.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/Event.java similarity index 61% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/event/Event.java rename to core/src/main/java/com/gmail/nossr50/core/mcmmo/event/Event.java index 40df44a2e..fd6852066 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/event/Event.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/Event.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.event; +package com.gmail.nossr50.core.mcmmo.event; /** * Represents an event for a given API diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/event/EventType.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/EventType.java similarity index 89% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/event/EventType.java rename to core/src/main/java/com/gmail/nossr50/core/mcmmo/event/EventType.java index 5cc5716cb..eded15cb0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/event/EventType.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/EventType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.event; +package com.gmail.nossr50.core.mcmmo.event; /** * Different platforms have different event systems From e749d5eb7ff5452b87c0e36009f6b1d88e19a86f Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 9 Feb 2019 22:37:22 -0800 Subject: [PATCH 05/28] Moving Stuff around pt 2 --- .../nossr50/commands/McImportCommand.java | 4 +- .../nossr50/commands/McabilityCommand.java | 4 +- .../gmail/nossr50/commands/McgodCommand.java | 4 +- .../gmail/nossr50/commands/McmmoCommand.java | 4 +- .../nossr50/commands/McnotifyCommand.java | 2 +- .../nossr50/commands/McrefreshCommand.java | 4 +- .../nossr50/commands/McscoreboardCommand.java | 6 +- .../gmail/nossr50/commands/ToggleCommand.java | 2 +- .../gmail/nossr50/commands/XprateCommand.java | 10 +- .../nossr50/commands/chat/ChatCommand.java | 8 +- .../nossr50/commands/chat/McChatSpy.java | 4 +- .../commands/chat/PartyChatCommand.java | 6 +- .../database/ConvertDatabaseCommand.java | 6 +- .../commands/database/McpurgeCommand.java | 2 +- .../commands/database/McremoveCommand.java | 4 +- .../commands/database/MmoshowdbCommand.java | 2 +- .../commands/experience/AddlevelsCommand.java | 8 +- .../commands/experience/AddxpCommand.java | 6 +- .../experience/ConvertExperienceCommand.java | 6 +- .../experience/ExperienceCommand.java | 6 +- .../commands/experience/MmoeditCommand.java | 8 +- .../experience/SkillresetCommand.java | 10 +- .../commands/hardcore/HardcoreCommand.java | 6 +- .../hardcore/HardcoreModeCommand.java | 8 +- .../commands/hardcore/VampirismCommand.java | 6 +- .../commands/party/PartyAcceptCommand.java | 4 +- .../party/PartyChangeOwnerCommand.java | 6 +- .../party/PartyChangePasswordCommand.java | 2 +- .../nossr50/commands/party/PartyCommand.java | 6 +- .../commands/party/PartyCreateCommand.java | 4 +- .../commands/party/PartyDisbandCommand.java | 4 +- .../commands/party/PartyHelpCommand.java | 2 +- .../commands/party/PartyInfoCommand.java | 4 +- .../commands/party/PartyInviteCommand.java | 6 +- .../commands/party/PartyItemShareCommand.java | 6 +- .../commands/party/PartyJoinCommand.java | 6 +- .../commands/party/PartyKickCommand.java | 6 +- .../commands/party/PartyLockCommand.java | 6 +- .../commands/party/PartyQuitCommand.java | 4 +- .../commands/party/PartyRenameCommand.java | 4 +- .../commands/party/PartyXpShareCommand.java | 6 +- .../alliance/PartyAllianceAcceptCommand.java | 4 +- .../party/alliance/PartyAllianceCommand.java | 6 +- .../alliance/PartyAllianceDisbandCommand.java | 4 +- .../alliance/PartyAllianceInviteCommand.java | 6 +- .../party/teleport/PtpAcceptAnyCommand.java | 4 +- .../party/teleport/PtpAcceptCommand.java | 6 +- .../commands/party/teleport/PtpCommand.java | 20 +- .../party/teleport/PtpToggleCommand.java | 4 +- .../commands/player/InspectCommand.java | 10 +- .../commands/player/MccooldownCommand.java | 8 +- .../commands/player/McrankCommand.java | 8 +- .../commands/player/McstatsCommand.java | 6 +- .../nossr50/commands/player/MctopCommand.java | 12 +- .../commands/skills/AcrobaticsCommand.java | 16 +- .../commands/skills/AlchemyCommand.java | 14 +- .../nossr50/commands/skills/AprilCommand.java | 10 +- .../commands/skills/ArcheryCommand.java | 12 +- .../nossr50/commands/skills/AxesCommand.java | 16 +- .../commands/skills/ExcavationCommand.java | 12 +- .../commands/skills/FishingCommand.java | 20 +- .../commands/skills/HerbalismCommand.java | 14 +- .../commands/skills/MiningCommand.java | 16 +- .../commands/skills/MmoInfoCommand.java | 12 +- .../commands/skills/RepairCommand.java | 24 +- .../commands/skills/SalvageCommand.java | 14 +- .../nossr50/commands/skills/SkillCommand.java | 26 +- .../commands/skills/SkillGuideCommand.java | 6 +- .../commands/skills/SmeltingCommand.java | 16 +- .../commands/skills/SwordsCommand.java | 14 +- .../commands/skills/TamingCommand.java | 14 +- .../commands/skills/UnarmedCommand.java | 14 +- .../commands/skills/WoodcuttingCommand.java | 14 +- .../McMMOPlayerExperienceEvent.java | 2 +- .../McMMOPlayerLevelChangeEvent.java | 2 +- .../experience/McMMOPlayerLevelDownEvent.java | 2 +- .../experience/McMMOPlayerLevelUpEvent.java | 2 +- .../experience/McMMOPlayerXpGainEvent.java | 2 +- .../events/skills/McMMOPlayerSkillEvent.java | 2 +- .../McMMOPlayerAbilityActivateEvent.java | 2 +- .../McMMOPlayerAbilityDeactivateEvent.java | 2 +- .../abilities/McMMOPlayerAbilityEvent.java | 4 +- .../skills/alchemy/McMMOPlayerBrewEvent.java | 2 +- .../alchemy/McMMOPlayerCatalysisEvent.java | 2 +- .../fishing/McMMOPlayerFishingEvent.java | 2 +- .../repair/McMMOPlayerRepairCheckEvent.java | 2 +- .../salvage/McMMOPlayerSalvageCheckEvent.java | 2 +- .../secondaryabilities/SubSkillEvent.java | 6 +- .../SubSkillRandomCheckEvent.java | 4 +- .../unarmed/McMMOPlayerDisarmEvent.java | 2 +- .../nossr50/listeners/BlockListener.java | 40 +- .../nossr50/listeners/EntityListener.java | 30 +- .../nossr50/listeners/InteractionManager.java | 8 +- .../nossr50/listeners/InventoryListener.java | 20 +- .../nossr50/listeners/PlayerListener.java | 41 +- .../gmail/nossr50/listeners/SelfListener.java | 8 +- .../main/java/com/gmail/nossr50/mcMMO.java | 53 +-- .../gmail/nossr50/skills/mining/Mining.java | 167 ------- .../com/gmail/nossr50/util/MaterialUtils.java | 24 - .../gmail/nossr50/core}/api/AbilityAPI.java | 4 +- .../com/gmail/nossr50/core}/api/ChatAPI.java | 2 +- .../nossr50/core}/api/ExperienceAPI.java | 5 +- .../com/gmail/nossr50/core}/api/PartyAPI.java | 2 +- .../com/gmail/nossr50/core}/api/SkillAPI.java | 4 +- .../InvalidFormulaTypeException.java | 2 +- .../exceptions/InvalidPlayerException.java | 2 +- .../api/exceptions/InvalidSkillException.java | 2 +- .../InvalidXPGainReasonException.java | 2 +- .../McMMOPlayerNotFoundException.java | 2 +- .../nossr50/core}/chat/AdminChatManager.java | 2 +- .../gmail/nossr50/core}/chat/ChatManager.java | 4 +- .../core}/chat/ChatManagerFactory.java | 2 +- .../nossr50/core}/chat/PartyChatManager.java | 4 +- .../datatypes/experience/SkillXpGain.java | 2 +- .../core/datatypes/player/McMMOPlayer.java | 6 +- .../core/datatypes/player/PlayerProfile.java | 6 +- .../nossr50/core}/locale/LocaleLoader.java | 2 +- .../nossr50/core}/party/PartyManager.java | 14 +- .../nossr50/core}/party/ShareHandler.java | 6 +- .../core}/runnables/CheckDateTask.java | 4 +- .../MobHealthDisplayUpdaterTask.java | 2 +- .../core}/runnables/PistonTrackerTask.java | 2 +- .../core}/runnables/SaveTimerTask.java | 4 +- .../runnables/StickyPistonTrackerTask.java | 2 +- .../runnables/backups/CleanBackupsTask.java | 2 +- .../commands/McScoreboardKeepTask.java | 2 +- .../commands/McrankCommandAsyncTask.java | 4 +- .../commands/McrankCommandDisplayTask.java | 6 +- .../commands/MctopCommandAsyncTask.java | 4 +- .../commands/MctopCommandDisplayTask.java | 6 +- .../database/DatabaseConversionTask.java | 4 +- .../database/FormulaConversionTask.java | 6 +- .../database/UUIDUpdateAsyncTask.java | 2 +- .../runnables/database/UserPurgeTask.java | 2 +- .../runnables/items/ChimaeraWingWarmup.java | 4 +- .../runnables/items/TeleportationWarmup.java | 4 +- .../runnables/party/PartyAutoKickTask.java | 2 +- .../core}/runnables/party/PartyChatTask.java | 4 +- .../player/ClearRegisteredXPGainTask.java | 2 +- .../player/PlayerProfileLoadingTask.java | 6 +- .../player/PlayerProfileSaveTask.java | 2 +- .../player/PlayerUpdateInventoryTask.java | 2 +- .../player/PowerLevelUpdatingTask.java | 2 +- .../runnables/skills/AbilityCooldownTask.java | 4 +- .../runnables/skills/AbilityDisableTask.java | 4 +- .../skills/AlchemyBrewCheckTask.java | 6 +- .../runnables/skills/AlchemyBrewTask.java | 10 +- .../core}/runnables/skills/AprilTask.java | 2 +- .../runnables/skills/AwardCombatXpTask.java | 4 +- .../runnables/skills/BleedContainer.java | 2 +- .../runnables/skills/BleedTimerTask.java | 2 +- .../skills/ExperienceBarHideTask.java | 4 +- .../skills/HerbalismBlockUpdaterTask.java | 2 +- .../skills/SkillUnlockNotificationTask.java | 4 +- .../core}/runnables/skills/ToolLowerTask.java | 4 +- .../core/{datatypes => }/skills/ItemType.java | 2 +- .../{datatypes => }/skills/MaterialType.java | 2 +- .../MobHealthbarType.java | 2 +- .../{datatypes => }/skills/ModConfigType.java | 2 +- .../alchemy => skills}/PotionStage.java | 3 +- .../skills/PrimarySkillType.java | 2 +- .../nossr50/core}/skills/SkillManager.java | 3 +- .../{datatypes => }/skills/SubSkillFlags.java | 2 +- .../{datatypes => }/skills/SubSkillType.java | 2 +- .../skills/SuperAbilityType.java | 2 +- .../core/{datatypes => }/skills/ToolType.java | 2 +- .../core}/skills/child/ChildConfig.java | 4 +- .../core}/skills/child/FamilyTree.java | 4 +- .../core/skills/child}/salvage/Salvage.java | 2 +- .../skills/child}/salvage/SalvageManager.java | 12 +- .../salvage/salvageables/Salvageable.java | 6 +- .../salvageables/SalvageableFactory.java | 6 +- .../salvageables/SalvageableManager.java | 2 +- .../salvageables/SimpleSalvageable.java | 6 +- .../SimpleSalvageableManager.java | 2 +- .../core/skills/child}/smelting/Smelting.java | 6 +- .../child}/smelting/SmeltingManager.java | 14 +- .../skills/interfaces/ChildSkill.java | 4 +- .../skills/interfaces/CoreSkill.java | 4 +- .../skills/interfaces/Localized.java | 2 +- .../interfaces}/Progression.java | 4 +- .../skills/interfaces/Skill.java | 4 +- .../skills/interfaces/Toolable.java | 2 +- .../primary}/acrobatics/Acrobatics.java | 2 +- .../acrobatics/AcrobaticsManager.java | 8 +- .../core/skills/primary}/alchemy/Alchemy.java | 4 +- .../primary}/alchemy/AlchemyManager.java | 10 +- .../primary}/alchemy/AlchemyPotion.java | 2 +- .../primary}/alchemy/AlchemyPotionBrewer.java | 7 +- .../core/skills/primary}/archery/Archery.java | 4 +- .../primary}/archery/ArcheryManager.java | 8 +- .../primary}/archery/TrackedEntity.java | 2 +- .../core/skills/primary}/axes/Axes.java | 4 +- .../skills/primary}/axes/AxesManager.java | 13 +- .../primary}/excavation/Excavation.java | 6 +- .../excavation/ExcavationManager.java | 10 +- .../core/skills/primary}/fishing/Fishing.java | 4 +- .../primary}/fishing/FishingManager.java | 24 +- .../skills/primary}/herbalism/Herbalism.java | 18 +- .../primary}/herbalism/HerbalismManager.java | 38 +- .../skills/primary}/mining/BlastMining.java | 4 +- .../core/skills/primary/mining/Mining.java | 167 +++++++ .../skills/primary}/mining/MiningManager.java | 10 +- .../skills/primary}/repair/ArcaneForging.java | 2 +- .../core/skills/primary}/repair/Repair.java | 2 +- .../skills/primary}/repair/RepairManager.java | 12 +- .../repair/repairables/Repairable.java | 6 +- .../repair/repairables/RepairableFactory.java | 6 +- .../repair/repairables/RepairableManager.java | 2 +- .../repair/repairables/SimpleRepairable.java | 6 +- .../repairables/SimpleRepairableManager.java | 2 +- .../core/skills/primary}/swords/Swords.java | 2 +- .../skills/primary}/swords/SwordsManager.java | 12 +- .../core/skills/primary}/taming/Taming.java | 8 +- .../skills/primary}/taming/TamingManager.java | 16 +- .../primary}/taming/TrackedTamingEntity.java | 2 +- .../core/skills/primary}/unarmed/Unarmed.java | 2 +- .../primary}/unarmed/UnarmedManager.java | 14 +- .../primary}/woodcutting/Woodcutting.java | 4 +- .../woodcutting/WoodcuttingManager.java | 16 +- .../skills/subskills/AbstractSubSkill.java | 12 +- .../acrobatics/AcrobaticsSubSkill.java | 10 +- .../skills/subskills/acrobatics/Roll.java | 4 +- .../subskills/interfaces/InteractType.java | 2 +- .../subskills/interfaces/Interaction.java | 2 +- .../skills/subskills/interfaces/Rank.java | 2 +- .../skills/subskills/interfaces/SubSkill.java | 4 +- .../interfaces/SubSkillProperties.java | 2 +- .../treasure/EnchantmentTreasure.java | 2 +- .../treasure/ExcavationTreasure.java | 3 +- .../treasure/FishingTreasure.java | 3 +- .../treasure/HylianTreasure.java | 3 +- .../treasure/Rarity.java | 2 +- .../treasure/ShakeTreasure.java | 3 +- .../treasure/Treasure.java | 2 +- .../gmail/nossr50/core}/util/BlockUtils.java | 434 +++++++++--------- .../nossr50/core}/util/ChimaeraWing.java | 16 +- .../nossr50/core}/util/EnchantmentUtils.java | 2 +- .../gmail/nossr50/core}/util/EventUtils.java | 14 +- .../nossr50/core}/util/HardcoreManager.java | 6 +- .../nossr50/core}/util/HolidayManager.java | 52 +-- .../gmail/nossr50/core}/util/ItemUtils.java | 420 ++++++++--------- .../gmail/nossr50/core}/util/LogFilter.java | 2 +- .../nossr50/core/util/MaterialUtils.java | 24 + .../com/gmail/nossr50/core}/util/Misc.java | 4 +- .../nossr50/core}/util/MobHealthbarUtils.java | 10 +- .../gmail/nossr50/core}/util/ModManager.java | 4 +- .../com/gmail/nossr50/core}/util/Motd.java | 8 +- .../gmail/nossr50/core}/util/Permissions.java | 12 +- .../gmail/nossr50/core}/util/StringUtils.java | 18 +- .../core}/util/TextComponentFactory.java | 12 +- .../core}/util/adapter/BiomeAdapter.java | 2 +- .../commands/CommandRegistrationManager.java | 8 +- .../core}/util/commands/CommandUtils.java | 12 +- .../util/experience/ExperienceBarManager.java | 6 +- .../util/experience/ExperienceBarWrapper.java | 8 +- .../core}/util/experience/FormulaManager.java | 4 +- .../util/player/NotificationManager.java | 14 +- .../random/InvalidActivationException.java | 2 +- .../util/random/InvalidStaticChance.java | 2 +- .../util/random/RandomChanceExecution.java | 2 +- .../core}/util/random/RandomChanceSkill.java | 8 +- .../util/random/RandomChanceSkillStatic.java | 4 +- .../core}/util/random/RandomChanceStatic.java | 2 +- .../core}/util/random/RandomChanceUtil.java | 14 +- .../core}/util/scoreboards/ObjectiveType.java | 2 +- .../util/scoreboards/ScoreboardManager.java | 10 +- .../util/scoreboards/ScoreboardWrapper.java | 14 +- .../core}/util/skills/CombatUtils.java | 27 +- .../util/skills/ParticleEffectUtils.java | 2 +- .../nossr50/core}/util/skills/PerksUtils.java | 6 +- .../nossr50/core}/util/skills/RankUtils.java | 12 +- .../util/skills/SkillActivationType.java | 2 +- .../nossr50/core}/util/skills/SkillUtils.java | 18 +- .../core}/util/sounds/SoundManager.java | 4 +- .../nossr50/core}/util/sounds/SoundType.java | 2 +- .../core}/util/upgrade/UpgradeManager.java | 2 +- .../nossr50/core}/util/uuid/UUIDFetcher.java | 2 +- .../core}/worldguard/WorldGuardFlags.java | 2 +- .../core}/worldguard/WorldGuardManager.java | 2 +- .../core}/worldguard/WorldGuardUtils.java | 2 +- .../shatt/backup/ZipLibrary.java | 0 282 files changed, 1547 insertions(+), 1541 deletions(-) delete mode 100644 bukkit/src/main/java/com/gmail/nossr50/skills/mining/Mining.java delete mode 100644 bukkit/src/main/java/com/gmail/nossr50/util/MaterialUtils.java rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/api/AbilityAPI.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/api/ChatAPI.java (99%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/api/ExperienceAPI.java (99%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/api/PartyAPI.java (99%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/api/SkillAPI.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/api/exceptions/InvalidFormulaTypeException.java (83%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/api/exceptions/InvalidPlayerException.java (83%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/api/exceptions/InvalidSkillException.java (82%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/api/exceptions/InvalidXPGainReasonException.java (83%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/api/exceptions/McMMOPlayerNotFoundException.java (88%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/chat/AdminChatManager.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/chat/ChatManager.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/chat/ChatManagerFactory.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/chat/PartyChatManager.java (90%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/locale/LocaleLoader.java (99%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/party/PartyManager.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/party/ShareHandler.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/CheckDateTask.java (84%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/MobHealthDisplayUpdaterTask.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/PistonTrackerTask.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/SaveTimerTask.java (85%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/StickyPistonTrackerTask.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/backups/CleanBackupsTask.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/commands/McScoreboardKeepTask.java (90%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/commands/McrankCommandAsyncTask.java (92%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/commands/McrankCommandDisplayTask.java (93%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/commands/MctopCommandAsyncTask.java (92%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/commands/MctopCommandDisplayTask.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/database/DatabaseConversionTask.java (90%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/database/FormulaConversionTask.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/database/UUIDUpdateAsyncTask.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/database/UserPurgeTask.java (91%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/items/ChimaeraWingWarmup.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/items/TeleportationWarmup.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/party/PartyAutoKickTask.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/party/PartyChatTask.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/player/ClearRegisteredXPGainTask.java (89%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/player/PlayerProfileLoadingTask.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/player/PlayerProfileSaveTask.java (89%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/player/PlayerUpdateInventoryTask.java (88%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/player/PowerLevelUpdatingTask.java (86%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/skills/AbilityCooldownTask.java (89%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/skills/AbilityDisableTask.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/skills/AlchemyBrewCheckTask.java (88%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/skills/AlchemyBrewTask.java (92%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/skills/AprilTask.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/skills/AwardCombatXpTask.java (93%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/skills/BleedContainer.java (90%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/skills/BleedTimerTask.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/skills/ExperienceBarHideTask.java (92%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/skills/HerbalismBlockUpdaterTask.java (88%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/skills/SkillUnlockNotificationTask.java (93%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/runnables/skills/ToolLowerTask.java (90%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/ItemType.java (54%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/MaterialType.java (94%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => skills}/MobHealthbarType.java (60%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/ModConfigType.java (95%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes/skills/alchemy => skills}/PotionStage.java (95%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/PrimarySkillType.java (99%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/skills/SkillManager.java (94%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/SubSkillFlags.java (96%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/SubSkillType.java (99%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/SuperAbilityType.java (99%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/ToolType.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/skills/child/ChildConfig.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/skills/child/FamilyTree.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/child}/salvage/Salvage.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/child}/salvage/SalvageManager.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/child}/salvage/salvageables/Salvageable.java (92%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/child}/salvage/salvageables/SalvageableFactory.java (84%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/child}/salvage/salvageables/SalvageableManager.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/child}/salvage/salvageables/SimpleSalvageable.java (92%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/child}/salvage/salvageables/SimpleSalvageableManager.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/child}/smelting/Smelting.java (87%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/child}/smelting/SmeltingManager.java (93%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/interfaces/ChildSkill.java (59%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/interfaces/CoreSkill.java (82%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/interfaces/Localized.java (88%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes/skills/progression => skills/interfaces}/Progression.java (69%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/interfaces/Skill.java (71%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/interfaces/Toolable.java (86%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/acrobatics/Acrobatics.java (92%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/acrobatics/AcrobaticsManager.java (92%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/alchemy/Alchemy.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/alchemy/AlchemyManager.java (87%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes/skills => skills/primary}/alchemy/AlchemyPotion.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/alchemy/AlchemyPotionBrewer.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/archery/Archery.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/archery/ArcheryManager.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/archery/TrackedEntity.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/axes/Axes.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/axes/AxesManager.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/excavation/Excavation.java (88%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/excavation/ExcavationManager.java (91%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/fishing/Fishing.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/fishing/FishingManager.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/herbalism/Herbalism.java (92%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/herbalism/HerbalismManager.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/mining/BlastMining.java (97%) create mode 100644 core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/Mining.java rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/mining/MiningManager.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/repair/ArcaneForging.java (86%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/repair/Repair.java (89%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/repair/RepairManager.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/repair/repairables/Repairable.java (92%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/repair/repairables/RepairableFactory.java (89%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/repair/repairables/RepairableManager.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/repair/repairables/SimpleRepairable.java (93%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/repair/repairables/SimpleRepairableManager.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/swords/Swords.java (91%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/swords/SwordsManager.java (93%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/taming/Taming.java (92%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/taming/TamingManager.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/taming/TrackedTamingEntity.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/unarmed/Unarmed.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/unarmed/UnarmedManager.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/woodcutting/Woodcutting.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50/skills => core/src/main/java/com/gmail/nossr50/core/skills/primary}/woodcutting/WoodcuttingManager.java (92%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/subskills/AbstractSubSkill.java (81%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/subskills/acrobatics/AcrobaticsSubSkill.java (88%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/subskills/acrobatics/Roll.java (99%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/subskills/interfaces/InteractType.java (80%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/subskills/interfaces/Interaction.java (91%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/subskills/interfaces/Rank.java (87%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/subskills/interfaces/SubSkill.java (93%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => }/skills/subskills/interfaces/SubSkillProperties.java (64%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => skills}/treasure/EnchantmentTreasure.java (92%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => skills}/treasure/ExcavationTreasure.java (69%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => skills}/treasure/FishingTreasure.java (63%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => skills}/treasure/HylianTreasure.java (68%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => skills}/treasure/Rarity.java (85%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => skills}/treasure/ShakeTreasure.java (68%) rename core/src/main/java/com/gmail/nossr50/core/{datatypes => skills}/treasure/Treasure.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/BlockUtils.java (50%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/ChimaeraWing.java (93%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/EnchantmentUtils.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/EventUtils.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/HardcoreManager.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/HolidayManager.java (92%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/ItemUtils.java (62%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/LogFilter.java (93%) create mode 100644 core/src/main/java/com/gmail/nossr50/core/util/MaterialUtils.java rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/Misc.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/MobHealthbarUtils.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/ModManager.java (99%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/Motd.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/Permissions.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/StringUtils.java (91%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/TextComponentFactory.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/adapter/BiomeAdapter.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/commands/CommandRegistrationManager.java (99%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/commands/CommandUtils.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/experience/ExperienceBarManager.java (93%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/experience/ExperienceBarWrapper.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/experience/FormulaManager.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/player/NotificationManager.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/random/InvalidActivationException.java (62%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/random/InvalidStaticChance.java (60%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/random/RandomChanceExecution.java (92%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/random/RandomChanceSkill.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/random/RandomChanceSkillStatic.java (93%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/random/RandomChanceStatic.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/random/RandomChanceUtil.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/scoreboards/ObjectiveType.java (52%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/scoreboards/ScoreboardManager.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/scoreboards/ScoreboardWrapper.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/skills/CombatUtils.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/skills/ParticleEffectUtils.java (99%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/skills/PerksUtils.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/skills/RankUtils.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/skills/SkillActivationType.java (91%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/skills/SkillUtils.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/sounds/SoundManager.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/sounds/SoundType.java (91%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/upgrade/UpgradeManager.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/util/uuid/UUIDFetcher.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/worldguard/WorldGuardFlags.java (88%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/worldguard/WorldGuardManager.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/worldguard/WorldGuardUtils.java (97%) rename {bukkit => core}/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java (100%) diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McImportCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McImportCommand.java index 14f6dd891..e370d91ec 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McImportCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McImportCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands; -import com.gmail.nossr50.core.datatypes.skills.ModConfigType; +import com.gmail.nossr50.core.skills.ModConfigType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Misc; +import com.gmail.nossr50.core.util.Misc; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McabilityCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McabilityCommand.java index f251b728a..87901644c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McabilityCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McabilityCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.Permissions; import org.bukkit.command.CommandSender; public class McabilityCommand extends ToggleCommand { diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McgodCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McgodCommand.java index ff03c8226..f2a0fdea5 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McgodCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McgodCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.Permissions; import org.bukkit.command.CommandSender; public class McgodCommand extends ToggleCommand { diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java index a87672a55..3a20b6b4b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java @@ -2,9 +2,9 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.commands.party.PartySubcommandType; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.core.util.Permissions; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java index 10d12c2fb..afbe211b7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McrefreshCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McrefreshCommand.java index 93b277bb4..d143e2814 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McrefreshCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McrefreshCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.Permissions; import org.bukkit.command.CommandSender; public class McrefreshCommand extends ToggleCommand { diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McscoreboardCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McscoreboardCommand.java index f9ccf4503..47f30be5c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McscoreboardCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McscoreboardCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.scoreboards.ScoreboardManager; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.commands.CommandUtils; +import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/ToggleCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/ToggleCommand.java index 9195e57c9..5956d6df9 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/ToggleCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/ToggleCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java index 85f35576b..6d6765822 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java @@ -2,12 +2,12 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.StringUtils; -import com.gmail.nossr50.util.commands.CommandUtils; -import com.gmail.nossr50.util.player.NotificationManager; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.StringUtils; +import com.gmail.nossr50.core.util.commands.CommandUtils; +import com.gmail.nossr50.core.util.player.NotificationManager; import com.google.common.collect.ImmutableList; import org.bukkit.ChatColor; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java index f315f5d71..6bc73b9c2 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.commands.chat; -import com.gmail.nossr50.chat.ChatManager; -import com.gmail.nossr50.chat.ChatManagerFactory; +import com.gmail.nossr50.core.chat.ChatManager; +import com.gmail.nossr50.core.chat.ChatManagerFactory; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/McChatSpy.java b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/McChatSpy.java index 6a471f16e..b6f779aa3 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/McChatSpy.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/McChatSpy.java @@ -2,8 +2,8 @@ package com.gmail.nossr50.commands.chat; import com.gmail.nossr50.commands.ToggleCommand; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.Permissions; import org.bukkit.command.CommandSender; public class McChatSpy extends ToggleCommand { diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java index a39b535f5..219ffa072 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.chat; -import com.gmail.nossr50.chat.PartyChatManager; +import com.gmail.nossr50.core.chat.PartyChatManager; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.party.PartyManager; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java index 8d4816436..69620c5a7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java @@ -4,10 +4,10 @@ import com.gmail.nossr50.core.data.database.DatabaseManager; import com.gmail.nossr50.core.data.database.DatabaseManagerFactory; import com.gmail.nossr50.core.datatypes.database.DatabaseType; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.runnables.database.DatabaseConversionTask; -import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask; +import com.gmail.nossr50.core.runnables.database.DatabaseConversionTask; +import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java index 1a3948496..17d8cca79 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands.database; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/database/McremoveCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/database/McremoveCommand.java index 25446135a..c4b83e977 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/database/McremoveCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/database/McremoveCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.database; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/database/MmoshowdbCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/database/MmoshowdbCommand.java index c02e5688a..9b0566825 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/database/MmoshowdbCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/database/MmoshowdbCommand.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.commands.database; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.data.database.DatabaseManagerFactory; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java index db3bc73e9..4ea0ecf2e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java @@ -2,10 +2,10 @@ package com.gmail.nossr50.commands.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.EventUtils; -import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.EventUtils; +import com.gmail.nossr50.core.util.Permissions; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddxpCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddxpCommand.java index 91ec3a2a8..2b1fbd647 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddxpCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddxpCommand.java @@ -3,9 +3,9 @@ package com.gmail.nossr50.commands.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java index 253fec7ec..7c1b1b8ab 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.experience; import com.gmail.nossr50.core.datatypes.experience.FormulaType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.runnables.database.FormulaConversionTask; -import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask; +import com.gmail.nossr50.core.runnables.database.FormulaConversionTask; +import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java index 58dae952b..a8a24db35 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java @@ -2,10 +2,10 @@ package com.gmail.nossr50.commands.experience; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.OfflinePlayer; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java index 1f0ccb1b2..d7e9150f7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java @@ -2,10 +2,10 @@ package com.gmail.nossr50.commands.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.EventUtils; -import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.EventUtils; +import com.gmail.nossr50.core.util.Permissions; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java index 9cacf213f..d9a98242d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java @@ -3,12 +3,12 @@ package com.gmail.nossr50.commands.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.EventUtils; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.util.EventUtils; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.OfflinePlayer; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java index fcc4d427f..2e2bcd582 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.hardcore; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.core.util.Permissions; import org.bukkit.command.CommandSender; public class HardcoreCommand extends HardcoreModeCommand { diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreModeCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreModeCommand.java index f252ad48e..190e92925 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreModeCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreModeCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.hardcore; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.StringUtils; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.StringUtils; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java index 253d56822..97758e956 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.hardcore; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.core.util.Permissions; import org.bukkit.command.CommandSender; public class VampirismCommand extends HardcoreModeCommand { diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyAcceptCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyAcceptCommand.java index b69649a83..d9e8535bd 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyAcceptCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyAcceptCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.party.PartyManager; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java index f31bcffe1..6fc137f72 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.core.datatypes.party.Party; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.party.PartyManager; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.OfflinePlayer; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangePasswordCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangePasswordCommand.java index cd57094db..28503767e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangePasswordCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangePasswordCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.core.datatypes.party.Party; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java index 1e443fe1b..d71b11818 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java @@ -5,9 +5,9 @@ import com.gmail.nossr50.commands.party.alliance.PartyAllianceCommand; import com.gmail.nossr50.commands.party.teleport.PtpCommand; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCreateCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCreateCommand.java index b0e649fdc..90f0fe974 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCreateCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCreateCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.party.PartyManager; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java index b033b30a1..6d8c692c5 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java @@ -2,8 +2,8 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.party.PartyManager; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyHelpCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyHelpCommand.java index fcf4908c0..7773e2dfe 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyHelpCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyHelpCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java index c5aff1d4a..d8c0ed899 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java @@ -5,8 +5,8 @@ import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.core.datatypes.party.ShareMode; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.party.PartyManager; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.ChatColor; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java index bdf8d3c79..77240b094 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java @@ -3,9 +3,9 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.party.PartyManager; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java index 0b0067636..0beb71618 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java @@ -5,9 +5,9 @@ import com.gmail.nossr50.core.datatypes.party.ItemShareType; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.core.datatypes.party.ShareMode; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.StringUtils; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.StringUtils; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyJoinCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyJoinCommand.java index 1a101e684..e60ca6348 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyJoinCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyJoinCommand.java @@ -2,9 +2,9 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.party.PartyManager; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java index b9aea6d2a..4eec0fa64 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java @@ -2,10 +2,10 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.party.PartyManager; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.OfflinePlayer; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java index 842ab1bfc..4e70cd29f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.core.datatypes.party.Party; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java index 853b45c10..6c1f62e9f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java @@ -3,8 +3,8 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.party.PartyManager; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java index d72d5ae0d..b84a19c7e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java @@ -3,8 +3,8 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.party.PartyManager; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java index 9af76d9cd..1069244a3 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java @@ -4,9 +4,9 @@ import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.core.datatypes.party.ShareMode; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.StringUtils; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.StringUtils; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceAcceptCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceAcceptCommand.java index 8652b980d..6169132c7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceAcceptCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceAcceptCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.party.alliance; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.party.PartyManager; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java index ccab1ae8b..754d61a61 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java @@ -4,9 +4,9 @@ import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.party.PartyManager; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.ChatColor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceDisbandCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceDisbandCommand.java index 8b3e01044..418f4f478 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceDisbandCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceDisbandCommand.java @@ -2,8 +2,8 @@ package com.gmail.nossr50.commands.party.alliance; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.party.PartyManager; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceInviteCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceInviteCommand.java index dd08b73e5..704e3e0c8 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceInviteCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceInviteCommand.java @@ -2,9 +2,9 @@ package com.gmail.nossr50.commands.party.alliance; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.party.PartyManager; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java index b3c28dc5d..b525e779d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.party.teleport; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java index 7528eeb4e..de5330587 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java @@ -2,10 +2,10 @@ package com.gmail.nossr50.commands.party.teleport; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.skills.SkillUtils; +import com.gmail.nossr50.core.util.skills.SkillUtils; import org.bukkit.World; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java index 88bc48294..a76b3af7e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java @@ -6,18 +6,18 @@ import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.runnables.items.TeleportationWarmup; -import com.gmail.nossr50.util.EventUtils; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.party.PartyManager; +import com.gmail.nossr50.core.runnables.items.TeleportationWarmup; +import com.gmail.nossr50.core.util.EventUtils; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.skills.SkillUtils; -import com.gmail.nossr50.worldguard.WorldGuardManager; -import com.gmail.nossr50.worldguard.WorldGuardUtils; +import com.gmail.nossr50.core.util.skills.SkillUtils; +import com.gmail.nossr50.core.worldguard.WorldGuardManager; +import com.gmail.nossr50.core.worldguard.WorldGuardUtils; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java index fea809e3d..1449b7c24 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.party.teleport; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java index 02e7f3c02..7214e389c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java @@ -3,13 +3,13 @@ package com.gmail.nossr50.commands.player; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.scoreboards.ScoreboardManager; +import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java index 2136c1af3..29734c1be 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java @@ -2,11 +2,11 @@ package com.gmail.nossr50.commands.player; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.skills.SuperAbilityType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.scoreboards.ScoreboardManager; +import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java index 814811daa..abcea5284 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java @@ -2,11 +2,11 @@ package com.gmail.nossr50.commands.player; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.runnables.commands.McrankCommandAsyncTask; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.runnables.commands.McrankCommandAsyncTask; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java index a53e92f21..3a7bc321e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.player; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.scoreboards.ScoreboardManager; +import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java index 93de2eb1a..fd53d54bf 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java @@ -2,13 +2,13 @@ package com.gmail.nossr50.commands.player; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.runnables.commands.MctopCommandAsyncTask; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.StringUtils; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.runnables.commands.MctopCommandAsyncTask; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.StringUtils; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java index 0913fd400..c6cf8b0f4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.listeners.InteractionManager; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.TextComponentFactory; -import com.gmail.nossr50.util.random.RandomChanceSkill; -import com.gmail.nossr50.util.random.RandomChanceUtil; -import com.gmail.nossr50.util.skills.SkillActivationType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.TextComponentFactory; +import com.gmail.nossr50.core.util.random.RandomChanceSkill; +import com.gmail.nossr50.core.util.random.RandomChanceUtil; +import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AlchemyCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AlchemyCommand.java index 4692742fc..c5d0da343 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AlchemyCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AlchemyCommand.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.skills.alchemy.AlchemyManager; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.TextComponentFactory; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyManager; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.RankUtils; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AprilCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AprilCommand.java index 294839b9e..54863cd3c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AprilCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AprilCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.HolidayManager.FakeSkillType; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.StringUtils; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.HolidayManager.FakeSkillType; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.StringUtils; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java index ebb7411cf..94ceca20f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.skills.archery.Archery; -import com.gmail.nossr50.util.TextComponentFactory; -import com.gmail.nossr50.util.skills.SkillActivationType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.primary.archery.Archery; +import com.gmail.nossr50.core.util.TextComponentFactory; +import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java index fd45671aa..160d52d64 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.skills.axes.Axes; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.TextComponentFactory; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.primary.axes.Axes; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java index 43e5a3500..c502553e7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.TextComponentFactory; -import com.gmail.nossr50.util.skills.RankUtils; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.TextComponentFactory; +import com.gmail.nossr50.core.util.skills.RankUtils; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java index 996bc5e0b..ba150f6f0 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java @@ -2,17 +2,17 @@ package com.gmail.nossr50.commands.skills; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.treasure.TreasureConfig; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.treasure.Rarity; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.skills.fishing.Fishing; -import com.gmail.nossr50.skills.fishing.FishingManager; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.TextComponentFactory; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.treasure.Rarity; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.primary.fishing.Fishing; +import com.gmail.nossr50.core.skills.primary.fishing.FishingManager; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.random.RandomChanceUtil; -import com.gmail.nossr50.util.skills.RankUtils; +import com.gmail.nossr50.core.util.random.RandomChanceUtil; +import com.gmail.nossr50.core.util.skills.RankUtils; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.Location; import org.bukkit.entity.EntityType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java index d788de937..54d49dcce 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.TextComponentFactory; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.TextComponentFactory; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.Material; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java index 16bf12c3f..2ae4fe8dd 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.skills.mining.MiningManager; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.TextComponentFactory; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.primary.mining.MiningManager; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java index 54cf7b915..3883f797e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.listeners.InteractionManager; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.TextComponentFactory; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.TextComponentFactory; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java index 0a5cb9dc3..049823e35 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java @@ -1,19 +1,19 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.datatypes.skills.MaterialType; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.MaterialType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.repair.ArcaneForging; -import com.gmail.nossr50.skills.repair.Repair; -import com.gmail.nossr50.skills.repair.RepairManager; -import com.gmail.nossr50.skills.repair.repairables.Repairable; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.TextComponentFactory; +import com.gmail.nossr50.core.skills.primary.repair.ArcaneForging; +import com.gmail.nossr50.core.skills.primary.repair.Repair; +import com.gmail.nossr50.core.skills.primary.repair.RepairManager; +import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.Material; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java index 4b11c0039..1c5b03f6a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.skills.salvage.Salvage; -import com.gmail.nossr50.skills.salvage.SalvageManager; -import com.gmail.nossr50.util.TextComponentFactory; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.child.salvage.Salvage; +import com.gmail.nossr50.core.skills.child.salvage.SalvageManager; +import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.RankUtils; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java index c907b2d74..d12a2f1cf 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java @@ -3,20 +3,20 @@ package com.gmail.nossr50.commands.skills; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.skills.child.FamilyTree; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.StringUtils; -import com.gmail.nossr50.util.TextComponentFactory; -import com.gmail.nossr50.util.commands.CommandUtils; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.child.FamilyTree; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.StringUtils; +import com.gmail.nossr50.core.util.TextComponentFactory; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.random.RandomChanceUtil; -import com.gmail.nossr50.util.scoreboards.ScoreboardManager; -import com.gmail.nossr50.util.skills.PerksUtils; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; +import com.gmail.nossr50.core.util.random.RandomChanceUtil; +import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; +import com.gmail.nossr50.core.util.skills.PerksUtils; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; import com.google.common.collect.ImmutableList; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.chat.TextComponent; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillGuideCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillGuideCommand.java index ed7d7152e..7b1280c4a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillGuideCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillGuideCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.StringUtils; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.StringUtils; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java index e53afc4e4..d01ae1ebc 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.skills.smelting.Smelting; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.TextComponentFactory; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.child.smelting.Smelting; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java index 2c413c4f7..7133d440a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.commands.skills; import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.TextComponentFactory; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java index 69a142348..23fe7406f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.skills.taming.Taming; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.TextComponentFactory; -import com.gmail.nossr50.util.skills.SkillActivationType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.primary.taming.Taming; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.TextComponentFactory; +import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java index 1fa09d0db..30f3ebb0a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.TextComponentFactory; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java index 4428181ba..0d55831f7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.TextComponentFactory; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.TextComponentFactory; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java index c9cc14e2e..855d4eadc 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.events.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelChangeEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelChangeEvent.java index b9ffc9598..316c1c6d4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelChangeEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelChangeEvent.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.events.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import org.bukkit.entity.Player; /** diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelDownEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelDownEvent.java index 1f03196d6..515d53314 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelDownEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelDownEvent.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.events.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java index d51bc5569..dc3cf393a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.events.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerXpGainEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerXpGainEvent.java index 553bfcca5..2116c7948 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerXpGainEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerXpGainEvent.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.events.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java index 03598dc24..96f1ceb4e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.skills; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityActivateEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityActivateEvent.java index 51845ae66..baf52c70f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityActivateEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityActivateEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.skills.abilities; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityDeactivateEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityDeactivateEvent.java index df03a14ec..b2f85065e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityDeactivateEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityDeactivateEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.skills.abilities; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import org.bukkit.entity.Player; public class McMMOPlayerAbilityDeactivateEvent extends McMMOPlayerAbilityEvent { diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityEvent.java index 39c7054dc..b082af019 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityEvent.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.events.skills.abilities; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerBrewEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerBrewEvent.java index a44a266c7..f240b10e6 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerBrewEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerBrewEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.skills.alchemy; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; import org.bukkit.block.Block; import org.bukkit.block.BlockState; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerCatalysisEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerCatalysisEvent.java index e779dd8de..0afe839bb 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerCatalysisEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerCatalysisEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.skills.alchemy; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerFishingEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerFishingEvent.java index c24c12b6a..215627eb5 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerFishingEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerFishingEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.skills.fishing; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/repair/McMMOPlayerRepairCheckEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/repair/McMMOPlayerRepairCheckEvent.java index 9b0f94866..9cd0733a7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/repair/McMMOPlayerRepairCheckEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/repair/McMMOPlayerRepairCheckEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.skills.repair; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java index 172f3bc66..a1a6567e9 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.skills.salvage; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java index a94deef33..3454c9826 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.events.skills.secondaryabilities; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java index c158ab653..00073617f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.events.skills.secondaryabilities; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; import org.bukkit.entity.Player; public class SubSkillRandomCheckEvent extends SubSkillEvent { diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/unarmed/McMMOPlayerDisarmEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/unarmed/McMMOPlayerDisarmEvent.java index 4452c2f19..c363f2c78 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/unarmed/McMMOPlayerDisarmEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/unarmed/McMMOPlayerDisarmEvent.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.events.skills.unarmed; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index 3e5f96cd4..7ff911060 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -5,30 +5,30 @@ import com.gmail.nossr50.core.config.skills.HiddenConfig; import com.gmail.nossr50.core.config.skills.WorldBlacklist; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; -import com.gmail.nossr50.core.datatypes.skills.ToolType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SuperAbilityType; +import com.gmail.nossr50.core.skills.ToolType; import com.gmail.nossr50.events.fake.FakeBlockBreakEvent; import com.gmail.nossr50.events.fake.FakeBlockDamageEvent; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.alchemy.Alchemy; -import com.gmail.nossr50.skills.excavation.ExcavationManager; -import com.gmail.nossr50.skills.herbalism.Herbalism; -import com.gmail.nossr50.skills.herbalism.HerbalismManager; -import com.gmail.nossr50.skills.mining.MiningManager; -import com.gmail.nossr50.skills.repair.Repair; -import com.gmail.nossr50.skills.salvage.Salvage; -import com.gmail.nossr50.skills.woodcutting.WoodcuttingManager; -import com.gmail.nossr50.util.BlockUtils; -import com.gmail.nossr50.util.EventUtils; -import com.gmail.nossr50.util.ItemUtils; -import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy; +import com.gmail.nossr50.core.skills.primary.excavation.ExcavationManager; +import com.gmail.nossr50.core.skills.primary.herbalism.Herbalism; +import com.gmail.nossr50.core.skills.primary.herbalism.HerbalismManager; +import com.gmail.nossr50.core.skills.primary.mining.MiningManager; +import com.gmail.nossr50.core.skills.primary.repair.Repair; +import com.gmail.nossr50.core.skills.child.salvage.Salvage; +import com.gmail.nossr50.core.skills.primary.woodcutting.WoodcuttingManager; +import com.gmail.nossr50.core.util.BlockUtils; +import com.gmail.nossr50.core.util.EventUtils; +import com.gmail.nossr50.core.util.ItemUtils; +import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.skills.SkillUtils; -import com.gmail.nossr50.util.sounds.SoundManager; -import com.gmail.nossr50.util.sounds.SoundType; -import com.gmail.nossr50.worldguard.WorldGuardManager; -import com.gmail.nossr50.worldguard.WorldGuardUtils; +import com.gmail.nossr50.core.util.skills.SkillUtils; +import com.gmail.nossr50.core.util.sounds.SoundManager; +import com.gmail.nossr50.core.util.sounds.SoundType; +import com.gmail.nossr50.core.worldguard.WorldGuardManager; +import com.gmail.nossr50.core.worldguard.WorldGuardUtils; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 20e757954..5ee64bf7c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -6,26 +6,26 @@ import com.gmail.nossr50.core.config.skills.WorldBlacklist; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.meta.OldName; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.InteractType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.subskills.interfaces.InteractType; import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent; import com.gmail.nossr50.events.fake.FakeEntityDamageEvent; import com.gmail.nossr50.events.fake.FakeEntityTameEvent; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.skills.archery.Archery; -import com.gmail.nossr50.skills.fishing.Fishing; -import com.gmail.nossr50.skills.mining.BlastMining; -import com.gmail.nossr50.skills.mining.MiningManager; -import com.gmail.nossr50.skills.taming.Taming; -import com.gmail.nossr50.skills.taming.TamingManager; -import com.gmail.nossr50.util.BlockUtils; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.core.party.PartyManager; +import com.gmail.nossr50.core.skills.primary.archery.Archery; +import com.gmail.nossr50.core.skills.primary.fishing.Fishing; +import com.gmail.nossr50.core.skills.primary.mining.BlastMining; +import com.gmail.nossr50.core.skills.primary.mining.MiningManager; +import com.gmail.nossr50.core.skills.primary.taming.Taming; +import com.gmail.nossr50.core.skills.primary.taming.TamingManager; +import com.gmail.nossr50.core.util.BlockUtils; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.skills.CombatUtils; -import com.gmail.nossr50.worldguard.WorldGuardManager; -import com.gmail.nossr50.worldguard.WorldGuardUtils; +import com.gmail.nossr50.core.util.skills.CombatUtils; +import com.gmail.nossr50.core.worldguard.WorldGuardManager; +import com.gmail.nossr50.core.worldguard.WorldGuardUtils; import org.bukkit.Material; import org.bukkit.OfflinePlayer; import org.bukkit.block.Block; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java index 17542c9db..71d8d6486 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.listeners; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; -import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.InteractType; -import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.Interaction; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.skills.subskills.interfaces.InteractType; +import com.gmail.nossr50.core.skills.subskills.interfaces.Interaction; import com.gmail.nossr50.mcMMO; import org.bukkit.event.Event; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java index e6fa90c40..3f856fb75 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java @@ -2,19 +2,19 @@ package com.gmail.nossr50.listeners; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.skills.WorldBlacklist; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.events.fake.FakeBrewEvent; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.runnables.player.PlayerUpdateInventoryTask; -import com.gmail.nossr50.skills.alchemy.Alchemy; -import com.gmail.nossr50.skills.alchemy.AlchemyPotionBrewer; -import com.gmail.nossr50.util.ItemUtils; -import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.core.runnables.player.PlayerUpdateInventoryTask; +import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy; +import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyPotionBrewer; +import com.gmail.nossr50.core.util.ItemUtils; +import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.skills.SkillUtils; -import com.gmail.nossr50.worldguard.WorldGuardManager; -import com.gmail.nossr50.worldguard.WorldGuardUtils; +import com.gmail.nossr50.core.util.skills.SkillUtils; +import com.gmail.nossr50.core.worldguard.WorldGuardManager; +import com.gmail.nossr50.core.worldguard.WorldGuardUtils; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index fa9f2e564..9a15cf63d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -1,34 +1,35 @@ package com.gmail.nossr50.listeners; -import com.gmail.nossr50.chat.ChatManager; -import com.gmail.nossr50.chat.ChatManagerFactory; -import com.gmail.nossr50.chat.PartyChatManager; +import com.gmail.nossr50.core.chat.ChatManager; +import com.gmail.nossr50.core.chat.ChatManagerFactory; +import com.gmail.nossr50.core.chat.PartyChatManager; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.skills.WorldBlacklist; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.*; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.party.ShareHandler; -import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask; -import com.gmail.nossr50.skills.fishing.FishingManager; -import com.gmail.nossr50.skills.herbalism.HerbalismManager; -import com.gmail.nossr50.skills.mining.MiningManager; -import com.gmail.nossr50.skills.repair.Repair; -import com.gmail.nossr50.skills.repair.RepairManager; -import com.gmail.nossr50.skills.salvage.Salvage; -import com.gmail.nossr50.skills.salvage.SalvageManager; -import com.gmail.nossr50.skills.taming.TamingManager; +import com.gmail.nossr50.core.party.ShareHandler; +import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask; +import com.gmail.nossr50.core.skills.primary.fishing.FishingManager; +import com.gmail.nossr50.core.skills.primary.herbalism.HerbalismManager; +import com.gmail.nossr50.core.skills.primary.mining.MiningManager; +import com.gmail.nossr50.core.skills.primary.repair.Repair; +import com.gmail.nossr50.core.skills.primary.repair.RepairManager; +import com.gmail.nossr50.core.skills.child.salvage.Salvage; +import com.gmail.nossr50.core.skills.child.salvage.SalvageManager; +import com.gmail.nossr50.core.skills.primary.taming.TamingManager; import com.gmail.nossr50.util.*; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.skills.SkillUtils; -import com.gmail.nossr50.util.sounds.SoundManager; -import com.gmail.nossr50.util.sounds.SoundType; -import com.gmail.nossr50.worldguard.WorldGuardManager; -import com.gmail.nossr50.worldguard.WorldGuardUtils; +import com.gmail.nossr50.core.util.skills.SkillUtils; +import com.gmail.nossr50.core.util.sounds.SoundManager; +import com.gmail.nossr50.core.util.sounds.SoundType; +import com.gmail.nossr50.core.worldguard.WorldGuardManager; +import com.gmail.nossr50.core.worldguard.WorldGuardUtils; import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.block.Block; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java index f2cc07c73..9b098a83f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java @@ -4,15 +4,15 @@ import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent; import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent; import com.gmail.nossr50.events.skills.abilities.McMMOPlayerAbilityActivateEvent; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.scoreboards.ScoreboardManager; -import com.gmail.nossr50.worldguard.WorldGuardManager; -import com.gmail.nossr50.worldguard.WorldGuardUtils; +import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; +import com.gmail.nossr50.core.worldguard.WorldGuardManager; +import com.gmail.nossr50.core.worldguard.WorldGuardUtils; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; diff --git a/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java b/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java index 1a06cec8c..e97d1b573 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java @@ -12,37 +12,38 @@ import com.gmail.nossr50.core.config.treasure.TreasureConfig; import com.gmail.nossr50.core.config.skills.*; import com.gmail.nossr50.core.data.database.DatabaseManager; import com.gmail.nossr50.core.data.database.DatabaseManagerFactory; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.subskills.acrobatics.Roll; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.subskills.acrobatics.Roll; +import com.gmail.nossr50.core.util.*; import com.gmail.nossr50.listeners.*; -import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.runnables.CheckDateTask; -import com.gmail.nossr50.runnables.SaveTimerTask; -import com.gmail.nossr50.runnables.backups.CleanBackupsTask; -import com.gmail.nossr50.runnables.database.UserPurgeTask; -import com.gmail.nossr50.runnables.party.PartyAutoKickTask; -import com.gmail.nossr50.runnables.player.ClearRegisteredXPGainTask; -import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask; -import com.gmail.nossr50.runnables.player.PowerLevelUpdatingTask; -import com.gmail.nossr50.runnables.skills.BleedTimerTask; -import com.gmail.nossr50.skills.alchemy.Alchemy; -import com.gmail.nossr50.skills.child.ChildConfig; -import com.gmail.nossr50.skills.repair.repairables.Repairable; -import com.gmail.nossr50.skills.repair.repairables.RepairableManager; -import com.gmail.nossr50.skills.repair.repairables.SimpleRepairableManager; -import com.gmail.nossr50.skills.salvage.salvageables.Salvageable; -import com.gmail.nossr50.skills.salvage.salvageables.SalvageableManager; -import com.gmail.nossr50.skills.salvage.salvageables.SimpleSalvageableManager; +import com.gmail.nossr50.core.party.PartyManager; +import com.gmail.nossr50.core.runnables.CheckDateTask; +import com.gmail.nossr50.core.runnables.SaveTimerTask; +import com.gmail.nossr50.core.runnables.backups.CleanBackupsTask; +import com.gmail.nossr50.core.runnables.database.UserPurgeTask; +import com.gmail.nossr50.core.runnables.party.PartyAutoKickTask; +import com.gmail.nossr50.core.runnables.player.ClearRegisteredXPGainTask; +import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask; +import com.gmail.nossr50.core.runnables.player.PowerLevelUpdatingTask; +import com.gmail.nossr50.core.runnables.skills.BleedTimerTask; +import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy; +import com.gmail.nossr50.core.skills.child.ChildConfig; +import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; +import com.gmail.nossr50.core.skills.primary.repair.repairables.RepairableManager; +import com.gmail.nossr50.core.skills.primary.repair.repairables.SimpleRepairableManager; +import com.gmail.nossr50.core.skills.child.salvage.salvageables.Salvageable; +import com.gmail.nossr50.core.skills.child.salvage.salvageables.SalvageableManager; +import com.gmail.nossr50.core.skills.child.salvage.salvageables.SimpleSalvageableManager; import com.gmail.nossr50.util.*; import com.gmail.nossr50.core.data.blockmeta.chunkmeta.ChunkManager; import com.gmail.nossr50.core.data.blockmeta.chunkmeta.ChunkManagerFactory; -import com.gmail.nossr50.util.commands.CommandRegistrationManager; -import com.gmail.nossr50.util.experience.FormulaManager; +import com.gmail.nossr50.core.util.commands.CommandRegistrationManager; +import com.gmail.nossr50.core.util.experience.FormulaManager; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.scoreboards.ScoreboardManager; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.upgrade.UpgradeManager; -import com.gmail.nossr50.worldguard.WorldGuardManager; +import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.upgrade.UpgradeManager; +import com.gmail.nossr50.core.worldguard.WorldGuardManager; import com.google.common.base.Charsets; import net.shatteredlands.shatt.backup.ZipLibrary; import org.bstats.bukkit.Metrics; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/mining/Mining.java b/bukkit/src/main/java/com/gmail/nossr50/skills/mining/Mining.java deleted file mode 100644 index cd805062c..000000000 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/mining/Mining.java +++ /dev/null @@ -1,167 +0,0 @@ -package com.gmail.nossr50.skills.mining; - -import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Misc; -import org.bukkit.Material; -import org.bukkit.block.BlockState; -import org.bukkit.inventory.ItemStack; - -public class Mining { - - /** - * Calculate XP gain for Mining. - * - * @param blockState The {@link BlockState} to check ability activation for - */ - public static int getBlockXp(BlockState blockState) { - int xp = ExperienceConfig.getInstance().getXp(PrimarySkillType.MINING, blockState.getType()); - - if (xp == 0 && mcMMO.getModManager().isCustomMiningBlock(blockState)) { - xp = mcMMO.getModManager().getBlock(blockState).getXpGain(); - } - - return xp; - } - - /** - * Handle double drops when using Silk Touch. - * - * @param blockState The {@link BlockState} to check ability activation for - */ - protected static void handleSilkTouchDrops(BlockState blockState) { - Material blockType = blockState.getType(); - - switch (blockType) { - case END_STONE: - case TERRACOTTA: - case CLAY: - case IRON_ORE: - case MOSSY_COBBLESTONE: - case NETHERRACK: - case OBSIDIAN: - case SANDSTONE: - case BLACK_GLAZED_TERRACOTTA: - case BLACK_TERRACOTTA: - case BLUE_GLAZED_TERRACOTTA: - case BLUE_TERRACOTTA: - case BROWN_GLAZED_TERRACOTTA: - case BROWN_TERRACOTTA: - case CYAN_GLAZED_TERRACOTTA: - case CYAN_TERRACOTTA: - case GRAY_GLAZED_TERRACOTTA: - case GRAY_TERRACOTTA: - case GREEN_GLAZED_TERRACOTTA: - case GREEN_TERRACOTTA: - case LIGHT_BLUE_GLAZED_TERRACOTTA: - case LIGHT_BLUE_TERRACOTTA: - case LIGHT_GRAY_GLAZED_TERRACOTTA: - case LIGHT_GRAY_TERRACOTTA: - case LIME_GLAZED_TERRACOTTA: - case LIME_TERRACOTTA: - case MAGENTA_GLAZED_TERRACOTTA: - case MAGENTA_TERRACOTTA: - case ORANGE_GLAZED_TERRACOTTA: - case ORANGE_TERRACOTTA: - case PINK_GLAZED_TERRACOTTA: - case PINK_TERRACOTTA: - case PURPLE_GLAZED_TERRACOTTA: - case PURPLE_TERRACOTTA: - case RED_GLAZED_TERRACOTTA: - case RED_TERRACOTTA: - case WHITE_GLAZED_TERRACOTTA: - case WHITE_TERRACOTTA: - case YELLOW_GLAZED_TERRACOTTA: - case YELLOW_TERRACOTTA: - handleMiningDrops(blockState); - return; - - case COAL_ORE: - case DIAMOND_ORE: - case EMERALD_ORE: - case GLOWSTONE: - case LAPIS_ORE: - case PACKED_ICE: - case NETHER_QUARTZ_ORE: - case REDSTONE_ORE: - case STONE: - case PRISMARINE: - Misc.dropItem(Misc.getBlockCenter(blockState), new ItemStack(blockState.getType())); - return; - - default: - if (mcMMO.getModManager().isCustomMiningBlock(blockState)) { - Misc.dropItem(Misc.getBlockCenter(blockState), new ItemStack(blockState.getType())); - } - return; - } - } - - /** - * Handle double drops from Mining & Blast Mining. - * - * @param blockState The {@link BlockState} to check ability activation for - */ - protected static void handleMiningDrops(BlockState blockState) { - switch (blockState.getType()) { - case COAL_ORE: - case DIAMOND_ORE: - case EMERALD_ORE: - case END_STONE: - case GLOWSTONE: - case GOLD_ORE: - case TERRACOTTA: - case IRON_ORE: - case LAPIS_ORE: - case MOSSY_COBBLESTONE: - case NETHERRACK: - case OBSIDIAN: - case PACKED_ICE: - case REDSTONE_ORE: - case SANDSTONE: - case BLACK_GLAZED_TERRACOTTA: - case BLACK_TERRACOTTA: - case BLUE_GLAZED_TERRACOTTA: - case BLUE_TERRACOTTA: - case BROWN_GLAZED_TERRACOTTA: - case BROWN_TERRACOTTA: - case CYAN_GLAZED_TERRACOTTA: - case CYAN_TERRACOTTA: - case GRAY_GLAZED_TERRACOTTA: - case GRAY_TERRACOTTA: - case GREEN_GLAZED_TERRACOTTA: - case GREEN_TERRACOTTA: - case LIGHT_BLUE_GLAZED_TERRACOTTA: - case LIGHT_BLUE_TERRACOTTA: - case LIGHT_GRAY_GLAZED_TERRACOTTA: - case LIGHT_GRAY_TERRACOTTA: - case LIME_GLAZED_TERRACOTTA: - case LIME_TERRACOTTA: - case MAGENTA_GLAZED_TERRACOTTA: - case MAGENTA_TERRACOTTA: - case ORANGE_GLAZED_TERRACOTTA: - case ORANGE_TERRACOTTA: - case PINK_GLAZED_TERRACOTTA: - case PINK_TERRACOTTA: - case PURPLE_GLAZED_TERRACOTTA: - case PURPLE_TERRACOTTA: - case RED_GLAZED_TERRACOTTA: - case RED_TERRACOTTA: - case WHITE_GLAZED_TERRACOTTA: - case WHITE_TERRACOTTA: - case YELLOW_GLAZED_TERRACOTTA: - case YELLOW_TERRACOTTA: - case STONE: - case NETHER_QUARTZ_ORE: - Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops()); - return; - - default: - if (mcMMO.getModManager().isCustomMiningBlock(blockState)) { - Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops()); - } - return; - } - } -} diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/MaterialUtils.java b/bukkit/src/main/java/com/gmail/nossr50/util/MaterialUtils.java deleted file mode 100644 index 8951a098a..000000000 --- a/bukkit/src/main/java/com/gmail/nossr50/util/MaterialUtils.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.gmail.nossr50.util; - -import com.gmail.nossr50.mcMMO; -import org.bukkit.Material; - -public final class MaterialUtils { - private MaterialUtils() {} - - protected static boolean isOre(Material data) { - switch (data) { - case COAL_ORE: - case DIAMOND_ORE: - case NETHER_QUARTZ_ORE: - case GOLD_ORE: - case IRON_ORE: - case LAPIS_ORE: - case REDSTONE_ORE: - case EMERALD_ORE: - return true; - default: - return mcMMO.getModManager().isCustomOre(data); - } - } -} diff --git a/bukkit/src/main/java/com/gmail/nossr50/api/AbilityAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/AbilityAPI.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/api/AbilityAPI.java rename to core/src/main/java/com/gmail/nossr50/core/api/AbilityAPI.java index 9013f7652..fb66dc2a6 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/api/AbilityAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/AbilityAPI.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.api; +package com.gmail.nossr50.core.api; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.runnables.skills.BleedTimerTask; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.LivingEntity; diff --git a/bukkit/src/main/java/com/gmail/nossr50/api/ChatAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/ChatAPI.java similarity index 99% rename from bukkit/src/main/java/com/gmail/nossr50/api/ChatAPI.java rename to core/src/main/java/com/gmail/nossr50/core/api/ChatAPI.java index 042305654..58b6ca907 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/api/ChatAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/ChatAPI.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.api; +package com.gmail.nossr50.core.api; import com.gmail.nossr50.chat.ChatManager; import com.gmail.nossr50.chat.ChatManagerFactory; diff --git a/bukkit/src/main/java/com/gmail/nossr50/api/ExperienceAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java similarity index 99% rename from bukkit/src/main/java/com/gmail/nossr50/api/ExperienceAPI.java rename to core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java index 36d1deeef..fa20f3215 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/api/ExperienceAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java @@ -1,6 +1,7 @@ -package com.gmail.nossr50.api; +package com.gmail.nossr50.core.api; import com.gmail.nossr50.api.exceptions.*; +import com.gmail.nossr50.core.api.exceptions.*; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.experience.FormulaType; @@ -8,7 +9,7 @@ import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.child.FamilyTree; import com.gmail.nossr50.core.data.UserManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/api/PartyAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java similarity index 99% rename from bukkit/src/main/java/com/gmail/nossr50/api/PartyAPI.java rename to core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java index fb5964472..ae0da4952 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/api/PartyAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.api; +package com.gmail.nossr50.core.api; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/api/SkillAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/SkillAPI.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/api/SkillAPI.java rename to core/src/main/java/com/gmail/nossr50/core/api/SkillAPI.java index 720421ea2..53a7eb5d1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/api/SkillAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/SkillAPI.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.api; +package com.gmail.nossr50.core.api; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import java.util.ArrayList; import java.util.Arrays; diff --git a/bukkit/src/main/java/com/gmail/nossr50/api/exceptions/InvalidFormulaTypeException.java b/core/src/main/java/com/gmail/nossr50/core/api/exceptions/InvalidFormulaTypeException.java similarity index 83% rename from bukkit/src/main/java/com/gmail/nossr50/api/exceptions/InvalidFormulaTypeException.java rename to core/src/main/java/com/gmail/nossr50/core/api/exceptions/InvalidFormulaTypeException.java index c46332b99..5a19d5f5f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/api/exceptions/InvalidFormulaTypeException.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/exceptions/InvalidFormulaTypeException.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.api.exceptions; +package com.gmail.nossr50.core.api.exceptions; public class InvalidFormulaTypeException extends RuntimeException { private static final long serialVersionUID = 3368670229490121886L; diff --git a/bukkit/src/main/java/com/gmail/nossr50/api/exceptions/InvalidPlayerException.java b/core/src/main/java/com/gmail/nossr50/core/api/exceptions/InvalidPlayerException.java similarity index 83% rename from bukkit/src/main/java/com/gmail/nossr50/api/exceptions/InvalidPlayerException.java rename to core/src/main/java/com/gmail/nossr50/core/api/exceptions/InvalidPlayerException.java index 47d065e4a..7a915276f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/api/exceptions/InvalidPlayerException.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/exceptions/InvalidPlayerException.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.api.exceptions; +package com.gmail.nossr50.core.api.exceptions; public class InvalidPlayerException extends RuntimeException { private static final long serialVersionUID = 907213002618581385L; diff --git a/bukkit/src/main/java/com/gmail/nossr50/api/exceptions/InvalidSkillException.java b/core/src/main/java/com/gmail/nossr50/core/api/exceptions/InvalidSkillException.java similarity index 82% rename from bukkit/src/main/java/com/gmail/nossr50/api/exceptions/InvalidSkillException.java rename to core/src/main/java/com/gmail/nossr50/core/api/exceptions/InvalidSkillException.java index f94207a41..a6b63d675 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/api/exceptions/InvalidSkillException.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/exceptions/InvalidSkillException.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.api.exceptions; +package com.gmail.nossr50.core.api.exceptions; public class InvalidSkillException extends RuntimeException { private static final long serialVersionUID = 942705284195791157L; diff --git a/bukkit/src/main/java/com/gmail/nossr50/api/exceptions/InvalidXPGainReasonException.java b/core/src/main/java/com/gmail/nossr50/core/api/exceptions/InvalidXPGainReasonException.java similarity index 83% rename from bukkit/src/main/java/com/gmail/nossr50/api/exceptions/InvalidXPGainReasonException.java rename to core/src/main/java/com/gmail/nossr50/core/api/exceptions/InvalidXPGainReasonException.java index b2c1232b2..944693fed 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/api/exceptions/InvalidXPGainReasonException.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/exceptions/InvalidXPGainReasonException.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.api.exceptions; +package com.gmail.nossr50.core.api.exceptions; public class InvalidXPGainReasonException extends RuntimeException { private static final long serialVersionUID = 4427052841957931157L; diff --git a/bukkit/src/main/java/com/gmail/nossr50/api/exceptions/McMMOPlayerNotFoundException.java b/core/src/main/java/com/gmail/nossr50/core/api/exceptions/McMMOPlayerNotFoundException.java similarity index 88% rename from bukkit/src/main/java/com/gmail/nossr50/api/exceptions/McMMOPlayerNotFoundException.java rename to core/src/main/java/com/gmail/nossr50/core/api/exceptions/McMMOPlayerNotFoundException.java index d087631cd..cff599a11 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/api/exceptions/McMMOPlayerNotFoundException.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/exceptions/McMMOPlayerNotFoundException.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.api.exceptions; +package com.gmail.nossr50.core.api.exceptions; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/chat/AdminChatManager.java b/core/src/main/java/com/gmail/nossr50/core/chat/AdminChatManager.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/chat/AdminChatManager.java rename to core/src/main/java/com/gmail/nossr50/core/chat/AdminChatManager.java index e7ebbfd7f..3f85f66b8 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/chat/AdminChatManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/chat/AdminChatManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.chat; +package com.gmail.nossr50.core.chat; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.events.chat.McMMOAdminChatEvent; diff --git a/bukkit/src/main/java/com/gmail/nossr50/chat/ChatManager.java b/core/src/main/java/com/gmail/nossr50/core/chat/ChatManager.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/chat/ChatManager.java rename to core/src/main/java/com/gmail/nossr50/core/chat/ChatManager.java index 5c77e9a12..2cc23d292 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/chat/ChatManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/chat/ChatManager.java @@ -1,9 +1,9 @@ -package com.gmail.nossr50.chat; +package com.gmail.nossr50.core.chat; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.events.chat.McMMOChatEvent; import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; diff --git a/bukkit/src/main/java/com/gmail/nossr50/chat/ChatManagerFactory.java b/core/src/main/java/com/gmail/nossr50/core/chat/ChatManagerFactory.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/chat/ChatManagerFactory.java rename to core/src/main/java/com/gmail/nossr50/core/chat/ChatManagerFactory.java index bf476ea5a..69bc0e99a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/chat/ChatManagerFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/chat/ChatManagerFactory.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.chat; +package com.gmail.nossr50.core.chat; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import org.bukkit.plugin.Plugin; diff --git a/bukkit/src/main/java/com/gmail/nossr50/chat/PartyChatManager.java b/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java similarity index 90% rename from bukkit/src/main/java/com/gmail/nossr50/chat/PartyChatManager.java rename to core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java index 271fcb3db..5c79f2687 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/chat/PartyChatManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java @@ -1,9 +1,9 @@ -package com.gmail.nossr50.chat; +package com.gmail.nossr50.core.chat; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; -import com.gmail.nossr50.runnables.party.PartyChatTask; +import com.gmail.nossr50.core.runnables.party.PartyChatTask; import org.bukkit.plugin.Plugin; public class PartyChatManager extends ChatManager { diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java index 18138d08d..1cb41005f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.datatypes.experience; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import java.util.concurrent.Delayed; import java.util.concurrent.TimeUnit; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java index a54450686..6212d8fc1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java @@ -8,12 +8,12 @@ import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.mods.CustomTool; import com.gmail.nossr50.core.datatypes.party.Party; -import com.gmail.nossr50.core.datatypes.skills.ToolType; +import com.gmail.nossr50.core.skills.ToolType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.party.PartyManager; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java index e02db264e..8dd1013a5 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java @@ -5,9 +5,9 @@ import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.datatypes.experience.SkillXpGain; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; -import com.gmail.nossr50.core.datatypes.MobHealthbarType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SuperAbilityType; +import com.gmail.nossr50.core.skills.MobHealthbarType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.player.PlayerProfileSaveTask; import com.gmail.nossr50.skills.child.FamilyTree; diff --git a/bukkit/src/main/java/com/gmail/nossr50/locale/LocaleLoader.java b/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java similarity index 99% rename from bukkit/src/main/java/com/gmail/nossr50/locale/LocaleLoader.java rename to core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java index 0b75cadb7..f5a9e46a7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/locale/LocaleLoader.java +++ b/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.locale; +package com.gmail.nossr50.core.locale; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.mcMMO; diff --git a/bukkit/src/main/java/com/gmail/nossr50/party/PartyManager.java b/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/party/PartyManager.java rename to core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java index 99f6437da..c7073a128 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/party/PartyManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.party; +package com.gmail.nossr50.core.party; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.chat.ChatMode; @@ -12,14 +12,14 @@ import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import com.gmail.nossr50.events.party.McMMOPartyAllianceChangeEvent; import com.gmail.nossr50.events.party.McMMOPartyChangeEvent; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.player.NotificationManager; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.player.NotificationManager; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.sounds.SoundManager; -import com.gmail.nossr50.util.sounds.SoundType; +import com.gmail.nossr50.core.util.sounds.SoundManager; +import com.gmail.nossr50.core.util.sounds.SoundType; import org.bukkit.OfflinePlayer; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/party/ShareHandler.java b/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/party/ShareHandler.java rename to core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java index d5db714c4..01d20a276 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/party/ShareHandler.java +++ b/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.party; +package com.gmail.nossr50.core.party; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.party.ItemWeightConfig; @@ -8,8 +8,8 @@ import com.gmail.nossr50.core.datatypes.party.ItemShareType; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.ShareMode; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.util.Misc; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Item; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/CheckDateTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/CheckDateTask.java similarity index 84% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/CheckDateTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/CheckDateTask.java index 0b296b4bd..2a796ed7d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/CheckDateTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/CheckDateTask.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.runnables; +package com.gmail.nossr50.core.runnables; +import com.gmail.nossr50.core.runnables.skills.AprilTask; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.runnables.skills.AprilTask; import com.gmail.nossr50.util.Misc; import org.bukkit.scheduler.BukkitRunnable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/MobHealthDisplayUpdaterTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/MobHealthDisplayUpdaterTask.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/MobHealthDisplayUpdaterTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/MobHealthDisplayUpdaterTask.java index a81cc21ed..4ea6db325 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/MobHealthDisplayUpdaterTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/MobHealthDisplayUpdaterTask.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.runnables; +package com.gmail.nossr50.core.runnables; import com.gmail.nossr50.mcMMO; import org.bukkit.entity.LivingEntity; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/PistonTrackerTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/PistonTrackerTask.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/PistonTrackerTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/PistonTrackerTask.java index 9f01d64e5..f9e4615d1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/PistonTrackerTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/PistonTrackerTask.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.runnables; +package com.gmail.nossr50.core.runnables; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.BlockUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/SaveTimerTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/SaveTimerTask.java similarity index 85% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/SaveTimerTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/SaveTimerTask.java index 62478590a..59bdc4357 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/SaveTimerTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/SaveTimerTask.java @@ -1,9 +1,9 @@ -package com.gmail.nossr50.runnables; +package com.gmail.nossr50.core.runnables; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.runnables.player.PlayerProfileSaveTask; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.runnables.player.PlayerProfileSaveTask; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.scheduler.BukkitRunnable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/StickyPistonTrackerTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/StickyPistonTrackerTask.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/StickyPistonTrackerTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/StickyPistonTrackerTask.java index 00062659b..d3f8d5e48 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/StickyPistonTrackerTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/StickyPistonTrackerTask.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.runnables; +package com.gmail.nossr50.core.runnables; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.BlockUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/backups/CleanBackupsTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/backups/CleanBackupsTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java index b307855b7..d7dddac84 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/backups/CleanBackupsTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.runnables.backups; +package com.gmail.nossr50.core.runnables.backups; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.mcMMO; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/McScoreboardKeepTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McScoreboardKeepTask.java similarity index 90% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/commands/McScoreboardKeepTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/commands/McScoreboardKeepTask.java index 5a318596f..7f42b6505 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/McScoreboardKeepTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McScoreboardKeepTask.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.runnables.commands; +package com.gmail.nossr50.core.runnables.commands; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/McrankCommandAsyncTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandAsyncTask.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/commands/McrankCommandAsyncTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandAsyncTask.java index 2f61e0cf0..50e3c074f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/McrankCommandAsyncTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandAsyncTask.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.runnables.commands; +package com.gmail.nossr50.core.runnables.commands; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import org.apache.commons.lang.Validate; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/McrankCommandDisplayTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java similarity index 93% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/commands/McrankCommandDisplayTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java index 9f55aa331..f474c8f35 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/McrankCommandDisplayTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java @@ -1,8 +1,8 @@ -package com.gmail.nossr50.runnables.commands; +package com.gmail.nossr50.core.runnables.commands; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandAsyncTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandAsyncTask.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandAsyncTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandAsyncTask.java index 7bccd7c50..214bb4e04 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandAsyncTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandAsyncTask.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.runnables.commands; +package com.gmail.nossr50.core.runnables.commands; import com.gmail.nossr50.core.datatypes.database.PlayerStat; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import org.apache.commons.lang.Validate; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandDisplayTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandDisplayTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java index 08a454d33..b0d95823d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandDisplayTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java @@ -1,9 +1,9 @@ -package com.gmail.nossr50.runnables.commands; +package com.gmail.nossr50.core.runnables.commands; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.database.PlayerStat; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import org.bukkit.ChatColor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/database/DatabaseConversionTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/database/DatabaseConversionTask.java similarity index 90% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/database/DatabaseConversionTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/database/DatabaseConversionTask.java index a9517b8af..2b0a30f71 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/database/DatabaseConversionTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/database/DatabaseConversionTask.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.runnables.database; +package com.gmail.nossr50.core.runnables.database; import com.gmail.nossr50.core.data.database.DatabaseManager; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import org.bukkit.command.CommandSender; import org.bukkit.scheduler.BukkitRunnable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/database/FormulaConversionTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/database/FormulaConversionTask.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/database/FormulaConversionTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/database/FormulaConversionTask.java index c70f872b1..87e11786f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/database/FormulaConversionTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/database/FormulaConversionTask.java @@ -1,12 +1,12 @@ -package com.gmail.nossr50.runnables.database; +package com.gmail.nossr50.core.runnables.database; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.data.database.DatabaseManager; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.core.data.UserManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/database/UUIDUpdateAsyncTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UUIDUpdateAsyncTask.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/database/UUIDUpdateAsyncTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/database/UUIDUpdateAsyncTask.java index 128afe88c..f13abc478 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/database/UUIDUpdateAsyncTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UUIDUpdateAsyncTask.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.runnables.database; +package com.gmail.nossr50.core.runnables.database; import com.gmail.nossr50.core.config.skills.HiddenConfig; import com.gmail.nossr50.core.data.database.DatabaseManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/database/UserPurgeTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java similarity index 91% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/database/UserPurgeTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java index ec8e4a92d..abecece74 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/database/UserPurgeTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.runnables.database; +package com.gmail.nossr50.core.runnables.database; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.mcMMO; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/items/ChimaeraWingWarmup.java b/core/src/main/java/com/gmail/nossr50/core/runnables/items/ChimaeraWingWarmup.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/items/ChimaeraWingWarmup.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/items/ChimaeraWingWarmup.java index 300259029..ca72fa38a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/items/ChimaeraWingWarmup.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/items/ChimaeraWingWarmup.java @@ -1,8 +1,8 @@ -package com.gmail.nossr50.runnables.items; +package com.gmail.nossr50.core.runnables.items; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.util.ChimaeraWing; import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.Misc; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/items/TeleportationWarmup.java b/core/src/main/java/com/gmail/nossr50/core/runnables/items/TeleportationWarmup.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/items/TeleportationWarmup.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/items/TeleportationWarmup.java index 13d725e90..9bd97f027 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/items/TeleportationWarmup.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/items/TeleportationWarmup.java @@ -1,8 +1,8 @@ -package com.gmail.nossr50.runnables.items; +package com.gmail.nossr50.core.runnables.items; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Misc; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/party/PartyAutoKickTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyAutoKickTask.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/party/PartyAutoKickTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyAutoKickTask.java index ecb54be46..4bdc5439e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/party/PartyAutoKickTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyAutoKickTask.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.runnables.party; +package com.gmail.nossr50.core.runnables.party; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.party.Party; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/party/PartyChatTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyChatTask.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/party/PartyChatTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyChatTask.java index ea515b5af..4bbd9c5f9 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/party/PartyChatTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyChatTask.java @@ -1,8 +1,8 @@ -package com.gmail.nossr50.runnables.party; +package com.gmail.nossr50.core.runnables.party; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.party.Party; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/player/ClearRegisteredXPGainTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/player/ClearRegisteredXPGainTask.java similarity index 89% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/player/ClearRegisteredXPGainTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/player/ClearRegisteredXPGainTask.java index 552e89940..3bd53222e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/player/ClearRegisteredXPGainTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/player/ClearRegisteredXPGainTask.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.runnables.player; +package com.gmail.nossr50.core.runnables.player; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.data.UserManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileLoadingTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileLoadingTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java index c212297bd..733790134 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileLoadingTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java @@ -1,11 +1,11 @@ -package com.gmail.nossr50.runnables.player; +package com.gmail.nossr50.core.runnables.player; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.runnables.commands.McScoreboardKeepTask; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.runnables.commands.McScoreboardKeepTask; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileSaveTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileSaveTask.java similarity index 89% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileSaveTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileSaveTask.java index d2b9e8388..65f01837e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileSaveTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileSaveTask.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.runnables.player; +package com.gmail.nossr50.core.runnables.player; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import org.bukkit.scheduler.BukkitRunnable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/player/PlayerUpdateInventoryTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerUpdateInventoryTask.java similarity index 88% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/player/PlayerUpdateInventoryTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerUpdateInventoryTask.java index d255eee2a..85835d946 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/player/PlayerUpdateInventoryTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerUpdateInventoryTask.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.runnables.player; +package com.gmail.nossr50.core.runnables.player; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/player/PowerLevelUpdatingTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PowerLevelUpdatingTask.java similarity index 86% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/player/PowerLevelUpdatingTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/player/PowerLevelUpdatingTask.java index 3f50bce89..dfe98f8cd 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/player/PowerLevelUpdatingTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PowerLevelUpdatingTask.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.runnables.player; +package com.gmail.nossr50.core.runnables.player; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import org.bukkit.scheduler.BukkitRunnable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AbilityCooldownTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityCooldownTask.java similarity index 89% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AbilityCooldownTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityCooldownTask.java index cd5592bfc..773bd3c8e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AbilityCooldownTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityCooldownTask.java @@ -1,8 +1,8 @@ -package com.gmail.nossr50.runnables.skills; +package com.gmail.nossr50.core.runnables.skills; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.util.player.NotificationManager; import org.bukkit.scheduler.BukkitRunnable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AbilityDisableTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityDisableTask.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AbilityDisableTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityDisableTask.java index 81c4415c3..fcd02db7f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AbilityDisableTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityDisableTask.java @@ -1,9 +1,9 @@ -package com.gmail.nossr50.runnables.skills; +package com.gmail.nossr50.core.runnables.skills; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Misc; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AlchemyBrewCheckTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewCheckTask.java similarity index 88% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AlchemyBrewCheckTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewCheckTask.java index 904aebc35..bcb0c712b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AlchemyBrewCheckTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewCheckTask.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.runnables.skills; +package com.gmail.nossr50.core.runnables.skills; -import com.gmail.nossr50.skills.alchemy.Alchemy; -import com.gmail.nossr50.skills.alchemy.AlchemyPotionBrewer; +import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy; +import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyPotionBrewer; import org.bukkit.Location; import org.bukkit.block.BrewingStand; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AlchemyBrewTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewTask.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AlchemyBrewTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewTask.java index fc07d6000..6b42e0f35 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AlchemyBrewTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewTask.java @@ -1,12 +1,12 @@ -package com.gmail.nossr50.runnables.skills; +package com.gmail.nossr50.core.runnables.skills; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.events.skills.alchemy.McMMOPlayerBrewEvent; import com.gmail.nossr50.events.skills.alchemy.McMMOPlayerCatalysisEvent; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.alchemy.Alchemy; -import com.gmail.nossr50.skills.alchemy.AlchemyPotionBrewer; +import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy; +import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyPotionBrewer; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.core.data.UserManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AprilTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AprilTask.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AprilTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/skills/AprilTask.java index b32fa4a87..65149ba3a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AprilTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AprilTask.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.runnables.skills; +package com.gmail.nossr50.core.runnables.skills; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.HolidayManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AwardCombatXpTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AwardCombatXpTask.java similarity index 93% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AwardCombatXpTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/skills/AwardCombatXpTask.java index 601fbc527..006d6c7b5 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/AwardCombatXpTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AwardCombatXpTask.java @@ -1,9 +1,9 @@ -package com.gmail.nossr50.runnables.skills; +package com.gmail.nossr50.core.runnables.skills; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import org.bukkit.entity.LivingEntity; import org.bukkit.scheduler.BukkitRunnable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/BleedContainer.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedContainer.java similarity index 90% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/skills/BleedContainer.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedContainer.java index 36f3a9022..ac4567afb 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/BleedContainer.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedContainer.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.runnables.skills; +package com.gmail.nossr50.core.runnables.skills; import org.bukkit.entity.LivingEntity; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/BleedTimerTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedTimerTask.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/skills/BleedTimerTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedTimerTask.java index f669e7c8d..83a8c2b48 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/BleedTimerTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedTimerTask.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.runnables.skills; +package com.gmail.nossr50.core.runnables.skills; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/ExperienceBarHideTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ExperienceBarHideTask.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/skills/ExperienceBarHideTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/skills/ExperienceBarHideTask.java index c8f1ee933..383f3c725 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/ExperienceBarHideTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ExperienceBarHideTask.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.runnables.skills; +package com.gmail.nossr50.core.runnables.skills; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.util.experience.ExperienceBarManager; import org.bukkit.scheduler.BukkitRunnable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/HerbalismBlockUpdaterTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/HerbalismBlockUpdaterTask.java similarity index 88% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/skills/HerbalismBlockUpdaterTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/skills/HerbalismBlockUpdaterTask.java index 38f5eb84d..1430e3f6e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/HerbalismBlockUpdaterTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/HerbalismBlockUpdaterTask.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.runnables.skills; +package com.gmail.nossr50.core.runnables.skills; import org.bukkit.block.BlockState; import org.bukkit.scheduler.BukkitRunnable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/SkillUnlockNotificationTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/SkillUnlockNotificationTask.java similarity index 93% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/skills/SkillUnlockNotificationTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/skills/SkillUnlockNotificationTask.java index 7aae9c6aa..509eec752 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/SkillUnlockNotificationTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/SkillUnlockNotificationTask.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.runnables.skills; +package com.gmail.nossr50.core.runnables.skills; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.util.player.NotificationManager; import org.bukkit.scheduler.BukkitRunnable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/ToolLowerTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ToolLowerTask.java similarity index 90% rename from bukkit/src/main/java/com/gmail/nossr50/runnables/skills/ToolLowerTask.java rename to core/src/main/java/com/gmail/nossr50/core/runnables/skills/ToolLowerTask.java index a41bd92ed..71344bdef 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/runnables/skills/ToolLowerTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ToolLowerTask.java @@ -1,9 +1,9 @@ -package com.gmail.nossr50.runnables.skills; +package com.gmail.nossr50.core.runnables.skills; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.ToolType; +import com.gmail.nossr50.core.skills.ToolType; import com.gmail.nossr50.util.player.NotificationManager; import org.bukkit.scheduler.BukkitRunnable; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/ItemType.java b/core/src/main/java/com/gmail/nossr50/core/skills/ItemType.java similarity index 54% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/ItemType.java rename to core/src/main/java/com/gmail/nossr50/core/skills/ItemType.java index 4bcb54ae4..2035e841c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/ItemType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/ItemType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.skills; +package com.gmail.nossr50.core.skills; public enum ItemType { ARMOR, diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/MaterialType.java b/core/src/main/java/com/gmail/nossr50/core/skills/MaterialType.java similarity index 94% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/MaterialType.java rename to core/src/main/java/com/gmail/nossr50/core/skills/MaterialType.java index e93aac73d..920017345 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/MaterialType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/MaterialType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.skills; +package com.gmail.nossr50.core.skills; import org.bukkit.Material; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/MobHealthbarType.java b/core/src/main/java/com/gmail/nossr50/core/skills/MobHealthbarType.java similarity index 60% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/MobHealthbarType.java rename to core/src/main/java/com/gmail/nossr50/core/skills/MobHealthbarType.java index aa938ab70..d0088ce9a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/MobHealthbarType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/MobHealthbarType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes; +package com.gmail.nossr50.core.skills; public enum MobHealthbarType { HEARTS, diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/ModConfigType.java b/core/src/main/java/com/gmail/nossr50/core/skills/ModConfigType.java similarity index 95% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/ModConfigType.java rename to core/src/main/java/com/gmail/nossr50/core/skills/ModConfigType.java index 9c317042f..267b4be6f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/ModConfigType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/ModConfigType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.skills; +package com.gmail.nossr50.core.skills; public enum ModConfigType { BLOCKS, diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/PotionStage.java b/core/src/main/java/com/gmail/nossr50/core/skills/PotionStage.java similarity index 95% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/PotionStage.java rename to core/src/main/java/com/gmail/nossr50/core/skills/PotionStage.java index 10e0e6d39..acb3b31cd 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/PotionStage.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/PotionStage.java @@ -1,5 +1,6 @@ -package com.gmail.nossr50.core.datatypes.skills.alchemy; +package com.gmail.nossr50.core.skills; +import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyPotion; import org.bukkit.Material; import org.bukkit.potion.PotionData; import org.bukkit.potion.PotionEffect; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/PrimarySkillType.java b/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java similarity index 99% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/PrimarySkillType.java rename to core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java index 171077723..91c2dfe26 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/PrimarySkillType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.skills; +package com.gmail.nossr50.core.skills; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/SkillManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/SkillManager.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/skills/SkillManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/SkillManager.java index 10495533e..c15dd3f90 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/SkillManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/SkillManager.java @@ -1,9 +1,8 @@ -package com.gmail.nossr50.skills; +package com.gmail.nossr50.core.skills; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillFlags.java b/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillFlags.java similarity index 96% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillFlags.java rename to core/src/main/java/com/gmail/nossr50/core/skills/SubSkillFlags.java index 6e2225860..96be040da 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillFlags.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillFlags.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.skills; +package com.gmail.nossr50.core.skills; public class SubSkillFlags { /* diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillType.java b/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillType.java similarity index 99% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillType.java rename to core/src/main/java/com/gmail/nossr50/core/skills/SubSkillType.java index 817e0ad53..5d7120e4c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/SubSkillType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.skills; +package com.gmail.nossr50.core.skills; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.StringUtils; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/SuperAbilityType.java b/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java similarity index 99% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/SuperAbilityType.java rename to core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java index 4e7e45527..ee36532dd 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/SuperAbilityType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.skills; +package com.gmail.nossr50.core.skills; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.util.BlockUtils; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/ToolType.java b/core/src/main/java/com/gmail/nossr50/core/skills/ToolType.java similarity index 97% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/ToolType.java rename to core/src/main/java/com/gmail/nossr50/core/skills/ToolType.java index 35b9ffc4c..4b513b58b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/ToolType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/ToolType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.skills; +package com.gmail.nossr50.core.skills; import com.gmail.nossr50.util.ItemUtils; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/child/ChildConfig.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/ChildConfig.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/skills/child/ChildConfig.java rename to core/src/main/java/com/gmail/nossr50/core/skills/child/ChildConfig.java index 4d6f9f987..5a3df0a37 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/child/ChildConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/ChildConfig.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.skills.child; +package com.gmail.nossr50.core.skills.child; import com.gmail.nossr50.core.config.skills.AutoUpdateConfigLoader; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.util.StringUtils; import org.bukkit.configuration.file.YamlConfiguration; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/child/FamilyTree.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/FamilyTree.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/skills/child/FamilyTree.java rename to core/src/main/java/com/gmail/nossr50/core/skills/child/FamilyTree.java index df78202d3..bdabfde9c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/child/FamilyTree.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/FamilyTree.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.skills.child; +package com.gmail.nossr50.core.skills.child; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import java.util.Collections; import java.util.EnumSet; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/Salvage.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/skills/salvage/Salvage.java rename to core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java index 7cd8ef3af..a288d12d7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/Salvage.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.skills.salvage; +package com.gmail.nossr50.core.skills.child.salvage; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java index 41cf74b76..c01ba6dc3 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java @@ -1,15 +1,15 @@ -package com.gmail.nossr50.skills.salvage; +package com.gmail.nossr50.core.skills.child.salvage; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.SkillManager; -import com.gmail.nossr50.skills.salvage.salvageables.Salvageable; +import com.gmail.nossr50.core.skills.child.salvage.salvageables.Salvageable; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/Salvageable.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/Salvageable.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/Salvageable.java rename to core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/Salvageable.java index cc1d20564..baf60b406 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/Salvageable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/Salvageable.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.skills.salvage.salvageables; +package com.gmail.nossr50.core.skills.child.salvage.salvageables; -import com.gmail.nossr50.core.datatypes.skills.ItemType; -import com.gmail.nossr50.core.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.skills.ItemType; +import com.gmail.nossr50.core.skills.MaterialType; import org.bukkit.Material; public interface Salvageable { diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SalvageableFactory.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableFactory.java similarity index 84% rename from bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SalvageableFactory.java rename to core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableFactory.java index eafad00ab..155ca567f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SalvageableFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableFactory.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.skills.salvage.salvageables; +package com.gmail.nossr50.core.skills.child.salvage.salvageables; -import com.gmail.nossr50.core.datatypes.skills.ItemType; -import com.gmail.nossr50.core.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.skills.ItemType; +import com.gmail.nossr50.core.skills.MaterialType; import org.bukkit.Material; public class SalvageableFactory { diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SalvageableManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableManager.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SalvageableManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableManager.java index fb9f4b84e..9d50c68c4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SalvageableManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.skills.salvage.salvageables; +package com.gmail.nossr50.core.skills.child.salvage.salvageables; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SimpleSalvageable.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SimpleSalvageable.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SimpleSalvageable.java rename to core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SimpleSalvageable.java index 715426165..b2c4c0ac9 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SimpleSalvageable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SimpleSalvageable.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.skills.salvage.salvageables; +package com.gmail.nossr50.core.skills.child.salvage.salvageables; -import com.gmail.nossr50.core.datatypes.skills.ItemType; -import com.gmail.nossr50.core.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.skills.ItemType; +import com.gmail.nossr50.core.skills.MaterialType; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SimpleSalvageableManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SimpleSalvageableManager.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SimpleSalvageableManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SimpleSalvageableManager.java index 872364e64..b1608879a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/salvage/salvageables/SimpleSalvageableManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SimpleSalvageableManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.skills.salvage.salvageables; +package com.gmail.nossr50.core.skills.child.salvage.salvageables; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/smelting/Smelting.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/Smelting.java similarity index 87% rename from bukkit/src/main/java/com/gmail/nossr50/skills/smelting/Smelting.java rename to core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/Smelting.java index e8ba7e03a..6ded74855 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/smelting/Smelting.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/Smelting.java @@ -1,9 +1,9 @@ -package com.gmail.nossr50.skills.smelting; +package com.gmail.nossr50.core.skills.child.smelting; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.skills.RankUtils; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/smelting/SmeltingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java similarity index 93% rename from bukkit/src/main/java/com/gmail/nossr50/skills/smelting/SmeltingManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java index 1ac510cf1..20626be12 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/smelting/SmeltingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java @@ -1,14 +1,14 @@ -package com.gmail.nossr50.skills.smelting; +package com.gmail.nossr50.core.skills.child.smelting; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SkillManager; +import com.gmail.nossr50.core.skills.primary.mining.Mining; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.SkillManager; -import com.gmail.nossr50.skills.mining.Mining; import com.gmail.nossr50.util.BlockUtils; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Misc; @@ -56,11 +56,11 @@ public class SmeltingManager extends SkillManager { ItemStack item = null; switch (blockState.getType()) { - case IRON_ORE: + case Material.IRON_ORE: item = new ItemStack(Material.IRON_INGOT); break; - case GOLD_ORE: + case Material.GOLD_ORE: item = new ItemStack(Material.GOLD_INGOT); break; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/ChildSkill.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/ChildSkill.java similarity index 59% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/ChildSkill.java rename to core/src/main/java/com/gmail/nossr50/core/skills/interfaces/ChildSkill.java index a80aad1bd..504542177 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/ChildSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/ChildSkill.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.core.datatypes.skills.interfaces; +package com.gmail.nossr50.core.skills.interfaces; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; public interface ChildSkill extends Skill { /** diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/CoreSkill.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/CoreSkill.java similarity index 82% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/CoreSkill.java rename to core/src/main/java/com/gmail/nossr50/core/skills/interfaces/CoreSkill.java index bb45b4027..df85989b0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/CoreSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/CoreSkill.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.core.datatypes.skills.interfaces; +package com.gmail.nossr50.core.skills.interfaces; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SubSkillType; /** * This interface is mostly here to maintain backwards compatibility with other mcMMO plugins diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Localized.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Localized.java similarity index 88% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Localized.java rename to core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Localized.java index 52b9e0181..a2758d46f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Localized.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Localized.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.skills.interfaces; +package com.gmail.nossr50.core.skills.interfaces; /** * Localized interface represents skills which have localizations diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/progression/Progression.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Progression.java similarity index 69% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/progression/Progression.java rename to core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Progression.java index bac3e885e..cbdd3e51c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/progression/Progression.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Progression.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.core.datatypes.skills.progression; +package com.gmail.nossr50.core.skills.interfaces; -import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.InteractType; +import com.gmail.nossr50.core.skills.subskills.interfaces.InteractType; import org.bukkit.event.Event; public interface Progression { diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Skill.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Skill.java similarity index 71% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Skill.java rename to core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Skill.java index 3cf20c3bf..f89e93c17 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Skill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Skill.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.core.datatypes.skills.interfaces; +package com.gmail.nossr50.core.skills.interfaces; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; public interface Skill { /** diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Toolable.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Toolable.java similarity index 86% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Toolable.java rename to core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Toolable.java index 3bbe737bd..184c7a59d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/interfaces/Toolable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Toolable.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.skills.interfaces; +package com.gmail.nossr50.core.skills.interfaces; import org.bukkit.inventory.ItemStack; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/acrobatics/Acrobatics.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/skills/acrobatics/Acrobatics.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java index f2d061578..5ade031db 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/acrobatics/Acrobatics.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.skills.acrobatics; +package com.gmail.nossr50.core.skills.primary.acrobatics; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/AcrobaticsManager.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/AcrobaticsManager.java index eadc63076..a483c29cf 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/AcrobaticsManager.java @@ -1,11 +1,11 @@ -package com.gmail.nossr50.skills.acrobatics; +package com.gmail.nossr50.core.skills.primary.acrobatics; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.skills.SkillManager; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/Alchemy.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/Alchemy.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/Alchemy.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/Alchemy.java index 500640afd..30cd1b396 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/Alchemy.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/Alchemy.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.skills.alchemy; +package com.gmail.nossr50.core.skills.primary.alchemy; import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.skills.AlchemyBrewTask; import com.gmail.nossr50.util.skills.RankUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyManager.java similarity index 87% rename from bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyManager.java index d7acbb81b..10f3d3f07 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyManager.java @@ -1,14 +1,14 @@ -package com.gmail.nossr50.skills.alchemy; +package com.gmail.nossr50.core.skills.primary.alchemy; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.config.skills.alchemy.PotionConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.alchemy.PotionStage; -import com.gmail.nossr50.skills.SkillManager; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.PotionStage; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.skills.RankUtils; import org.bukkit.inventory.ItemStack; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/AlchemyPotion.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotion.java similarity index 98% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/AlchemyPotion.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotion.java index 14246e199..3efde46bd 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/alchemy/AlchemyPotion.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotion.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.skills.alchemy; +package com.gmail.nossr50.core.skills.primary.alchemy; import com.gmail.nossr50.config.skills.alchemy.PotionConfig; import org.bukkit.Color; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotionBrewer.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotionBrewer.java index e53bbf12e..1daa82c22 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotionBrewer.java @@ -1,9 +1,8 @@ -package com.gmail.nossr50.skills.alchemy; +package com.gmail.nossr50.core.skills.primary.alchemy; import com.gmail.nossr50.config.skills.alchemy.PotionConfig; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.alchemy.AlchemyPotion; -import com.gmail.nossr50.core.datatypes.skills.alchemy.PotionStage; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.PotionStage; import com.gmail.nossr50.events.fake.FakeBrewEvent; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.player.PlayerUpdateInventoryTask; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/archery/Archery.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/Archery.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/skills/archery/Archery.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/Archery.java index 0b76e5eb6..7ec67ed0c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/archery/Archery.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/Archery.java @@ -1,8 +1,8 @@ -package com.gmail.nossr50.skills.archery; +package com.gmail.nossr50.core.skills.primary.archery; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.skills.RankUtils; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/ArcheryManager.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/ArcheryManager.java index 84a4ab289..17a998a58 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/ArcheryManager.java @@ -1,11 +1,11 @@ -package com.gmail.nossr50.skills.archery; +package com.gmail.nossr50.core.skills.primary.archery; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/archery/TrackedEntity.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/TrackedEntity.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/skills/archery/TrackedEntity.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/TrackedEntity.java index 851a007df..f7170bb6e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/archery/TrackedEntity.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/TrackedEntity.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.skills.archery; +package com.gmail.nossr50.core.skills.primary.archery; import com.gmail.nossr50.mcMMO; import org.bukkit.entity.LivingEntity; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/axes/Axes.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/Axes.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/skills/axes/Axes.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/Axes.java index a34bcf8e5..da17bd6b6 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/axes/Axes.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/Axes.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.skills.axes; +package com.gmail.nossr50.core.skills.primary.axes; import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.skills.RankUtils; import org.bukkit.entity.LivingEntity; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/axes/AxesManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/AxesManager.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/skills/axes/AxesManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/AxesManager.java index d4b071737..acb40da77 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/axes/AxesManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/AxesManager.java @@ -1,18 +1,17 @@ -package com.gmail.nossr50.skills.axes; +package com.gmail.nossr50.core.skills.primary.axes; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; -import com.gmail.nossr50.core.datatypes.skills.ToolType; -import com.gmail.nossr50.skills.SkillManager; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SuperAbilityType; +import com.gmail.nossr50.core.skills.ToolType; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceUtil; -import com.gmail.nossr50.util.skills.*; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.entity.EntityDamageEvent.DamageModifier; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/excavation/Excavation.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/Excavation.java similarity index 88% rename from bukkit/src/main/java/com/gmail/nossr50/skills/excavation/Excavation.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/Excavation.java index d91d78c65..bb772370b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/excavation/Excavation.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/Excavation.java @@ -1,9 +1,9 @@ -package com.gmail.nossr50.skills.excavation; +package com.gmail.nossr50.core.skills.primary.excavation; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.treasure.TreasureConfig; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.treasure.ExcavationTreasure; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.treasure.ExcavationTreasure; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.StringUtils; import org.bukkit.block.BlockState; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java similarity index 91% rename from bukkit/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java index 55dc6a3ae..519723681 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java @@ -1,12 +1,12 @@ -package com.gmail.nossr50.skills.excavation; +package com.gmail.nossr50.core.skills.primary.excavation; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.treasure.ExcavationTreasure; -import com.gmail.nossr50.skills.SkillManager; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.treasure.ExcavationTreasure; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.random.RandomChanceUtil; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/fishing/Fishing.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/Fishing.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/skills/fishing/Fishing.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/Fishing.java index 33f0a1515..9ffc0c444 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/fishing/Fishing.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/Fishing.java @@ -1,8 +1,8 @@ -package com.gmail.nossr50.skills.fishing; +package com.gmail.nossr50.core.skills.primary.fishing; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.treasure.TreasureConfig; -import com.gmail.nossr50.core.datatypes.treasure.ShakeTreasure; +import com.gmail.nossr50.core.skills.treasure.ShakeTreasure; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.adapter.BiomeAdapter; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java index b70b66f8e..8a0dd5e3e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.skills.fishing; +package com.gmail.nossr50.core.skills.primary.fishing; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; @@ -7,15 +7,15 @@ import com.gmail.nossr50.core.config.treasure.TreasureConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.treasure.EnchantmentTreasure; -import com.gmail.nossr50.core.datatypes.treasure.FishingTreasure; -import com.gmail.nossr50.core.datatypes.treasure.Rarity; -import com.gmail.nossr50.core.datatypes.treasure.ShakeTreasure; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.treasure.EnchantmentTreasure; +import com.gmail.nossr50.core.skills.treasure.FishingTreasure; +import com.gmail.nossr50.core.skills.treasure.Rarity; +import com.gmail.nossr50.core.skills.treasure.ShakeTreasure; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.events.skills.fishing.McMMOPlayerFishingTreasureEvent; import com.gmail.nossr50.events.skills.fishing.McMMOPlayerShakeEvent; -import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.*; import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.random.RandomChanceSkillStatic; @@ -284,18 +284,18 @@ public class FishingManager extends SkillManager { // Extra processing depending on the mob and drop type switch (target.getType()) { - case PLAYER: + case EntityType.PLAYER: Player targetPlayer = (Player) target; switch (drop.getType()) { - case PLAYER_HEAD: + case Material.PLAYER_HEAD: drop.setDurability((short) 3); SkullMeta skullMeta = (SkullMeta) drop.getItemMeta(); skullMeta.setOwningPlayer(targetPlayer); drop.setItemMeta(skullMeta); break; - case BEDROCK: + case Material.BEDROCK: if (TreasureConfig.getInstance().getInventoryStealEnabled()) { PlayerInventory inventory = targetPlayer.getInventory(); int length = inventory.getContents().length; @@ -323,7 +323,7 @@ public class FishingManager extends SkillManager { } break; - case SHEEP: + case EntityType.SHEEP: Sheep sheep = (Sheep) target; if (drop.getType().name().endsWith("WOOL")) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/herbalism/Herbalism.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/Herbalism.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/skills/herbalism/Herbalism.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/Herbalism.java index bae27e8fd..f055a07f1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/herbalism/Herbalism.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/Herbalism.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.skills.herbalism; +package com.gmail.nossr50.core.skills.primary.herbalism; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.skills.SkillUtils; @@ -20,20 +20,20 @@ public class Herbalism { */ protected static boolean convertGreenTerraBlocks(BlockState blockState) { switch (blockState.getType()) { - case COBBLESTONE_WALL: + case Material.COBBLESTONE_WALL: blockState.setType(Material.MOSSY_COBBLESTONE_WALL); return true; - case STONE_BRICKS: + case Material.STONE_BRICKS: blockState.setType(Material.MOSSY_STONE_BRICKS); return true; - case DIRT : - case GRASS_PATH : + case Material.DIRT : + case Material.GRASS_PATH : blockState.setType(Material.GRASS_BLOCK); return true; - case COBBLESTONE : + case Material.COBBLESTONE : blockState.setType(Material.MOSSY_COBBLESTONE); return true; @@ -118,9 +118,9 @@ public class Herbalism { */ protected static boolean convertShroomThumb(BlockState blockState) { switch (blockState.getType()) { - case DIRT : - case GRASS_BLOCK: - case GRASS_PATH : + case Material.DIRT : + case Material.GRASS_BLOCK: + case Material.GRASS_PATH : blockState.setType(Material.MYCELIUM); return true; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java index 615262ace..fd84ca1cd 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.skills.herbalism; +package com.gmail.nossr50.core.skills.primary.herbalism; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; @@ -7,14 +7,14 @@ import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.mods.CustomBlock; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; -import com.gmail.nossr50.core.datatypes.skills.ToolType; -import com.gmail.nossr50.core.datatypes.treasure.HylianTreasure; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SuperAbilityType; +import com.gmail.nossr50.core.skills.ToolType; +import com.gmail.nossr50.core.skills.treasure.HylianTreasure; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.skills.HerbalismBlockUpdaterTask; -import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.*; import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.random.RandomChanceSkillStatic; @@ -283,27 +283,27 @@ public class HerbalismManager extends SkillManager { Material seed = null; switch (blockState.getType()) { - case CARROTS: + case Material.CARROTS: seed = Material.CARROT; break; - case WHEAT: + case Material.WHEAT: seed = Material.WHEAT_SEEDS; break; - case NETHER_WART: + case Material.NETHER_WART: seed = Material.NETHER_WART; break; - case POTATOES: + case Material.POTATOES: seed = Material.POTATO; break; - case BEETROOTS: + case Material.BEETROOTS: seed = Material.BEETROOT_SEEDS; break; - case COCOA: + case Material.COCOA: seed = Material.COCOA_BEANS; break; @@ -338,9 +338,9 @@ public class HerbalismManager extends SkillManager { switch (blockState.getType()) { - case POTATOES: - case CARROTS: - case WHEAT: + case Material.POTATOES: + case Material.CARROTS: + case Material.WHEAT: if (greenTerra) { crops.setAge(3); @@ -350,8 +350,8 @@ public class HerbalismManager extends SkillManager { } break; - case BEETROOTS: - case NETHER_WART: + case Material.BEETROOTS: + case Material.NETHER_WART: if (greenTerra || greenThumbStage > 2) { crops.setAge(2); @@ -364,7 +364,7 @@ public class HerbalismManager extends SkillManager { } break; - case COCOA: + case Material.COCOA: if (greenTerra || getGreenThumbStage() > 1) { crops.setAge(1); diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/mining/BlastMining.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/skills/mining/BlastMining.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java index 8bf6005db..e1be7e7a6 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/mining/BlastMining.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java @@ -1,8 +1,8 @@ -package com.gmail.nossr50.skills.mining; +package com.gmail.nossr50.core.skills.primary.mining; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.RankUtils; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/Mining.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/Mining.java new file mode 100644 index 000000000..a75595fac --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/Mining.java @@ -0,0 +1,167 @@ +package com.gmail.nossr50.core.skills.primary.mining; + +import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.util.Misc; +import org.bukkit.Material; +import org.bukkit.block.BlockState; +import org.bukkit.inventory.ItemStack; + +public class Mining { + + /** + * Calculate XP gain for Mining. + * + * @param blockState The {@link BlockState} to check ability activation for + */ + public static int getBlockXp(BlockState blockState) { + int xp = ExperienceConfig.getInstance().getXp(PrimarySkillType.MINING, blockState.getType()); + + if (xp == 0 && mcMMO.getModManager().isCustomMiningBlock(blockState)) { + xp = mcMMO.getModManager().getBlock(blockState).getXpGain(); + } + + return xp; + } + + /** + * Handle double drops when using Silk Touch. + * + * @param blockState The {@link BlockState} to check ability activation for + */ + protected static void handleSilkTouchDrops(BlockState blockState) { + Material blockType = blockState.getType(); + + switch (blockType) { + case Material.END_STONE: + case Material.TERRACOTTA: + case Material.CLAY: + case Material.IRON_ORE: + case Material.MOSSY_COBBLESTONE: + case Material.NETHERRACK: + case Material.OBSIDIAN: + case Material.SANDSTONE: + case Material.BLACK_GLAZED_TERRACOTTA: + case Material.BLACK_TERRACOTTA: + case Material.BLUE_GLAZED_TERRACOTTA: + case Material.BLUE_TERRACOTTA: + case Material.BROWN_GLAZED_TERRACOTTA: + case Material.BROWN_TERRACOTTA: + case Material.CYAN_GLAZED_TERRACOTTA: + case Material.CYAN_TERRACOTTA: + case Material.GRAY_GLAZED_TERRACOTTA: + case Material.GRAY_TERRACOTTA: + case Material.GREEN_GLAZED_TERRACOTTA: + case Material.GREEN_TERRACOTTA: + case Material.LIGHT_BLUE_GLAZED_TERRACOTTA: + case Material.LIGHT_BLUE_TERRACOTTA: + case Material.LIGHT_GRAY_GLAZED_TERRACOTTA: + case Material.LIGHT_GRAY_TERRACOTTA: + case Material.LIME_GLAZED_TERRACOTTA: + case Material.LIME_TERRACOTTA: + case Material.MAGENTA_GLAZED_TERRACOTTA: + case Material.MAGENTA_TERRACOTTA: + case Material.ORANGE_GLAZED_TERRACOTTA: + case Material.ORANGE_TERRACOTTA: + case Material.PINK_GLAZED_TERRACOTTA: + case Material.PINK_TERRACOTTA: + case Material.PURPLE_GLAZED_TERRACOTTA: + case Material.PURPLE_TERRACOTTA: + case Material.RED_GLAZED_TERRACOTTA: + case Material.RED_TERRACOTTA: + case Material.WHITE_GLAZED_TERRACOTTA: + case Material.WHITE_TERRACOTTA: + case Material.YELLOW_GLAZED_TERRACOTTA: + case Material.YELLOW_TERRACOTTA: + handleMiningDrops(blockState); + return; + + case Material.COAL_ORE: + case Material.DIAMOND_ORE: + case Material.EMERALD_ORE: + case Material.GLOWSTONE: + case Material.LAPIS_ORE: + case Material.PACKED_ICE: + case Material.NETHER_QUARTZ_ORE: + case Material.REDSTONE_ORE: + case Material.STONE: + case Material.PRISMARINE: + Misc.dropItem(Misc.getBlockCenter(blockState), new ItemStack(blockState.getType())); + return; + + default: + if (mcMMO.getModManager().isCustomMiningBlock(blockState)) { + Misc.dropItem(Misc.getBlockCenter(blockState), new ItemStack(blockState.getType())); + } + return; + } + } + + /** + * Handle double drops from Mining & Blast Mining. + * + * @param blockState The {@link BlockState} to check ability activation for + */ + protected static void handleMiningDrops(BlockState blockState) { + switch (blockState.getType()) { + case Material.COAL_ORE: + case Material.DIAMOND_ORE: + case Material.EMERALD_ORE: + case Material.END_STONE: + case Material.GLOWSTONE: + case Material.GOLD_ORE: + case Material.TERRACOTTA: + case Material.IRON_ORE: + case Material.LAPIS_ORE: + case Material.MOSSY_COBBLESTONE: + case Material.NETHERRACK: + case Material.OBSIDIAN: + case Material.PACKED_ICE: + case Material.REDSTONE_ORE: + case Material.SANDSTONE: + case Material.BLACK_GLAZED_TERRACOTTA: + case Material.BLACK_TERRACOTTA: + case Material.BLUE_GLAZED_TERRACOTTA: + case Material.BLUE_TERRACOTTA: + case Material.BROWN_GLAZED_TERRACOTTA: + case Material.BROWN_TERRACOTTA: + case Material.CYAN_GLAZED_TERRACOTTA: + case Material.CYAN_TERRACOTTA: + case Material.GRAY_GLAZED_TERRACOTTA: + case Material.GRAY_TERRACOTTA: + case Material.GREEN_GLAZED_TERRACOTTA: + case Material.GREEN_TERRACOTTA: + case Material.LIGHT_BLUE_GLAZED_TERRACOTTA: + case Material.LIGHT_BLUE_TERRACOTTA: + case Material.LIGHT_GRAY_GLAZED_TERRACOTTA: + case Material.LIGHT_GRAY_TERRACOTTA: + case Material.LIME_GLAZED_TERRACOTTA: + case Material.LIME_TERRACOTTA: + case Material.MAGENTA_GLAZED_TERRACOTTA: + case Material.MAGENTA_TERRACOTTA: + case Material.ORANGE_GLAZED_TERRACOTTA: + case Material.ORANGE_TERRACOTTA: + case Material.PINK_GLAZED_TERRACOTTA: + case Material.PINK_TERRACOTTA: + case Material.PURPLE_GLAZED_TERRACOTTA: + case Material.PURPLE_TERRACOTTA: + case Material.RED_GLAZED_TERRACOTTA: + case Material.RED_TERRACOTTA: + case Material.WHITE_GLAZED_TERRACOTTA: + case Material.WHITE_TERRACOTTA: + case Material.YELLOW_GLAZED_TERRACOTTA: + case Material.YELLOW_TERRACOTTA: + case Material.STONE: + case Material.NETHER_QUARTZ_ORE: + Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops()); + return; + + default: + if (mcMMO.getModManager().isCustomMiningBlock(blockState)) { + Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops()); + } + return; + } + } +} diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java index c04e55461..97dbe946e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java @@ -1,16 +1,16 @@ -package com.gmail.nossr50.skills.mining; +package com.gmail.nossr50.core.skills.primary.mining; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.skills.AbilityCooldownTask; -import com.gmail.nossr50.skills.SkillManager; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.util.BlockUtils; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Misc; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/ArcaneForging.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/ArcaneForging.java similarity index 86% rename from bukkit/src/main/java/com/gmail/nossr50/skills/repair/ArcaneForging.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/ArcaneForging.java index cb3f98834..1a15e6050 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/ArcaneForging.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/ArcaneForging.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.skills.repair; +package com.gmail.nossr50.core.skills.primary.repair; import com.gmail.nossr50.core.config.skills.AdvancedConfig; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/Repair.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java similarity index 89% rename from bukkit/src/main/java/com/gmail/nossr50/skills/repair/Repair.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java index 45ebd010c..145c96a5c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/Repair.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.skills.repair; +package com.gmail.nossr50.core.skills.primary.repair; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java index 56909867a..fc186ffba 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.skills.repair; +package com.gmail.nossr50.core.skills.primary.repair; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; @@ -6,12 +6,12 @@ import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.SkillManager; -import com.gmail.nossr50.skills.repair.repairables.Repairable; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/Repairable.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/Repairable.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/Repairable.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/Repairable.java index 6468c46f1..d954b161e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/Repairable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/Repairable.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.skills.repair.repairables; +package com.gmail.nossr50.core.skills.primary.repair.repairables; -import com.gmail.nossr50.core.datatypes.skills.ItemType; -import com.gmail.nossr50.core.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.skills.ItemType; +import com.gmail.nossr50.core.skills.MaterialType; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/RepairableFactory.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableFactory.java similarity index 89% rename from bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/RepairableFactory.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableFactory.java index 6d72225a6..4f50e2153 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/RepairableFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableFactory.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.skills.repair.repairables; +package com.gmail.nossr50.core.skills.primary.repair.repairables; -import com.gmail.nossr50.core.datatypes.skills.ItemType; -import com.gmail.nossr50.core.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.skills.ItemType; +import com.gmail.nossr50.core.skills.MaterialType; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/RepairableManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableManager.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/RepairableManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableManager.java index fff27e718..eb6e17d53 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/RepairableManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.skills.repair.repairables; +package com.gmail.nossr50.core.skills.primary.repair.repairables; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/SimpleRepairable.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairable.java similarity index 93% rename from bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/SimpleRepairable.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairable.java index c8e26c4c3..c79eac8ec 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/SimpleRepairable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairable.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.skills.repair.repairables; +package com.gmail.nossr50.core.skills.primary.repair.repairables; -import com.gmail.nossr50.core.datatypes.skills.ItemType; -import com.gmail.nossr50.core.datatypes.skills.MaterialType; +import com.gmail.nossr50.core.skills.ItemType; +import com.gmail.nossr50.core.skills.MaterialType; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/SimpleRepairableManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairableManager.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/SimpleRepairableManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairableManager.java index 8fe95d830..9577cb297 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/repair/repairables/SimpleRepairableManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairableManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.skills.repair.repairables; +package com.gmail.nossr50.core.skills.primary.repair.repairables; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/swords/Swords.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/Swords.java similarity index 91% rename from bukkit/src/main/java/com/gmail/nossr50/skills/swords/Swords.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/Swords.java index 159d3a565..cb10d1377 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/swords/Swords.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/Swords.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.skills.swords; +package com.gmail.nossr50.core.skills.primary.swords; import com.gmail.nossr50.core.config.skills.AdvancedConfig; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/SwordsManager.java similarity index 93% rename from bukkit/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/SwordsManager.java index b6c62dcb4..2d6b8ae3e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/SwordsManager.java @@ -1,13 +1,13 @@ -package com.gmail.nossr50.skills.swords; +package com.gmail.nossr50.core.skills.primary.swords; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; -import com.gmail.nossr50.core.datatypes.skills.ToolType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SuperAbilityType; +import com.gmail.nossr50.core.skills.ToolType; import com.gmail.nossr50.runnables.skills.BleedTimerTask; -import com.gmail.nossr50.skills.SkillManager; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.core.data.UserManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/taming/Taming.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/Taming.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/skills/taming/Taming.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/Taming.java index 40fdd5570..45a246752 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/taming/Taming.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/Taming.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.skills.taming; +package com.gmail.nossr50.core.skills.primary.taming; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import org.bukkit.EntityEffect; @@ -44,13 +44,13 @@ public class Taming { protected static String getCallOfTheWildFailureMessage(EntityType type) { switch (type) { - case OCELOT: + case EntityType.OCELOT: return "Taming.Summon.Fail.Ocelot"; - case WOLF: + case EntityType.WOLF: return "Taming.Summon.Fail.Wolf"; - case HORSE: + case EntityType.HORSE: return "Taming.Summon.Fail.Horse"; default: diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java index b8079e619..74c224b0d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.skills.taming; +package com.gmail.nossr50.core.skills.primary.taming; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; @@ -6,13 +6,13 @@ import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.events.fake.FakeEntityTameEvent; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.skills.BleedTimerTask; -import com.gmail.nossr50.skills.SkillManager; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; @@ -298,16 +298,16 @@ public class TamingManager extends SkillManager { addToTracker(entity); switch (type) { - case OCELOT: + case EntityType.OCELOT: ((Ocelot) entity).setCatType(Ocelot.Type.values()[1 + Misc.getRandom().nextInt(3)]); break; - case WOLF: + case EntityType.WOLF: entity.setMaxHealth(20.0); entity.setHealth(entity.getMaxHealth()); break; - case HORSE: + case EntityType.HORSE: Horse horse = (Horse) entity; entity.setMaxHealth(15.0 + (Misc.getRandom().nextDouble() * 15)); diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/taming/TrackedTamingEntity.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TrackedTamingEntity.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/skills/taming/TrackedTamingEntity.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TrackedTamingEntity.java index 67b543e8f..e158b8a13 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/taming/TrackedTamingEntity.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TrackedTamingEntity.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.skills.taming; +package com.gmail.nossr50.core.skills.primary.taming; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.mcMMO; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/unarmed/Unarmed.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/skills/unarmed/Unarmed.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java index 4e795e594..448b4f8f8 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/unarmed/Unarmed.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.skills.unarmed; +package com.gmail.nossr50.core.skills.primary.unarmed; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.util.sounds.SoundManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/UnarmedManager.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/UnarmedManager.java index 853ac9c62..b927c49b1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/UnarmedManager.java @@ -1,14 +1,14 @@ -package com.gmail.nossr50.skills.unarmed; +package com.gmail.nossr50.core.skills.primary.unarmed; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; -import com.gmail.nossr50.core.datatypes.skills.ToolType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SuperAbilityType; +import com.gmail.nossr50.core.skills.ToolType; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.Misc; @@ -77,7 +77,7 @@ public class UnarmedManager extends SkillManager { BlockData data = blockState.getBlockData(); switch (blockState.getType()) { - case STONE_BRICKS: + case Material.STONE_BRICKS: if (!Unarmed.blockCrackerSmoothBrick) { return false; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java index 595eff6cd..92c7bcbb5 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java @@ -1,8 +1,8 @@ -package com.gmail.nossr50.skills.woodcutting; +package com.gmail.nossr50.core.skills.primary.woodcutting; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.BlockUtils; import com.gmail.nossr50.util.Misc; diff --git a/bukkit/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/WoodcuttingManager.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java rename to core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/WoodcuttingManager.java index 63efc6f7b..1dff844f8 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/WoodcuttingManager.java @@ -1,15 +1,15 @@ -package com.gmail.nossr50.skills.woodcutting; +package com.gmail.nossr50.core.skills.primary.woodcutting; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.mods.CustomBlock; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SuperAbilityType; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.SkillManager; -import com.gmail.nossr50.skills.woodcutting.Woodcutting.ExperienceGainMethod; +import com.gmail.nossr50.core.skills.primary.woodcutting.Woodcutting.ExperienceGainMethod; import com.gmail.nossr50.util.*; import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.random.RandomChanceUtil; @@ -57,8 +57,8 @@ public class WoodcuttingManager extends SkillManager { int xp = Woodcutting.getExperienceFromLog(blockState, ExperienceGainMethod.DEFAULT); switch (blockState.getType()) { - case BROWN_MUSHROOM_BLOCK: - case RED_MUSHROOM_BLOCK: + case Material.BROWN_MUSHROOM_BLOCK: + case Material.RED_MUSHROOM_BLOCK: break; default: diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/AbstractSubSkill.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/AbstractSubSkill.java similarity index 81% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/AbstractSubSkill.java rename to core/src/main/java/com/gmail/nossr50/core/skills/subskills/AbstractSubSkill.java index b12d8af0d..b18f1d42c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/AbstractSubSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/AbstractSubSkill.java @@ -1,11 +1,11 @@ -package com.gmail.nossr50.core.datatypes.skills.subskills; +package com.gmail.nossr50.core.skills.subskills; import com.gmail.nossr50.core.config.skills.CoreSkillsConfig; -import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.Interaction; -import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.Rank; -import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.SubSkill; -import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.SubSkillProperties; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.skills.subskills.interfaces.Interaction; +import com.gmail.nossr50.core.skills.subskills.interfaces.Rank; +import com.gmail.nossr50.core.skills.subskills.interfaces.SubSkill; +import com.gmail.nossr50.core.skills.subskills.interfaces.SubSkillProperties; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import org.bukkit.entity.Player; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/AcrobaticsSubSkill.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/AcrobaticsSubSkill.java similarity index 88% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/AcrobaticsSubSkill.java rename to core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/AcrobaticsSubSkill.java index 30da16ad7..da7428845 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/AcrobaticsSubSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/AcrobaticsSubSkill.java @@ -1,9 +1,9 @@ -package com.gmail.nossr50.core.datatypes.skills.subskills.acrobatics; +package com.gmail.nossr50.core.skills.subskills.acrobatics; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; -import com.gmail.nossr50.core.datatypes.skills.subskills.interfaces.InteractType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.skills.subskills.interfaces.InteractType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.StringUtils; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/Roll.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java similarity index 99% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/Roll.java rename to core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java index 72c3855f6..51a3fe315 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/acrobatics/Roll.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.skills.subskills.acrobatics; +package com.gmail.nossr50.core.skills.subskills.acrobatics; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; @@ -8,7 +8,7 @@ import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.LimitedSizeList; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.EventUtils; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/InteractType.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/InteractType.java similarity index 80% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/InteractType.java rename to core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/InteractType.java index 110e53898..15d9ec3d0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/InteractType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/InteractType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.skills.subskills.interfaces; +package com.gmail.nossr50.core.skills.subskills.interfaces; /** * This class is used to determine event registrations for SubSkill interactions diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Interaction.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Interaction.java similarity index 91% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Interaction.java rename to core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Interaction.java index 9527fb7cb..397526230 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Interaction.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Interaction.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.skills.subskills.interfaces; +package com.gmail.nossr50.core.skills.subskills.interfaces; import com.gmail.nossr50.mcMMO; import org.bukkit.event.Event; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Rank.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Rank.java similarity index 87% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Rank.java rename to core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Rank.java index 161ecb880..2ccf2c80e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/Rank.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Rank.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.skills.subskills.interfaces; +package com.gmail.nossr50.core.skills.subskills.interfaces; public interface Rank { /** diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkill.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/SubSkill.java similarity index 93% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkill.java rename to core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/SubSkill.java index 96f382750..45ce88af6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/SubSkill.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.core.datatypes.skills.subskills.interfaces; +package com.gmail.nossr50.core.skills.subskills.interfaces; -import com.gmail.nossr50.core.datatypes.skills.interfaces.Skill; +import com.gmail.nossr50.core.skills.interfaces.Skill; import net.md_5.bungee.api.chat.ComponentBuilder; import org.bukkit.entity.Player; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkillProperties.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/SubSkillProperties.java similarity index 64% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkillProperties.java rename to core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/SubSkillProperties.java index a57988613..7cca148a6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/skills/subskills/interfaces/SubSkillProperties.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/SubSkillProperties.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.skills.subskills.interfaces; +package com.gmail.nossr50.core.skills.subskills.interfaces; public interface SubSkillProperties { boolean isSuperAbility(); diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/EnchantmentTreasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/EnchantmentTreasure.java similarity index 92% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/EnchantmentTreasure.java rename to core/src/main/java/com/gmail/nossr50/core/skills/treasure/EnchantmentTreasure.java index 6fc8f1c77..50ccb6980 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/EnchantmentTreasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/EnchantmentTreasure.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.treasure; +package com.gmail.nossr50.core.skills.treasure; import org.bukkit.enchantments.Enchantment; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ExcavationTreasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ExcavationTreasure.java similarity index 69% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ExcavationTreasure.java rename to core/src/main/java/com/gmail/nossr50/core/skills/treasure/ExcavationTreasure.java index 9454c501c..c69073284 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ExcavationTreasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ExcavationTreasure.java @@ -1,5 +1,6 @@ -package com.gmail.nossr50.core.datatypes.treasure; +package com.gmail.nossr50.core.skills.treasure; +import com.gmail.nossr50.core.skills.treasure.Treasure; import org.bukkit.inventory.ItemStack; public class ExcavationTreasure extends Treasure { diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/FishingTreasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/FishingTreasure.java similarity index 63% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/FishingTreasure.java rename to core/src/main/java/com/gmail/nossr50/core/skills/treasure/FishingTreasure.java index 5954bd860..6e9b07ef8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/FishingTreasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/FishingTreasure.java @@ -1,5 +1,6 @@ -package com.gmail.nossr50.core.datatypes.treasure; +package com.gmail.nossr50.core.skills.treasure; +import com.gmail.nossr50.core.skills.treasure.Treasure; import org.bukkit.inventory.ItemStack; public class FishingTreasure extends Treasure { diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/HylianTreasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/HylianTreasure.java similarity index 68% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/HylianTreasure.java rename to core/src/main/java/com/gmail/nossr50/core/skills/treasure/HylianTreasure.java index 81b4d8b04..61863a3b6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/HylianTreasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/HylianTreasure.java @@ -1,5 +1,6 @@ -package com.gmail.nossr50.core.datatypes.treasure; +package com.gmail.nossr50.core.skills.treasure; +import com.gmail.nossr50.core.skills.treasure.Treasure; import org.bukkit.inventory.ItemStack; public class HylianTreasure extends Treasure { diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Rarity.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Rarity.java similarity index 85% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Rarity.java rename to core/src/main/java/com/gmail/nossr50/core/skills/treasure/Rarity.java index 3216d9d26..fe4eff482 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Rarity.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Rarity.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.treasure; +package com.gmail.nossr50.core.skills.treasure; public enum Rarity { RECORD, diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ShakeTreasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ShakeTreasure.java similarity index 68% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ShakeTreasure.java rename to core/src/main/java/com/gmail/nossr50/core/skills/treasure/ShakeTreasure.java index 342203a1f..6c9755cd7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/ShakeTreasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ShakeTreasure.java @@ -1,5 +1,6 @@ -package com.gmail.nossr50.core.datatypes.treasure; +package com.gmail.nossr50.core.skills.treasure; +import com.gmail.nossr50.core.skills.treasure.Treasure; import org.bukkit.inventory.ItemStack; public class ShakeTreasure extends Treasure { diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Treasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java similarity index 95% rename from core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Treasure.java rename to core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java index be1e69bb1..127b94540 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/treasure/Treasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.datatypes.treasure; +package com.gmail.nossr50.core.skills.treasure; import com.gmail.nossr50.core.config.skills.Config; import org.bukkit.inventory.ItemStack; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/BlockUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/BlockUtils.java similarity index 50% rename from bukkit/src/main/java/com/gmail/nossr50/util/BlockUtils.java rename to core/src/main/java/com/gmail/nossr50/core/util/BlockUtils.java index 2c57b42b1..5780eeb5b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/BlockUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/BlockUtils.java @@ -1,10 +1,10 @@ -package com.gmail.nossr50.util; +package com.gmail.nossr50.core.util; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.repair.Repair; -import com.gmail.nossr50.skills.salvage.Salvage; +import com.gmail.nossr50.core.skills.primary.repair.Repair; +import com.gmail.nossr50.core.skills.child.salvage.Salvage; import org.bukkit.Material; import org.bukkit.block.BlockState; import org.bukkit.block.data.Ageable; @@ -37,90 +37,90 @@ public final class BlockUtils { */ public static boolean canActivateAbilities(BlockState blockState) { switch (blockState.getType()) { - case BLACK_BED: - case BLUE_BED: - case BROWN_BED: - case CYAN_BED: - case GRAY_BED: - case GREEN_BED: - case LIGHT_BLUE_BED: - case LIGHT_GRAY_BED: - case LIME_BED: - case MAGENTA_BED: - case ORANGE_BED: - case PINK_BED: - case PURPLE_BED: - case RED_BED: - case WHITE_BED: - case YELLOW_BED: - case BREWING_STAND : - case BOOKSHELF : - case CAKE: - case CHEST : - case DISPENSER : - case ENCHANTING_TABLE: - case ENDER_CHEST : - case OAK_FENCE_GATE: - case ACACIA_FENCE_GATE : - case DARK_OAK_FENCE_GATE : - case SPRUCE_FENCE_GATE : - case BIRCH_FENCE_GATE : - case JUNGLE_FENCE_GATE : - case FURNACE : - case JUKEBOX : - case LEVER : - case NOTE_BLOCK : - case STONE_BUTTON : - case OAK_BUTTON: - case BIRCH_BUTTON: - case ACACIA_BUTTON: - case DARK_OAK_BUTTON: - case JUNGLE_BUTTON: - case SPRUCE_BUTTON: - case ACACIA_TRAPDOOR: - case BIRCH_TRAPDOOR: - case DARK_OAK_TRAPDOOR: - case JUNGLE_TRAPDOOR: - case OAK_TRAPDOOR: - case SPRUCE_TRAPDOOR: - case WALL_SIGN : - case CRAFTING_TABLE: - case BEACON : - case ANVIL : - case DROPPER : - case HOPPER : - case TRAPPED_CHEST : - case IRON_DOOR : - case IRON_TRAPDOOR : - case OAK_DOOR: - case ACACIA_DOOR : - case SPRUCE_DOOR : - case BIRCH_DOOR : - case JUNGLE_DOOR : - case DARK_OAK_DOOR : - case OAK_FENCE: - case ACACIA_FENCE : - case DARK_OAK_FENCE : - case BIRCH_FENCE : - case JUNGLE_FENCE : - case SPRUCE_FENCE : - case ARMOR_STAND : - case BLACK_SHULKER_BOX : - case BLUE_SHULKER_BOX : - case BROWN_SHULKER_BOX : - case CYAN_SHULKER_BOX : - case GRAY_SHULKER_BOX : - case GREEN_SHULKER_BOX : - case LIGHT_BLUE_SHULKER_BOX : - case LIME_SHULKER_BOX : - case MAGENTA_SHULKER_BOX : - case ORANGE_SHULKER_BOX : - case PINK_SHULKER_BOX : - case PURPLE_SHULKER_BOX : - case RED_SHULKER_BOX : - case LIGHT_GRAY_SHULKER_BOX: - case WHITE_SHULKER_BOX : - case YELLOW_SHULKER_BOX : + case Material.BLACK_BED: + case Material.BLUE_BED: + case Material.BROWN_BED: + case Material.CYAN_BED: + case Material.GRAY_BED: + case Material.GREEN_BED: + case Material.LIGHT_BLUE_BED: + case Material.LIGHT_GRAY_BED: + case Material.LIME_BED: + case Material.MAGENTA_BED: + case Material.ORANGE_BED: + case Material.PINK_BED: + case Material.PURPLE_BED: + case Material.RED_BED: + case Material.WHITE_BED: + case Material.YELLOW_BED: + case Material.BREWING_STAND : + case Material.BOOKSHELF : + case Material.CAKE: + case Material.CHEST : + case Material.DISPENSER : + case Material.ENCHANTING_TABLE: + case Material.ENDER_CHEST : + case Material.OAK_FENCE_GATE: + case Material.ACACIA_FENCE_GATE : + case Material.DARK_OAK_FENCE_GATE : + case Material.SPRUCE_FENCE_GATE : + case Material.BIRCH_FENCE_GATE : + case Material.JUNGLE_FENCE_GATE : + case Material.FURNACE : + case Material.JUKEBOX : + case Material.LEVER : + case Material.NOTE_BLOCK : + case Material.STONE_BUTTON : + case Material.OAK_BUTTON: + case Material.BIRCH_BUTTON: + case Material.ACACIA_BUTTON: + case Material.DARK_OAK_BUTTON: + case Material.JUNGLE_BUTTON: + case Material.SPRUCE_BUTTON: + case Material.ACACIA_TRAPDOOR: + case Material.BIRCH_TRAPDOOR: + case Material.DARK_OAK_TRAPDOOR: + case Material.JUNGLE_TRAPDOOR: + case Material.OAK_TRAPDOOR: + case Material.SPRUCE_TRAPDOOR: + case Material.WALL_SIGN : + case Material.CRAFTING_TABLE: + case Material.BEACON : + case Material.ANVIL : + case Material.DROPPER : + case Material.HOPPER : + case Material.TRAPPED_CHEST : + case Material.IRON_DOOR : + case Material.IRON_TRAPDOOR : + case Material.OAK_DOOR: + case Material.ACACIA_DOOR : + case Material.SPRUCE_DOOR : + case Material.BIRCH_DOOR : + case Material.JUNGLE_DOOR : + case Material.DARK_OAK_DOOR : + case Material.OAK_FENCE: + case Material.ACACIA_FENCE : + case Material.DARK_OAK_FENCE : + case Material.BIRCH_FENCE : + case Material.JUNGLE_FENCE : + case Material.SPRUCE_FENCE : + case Material.ARMOR_STAND : + case Material.BLACK_SHULKER_BOX : + case Material.BLUE_SHULKER_BOX : + case Material.BROWN_SHULKER_BOX : + case Material.CYAN_SHULKER_BOX : + case Material.GRAY_SHULKER_BOX : + case Material.GREEN_SHULKER_BOX : + case Material.LIGHT_BLUE_SHULKER_BOX : + case Material.LIME_SHULKER_BOX : + case Material.MAGENTA_SHULKER_BOX : + case Material.ORANGE_SHULKER_BOX : + case Material.PINK_SHULKER_BOX : + case Material.PURPLE_SHULKER_BOX : + case Material.RED_SHULKER_BOX : + case Material.LIGHT_GRAY_SHULKER_BOX: + case Material.WHITE_SHULKER_BOX : + case Material.YELLOW_SHULKER_BOX : return false; default : @@ -139,114 +139,114 @@ public final class BlockUtils { */ public static boolean canActivateTools(BlockState blockState) { switch (blockState.getType()) { - case BLACK_BED: - case BLUE_BED: - case BROWN_BED: - case CYAN_BED: - case GRAY_BED: - case GREEN_BED: - case LIGHT_BLUE_BED: - case LIGHT_GRAY_BED: - case LIME_BED: - case MAGENTA_BED: - case ORANGE_BED: - case PINK_BED: - case PURPLE_BED: - case RED_BED: - case WHITE_BED: - case YELLOW_BED: - case BREWING_STAND : - case BOOKSHELF : - case CAKE: - case CHEST : - case DISPENSER : - case ENCHANTING_TABLE: - case ENDER_CHEST : - case OAK_FENCE_GATE: - case ACACIA_FENCE_GATE : - case DARK_OAK_FENCE_GATE : - case SPRUCE_FENCE_GATE : - case BIRCH_FENCE_GATE : - case JUNGLE_FENCE_GATE : - case FURNACE : - case JUKEBOX : - case LEVER : - case NOTE_BLOCK : - case STONE_BUTTON : - case OAK_BUTTON: - case BIRCH_BUTTON: - case ACACIA_BUTTON: - case DARK_OAK_BUTTON: - case JUNGLE_BUTTON: - case SPRUCE_BUTTON: - case ACACIA_TRAPDOOR: - case BIRCH_TRAPDOOR: - case DARK_OAK_TRAPDOOR: - case JUNGLE_TRAPDOOR: - case OAK_TRAPDOOR: - case SPRUCE_TRAPDOOR: - case WALL_SIGN : - case CRAFTING_TABLE: - case BEACON : - case ANVIL : - case DROPPER : - case HOPPER : - case TRAPPED_CHEST : - case IRON_DOOR : - case IRON_TRAPDOOR : - case OAK_DOOR: - case ACACIA_DOOR : - case SPRUCE_DOOR : - case BIRCH_DOOR : - case JUNGLE_DOOR : - case DARK_OAK_DOOR : - case OAK_FENCE: - case ACACIA_FENCE : - case DARK_OAK_FENCE : - case BIRCH_FENCE : - case JUNGLE_FENCE : - case SPRUCE_FENCE : - case ARMOR_STAND : - case BLACK_SHULKER_BOX : - case BLUE_SHULKER_BOX : - case BROWN_SHULKER_BOX : - case CYAN_SHULKER_BOX : - case GRAY_SHULKER_BOX : - case GREEN_SHULKER_BOX : - case LIGHT_BLUE_SHULKER_BOX : - case LIME_SHULKER_BOX : - case MAGENTA_SHULKER_BOX : - case ORANGE_SHULKER_BOX : - case PINK_SHULKER_BOX : - case PURPLE_SHULKER_BOX : - case RED_SHULKER_BOX : - case LIGHT_GRAY_SHULKER_BOX: - case WHITE_SHULKER_BOX : - case YELLOW_SHULKER_BOX : - case STRIPPED_ACACIA_LOG: - case STRIPPED_ACACIA_WOOD: - case STRIPPED_BIRCH_LOG: - case STRIPPED_BIRCH_WOOD: - case STRIPPED_DARK_OAK_LOG: - case STRIPPED_DARK_OAK_WOOD: - case STRIPPED_JUNGLE_LOG: - case STRIPPED_JUNGLE_WOOD: - case STRIPPED_OAK_LOG: - case STRIPPED_OAK_WOOD: - case STRIPPED_SPRUCE_LOG: - case STRIPPED_SPRUCE_WOOD: - case ACACIA_LOG: - case ACACIA_WOOD: - case BIRCH_LOG: - case BIRCH_WOOD: - case DARK_OAK_LOG: - case DARK_OAK_WOOD: - case JUNGLE_LOG: - case JUNGLE_WOOD: - case OAK_LOG: - case OAK_WOOD: - case SPRUCE_LOG: - case SPRUCE_WOOD: + case Material.BLACK_BED: + case Material.BLUE_BED: + case Material.BROWN_BED: + case Material.CYAN_BED: + case Material.GRAY_BED: + case Material.GREEN_BED: + case Material.LIGHT_BLUE_BED: + case Material.LIGHT_GRAY_BED: + case Material.LIME_BED: + case Material.MAGENTA_BED: + case Material.ORANGE_BED: + case Material.PINK_BED: + case Material.PURPLE_BED: + case Material.RED_BED: + case Material.WHITE_BED: + case Material.YELLOW_BED: + case Material.BREWING_STAND : + case Material.BOOKSHELF : + case Material.CAKE: + case Material.CHEST : + case Material.DISPENSER : + case Material.ENCHANTING_TABLE: + case Material.ENDER_CHEST : + case Material.OAK_FENCE_GATE: + case Material.ACACIA_FENCE_GATE : + case Material.DARK_OAK_FENCE_GATE : + case Material.SPRUCE_FENCE_GATE : + case Material.BIRCH_FENCE_GATE : + case Material.JUNGLE_FENCE_GATE : + case Material.FURNACE : + case Material.JUKEBOX : + case Material.LEVER : + case Material.NOTE_BLOCK : + case Material.STONE_BUTTON : + case Material.OAK_BUTTON: + case Material.BIRCH_BUTTON: + case Material.ACACIA_BUTTON: + case Material.DARK_OAK_BUTTON: + case Material.JUNGLE_BUTTON: + case Material.SPRUCE_BUTTON: + case Material.ACACIA_TRAPDOOR: + case Material.BIRCH_TRAPDOOR: + case Material.DARK_OAK_TRAPDOOR: + case Material.JUNGLE_TRAPDOOR: + case Material.OAK_TRAPDOOR: + case Material.SPRUCE_TRAPDOOR: + case Material.WALL_SIGN : + case Material.CRAFTING_TABLE: + case Material.BEACON : + case Material.ANVIL : + case Material.DROPPER : + case Material.HOPPER : + case Material.TRAPPED_CHEST : + case Material.IRON_DOOR : + case Material.IRON_TRAPDOOR : + case Material.OAK_DOOR: + case Material.ACACIA_DOOR : + case Material.SPRUCE_DOOR : + case Material.BIRCH_DOOR : + case Material.JUNGLE_DOOR : + case Material.DARK_OAK_DOOR : + case Material.OAK_FENCE: + case Material.ACACIA_FENCE : + case Material.DARK_OAK_FENCE : + case Material.BIRCH_FENCE : + case Material.JUNGLE_FENCE : + case Material.SPRUCE_FENCE : + case Material.ARMOR_STAND : + case Material.BLACK_SHULKER_BOX : + case Material.BLUE_SHULKER_BOX : + case Material.BROWN_SHULKER_BOX : + case Material.CYAN_SHULKER_BOX : + case Material.GRAY_SHULKER_BOX : + case Material.GREEN_SHULKER_BOX : + case Material.LIGHT_BLUE_SHULKER_BOX : + case Material.LIME_SHULKER_BOX : + case Material.MAGENTA_SHULKER_BOX : + case Material.ORANGE_SHULKER_BOX : + case Material.PINK_SHULKER_BOX : + case Material.PURPLE_SHULKER_BOX : + case Material.RED_SHULKER_BOX : + case Material.LIGHT_GRAY_SHULKER_BOX: + case Material.WHITE_SHULKER_BOX : + case Material.YELLOW_SHULKER_BOX : + case Material.STRIPPED_ACACIA_LOG: + case Material.STRIPPED_ACACIA_WOOD: + case Material.STRIPPED_BIRCH_LOG: + case Material.STRIPPED_BIRCH_WOOD: + case Material.STRIPPED_DARK_OAK_LOG: + case Material.STRIPPED_DARK_OAK_WOOD: + case Material.STRIPPED_JUNGLE_LOG: + case Material.STRIPPED_JUNGLE_WOOD: + case Material.STRIPPED_OAK_LOG: + case Material.STRIPPED_OAK_WOOD: + case Material.STRIPPED_SPRUCE_LOG: + case Material.STRIPPED_SPRUCE_WOOD: + case Material.ACACIA_LOG: + case Material.ACACIA_WOOD: + case Material.BIRCH_LOG: + case Material.BIRCH_WOOD: + case Material.DARK_OAK_LOG: + case Material.DARK_OAK_WOOD: + case Material.JUNGLE_LOG: + case Material.JUNGLE_WOOD: + case Material.OAK_LOG: + case Material.OAK_WOOD: + case Material.SPRUCE_LOG: + case Material.SPRUCE_WOOD: return false; default : @@ -274,15 +274,15 @@ public final class BlockUtils { */ public static boolean canMakeMossy(BlockState blockState) { switch (blockState.getType()) { - case COBBLESTONE : - case DIRT : - case GRASS_PATH : + case Material.COBBLESTONE : + case Material.DIRT : + case Material.GRASS_PATH : return true; - case STONE_BRICKS: + case Material.STONE_BRICKS: return true; - case COBBLESTONE_WALL: + case Material.COBBLESTONE_WALL: return true; default : @@ -356,12 +356,12 @@ public final class BlockUtils { */ public static boolean isLeaves(BlockState blockState) { switch (blockState.getType()) { - case OAK_LEAVES: - case ACACIA_LEAVES: - case BIRCH_LEAVES: - case DARK_OAK_LEAVES: - case JUNGLE_LEAVES: - case SPRUCE_LEAVES: + case Material.OAK_LEAVES: + case Material.ACACIA_LEAVES: + case Material.BIRCH_LEAVES: + case Material.DARK_OAK_LEAVES: + case Material.JUNGLE_LEAVES: + case Material.SPRUCE_LEAVES: return true; default : @@ -378,8 +378,8 @@ public final class BlockUtils { */ public static boolean affectedByFluxMining(BlockState blockState) { switch (blockState.getType()) { - case IRON_ORE : - case GOLD_ORE : + case Material.IRON_ORE : + case Material.GOLD_ORE : return true; default : @@ -397,10 +397,10 @@ public final class BlockUtils { */ public static boolean canActivateHerbalism(BlockState blockState) { switch (blockState.getType()) { - case DIRT : - case GRASS : - case GRASS_PATH : - case FARMLAND: + case Material.DIRT : + case Material.GRASS : + case Material.GRASS_PATH : + case Material.FARMLAND: return false; default : @@ -418,7 +418,7 @@ public final class BlockUtils { */ public static boolean affectedByBlockCracker(BlockState blockState) { switch (blockState.getType()) { - case STONE_BRICKS: + case Material.STONE_BRICKS: return true; default : @@ -435,9 +435,9 @@ public final class BlockUtils { */ public static boolean canMakeShroomy(BlockState blockState) { switch (blockState.getType()) { - case DIRT : - case GRASS : - case GRASS_PATH : + case Material.DIRT : + case Material.GRASS : + case Material.GRASS_PATH : return true; default : diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/ChimaeraWing.java b/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java similarity index 93% rename from bukkit/src/main/java/com/gmail/nossr50/util/ChimaeraWing.java rename to core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java index e1738c3bf..63e1832a1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/ChimaeraWing.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java @@ -1,17 +1,17 @@ -package com.gmail.nossr50.util; +package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.player.NotificationManager; +import com.gmail.nossr50.core.util.skills.CombatUtils; +import com.gmail.nossr50.core.util.skills.SkillUtils; +import com.gmail.nossr50.core.util.sounds.SoundManager; +import com.gmail.nossr50.core.util.sounds.SoundType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.runnables.items.ChimaeraWingWarmup; -import com.gmail.nossr50.util.player.NotificationManager; +import com.gmail.nossr50.core.runnables.items.ChimaeraWingWarmup; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.skills.CombatUtils; -import com.gmail.nossr50.util.skills.SkillUtils; -import com.gmail.nossr50.util.sounds.SoundManager; -import com.gmail.nossr50.util.sounds.SoundType; import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/EnchantmentUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/EnchantmentUtils.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/util/EnchantmentUtils.java rename to core/src/main/java/com/gmail/nossr50/core/util/EnchantmentUtils.java index ad71ea747..33d3e0a7b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/EnchantmentUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/EnchantmentUtils.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util; +package com.gmail.nossr50.core.util; import org.bukkit.enchantments.Enchantment; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/EventUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/EventUtils.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/util/EventUtils.java rename to core/src/main/java/com/gmail/nossr50/core/util/EventUtils.java index 41a1fabe1..3b8c6f143 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/EventUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/EventUtils.java @@ -1,14 +1,14 @@ -package com.gmail.nossr50.util; +package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; -import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SuperAbilityType; +import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.events.experience.McMMOPlayerLevelChangeEvent; import com.gmail.nossr50.events.experience.McMMOPlayerLevelDownEvent; import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent; @@ -28,10 +28,10 @@ import com.gmail.nossr50.events.skills.repair.McMMOPlayerRepairCheckEvent; import com.gmail.nossr50.events.skills.salvage.McMMOPlayerSalvageCheckEvent; import com.gmail.nossr50.events.skills.secondaryabilities.SubSkillEvent; import com.gmail.nossr50.events.skills.unarmed.McMMOPlayerDisarmEvent; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.skills.CombatUtils; +import com.gmail.nossr50.core.util.skills.CombatUtils; import org.bukkit.block.Block; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Entity; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/HardcoreManager.java b/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/util/HardcoreManager.java rename to core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java index 4ade50c0f..7ac15590a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/HardcoreManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java @@ -1,10 +1,10 @@ -package com.gmail.nossr50.util; +package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.util.player.NotificationManager; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.util.player.NotificationManager; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/HolidayManager.java b/core/src/main/java/com/gmail/nossr50/core/util/HolidayManager.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/util/HolidayManager.java rename to core/src/main/java/com/gmail/nossr50/core/util/HolidayManager.java index a56f79c14..cec47e1a9 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/HolidayManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/HolidayManager.java @@ -1,15 +1,15 @@ -package com.gmail.nossr50.util; +package com.gmail.nossr50.core.util; import com.gmail.nossr50.commands.skills.AprilCommand; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.player.NotificationManager; +import com.gmail.nossr50.core.util.player.NotificationManager; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.skills.ParticleEffectUtils; -import com.gmail.nossr50.util.sounds.SoundManager; -import com.gmail.nossr50.util.sounds.SoundType; +import com.gmail.nossr50.core.util.skills.ParticleEffectUtils; +import com.gmail.nossr50.core.util.sounds.SoundManager; +import com.gmail.nossr50.core.util.sounds.SoundType; import com.google.common.collect.ImmutableList; import org.bukkit.*; import org.bukkit.FireworkEffect.Type; @@ -60,30 +60,30 @@ public final class HolidayManager { public static FakeSkillType getByStatistic(Statistic statistic) { switch (statistic) { - case DAMAGE_TAKEN: + case Statistic.DAMAGE_TAKEN: return FakeSkillType.MACHO; - case JUMP: + case Statistic.JUMP: return FakeSkillType.JUMPING; - case DROP: + case Statistic.DROP: return FakeSkillType.THROWING; - case MINE_BLOCK: - case BREAK_ITEM: + case Statistic.MINE_BLOCK: + case Statistic.BREAK_ITEM: return FakeSkillType.WRECKING; - case CRAFT_ITEM: + case Statistic.CRAFT_ITEM: return FakeSkillType.CRAFTING; - case WALK_ONE_CM: + case Statistic.WALK_ONE_CM: return FakeSkillType.WALKING; - case SWIM_ONE_CM: + case Statistic.SWIM_ONE_CM: return FakeSkillType.SWIMMING; - case FALL_ONE_CM: + case Statistic.FALL_ONE_CM: return FakeSkillType.FALLING; - case CLIMB_ONE_CM: + case Statistic.CLIMB_ONE_CM: return FakeSkillType.CLIMBING; - case FLY_ONE_CM: + case Statistic.FLY_ONE_CM: return FakeSkillType.FLYING; - case WALK_UNDER_WATER_ONE_CM: + case Statistic.WALK_UNDER_WATER_ONE_CM: return FakeSkillType.DIVING; - case PIG_ONE_CM: + case Statistic.PIG_ONE_CM: return FakeSkillType.PIGGY; default: return FakeSkillType.UNKNOWN; @@ -334,20 +334,20 @@ public final class HolidayManager { int modifier; switch (statistic) { - case DAMAGE_TAKEN: + case Statistic.DAMAGE_TAKEN: modifier = 500; break; - case JUMP: + case Statistic.JUMP: modifier = 500; break; - case DROP: + case Statistic.DROP: modifier = 200; break; - case MINE_BLOCK: - case BREAK_ITEM: + case Statistic.MINE_BLOCK: + case Statistic.BREAK_ITEM: modifier = 500; break; - case CRAFT_ITEM: + case Statistic.CRAFT_ITEM: modifier = 100; break; default: diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/ItemUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java similarity index 62% rename from bukkit/src/main/java/com/gmail/nossr50/util/ItemUtils.java rename to core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java index daa15b982..709bfa87e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/ItemUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java @@ -1,8 +1,8 @@ -package com.gmail.nossr50.util; +package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.party.ItemWeightConfig; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -24,7 +24,7 @@ public final class ItemUtils { Material type = item.getType(); switch (type) { - case BOW: + case Material.BOW: return true; default: @@ -42,11 +42,11 @@ public final class ItemUtils { Material type = item.getType(); switch (type) { - case DIAMOND_SWORD: - case GOLDEN_SWORD: - case IRON_SWORD: - case STONE_SWORD: - case WOODEN_SWORD: + case Material.DIAMOND_SWORD: + case Material.GOLDEN_SWORD: + case Material.IRON_SWORD: + case Material.STONE_SWORD: + case Material.WOODEN_SWORD: return true; default: @@ -64,11 +64,11 @@ public final class ItemUtils { Material type = item.getType(); switch (type) { - case DIAMOND_HOE: - case GOLDEN_HOE: - case IRON_HOE: - case STONE_HOE: - case WOODEN_HOE: + case Material.DIAMOND_HOE: + case Material.GOLDEN_HOE: + case Material.IRON_HOE: + case Material.STONE_HOE: + case Material.WOODEN_HOE: return true; default: @@ -86,11 +86,11 @@ public final class ItemUtils { Material type = item.getType(); switch (type) { - case DIAMOND_SHOVEL: - case GOLDEN_SHOVEL: - case IRON_SHOVEL: - case STONE_SHOVEL: - case WOODEN_SHOVEL: + case Material.DIAMOND_SHOVEL: + case Material.GOLDEN_SHOVEL: + case Material.IRON_SHOVEL: + case Material.STONE_SHOVEL: + case Material.WOODEN_SHOVEL: return true; default: @@ -108,11 +108,11 @@ public final class ItemUtils { Material type = item.getType(); switch (type) { - case DIAMOND_AXE: - case GOLDEN_AXE: - case IRON_AXE: - case STONE_AXE: - case WOODEN_AXE: + case Material.DIAMOND_AXE: + case Material.GOLDEN_AXE: + case Material.IRON_AXE: + case Material.STONE_AXE: + case Material.WOODEN_AXE: return true; default: @@ -130,11 +130,11 @@ public final class ItemUtils { Material type = item.getType(); switch (type) { - case DIAMOND_PICKAXE: - case GOLDEN_PICKAXE: - case IRON_PICKAXE: - case STONE_PICKAXE: - case WOODEN_PICKAXE: + case Material.DIAMOND_PICKAXE: + case Material.GOLDEN_PICKAXE: + case Material.IRON_PICKAXE: + case Material.STONE_PICKAXE: + case Material.WOODEN_PICKAXE: return true; default: @@ -166,11 +166,11 @@ public final class ItemUtils { Material type = item.getType(); switch (type) { - case DIAMOND_HELMET: - case GOLDEN_HELMET: - case IRON_HELMET: - case CHAINMAIL_HELMET: - case LEATHER_HELMET: + case Material.DIAMOND_HELMET: + case Material.GOLDEN_HELMET: + case Material.IRON_HELMET: + case Material.CHAINMAIL_HELMET: + case Material.LEATHER_HELMET: return true; default: @@ -188,11 +188,11 @@ public final class ItemUtils { Material type = item.getType(); switch (type) { - case DIAMOND_CHESTPLATE: - case GOLDEN_CHESTPLATE: - case IRON_CHESTPLATE: - case CHAINMAIL_CHESTPLATE: - case LEATHER_CHESTPLATE: + case Material.DIAMOND_CHESTPLATE: + case Material.GOLDEN_CHESTPLATE: + case Material.IRON_CHESTPLATE: + case Material.CHAINMAIL_CHESTPLATE: + case Material.LEATHER_CHESTPLATE: return true; default: @@ -210,11 +210,11 @@ public final class ItemUtils { Material type = item.getType(); switch (type) { - case DIAMOND_LEGGINGS: - case GOLDEN_LEGGINGS: - case IRON_LEGGINGS: - case CHAINMAIL_LEGGINGS: - case LEATHER_LEGGINGS: + case Material.DIAMOND_LEGGINGS: + case Material.GOLDEN_LEGGINGS: + case Material.IRON_LEGGINGS: + case Material.CHAINMAIL_LEGGINGS: + case Material.LEATHER_LEGGINGS: return true; default: @@ -232,11 +232,11 @@ public final class ItemUtils { Material type = item.getType(); switch (type) { - case DIAMOND_BOOTS: - case GOLDEN_BOOTS: - case IRON_BOOTS: - case CHAINMAIL_BOOTS: - case LEATHER_BOOTS: + case Material.DIAMOND_BOOTS: + case Material.GOLDEN_BOOTS: + case Material.IRON_BOOTS: + case Material.CHAINMAIL_BOOTS: + case Material.LEATHER_BOOTS: return true; default: @@ -272,10 +272,10 @@ public final class ItemUtils { */ public static boolean isLeatherArmor(ItemStack item) { switch (item.getType()) { - case LEATHER_BOOTS: - case LEATHER_CHESTPLATE: - case LEATHER_HELMET: - case LEATHER_LEGGINGS: + case Material.LEATHER_BOOTS: + case Material.LEATHER_CHESTPLATE: + case Material.LEATHER_HELMET: + case Material.LEATHER_LEGGINGS: return true; default: @@ -291,10 +291,10 @@ public final class ItemUtils { */ public static boolean isGoldArmor(ItemStack item) { switch (item.getType()) { - case GOLDEN_BOOTS: - case GOLDEN_CHESTPLATE: - case GOLDEN_HELMET: - case GOLDEN_LEGGINGS: + case Material.GOLDEN_BOOTS: + case Material.GOLDEN_CHESTPLATE: + case Material.GOLDEN_HELMET: + case Material.GOLDEN_LEGGINGS: return true; default: @@ -310,10 +310,10 @@ public final class ItemUtils { */ public static boolean isIronArmor(ItemStack item) { switch (item.getType()) { - case IRON_BOOTS: - case IRON_CHESTPLATE: - case IRON_HELMET: - case IRON_LEGGINGS: + case Material.IRON_BOOTS: + case Material.IRON_CHESTPLATE: + case Material.IRON_HELMET: + case Material.IRON_LEGGINGS: return true; default: @@ -329,10 +329,10 @@ public final class ItemUtils { */ public static boolean isDiamondArmor(ItemStack item) { switch (item.getType()) { - case DIAMOND_BOOTS: - case DIAMOND_CHESTPLATE: - case DIAMOND_HELMET: - case DIAMOND_LEGGINGS: + case Material.DIAMOND_BOOTS: + case Material.DIAMOND_CHESTPLATE: + case Material.DIAMOND_HELMET: + case Material.DIAMOND_LEGGINGS: return true; default: @@ -348,10 +348,10 @@ public final class ItemUtils { */ public static boolean isChainmailArmor(ItemStack item) { switch (item.getType()) { - case CHAINMAIL_BOOTS: - case CHAINMAIL_CHESTPLATE: - case CHAINMAIL_HELMET: - case CHAINMAIL_LEGGINGS: + case Material.CHAINMAIL_BOOTS: + case Material.CHAINMAIL_CHESTPLATE: + case Material.CHAINMAIL_HELMET: + case Material.CHAINMAIL_LEGGINGS: return true; default: @@ -377,11 +377,11 @@ public final class ItemUtils { */ public static boolean isStoneTool(ItemStack item) { switch (item.getType()) { - case STONE_AXE: - case STONE_HOE: - case STONE_PICKAXE: - case STONE_SHOVEL: - case STONE_SWORD: + case Material.STONE_AXE: + case Material.STONE_HOE: + case Material.STONE_PICKAXE: + case Material.STONE_SHOVEL: + case Material.STONE_SWORD: return true; default: @@ -397,11 +397,11 @@ public final class ItemUtils { */ public static boolean isWoodTool(ItemStack item) { switch (item.getType()) { - case WOODEN_AXE: - case WOODEN_HOE: - case WOODEN_PICKAXE: - case WOODEN_SHOVEL: - case WOODEN_SWORD: + case Material.WOODEN_AXE: + case Material.WOODEN_HOE: + case Material.WOODEN_PICKAXE: + case Material.WOODEN_SHOVEL: + case Material.WOODEN_SWORD: return true; default: @@ -417,9 +417,9 @@ public final class ItemUtils { */ public static boolean isStringTool(ItemStack item) { switch (item.getType()) { - case BOW: - case CARROT_ON_A_STICK: - case FISHING_ROD: + case Material.BOW: + case Material.CARROT_ON_A_STICK: + case Material.FISHING_ROD: return true; default: @@ -435,11 +435,11 @@ public final class ItemUtils { */ public static boolean isGoldTool(ItemStack item) { switch (item.getType()) { - case GOLDEN_AXE: - case GOLDEN_HOE: - case GOLDEN_PICKAXE: - case GOLDEN_SHOVEL: - case GOLDEN_SWORD: + case Material.GOLDEN_AXE: + case Material.GOLDEN_HOE: + case Material.GOLDEN_PICKAXE: + case Material.GOLDEN_SHOVEL: + case Material.GOLDEN_SWORD: return true; default: @@ -455,14 +455,14 @@ public final class ItemUtils { */ public static boolean isIronTool(ItemStack item) { switch (item.getType()) { - case BUCKET: - case FLINT_AND_STEEL: - case IRON_AXE: - case IRON_HOE: - case IRON_PICKAXE: - case IRON_SHOVEL: - case IRON_SWORD: - case SHEARS: + case Material.BUCKET: + case Material.FLINT_AND_STEEL: + case Material.IRON_AXE: + case Material.IRON_HOE: + case Material.IRON_PICKAXE: + case Material.IRON_SHOVEL: + case Material.IRON_SWORD: + case Material.SHEARS: return true; default: @@ -478,11 +478,11 @@ public final class ItemUtils { */ public static boolean isDiamondTool(ItemStack item) { switch (item.getType()) { - case DIAMOND_AXE: - case DIAMOND_HOE: - case DIAMOND_PICKAXE: - case DIAMOND_SHOVEL: - case DIAMOND_SWORD: + case Material.DIAMOND_AXE: + case Material.DIAMOND_HOE: + case Material.DIAMOND_PICKAXE: + case Material.DIAMOND_SHOVEL: + case Material.DIAMOND_SWORD: return true; default: @@ -498,12 +498,12 @@ public final class ItemUtils { */ public static boolean isEnchantable(ItemStack item) { switch (item.getType()) { - case ENCHANTED_BOOK: - case SHEARS: - case FISHING_ROD: - case CARROT_ON_A_STICK: - case FLINT_AND_STEEL: - case TRIDENT: + case Material.ENCHANTED_BOOK: + case Material.SHEARS: + case Material.FISHING_ROD: + case Material.CARROT_ON_A_STICK: + case Material.FLINT_AND_STEEL: + case Material.TRIDENT: return true; default: @@ -553,21 +553,21 @@ public final class ItemUtils { */ public static boolean isMiningDrop(ItemStack item) { switch (item.getType()) { - case COAL: - case COAL_ORE: - case DIAMOND: - case DIAMOND_ORE: - case EMERALD: - case EMERALD_ORE: - case GOLD_ORE: - case IRON_ORE: - case LAPIS_ORE: - case REDSTONE_ORE: // Should we also have Glowing Redstone Ore here? - case REDSTONE: - case GLOWSTONE_DUST: // Should we also have Glowstone here? - case QUARTZ: - case NETHER_QUARTZ_ORE: - case LAPIS_LAZULI: + case Material.COAL: + case Material.COAL_ORE: + case Material.DIAMOND: + case Material.DIAMOND_ORE: + case Material.EMERALD: + case Material.EMERALD_ORE: + case Material.GOLD_ORE: + case Material.IRON_ORE: + case Material.LAPIS_ORE: + case Material.REDSTONE_ORE: // Should we also have Glowing Redstone Ore here? + case Material.REDSTONE: + case Material.GLOWSTONE_DUST: // Should we also have Glowstone here? + case Material.QUARTZ: + case Material.NETHER_QUARTZ_ORE: + case Material.LAPIS_LAZULI: return true; default: @@ -583,29 +583,29 @@ public final class ItemUtils { */ public static boolean isHerbalismDrop(ItemStack item) { switch (item.getType()) { - case WHEAT: - case WHEAT_SEEDS: - case CARROT: - case CHORUS_FRUIT: - case CHORUS_FLOWER: - case POTATO: - case BEETROOT: - case BEETROOT_SEEDS: - case NETHER_WART: - case BROWN_MUSHROOM: - case RED_MUSHROOM: - case ROSE_RED: - case DANDELION_YELLOW: - case CACTUS: - case SUGAR_CANE: - case MELON: - case MELON_SEEDS: - case PUMPKIN: - case PUMPKIN_SEEDS: - case LILY_PAD: - case VINE: - case TALL_GRASS: - case COCOA_BEANS: + case Material.WHEAT: + case Material.WHEAT_SEEDS: + case Material.CARROT: + case Material.CHORUS_FRUIT: + case Material.CHORUS_FLOWER: + case Material.POTATO: + case Material.BEETROOT: + case Material.BEETROOT_SEEDS: + case Material.NETHER_WART: + case Material.BROWN_MUSHROOM: + case Material.RED_MUSHROOM: + case Material.ROSE_RED: + case Material.DANDELION_YELLOW: + case Material.CACTUS: + case Material.SUGAR_CANE: + case Material.MELON: + case Material.MELON_SEEDS: + case Material.PUMPKIN: + case Material.PUMPKIN_SEEDS: + case Material.LILY_PAD: + case Material.VINE: + case Material.TALL_GRASS: + case Material.COCOA_BEANS: return true; default: @@ -621,48 +621,48 @@ public final class ItemUtils { */ public static boolean isMobDrop(ItemStack item) { switch (item.getType()) { - case STRING: - case FEATHER: - case CHICKEN: - case COOKED_CHICKEN: - case LEATHER: - case BEEF: - case COOKED_BEEF: - case PORKCHOP: - case COOKED_PORKCHOP: - case WHITE_WOOL: - case BLACK_WOOL: - case BLUE_WOOL: - case BROWN_WOOL: - case CYAN_WOOL: - case GRAY_WOOL: - case GREEN_WOOL: - case LIGHT_BLUE_WOOL: - case LIGHT_GRAY_WOOL: - case LIME_WOOL: - case MAGENTA_WOOL: - case ORANGE_WOOL: - case PINK_WOOL: - case PURPLE_WOOL: - case RED_WOOL: - case YELLOW_WOOL: - case IRON_INGOT: - case SNOWBALL: - case BLAZE_ROD: - case SPIDER_EYE: - case GUNPOWDER: - case ENDER_PEARL: - case GHAST_TEAR: - case MAGMA_CREAM: - case BONE: - case ARROW: - case SLIME_BALL: - case NETHER_STAR: - case ROTTEN_FLESH: - case GOLD_NUGGET: - case EGG: - case ROSE_RED: - case COAL: + case Material.STRING: + case Material.FEATHER: + case Material.CHICKEN: + case Material.COOKED_CHICKEN: + case Material.LEATHER: + case Material.BEEF: + case Material.COOKED_BEEF: + case Material.PORKCHOP: + case Material.COOKED_PORKCHOP: + case Material.WHITE_WOOL: + case Material.BLACK_WOOL: + case Material.BLUE_WOOL: + case Material.BROWN_WOOL: + case Material.CYAN_WOOL: + case Material.GRAY_WOOL: + case Material.GREEN_WOOL: + case Material.LIGHT_BLUE_WOOL: + case Material.LIGHT_GRAY_WOOL: + case Material.LIME_WOOL: + case Material.MAGENTA_WOOL: + case Material.ORANGE_WOOL: + case Material.PINK_WOOL: + case Material.PURPLE_WOOL: + case Material.RED_WOOL: + case Material.YELLOW_WOOL: + case Material.IRON_INGOT: + case Material.SNOWBALL: + case Material.BLAZE_ROD: + case Material.SPIDER_EYE: + case Material.GUNPOWDER: + case Material.ENDER_PEARL: + case Material.GHAST_TEAR: + case Material.MAGMA_CREAM: + case Material.BONE: + case Material.ARROW: + case Material.SLIME_BALL: + case Material.NETHER_STAR: + case Material.ROTTEN_FLESH: + case Material.GOLD_NUGGET: + case Material.EGG: + case Material.ROSE_RED: + case Material.COAL: return true; default: @@ -678,31 +678,31 @@ public final class ItemUtils { */ public static boolean isWoodcuttingDrop(ItemStack item) { switch (item.getType()) { - case ACACIA_LOG: - case BIRCH_LOG: - case DARK_OAK_LOG: - case JUNGLE_LOG: - case OAK_LOG: - case SPRUCE_LOG: - case STRIPPED_ACACIA_LOG: - case STRIPPED_BIRCH_LOG: - case STRIPPED_DARK_OAK_LOG: - case STRIPPED_JUNGLE_LOG: - case STRIPPED_OAK_LOG: - case STRIPPED_SPRUCE_LOG: - case ACACIA_SAPLING: - case SPRUCE_SAPLING: - case BIRCH_SAPLING: - case DARK_OAK_SAPLING: - case JUNGLE_SAPLING: - case OAK_SAPLING: - case ACACIA_LEAVES: - case BIRCH_LEAVES: - case DARK_OAK_LEAVES: - case JUNGLE_LEAVES: - case OAK_LEAVES: - case SPRUCE_LEAVES: - case APPLE: + case Material.ACACIA_LOG: + case Material.BIRCH_LOG: + case Material.DARK_OAK_LOG: + case Material.JUNGLE_LOG: + case Material.OAK_LOG: + case Material.SPRUCE_LOG: + case Material.STRIPPED_ACACIA_LOG: + case Material.STRIPPED_BIRCH_LOG: + case Material.STRIPPED_DARK_OAK_LOG: + case Material.STRIPPED_JUNGLE_LOG: + case Material.STRIPPED_OAK_LOG: + case Material.STRIPPED_SPRUCE_LOG: + case Material.ACACIA_SAPLING: + case Material.SPRUCE_SAPLING: + case Material.BIRCH_SAPLING: + case Material.DARK_OAK_SAPLING: + case Material.JUNGLE_SAPLING: + case Material.OAK_SAPLING: + case Material.ACACIA_LEAVES: + case Material.BIRCH_LEAVES: + case Material.DARK_OAK_LEAVES: + case Material.JUNGLE_LEAVES: + case Material.OAK_LEAVES: + case Material.SPRUCE_LEAVES: + case Material.APPLE: return true; default: diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/LogFilter.java b/core/src/main/java/com/gmail/nossr50/core/util/LogFilter.java similarity index 93% rename from bukkit/src/main/java/com/gmail/nossr50/util/LogFilter.java rename to core/src/main/java/com/gmail/nossr50/core/util/LogFilter.java index fde20cd1e..6c19f22d5 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/LogFilter.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/LogFilter.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util; +package com.gmail.nossr50.core.util; import com.gmail.nossr50.mcMMO; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/MaterialUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/MaterialUtils.java new file mode 100644 index 000000000..698936c1c --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/util/MaterialUtils.java @@ -0,0 +1,24 @@ +package com.gmail.nossr50.core.util; + +import com.gmail.nossr50.mcMMO; +import org.bukkit.Material; + +public final class MaterialUtils { + private MaterialUtils() {} + + protected static boolean isOre(Material data) { + switch (data) { + case Material.COAL_ORE: + case Material.DIAMOND_ORE: + case Material.NETHER_QUARTZ_ORE: + case Material.GOLD_ORE: + case Material.IRON_ORE: + case Material.LAPIS_ORE: + case Material.REDSTONE_ORE: + case Material.EMERALD_ORE: + return true; + default: + return mcMMO.getModManager().isCustomOre(data); + } + } +} diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/Misc.java b/core/src/main/java/com/gmail/nossr50/core/util/Misc.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/util/Misc.java rename to core/src/main/java/com/gmail/nossr50/core/util/Misc.java index 0b6dca19f..48ace8dab 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/Misc.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/Misc.java @@ -1,8 +1,8 @@ -package com.gmail.nossr50.util; +package com.gmail.nossr50.core.util; import com.gmail.nossr50.events.items.McMMOItemSpawnEvent; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask; +import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask; import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableSet; import org.bukkit.Location; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java rename to core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java index 3f4aa12b1..55826c168 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java @@ -1,11 +1,11 @@ -package com.gmail.nossr50.util; +package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.datatypes.MobHealthbarType; +import com.gmail.nossr50.core.skills.MobHealthbarType; import com.gmail.nossr50.core.datatypes.meta.OldName; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.runnables.MobHealthDisplayUpdaterTask; +import com.gmail.nossr50.core.runnables.MobHealthDisplayUpdaterTask; import org.bukkit.ChatColor; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -155,8 +155,8 @@ public final class MobHealthbarUtils { */ private static boolean isBoss(LivingEntity livingEntity) { switch (livingEntity.getType()) { - case ENDER_DRAGON: - case WITHER: + case EntityType.ENDER_DRAGON: + case EntityType.WITHER: return true; default: diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/ModManager.java b/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java similarity index 99% rename from bukkit/src/main/java/com/gmail/nossr50/util/ModManager.java rename to core/src/main/java/com/gmail/nossr50/core/util/ModManager.java index 8201328cd..0585613b4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/ModManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util; +package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.mods.CustomArmorConfig; @@ -9,7 +9,7 @@ import com.gmail.nossr50.core.datatypes.mods.CustomBlock; import com.gmail.nossr50.core.datatypes.mods.CustomEntity; import com.gmail.nossr50.core.datatypes.mods.CustomTool; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.repair.repairables.Repairable; +import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; import org.bukkit.Material; import org.bukkit.block.BlockState; import org.bukkit.configuration.file.YamlConfiguration; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/Motd.java b/core/src/main/java/com/gmail/nossr50/core/util/Motd.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/util/Motd.java rename to core/src/main/java/com/gmail/nossr50/core/util/Motd.java index 0d627523d..b675c539f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/Motd.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/Motd.java @@ -1,10 +1,10 @@ -package com.gmail.nossr50.util; +package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.skills.PerksUtils; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.skills.PerksUtils; import org.bukkit.entity.Player; import org.bukkit.plugin.PluginDescriptionFile; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/Permissions.java b/core/src/main/java/com/gmail/nossr50/core/util/Permissions.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/util/Permissions.java rename to core/src/main/java/com/gmail/nossr50/core/util/Permissions.java index bb9342e71..aaea517dc 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/Permissions.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/Permissions.java @@ -1,11 +1,11 @@ -package com.gmail.nossr50.util; +package com.gmail.nossr50.core.util; import com.gmail.nossr50.commands.party.PartySubcommandType; -import com.gmail.nossr50.core.datatypes.skills.ItemType; -import com.gmail.nossr50.core.datatypes.skills.MaterialType; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.skills.ItemType; +import com.gmail.nossr50.core.skills.MaterialType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.mcMMO; import org.bukkit.Material; import org.bukkit.Server; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/StringUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/StringUtils.java similarity index 91% rename from bukkit/src/main/java/com/gmail/nossr50/util/StringUtils.java rename to core/src/main/java/com/gmail/nossr50/core/util/StringUtils.java index 163c1078a..f744ffb37 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/StringUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/StringUtils.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.util; +package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.datatypes.party.PartyFeature; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.skills.SuperAbilityType; import org.bukkit.Material; import org.bukkit.block.data.Ageable; import org.bukkit.block.data.BlockData; @@ -42,13 +42,13 @@ public class StringUtils { public static String getFriendlyConfigBlockDataString(BlockData data) { switch(data.getMaterial()){ - case CHORUS_FLOWER: - case COCOA: - case WHEAT: - case BEETROOTS: - case CARROTS: - case POTATOES: - case NETHER_WART: { + case Material.CHORUS_FLOWER: + case Material.COCOA: + case Material.WHEAT: + case Material.BEETROOTS: + case Material.CARROTS: + case Material.POTATOES: + case Material.NETHER_WART: { if (data instanceof Ageable) { Ageable ageData = (Ageable) data; if (ageData.getAge() == ageData.getMaximumAge()) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/TextComponentFactory.java b/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/util/TextComponentFactory.java rename to core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java index 7adbd744a..c27f78ee0 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/TextComponentFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java @@ -1,16 +1,16 @@ -package com.gmail.nossr50.util; +package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.skills.RankConfig; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.json.McMMOUrl; import com.gmail.nossr50.core.datatypes.json.McMMOWebLinks; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.util.skills.RankUtils; import com.gmail.nossr50.listeners.InteractionManager; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.skills.RankUtils; +import com.gmail.nossr50.core.locale.LocaleLoader; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.chat.*; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/adapter/BiomeAdapter.java b/core/src/main/java/com/gmail/nossr50/core/util/adapter/BiomeAdapter.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/util/adapter/BiomeAdapter.java rename to core/src/main/java/com/gmail/nossr50/core/util/adapter/BiomeAdapter.java index 2de65c9fc..6070e7e42 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/adapter/BiomeAdapter.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/adapter/BiomeAdapter.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.adapter; +package com.gmail.nossr50.core.util.adapter; import org.bukkit.block.Biome; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java similarity index 99% rename from bukkit/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java rename to core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java index 1a7810e3e..dc5401584 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.commands; +package com.gmail.nossr50.core.util.commands; import com.gmail.nossr50.commands.*; import com.gmail.nossr50.commands.chat.AdminChatCommand; @@ -18,10 +18,10 @@ import com.gmail.nossr50.commands.party.teleport.PtpCommand; import com.gmail.nossr50.commands.player.*; import com.gmail.nossr50.commands.skills.*; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.StringUtils; +import com.gmail.nossr50.core.util.StringUtils; import org.bukkit.command.PluginCommand; import java.util.ArrayList; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java rename to core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java index 796701593..7b923a893 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java @@ -1,15 +1,15 @@ -package com.gmail.nossr50.util.commands; +package com.gmail.nossr50.core.util.commands; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.StringUtils; +import com.gmail.nossr50.core.util.StringUtils; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.skills.SkillUtils; +import com.gmail.nossr50.core.util.skills.SkillUtils; import com.google.common.collect.ImmutableList; import org.bukkit.OfflinePlayer; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/experience/ExperienceBarManager.java b/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarManager.java similarity index 93% rename from bukkit/src/main/java/com/gmail/nossr50/util/experience/ExperienceBarManager.java rename to core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarManager.java index fca840ea5..86744195d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/experience/ExperienceBarManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarManager.java @@ -1,9 +1,9 @@ -package com.gmail.nossr50.util.experience; +package com.gmail.nossr50.core.util.experience; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.runnables.skills.ExperienceBarHideTask; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.runnables.skills.ExperienceBarHideTask; import org.bukkit.plugin.Plugin; import java.util.HashMap; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/experience/ExperienceBarWrapper.java b/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarWrapper.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/util/experience/ExperienceBarWrapper.java rename to core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarWrapper.java index 231362b74..24ae7d5d0 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/experience/ExperienceBarWrapper.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarWrapper.java @@ -1,10 +1,10 @@ -package com.gmail.nossr50.util.experience; +package com.gmail.nossr50.core.util.experience; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.StringUtils; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.StringUtils; import org.bukkit.Server; import org.bukkit.boss.BarColor; import org.bukkit.boss.BarStyle; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/experience/FormulaManager.java b/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/util/experience/FormulaManager.java rename to core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java index a445f595a..7e9f0c099 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/experience/FormulaManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java @@ -1,9 +1,9 @@ -package com.gmail.nossr50.util.experience; +package com.gmail.nossr50.core.util.experience; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.experience.FormulaType; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import org.bukkit.configuration.file.YamlConfiguration; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/player/NotificationManager.java b/core/src/main/java/com/gmail/nossr50/core/util/player/NotificationManager.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/util/player/NotificationManager.java rename to core/src/main/java/com/gmail/nossr50/core/util/player/NotificationManager.java index 629cebf3f..539e42805 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/player/NotificationManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/player/NotificationManager.java @@ -1,15 +1,15 @@ -package com.gmail.nossr50.util.player; +package com.gmail.nossr50.core.util.player; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.sounds.SoundManager; +import com.gmail.nossr50.core.util.sounds.SoundType; import com.gmail.nossr50.events.skills.McMMOPlayerNotificationEvent; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.TextComponentFactory; -import com.gmail.nossr50.util.sounds.SoundManager; -import com.gmail.nossr50.util.sounds.SoundType; +import com.gmail.nossr50.core.util.TextComponentFactory; import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.Bukkit; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/random/InvalidActivationException.java b/core/src/main/java/com/gmail/nossr50/core/util/random/InvalidActivationException.java similarity index 62% rename from bukkit/src/main/java/com/gmail/nossr50/util/random/InvalidActivationException.java rename to core/src/main/java/com/gmail/nossr50/core/util/random/InvalidActivationException.java index 677d3e63e..176db6236 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/random/InvalidActivationException.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/InvalidActivationException.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.random; +package com.gmail.nossr50.core.util.random; public class InvalidActivationException extends Exception { //Weee diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/random/InvalidStaticChance.java b/core/src/main/java/com/gmail/nossr50/core/util/random/InvalidStaticChance.java similarity index 60% rename from bukkit/src/main/java/com/gmail/nossr50/util/random/InvalidStaticChance.java rename to core/src/main/java/com/gmail/nossr50/core/util/random/InvalidStaticChance.java index 79a1b0302..b339eb79a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/random/InvalidStaticChance.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/InvalidStaticChance.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.random; +package com.gmail.nossr50.core.util.random; public class InvalidStaticChance extends Exception { //Weeee diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceExecution.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceExecution.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceExecution.java rename to core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceExecution.java index 8d0da9285..2726bf02b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceExecution.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceExecution.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.random; +package com.gmail.nossr50.core.util.random; public interface RandomChanceExecution { /** diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceSkill.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkill.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceSkill.java rename to core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkill.java index ecde9fad3..fee48dc52 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkill.java @@ -1,9 +1,9 @@ -package com.gmail.nossr50.util.random; +package com.gmail.nossr50.core.util.random; import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceSkillStatic.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkillStatic.java similarity index 93% rename from bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceSkillStatic.java rename to core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkillStatic.java index 8aa996b12..97da973ac 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceSkillStatic.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkillStatic.java @@ -1,6 +1,6 @@ -package com.gmail.nossr50.util.random; +package com.gmail.nossr50.core.util.random; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SubSkillType; import org.bukkit.entity.Player; public class RandomChanceSkillStatic extends RandomChanceSkill { diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceStatic.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceStatic.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceStatic.java rename to core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceStatic.java index 30f84cfbf..86ff0e059 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceStatic.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceStatic.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.random; +package com.gmail.nossr50.core.util.random; public class RandomChanceStatic implements RandomChanceExecution { private final double xPos; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceUtil.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceUtil.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceUtil.java rename to core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceUtil.java index 77e379c7d..d01b9ff39 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/random/RandomChanceUtil.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceUtil.java @@ -1,14 +1,14 @@ -package com.gmail.nossr50.util.random; +package com.gmail.nossr50.core.util.random; import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.util.EventUtils; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.skills.SkillActivationType; import com.gmail.nossr50.events.skills.secondaryabilities.SubSkillEvent; import com.gmail.nossr50.events.skills.secondaryabilities.SubSkillRandomCheckEvent; -import com.gmail.nossr50.util.EventUtils; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.skills.SkillActivationType; import org.bukkit.entity.Player; import java.text.DecimalFormat; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/scoreboards/ObjectiveType.java b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ObjectiveType.java similarity index 52% rename from bukkit/src/main/java/com/gmail/nossr50/util/scoreboards/ObjectiveType.java rename to core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ObjectiveType.java index 5f53bd37a..c5fdf470b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/scoreboards/ObjectiveType.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ObjectiveType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.scoreboards; +package com.gmail.nossr50.core.util.scoreboards; public enum ObjectiveType { SIDEBAR, diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardManager.java b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardManager.java rename to core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java index c7d01f424..54770160f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java @@ -1,14 +1,14 @@ -package com.gmail.nossr50.util.scoreboards; +package com.gmail.nossr50.core.util.scoreboards; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.database.PlayerStat; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SuperAbilityType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardWrapper.java b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardWrapper.java rename to core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java index 286877578..34c5ae3c6 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardWrapper.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java @@ -1,18 +1,18 @@ -package com.gmail.nossr50.util.scoreboards; +package com.gmail.nossr50.core.util.scoreboards; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.database.PlayerStat; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SuperAbilityType; +import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.events.scoreboard.*; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.child.FamilyTree; -import com.gmail.nossr50.util.Misc; +import com.gmail.nossr50.core.skills.child.FamilyTree; import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.util.scoreboards.ScoreboardManager.SidebarType; +import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager.SidebarType; import org.apache.commons.lang.Validate; import org.bukkit.ChatColor; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/CombatUtils.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java rename to core/src/main/java/com/gmail/nossr50/core/util/skills/CombatUtils.java index b25df64eb..0a9422b68 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/CombatUtils.java @@ -1,26 +1,27 @@ -package com.gmail.nossr50.util.skills; +package com.gmail.nossr50.core.util.skills; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.util.*; import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent; import com.gmail.nossr50.events.fake.FakeEntityDamageEvent; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.runnables.skills.AwardCombatXpTask; -import com.gmail.nossr50.runnables.skills.BleedTimerTask; -import com.gmail.nossr50.skills.acrobatics.AcrobaticsManager; -import com.gmail.nossr50.skills.archery.ArcheryManager; -import com.gmail.nossr50.skills.axes.AxesManager; -import com.gmail.nossr50.skills.swords.SwordsManager; -import com.gmail.nossr50.skills.taming.TamingManager; -import com.gmail.nossr50.skills.unarmed.Unarmed; -import com.gmail.nossr50.skills.unarmed.UnarmedManager; +import com.gmail.nossr50.core.runnables.skills.AwardCombatXpTask; +import com.gmail.nossr50.core.runnables.skills.BleedTimerTask; +import com.gmail.nossr50.core.skills.primary.acrobatics.AcrobaticsManager; +import com.gmail.nossr50.core.skills.primary.archery.ArcheryManager; +import com.gmail.nossr50.core.skills.primary.axes.AxesManager; +import com.gmail.nossr50.core.skills.primary.swords.SwordsManager; +import com.gmail.nossr50.core.skills.primary.taming.TamingManager; +import com.gmail.nossr50.core.skills.primary.unarmed.Unarmed; +import com.gmail.nossr50.core.skills.primary.unarmed.UnarmedManager; import com.gmail.nossr50.util.*; -import com.gmail.nossr50.util.player.NotificationManager; +import com.gmail.nossr50.core.util.player.NotificationManager; import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableMap; import org.bukkit.GameMode; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java similarity index 99% rename from bukkit/src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java rename to core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java index 366b944a4..22257ee20 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.skills; +package com.gmail.nossr50.core.util.skills; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.mcMMO; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/PerksUtils.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java rename to core/src/main/java/com/gmail/nossr50/core/util/skills/PerksUtils.java index 04282a97b..b3000d9f9 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/PerksUtils.java @@ -1,8 +1,8 @@ -package com.gmail.nossr50.util.skills; +package com.gmail.nossr50.core.util.skills; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.util.Permissions; import org.bukkit.entity.Player; public final class PerksUtils { diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/RankUtils.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java rename to core/src/main/java/com/gmail/nossr50/core/util/skills/RankUtils.java index dc98da67b..c82f05ee4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/RankUtils.java @@ -1,13 +1,13 @@ -package com.gmail.nossr50.util.skills; +package com.gmail.nossr50.core.util.skills; import com.gmail.nossr50.core.config.skills.RankConfig; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; -import com.gmail.nossr50.core.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SuperAbilityType; +import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.listeners.InteractionManager; -import com.gmail.nossr50.runnables.skills.SkillUnlockNotificationTask; +import com.gmail.nossr50.core.runnables.skills.SkillUnlockNotificationTask; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/skills/SkillActivationType.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillActivationType.java similarity index 91% rename from bukkit/src/main/java/com/gmail/nossr50/util/skills/SkillActivationType.java rename to core/src/main/java/com/gmail/nossr50/core/util/skills/SkillActivationType.java index 4f8ae88ca..169dc5feb 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/skills/SkillActivationType.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillActivationType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.skills; +package com.gmail.nossr50.core.util.skills; /** * Defines the type of random calculations to use with a given skill diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java rename to core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java index 7f11b8387..bb28f14c0 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.skills; +package com.gmail.nossr50.core.util.skills; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; @@ -7,15 +7,15 @@ import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.core.datatypes.skills.SubSkillType; -import com.gmail.nossr50.core.datatypes.skills.SuperAbilityType; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.SuperAbilityType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.ItemUtils; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.StringUtils; -import com.gmail.nossr50.util.player.NotificationManager; +import com.gmail.nossr50.core.util.ItemUtils; +import com.gmail.nossr50.core.util.StringUtils; +import com.gmail.nossr50.core.util.player.NotificationManager; import com.gmail.nossr50.core.data.UserManager; import org.bukkit.Location; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/sounds/SoundManager.java b/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundManager.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/util/sounds/SoundManager.java rename to core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundManager.java index 28090eb89..e361d1dff 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/sounds/SoundManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundManager.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.util.sounds; +package com.gmail.nossr50.core.util.sounds; import com.gmail.nossr50.core.config.skills.SoundConfig; -import com.gmail.nossr50.util.Misc; +import com.gmail.nossr50.core.util.Misc; import org.bukkit.Location; import org.bukkit.Sound; import org.bukkit.SoundCategory; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/sounds/SoundType.java b/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundType.java similarity index 91% rename from bukkit/src/main/java/com/gmail/nossr50/util/sounds/SoundType.java rename to core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundType.java index 6ebaa3a71..ddffdcd08 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/sounds/SoundType.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundType.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.sounds; +package com.gmail.nossr50.core.util.sounds; public enum SoundType { ANVIL, diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/upgrade/UpgradeManager.java b/core/src/main/java/com/gmail/nossr50/core/util/upgrade/UpgradeManager.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/util/upgrade/UpgradeManager.java rename to core/src/main/java/com/gmail/nossr50/core/util/upgrade/UpgradeManager.java index f49c8d973..52af72fa0 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/upgrade/UpgradeManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/upgrade/UpgradeManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.upgrade; +package com.gmail.nossr50.core.util.upgrade; import com.gmail.nossr50.core.config.skills.ConfigLoader; import com.gmail.nossr50.core.datatypes.database.UpgradeType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/util/uuid/UUIDFetcher.java b/core/src/main/java/com/gmail/nossr50/core/util/uuid/UUIDFetcher.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/util/uuid/UUIDFetcher.java rename to core/src/main/java/com/gmail/nossr50/core/util/uuid/UUIDFetcher.java index 90bef4122..0da94b63a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/util/uuid/UUIDFetcher.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/uuid/UUIDFetcher.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.uuid; +package com.gmail.nossr50.core.util.uuid; import com.google.common.collect.ImmutableList; import org.json.simple.JSONArray; diff --git a/bukkit/src/main/java/com/gmail/nossr50/worldguard/WorldGuardFlags.java b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardFlags.java similarity index 88% rename from bukkit/src/main/java/com/gmail/nossr50/worldguard/WorldGuardFlags.java rename to core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardFlags.java index c61f384c6..f632a76f9 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/worldguard/WorldGuardFlags.java +++ b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardFlags.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.worldguard; +package com.gmail.nossr50.core.worldguard; import com.sk89q.worldguard.protection.flags.StateFlag; diff --git a/bukkit/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardManager.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java rename to core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardManager.java index ad7806be5..9cd12f58d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.worldguard; +package com.gmail.nossr50.core.worldguard; import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.bukkit.BukkitPlayer; diff --git a/bukkit/src/main/java/com/gmail/nossr50/worldguard/WorldGuardUtils.java b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardUtils.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/worldguard/WorldGuardUtils.java rename to core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardUtils.java index 85a9b5fb6..6b19963a0 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/worldguard/WorldGuardUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardUtils.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.worldguard; +package com.gmail.nossr50.core.worldguard; import com.gmail.nossr50.mcMMO; import com.sk89q.worldguard.bukkit.WorldGuardPlugin; diff --git a/bukkit/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java b/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java similarity index 100% rename from bukkit/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java rename to core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java From bbcc1ee7daaf0403d72140ed4fa7641a8b232539 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 9 Feb 2019 22:46:30 -0800 Subject: [PATCH 06/28] Changing the style of our code --- .../gmail/nossr50/commands/MHDCommand.java | 2 +- .../nossr50/commands/McImportCommand.java | 59 +- .../nossr50/commands/McconvertCommand.java | 9 +- .../gmail/nossr50/commands/McmmoCommand.java | 4 +- .../nossr50/commands/McnotifyCommand.java | 2 +- .../gmail/nossr50/commands/ToggleCommand.java | 5 +- .../gmail/nossr50/commands/XprateCommand.java | 30 +- .../nossr50/commands/chat/ChatCommand.java | 9 +- .../commands/chat/PartyChatCommand.java | 5 +- .../database/ConvertDatabaseCommand.java | 7 +- .../commands/database/McremoveCommand.java | 9 +- .../commands/experience/AddlevelsCommand.java | 2 +- .../commands/experience/AddxpCommand.java | 7 +- .../experience/ConvertExperienceCommand.java | 4 +- .../experience/ExperienceCommand.java | 39 +- .../commands/experience/MmoeditCommand.java | 2 +- .../experience/SkillresetCommand.java | 35 +- .../commands/hardcore/HardcoreCommand.java | 7 +- .../hardcore/HardcoreModeCommand.java | 8 +- .../commands/hardcore/VampirismCommand.java | 7 +- .../commands/party/PartyAcceptCommand.java | 2 +- .../party/PartyChangeOwnerCommand.java | 4 +- .../party/PartyChangePasswordCommand.java | 2 +- .../nossr50/commands/party/PartyCommand.java | 36 +- .../commands/party/PartyCreateCommand.java | 2 +- .../commands/party/PartyDisbandCommand.java | 4 +- .../commands/party/PartyInfoCommand.java | 7 +- .../commands/party/PartyInviteCommand.java | 5 +- .../commands/party/PartyItemShareCommand.java | 11 +- .../commands/party/PartyJoinCommand.java | 5 +- .../commands/party/PartyKickCommand.java | 6 +- .../commands/party/PartyLockCommand.java | 11 +- .../commands/party/PartyQuitCommand.java | 4 +- .../commands/party/PartyRenameCommand.java | 4 +- .../commands/party/PartySubcommandType.java | 15 +- .../commands/party/PartyXpShareCommand.java | 8 +- .../alliance/PartyAllianceAcceptCommand.java | 2 +- .../party/alliance/PartyAllianceCommand.java | 6 +- .../alliance/PartyAllianceDisbandCommand.java | 2 +- .../alliance/PartyAllianceInviteCommand.java | 2 +- .../party/teleport/PtpAcceptAnyCommand.java | 5 +- .../party/teleport/PtpAcceptCommand.java | 5 +- .../commands/party/teleport/PtpCommand.java | 108 ++- .../party/teleport/PtpToggleCommand.java | 5 +- .../commands/player/InspectCommand.java | 12 +- .../commands/player/MccooldownCommand.java | 11 +- .../commands/player/McrankCommand.java | 7 +- .../commands/player/McstatsCommand.java | 5 +- .../nossr50/commands/player/MctopCommand.java | 6 +- .../commands/skills/AcrobaticsCommand.java | 17 +- .../commands/skills/AlchemyCommand.java | 8 +- .../nossr50/commands/skills/AprilCommand.java | 3 +- .../commands/skills/ArcheryCommand.java | 10 +- .../nossr50/commands/skills/AxesCommand.java | 12 +- .../commands/skills/ExcavationCommand.java | 2 +- .../commands/skills/FishingCommand.java | 20 +- .../commands/skills/HerbalismCommand.java | 17 +- .../commands/skills/MiningCommand.java | 16 +- .../commands/skills/MmoInfoCommand.java | 31 +- .../commands/skills/RepairCommand.java | 8 +- .../commands/skills/SalvageCommand.java | 4 +- .../nossr50/commands/skills/SkillCommand.java | 74 +- .../commands/skills/SkillGuideCommand.java | 5 +- .../commands/skills/SmeltingCommand.java | 8 +- .../commands/skills/SwordsCommand.java | 10 +- .../commands/skills/TamingCommand.java | 12 +- .../commands/skills/UnarmedCommand.java | 18 +- .../commands/skills/WoodcuttingCommand.java | 9 +- .../nossr50/events/chat/McMMOChatEvent.java | 33 +- .../McMMOPlayerExperienceEvent.java | 19 +- .../experience/McMMOPlayerLevelDownEvent.java | 19 +- .../experience/McMMOPlayerLevelUpEvent.java | 19 +- .../experience/McMMOPlayerXpGainEvent.java | 25 +- .../McMMOPlayerDeathPenaltyEvent.java | 20 +- .../McMMOPlayerPreDeathPenaltyEvent.java | 19 +- .../events/items/McMMOItemSpawnEvent.java | 19 +- .../party/McMMOPartyAllianceChangeEvent.java | 49 +- .../events/party/McMMOPartyChangeEvent.java | 49 +- .../events/party/McMMOPartyLevelUpEvent.java | 19 +- .../events/party/McMMOPartyTeleportEvent.java | 15 +- .../events/party/McMMOPartyXpGainEvent.java | 33 +- .../scoreboard/McMMOScoreboardEvent.java | 45 +- .../McMMOScoreboardObjectiveEvent.java | 7 +- .../skills/McMMOPlayerNotificationEvent.java | 27 +- .../events/skills/McMMOPlayerSkillEvent.java | 17 +- .../repair/McMMOPlayerRepairCheckEvent.java | 4 +- .../salvage/McMMOPlayerSalvageCheckEvent.java | 4 +- .../secondaryabilities/SubSkillEvent.java | 7 +- .../SubSkillRandomCheckEvent.java | 3 +- .../unarmed/McMMOPlayerDisarmEvent.java | 4 +- .../nossr50/listeners/BlockListener.java | 135 ++- .../nossr50/listeners/EntityListener.java | 243 +++--- .../nossr50/listeners/InteractionManager.java | 44 +- .../nossr50/listeners/InventoryListener.java | 78 +- .../nossr50/listeners/PlayerListener.java | 108 +-- .../gmail/nossr50/listeners/SelfListener.java | 42 +- .../nossr50/listeners/WorldListener.java | 10 +- .../main/java/com/gmail/nossr50/mcMMO.java | 265 +++--- .../java/mcMMO/PotionConfigGenerator.java | 349 ++++---- bukkit/src/main/resources/child.yml | 8 +- bukkit/src/main/resources/config.yml | 6 +- bukkit/src/main/resources/coreskills.yml | 8 +- bukkit/src/main/resources/itemweights.yml | 74 +- .../resources/locale/locale_cs_CZ.properties | 6 +- .../resources/locale/locale_cy.properties | 52 +- .../resources/locale/locale_da.properties | 6 +- .../resources/locale/locale_de.properties | 71 +- .../resources/locale/locale_en_US.properties | 25 +- .../resources/locale/locale_es.properties | 4 +- .../resources/locale/locale_fr.properties | 13 +- .../resources/locale/locale_hu_HU.properties | 6 +- .../resources/locale/locale_it.properties | 72 +- .../resources/locale/locale_ko.properties | 69 +- .../resources/locale/locale_nl.properties | 30 +- .../resources/locale/locale_pl.properties | 2 +- .../resources/locale/locale_ru.properties | 6 +- .../resources/locale/locale_th_TH.properties | 2 +- .../resources/locale/locale_zh_CN.properties | 4 +- .../resources/locale/locale_zh_TW.properties | 6 +- bukkit/src/main/resources/plugin.yml | 26 +- bukkit/src/main/resources/potions.yml | 54 +- core/build.gradle.kts | 1 - .../gmail/nossr50/core/api/AbilityAPI.java | 5 +- .../com/gmail/nossr50/core/api/ChatAPI.java | 29 +- .../gmail/nossr50/core/api/ExperienceAPI.java | 388 ++++----- .../com/gmail/nossr50/core/api/PartyAPI.java | 20 +- .../com/gmail/nossr50/core/api/SkillAPI.java | 3 +- .../gmail/nossr50/core/chat/ChatManager.java | 18 +- .../nossr50/core/chat/PartyChatManager.java | 2 +- .../config/experience/ExperienceConfig.java | 203 +++-- .../core/config/mods/CustomArmorConfig.java | 10 +- .../core/config/mods/CustomBlockConfig.java | 24 +- .../core/config/mods/CustomEntityConfig.java | 5 +- .../core/config/mods/CustomToolConfig.java | 15 +- .../core/config/party/ItemWeightConfig.java | 3 +- .../core/config/skills/AdvancedConfig.java | 387 ++++++--- .../config/skills/AutoUpdateConfigLoader.java | 17 +- .../nossr50/core/config/skills/Config.java | 810 ++++++++++++++---- .../core/config/skills/ConfigLoader.java | 11 +- .../core/config/skills/CoreSkillsConfig.java | 30 +- .../core/config/skills/RankConfig.java | 56 +- .../core/config/skills/SoundConfig.java | 53 +- .../core/config/skills/WorldBlacklist.java | 45 +- .../config/skills/alchemy/PotionConfig.java | 35 +- .../config/skills/repair/RepairConfig.java | 33 +- .../config/skills/salvage/SalvageConfig.java | 33 +- .../core/config/treasure/TreasureConfig.java | 6 +- .../gmail/nossr50/core/data/UserManager.java | 10 +- .../core/data/blockmeta/ChunkletManager.java | 46 +- .../data/blockmeta/HashChunkletManager.java | 35 +- .../data/blockmeta/NullChunkletManager.java | 2 +- .../blockmeta/PrimitiveChunkletStore.java | 4 +- .../blockmeta/PrimitiveExChunkletStore.java | 66 +- .../blockmeta/chunkmeta/ChunkManager.java | 50 +- .../blockmeta/chunkmeta/HashChunkManager.java | 35 +- .../chunkmeta/McMMOSimpleRegionFile.java | 22 +- .../blockmeta/chunkmeta/NullChunkManager.java | 66 +- .../chunkmeta/PrimitiveChunkStore.java | 11 +- .../conversion/BlockStoreConversionMain.java | 4 +- .../BlockStoreConversionXDirectory.java | 4 +- .../BlockStoreConversionZDirectory.java | 15 +- .../core/data/database/DatabaseManager.java | 33 +- .../data/database/DatabaseManagerFactory.java | 21 +- .../database/FlatfileDatabaseManager.java | 297 +++---- .../data/database/SQLDatabaseManager.java | 592 ++++++------- .../core/datatypes/LimitedSizeList.java | 27 +- .../nossr50/core/datatypes/chat/ChatMode.java | 2 +- .../core/datatypes/database/DatabaseType.java | 3 +- .../datatypes/experience/FormulaType.java | 3 +- .../datatypes/experience/SkillXpGain.java | 11 +- .../interactions/NotificationType.java | 3 +- .../nossr50/core/datatypes/json/McMMOUrl.java | 16 +- .../core/datatypes/json/McMMOWebLinks.java | 20 +- .../nossr50/core/datatypes/meta/OldName.java | 3 +- .../core/datatypes/party/ItemShareType.java | 12 +- .../nossr50/core/datatypes/party/Party.java | 78 +- .../datatypes/party/PartyTeleportRecord.java | 4 +- .../core/datatypes/party/ShareMode.java | 6 +- .../core/datatypes/player/McMMOPlayer.java | 117 ++- .../core/datatypes/player/PlayerProfile.java | 42 +- .../nossr50/core/locale/LocaleLoader.java | 16 +- .../nossr50/core/mcmmo/AbstractWorld.java | 5 +- .../gmail/nossr50/core/mcmmo/Location.java | 4 + .../gmail/nossr50/core/mcmmo/Nameable.java | 2 + .../com/gmail/nossr50/core/mcmmo/Named.java | 1 + .../gmail/nossr50/core/mcmmo/Property.java | 7 +- .../com/gmail/nossr50/core/mcmmo/World.java | 1 + .../gmail/nossr50/core/mcmmo/block/Block.java | 14 +- .../nossr50/core/mcmmo/block/BlockState.java | 13 +- .../nossr50/core/mcmmo/entity/Entity.java | 2 + .../nossr50/core/mcmmo/entity/Living.java | 4 + .../nossr50/core/mcmmo/entity/Player.java | 2 + .../nossr50/core/mcmmo/event/Cancellable.java | 2 + .../nossr50/core/party/PartyManager.java | 74 +- .../nossr50/core/party/ShareHandler.java | 19 +- .../gmail/nossr50/core/platform/Platform.java | 5 + .../core/platform/TargetMinecraftVersion.java | 7 +- .../core/platform/drivers/PlatformDriver.java | 2 + .../core/runnables/PistonTrackerTask.java | 3 +- .../nossr50/core/runnables/SaveTimerTask.java | 2 +- .../runnables/backups/CleanBackupsTask.java | 11 +- .../commands/McrankCommandDisplayTask.java | 5 +- .../commands/MctopCommandDisplayTask.java | 27 +- .../database/FormulaConversionTask.java | 7 +- .../database/UUIDUpdateAsyncTask.java | 9 +- .../runnables/database/UserPurgeTask.java | 1 + .../player/ClearRegisteredXPGainTask.java | 2 +- .../player/PlayerProfileLoadingTask.java | 2 +- .../skills/AlchemyBrewCheckTask.java | 3 +- .../runnables/skills/AlchemyBrewTask.java | 11 +- .../core/runnables/skills/BleedContainer.java | 11 +- .../core/runnables/skills/BleedTimerTask.java | 81 +- .../skills/ExperienceBarHideTask.java | 5 +- .../skills/SkillUnlockNotificationTask.java | 10 +- .../nossr50/core/skills/ModConfigType.java | 6 +- .../nossr50/core/skills/PotionStage.java | 16 +- .../nossr50/core/skills/PrimarySkillType.java | 109 ++- .../nossr50/core/skills/SkillManager.java | 6 +- .../nossr50/core/skills/SubSkillFlags.java | 18 +- .../nossr50/core/skills/SubSkillType.java | 93 +- .../nossr50/core/skills/SuperAbilityType.java | 17 +- .../core/skills/child/ChildConfig.java | 3 +- .../core/skills/child/salvage/Salvage.java | 2 +- .../skills/child/salvage/SalvageManager.java | 25 +- .../salvage/salvageables/Salvageable.java | 4 +- .../salvageables/SalvageableManager.java | 3 - .../core/skills/child/smelting/Smelting.java | 16 +- .../child/smelting/SmeltingManager.java | 2 +- .../core/skills/interfaces/ChildSkill.java | 1 + .../core/skills/interfaces/CoreSkill.java | 1 + .../core/skills/interfaces/Localized.java | 2 + .../core/skills/interfaces/Progression.java | 1 + .../nossr50/core/skills/interfaces/Skill.java | 2 + .../core/skills/interfaces/Toolable.java | 4 +- .../skills/primary/acrobatics/Acrobatics.java | 7 +- .../primary/acrobatics/AcrobaticsManager.java | 4 +- .../core/skills/primary/alchemy/Alchemy.java | 11 +- .../primary/alchemy/AlchemyManager.java | 4 +- .../skills/primary/alchemy/AlchemyPotion.java | 6 +- .../primary/alchemy/AlchemyPotionBrewer.java | 25 +- .../core/skills/primary/archery/Archery.java | 15 +- .../primary/archery/ArcheryManager.java | 12 +- .../core/skills/primary/axes/Axes.java | 16 +- .../core/skills/primary/axes/AxesManager.java | 21 +- .../primary/excavation/ExcavationManager.java | 13 +- .../core/skills/primary/fishing/Fishing.java | 13 +- .../primary/fishing/FishingManager.java | 24 +- .../skills/primary/herbalism/Herbalism.java | 28 +- .../primary/herbalism/HerbalismManager.java | 35 +- .../skills/primary/mining/BlastMining.java | 23 +- .../skills/primary/mining/MiningManager.java | 38 +- .../skills/primary/repair/ArcaneForging.java | 2 +- .../core/skills/primary/repair/Repair.java | 6 +- .../skills/primary/repair/RepairManager.java | 23 +- .../repair/repairables/Repairable.java | 4 +- .../repair/repairables/RepairableManager.java | 3 - .../repair/repairables/SimpleRepairable.java | 2 +- .../core/skills/primary/swords/Swords.java | 10 +- .../skills/primary/swords/SwordsManager.java | 23 +- .../core/skills/primary/taming/Taming.java | 9 +- .../skills/primary/taming/TamingManager.java | 67 +- .../core/skills/primary/unarmed/Unarmed.java | 22 +- .../primary/unarmed/UnarmedManager.java | 16 +- .../primary/woodcutting/Woodcutting.java | 61 +- .../woodcutting/WoodcuttingManager.java | 13 +- .../skills/subskills/AbstractSubSkill.java | 10 +- .../acrobatics/AcrobaticsSubSkill.java | 4 +- .../skills/subskills/acrobatics/Roll.java | 83 +- .../subskills/interfaces/Interaction.java | 5 +- .../skills/subskills/interfaces/Rank.java | 2 + .../skills/subskills/interfaces/SubSkill.java | 13 +- .../skills/treasure/ExcavationTreasure.java | 1 - .../core/skills/treasure/FishingTreasure.java | 1 - .../core/skills/treasure/HylianTreasure.java | 1 - .../nossr50/core/skills/treasure/Rarity.java | 3 +- .../core/skills/treasure/ShakeTreasure.java | 1 - .../core/skills/treasure/Treasure.java | 2 +- .../gmail/nossr50/core/util/BlockUtils.java | 301 ++++--- .../gmail/nossr50/core/util/ChimaeraWing.java | 18 +- .../nossr50/core/util/EnchantmentUtils.java | 1 - .../gmail/nossr50/core/util/EventUtils.java | 33 +- .../nossr50/core/util/HardcoreManager.java | 8 +- .../nossr50/core/util/HolidayManager.java | 237 +++-- .../gmail/nossr50/core/util/ItemUtils.java | 5 +- .../nossr50/core/util/MaterialUtils.java | 3 +- .../com/gmail/nossr50/core/util/Misc.java | 24 +- .../nossr50/core/util/MobHealthbarUtils.java | 35 +- .../gmail/nossr50/core/util/ModManager.java | 54 +- .../com/gmail/nossr50/core/util/Motd.java | 5 +- .../gmail/nossr50/core/util/Permissions.java | 514 ++++++++--- .../gmail/nossr50/core/util/StringUtils.java | 13 +- .../core/util/TextComponentFactory.java | 167 ++-- .../core/util/adapter/BiomeAdapter.java | 3 +- .../commands/CommandRegistrationManager.java | 22 +- .../core/util/commands/CommandUtils.java | 26 +- .../util/experience/ExperienceBarManager.java | 26 +- .../util/experience/ExperienceBarWrapper.java | 67 +- .../core/util/experience/FormulaManager.java | 19 +- .../core/util/player/NotificationManager.java | 46 +- .../util/random/RandomChanceExecution.java | 2 + .../core/util/random/RandomChanceSkill.java | 24 +- .../util/random/RandomChanceSkillStatic.java | 3 +- .../core/util/random/RandomChanceStatic.java | 3 +- .../core/util/random/RandomChanceUtil.java | 79 +- .../util/scoreboards/ScoreboardManager.java | 45 +- .../util/scoreboards/ScoreboardWrapper.java | 133 ++- .../nossr50/core/util/skills/CombatUtils.java | 125 ++- .../core/util/skills/ParticleEffectUtils.java | 6 +- .../nossr50/core/util/skills/PerksUtils.java | 37 +- .../nossr50/core/util/skills/RankUtils.java | 157 ++-- .../nossr50/core/util/skills/SkillUtils.java | 64 +- .../core/util/sounds/SoundManager.java | 36 +- .../nossr50/core/util/sounds/SoundType.java | 5 +- .../core/util/upgrade/UpgradeManager.java | 4 +- .../nossr50/core/util/uuid/UUIDFetcher.java | 44 +- .../core/worldguard/WorldGuardManager.java | 26 +- .../core/worldguard/WorldGuardUtils.java | 19 +- .../shatt/backup/ZipLibrary.java | 9 +- 318 files changed, 5494 insertions(+), 5357 deletions(-) diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java index 4138e2582..5dfc12ac2 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.data.database.FlatfileDatabaseManager; import com.gmail.nossr50.core.data.database.SQLDatabaseManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McImportCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McImportCommand.java index e370d91ec..086757f27 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McImportCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McImportCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.core.skills.ModConfigType; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.mcMMO; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -71,17 +71,14 @@ public class McImportCommand implements CommandExecutor { materialNames.get(type).add(materialName); continue; } - } - catch (FileNotFoundException e) { + } catch (FileNotFoundException e) { mcMMO.p.getLogger().warning("Could not find " + importFile.getAbsolutePath() + " ! (No such file or directory)"); mcMMO.p.getLogger().warning("Copy and paste latest.log to " + importFile.getParentFile().getAbsolutePath() + " and rename it to import.log"); return false; - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); return false; - } - finally { + } finally { tryClose(in); } @@ -116,8 +113,7 @@ public class McImportCommand implements CommandExecutor { } try { c.close(); - } - catch (IOException e) { + } catch (IOException e) { e.printStackTrace(); } } @@ -169,16 +165,13 @@ public class McImportCommand implements CommandExecutor { out = new FileWriter(outputFile); out.write(writer.toString()); - } - catch (IOException e) { + } catch (IOException e) { e.printStackTrace(); return; - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); return; - } - finally { + } finally { tryClose(out); fileAmount++; } @@ -208,14 +201,11 @@ public class McImportCommand implements CommandExecutor { String skillName = "UNIDENTIFIED"; if (materialName.contains("ORE")) { skillName = "Mining"; - } - else if (materialName.contains("LOG") || materialName.contains("LEAVES")) { + } else if (materialName.contains("LOG") || materialName.contains("LEAVES")) { skillName = "Woodcutting"; - } - else if (materialName.contains("GRASS") || materialName.contains("FLOWER") || materialName.contains("CROP")) { + } else if (materialName.contains("GRASS") || materialName.contains("FLOWER") || materialName.contains("CROP")) { skillName = "Herbalism"; - } - else if (materialName.contains("DIRT") || materialName.contains("SAND")) { + } else if (materialName.contains("DIRT") || materialName.contains("SAND")) { skillName = "Excavation"; } @@ -230,8 +220,7 @@ public class McImportCommand implements CommandExecutor { if (skillName.equals("Mining")) { skillContents.add(" " + " " + "Smelting_XP_Gain: 9"); - } - else if (skillName.equals("Woodcutting")) { + } else if (skillName.equals("Woodcutting")) { skillContents.add(" " + " " + "Is_Log: " + materialName.contains("LOG")); } } @@ -247,20 +236,15 @@ public class McImportCommand implements CommandExecutor { String toolType = "UNIDENTIFIED"; if (materialName.contains("PICKAXE")) { toolType = "Pickaxes"; - } - else if (materialName.contains("AXE")) { + } else if (materialName.contains("AXE")) { toolType = "Axes"; - } - else if (materialName.contains("BOW")) { + } else if (materialName.contains("BOW")) { toolType = "Bows"; - } - else if (materialName.contains("HOE")) { + } else if (materialName.contains("HOE")) { toolType = "Hoes"; - } - else if (materialName.contains("SHOVEL") || materialName.contains("SPADE")) { + } else if (materialName.contains("SHOVEL") || materialName.contains("SPADE")) { toolType = "Shovels"; - } - else if (materialName.contains("SWORD")) { + } else if (materialName.contains("SWORD")) { toolType = "Swords"; } @@ -287,14 +271,11 @@ public class McImportCommand implements CommandExecutor { String toolType = "UNIDENTIFIED"; if (materialName.contains("BOOT") || materialName.contains("SHOE")) { toolType = "Boots"; - } - else if (materialName.contains("CHESTPLATE") || materialName.contains("CHEST")) { + } else if (materialName.contains("CHESTPLATE") || materialName.contains("CHEST")) { toolType = "Chestplates"; - } - else if (materialName.contains("HELM") || materialName.contains("HAT")) { + } else if (materialName.contains("HELM") || materialName.contains("HAT")) { toolType = "Helmets"; - } - else if (materialName.contains("LEGGINGS") || materialName.contains("LEGS") || materialName.contains("PANTS")) { + } else if (materialName.contains("LEGGINGS") || materialName.contains("LEGS") || materialName.contains("PANTS")) { toolType = "Leggings"; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McconvertCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McconvertCommand.java index f9a518873..5b29c3c10 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McconvertCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McconvertCommand.java @@ -22,9 +22,6 @@ public class McconvertCommand implements TabExecutor { private static final List DATABASE_TYPES; private static final List SUBCOMMANDS = ImmutableList.of("database", "experience"); - private CommandExecutor databaseConvertCommand = new ConvertDatabaseCommand(); - private CommandExecutor experienceConvertCommand = new ConvertExperienceCommand(); - static { ArrayList formulaTypes = new ArrayList(); ArrayList databaseTypes = new ArrayList(); @@ -52,14 +49,16 @@ public class McconvertCommand implements TabExecutor { } + private CommandExecutor databaseConvertCommand = new ConvertDatabaseCommand(); + private CommandExecutor experienceConvertCommand = new ConvertExperienceCommand(); + @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { switch (args.length) { case 2: if (args[0].equalsIgnoreCase("database") || args[0].equalsIgnoreCase("db")) { return databaseConvertCommand.onCommand(sender, command, label, args); - } - else if (args[0].equalsIgnoreCase("experience") || args[0].equalsIgnoreCase("xp") || args[1].equalsIgnoreCase("exp")) { + } else if (args[0].equalsIgnoreCase("experience") || args[0].equalsIgnoreCase("xp") || args[1].equalsIgnoreCase("exp")) { return experienceConvertCommand.onCommand(sender, command, label, args); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java index 3a20b6b4b..104fb5e01 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java @@ -3,8 +3,8 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.commands.party.PartySubcommandType; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.mcMMO; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -71,7 +71,7 @@ public class McmmoCommand implements CommandExecutor { private void displayOtherCommands(CommandSender sender) { //Don't show them this category if they have none of the permissions - if(!Permissions.skillreset(sender) && !Permissions.mmoedit(sender) && !Permissions.adminChat(sender) && !Permissions.mcgod(sender)) + if (!Permissions.skillreset(sender) && !Permissions.mmoedit(sender) && !Permissions.adminChat(sender) && !Permissions.mcgod(sender)) return; sender.sendMessage(LocaleLoader.getString("Commands.Other")); diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java index afbe211b7..3c3818406 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/ToggleCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/ToggleCommand.java index 5956d6df9..2b10cea70 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/ToggleCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/ToggleCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -71,7 +71,10 @@ public abstract class ToggleCommand implements TabExecutor { } protected abstract boolean hasOtherPermission(CommandSender sender); + protected abstract boolean hasSelfPermission(CommandSender sender); + protected abstract void applyCommandAction(McMMOPlayer mcMMOPlayer); + protected abstract void sendSuccessMessage(CommandSender sender, String playerName); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java index 6d6765822..d655df001 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.commands; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.StringUtils; import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.util.player.NotificationManager; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.ChatColor; import org.bukkit.command.Command; @@ -25,7 +25,7 @@ public class XprateCommand implements TabExecutor { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { switch (args.length) { case 1: - if (!args[0].equalsIgnoreCase("reset") && !args[0].equalsIgnoreCase("clear")) { + if (!args[0].equalsIgnoreCase("reset") && !args[0].equalsIgnoreCase("clear")) { return false; } @@ -36,12 +36,11 @@ public class XprateCommand implements TabExecutor { if (mcMMO.p.isXPEventEnabled()) { - if(AdvancedConfig.getInstance().useTitlesForXPEvent()) - { + if (AdvancedConfig.getInstance().useTitlesForXPEvent()) { NotificationManager.broadcastTitle(mcMMO.p.getServer(), LocaleLoader.getString("Commands.Event.Stop"), LocaleLoader.getString("Commands.Event.Stop.Subtitle"), - 10, 10*20, 20); + 10, 10 * 20, 20); } mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.Stop")); @@ -65,36 +64,31 @@ public class XprateCommand implements TabExecutor { if (CommandUtils.shouldDisableToggle(args[1])) { mcMMO.p.setXPEventEnabled(false); - } - else if (CommandUtils.shouldEnableToggle(args[1])) { + } else if (CommandUtils.shouldEnableToggle(args[1])) { mcMMO.p.setXPEventEnabled(true); - } - else { + } else { return false; } int newXpRate = Integer.parseInt(args[0]); - if(newXpRate < 0) - { - sender.sendMessage(ChatColor.RED+LocaleLoader.getString("Commands.NegativeNumberWarn")); + if (newXpRate < 0) { + sender.sendMessage(ChatColor.RED + LocaleLoader.getString("Commands.NegativeNumberWarn")); return true; } ExperienceConfig.getInstance().setExperienceGainsGlobalMultiplier(newXpRate); if (mcMMO.p.isXPEventEnabled()) { - if(AdvancedConfig.getInstance().useTitlesForXPEvent()) - { + if (AdvancedConfig.getInstance().useTitlesForXPEvent()) { NotificationManager.broadcastTitle(mcMMO.p.getServer(), LocaleLoader.getString("Commands.Event.Start"), LocaleLoader.getString("Commands.Event.XP", newXpRate), - 10, 10*20, 20); + 10, 10 * 20, 20); } mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.Start")); mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.XP", newXpRate)); - } - else { + } else { sender.sendMessage(LocaleLoader.getString("Commands.xprate.modified", newXpRate)); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java index 6bc73b9c2..4c1c883e8 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java @@ -3,13 +3,13 @@ package com.gmail.nossr50.commands.chat; import com.gmail.nossr50.core.chat.ChatManager; import com.gmail.nossr50.core.chat.ChatManagerFactory; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -21,8 +21,8 @@ import java.util.ArrayList; import java.util.List; public abstract class ChatCommand implements TabExecutor { - private ChatMode chatMode; protected ChatManager chatManager; + private ChatMode chatMode; public ChatCommand(ChatMode chatMode) { this.chatMode = chatMode; @@ -47,8 +47,7 @@ public abstract class ChatCommand implements TabExecutor { if (mcMMOPlayer.isChatEnabled(chatMode)) { disableChatMode(mcMMOPlayer, sender); - } - else { + } else { enableChatMode(mcMMOPlayer, sender); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java index 219ffa072..4cd76d299 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java @@ -2,12 +2,12 @@ package com.gmail.nossr50.commands.chat; import com.gmail.nossr50.core.chat.PartyChatManager; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -35,8 +35,7 @@ public class PartyChatCommand extends ChatCommand { } message = buildChatMessage(args, 0); - } - else { + } else { if (args.length < 2) { sender.sendMessage(LocaleLoader.getString("Party.Specify")); return; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java index 69620c5a7..840a6823c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.commands.database; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.data.database.DatabaseManager; import com.gmail.nossr50.core.data.database.DatabaseManagerFactory; import com.gmail.nossr50.core.datatypes.database.DatabaseType; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.runnables.database.DatabaseConversionTask; import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.mcMMO; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -41,8 +41,7 @@ public class ConvertDatabaseCommand implements CommandExecutor { } oldDatabase = DatabaseManagerFactory.createCustomDatabaseManager((Class) clazz); - } - catch (Throwable e) { + } catch (Throwable e) { e.printStackTrace(); sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Database.InvalidType", args[1])); return true; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/database/McremoveCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/database/McremoveCommand.java index c4b83e977..66f19cd15 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/database/McremoveCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/database/McremoveCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.database; -import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.commands.CommandUtils; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -26,8 +26,7 @@ public class McremoveCommand implements TabExecutor { if (mcMMO.getDatabaseManager().removeUser(playerName)) { sender.sendMessage(LocaleLoader.getString("Commands.mcremove.Success", playerName)); - } - else { + } else { sender.sendMessage(playerName + " could not be removed from the database."); // Pretty sure this should NEVER happen. } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java index 4ea0ecf2e..be5d98f63 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java @@ -2,8 +2,8 @@ package com.gmail.nossr50.commands.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.EventUtils; import com.gmail.nossr50.core.util.Permissions; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddxpCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddxpCommand.java index 2b1fbd647..112f087ef 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddxpCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddxpCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.experience; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -25,8 +25,7 @@ public class AddxpCommand extends ExperienceCommand { protected void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill, int value) { if (player != null) { UserManager.getPlayer(player).applyXpGain(skill, value, XPGainReason.COMMAND, XPGainSource.COMMAND); - } - else { + } else { profile.addXp(skill, value); profile.scheduleAsyncSave(); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java index 7c1b1b8ab..d75ee9182 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.experience; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.runnables.database.FormulaConversionTask; import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.mcMMO; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java index a8a24db35..37839cb3c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.experience; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.OfflinePlayer; import org.bukkit.command.Command; @@ -20,6 +20,14 @@ import java.util.List; import java.util.UUID; public abstract class ExperienceCommand implements TabExecutor { + protected static void handleSenderMessage(CommandSender sender, String playerName, PrimarySkillType skill) { + if (skill == null) { + sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", playerName)); + } else { + sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", skill.getName(), playerName)); + } + } + @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { PrimarySkillType skill; @@ -45,8 +53,7 @@ public abstract class ExperienceCommand implements TabExecutor { skill = null; } - if (skill != null && skill.isChildSkill()) - { + if (skill != null && skill.isChildSkill()) { sender.sendMessage(LocaleLoader.getString("Commands.Skill.ChildSkill")); return true; } @@ -70,8 +77,7 @@ public abstract class ExperienceCommand implements TabExecutor { skill = null; } - if (skill != null && skill.isChildSkill()) - { + if (skill != null && skill.isChildSkill()) { sender.sendMessage(LocaleLoader.getString("Commands.Skill.ChildSkill")); return true; } @@ -95,8 +101,7 @@ public abstract class ExperienceCommand implements TabExecutor { } editValues(null, profile, skill, value); - } - else { + } else { editValues(mcMMOPlayer.getPlayer(), mcMMOPlayer.getProfile(), skill, value); } @@ -122,24 +127,19 @@ public abstract class ExperienceCommand implements TabExecutor { } protected abstract boolean permissionsCheckSelf(CommandSender sender); + protected abstract boolean permissionsCheckOthers(CommandSender sender); + protected abstract void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill, int value); + protected abstract void handlePlayerMessageAll(Player player, int value); + protected abstract void handlePlayerMessageSkill(Player player, int value, PrimarySkillType skill); private boolean validateArguments(CommandSender sender, String skillName, String value) { return !(CommandUtils.isInvalidInteger(sender, value) || (!skillName.equalsIgnoreCase("all") && CommandUtils.isInvalidSkill(sender, skillName))); } - protected static void handleSenderMessage(CommandSender sender, String playerName, PrimarySkillType skill) { - if (skill == null) { - sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", playerName)); - } - else { - sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", skill.getName(), playerName)); - } - } - protected void editValues(Player player, PlayerProfile profile, PrimarySkillType skill, int value) { if (skill == null) { for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) { @@ -149,8 +149,7 @@ public abstract class ExperienceCommand implements TabExecutor { if (player != null) { handlePlayerMessageAll(player, value); } - } - else { + } else { handleCommand(player, profile, skill, value); if (player != null) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java index d7e9150f7..fa616cee1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java @@ -2,8 +2,8 @@ package com.gmail.nossr50.commands.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.EventUtils; import com.gmail.nossr50.core.util.Permissions; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java index d9a98242d..66d9ee038 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.commands.experience; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.EventUtils; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.OfflinePlayer; import org.bukkit.command.Command; @@ -27,6 +27,14 @@ import java.util.UUID; * value/quantity argument is removed. */ public class SkillresetCommand implements TabExecutor { + protected static void handleSenderMessage(CommandSender sender, String playerName, PrimarySkillType skill) { + if (skill == null) { + sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", playerName)); + } else { + sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", skill.getName(), playerName)); + } + } + @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { PrimarySkillType skill; @@ -47,8 +55,7 @@ public class SkillresetCommand implements TabExecutor { if (args[0].equalsIgnoreCase("all")) { skill = null; - } - else { + } else { skill = PrimarySkillType.getSkill(args[1]); } @@ -67,8 +74,7 @@ public class SkillresetCommand implements TabExecutor { if (args[1].equalsIgnoreCase("all")) { skill = null; - } - else { + } else { skill = PrimarySkillType.getSkill(args[1]); } @@ -89,8 +95,7 @@ public class SkillresetCommand implements TabExecutor { } editValues(null, profile, skill); - } - else { + } else { editValues(mcMMOPlayer.getPlayer(), mcMMOPlayer.getProfile(), skill); } @@ -149,15 +154,6 @@ public class SkillresetCommand implements TabExecutor { return skillName.equalsIgnoreCase("all") || !CommandUtils.isInvalidSkill(sender, skillName); } - protected static void handleSenderMessage(CommandSender sender, String playerName, PrimarySkillType skill) { - if (skill == null) { - sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", playerName)); - } - else { - sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", skill.getName(), playerName)); - } - } - protected void editValues(Player player, PlayerProfile profile, PrimarySkillType skill) { if (skill == null) { for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) { @@ -167,8 +163,7 @@ public class SkillresetCommand implements TabExecutor { if (player != null) { handlePlayerMessageAll(player); } - } - else { + } else { handleCommand(player, profile, skill); if (player != null) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java index 2e2bcd582..9d816402f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.hardcore; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.mcMMO; import org.bukkit.command.CommandSender; public class HardcoreCommand extends HardcoreModeCommand { @@ -54,8 +54,7 @@ public class HardcoreCommand extends HardcoreModeCommand { for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) { primarySkillType.setHardcoreStatLossEnabled(enable); } - } - else { + } else { skill.setHardcoreStatLossEnabled(enable); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreModeCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreModeCommand.java index 190e92925..5decf71e5 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreModeCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreModeCommand.java @@ -28,8 +28,7 @@ public abstract class HardcoreModeCommand implements TabExecutor { if (checkEnabled(null)) { disable(null); - } - else { + } else { enable(null); } @@ -122,9 +121,14 @@ public abstract class HardcoreModeCommand implements TabExecutor { } protected abstract boolean checkTogglePermissions(CommandSender sender); + protected abstract boolean checkModifyPermissions(CommandSender sender); + protected abstract boolean checkEnabled(PrimarySkillType skill); + protected abstract void enable(PrimarySkillType skill); + protected abstract void disable(PrimarySkillType skill); + protected abstract void modify(CommandSender sender, double newPercentage); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java index 97758e956..b3a19a48c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.hardcore; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.mcMMO; import org.bukkit.command.CommandSender; public class VampirismCommand extends HardcoreModeCommand { @@ -54,8 +54,7 @@ public class VampirismCommand extends HardcoreModeCommand { for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) { primarySkillType.setHardcoreVampirismEnabled(enable); } - } - else { + } else { skill.setHardcoreVampirismEnabled(enable); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyAcceptCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyAcceptCommand.java index d9e8535bd..acf63df8f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyAcceptCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyAcceptCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java index 6fc137f72..5eb2154f6 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.mcMMO; import org.bukkit.OfflinePlayer; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangePasswordCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangePasswordCommand.java index 28503767e..e8f49776d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangePasswordCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangePasswordCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java index d71b11818..a0d58322f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java @@ -3,12 +3,12 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.commands.chat.PartyChatCommand; import com.gmail.nossr50.commands.party.alliance.PartyAllianceCommand; import com.gmail.nossr50.commands.party.teleport.PtpCommand; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -38,24 +38,24 @@ public class PartyCommand implements TabExecutor { PARTY_SUBCOMMANDS = ImmutableList.copyOf(subcommands); } - private CommandExecutor partyJoinCommand = new PartyJoinCommand(); - private CommandExecutor partyAcceptCommand = new PartyAcceptCommand(); - private CommandExecutor partyCreateCommand = new PartyCreateCommand(); - private CommandExecutor partyQuitCommand = new PartyQuitCommand(); - private CommandExecutor partyXpShareCommand = new PartyXpShareCommand(); - private CommandExecutor partyItemShareCommand = new PartyItemShareCommand(); - private CommandExecutor partyInviteCommand = new PartyInviteCommand(); - private CommandExecutor partyKickCommand = new PartyKickCommand(); - private CommandExecutor partyDisbandCommand = new PartyDisbandCommand(); - private CommandExecutor partyChangeOwnerCommand = new PartyChangeOwnerCommand(); - private CommandExecutor partyLockCommand = new PartyLockCommand(); + private CommandExecutor partyJoinCommand = new PartyJoinCommand(); + private CommandExecutor partyAcceptCommand = new PartyAcceptCommand(); + private CommandExecutor partyCreateCommand = new PartyCreateCommand(); + private CommandExecutor partyQuitCommand = new PartyQuitCommand(); + private CommandExecutor partyXpShareCommand = new PartyXpShareCommand(); + private CommandExecutor partyItemShareCommand = new PartyItemShareCommand(); + private CommandExecutor partyInviteCommand = new PartyInviteCommand(); + private CommandExecutor partyKickCommand = new PartyKickCommand(); + private CommandExecutor partyDisbandCommand = new PartyDisbandCommand(); + private CommandExecutor partyChangeOwnerCommand = new PartyChangeOwnerCommand(); + private CommandExecutor partyLockCommand = new PartyLockCommand(); private CommandExecutor partyChangePasswordCommand = new PartyChangePasswordCommand(); - private CommandExecutor partyRenameCommand = new PartyRenameCommand(); - private CommandExecutor partyInfoCommand = new PartyInfoCommand(); - private CommandExecutor partyHelpCommand = new PartyHelpCommand(); - private CommandExecutor partyTeleportCommand = new PtpCommand(); - private CommandExecutor partyChatCommand = new PartyChatCommand(); - private CommandExecutor partyAllianceCommand = new PartyAllianceCommand(); + private CommandExecutor partyRenameCommand = new PartyRenameCommand(); + private CommandExecutor partyInfoCommand = new PartyInfoCommand(); + private CommandExecutor partyHelpCommand = new PartyHelpCommand(); + private CommandExecutor partyTeleportCommand = new PtpCommand(); + private CommandExecutor partyChatCommand = new PartyChatCommand(); + private CommandExecutor partyAllianceCommand = new PartyAllianceCommand(); @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCreateCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCreateCommand.java index 90f0fe974..ff547962d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCreateCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCreateCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java index 6d8c692c5..6001a512e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; -import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java index d8c0ed899..944bae118 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.core.datatypes.party.ShareMode; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -65,8 +65,7 @@ public class PartyInfoCommand implements CommandExecutor { if (isUnlockedFeature(party, partyFeature)) { unlockedPartyFeatures.add(partyFeature.getLocaleString()); - } - else { + } else { lockedPartyFeatures.add(partyFeature.getFeatureLockedLocaleString()); } } @@ -123,7 +122,7 @@ public class PartyInfoCommand implements CommandExecutor { int membersOnline = party.getVisibleMembers(player).size(); player.sendMessage(LocaleLoader.getString("Commands.Party.Members.Header")); - player.sendMessage(LocaleLoader.getString("Commands.Party.MembersNear", nearMembers.size()+1, membersOnline)); + player.sendMessage(LocaleLoader.getString("Commands.Party.MembersNear", nearMembers.size() + 1, membersOnline)); player.sendMessage(party.createMembersList(player)); } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java index 77240b094..facdd9fad 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -46,8 +46,7 @@ public class PartyInviteCommand implements CommandExecutor { Party playerParty = mcMMOPlayer.getParty(); - if(PartyManager.isPartyFull(target, playerParty)) - { + if (PartyManager.isPartyFull(target, playerParty)) { player.sendMessage(LocaleLoader.getString("Commands.Party.PartyFull.Invite", target.getName(), playerParty.toString(), Config.getInstance().getPartyMaxSize())); return true; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java index 0beb71618..473d4f637 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.ItemShareType; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; @@ -8,7 +9,6 @@ import com.gmail.nossr50.core.datatypes.party.ShareMode; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.StringUtils; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -41,19 +41,16 @@ public class PartyItemShareCommand implements CommandExecutor { if (CommandUtils.shouldEnableToggle(args[2])) { toggle = true; - } - else if (CommandUtils.shouldDisableToggle(args[2])) { + } else if (CommandUtils.shouldDisableToggle(args[2])) { toggle = false; - } - else { + } else { sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "itemshare", " ")); return true; } try { handleToggleItemShareCategory(party, ItemShareType.valueOf(args[1].toUpperCase()), toggle); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "itemshare", " ")); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyJoinCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyJoinCommand.java index e60ca6348..7d01ece25 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyJoinCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyJoinCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -54,8 +54,7 @@ public class PartyJoinCommand implements CommandExecutor { return true; } - if(PartyManager.isPartyFull(player, targetParty)) - { + if (PartyManager.isPartyFull(player, targetParty)) { player.sendMessage(LocaleLoader.getString("Commands.Party.PartyFull", targetParty.toString())); return true; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java index 4eec0fa64..7b969845d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; -import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; +import com.gmail.nossr50.mcMMO; import org.bukkit.OfflinePlayer; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java index 4e70cd29f..d312d4d94 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -17,8 +17,7 @@ public class PartyLockCommand implements CommandExecutor { case 1: if (args[0].equalsIgnoreCase("lock")) { togglePartyLock(sender, true); - } - else if (args[0].equalsIgnoreCase("unlock")) { + } else if (args[0].equalsIgnoreCase("unlock")) { togglePartyLock(sender, false); } @@ -32,11 +31,9 @@ public class PartyLockCommand implements CommandExecutor { if (CommandUtils.shouldEnableToggle(args[1])) { togglePartyLock(sender, true); - } - else if (CommandUtils.shouldDisableToggle(args[1])) { + } else if (CommandUtils.shouldDisableToggle(args[1])) { togglePartyLock(sender, false); - } - else { + } else { sendUsageStrings(sender); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java index 6c1f62e9f..2097451c4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java index b84a19c7e..802f1797e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartySubcommandType.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartySubcommandType.java index f4ebdb510..c9c45453d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartySubcommandType.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartySubcommandType.java @@ -30,20 +30,15 @@ public enum PartySubcommandType { if (commandName.equalsIgnoreCase("?")) { return HELP; - } - else if (commandName.equalsIgnoreCase("q") || commandName.equalsIgnoreCase("leave")) { + } else if (commandName.equalsIgnoreCase("q") || commandName.equalsIgnoreCase("leave")) { return QUIT; - } - else if (commandName.equalsIgnoreCase("leader")) { + } else if (commandName.equalsIgnoreCase("leader")) { return OWNER; - } - else if (commandName.equalsIgnoreCase("xpshare") || commandName.equalsIgnoreCase("shareexp") || commandName.equalsIgnoreCase("sharexp")) { + } else if (commandName.equalsIgnoreCase("xpshare") || commandName.equalsIgnoreCase("shareexp") || commandName.equalsIgnoreCase("sharexp")) { return XPSHARE; - } - else if (commandName.equalsIgnoreCase("shareitem") || commandName.equalsIgnoreCase("shareitems")) { + } else if (commandName.equalsIgnoreCase("shareitem") || commandName.equalsIgnoreCase("shareitems")) { return ITEMSHARE; - } - else if (commandName.equalsIgnoreCase("ally")) { + } else if (commandName.equalsIgnoreCase("ally")) { return ALLIANCE; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java index 1069244a3..2290132cf 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.core.datatypes.party.ShareMode; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.StringUtils; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -27,11 +27,9 @@ public class PartyXpShareCommand implements CommandExecutor { case 2: if (args[1].equalsIgnoreCase("none") || CommandUtils.shouldDisableToggle(args[1])) { handleChangingShareMode(party, ShareMode.NONE); - } - else if (args[1].equalsIgnoreCase("equal") || args[1].equalsIgnoreCase("even") || CommandUtils.shouldEnableToggle(args[1])) { + } else if (args[1].equalsIgnoreCase("equal") || args[1].equalsIgnoreCase("even") || CommandUtils.shouldEnableToggle(args[1])) { handleChangingShareMode(party, ShareMode.EQUAL); - } - else { + } else { sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "xpshare", "")); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceAcceptCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceAcceptCommand.java index 6169132c7..ed263aaa3 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceAcceptCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceAcceptCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.party.alliance; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java index 754d61a61..d7f7e07ee 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.commands.party.alliance; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.ChatColor; import org.bukkit.command.Command; @@ -21,12 +21,10 @@ import java.util.ArrayList; import java.util.List; public class PartyAllianceCommand implements TabExecutor { + public static final List ALLIANCE_SUBCOMMANDS = ImmutableList.of("invite", "accept", "disband"); private Player player; private Party playerParty; private Party targetParty; - - public static final List ALLIANCE_SUBCOMMANDS = ImmutableList.of("invite", "accept", "disband"); - private CommandExecutor partyAllianceInviteCommand = new PartyAllianceInviteCommand(); private CommandExecutor partyAllianceAcceptCommand = new PartyAllianceAcceptCommand(); private CommandExecutor partyAllianceDisbandCommand = new PartyAllianceDisbandCommand(); diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceDisbandCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceDisbandCommand.java index 418f4f478..34bf835c3 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceDisbandCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceDisbandCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.party.alliance; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceInviteCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceInviteCommand.java index 704e3e0c8..c396ab8f2 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceInviteCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceInviteCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.party.alliance; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java index b525e779d..fa4d0d675 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.party.teleport; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -20,8 +20,7 @@ public class PtpAcceptAnyCommand implements CommandExecutor { if (ptpRecord.isConfirmRequired()) { sender.sendMessage(LocaleLoader.getString("Commands.ptp.AcceptAny.Disabled")); - } - else { + } else { sender.sendMessage(LocaleLoader.getString("Commands.ptp.AcceptAny.Enabled")); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java index de5330587..824d5e7c9 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.party.teleport; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.SkillUtils; import org.bukkit.World; import org.bukkit.command.Command; @@ -49,8 +49,7 @@ public class PtpAcceptCommand implements CommandExecutor { if (!Permissions.partyTeleportWorld(target, targetWorld)) { target.sendMessage(LocaleLoader.getString("Commands.ptp.NoWorldPermissions", targetWorld.getName())); return true; - } - else if (targetWorld != playerWorld && !Permissions.partyTeleportWorld(target, playerWorld)) { + } else if (targetWorld != playerWorld && !Permissions.partyTeleportWorld(target, playerWorld)) { target.sendMessage(LocaleLoader.getString("Commands.ptp.NoWorldPermissions", playerWorld.getName())); return true; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java index a76b3af7e..625cc8257 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java @@ -2,22 +2,22 @@ package com.gmail.nossr50.commands.party.teleport; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.skills.WorldBlacklist; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.runnables.items.TeleportationWarmup; import com.gmail.nossr50.core.util.EventUtils; import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.SkillUtils; import com.gmail.nossr50.core.worldguard.WorldGuardManager; import com.gmail.nossr50.core.worldguard.WorldGuardUtils; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -36,6 +36,54 @@ public class PtpCommand implements TabExecutor { private CommandExecutor ptpAcceptAnyCommand = new PtpAcceptAnyCommand(); private CommandExecutor ptpAcceptCommand = new PtpAcceptCommand(); + protected static boolean canTeleport(CommandSender sender, Player player, String targetName) { + McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetName); + + if (!CommandUtils.checkPlayerExistence(sender, targetName, mcMMOTarget)) { + return false; + } + + Player target = mcMMOTarget.getPlayer(); + + if (player.equals(target)) { + player.sendMessage(LocaleLoader.getString("Party.Teleport.Self")); + return false; + } + + if (!PartyManager.inSameParty(player, target)) { + player.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName)); + return false; + } + + if (!mcMMOTarget.getPartyTeleportRecord().isEnabled()) { + player.sendMessage(LocaleLoader.getString("Party.Teleport.Disabled", targetName)); + return false; + } + + if (!target.isValid()) { + player.sendMessage(LocaleLoader.getString("Party.Teleport.Dead")); + return false; + } + + return true; + } + + protected static void handleTeleportWarmup(Player teleportingPlayer, Player targetPlayer) { + McMMOPlayer mcMMOPlayer = UserManager.getPlayer(teleportingPlayer); + McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetPlayer); + + long warmup = Config.getInstance().getPTPCommandWarmup(); + + mcMMOPlayer.actualizeTeleportCommenceLocation(teleportingPlayer); + + if (warmup > 0) { + teleportingPlayer.sendMessage(LocaleLoader.getString("Teleport.Commencing", warmup)); + new TeleportationWarmup(mcMMOPlayer, mcMMOTarget).runTaskLater(mcMMO.p, 20 * warmup); + } else { + EventUtils.handlePartyTeleportEvent(teleportingPlayer, targetPlayer); + } + } + @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (CommandUtils.noConsoleUsage(sender)) { @@ -45,14 +93,13 @@ public class PtpCommand implements TabExecutor { Player player = (Player) sender; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return true; } /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(player.getWorld())) + if (WorldBlacklist.isWorldBlacklisted(player.getWorld())) return true; if (!UserManager.hasPlayerDataKey(player)) { @@ -171,53 +218,4 @@ public class PtpCommand implements TabExecutor { target.sendMessage(LocaleLoader.getString("Commands.ptp.Request1", player.getName())); target.sendMessage(LocaleLoader.getString("Commands.ptp.Request2", Config.getInstance().getPTPCommandTimeout())); } - - protected static boolean canTeleport(CommandSender sender, Player player, String targetName) { - McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetName); - - if (!CommandUtils.checkPlayerExistence(sender, targetName, mcMMOTarget)) { - return false; - } - - Player target = mcMMOTarget.getPlayer(); - - if (player.equals(target)) { - player.sendMessage(LocaleLoader.getString("Party.Teleport.Self")); - return false; - } - - if (!PartyManager.inSameParty(player, target)) { - player.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName)); - return false; - } - - if (!mcMMOTarget.getPartyTeleportRecord().isEnabled()) { - player.sendMessage(LocaleLoader.getString("Party.Teleport.Disabled", targetName)); - return false; - } - - if (!target.isValid()) { - player.sendMessage(LocaleLoader.getString("Party.Teleport.Dead")); - return false; - } - - return true; - } - - protected static void handleTeleportWarmup(Player teleportingPlayer, Player targetPlayer) { - McMMOPlayer mcMMOPlayer = UserManager.getPlayer(teleportingPlayer); - McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetPlayer); - - long warmup = Config.getInstance().getPTPCommandWarmup(); - - mcMMOPlayer.actualizeTeleportCommenceLocation(teleportingPlayer); - - if (warmup > 0) { - teleportingPlayer.sendMessage(LocaleLoader.getString("Teleport.Commencing", warmup)); - new TeleportationWarmup(mcMMOPlayer, mcMMOTarget).runTaskLater(mcMMO.p, 20 * warmup); - } - else { - EventUtils.handlePartyTeleportEvent(teleportingPlayer, targetPlayer); - } - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java index 1449b7c24..e1e4a7097 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.party.teleport; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -20,8 +20,7 @@ public class PtpToggleCommand implements CommandExecutor { if (ptpRecord.isEnabled()) { sender.sendMessage(LocaleLoader.getString("Commands.ptp.Disabled")); - } - else { + } else { sender.sendMessage(LocaleLoader.getString("Commands.ptp.Enabled")); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java index 7214e389c..5bb5384bd 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.commands.player; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -65,8 +65,7 @@ public class InspectCommand implements TabExecutor { sender.sendMessage(CommandUtils.displaySkill(profile, skill)); } - } - else { + } else { Player target = mcMMOPlayer.getPlayer(); if (CommandUtils.hidden(sender, target, Permissions.inspectHidden(sender))) { @@ -74,8 +73,7 @@ public class InspectCommand implements TabExecutor { sender.sendMessage(LocaleLoader.getString("Inspect.Offline")); return true; } - } - else if (CommandUtils.tooFar(sender, target, Permissions.inspectFar(sender))) { + } else if (CommandUtils.tooFar(sender, target, Permissions.inspectFar(sender))) { return true; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java index 29734c1be..6a3c06715 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.player; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.SuperAbilityType; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; @@ -52,8 +52,7 @@ public class MccooldownCommand implements TabExecutor { if (seconds <= 0) { player.sendMessage(LocaleLoader.getString("Commands.Cooldowns.Row.Y", ability.getName())); - } - else { + } else { player.sendMessage(LocaleLoader.getString("Commands.Cooldowns.Row.N", ability.getName(), seconds)); } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java index abcea5284..419606632 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.commands.player; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.runnables.commands.McrankCommandAsyncTask; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -61,8 +61,7 @@ public class McrankCommand implements TabExecutor { if (CommandUtils.tooFar(sender, player, Permissions.mcrankFar(sender))) { return true; } - } - else if (CommandUtils.inspectOffline(sender, mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false), Permissions.mcrankOffline(sender))) { + } else if (CommandUtils.inspectOffline(sender, mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false), Permissions.mcrankOffline(sender))) { return true; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java index 3a7bc321e..64b2fc11d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.player; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; @@ -47,8 +47,7 @@ public class McstatsCommand implements TabExecutor { if (powerLevelCap != Integer.MAX_VALUE) { player.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Capped", UserManager.getPlayer(player).getPowerLevel(), powerLevelCap)); - } - else { + } else { player.sendMessage(LocaleLoader.getString("Commands.PowerLevel", UserManager.getPlayer(player).getPowerLevel())); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java index fd53d54bf..bbefd239a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.commands.player; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.runnables.commands.MctopCommandAsyncTask; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.StringUtils; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java index c6cf8b0f4..86d9c068c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; -import com.gmail.nossr50.listeners.InteractionManager; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.util.random.RandomChanceSkill; import com.gmail.nossr50.core.util.random.RandomChanceUtil; import com.gmail.nossr50.core.util.skills.SkillActivationType; +import com.gmail.nossr50.listeners.InteractionManager; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; @@ -50,31 +50,30 @@ public class AcrobaticsCommand extends SkillCommand { messages.add(getStatMessage(SubSkillType.ACROBATICS_DODGE, dodgeChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", dodgeChanceLucky) : "")); } - + if (canRoll) { AbstractSubSkill abstractSubSkill = InteractionManager.getAbstractByName("Roll"); - if(abstractSubSkill != null) - { + if (abstractSubSkill != null) { double rollChance, graceChance; //Chance to roll at half - RandomChanceSkill roll_rcs = new RandomChanceSkill(player, SubSkillType.ACROBATICS_ROLL); + RandomChanceSkill roll_rcs = new RandomChanceSkill(player, SubSkillType.ACROBATICS_ROLL); //Chance to graceful roll RandomChanceSkill grace_rcs = new RandomChanceSkill(player, SubSkillType.ACROBATICS_ROLL); grace_rcs.setSkillLevel(grace_rcs.getSkillLevel() * 2); //Double Odds //Chance Stat Calculations - rollChance = RandomChanceUtil.getRandomChanceExecutionChance(roll_rcs); - graceChance = RandomChanceUtil.getRandomChanceExecutionChance(grace_rcs); + rollChance = RandomChanceUtil.getRandomChanceExecutionChance(roll_rcs); + graceChance = RandomChanceUtil.getRandomChanceExecutionChance(grace_rcs); //damageThreshold = AdvancedConfig.getInstance().getRollDamageThreshold(); String rollStrings[] = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.ACROBATICS_ROLL); //Format - double rollChanceLucky = rollChance * 1.333D; + double rollChanceLucky = rollChance * 1.333D; double graceChanceLucky = graceChance * 1.333D; messages.add(getStatMessage(SubSkillType.ACROBATICS_ROLL, rollStrings[0]) diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AlchemyCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AlchemyCommand.java index c5d0da343..86ffdc2d3 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AlchemyCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AlchemyCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyManager; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.RankUtils; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; @@ -18,8 +18,8 @@ public class AlchemyCommand extends SkillCommand { private String brewSpeed; private String brewSpeedLucky; - private int tier; - private int ingredientCount; + private int tier; + private int ingredientCount; private String ingredientList; private boolean canCatalysis; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AprilCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AprilCommand.java index 54863cd3c..52edb0b78 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AprilCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AprilCommand.java @@ -16,10 +16,9 @@ import java.util.ArrayList; import java.util.List; public class AprilCommand implements TabExecutor { - private String skillName; - protected DecimalFormat percent = new DecimalFormat("##0.00%"); protected DecimalFormat decimal = new DecimalFormat("##0.00"); + private String skillName; @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java index 94ceca20f..9da128ba9 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.primary.archery.Archery; import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.util.skills.SkillActivationType; @@ -35,14 +35,14 @@ public class ArcheryCommand extends SkillCommand { retrieveChance = retrieveStrings[0]; retrieveChanceLucky = retrieveStrings[1]; } - + // ARCHERY_DAZE if (canDaze) { String[] dazeStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.ARCHERY_DAZE); dazeChance = dazeStrings[0]; dazeChanceLucky = dazeStrings[1]; } - + // SKILL SHOT if (canSkillShot) { skillShotBonus = percent.format(Archery.getDamageBonusPercent(player)); @@ -64,12 +64,12 @@ public class ArcheryCommand extends SkillCommand { messages.add(getStatMessage(SubSkillType.ARCHERY_ARROW_RETRIEVAL, retrieveChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", retrieveChanceLucky) : "")); } - + if (canDaze) { messages.add(getStatMessage(SubSkillType.ARCHERY_DAZE, dazeChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", dazeChanceLucky) : "")); } - + if (canSkillShot) { messages.add(getStatMessage(SubSkillType.ARCHERY_SKILL_SHOT, skillShotBonus)); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java index 160d52d64..a95eb273c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.primary.axes.Axes; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.RankUtils; import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; @@ -44,14 +44,14 @@ public class AxesCommand extends SkillCommand { if (canAxeMastery) { axeMasteryDamage = Axes.getAxeMasteryBonusDamage(player); } - + // CRITICAL HIT if (canCritical) { String[] criticalHitStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.AXES_CRITICAL_STRIKES); critChance = criticalHitStrings[0]; critChanceLucky = criticalHitStrings[1]; } - + // SKULL SPLITTER if (canSkullSplitter) { String[] skullSplitterStrings = calculateLengthDisplayValues(player, skillValue); @@ -76,7 +76,7 @@ public class AxesCommand extends SkillCommand { if (canImpact) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Axes.Ability.Bonus.2"), LocaleLoader.getString("Axes.Ability.Bonus.3", impactDamage))); } - + if (canAxeMastery) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Axes.Ability.Bonus.0"), LocaleLoader.getString("Axes.Ability.Bonus.1", axeMasteryDamage))); } @@ -85,7 +85,7 @@ public class AxesCommand extends SkillCommand { messages.add(getStatMessage(SubSkillType.AXES_CRITICAL_STRIKES, critChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", critChanceLucky) : "")); } - + if (canGreaterImpact) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Axes.Ability.Bonus.4"), LocaleLoader.getString("Axes.Ability.Bonus.5", Axes.greaterImpactBonusDamage))); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java index c502553e7..c8debcff0 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.util.skills.RankUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java index ba150f6f0..4e60a73b7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java @@ -2,15 +2,15 @@ package com.gmail.nossr50.commands.skills; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.treasure.TreasureConfig; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.skills.treasure.Rarity; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.primary.fishing.Fishing; import com.gmail.nossr50.core.skills.primary.fishing.FishingManager; +import com.gmail.nossr50.core.skills.treasure.Rarity; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.random.RandomChanceUtil; import com.gmail.nossr50.core.util.skills.RankUtils; import net.md_5.bungee.api.chat.TextComponent; @@ -74,7 +74,7 @@ public class FishingCommand extends SkillCommand { } } - if(totalEnchantChance >= 1) + if (totalEnchantChance >= 1) magicChance = percent.format(totalEnchantChance / 100.0); else magicChance = percent.format(0); @@ -129,15 +129,15 @@ public class FishingCommand extends SkillCommand { @Override protected List statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) { List messages = new ArrayList(); - + if (canFishermansDiet) { messages.add(getStatMessage(false, true, SubSkillType.FISHING_FISHERMANS_DIET, String.valueOf(fishermansDietRank))); } - + if (canIceFish) { messages.add(getStatMessage(SubSkillType.FISHING_ICE_FISHING, SubSkillType.FISHING_ICE_FISHING.getLocaleStatDescription())); } - + if (canMagicHunt) { messages.add(getStatMessage(SubSkillType.FISHING_MAGIC_HUNTER, magicChance)); } @@ -146,12 +146,12 @@ public class FishingCommand extends SkillCommand { //TODO: Update this with more details messages.add(getStatMessage(false, true, SubSkillType.FISHING_MASTER_ANGLER, biteChance)); } - + if (canShake) { messages.add(getStatMessage(SubSkillType.FISHING_SHAKE, shakeChance) - + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", shakeChanceLucky) : "")); + + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", shakeChanceLucky) : "")); } - + if (canTreasureHunt) { messages.add(getStatMessage(false, true, SubSkillType.FISHING_TREASURE_HUNTER, String.valueOf(lootTier), String.valueOf(RankUtils.getHighestRank(SubSkillType.FISHING_TREASURE_HUNTER)))); messages.add(getStatMessage(true, true, SubSkillType.FISHING_TREASURE_HUNTER, diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java index 54d49dcce..a5e86c6dd 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.util.skills.RankUtils; @@ -42,19 +42,20 @@ public class HerbalismCommand extends SkillCommand { @Override protected void dataCalculations(Player player, float skillValue) { - + // DOUBLE DROPS if (canDoubleDrop) { - String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.HERBALISM_DOUBLE_DROPS);; + String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.HERBALISM_DOUBLE_DROPS); + ; doubleDropChance = doubleDropStrings[0]; doubleDropChanceLucky = doubleDropStrings[1]; } - + // FARMERS DIET if (canFarmersDiet) { farmersDietRank = RankUtils.getRank(player, SubSkillType.HERBALISM_FARMERS_DIET); } - + // GREEN TERRA if (canGreenTerra) { String[] greenTerraStrings = calculateLengthDisplayValues(player, skillValue); @@ -105,11 +106,11 @@ public class HerbalismCommand extends SkillCommand { messages.add(getStatMessage(SubSkillType.HERBALISM_DOUBLE_DROPS, doubleDropChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : "")); } - + if (canFarmersDiet) { messages.add(getStatMessage(false, true, SubSkillType.HERBALISM_FARMERS_DIET, String.valueOf(farmersDietRank))); } - + if (canGreenTerra) { messages.add(getStatMessage(SubSkillType.HERBALISM_GREEN_TERRA, greenTerraLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", greenTerraLengthEndurance) : "")); @@ -124,7 +125,7 @@ public class HerbalismCommand extends SkillCommand { } if (canGreenThumbPlants) { - messages.add(getStatMessage(true, true,SubSkillType.HERBALISM_GREEN_THUMB, String.valueOf(greenThumbStage))); + messages.add(getStatMessage(true, true, SubSkillType.HERBALISM_GREEN_THUMB, String.valueOf(greenThumbStage))); } if (hasHylianLuck) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java index 2ae4fe8dd..9e0cc63ee 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.primary.mining.MiningManager; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.RankUtils; import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; @@ -51,14 +51,14 @@ public class MiningCommand extends SkillCommand { blastDamageDecrease = percent.format(miningManager.getBlastDamageModifier() / 100.0D); blastRadiusIncrease = miningManager.getBlastRadiusModifier(); } - + // DOUBLE DROPS if (canDoubleDrop) { String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.MINING_DOUBLE_DROPS); doubleDropChance = doubleDropStrings[0]; doubleDropChanceLucky = doubleDropStrings[1]; } - + // SUPER BREAKER if (canSuperBreaker) { String[] superBreakerStrings = calculateLengthDisplayValues(player, skillValue); @@ -84,17 +84,17 @@ public class MiningCommand extends SkillCommand { messages.add(getStatMessage(true, true, SubSkillType.MINING_BLAST_MINING, String.valueOf(blastRadiusIncrease))); //messages.add(LocaleLoader.getString("Mining.Blast.Radius.Increase", blastRadiusIncrease)); } - + if (canBlast) { messages.add(getStatMessage(false, true, SubSkillType.MINING_BLAST_MINING, String.valueOf(blastMiningRank), String.valueOf(RankUtils.getHighestRank(SubSkillType.MINING_BLAST_MINING)), LocaleLoader.getString("Mining.Blast.Effect", oreBonus, debrisReduction, bonusTNTDrops))); //messages.add(LocaleLoader.getString("Mining.Blast.Rank", blastMiningRank, RankUtils.getHighestRank(SubSkillType.MINING_BLAST_MINING), LocaleLoader.getString("Mining.Blast.Effect", oreBonus, debrisReduction, bonusTNTDrops))); } - - if (canDemoExpert) { + + if (canDemoExpert) { messages.add(getStatMessage(SubSkillType.MINING_DEMOLITIONS_EXPERTISE, blastDamageDecrease)); //messages.add(LocaleLoader.getString("Mining.Effect.Decrease", blastDamageDecrease)); } - + if (canDoubleDrop) { messages.add(getStatMessage(SubSkillType.HERBALISM_DOUBLE_DROPS, doubleDropChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : "")); diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java index 3883f797e..6c1f2ead5 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; -import com.gmail.nossr50.listeners.InteractionManager; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; +import com.gmail.nossr50.listeners.InteractionManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -27,26 +27,22 @@ public class MmoInfoCommand implements TabExecutor { /* * Only allow players to use this command */ - if(commandSender instanceof Player) - { - if(args.length < 1) + if (commandSender instanceof Player) { + if (args.length < 1) return false; Player player = (Player) commandSender; - if(Permissions.mmoinfo(player)) - { - if(args == null || args[0] == null) + if (Permissions.mmoinfo(player)) { + if (args == null || args[0] == null) return false; - if(args[0].equalsIgnoreCase( "???")) - { + if (args[0].equalsIgnoreCase("???")) { player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Header")); player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.SubSkillHeader", "???")); player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.DetailsHeader")); player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Mystery")); return true; - } else if(InteractionManager.getAbstractByName(args[0]) != null || PrimarySkillType.SUBSKILL_NAMES.contains(args[0])) - { + } else if (InteractionManager.getAbstractByName(args[0]) != null || PrimarySkillType.SUBSKILL_NAMES.contains(args[0])) { displayInfo(player, args[0]); return true; } @@ -70,12 +66,10 @@ public class MmoInfoCommand implements TabExecutor { } } - private void displayInfo(Player player, String subSkillName) - { + private void displayInfo(Player player, String subSkillName) { //Check to see if the skill exists in the new system AbstractSubSkill abstractSubSkill = InteractionManager.getAbstractByName(subSkillName); - if(abstractSubSkill != null) - { + if (abstractSubSkill != null) { /* New System Skills are programmable */ abstractSubSkill.printInfo(player); //TextComponentFactory.sendPlayerUrlHeader(player); @@ -89,9 +83,8 @@ public class MmoInfoCommand implements TabExecutor { player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.OldSkill")); } - for(SubSkillType subSkillType : SubSkillType.values()) - { - if(subSkillType.getNiceNameNoSpaces(subSkillType).equalsIgnoreCase(subSkillName)) + for (SubSkillType subSkillType : SubSkillType.values()) { + if (subSkillType.getNiceNameNoSpaces(subSkillType).equalsIgnoreCase(subSkillName)) subSkillName = subSkillType.getWikiName(subSkillType.toString()); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java index 049823e35..4833a9619 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java @@ -1,19 +1,19 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.MaterialType; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.skills.primary.repair.ArcaneForging; import com.gmail.nossr50.core.skills.primary.repair.Repair; import com.gmail.nossr50.core.skills.primary.repair.RepairManager; import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.RankUtils; import com.gmail.nossr50.core.util.skills.SkillActivationType; +import com.gmail.nossr50.mcMMO; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -107,7 +107,7 @@ public class RepairCommand extends SkillCommand { String.valueOf(arcaneBypass ? 0 : repairManager.getDowngradeEnchantChance()))); //Jesus those parentheses } } - + if (canMasterRepair) { messages.add(getStatMessage(false, true, SubSkillType.REPAIR_REPAIR_MASTERY, repairMasteryBonus)); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java index 1c5b03f6a..43dcc9870 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.child.salvage.Salvage; import com.gmail.nossr50.core.skills.child.salvage.SalvageManager; import com.gmail.nossr50.core.util.TextComponentFactory; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.RankUtils; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java index d12a2f1cf..95c21b0ac 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java @@ -2,16 +2,16 @@ package com.gmail.nossr50.commands.skills; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.child.FamilyTree; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.StringUtils; import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.random.RandomChanceUtil; import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.core.util.skills.PerksUtils; @@ -33,11 +33,9 @@ import java.util.Set; public abstract class SkillCommand implements TabExecutor { protected PrimarySkillType skill; - private String skillName; - protected DecimalFormat percent = new DecimalFormat("##0.00%"); protected DecimalFormat decimal = new DecimalFormat("##0.00"); - + private String skillName; private CommandExecutor skillGuideCommand; public SkillCommand(PrimarySkillType skill) { @@ -46,6 +44,15 @@ public abstract class SkillCommand implements TabExecutor { skillGuideCommand = new SkillGuideCommand(skill); } + public static String[] addItemToFirstPositionOfArray(String itemToAdd, String... existingArray) { + String[] newArray = new String[existingArray.length + 1]; + newArray[0] = itemToAdd; + + System.arraycopy(existingArray, 0, newArray, 1, existingArray.length); + + return newArray; + } + @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (CommandUtils.noConsoleUsage(sender)) { @@ -66,9 +73,8 @@ public abstract class SkillCommand implements TabExecutor { float skillValue = mcMMOPlayer.getSkillLevel(skill); //Send the players a few blank lines to make finding the top of the skill command easier - if(AdvancedConfig.getInstance().doesSkillCommandSendBlankLines()) - for(int i = 0; i < 2; i++) - { + if (AdvancedConfig.getInstance().doesSkillCommandSendBlankLines()) + for (int i = 0; i < 2; i++) { player.sendMessage(""); } @@ -99,8 +105,7 @@ public abstract class SkillCommand implements TabExecutor { //Link Header - if(Config.getInstance().getUrlLinksEnabled()) - { + if (Config.getInstance().getUrlLinksEnabled()) { player.sendMessage(LocaleLoader.getString("Overhaul.mcMMO.Header")); TextComponentFactory.sendPlayerUrlHeader(player); } @@ -138,8 +143,7 @@ public abstract class SkillCommand implements TabExecutor { player.sendMessage(LocaleLoader.getString("Skills.Overhaul.Header", skillName)); - if(!skill.isChildSkill()) - { + if (!skill.isChildSkill()) { /* * NON-CHILD SKILLS */ @@ -162,17 +166,16 @@ public abstract class SkillCommand implements TabExecutor { //TODO: Add JSON here for (PrimarySkillType parent : parents) { parentList.add(parent); - /*player.sendMessage(parent.getName() + " - " + LocaleLoader.getString("Effects.Level.Overhaul", mcMMOPlayer.getSkillLevel(parent), mcMMOPlayer.getSkillXpLevel(parent), mcMMOPlayer.getXpToLevel(parent)))*/; + /*player.sendMessage(parent.getName() + " - " + LocaleLoader.getString("Effects.Level.Overhaul", mcMMOPlayer.getSkillLevel(parent), mcMMOPlayer.getSkillXpLevel(parent), mcMMOPlayer.getXpToLevel(parent)))*/ + ; } String parentMessage = ""; - for(int i = 0; i < parentList.size(); i++) - { - if(i+1 < parentList.size()) - { + for (int i = 0; i < parentList.size(); i++) { + if (i + 1 < parentList.size()) { parentMessage += LocaleLoader.getString("Effects.Child.ParentList", parentList.get(i).getName(), mcMMOPlayer.getSkillLevel(parentList.get(i))); - parentMessage += ChatColor.GRAY+", "; + parentMessage += ChatColor.GRAY + ", "; } else { parentMessage += LocaleLoader.getString("Effects.Child.ParentList", parentList.get(i).getName(), mcMMOPlayer.getSkillLevel(parentList.get(i))); } @@ -231,11 +234,9 @@ public abstract class SkillCommand implements TabExecutor { int length; - if(abilityLengthCap <= 0) - { + if (abilityLengthCap <= 0) { length = 2 + (int) (skillValue / abilityLengthVar); - } - else { + } else { length = 2 + (int) (Math.min(abilityLengthCap, skillValue) / abilityLengthVar); } @@ -245,40 +246,27 @@ public abstract class SkillCommand implements TabExecutor { length = Math.min(length, maxLength); } - return new String[] { String.valueOf(length), String.valueOf(enduranceLength) }; + return new String[]{String.valueOf(length), String.valueOf(enduranceLength)}; } - protected String getStatMessage(SubSkillType subSkillType, String... vars) - { + protected String getStatMessage(SubSkillType subSkillType, String... vars) { return getStatMessage(false, false, subSkillType, vars); } - protected String getStatMessage(boolean isExtra, boolean isCustom, SubSkillType subSkillType, String... vars) - { + protected String getStatMessage(boolean isExtra, boolean isCustom, SubSkillType subSkillType, String... vars) { String templateKey = isCustom ? "Ability.Generic.Template.Custom" : "Ability.Generic.Template"; String statDescriptionKey = !isExtra ? subSkillType.getLocaleKeyStatDescription() : subSkillType.getLocaleKeyStatExtraDescription(); - if(isCustom) + if (isCustom) //Cast to Object[] to suppress warnings return LocaleLoader.getString(templateKey, LocaleLoader.getString(statDescriptionKey, (Object[]) vars)); - else - { + else { String[] mergedList = addItemToFirstPositionOfArray(LocaleLoader.getString(statDescriptionKey), vars); //Cast to Object[] to suppress warnings return LocaleLoader.getString(templateKey, (Object[]) mergedList); } } - - public static String[] addItemToFirstPositionOfArray(String itemToAdd, String... existingArray) { - String[] newArray = new String[existingArray.length + 1]; - newArray[0] = itemToAdd; - - System.arraycopy(existingArray, 0, newArray, 1, existingArray.length); - - return newArray; - } - protected abstract void dataCalculations(Player player, float skillValue); protected abstract void permissionsCheck(Player player); @@ -291,12 +279,12 @@ public abstract class SkillCommand implements TabExecutor { /** * Checks if a player can use a skill - * @param player target player + * + * @param player target player * @param subSkillType target subskill * @return true if the player has permission and has the skill unlocked */ - protected boolean canUseSubskill(Player player, SubSkillType subSkillType) - { + protected boolean canUseSubskill(Player player, SubSkillType subSkillType) { return Permissions.isSubSkillEnabled(player, subSkillType) && RankUtils.hasUnlockedSubskill(player, subSkillType); } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillGuideCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillGuideCommand.java index 7b1280c4a..9a0694860 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillGuideCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillGuideCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.StringUtils; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -75,8 +75,7 @@ public class SkillGuideCommand implements CommandExecutor { while (allStrings.size() < 9) { if (pageIndexStart + allStrings.size() > guide.size()) { allStrings.add(""); - } - else { + } else { allStrings.add(guide.get(pageIndexStart + (allStrings.size() - 1))); } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java index d01ae1ebc..59c71571f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.child.smelting.Smelting; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.RankUtils; import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; @@ -44,7 +44,7 @@ public class SmeltingCommand extends SkillCommand { str_fluxMiningChance = fluxMiningStrings[0]; str_fluxMiningChanceLucky = fluxMiningStrings[1]; }*/ - + // SECOND SMELT if (canSecondSmelt) { String[] secondSmeltStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.SMELTING_SECOND_SMELT); @@ -70,7 +70,7 @@ public class SmeltingCommand extends SkillCommand { + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", str_fluxMiningChanceLucky) : "")); //messages.add(LocaleLoader.getString("Smelting.Ability.FluxMining", str_fluxMiningChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", str_fluxMiningChanceLucky) : "")); }*/ - + if (canFuelEfficiency) { messages.add(getStatMessage(false, true, SubSkillType.SMELTING_FUEL_EFFICIENCY, burnTimeModifier)); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java index 7133d440a..a202d2f3b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.RankUtils; import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; @@ -49,7 +49,7 @@ public class SwordsCommand extends SkillCommand { bleedChance = bleedStrings[0]; bleedChanceLucky = bleedStrings[1]; } - + // SERRATED STRIKES if (canSerratedStrike) { String[] serratedStrikesStrings = calculateLengthDisplayValues(player, skillValue); @@ -70,8 +70,8 @@ public class SwordsCommand extends SkillCommand { List messages = new ArrayList(); int ruptureTicks = UserManager.getPlayer(player).getSwordsManager().getRuptureBleedTicks(); - double ruptureDamagePlayers = RankUtils.getRank(player, SubSkillType.SWORDS_RUPTURE) >= 3 ? AdvancedConfig.getInstance().getRuptureDamagePlayer() * 1.5D : AdvancedConfig.getInstance().getRuptureDamagePlayer(); - double ruptureDamageMobs = RankUtils.getRank(player, SubSkillType.SWORDS_RUPTURE) >= 3 ? AdvancedConfig.getInstance().getRuptureDamageMobs() * 1.5D : AdvancedConfig.getInstance().getRuptureDamageMobs(); + double ruptureDamagePlayers = RankUtils.getRank(player, SubSkillType.SWORDS_RUPTURE) >= 3 ? AdvancedConfig.getInstance().getRuptureDamagePlayer() * 1.5D : AdvancedConfig.getInstance().getRuptureDamagePlayer(); + double ruptureDamageMobs = RankUtils.getRank(player, SubSkillType.SWORDS_RUPTURE) >= 3 ? AdvancedConfig.getInstance().getRuptureDamageMobs() * 1.5D : AdvancedConfig.getInstance().getRuptureDamageMobs(); if (canCounter) { messages.add(getStatMessage(SubSkillType.SWORDS_COUNTER_ATTACK, counterChance) diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java index 23fe7406f..5d0833f0d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.primary.taming.Taming; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; @@ -61,17 +61,17 @@ public class TamingCommand extends SkillCommand { if (canEnvironmentallyAware) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.0"), LocaleLoader.getString("Taming.Ability.Bonus.1"))); } - + if (canFastFood) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.8"), LocaleLoader.getString("Taming.Ability.Bonus.9", percent.format(Taming.fastFoodServiceActivationChance / 100D)))); } - + if (canGore) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Combat.Chance.Gore"), goreChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", goreChanceLucky) : "")); } - + if (canHolyHound) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.10"), LocaleLoader.getString("Taming.Ability.Bonus.11"))); } @@ -79,11 +79,11 @@ public class TamingCommand extends SkillCommand { if (canSharpenedClaws) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.6"), LocaleLoader.getString("Taming.Ability.Bonus.7", Taming.sharpenedClawsBonusDamage))); } - + if (canShockProof) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.4"), LocaleLoader.getString("Taming.Ability.Bonus.5", Taming.shockProofModifier))); } - + if (canThickFur) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.2"), LocaleLoader.getString("Taming.Ability.Bonus.3", Taming.thickFurModifier))); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java index 30f3ebb0a..e0f84b728 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.RankUtils; import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; @@ -39,11 +39,12 @@ public class UnarmedCommand extends SkillCommand { protected void dataCalculations(Player player, float skillValue) { // UNARMED_ARROW_DEFLECT if (canDeflect) { - String[] deflectStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_ARROW_DEFLECT);; + String[] deflectStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_ARROW_DEFLECT); + ; deflectChance = deflectStrings[0]; deflectChanceLucky = deflectStrings[1]; } - + // BERSERK if (canBerserk) { String[] berserkStrings = calculateLengthDisplayValues(player, skillValue); @@ -53,7 +54,8 @@ public class UnarmedCommand extends SkillCommand { // UNARMED_DISARM if (canDisarm) { - String[] disarmStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_DISARM);; + String[] disarmStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_DISARM); + ; disarmChance = disarmStrings[0]; disarmChanceLucky = disarmStrings[1]; } @@ -90,19 +92,19 @@ public class UnarmedCommand extends SkillCommand { + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", deflectChanceLucky) : "")); //messages.add(LocaleLoader.getString("Unarmed.Ability.Chance.ArrowDeflect", deflectChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", deflectChanceLucky) : "")); } - + if (canBerserk) { messages.add(getStatMessage(SubSkillType.UNARMED_BERSERK, berserkLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", berserkLengthEndurance) : "")); //messages.add(LocaleLoader.getString("Unarmed.Ability.Berserk.Length", berserkLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", berserkLengthEndurance) : "")); } - + if (canDisarm) { messages.add(getStatMessage(SubSkillType.UNARMED_DISARM, disarmChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", disarmChanceLucky) : "")); //messages.add(LocaleLoader.getString("Unarmed.Ability.Chance.Disarm", disarmChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", disarmChanceLucky) : "")); } - + if (canIronArm) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Unarmed.Ability.Bonus.0"), LocaleLoader.getString("Unarmed.Ability.Bonus.1", ironArmBonus))); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java index 0d55831f7..c5c31d93a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.util.skills.RankUtils; @@ -36,7 +36,7 @@ public class WoodcuttingCommand extends SkillCommand { if (canDoubleDrop) { setDoubleDropClassicChanceStrings(player); } - + // TREE FELLER if (canTreeFell) { String[] treeFellerStrings = calculateLengthDisplayValues(player, skillValue); @@ -46,7 +46,8 @@ public class WoodcuttingCommand extends SkillCommand { } private void setDoubleDropClassicChanceStrings(Player player) { - String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.WOODCUTTING_HARVEST_LUMBER);; + String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.WOODCUTTING_HARVEST_LUMBER); + ; doubleDropChance = doubleDropStrings[0]; doubleDropChanceLucky = doubleDropStrings[1]; } @@ -69,7 +70,7 @@ public class WoodcuttingCommand extends SkillCommand { messages.add(getStatMessage(SubSkillType.WOODCUTTING_HARVEST_LUMBER, doubleDropChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : "")); } - + if (canLeafBlow) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Woodcutting.Ability.0"), LocaleLoader.getString("Woodcutting.Ability.1"))); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/chat/McMMOChatEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/chat/McMMOChatEvent.java index 9c4f3ae68..ce13caf12 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/chat/McMMOChatEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/chat/McMMOChatEvent.java @@ -6,6 +6,10 @@ import org.bukkit.event.HandlerList; import org.bukkit.plugin.Plugin; public abstract class McMMOChatEvent extends Event implements Cancellable { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); private boolean cancelled; private Plugin plugin; private String sender; @@ -27,6 +31,10 @@ public abstract class McMMOChatEvent extends Event implements Cancellable { this.message = message; } + public static HandlerList getHandlerList() { + return handlers; + } + /** * @return The plugin responsible for this event, note this can be null */ @@ -48,13 +56,6 @@ public abstract class McMMOChatEvent extends Event implements Cancellable { return displayName; } - /** - * @return String message that will be sent - */ - public String getMessage() { - return message; - } - /** * @param displayName String display name of the player who sent the chat */ @@ -62,6 +63,13 @@ public abstract class McMMOChatEvent extends Event implements Cancellable { this.displayName = displayName; } + /** + * @return String message that will be sent + */ + public String getMessage() { + return message; + } + /** * @param message String message to be sent in chat */ @@ -69,7 +77,9 @@ public abstract class McMMOChatEvent extends Event implements Cancellable { this.message = message; } - /** Following are required for Cancellable **/ + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; @@ -80,15 +90,8 @@ public abstract class McMMOChatEvent extends Event implements Cancellable { this.cancelled = cancelled; } - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java index 855d4eadc..a19cc810d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.events.experience; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; @@ -12,10 +12,11 @@ import org.bukkit.event.player.PlayerEvent; * Generic event for mcMMO experience events. */ public abstract class McMMOPlayerExperienceEvent extends PlayerEvent implements Cancellable { - private boolean cancelled; + private static final HandlerList handlers = new HandlerList(); protected PrimarySkillType skill; protected int skillLevel; protected XPGainReason xpGainReason; + private boolean cancelled; @Deprecated protected McMMOPlayerExperienceEvent(Player player, PrimarySkillType skill) { @@ -32,6 +33,10 @@ public abstract class McMMOPlayerExperienceEvent extends PlayerEvent implements this.xpGainReason = xpGainReason; } + public static HandlerList getHandlerList() { + return handlers; + } + /** * @return The skill involved in this event */ @@ -53,7 +58,9 @@ public abstract class McMMOPlayerExperienceEvent extends PlayerEvent implements return xpGainReason; } - /** Following are required for Cancellable **/ + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; @@ -63,15 +70,9 @@ public abstract class McMMOPlayerExperienceEvent extends PlayerEvent implements public void setCancelled(boolean cancelled) { this.cancelled = cancelled; } - - private static final HandlerList handlers = new HandlerList(); @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelDownEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelDownEvent.java index 515d53314..183cced08 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelDownEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelDownEvent.java @@ -9,6 +9,7 @@ import org.bukkit.event.HandlerList; * Called when a user loses levels in a skill */ public class McMMOPlayerLevelDownEvent extends McMMOPlayerLevelChangeEvent { + private static final HandlerList handlers = new HandlerList(); private int levelsLost; @Deprecated @@ -33,11 +34,8 @@ public class McMMOPlayerLevelDownEvent extends McMMOPlayerLevelChangeEvent { this.levelsLost = levelsLost; } - /** - * @param levelsLost Set the number of levels lost in this event - */ - public void setLevelsLost(int levelsLost) { - this.levelsLost = levelsLost; + public static HandlerList getHandlerList() { + return handlers; } /** @@ -47,14 +45,15 @@ public class McMMOPlayerLevelDownEvent extends McMMOPlayerLevelChangeEvent { return levelsLost; } - private static final HandlerList handlers = new HandlerList(); + /** + * @param levelsLost Set the number of levels lost in this event + */ + public void setLevelsLost(int levelsLost) { + this.levelsLost = levelsLost; + } @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java index dc3cf393a..1dd843d7e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java @@ -9,6 +9,7 @@ import org.bukkit.event.HandlerList; * Called when a user levels up in a skill */ public class McMMOPlayerLevelUpEvent extends McMMOPlayerLevelChangeEvent { + private static final HandlerList handlers = new HandlerList(); private int levelsGained; @Deprecated @@ -33,11 +34,8 @@ public class McMMOPlayerLevelUpEvent extends McMMOPlayerLevelChangeEvent { this.levelsGained = levelsGained; } - /** - * @param levelsGained Set the number of levels gained in this event - */ - public void setLevelsGained(int levelsGained) { - this.levelsGained = levelsGained; + public static HandlerList getHandlerList() { + return handlers; } /** @@ -47,14 +45,15 @@ public class McMMOPlayerLevelUpEvent extends McMMOPlayerLevelChangeEvent { return levelsGained; } - private static final HandlerList handlers = new HandlerList(); + /** + * @param levelsGained Set the number of levels gained in this event + */ + public void setLevelsGained(int levelsGained) { + this.levelsGained = levelsGained; + } @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerXpGainEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerXpGainEvent.java index 2116c7948..c3290569d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerXpGainEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerXpGainEvent.java @@ -9,6 +9,7 @@ import org.bukkit.event.HandlerList; * Called when a player gains XP in a skill */ public class McMMOPlayerXpGainEvent extends McMMOPlayerExperienceEvent { + private static final HandlerList handlers = new HandlerList(); private float xpGained; @Deprecated @@ -22,6 +23,10 @@ public class McMMOPlayerXpGainEvent extends McMMOPlayerExperienceEvent { this.xpGained = xpGained; } + public static HandlerList getHandlerList() { + return handlers; + } + /** * @return The amount of experience gained in this event */ @@ -29,6 +34,13 @@ public class McMMOPlayerXpGainEvent extends McMMOPlayerExperienceEvent { return xpGained; } + /** + * @param xpGained int amount of experience gained in this event + */ + public void setRawXpGained(float xpGained) { + this.xpGained = xpGained; + } + /** * @return int amount of experience gained in this event */ @@ -37,13 +49,6 @@ public class McMMOPlayerXpGainEvent extends McMMOPlayerExperienceEvent { return (int) xpGained; } - /** - * @param xpGained int amount of experience gained in this event - */ - public void setRawXpGained(float xpGained) { - this.xpGained = xpGained; - } - /** * @param xpGained int amount of experience gained in this event */ @@ -52,14 +57,8 @@ public class McMMOPlayerXpGainEvent extends McMMOPlayerExperienceEvent { this.xpGained = xpGained; } - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerDeathPenaltyEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerDeathPenaltyEvent.java index bf723375a..a6035351c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerDeathPenaltyEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerDeathPenaltyEvent.java @@ -8,9 +8,12 @@ import org.bukkit.event.player.PlayerEvent; import java.util.HashMap; public class McMMOPlayerDeathPenaltyEvent extends PlayerEvent implements Cancellable { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); private HashMap levelChanged; private HashMap experienceChanged; - private boolean cancelled; public McMMOPlayerDeathPenaltyEvent(Player player, HashMap levelChanged, HashMap experienceChanged) { @@ -26,6 +29,10 @@ public class McMMOPlayerDeathPenaltyEvent extends PlayerEvent implements Cancell this.cancelled = false; } + public static HandlerList getHandlerList() { + return handlers; + } + public HashMap getLevelChanged() { return levelChanged; } @@ -42,7 +49,9 @@ public class McMMOPlayerDeathPenaltyEvent extends PlayerEvent implements Cancell this.experienceChanged = experienceChanged; } - /** Following are required for Cancellable **/ + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; @@ -53,15 +62,8 @@ public class McMMOPlayerDeathPenaltyEvent extends PlayerEvent implements Cancell this.cancelled = cancelled; } - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerPreDeathPenaltyEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerPreDeathPenaltyEvent.java index b831f0426..7e8b8fb22 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerPreDeathPenaltyEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerPreDeathPenaltyEvent.java @@ -6,6 +6,10 @@ import org.bukkit.event.HandlerList; import org.bukkit.event.player.PlayerEvent; public class McMMOPlayerPreDeathPenaltyEvent extends PlayerEvent implements Cancellable { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); private boolean cancelled; public McMMOPlayerPreDeathPenaltyEvent(Player player) { @@ -13,7 +17,13 @@ public class McMMOPlayerPreDeathPenaltyEvent extends PlayerEvent implements Canc this.cancelled = false; } - /** Following are required for Cancellable **/ + public static HandlerList getHandlerList() { + return handlers; + } + + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; @@ -24,15 +34,8 @@ public class McMMOPlayerPreDeathPenaltyEvent extends PlayerEvent implements Canc this.cancelled = cancelled; } - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/items/McMMOItemSpawnEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/items/McMMOItemSpawnEvent.java index b6d7dcb94..5756fe5fe 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/items/McMMOItemSpawnEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/items/McMMOItemSpawnEvent.java @@ -10,6 +10,10 @@ import org.bukkit.inventory.ItemStack; * Called when mcMMO is preparing to drop an item. */ public class McMMOItemSpawnEvent extends Event implements Cancellable { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); private Location location; private ItemStack itemStack; private boolean cancelled; @@ -20,6 +24,10 @@ public class McMMOItemSpawnEvent extends Event implements Cancellable { this.cancelled = false; } + public static HandlerList getHandlerList() { + return handlers; + } + /** * @return Location where the item will be dropped */ @@ -48,7 +56,9 @@ public class McMMOItemSpawnEvent extends Event implements Cancellable { this.itemStack = itemStack; } - /** Following are required for Cancellable **/ + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; @@ -59,15 +69,8 @@ public class McMMOItemSpawnEvent extends Event implements Cancellable { this.cancelled = cancelled; } - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyAllianceChangeEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyAllianceChangeEvent.java index 1e126e501..4a57ca955 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyAllianceChangeEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyAllianceChangeEvent.java @@ -6,6 +6,10 @@ import org.bukkit.event.HandlerList; import org.bukkit.event.player.PlayerEvent; public class McMMOPartyAllianceChangeEvent extends PlayerEvent implements Cancellable { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); private String oldAlly; private String newAlly; private EventReason reason; @@ -24,6 +28,10 @@ public class McMMOPartyAllianceChangeEvent extends PlayerEvent implements Cancel this.cancelled = false; } + public static HandlerList getHandlerList() { + return handlers; + } + /** * @return The party being left, or null if the player was not in a party */ @@ -45,6 +53,24 @@ public class McMMOPartyAllianceChangeEvent extends PlayerEvent implements Cancel return reason; } + /** + * Following are required for Cancellable + **/ + @Override + public boolean isCancelled() { + return cancelled; + } + + @Override + public void setCancelled(boolean cancelled) { + this.cancelled = cancelled; + } + + @Override + public HandlerList getHandlers() { + return handlers; + } + /** * A list of reasons why the event may have been fired */ @@ -64,27 +90,4 @@ public class McMMOPartyAllianceChangeEvent extends PlayerEvent implements Cancel */ CUSTOM; } - - /** Following are required for Cancellable **/ - @Override - public boolean isCancelled() { - return cancelled; - } - - @Override - public void setCancelled(boolean cancelled) { - this.cancelled = cancelled; - } - - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - - @Override - public HandlerList getHandlers() { - return handlers; - } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyChangeEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyChangeEvent.java index f2d3f537e..00fea8f2c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyChangeEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyChangeEvent.java @@ -9,6 +9,10 @@ import org.bukkit.event.player.PlayerEvent; * Called when a player attempts to join, leave, or change parties. */ public class McMMOPartyChangeEvent extends PlayerEvent implements Cancellable { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); private String oldParty; private String newParty; private EventReason reason; @@ -27,6 +31,10 @@ public class McMMOPartyChangeEvent extends PlayerEvent implements Cancellable { this.cancelled = false; } + public static HandlerList getHandlerList() { + return handlers; + } + /** * @return The party being left, or null if the player was not in a party */ @@ -48,6 +56,24 @@ public class McMMOPartyChangeEvent extends PlayerEvent implements Cancellable { return reason; } + /** + * Following are required for Cancellable + **/ + @Override + public boolean isCancelled() { + return cancelled; + } + + @Override + public void setCancelled(boolean cancelled) { + this.cancelled = cancelled; + } + + @Override + public HandlerList getHandlers() { + return handlers; + } + /** * A list of reasons why the event may have been fired */ @@ -77,27 +103,4 @@ public class McMMOPartyChangeEvent extends PlayerEvent implements Cancellable { */ CUSTOM; } - - /** Following are required for Cancellable **/ - @Override - public boolean isCancelled() { - return cancelled; - } - - @Override - public void setCancelled(boolean cancelled) { - this.cancelled = cancelled; - } - - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - - @Override - public HandlerList getHandlers() { - return handlers; - } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyLevelUpEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyLevelUpEvent.java index 521a10d5e..78ade045c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyLevelUpEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyLevelUpEvent.java @@ -6,6 +6,10 @@ import org.bukkit.event.Event; import org.bukkit.event.HandlerList; public class McMMOPartyLevelUpEvent extends Event implements Cancellable { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); private Party party; private int levelsChanged; private boolean cancelled; @@ -16,6 +20,10 @@ public class McMMOPartyLevelUpEvent extends Event implements Cancellable { this.cancelled = false; } + public static HandlerList getHandlerList() { + return handlers; + } + public Party getParty() { return party; } @@ -28,7 +36,9 @@ public class McMMOPartyLevelUpEvent extends Event implements Cancellable { this.levelsChanged = levelsChanged; } - /** Following are required for Cancellable **/ + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; @@ -39,15 +49,8 @@ public class McMMOPartyLevelUpEvent extends Event implements Cancellable { this.cancelled = cancelled; } - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyTeleportEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyTeleportEvent.java index 9bc1fe1ee..7139e3264 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyTeleportEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyTeleportEvent.java @@ -8,6 +8,10 @@ import org.bukkit.event.player.PlayerTeleportEvent; * Called just before a player teleports using the /ptp command. */ public class McMMOPartyTeleportEvent extends PlayerTeleportEvent { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); private String party; private Player target; @@ -17,6 +21,10 @@ public class McMMOPartyTeleportEvent extends PlayerTeleportEvent { this.target = target; } + public static HandlerList getHandlerList() { + return handlers; + } + /** * @return The party the teleporting player is in */ @@ -31,15 +39,8 @@ public class McMMOPartyTeleportEvent extends PlayerTeleportEvent { return target; } - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyXpGainEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyXpGainEvent.java index 91f76c6c0..2854ac512 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyXpGainEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyXpGainEvent.java @@ -6,6 +6,10 @@ import org.bukkit.event.Event; import org.bukkit.event.HandlerList; public class McMMOPartyXpGainEvent extends Event implements Cancellable { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); private Party party; private float xpGained; private boolean cancelled; @@ -16,6 +20,10 @@ public class McMMOPartyXpGainEvent extends Event implements Cancellable { this.cancelled = false; } + public static HandlerList getHandlerList() { + return handlers; + } + public Party getParty() { return party; } @@ -27,6 +35,13 @@ public class McMMOPartyXpGainEvent extends Event implements Cancellable { return xpGained; } + /** + * @param xpGained set amount of experience gained in this event + */ + public void setRawXpGained(float xpGained) { + this.xpGained = xpGained; + } + /** * @return int amount of experience gained in this event */ @@ -35,13 +50,6 @@ public class McMMOPartyXpGainEvent extends Event implements Cancellable { return (int) xpGained; } - /** - * @param xpGained set amount of experience gained in this event - */ - public void setRawXpGained(float xpGained) { - this.xpGained = xpGained; - } - /** * @param xpGained set int amount of experience gained in this event */ @@ -50,7 +58,9 @@ public class McMMOPartyXpGainEvent extends Event implements Cancellable { this.xpGained = xpGained; } - /** Following are required for Cancellable **/ + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; @@ -61,15 +71,8 @@ public class McMMOPartyXpGainEvent extends Event implements Cancellable { this.cancelled = cancelled; } - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardEvent.java index 44a22538b..b7b608716 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardEvent.java @@ -11,24 +11,31 @@ import org.bukkit.scoreboard.Scoreboard; */ abstract public class McMMOScoreboardEvent extends Event { - protected Scoreboard targetBoard; //Scoreboard involved in this event + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); final Scoreboard currentBoard; //Can be null + private final ScoreboardEventReason scoreboardEventReason; + protected Scoreboard targetBoard; //Scoreboard involved in this event protected Player targetPlayer; - private final ScoreboardEventReason scoreboardEventReason; + /** GETTER & SETTER BOILERPLATE **/ - public McMMOScoreboardEvent(Scoreboard targetBoard, Scoreboard currentBoard, Player targetPlayer, ScoreboardEventReason scoreboardEventReason) - { + public McMMOScoreboardEvent(Scoreboard targetBoard, Scoreboard currentBoard, Player targetPlayer, ScoreboardEventReason scoreboardEventReason) { this.scoreboardEventReason = scoreboardEventReason; this.targetBoard = targetBoard; this.currentBoard = currentBoard; this.targetPlayer = targetPlayer; } - /** GETTER & SETTER BOILERPLATE **/ + public static HandlerList getHandlerList() { + return handlers; + } /** * This is the scoreboard the player will be assigned to after this event + * * @return the target board to assign the player after this event fires */ public Scoreboard getTargetBoard() { @@ -37,6 +44,7 @@ abstract public class McMMOScoreboardEvent extends Event { /** * Change the scoreboard that the player will be assigned to after this event fires + * * @param targetBoard the new board to assign the player to */ public void setTargetBoard(Scoreboard targetBoard) { @@ -45,15 +53,26 @@ abstract public class McMMOScoreboardEvent extends Event { /** * The player involved in this event (this can be changed) + * * @return the player involved in this event */ public Player getTargetPlayer() { return targetPlayer; } + /** + * Change the target player for this event + * + * @param targetPlayer the new target for this event + */ + public void setTargetPlayer(Player targetPlayer) { + this.targetPlayer = targetPlayer; + } + /** * This is the scoreboard the player is currently assigned to at the time the event was fired * Grabbed via player.getScoreboard() + * * @return players current scoreboard */ public Scoreboard getCurrentBoard() { @@ -62,29 +81,15 @@ abstract public class McMMOScoreboardEvent extends Event { /** * The ENUM defining the reason for this event + * * @return the reason for this event */ public ScoreboardEventReason getScoreboardEventReason() { return scoreboardEventReason; } - /** - * Change the target player for this event - * @param targetPlayer the new target for this event - */ - public void setTargetPlayer(Player targetPlayer) { - this.targetPlayer = targetPlayer; - } - - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardObjectiveEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardObjectiveEvent.java index 2f883f19e..41ffb01a2 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardObjectiveEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardObjectiveEvent.java @@ -6,10 +6,9 @@ import org.bukkit.scoreboard.Objective; import org.bukkit.scoreboard.Scoreboard; public class McMMOScoreboardObjectiveEvent extends McMMOScoreboardEvent implements Cancellable { - protected boolean cancelled; - - protected Objective targetObjective; protected final ScoreboardObjectiveEventReason objectiveEventReason; + protected boolean cancelled; + protected Objective targetObjective; public McMMOScoreboardObjectiveEvent(Objective targetObjective, ScoreboardObjectiveEventReason objectiveEventReason, Scoreboard scoreboard, Scoreboard oldboard, Player targetPlayer, ScoreboardEventReason scoreboardEventReason) { super(scoreboard, oldboard, targetPlayer, scoreboardEventReason); @@ -20,6 +19,7 @@ public class McMMOScoreboardObjectiveEvent extends McMMOScoreboardEvent implemen /** * The objective that will be modified by this event + * * @return */ public Objective getTargetObjective() { @@ -28,6 +28,7 @@ public class McMMOScoreboardObjectiveEvent extends McMMOScoreboardEvent implemen /** * Change the target objective for this event + * * @param newObjective new target objective */ public void setTargetObjective(Objective newObjective) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java index cc71c4f54..046eb65d8 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java @@ -12,6 +12,10 @@ import org.bukkit.event.player.PlayerEvent; * This event is sent for when mcMMO informs a player about various important information */ public class McMMOPlayerNotificationEvent extends PlayerEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + protected final NotificationType notificationType; + protected ChatMessageType chatMessageType; + protected TextComponent notificationTextComponent; private boolean isCancelled; /* * Messages can be sent to both places, as configured in advanced.yml @@ -20,12 +24,6 @@ public class McMMOPlayerNotificationEvent extends PlayerEvent implements Cancell */ private boolean isMessageAlsoBeingSentToChat; - private static final HandlerList handlers = new HandlerList(); - protected ChatMessageType chatMessageType; - - protected TextComponent notificationTextComponent; - protected final NotificationType notificationType; - public McMMOPlayerNotificationEvent(Player who, NotificationType notificationType, TextComponent notificationTextComponent, ChatMessageType chatMessageType, boolean isMessageAlsoBeingSentToChat) { super(who); this.notificationType = notificationType; @@ -39,6 +37,10 @@ public class McMMOPlayerNotificationEvent extends PlayerEvent implements Cancell * Getters & Setters */ + public static HandlerList getHandlerList() { + return handlers; + } + public boolean isMessageAlsoBeingSentToChat() { return isMessageAlsoBeingSentToChat; } @@ -63,27 +65,24 @@ public class McMMOPlayerNotificationEvent extends PlayerEvent implements Cancell this.chatMessageType = chatMessageType; } + /* + * Custom Event Boilerplate + */ + /** * The notification type for this event + * * @return this event's notification type */ public NotificationType getEventNotificationType() { return notificationType; } - /* - * Custom Event Boilerplate - */ - @Override public HandlerList getHandlers() { return handlers; } - public static HandlerList getHandlerList() { - return handlers; - } - /* * Cancellable Interface Boilerplate */ diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java index 96f1ceb4e..0bcafac90 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.events.skills; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.skills.PrimarySkillType; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; import org.bukkit.event.player.PlayerEvent; @@ -10,6 +10,10 @@ import org.bukkit.event.player.PlayerEvent; * Generic event for mcMMO skill handling. */ public abstract class McMMOPlayerSkillEvent extends PlayerEvent { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); protected PrimarySkillType skill; protected int skillLevel; @@ -19,6 +23,10 @@ public abstract class McMMOPlayerSkillEvent extends PlayerEvent { this.skillLevel = UserManager.getPlayer(player).getSkillLevel(skill); } + public static HandlerList getHandlerList() { + return handlers; + } + /** * @return The skill involved in this event */ @@ -33,15 +41,8 @@ public abstract class McMMOPlayerSkillEvent extends PlayerEvent { return skillLevel; } - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/repair/McMMOPlayerRepairCheckEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/repair/McMMOPlayerRepairCheckEvent.java index 9cd0733a7..1ce52a60c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/repair/McMMOPlayerRepairCheckEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/repair/McMMOPlayerRepairCheckEvent.java @@ -44,7 +44,9 @@ public class McMMOPlayerRepairCheckEvent extends McMMOPlayerSkillEvent implement return repairedObject; } - /** Following are required for Cancellable **/ + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java index a1a6567e9..7a379de9d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java @@ -44,7 +44,9 @@ public class McMMOPlayerSalvageCheckEvent extends McMMOPlayerSkillEvent implemen return enchantedBook; } - /** Following are required for Cancellable **/ + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java index 3454c9826..3cbb74d4b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java @@ -13,7 +13,8 @@ public class SubSkillEvent extends McMMOPlayerSkillEvent implements Cancellable /** * Only skills using the old system will fire this event - * @param player target player + * + * @param player target player * @param subSkillType target subskill * @Deprecated Skills will be using a new system stemming from the AbstractSubSkill class so make sure you check for both events, this event will be removed eventually. */ @@ -23,13 +24,13 @@ public class SubSkillEvent extends McMMOPlayerSkillEvent implements Cancellable this.subSkillType = subSkillType; } - public SubSkillEvent(Player player, AbstractSubSkill abstractSubSkill) - { + public SubSkillEvent(Player player, AbstractSubSkill abstractSubSkill) { super(player, abstractSubSkill.getPrimarySkill()); } /** * Gets the SubSkillType involved in the event + * * @return the SubSkillType */ public SubSkillType getSubSkillType() { diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java index 00073617f..2815cbfa4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java @@ -12,8 +12,7 @@ public class SubSkillRandomCheckEvent extends SubSkillEvent { this.chance = chance; } - public SubSkillRandomCheckEvent(Player player, AbstractSubSkill abstractSubSkill, double chance) - { + public SubSkillRandomCheckEvent(Player player, AbstractSubSkill abstractSubSkill, double chance) { super(player, abstractSubSkill); this.chance = chance; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/unarmed/McMMOPlayerDisarmEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/unarmed/McMMOPlayerDisarmEvent.java index c363f2c78..e401c1382 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/unarmed/McMMOPlayerDisarmEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/unarmed/McMMOPlayerDisarmEvent.java @@ -18,7 +18,9 @@ public class McMMOPlayerDisarmEvent extends McMMOPlayerSkillEvent implements Can return defender; } - /** Following are required for Cancellable **/ + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index 7ff911060..e5205b7d7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -1,34 +1,34 @@ package com.gmail.nossr50.listeners; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.skills.HiddenConfig; import com.gmail.nossr50.core.config.skills.WorldBlacklist; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.core.skills.ToolType; -import com.gmail.nossr50.events.fake.FakeBlockBreakEvent; -import com.gmail.nossr50.events.fake.FakeBlockDamageEvent; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.core.skills.child.salvage.Salvage; import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy; import com.gmail.nossr50.core.skills.primary.excavation.ExcavationManager; import com.gmail.nossr50.core.skills.primary.herbalism.Herbalism; import com.gmail.nossr50.core.skills.primary.herbalism.HerbalismManager; import com.gmail.nossr50.core.skills.primary.mining.MiningManager; import com.gmail.nossr50.core.skills.primary.repair.Repair; -import com.gmail.nossr50.core.skills.child.salvage.Salvage; import com.gmail.nossr50.core.skills.primary.woodcutting.WoodcuttingManager; import com.gmail.nossr50.core.util.BlockUtils; import com.gmail.nossr50.core.util.EventUtils; import com.gmail.nossr50.core.util.ItemUtils; import com.gmail.nossr50.core.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.SkillUtils; import com.gmail.nossr50.core.util.sounds.SoundManager; import com.gmail.nossr50.core.util.sounds.SoundType; import com.gmail.nossr50.core.worldguard.WorldGuardManager; import com.gmail.nossr50.core.worldguard.WorldGuardUtils; +import com.gmail.nossr50.events.fake.FakeBlockBreakEvent; +import com.gmail.nossr50.events.fake.FakeBlockDamageEvent; +import com.gmail.nossr50.mcMMO; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; @@ -62,7 +62,7 @@ public class BlockListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onBlockPistonExtend(BlockPistonExtendEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; BlockFace direction = event.getDirection(); @@ -85,7 +85,7 @@ public class BlockListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onBlockPistonRetract(BlockPistonRetractEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; // Get opposite direction so we get correct block @@ -105,14 +105,12 @@ public class BlockListener implements Listener { * @param event The event to watch */ @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) - public void onEntityBlockFormEvent(EntityBlockFormEvent event) - { + public void onEntityBlockFormEvent(EntityBlockFormEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; - if(BlockUtils.shouldBeWatched(event.getBlock().getState())) - { + if (BlockUtils.shouldBeWatched(event.getBlock().getState())) { mcMMO.getPlaceStore().setTrue(event.getBlock()); } } @@ -125,14 +123,14 @@ public class BlockListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onFallingBlock(EntityChangeBlockEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; if (BlockUtils.shouldBeWatched(event.getBlock().getState()) && event.getEntityType().equals(EntityType.FALLING_BLOCK)) { if (event.getTo().equals(Material.AIR) && mcMMO.getPlaceStore().isTrue(event.getBlock())) { - event.getEntity().setMetadata("mcMMOBlockFall", new FixedMetadataValue( plugin, event.getBlock().getLocation())); + event.getEntity().setMetadata("mcMMOBlockFall", new FixedMetadataValue(plugin, event.getBlock().getLocation())); } else { - List values = event.getEntity().getMetadata( "mcMMOBlockFall" ); + List values = event.getEntity().getMetadata("mcMMOBlockFall"); if (!values.isEmpty()) { @@ -140,8 +138,8 @@ public class BlockListener implements Listener { Block spawn = ((org.bukkit.Location) values.get(0).value()).getBlock(); - mcMMO.getPlaceStore().setTrue( event.getBlock() ); - mcMMO.getPlaceStore().setFalse( spawn ); + mcMMO.getPlaceStore().setTrue(event.getBlock()); + mcMMO.getPlaceStore().setFalse(spawn); } } @@ -156,7 +154,7 @@ public class BlockListener implements Listener { @EventHandler(priority = EventPriority.MONITOR) public void onBlockPlace(BlockPlaceEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; Player player = event.getPlayer(); @@ -178,8 +176,7 @@ public class BlockListener implements Listener { if (blockState.getType() == Repair.anvilMaterial && PrimarySkillType.REPAIR.getPermissions(player)) { mcMMOPlayer.getRepairManager().placedAnvilCheck(); - } - else if (blockState.getType() == Salvage.anvilMaterial && PrimarySkillType.SALVAGE.getPermissions(player)) { + } else if (blockState.getType() == Salvage.anvilMaterial && PrimarySkillType.SALVAGE.getPermissions(player)) { mcMMOPlayer.getSalvageManager().placedAnvilCheck(); } } @@ -192,7 +189,7 @@ public class BlockListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onBlockMultiPlace(BlockMultiPlaceEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; Player player = event.getPlayer(); @@ -201,8 +198,7 @@ public class BlockListener implements Listener { return; } - for (BlockState replacedBlockState : event.getReplacedBlockStates()) - { + for (BlockState replacedBlockState : event.getReplacedBlockStates()) { BlockState blockState = replacedBlockState.getBlock().getState(); /* Check if the blocks placed should be monitored so they do not give out XP in the future */ @@ -213,10 +209,9 @@ public class BlockListener implements Listener { } @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) - public void onBlockGrow(BlockGrowEvent event) - { + public void onBlockGrow(BlockGrowEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; BlockState blockState = event.getBlock().getState(); @@ -236,13 +231,12 @@ public class BlockListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onBlockBreak(BlockBreakEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) return; } @@ -300,8 +294,7 @@ public class BlockListener implements Listener { WoodcuttingManager woodcuttingManager = mcMMOPlayer.getWoodcuttingManager(); if (woodcuttingManager.canUseTreeFeller(heldItem)) { woodcuttingManager.processTreeFeller(blockState); - } - else { + } else { woodcuttingManager.woodcuttingBlockCheck(blockState); } } @@ -328,13 +321,12 @@ public class BlockListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onBlockBreakHigher(BlockBreakEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) return; } @@ -363,8 +355,7 @@ public class BlockListener implements Listener { if (herbalismManager.processHylianLuck(blockState)) { blockState.update(true); event.setCancelled(true); - } - else if (blockState.getType() == Material.FLOWER_POT) { + } else if (blockState.getType() == Material.FLOWER_POT) { blockState.setType(Material.AIR); blockState.update(true); event.setCancelled(true); @@ -394,13 +385,12 @@ public class BlockListener implements Listener { BlockState blockState = event.getBlock().getState(); /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) return; } @@ -423,17 +413,13 @@ public class BlockListener implements Listener { if (mcMMOPlayer.getToolPreparationMode(ToolType.HOE) && ItemUtils.isHoe(heldItem) && (BlockUtils.affectedByGreenTerra(blockState) || BlockUtils.canMakeMossy(blockState)) && Permissions.greenTerra(player)) { mcMMOPlayer.checkAbilityActivation(PrimarySkillType.HERBALISM); - } - else if (mcMMOPlayer.getToolPreparationMode(ToolType.AXE) && ItemUtils.isAxe(heldItem) && BlockUtils.isLog(blockState) && Permissions.treeFeller(player)) { + } else if (mcMMOPlayer.getToolPreparationMode(ToolType.AXE) && ItemUtils.isAxe(heldItem) && BlockUtils.isLog(blockState) && Permissions.treeFeller(player)) { mcMMOPlayer.checkAbilityActivation(PrimarySkillType.WOODCUTTING); - } - else if (mcMMOPlayer.getToolPreparationMode(ToolType.PICKAXE) && ItemUtils.isPickaxe(heldItem) && BlockUtils.affectedBySuperBreaker(blockState) && Permissions.superBreaker(player)) { + } else if (mcMMOPlayer.getToolPreparationMode(ToolType.PICKAXE) && ItemUtils.isPickaxe(heldItem) && BlockUtils.affectedBySuperBreaker(blockState) && Permissions.superBreaker(player)) { mcMMOPlayer.checkAbilityActivation(PrimarySkillType.MINING); - } - else if (mcMMOPlayer.getToolPreparationMode(ToolType.SHOVEL) && ItemUtils.isShovel(heldItem) && BlockUtils.affectedByGigaDrillBreaker(blockState) && Permissions.gigaDrillBreaker(player)) { + } else if (mcMMOPlayer.getToolPreparationMode(ToolType.SHOVEL) && ItemUtils.isShovel(heldItem) && BlockUtils.affectedByGigaDrillBreaker(blockState) && Permissions.gigaDrillBreaker(player)) { mcMMOPlayer.checkAbilityActivation(PrimarySkillType.EXCAVATION); - } - else if (mcMMOPlayer.getToolPreparationMode(ToolType.FISTS) && heldItem.getType() == Material.AIR && (BlockUtils.affectedByGigaDrillBreaker(blockState) || blockState.getType() == Material.SNOW || BlockUtils.affectedByBlockCracker(blockState) && Permissions.berserk(player))) { + } else if (mcMMOPlayer.getToolPreparationMode(ToolType.FISTS) && heldItem.getType() == Material.AIR && (BlockUtils.affectedByGigaDrillBreaker(blockState) || blockState.getType() == Material.SNOW || BlockUtils.affectedByBlockCracker(blockState) && Permissions.berserk(player))) { mcMMOPlayer.checkAbilityActivation(PrimarySkillType.UNARMED); } } @@ -466,13 +452,12 @@ public class BlockListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onBlockDamageHigher(BlockDamageEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) return; } @@ -500,19 +485,16 @@ public class BlockListener implements Listener { if (mcMMOPlayer.getHerbalismManager().processGreenTerra(blockState)) { blockState.update(true); } - } - else if (mcMMOPlayer.getAbilityMode(SuperAbilityType.BERSERK) && heldItem.getType() == Material.AIR) { + } else if (mcMMOPlayer.getAbilityMode(SuperAbilityType.BERSERK) && heldItem.getType() == Material.AIR) { if (SuperAbilityType.BERSERK.blockCheck(block.getState()) && EventUtils.simulateBlockBreak(block, player, true)) { event.setInstaBreak(true); SoundManager.sendSound(player, block.getLocation(), SoundType.POP); - } - else if (mcMMOPlayer.getUnarmedManager().canUseBlockCracker() && BlockUtils.affectedByBlockCracker(blockState) && EventUtils.simulateBlockBreak(block, player, true)) { + } else if (mcMMOPlayer.getUnarmedManager().canUseBlockCracker() && BlockUtils.affectedByBlockCracker(blockState) && EventUtils.simulateBlockBreak(block, player, true)) { if (mcMMOPlayer.getUnarmedManager().blockCrackerCheck(blockState)) { blockState.update(); } } - } - else if (mcMMOPlayer.getWoodcuttingManager().canUseLeafBlower(heldItem) && BlockUtils.isLeaves(blockState) && EventUtils.simulateBlockBreak(block, player, true)) { + } else if (mcMMOPlayer.getWoodcuttingManager().canUseLeafBlower(heldItem) && BlockUtils.isLeaves(blockState) && EventUtils.simulateBlockBreak(block, player, true)) { event.setInstaBreak(true); SoundManager.sendSound(player, block.getLocation(), SoundType.POP); } @@ -532,46 +514,39 @@ public class BlockListener implements Listener { } public void debugStickDump(Player player, BlockState blockState) { - if(player.getInventory().getItemInMainHand().getType() == Material.DEBUG_STICK) - { - if(mcMMO.getPlaceStore().isTrue(blockState)) + if (player.getInventory().getItemInMainHand().getType() == Material.DEBUG_STICK) { + if (mcMMO.getPlaceStore().isTrue(blockState)) player.sendMessage("[mcMMO DEBUG] This block is not natural and does not reward treasures/XP"); - else - { + else { player.sendMessage("[mcMMO DEBUG] This block is considered natural by mcMMO"); UserManager.getPlayer(player).getExcavationManager().printExcavationDebug(player, blockState); } - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (WorldGuardManager.getInstance().hasMainFlag(player)) player.sendMessage("[mcMMO DEBUG] World Guard main flag is permitted for this player in this region"); else player.sendMessage("[mcMMO DEBUG] World Guard main flag is DENIED for this player in this region"); - if(WorldGuardManager.getInstance().hasXPFlag(player)) + if (WorldGuardManager.getInstance().hasXPFlag(player)) player.sendMessage("[mcMMO DEBUG] World Guard xp flag is permitted for this player in this region"); else player.sendMessage("[mcMMO DEBUG] World Guard xp flag is not permitted for this player in this region"); } - if(blockState instanceof Furnace) - { + if (blockState instanceof Furnace) { Furnace furnace = (Furnace) blockState; - if(furnace.hasMetadata(mcMMO.furnaceMetadataKey)) - { + if (furnace.hasMetadata(mcMMO.furnaceMetadataKey)) { player.sendMessage("[mcMMO DEBUG] This furnace has a registered owner"); Player furnacePlayer = getPlayerFromFurnace(furnace.getBlock()); - if(furnacePlayer != null) - { - player.sendMessage("[mcMMO DEBUG] This furnace is owned by player "+furnacePlayer.getName()); + if (furnacePlayer != null) { + player.sendMessage("[mcMMO DEBUG] This furnace is owned by player " + furnacePlayer.getName()); } - } - else + } else player.sendMessage("[mcMMO DEBUG] This furnace does not have a registered owner"); } - if(ExperienceConfig.getInstance().isExperienceBarsEnabled()) + if (ExperienceConfig.getInstance().isExperienceBarsEnabled()) player.sendMessage("[mcMMO DEBUG] XP bars are enabled, however you should check per-skill settings to make sure those are enabled."); } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 5ee64bf7c..59742142c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -1,31 +1,31 @@ package com.gmail.nossr50.listeners; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.skills.WorldBlacklist; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.meta.OldName; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.skills.subskills.interfaces.InteractType; -import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent; -import com.gmail.nossr50.events.fake.FakeEntityDamageEvent; -import com.gmail.nossr50.events.fake.FakeEntityTameEvent; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.party.PartyManager; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.primary.archery.Archery; import com.gmail.nossr50.core.skills.primary.fishing.Fishing; import com.gmail.nossr50.core.skills.primary.mining.BlastMining; import com.gmail.nossr50.core.skills.primary.mining.MiningManager; import com.gmail.nossr50.core.skills.primary.taming.Taming; import com.gmail.nossr50.core.skills.primary.taming.TamingManager; +import com.gmail.nossr50.core.skills.subskills.interfaces.InteractType; import com.gmail.nossr50.core.util.BlockUtils; import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.core.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.CombatUtils; import com.gmail.nossr50.core.worldguard.WorldGuardManager; import com.gmail.nossr50.core.worldguard.WorldGuardUtils; +import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent; +import com.gmail.nossr50.events.fake.FakeEntityDamageEvent; +import com.gmail.nossr50.events.fake.FakeEntityTameEvent; +import com.gmail.nossr50.mcMMO; import org.bukkit.Material; import org.bukkit.OfflinePlayer; import org.bukkit.block.Block; @@ -55,15 +55,13 @@ public class EntityListener implements Listener { } @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) - public void onEntityTargetEntity(EntityTargetLivingEntityEvent event) - { - if(!ExperienceConfig.getInstance().isEndermanEndermiteFarmingPrevented()) + public void onEntityTargetEntity(EntityTargetLivingEntityEvent event) { + if (!ExperienceConfig.getInstance().isEndermanEndermiteFarmingPrevented()) return; //Prevent entities from giving XP if they target endermite - if(event.getTarget() instanceof Endermite) - { - if(event.getEntity().getMetadata(mcMMO.entityMetadataKey) == null || event.getEntity().getMetadata(mcMMO.entityMetadataKey).size() <= 0) + if (event.getTarget() instanceof Endermite) { + if (event.getEntity().getMetadata(mcMMO.entityMetadataKey) == null || event.getEntity().getMetadata(mcMMO.entityMetadataKey).size() <= 0) event.getEntity().setMetadata(mcMMO.entityMetadataKey, mcMMO.metadataValue); } } @@ -71,17 +69,15 @@ public class EntityListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onEntityShootBow(EntityShootBowEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; - if(event.getEntity() instanceof Player) - { + if (event.getEntity() instanceof Player) { Player player = (Player) event.getEntity(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } } @@ -105,17 +101,15 @@ public class EntityListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onProjectileLaunch(ProjectileLaunchEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; - if(event.getEntity() instanceof Player) - { + if (event.getEntity() instanceof Player) { Player player = (Player) event.getEntity(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } } @@ -133,13 +127,12 @@ public class EntityListener implements Listener { /** * Monitor EntityChangeBlock events. * - * @param event - * The event to watch + * @param event The event to watch */ @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onEntityChangeBlock(EntityChangeBlockEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; Block block = event.getBlock(); @@ -159,14 +152,12 @@ public class EntityListener implements Listener { if (mcMMO.getPlaceStore().isTrue(block) && !isTracked) { mcMMO.getPlaceStore().setFalse(block); entity.setMetadata(mcMMO.entityMetadataKey, mcMMO.metadataValue); - } - else if (isTracked) { + } else if (isTracked) { mcMMO.getPlaceStore().setTrue(block); } } else if ((block.getType() == Material.REDSTONE_ORE)) { return; - } - else { + } else { if (mcMMO.getPlaceStore().isTrue(block)) { mcMMO.getPlaceStore().setFalse(block); } @@ -176,13 +167,12 @@ public class EntityListener implements Listener { /** * Handle EntityDamageByEntity events that involve modifying the event. * - * @param event - * The event to watch + * @param event The event to watch */ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onEntityDamageByEntity(EntityDamageByEntityEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; if (event instanceof FakeEntityDamageByEntityEvent) { @@ -192,9 +182,8 @@ public class EntityListener implements Listener { if (event.getEntity() instanceof ArmorStand) { return; } - - if (event.getDamager().hasMetadata(mcMMO.funfettiMetadataKey)) - { + + if (event.getDamager().hasMetadata(mcMMO.funfettiMetadataKey)) { event.setCancelled(true); return; } @@ -203,14 +192,12 @@ public class EntityListener implements Listener { Entity defender = event.getEntity(); Entity attacker = event.getDamager(); - if(attacker instanceof Player) - { + if (attacker instanceof Player) { Player player = (Player) attacker; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } } @@ -221,7 +208,7 @@ public class EntityListener implements Listener { Player attackingPlayer = (Player) attacker; if (event.getDamage(DamageModifier.ABSORPTION) > 0) { //If friendly fire is off don't allow players to hurt one another - if(!Config.getInstance().getPartyFriendlyFire()) + if (!Config.getInstance().getPartyFriendlyFire()) if ((PartyManager.inSameParty(defendingPlayer, attackingPlayer) || PartyManager.areAllies(defendingPlayer, attackingPlayer)) && !(Permissions.friendlyFire(attackingPlayer) && Permissions.friendlyFire(defendingPlayer))) { event.setCancelled(true); return; @@ -252,7 +239,6 @@ public class EntityListener implements Listener { } - if (Misc.isNPCEntity(attacker)) { return; } @@ -263,15 +249,13 @@ public class EntityListener implements Listener { if (projectileSource instanceof LivingEntity) { attacker = (LivingEntity) projectileSource; } - } - else if (attacker instanceof Tameable) { + } else if (attacker instanceof Tameable) { AnimalTamer animalTamer = ((Tameable) attacker).getOwner(); if (animalTamer != null && ((OfflinePlayer) animalTamer).isOnline()) { attacker = (Entity) animalTamer; } - } - else if (attacker instanceof TNTPrimed && defender instanceof Player) { + } else if (attacker instanceof TNTPrimed && defender instanceof Player) { if (BlastMining.processBlastMiningExplosion(event, (TNTPrimed) attacker, (Player) defender)) { return; } @@ -292,7 +276,7 @@ public class EntityListener implements Listener { } //Party Friendly Fire - if(!Config.getInstance().getPartyFriendlyFire()) + if (!Config.getInstance().getPartyFriendlyFire()) if ((PartyManager.inSameParty(defendingPlayer, attackingPlayer) || PartyManager.areAllies(defendingPlayer, attackingPlayer)) && !(Permissions.friendlyFire(attackingPlayer) && Permissions.friendlyFire(defendingPlayer))) { event.setCancelled(true); return; @@ -305,17 +289,14 @@ public class EntityListener implements Listener { /** * This sets entity names back to whatever they are supposed to be */ - if(!(attacker instanceof Player) && defender instanceof Player) - { - if(event.getFinalDamage() >= ((LivingEntity) defender).getHealth()) - { + if (!(attacker instanceof Player) && defender instanceof Player) { + if (event.getFinalDamage() >= ((LivingEntity) defender).getHealth()) { List metadataValue = attacker.getMetadata("mcMMO_oldName"); - if(metadataValue.size() <= 0) + if (metadataValue.size() <= 0) return; - if(metadataValue != null) - { + if (metadataValue != null) { OldName oldName = (OldName) metadataValue.get(0); attacker.setCustomName(oldName.asString()); attacker.setCustomNameVisible(false); @@ -327,22 +308,19 @@ public class EntityListener implements Listener { /** * Handle EntityDamage events that involve modifying the event. * - * @param event - * The event to modify + * @param event The event to modify */ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onEntityDamage(EntityDamageEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; - if(event.getEntity() instanceof Player) - { + if (event.getEntity() instanceof Player) { Player player = (Player) event.getEntity(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } } @@ -408,19 +386,15 @@ public class EntityListener implements Listener { mcMMOPlayer.actualizeRecentlyHurt(); } - } - - else if (livingEntity instanceof Tameable) { + } else if (livingEntity instanceof Tameable) { Tameable pet = (Tameable) livingEntity; AnimalTamer owner = pet.getOwner(); - if(owner instanceof Player) - { + if (owner instanceof Player) { Player player = (Player) owner; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } } @@ -493,13 +467,12 @@ public class EntityListener implements Listener { /** * Monitor EntityDeath events. * - * @param event - * The event to watch + * @param event The event to watch */ @EventHandler(priority = EventPriority.LOWEST) public void onEntityDeathLowest(EntityDeathEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; LivingEntity entity = event.getEntity(); @@ -526,13 +499,12 @@ public class EntityListener implements Listener { /** * Monitor EntityDeath events. * - * @param event - * The event to watch + * @param event The event to watch */ @EventHandler(priority = EventPriority.MONITOR) public void onEntityDeath(EntityDeathEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; LivingEntity entity = event.getEntity(); @@ -547,13 +519,12 @@ public class EntityListener implements Listener { /** * Monitor CreatureSpawn events. * - * @param event - * The event to watch + * @param event The event to watch */ @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onCreatureSpawn(CreatureSpawnEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; LivingEntity entity = event.getEntity(); @@ -583,13 +554,12 @@ public class EntityListener implements Listener { /** * Handle ExplosionPrime events that involve modifying the event. * - * @param event - * The event to modify + * @param event The event to modify */ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onExplosionPrime(ExplosionPrimeEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; Entity entity = event.getEntity(); @@ -607,9 +577,8 @@ public class EntityListener implements Listener { } /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -623,13 +592,12 @@ public class EntityListener implements Listener { /** * Handle EntityExplode events that involve modifying the event. * - * @param event - * The event to modify + * @param event The event to modify */ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onEnitityExplode(EntityExplodeEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; Entity entity = event.getEntity(); @@ -647,9 +615,8 @@ public class EntityListener implements Listener { } /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -664,13 +631,12 @@ public class EntityListener implements Listener { /** * Handle EntityExplode events that involve modifying the event. * - * @param event - * The event to modify + * @param event The event to modify */ @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onEntityExplodeMonitor(EntityExplodeEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; Entity entity = event.getEntity(); @@ -685,13 +651,12 @@ public class EntityListener implements Listener { /** * Handle FoodLevelChange events that involve modifying the event. * - * @param event - * The event to modify + * @param event The event to modify */ @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onFoodLevelChange(FoodLevelChangeEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; Entity entity = event.getEntity(); @@ -703,9 +668,8 @@ public class EntityListener implements Listener { Player player = (Player) entity; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -728,27 +692,27 @@ public class EntityListener implements Listener { */ switch (player.getInventory().getItemInMainHand().getType()) { case BAKED_POTATO: /* - * RESTORES 3 HUNGER - RESTORES 5 1/2 HUNGER @ - * 1000 - */ + * RESTORES 3 HUNGER - RESTORES 5 1/2 HUNGER @ + * 1000 + */ case BEETROOT: case BREAD: /* RESTORES 2 1/2 HUNGER - RESTORES 5 HUNGER @ 1000 */ case CARROT: /* - * RESTORES 2 HUNGER - RESTORES 4 1/2 HUNGER @ - * 1000 - */ + * RESTORES 2 HUNGER - RESTORES 4 1/2 HUNGER @ + * 1000 + */ case GOLDEN_CARROT: /* - * RESTORES 3 HUNGER - RESTORES 5 1/2 HUNGER @ - * 1000 - */ + * RESTORES 3 HUNGER - RESTORES 5 1/2 HUNGER @ + * 1000 + */ case MUSHROOM_STEW: /* - * RESTORES 4 HUNGER - RESTORES 6 1/2 HUNGER @ - * 1000 - */ + * RESTORES 4 HUNGER - RESTORES 6 1/2 HUNGER @ + * 1000 + */ case PUMPKIN_PIE: /* - * RESTORES 4 HUNGER - RESTORES 6 1/2 HUNGER @ - * 1000 - */ + * RESTORES 4 HUNGER - RESTORES 6 1/2 HUNGER @ + * 1000 + */ if (Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_FARMERS_DIET)) { event.setFoodLevel(UserManager.getPlayer(player).getHerbalismManager().farmersDiet(newFoodLevel)); } @@ -757,9 +721,9 @@ public class EntityListener implements Listener { case COOKIE: /* RESTORES 1/2 HUNGER - RESTORES 2 HUNGER @ 1000 */ case MELON_SLICE: /* RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER @ 1000 */ case POISONOUS_POTATO: /* - * RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER - * @ 1000 - */ + * RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER + * @ 1000 + */ case POTATO: /* RESTORES 1/2 HUNGER - RESTORES 2 HUNGER @ 1000 */ if (Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_FARMERS_DIET)) { event.setFoodLevel(UserManager.getPlayer(player).getHerbalismManager().farmersDiet(newFoodLevel)); @@ -767,9 +731,9 @@ public class EntityListener implements Listener { return; case COOKED_SALMON: /* - * RESTORES 2 1/2 HUNGER - RESTORES 5 HUNGER @ - * 1000 - */ + * RESTORES 2 1/2 HUNGER - RESTORES 5 HUNGER @ + * 1000 + */ if (Permissions.isSubSkillEnabled(player, SubSkillType.FISHING_FISHERMANS_DIET)) { event.setFoodLevel(UserManager.getPlayer(player).getFishingManager().handleFishermanDiet(Fishing.fishermansDietRankLevel1, newFoodLevel)); } @@ -789,13 +753,12 @@ public class EntityListener implements Listener { /** * Monitor EntityTame events. * - * @param event - * The event to watch + * @param event The event to watch */ @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onEntityTame(EntityTameEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; if (event instanceof FakeEntityTameEvent) { @@ -805,9 +768,8 @@ public class EntityListener implements Listener { Player player = (Player) event.getOwner(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -824,13 +786,12 @@ public class EntityListener implements Listener { /** * Handle EntityTarget events. * - * @param event - * The event to process + * @param event The event to process */ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onEntityTarget(EntityTargetEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; Entity entity = event.getEntity(); @@ -843,9 +804,8 @@ public class EntityListener implements Listener { Player player = (Player) target; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -867,13 +827,12 @@ public class EntityListener implements Listener { * Handle PotionSplash events in order to fix broken Splash Potion of * Saturation. * - * @param event - * The event to process + * @param event The event to process */ @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPotionSplash(PotionSplashEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; for (PotionEffect effect : ((PotionMeta) event.getPotion().getItem().getItemMeta()).getCustomEffects()) { @@ -887,11 +846,11 @@ public class EntityListener implements Listener { } } } - + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPigZapEvent(PigZapEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; if (event.getEntity().hasMetadata(mcMMO.entityMetadataKey)) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java index 71d8d6486..ca29ca3a9 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java @@ -17,26 +17,26 @@ public class InteractionManager { /** * Registers subskills with the Interaction registration + * * @param abstractSubSkill the target subskill to register */ - public static void registerSubSkill(AbstractSubSkill abstractSubSkill) - { + public static void registerSubSkill(AbstractSubSkill abstractSubSkill) { /* INIT MAPS */ - if(interactRegister == null) + if (interactRegister == null) interactRegister = new HashMap<>(); - if(subSkillList == null) + if (subSkillList == null) subSkillList = new ArrayList<>(); - if(subSkillNameMap == null) + if (subSkillNameMap == null) subSkillNameMap = new HashMap<>(); //Store a unique copy of each subskill - if(!subSkillList.contains(abstractSubSkill)) + if (!subSkillList.contains(abstractSubSkill)) subSkillList.add(abstractSubSkill); //Init ArrayList - if(interactRegister.get(abstractSubSkill.getInteractType()) == null) + if (interactRegister.get(abstractSubSkill.getInteractType()) == null) interactRegister.put(abstractSubSkill.getInteractType(), new ArrayList<>()); //Registration array reference @@ -48,33 +48,32 @@ public class InteractionManager { String lowerCaseName = abstractSubSkill.getConfigKeyName().toLowerCase(); //Register in name map - if(subSkillNameMap.get(lowerCaseName) == null) + if (subSkillNameMap.get(lowerCaseName) == null) subSkillNameMap.put(lowerCaseName, abstractSubSkill); - System.out.println("[mcMMO] registered subskill: "+ abstractSubSkill.getConfigKeyName()); + System.out.println("[mcMMO] registered subskill: " + abstractSubSkill.getConfigKeyName()); } /** * Grabs the registered abstract skill by its name * Is not case sensitive + * * @param name name of subskill, not case sensitive * @return null if the subskill is not registered */ - public static AbstractSubSkill getAbstractByName(String name) - { + public static AbstractSubSkill getAbstractByName(String name) { return subSkillNameMap.get(name.toLowerCase()); } /** * Processes the associated Interactions for this event - * @param event target event - * @param plugin instance of mcMMO plugin + * + * @param event target event + * @param plugin instance of mcMMO plugin * @param curInteractType the associated interaction type */ - public static void processEvent(Event event, mcMMO plugin, InteractType curInteractType) - { - for(Interaction interaction : interactRegister.get(curInteractType)) - { + public static void processEvent(Event event, mcMMO plugin, InteractType curInteractType) { + for (Interaction interaction : interactRegister.get(curInteractType)) { interaction.doInteraction(event, plugin); } } @@ -82,25 +81,24 @@ public class InteractionManager { /** * Returns the list that contains all unique instances of registered Interaction classes * Interactions are extensions of abstract classes that represent modifying behaviours in Minecraft through events + * * @return the unique collection of all registered Interaction classes */ - public static ArrayList getSubSkillList() - { + public static ArrayList getSubSkillList() { return subSkillList; } - public static boolean hasSubSkill(String name) - { + public static boolean hasSubSkill(String name) { return getAbstractByName(name) != null; } - public static boolean hasSubSkill(SubSkillType subSkillType) - { + public static boolean hasSubSkill(SubSkillType subSkillType) { return hasSubSkill(subSkillType.getNiceNameNoSpaces(subSkillType)); } /** * Returns the associative map which contains all registered interactions + * * @return the interact register */ public static HashMap> getInteractRegister() { diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java index 3f856fb75..c4e071c16 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java @@ -2,19 +2,19 @@ package com.gmail.nossr50.listeners; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.skills.WorldBlacklist; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.runnables.player.PlayerUpdateInventoryTask; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.events.fake.FakeBrewEvent; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.runnables.player.PlayerUpdateInventoryTask; import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy; import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyPotionBrewer; import com.gmail.nossr50.core.util.ItemUtils; import com.gmail.nossr50.core.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.SkillUtils; import com.gmail.nossr50.core.worldguard.WorldGuardManager; import com.gmail.nossr50.core.worldguard.WorldGuardUtils; +import com.gmail.nossr50.events.fake.FakeBrewEvent; +import com.gmail.nossr50.mcMMO; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; @@ -42,7 +42,7 @@ public class InventoryListener implements Listener { @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onInventoryOpen(InventoryOpenEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; Block furnaceBlock = processInventoryOpenOrCloseEvent(event.getInventory()); @@ -57,14 +57,14 @@ public class InventoryListener implements Listener { return; } - if(!furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey) && furnaceBlock.getMetadata(mcMMO.furnaceMetadataKey).size() == 0) + if (!furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey) && furnaceBlock.getMetadata(mcMMO.furnaceMetadataKey).size() == 0) furnaceBlock.setMetadata(mcMMO.furnaceMetadataKey, UserManager.getPlayer((Player) player).getPlayerMetadata()); } @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onInventoryClose(InventoryCloseEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; Block furnaceBlock = processInventoryOpenOrCloseEvent(event.getInventory()); @@ -85,7 +85,7 @@ public class InventoryListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onFurnaceBurnEvent(FurnaceBurnEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; Block furnaceBlock = event.getBlock(); @@ -99,9 +99,8 @@ public class InventoryListener implements Listener { Player player = getPlayerFromFurnace(furnaceBlock); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -115,7 +114,7 @@ public class InventoryListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onFurnaceSmeltEvent(FurnaceSmeltEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; Block furnaceBlock = event.getBlock(); @@ -128,9 +127,8 @@ public class InventoryListener implements Listener { Player player = getPlayerFromFurnace(furnaceBlock); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -144,7 +142,7 @@ public class InventoryListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onFurnaceExtractEvent(FurnaceExtractEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; Block furnaceBlock = event.getBlock(); @@ -156,9 +154,8 @@ public class InventoryListener implements Listener { Player player = getPlayerFromFurnace(furnaceBlock); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -173,18 +170,16 @@ public class InventoryListener implements Listener { @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) public void onInventoryClickEventNormal(InventoryClickEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getWhoClicked().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getWhoClicked().getWorld())) return; Inventory inventory = event.getInventory(); - if(event.getWhoClicked() instanceof Player) - { + if (event.getWhoClicked() instanceof Player) { Player player = ((Player) event.getWhoClicked()).getPlayer(); Block furnaceBlock = processInventoryOpenOrCloseEvent(event.getInventory()); - if (furnaceBlock != null) - { + if (furnaceBlock != null) { if (furnaceBlock.getMetadata(mcMMO.furnaceMetadataKey).size() > 0) furnaceBlock.removeMetadata(mcMMO.furnaceMetadataKey, mcMMO.p); @@ -211,9 +206,8 @@ public class InventoryListener implements Listener { Player player = (Player) whoClicked; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -251,8 +245,7 @@ public class InventoryListener implements Listener { default: return; } - } - else if (slot == InventoryType.SlotType.FUEL) { + } else if (slot == InventoryType.SlotType.FUEL) { boolean emptyClicked = AlchemyPotionBrewer.isEmpty(clicked); if (AlchemyPotionBrewer.isEmpty(cursor)) { @@ -262,8 +255,7 @@ public class InventoryListener implements Listener { } AlchemyPotionBrewer.scheduleCheck(player, stand); - } - else if (emptyClicked) { + } else if (emptyClicked) { if (AlchemyPotionBrewer.isValidIngredient(player, cursor)) { int amount = cursor.getAmount(); @@ -274,8 +266,7 @@ public class InventoryListener implements Listener { AlchemyPotionBrewer.scheduleUpdate(inventory); AlchemyPotionBrewer.scheduleCheck(player, stand); - } - else if (click == ClickType.RIGHT) { + } else if (click == ClickType.RIGHT) { event.setCancelled(true); ItemStack one = cursor.clone(); @@ -298,7 +289,7 @@ public class InventoryListener implements Listener { @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) public void onInventoryDragEvent(InventoryDragEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getWhoClicked().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getWhoClicked().getWorld())) return; Inventory inventory = event.getInventory(); @@ -330,9 +321,8 @@ public class InventoryListener implements Listener { Player player = (Player) whoClicked; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -349,10 +339,9 @@ public class InventoryListener implements Listener { // Apparently sometimes vanilla brewing beats our task listener to the actual brew. We handle this by cancelling the vanilla event and finishing our brew ourselves. @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) - public void onBrew(BrewEvent event) - { + public void onBrew(BrewEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; if (event instanceof FakeBrewEvent) @@ -367,7 +356,7 @@ public class InventoryListener implements Listener { @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) public void onInventoryMoveItemEvent(InventoryMoveItemEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getSource().getLocation().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getSource().getLocation().getWorld())) return; Inventory inventory = event.getDestination(); @@ -415,7 +404,7 @@ public class InventoryListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onCraftItem(CraftItemEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getWhoClicked().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getWhoClicked().getWorld())) return; final HumanEntity whoClicked = event.getWhoClicked(); @@ -433,9 +422,8 @@ public class InventoryListener implements Listener { Player player = (Player) whoClicked; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 9a15cf63d..7fc4135d4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -1,35 +1,35 @@ package com.gmail.nossr50.listeners; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.chat.ChatManager; import com.gmail.nossr50.core.chat.ChatManagerFactory; import com.gmail.nossr50.core.chat.PartyChatManager; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.skills.WorldBlacklist; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.core.util.*; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.party.ShareHandler; import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.child.salvage.Salvage; +import com.gmail.nossr50.core.skills.child.salvage.SalvageManager; import com.gmail.nossr50.core.skills.primary.fishing.FishingManager; import com.gmail.nossr50.core.skills.primary.herbalism.HerbalismManager; import com.gmail.nossr50.core.skills.primary.mining.MiningManager; import com.gmail.nossr50.core.skills.primary.repair.Repair; import com.gmail.nossr50.core.skills.primary.repair.RepairManager; -import com.gmail.nossr50.core.skills.child.salvage.Salvage; -import com.gmail.nossr50.core.skills.child.salvage.SalvageManager; import com.gmail.nossr50.core.skills.primary.taming.TamingManager; -import com.gmail.nossr50.util.*; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.util.*; import com.gmail.nossr50.core.util.skills.SkillUtils; import com.gmail.nossr50.core.util.sounds.SoundManager; import com.gmail.nossr50.core.util.sounds.SoundType; import com.gmail.nossr50.core.worldguard.WorldGuardManager; import com.gmail.nossr50.core.worldguard.WorldGuardUtils; +import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.util.*; import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.block.Block; @@ -63,15 +63,14 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerTeleport(PlayerTeleportEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; Player player = event.getPlayer(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -94,15 +93,14 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onPlayerDeathLowest(PlayerDeathEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; String deathMessage = event.getDeathMessage(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(event.getEntity())) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(event.getEntity())) return; } @@ -127,7 +125,7 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerDeathMonitor(PlayerDeathEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; boolean statLossEnabled = HardcoreManager.isStatLossEnabled(); @@ -146,9 +144,8 @@ public class PlayerListener implements Listener { Player killer = killedPlayer.getKiller(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(killedPlayer)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(killedPlayer)) return; } @@ -202,13 +199,12 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerDropItem(PlayerDropItemEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) return; } @@ -233,15 +229,14 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onPlayerFishHighest(PlayerFishEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; Player player = event.getPlayer(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -266,7 +261,7 @@ public class PlayerListener implements Listener { if (Permissions.vanillaXpBoost(player, PrimarySkillType.FISHING)) { //Don't modify XP below vanilla values - if(fishingManager.handleVanillaXpBoost(event.getExpToDrop()) > 1) + if (fishingManager.handleVanillaXpBoost(event.getExpToDrop()) > 1) event.setExpToDrop(fishingManager.handleVanillaXpBoost(event.getExpToDrop())); } return; @@ -304,15 +299,14 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerFishMonitor(PlayerFishEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; Player player = event.getPlayer(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -334,7 +328,7 @@ public class PlayerListener implements Listener { return; case CAUGHT_FISH: - if(fishingManager.exploitPrevention(event.getHook().getBoundingBox())) + if (fishingManager.exploitPrevention(event.getHook().getBoundingBox())) return; fishingManager.handleFishing((Item) caught); fishingManager.setFishingTarget(); @@ -363,17 +357,15 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onPlayerPickupItem(EntityPickupItemEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; - if(event.getEntity() instanceof Player) - { + if (event.getEntity() instanceof Player) { Player player = (Player) event.getEntity(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -493,15 +485,14 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onPlayerInteractLowest(PlayerInteractEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; Player player = event.getPlayer(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -547,8 +538,7 @@ public class PlayerListener implements Listener { else if (miningManager.canDetonate()) { if (type == Material.TNT) { event.setCancelled(true); // Don't detonate the TNT if they're too close - } - else { + } else { miningManager.remoteDetonation(); } } @@ -596,15 +586,14 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.MONITOR) public void onPlayerInteractMonitor(PlayerInteractEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; Player player = event.getPlayer(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -617,10 +606,10 @@ public class PlayerListener implements Listener { switch (event.getAction()) { case RIGHT_CLICK_BLOCK: - if(player.getInventory().getItemInOffHand().getType() != Material.AIR && !player.isInsideVehicle() && !player.isSneaking()) { + if (player.getInventory().getItemInOffHand().getType() != Material.AIR && !player.isInsideVehicle() && !player.isSneaking()) { break; } - + Block block = event.getClickedBlock(); BlockState blockState = block.getState(); @@ -675,10 +664,10 @@ public class PlayerListener implements Listener { break; case RIGHT_CLICK_AIR: - if(player.getInventory().getItemInOffHand().getType() != Material.AIR && !player.isInsideVehicle() && !player.isSneaking()) { + if (player.getInventory().getItemInOffHand().getType() != Material.AIR && !player.isInsideVehicle() && !player.isSneaking()) { break; } - + /* ACTIVATION CHECKS */ if (Config.getInstance().getAbilitiesEnabled()) { mcMMOPlayer.processAbilityActivation(PrimarySkillType.AXES); @@ -714,11 +703,9 @@ public class PlayerListener implements Listener { if (type == Config.getInstance().getTamingCOTWMaterial(EntityType.WOLF)) { tamingManager.summonWolf(); - } - else if (type == Config.getInstance().getTamingCOTWMaterial(EntityType.OCELOT)) { + } else if (type == Config.getInstance().getTamingCOTWMaterial(EntityType.OCELOT)) { tamingManager.summonOcelot(); - } - else if (type == Config.getInstance().getTamingCOTWMaterial(EntityType.HORSE)) { + } else if (type == Config.getInstance().getTamingCOTWMaterial(EntityType.HORSE)) { tamingManager.summonHorse(); } @@ -763,8 +750,7 @@ public class PlayerListener implements Listener { chatManager = ChatManagerFactory.getChatManager(plugin, ChatMode.PARTY); ((PartyChatManager) chatManager).setParty(party); - } - else if (mcMMOPlayer.isChatEnabled(ChatMode.ADMIN)) { + } else if (mcMMOPlayer.isChatEnabled(ChatMode.ADMIN)) { chatManager = ChatManagerFactory.getChatManager(plugin, ChatMode.ADMIN); } @@ -806,7 +792,7 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerStatisticIncrementEvent(PlayerStatisticIncrementEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; if (!mcMMO.getHolidayManager().isAprilFirst()) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java index 9b098a83f..f936898a3 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java @@ -1,18 +1,18 @@ package com.gmail.nossr50.listeners; -import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; +import com.gmail.nossr50.core.worldguard.WorldGuardManager; +import com.gmail.nossr50.core.worldguard.WorldGuardUtils; import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent; import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent; import com.gmail.nossr50.events.skills.abilities.McMMOPlayerAbilityActivateEvent; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; -import com.gmail.nossr50.core.worldguard.WorldGuardManager; -import com.gmail.nossr50.core.worldguard.WorldGuardUtils; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -22,8 +22,7 @@ public class SelfListener implements Listener { //Used in task scheduling and other things private final mcMMO plugin; - public SelfListener(mcMMO plugin) - { + public SelfListener(mcMMO plugin) { this.plugin = plugin; } @@ -33,14 +32,13 @@ public class SelfListener implements Listener { PrimarySkillType skill = event.getSkill(); //Players can gain multiple levels especially during xprate events - for(int i = 0; i < event.getLevelsGained(); i++) - { + for (int i = 0; i < event.getLevelsGained(); i++) { int previousLevelGained = event.getSkillLevel() - i; //Send player skill unlock notifications UserManager.getPlayer(player).processUnlockNotifications(plugin, event.getSkill(), previousLevelGained); } - if(Config.getInstance().getScoreboardsEnabled()) + if (Config.getInstance().getScoreboardsEnabled()) ScoreboardManager.handleLevelUp(player, skill); if (!Config.getInstance().getLevelUpEffectsEnabled()) { @@ -54,13 +52,13 @@ public class SelfListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerXp(McMMOPlayerXpGainEvent event) { - if(Config.getInstance().getScoreboardsEnabled()) + if (Config.getInstance().getScoreboardsEnabled()) ScoreboardManager.handleXp(event.getPlayer(), event.getSkill()); } @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onAbility(McMMOPlayerAbilityActivateEvent event) { - if(Config.getInstance().getScoreboardsEnabled()) + if (Config.getInstance().getScoreboardsEnabled()) ScoreboardManager.cooldownUpdate(event.getPlayer(), event.getSkill()); } @@ -71,23 +69,19 @@ public class SelfListener implements Listener { PrimarySkillType primarySkillType = event.getSkill(); //WorldGuard XP Check - if(event.getXpGainReason() == XPGainReason.PVE || + if (event.getXpGainReason() == XPGainReason.PVE || event.getXpGainReason() == XPGainReason.PVP || event.getXpGainReason() == XPGainReason.SHARED_PVE || - event.getXpGainReason() == XPGainReason.SHARED_PVP) - { - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasXPFlag(player)) - { + event.getXpGainReason() == XPGainReason.SHARED_PVP) { + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasXPFlag(player)) { event.setRawXpGained(0); event.setCancelled(true); } } } - if (event.getXpGainReason() == XPGainReason.COMMAND) - { + if (event.getXpGainReason() == XPGainReason.COMMAND) { return; } @@ -124,12 +118,10 @@ public class SelfListener implements Listener { * Make sure players get a guaranteed minimum of XP */ //If there is no guaranteed minimum proceed, otherwise only proceed if newValue would be higher than our guaranteed minimum - if(guaranteedMinimum <= 0 || newValue > guaranteedMinimum) - { + if (guaranteedMinimum <= 0 || newValue > guaranteedMinimum) { if (newValue > 0) { event.setRawXpGained(newValue); - } - else { + } else { event.setCancelled(true); } } else { diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/WorldListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/WorldListener.java index c72d49d27..a533f0238 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/WorldListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/WorldListener.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.listeners; import com.gmail.nossr50.core.config.skills.WorldBlacklist; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.data.blockmeta.conversion.BlockStoreConversionMain; +import com.gmail.nossr50.mcMMO; import org.bukkit.Chunk; import org.bukkit.World; import org.bukkit.block.BlockState; @@ -31,7 +31,7 @@ public class WorldListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onStructureGrow(StructureGrowEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getWorld())) return; if (!mcMMO.getPlaceStore().isTrue(event.getLocation().getBlock())) { @@ -51,7 +51,7 @@ public class WorldListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onWorldInit(WorldInitEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getWorld())) return; World world = event.getWorld(); @@ -73,7 +73,7 @@ public class WorldListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onWorldUnload(WorldUnloadEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getWorld())) return; mcMMO.getPlaceStore().unloadWorld(event.getWorld()); @@ -87,7 +87,7 @@ public class WorldListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onChunkUnload(ChunkUnloadEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getWorld())) return; Chunk chunk = event.getChunk(); diff --git a/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java b/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java index e97d1b573..836198c74 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java @@ -8,14 +8,13 @@ import com.gmail.nossr50.config.mods.ToolConfigManager; import com.gmail.nossr50.config.skills.alchemy.PotionConfig; import com.gmail.nossr50.config.skills.repair.RepairConfigManager; import com.gmail.nossr50.config.skills.salvage.SalvageConfigManager; -import com.gmail.nossr50.core.config.treasure.TreasureConfig; import com.gmail.nossr50.core.config.skills.*; +import com.gmail.nossr50.core.config.treasure.TreasureConfig; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.data.blockmeta.chunkmeta.ChunkManager; +import com.gmail.nossr50.core.data.blockmeta.chunkmeta.ChunkManagerFactory; import com.gmail.nossr50.core.data.database.DatabaseManager; import com.gmail.nossr50.core.data.database.DatabaseManagerFactory; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.subskills.acrobatics.Roll; -import com.gmail.nossr50.core.util.*; -import com.gmail.nossr50.listeners.*; import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.runnables.CheckDateTask; import com.gmail.nossr50.core.runnables.SaveTimerTask; @@ -26,24 +25,25 @@ import com.gmail.nossr50.core.runnables.player.ClearRegisteredXPGainTask; import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask; import com.gmail.nossr50.core.runnables.player.PowerLevelUpdatingTask; import com.gmail.nossr50.core.runnables.skills.BleedTimerTask; -import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.child.ChildConfig; -import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; -import com.gmail.nossr50.core.skills.primary.repair.repairables.RepairableManager; -import com.gmail.nossr50.core.skills.primary.repair.repairables.SimpleRepairableManager; import com.gmail.nossr50.core.skills.child.salvage.salvageables.Salvageable; import com.gmail.nossr50.core.skills.child.salvage.salvageables.SalvageableManager; import com.gmail.nossr50.core.skills.child.salvage.salvageables.SimpleSalvageableManager; -import com.gmail.nossr50.util.*; -import com.gmail.nossr50.core.data.blockmeta.chunkmeta.ChunkManager; -import com.gmail.nossr50.core.data.blockmeta.chunkmeta.ChunkManagerFactory; +import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy; +import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; +import com.gmail.nossr50.core.skills.primary.repair.repairables.RepairableManager; +import com.gmail.nossr50.core.skills.primary.repair.repairables.SimpleRepairableManager; +import com.gmail.nossr50.core.skills.subskills.acrobatics.Roll; +import com.gmail.nossr50.core.util.*; import com.gmail.nossr50.core.util.commands.CommandRegistrationManager; import com.gmail.nossr50.core.util.experience.FormulaManager; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.core.util.skills.RankUtils; import com.gmail.nossr50.core.util.upgrade.UpgradeManager; import com.gmail.nossr50.core.worldguard.WorldGuardManager; +import com.gmail.nossr50.listeners.*; +import com.gmail.nossr50.util.*; import com.google.common.base.Charsets; import net.shatteredlands.shatt.backup.ZipLibrary; import org.bstats.bukkit.Metrics; @@ -61,6 +61,29 @@ import java.util.ArrayList; import java.util.List; public class mcMMO extends JavaPlugin { + /* Metadata Values */ + public final static String entityMetadataKey = "mcMMO: Spawned Entity"; + public final static String blockMetadataKey = "mcMMO: Piston Tracking"; + public final static String furnaceMetadataKey = "mcMMO: Tracked Furnace"; + public final static String tntMetadataKey = "mcMMO: Tracked TNT"; + public final static String funfettiMetadataKey = "mcMMO: Funfetti"; + public final static String tntsafeMetadataKey = "mcMMO: Safe TNT"; + public final static String customNameKey = "mcMMO: Custom Name"; + public final static String customVisibleKey = "mcMMO: Name Visibility"; + public final static String droppedItemKey = "mcMMO: Tracked Item"; + public final static String infiniteArrowKey = "mcMMO: Infinite Arrow"; + public final static String bowForceKey = "mcMMO: Bow Force"; + public final static String arrowDistanceKey = "mcMMO: Arrow Distance"; + //public final static String customDamageKey = "mcMMO: Custom Damage"; + public final static String disarmedItemKey = "mcMMO: Disarmed Item"; + public final static String playerDataKey = "mcMMO: Player Data"; + public final static String greenThumbDataKey = "mcMMO: Green Thumb"; + public final static String databaseCommandKey = "mcMMO: Processing Database Command"; + public final static String bredMetadataKey = "mcMMO: Bred Animal"; + public static mcMMO p; + // Jar Stuff + public static File mcmmo; + public static FixedMetadataValue metadataValue; /* Managers */ private static ChunkManager placeStore; private static RepairableManager repairableManager; @@ -70,53 +93,92 @@ public class mcMMO extends JavaPlugin { private static FormulaManager formulaManager; private static HolidayManager holidayManager; private static UpgradeManager upgradeManager; - /* Blacklist */ private static WorldBlacklist worldBlacklist; - /* File Paths */ private static String mainDirectory; private static String flatFileDirectory; private static String usersFile; private static String modDirectory; - - public static mcMMO p; - - // Jar Stuff - public static File mcmmo; - /* Plugin Checks */ private static boolean healthBarPluginEnabled; - + private static boolean isRetroModeEnabled; // Config Validation Check public boolean noErrorsInConfigFiles = true; - // XP Event Check private boolean xpEventEnabled; - private static boolean isRetroModeEnabled; + public static String getMainDirectory() { + return mainDirectory; + } - /* Metadata Values */ - public final static String entityMetadataKey = "mcMMO: Spawned Entity"; - public final static String blockMetadataKey = "mcMMO: Piston Tracking"; - public final static String furnaceMetadataKey = "mcMMO: Tracked Furnace"; - public final static String tntMetadataKey = "mcMMO: Tracked TNT"; - public final static String funfettiMetadataKey = "mcMMO: Funfetti"; - public final static String tntsafeMetadataKey = "mcMMO: Safe TNT"; - public final static String customNameKey = "mcMMO: Custom Name"; - public final static String customVisibleKey = "mcMMO: Name Visibility"; - public final static String droppedItemKey = "mcMMO: Tracked Item"; - public final static String infiniteArrowKey = "mcMMO: Infinite Arrow"; - public final static String bowForceKey = "mcMMO: Bow Force"; - public final static String arrowDistanceKey = "mcMMO: Arrow Distance"; - //public final static String customDamageKey = "mcMMO: Custom Damage"; - public final static String disarmedItemKey = "mcMMO: Disarmed Item"; - public final static String playerDataKey = "mcMMO: Player Data"; - public final static String greenThumbDataKey = "mcMMO: Green Thumb"; - public final static String databaseCommandKey = "mcMMO: Processing Database Command"; - public final static String bredMetadataKey = "mcMMO: Bred Animal"; + public static String getFlatFileDirectory() { + return flatFileDirectory; + } - public static FixedMetadataValue metadataValue; + public static String getUsersFilePath() { + return usersFile; + } + + public static String getModDirectory() { + return modDirectory; + } + + public static FormulaManager getFormulaManager() { + return formulaManager; + } + + public static HolidayManager getHolidayManager() { + return holidayManager; + } + + public static ChunkManager getPlaceStore() { + return placeStore; + } + + public static RepairableManager getRepairableManager() { + return repairableManager; + } + + public static SalvageableManager getSalvageableManager() { + return salvageableManager; + } + + public static DatabaseManager getDatabaseManager() { + return databaseManager; + } + + @Deprecated + public static void setDatabaseManager(DatabaseManager databaseManager) { + mcMMO.databaseManager = databaseManager; + } + + public static ModManager getModManager() { + return modManager; + } + + public static UpgradeManager getUpgradeManager() { + return upgradeManager; + } + + public static boolean isHealthBarPluginEnabled() { + return healthBarPluginEnabled; + } + + /** + * Checks if this plugin is using retro mode + * Retro mode is a 0-1000 skill system + * Standard mode is scaled for 1-100 + * + * @return true if retro mode is enabled + */ + public static boolean isRetroModeEnabled() { + return isRetroModeEnabled; + } + + public static WorldBlacklist getWorldBlacklist() { + return worldBlacklist; + } /** * Things to be run when the plugin is enabled. @@ -192,23 +254,21 @@ public class mcMMO extends JavaPlugin { Metrics metrics; - if(Config.getInstance().getIsMetricsEnabled()) { + if (Config.getInstance().getIsMetricsEnabled()) { metrics = new Metrics(this); metrics.addCustomChart(new Metrics.SimplePie("version", () -> getDescription().getVersion())); - if(Config.getInstance().getIsRetroMode()) + if (Config.getInstance().getIsRetroMode()) metrics.addCustomChart(new Metrics.SimplePie("scaling", () -> "Standard")); else metrics.addCustomChart(new Metrics.SimplePie("scaling", () -> "Retro")); } - } - catch (Throwable t) { + } catch (Throwable t) { getLogger().severe("There was an error while enabling mcMMO!"); if (!(t instanceof ExceptionInInitializerError)) { t.printStackTrace(); - } - else { + } else { getLogger().info("Please do not replace the mcMMO jar while the server is running."); } @@ -220,9 +280,8 @@ public class mcMMO extends JavaPlugin { } @Override - public void onLoad() - { - if(getServer().getPluginManager().getPlugin("WorldGuard") != null) + public void onLoad() { + if (getServer().getPluginManager().getPlugin("WorldGuard") != null) WorldGuardManager.getInstance().registerFlags(); } @@ -238,15 +297,16 @@ public class mcMMO extends JavaPlugin { PartyManager.saveParties(); // Save our parties //TODO: Needed? - if(Config.getInstance().getScoreboardsEnabled()) + if (Config.getInstance().getScoreboardsEnabled()) ScoreboardManager.teardownAll(); formulaManager.saveFormula(); holidayManager.saveAnniversaryFiles(); placeStore.saveAll(); // Save our metadata placeStore.cleanUp(); // Cleanup empty metadata stores + } catch (NullPointerException e) { + e.printStackTrace(); } - catch (NullPointerException e) { e.printStackTrace(); } debug("Canceling all tasks..."); getServer().getScheduler().cancelTasks(this); // This removes our tasks @@ -257,16 +317,13 @@ public class mcMMO extends JavaPlugin { // Remove other tasks BEFORE starting the Backup, or we just cancel it straight away. try { ZipLibrary.mcMMOBackup(); - } - catch (IOException e) { + } catch (IOException e) { getLogger().severe(e.toString()); - } - catch (Throwable e) { + } catch (Throwable e) { if (e instanceof NoClassDefFoundError) { getLogger().severe("Backup class not found!"); getLogger().info("Please do not replace the mcMMO jar while the server is running."); - } - else { + } else { getLogger().severe(e.toString()); } } @@ -276,22 +333,6 @@ public class mcMMO extends JavaPlugin { debug("Was disabled."); // How informative! } - public static String getMainDirectory() { - return mainDirectory; - } - - public static String getFlatFileDirectory() { - return flatFileDirectory; - } - - public static String getUsersFilePath() { - return usersFile; - } - - public static String getModDirectory() { - return modDirectory; - } - public boolean isXPEventEnabled() { return xpEventEnabled; } @@ -308,47 +349,6 @@ public class mcMMO extends JavaPlugin { getLogger().info("[Debug] " + message); } - public static FormulaManager getFormulaManager() { - return formulaManager; - } - - public static HolidayManager getHolidayManager() { - return holidayManager; - } - - public static ChunkManager getPlaceStore() { - return placeStore; - } - - public static RepairableManager getRepairableManager() { - return repairableManager; - } - - public static SalvageableManager getSalvageableManager() { - return salvageableManager; - } - - public static DatabaseManager getDatabaseManager() { - return databaseManager; - } - - public static ModManager getModManager() { - return modManager; - } - - public static UpgradeManager getUpgradeManager() { - return upgradeManager; - } - - @Deprecated - public static void setDatabaseManager(DatabaseManager databaseManager) { - mcMMO.databaseManager = databaseManager; - } - - public static boolean isHealthBarPluginEnabled() { - return healthBarPluginEnabled; - } - /** * Setup the various storage file paths */ @@ -377,10 +377,10 @@ public class mcMMO extends JavaPlugin { } } - File oldArmorFile = new File(modDirectory + "armor.yml"); - File oldBlocksFile = new File(modDirectory + "blocks.yml"); + File oldArmorFile = new File(modDirectory + "armor.yml"); + File oldBlocksFile = new File(modDirectory + "blocks.yml"); File oldEntitiesFile = new File(modDirectory + "entities.yml"); - File oldToolsFile = new File(modDirectory + "tools.yml"); + File oldToolsFile = new File(modDirectory + "tools.yml"); if (oldArmorFile.exists()) { if (!oldArmorFile.renameTo(new File(modDirectory + "armor.default.yml"))) { @@ -475,8 +475,7 @@ public class mcMMO extends JavaPlugin { * Acrobatics skills */ - if(CoreSkillsConfig.getInstance().isPrimarySkillEnabled(PrimarySkillType.ACROBATICS)) - { + if (CoreSkillsConfig.getInstance().isPrimarySkillEnabled(PrimarySkillType.ACROBATICS)) { System.out.println("[mcMMO]" + " enabling Acrobatics Skills"); //TODO: Should do this differently @@ -510,8 +509,7 @@ public class mcMMO extends JavaPlugin { if (purgeIntervalTicks == 0) { new UserPurgeTask().runTaskLaterAsynchronously(this, 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup. - } - else if (purgeIntervalTicks > 0) { + } else if (purgeIntervalTicks > 0) { new UserPurgeTask().runTaskTimerAsynchronously(this, purgeIntervalTicks, purgeIntervalTicks); } @@ -520,8 +518,7 @@ public class mcMMO extends JavaPlugin { if (kickIntervalTicks == 0) { new PartyAutoKickTask().runTaskLater(this, 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup. - } - else if (kickIntervalTicks > 0) { + } else if (kickIntervalTicks > 0) { new PartyAutoKickTask().runTaskTimer(this, kickIntervalTicks, kickIntervalTicks); } @@ -564,18 +561,4 @@ public class mcMMO extends JavaPlugin { InputStream in = getResource(fileName); return in == null ? null : new InputStreamReader(in, Charsets.UTF_8); } - - /** - * Checks if this plugin is using retro mode - * Retro mode is a 0-1000 skill system - * Standard mode is scaled for 1-100 - * @return true if retro mode is enabled - */ - public static boolean isRetroModeEnabled() { - return isRetroModeEnabled; - } - - public static WorldBlacklist getWorldBlacklist() { - return worldBlacklist; - } } diff --git a/bukkit/src/main/java/util/java/mcMMO/PotionConfigGenerator.java b/bukkit/src/main/java/util/java/mcMMO/PotionConfigGenerator.java index f50e6b4f2..f5fd26552 100644 --- a/bukkit/src/main/java/util/java/mcMMO/PotionConfigGenerator.java +++ b/bukkit/src/main/java/util/java/mcMMO/PotionConfigGenerator.java @@ -14,114 +14,6 @@ import java.util.Map.Entry; public class PotionConfigGenerator { - public static class Ingredient { - - public Material mat; - public int data; - public String name; - - public Ingredient(Material mat) { - this.mat = mat; - this.data = 0; - name = mat.name(); - } - - } - public static class WriteablePotion { - - public String name; - public Material mat; - public PotionData data; - public PotionEffect effect; - public String baseName; - - public WriteablePotion(PotionData data) { - this(Material.POTION, data); - } - - public WriteablePotion(Material type, PotionData data) { - this(type, data, null, getMCName(data.getType())); - } - - public WriteablePotion(Material mat, PotionType type, PotionEffect effect, String baseName) { - this(mat, new PotionData(type, false, false), effect, baseName); - } - - public WriteablePotion(Material type, PotionData data, PotionEffect effect, String baseName) { - this.data = data; - this.effect = effect; - this.mat = type; - this.baseName = baseName; - this.name = "POTION_OF_" + baseName; - if (mat == Material.SPLASH_POTION) { - this.name = "SPLASH_" + this.name; - } - if (mat == Material.LINGERING_POTION) { - this.name = "LINGERING_" + this.name; - } - if (data.isExtended()) { - this.name += "_EXTENDED"; - } - if (data.isUpgraded()) { - this.name += "_II"; - } - } - - public WriteablePotion(PotionType type) { - this(new PotionData(type, false, false)); - } - - public WriteablePotion(Material mat, PotionType type) { - this(mat, new PotionData(type, false, false)); - } - - private static String getMCName(PotionType type) { - switch (type) { - case INSTANT_DAMAGE : - return "HARMING"; - case INSTANT_HEAL : - return "HEALING"; - case JUMP : - return "LEAPING"; - case REGEN : - return "REGENERATION"; - case SPEED : - return "SWIFTNESS"; - case UNCRAFTABLE : - return "EMPTY"; - case LUCK : - case MUNDANE : - case NIGHT_VISION : - case POISON : - case INVISIBILITY : - case SLOWNESS : - case AWKWARD : - case STRENGTH : - case THICK : - case FIRE_RESISTANCE : - case WATER : - case WATER_BREATHING : - case WEAKNESS : - case TURTLE_MASTER: - case SLOW_FALLING: - return type.name(); - default : - return ""; - } - } - - public int hashCode() { - return name.hashCode(); - } - - public boolean equals(Object obj) { - if (!(obj instanceof WriteablePotion)) { - return false; - } - return name.equals(((WriteablePotion) obj).name); - } - } - public static void main(String[] args) { Map> vanillaPotions = new HashMap<>(); populateVanillaPotions(vanillaPotions); @@ -250,59 +142,59 @@ public class PotionConfigGenerator { private static String getName(PotionEffectType type) { switch (type.getId()) { - case 1 : + case 1: return "SPEED"; - case 2 : + case 2: return "SLOW"; - case 3 : + case 3: return "FAST_DIGGING"; - case 4 : + case 4: return "SLOW_DIGGING"; - case 5 : + case 5: return "INCREASE_DAMAGE"; - case 6 : + case 6: return "HEAL"; - case 7 : + case 7: return "HARM"; - case 8 : + case 8: return "JUMP"; - case 9 : + case 9: return "CONFUSION"; - case 10 : + case 10: return "REGENERATION"; - case 11 : + case 11: return "DAMAGE_RESISTANCE"; - case 12 : + case 12: return "FIRE_RESISTANCE"; - case 13 : + case 13: return "WATER_BREATHING"; - case 14 : + case 14: return "INVISIBILITY"; - case 15 : + case 15: return "BLINDNESS"; - case 16 : + case 16: return "NIGHT_VISION"; - case 17 : + case 17: return "HUNGER"; - case 18 : + case 18: return "WEAKNESS"; - case 19 : + case 19: return "POISON"; - case 20 : + case 20: return "WITHER"; - case 21 : + case 21: return "HEALTH_BOOST"; - case 22 : + case 22: return "ABSORPTION"; - case 23 : + case 23: return "SATURATION"; - case 24 : + case 24: return "GLOWING"; - case 25 : + case 25: return "LEVITATION"; - case 26 : + case 26: return "LUCK"; - case 27 : + case 27: return "UNLUCK"; case 28: return "SLOW_FALLING"; @@ -310,7 +202,7 @@ public class PotionConfigGenerator { return "CONDUIT_POWER"; case 30: return "DOLPHINS_GRACE"; - default : + default: return "UNKNOWN_EFFECT_TYPE_" + type.getId(); } } @@ -348,9 +240,9 @@ public class PotionConfigGenerator { private static void getChildren(WriteablePotion current, HashMap children) { switch (current.data.getType()) { - case WATER : - assert(!current.data.isExtended()); - assert(!current.data.isUpgraded()); + case WATER: + assert (!current.data.isExtended()); + assert (!current.data.isUpgraded()); children.put(new Ingredient(Material.NETHER_WART), new WriteablePotion(current.mat, PotionType.AWKWARD)); children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, PotionType.WEAKNESS)); children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, PotionType.MUNDANE)); @@ -363,9 +255,9 @@ public class PotionConfigGenerator { children.put(new Ingredient(Material.GLISTERING_MELON_SLICE), new WriteablePotion(current.mat, PotionType.MUNDANE)); children.put(new Ingredient(Material.GHAST_TEAR), new WriteablePotion(current.mat, PotionType.MUNDANE)); return; - case AWKWARD : - assert(!current.data.isExtended()); - assert(!current.data.isUpgraded()); + case AWKWARD: + assert (!current.data.isExtended()); + assert (!current.data.isUpgraded()); children.put(new Ingredient(Material.GOLDEN_CARROT), new WriteablePotion(current.mat, PotionType.NIGHT_VISION)); children.put(new Ingredient(Material.RABBIT_FOOT), new WriteablePotion(current.mat, PotionType.JUMP)); children.put(new Ingredient(Material.MAGMA_CREAM), new WriteablePotion(current.mat, PotionType.FIRE_RESISTANCE)); @@ -396,8 +288,8 @@ public class PotionConfigGenerator { children.put(new Ingredient(Material.FERN), new WriteablePotion(current.mat, PotionType.UNCRAFTABLE, new PotionEffect(PotionEffectType.SATURATION, (int) (8 * mod), 0), "SATURATION")); children.put(new Ingredient(Material.APPLE), new WriteablePotion(current.mat, PotionType.UNCRAFTABLE, new PotionEffect(PotionEffectType.HEALTH_BOOST, (int) (1800 * mod), 0), "HEALTH_BOOST")); return; - case FIRE_RESISTANCE : - assert(!current.data.isUpgraded()); + case FIRE_RESISTANCE: + assert (!current.data.isUpgraded()); if (current.data.isExtended()) { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, new PotionData(PotionType.SLOWNESS, true, false))); } else { @@ -405,14 +297,14 @@ public class PotionConfigGenerator { children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); } return; - case INSTANT_DAMAGE : - assert(!current.data.isExtended()); + case INSTANT_DAMAGE: + assert (!current.data.isExtended()); if (!current.data.isUpgraded()) { children.put(new Ingredient(Material.GLOWSTONE_DUST), new WriteablePotion(current.mat, new PotionData(current.data.getType(), false, true))); } return; - case INSTANT_HEAL : - assert(!current.data.isExtended()); + case INSTANT_HEAL: + assert (!current.data.isExtended()); if (!current.data.isUpgraded()) { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, PotionType.INSTANT_DAMAGE)); children.put(new Ingredient(Material.GLOWSTONE_DUST), new WriteablePotion(current.mat, new PotionData(current.data.getType(), false, true))); @@ -420,21 +312,21 @@ public class PotionConfigGenerator { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, new PotionData(PotionType.INSTANT_DAMAGE, false, true))); } return; - case INVISIBILITY : - assert(!current.data.isUpgraded()); + case INVISIBILITY: + assert (!current.data.isUpgraded()); if (!current.data.isExtended()) { children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); } return; - case JUMP : + case JUMP: if (!current.data.isUpgraded() && !current.data.isExtended()) { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, PotionType.SLOWNESS)); children.put(new Ingredient(Material.GLOWSTONE_DUST), new WriteablePotion(current.mat, new PotionData(current.data.getType(), false, true))); children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); } return; - case NIGHT_VISION : - assert(!current.data.isUpgraded()); + case NIGHT_VISION: + assert (!current.data.isUpgraded()); if (!current.data.isExtended()) { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, PotionType.INVISIBILITY)); children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); @@ -442,7 +334,7 @@ public class PotionConfigGenerator { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, new PotionData(PotionType.INVISIBILITY, true, false))); } return; - case POISON : + case POISON: if (!current.data.isUpgraded() && !current.data.isExtended()) { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, PotionType.INSTANT_DAMAGE)); children.put(new Ingredient(Material.GLOWSTONE_DUST), new WriteablePotion(current.mat, new PotionData(current.data.getType(), false, true))); @@ -451,25 +343,25 @@ public class PotionConfigGenerator { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, new PotionData(PotionType.INSTANT_DAMAGE, false, true))); } return; - case REGEN : + case REGEN: if (!current.data.isUpgraded() && !current.data.isExtended()) { children.put(new Ingredient(Material.GLOWSTONE_DUST), new WriteablePotion(current.mat, new PotionData(current.data.getType(), false, true))); children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); } return; - case SLOWNESS : - assert(!current.data.isUpgraded()); + case SLOWNESS: + assert (!current.data.isUpgraded()); if (!current.data.isExtended()) { children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); } return; - case SLOW_FALLING : - assert(!current.data.isUpgraded()); + case SLOW_FALLING: + assert (!current.data.isUpgraded()); if (!current.data.isExtended()) { children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); } return; - case SPEED : + case SPEED: if (!current.data.isUpgraded() && !current.data.isExtended()) { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, PotionType.SLOWNESS)); children.put(new Ingredient(Material.GLOWSTONE_DUST), new WriteablePotion(current.mat, new PotionData(current.data.getType(), false, true))); @@ -478,7 +370,7 @@ public class PotionConfigGenerator { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, new PotionData(PotionType.SLOWNESS, true, false))); } return; - case STRENGTH : + case STRENGTH: if (!current.data.isUpgraded() && !current.data.isExtended()) { children.put(new Ingredient(Material.GLOWSTONE_DUST), new WriteablePotion(current.mat, new PotionData(current.data.getType(), false, true))); children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); @@ -490,28 +382,28 @@ public class PotionConfigGenerator { children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); } return; - case WATER_BREATHING : - assert(!current.data.isUpgraded()); + case WATER_BREATHING: + assert (!current.data.isUpgraded()); if (!current.data.isExtended()) { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, PotionType.INSTANT_DAMAGE)); children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); } return; - case WEAKNESS : - assert(!current.data.isUpgraded()); + case WEAKNESS: + assert (!current.data.isUpgraded()); if (!current.data.isExtended()) { children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); } return; - case LUCK : - case MUNDANE : - case THICK : - case UNCRAFTABLE : - assert(!current.data.isExtended()); - assert(!current.data.isUpgraded()); + case LUCK: + case MUNDANE: + case THICK: + case UNCRAFTABLE: + assert (!current.data.isExtended()); + assert (!current.data.isUpgraded()); return; - default : - assert(false); + default: + assert (false); break; } } @@ -608,7 +500,7 @@ public class PotionConfigGenerator { } mcMMOPotions.put(data, children); } - + // Add all material state changes for (Entry> entry : mcMMOPotions.entrySet()) { if (entry.getKey().mat == Material.POTION) { @@ -620,4 +512,113 @@ public class PotionConfigGenerator { } } } + + public static class Ingredient { + + public Material mat; + public int data; + public String name; + + public Ingredient(Material mat) { + this.mat = mat; + this.data = 0; + name = mat.name(); + } + + } + + public static class WriteablePotion { + + public String name; + public Material mat; + public PotionData data; + public PotionEffect effect; + public String baseName; + + public WriteablePotion(PotionData data) { + this(Material.POTION, data); + } + + public WriteablePotion(Material type, PotionData data) { + this(type, data, null, getMCName(data.getType())); + } + + public WriteablePotion(Material mat, PotionType type, PotionEffect effect, String baseName) { + this(mat, new PotionData(type, false, false), effect, baseName); + } + + public WriteablePotion(Material type, PotionData data, PotionEffect effect, String baseName) { + this.data = data; + this.effect = effect; + this.mat = type; + this.baseName = baseName; + this.name = "POTION_OF_" + baseName; + if (mat == Material.SPLASH_POTION) { + this.name = "SPLASH_" + this.name; + } + if (mat == Material.LINGERING_POTION) { + this.name = "LINGERING_" + this.name; + } + if (data.isExtended()) { + this.name += "_EXTENDED"; + } + if (data.isUpgraded()) { + this.name += "_II"; + } + } + + public WriteablePotion(PotionType type) { + this(new PotionData(type, false, false)); + } + + public WriteablePotion(Material mat, PotionType type) { + this(mat, new PotionData(type, false, false)); + } + + private static String getMCName(PotionType type) { + switch (type) { + case INSTANT_DAMAGE: + return "HARMING"; + case INSTANT_HEAL: + return "HEALING"; + case JUMP: + return "LEAPING"; + case REGEN: + return "REGENERATION"; + case SPEED: + return "SWIFTNESS"; + case UNCRAFTABLE: + return "EMPTY"; + case LUCK: + case MUNDANE: + case NIGHT_VISION: + case POISON: + case INVISIBILITY: + case SLOWNESS: + case AWKWARD: + case STRENGTH: + case THICK: + case FIRE_RESISTANCE: + case WATER: + case WATER_BREATHING: + case WEAKNESS: + case TURTLE_MASTER: + case SLOW_FALLING: + return type.name(); + default: + return ""; + } + } + + public int hashCode() { + return name.hashCode(); + } + + public boolean equals(Object obj) { + if (!(obj instanceof WriteablePotion)) { + return false; + } + return name.equals(((WriteablePotion) obj).name); + } + } } diff --git a/bukkit/src/main/resources/child.yml b/bukkit/src/main/resources/child.yml index 685a6ce71..df215b424 100644 --- a/bukkit/src/main/resources/child.yml +++ b/bukkit/src/main/resources/child.yml @@ -9,8 +9,8 @@ # ##### Salvage: - - Fishing - - Repair +- Fishing +- Repair Smelting: - - Mining - - Repair \ No newline at end of file +- Mining +- Repair \ No newline at end of file diff --git a/bukkit/src/main/resources/config.yml b/bukkit/src/main/resources/config.yml index b528d3784..98c99daba 100644 --- a/bukkit/src/main/resources/config.yml +++ b/bukkit/src/main/resources/config.yml @@ -8,9 +8,9 @@ # Settings for mcMMO in general ### General: - # Turning this on will scale mcMMO around 1-1000 with default scaling factor - # Everything in your config related to skill level requirements, skill level bonuses, etc will be multiplied by 10 when this mode is on - # This change is purely cosmetic, it retains the old feel of mcMMO where you could level up thousands of times + # Turning this on will scale mcMMO around 1-1000 with default scaling factor + # Everything in your config related to skill level requirements, skill level bonuses, etc will be multiplied by 10 when this mode is on + # This change is purely cosmetic, it retains the old feel of mcMMO where you could level up thousands of times RetroMode: Enabled: false Locale: en_US diff --git a/bukkit/src/main/resources/coreskills.yml b/bukkit/src/main/resources/coreskills.yml index ba54e50f2..75e99afb8 100644 --- a/bukkit/src/main/resources/coreskills.yml +++ b/bukkit/src/main/resources/coreskills.yml @@ -3,7 +3,7 @@ #Acrobatics Acrobatics: - # turn this to false to disable all subskills for this skill - Enabled: true - Roll: - Enabled: true \ No newline at end of file + # turn this to false to disable all subskills for this skill + Enabled: true + Roll: + Enabled: true \ No newline at end of file diff --git a/bukkit/src/main/resources/itemweights.yml b/bukkit/src/main/resources/itemweights.yml index 7277c120a..55072c556 100644 --- a/bukkit/src/main/resources/itemweights.yml +++ b/bukkit/src/main/resources/itemweights.yml @@ -57,40 +57,40 @@ Item_Weights: # Case insensitive, though the name must be exactly the same as set in the Bukkit Material enum. Party_Shareables: Misc_Items: - - Diamond_Sword - - Diamond_Shovel - - Diamond_Pickaxe - - Diamond_Axe - - Golden_Sword - - Golden_Shovel - - Golden_Pickaxe - - Golden_Axe - - Iron_Sword - - Iron_Shovel - - Iron_Pickaxe - - Iron_Axe - - Stone_Sword - - Stone_Shovel - - Stone_Pickaxe - - Stone_Axe - - Wooden_Sword - - Wooden_Shovel - - Wooden_Pickaxe - - Wooden_Axe - - Bow - - Diamond_Helmet - - Diamond_Chestplate - - Diamond_Leggings - - Diamond_Boots - - Golden_Helmet - - Golden_Chestplate - - Golden_Leggings - - Golden_Boots - - Iron_Helmet - - Iron_Chestplate - - Iron_Leggings - - Iron_Boots - - Leather_Helmet - - Leather_Chestplate - - Leather_Leggings - - Leather_Boots + - Diamond_Sword + - Diamond_Shovel + - Diamond_Pickaxe + - Diamond_Axe + - Golden_Sword + - Golden_Shovel + - Golden_Pickaxe + - Golden_Axe + - Iron_Sword + - Iron_Shovel + - Iron_Pickaxe + - Iron_Axe + - Stone_Sword + - Stone_Shovel + - Stone_Pickaxe + - Stone_Axe + - Wooden_Sword + - Wooden_Shovel + - Wooden_Pickaxe + - Wooden_Axe + - Bow + - Diamond_Helmet + - Diamond_Chestplate + - Diamond_Leggings + - Diamond_Boots + - Golden_Helmet + - Golden_Chestplate + - Golden_Leggings + - Golden_Boots + - Iron_Helmet + - Iron_Chestplate + - Iron_Leggings + - Iron_Boots + - Leather_Helmet + - Leather_Chestplate + - Leather_Leggings + - Leather_Boots diff --git a/bukkit/src/main/resources/locale/locale_cs_CZ.properties b/bukkit/src/main/resources/locale/locale_cs_CZ.properties index 79daa5e53..2fefdf856 100644 --- a/bukkit/src/main/resources/locale/locale_cs_CZ.properties +++ b/bukkit/src/main/resources/locale/locale_cs_CZ.properties @@ -104,7 +104,7 @@ Herbalism.Ability.GTe.Length=D\u00e9lka trv\u00e1n\u00ed Zelen\u00e9 planety: [[ Herbalism.Ability.GTe.NeedMore=Bude\u0161 pot\u0159ebovat v\u00edc sem\u00ednek pro Green Tera. Herbalism.Ability.GTh.Chance=\u0160ance na dovednost Zahradn\u00edk: [[YELLOW]]{0} Herbalism.Ability.GTh.Fail=**ZAHRADN\u00cdK SELHAL** -Herbalism.Ability.GTh.Stage= Zahradn\u00edk Stage: [[\u017dlut\u00e9]] Plodiny rostou ve st\u00e1diu {0} +Herbalism.Ability.GTh.Stage=Zahradn\u00edk Stage: [[\u017dlut\u00e9]] Plodiny rostou ve st\u00e1diu {0} Herbalism.Ability.GTh=[[GREEN]]**ZAHRADNIK** Herbalism.Ability.HylianLuck=Hylian Luck zm\u011bn\u011bn: [[YELLOW]]{0} Herbalism.Ability.Lower=[[GRAY]]**SKLONIL JSI SVOJI MOTYKU** @@ -292,7 +292,7 @@ Unarmed.Ability.Bonus.1=+{0} Zv\u00fd\u0161en\u00ed zran\u011bn\u00ed Unarmed.Ability.Chance.ArrowDeflect=\u0160ance na vych\u00edlen\u00ed \u0161\u00edpu: [[YELLOW]]{0} Unarmed.Ability.Chance.Disarm=\u0160ance na odzbrojen\u00ed: [[YELLOW]]{0} Unarmed.Ability.Chance.IronGrip=\u0160ance na \u017delezn\u00fd stisk: [[YELLOW]]{0} -Unarmed.Ability.IronGrip.Attacker= Tv\u016fj soupe\u0159 m\u00e1 \u017eelezn\u00e9 sev\u0159en\u00ed! +Unarmed.Ability.IronGrip.Attacker=Tv\u016fj soupe\u0159 m\u00e1 \u017eelezn\u00e9 sev\u0159en\u00ed! Unarmed.Ability.IronGrip.Defender=[[GREEN]]Tv\u016fj \u017eelezny stisk zabr\u00e1nil tomu abys byl odzbrojen! Unarmed.Ability.Lower=[[GRAY]]**SKL\u00c1N\u00cd\u0160 SV\u00c9 P\u011aSTI** Unarmed.Ability.Ready=[[GREEN]]**PRIPRAVIL JSI SVOJE PESTI** @@ -548,7 +548,7 @@ Guides.Available=[[GRAY]]N\u00e1vod k {0} - napi\u0161te /{1} ? [page] Guides.Header=[[GOLD]]-=[[GREEN]]{0} N\u00e1vod[[GOLD]]=- Guides.Page.Invalid=Nespr\u00e1vn\u00e9 \u010d\u00edslo str\u00e1nky! Guides.Page.OutOfRange=Tato str\u00e1nka neexistuje, je tu pouze {0} str\u00e1nek. -Guides.Usage= Pou\u017eit\u00ed je /{0} ? [page] +Guides.Usage=Pou\u017eit\u00ed je /{0} ? [page] Guides.Smelting.Section.0=Ji\u017e brzy... Inspect.Offline=Nem\u00e1\u0161 pr\u00e1va kontrolovat hr\u00e1\u010de co nejsou online! Inspect.OfflineStats=mcMMO Statistiky pro offline hrace [[YELLOW]]{0} diff --git a/bukkit/src/main/resources/locale/locale_cy.properties b/bukkit/src/main/resources/locale/locale_cy.properties index dd6fc8bd6..0f535450c 100644 --- a/bukkit/src/main/resources/locale/locale_cy.properties +++ b/bukkit/src/main/resources/locale/locale_cy.properties @@ -12,7 +12,7 @@ Acrobatics.SubSkill.Roll.Chance=Roll Chance: [[YELLOW]]{0} Acrobatics.SubSkill.Roll.GraceChance=Graceful Roll Chance: [[YELLOW]]{0} Acrobatics.Roll.Text=**Rolled** Acrobatics.SkillName=ACROBATEG -Acrobatics.Skillup= Acrobateg sgil cynyddu {0}. Cyfanswm ({1}) +Acrobatics.Skillup=Acrobateg sgil cynyddu {0}. Cyfanswm ({1}) Archery.Combat.DazeChance=Chance to Daze: [[YELLOW]]{0} Archery.Combat.RetrieveChance=Chance to Retrieve Arrows: [[YELLOW]]{0} Archery.Combat.SkillshotBonus=Skill Shot Bonus Damage: [[YELLOW]]{0} @@ -23,7 +23,7 @@ Archery.SubSkill.ArrowRetrieval.Name=Arrow Retrieval Archery.SubSkill.ArrowRetrieval.Description=Chance to retrieve arrows from corpses Archery.Listener=Archery: Archery.SkillName=ARCHERY -Archery.Skillup= sgiliau Saethyddiaeth cynyddu {0}. Cyfanswm ({1}) +Archery.Skillup=sgiliau Saethyddiaeth cynyddu {0}. Cyfanswm ({1}) Axes.Ability.Bonus.0=Axe Mastery Axes.Ability.Bonus.1=Bonus {0} damage Axes.Ability.Bonus.2=Impact @@ -36,7 +36,7 @@ Axes.Combat.CritStruck=[[DARK_RED]]You were CRITICALLY hit! Axes.Combat.CritChance=Chance to critically strike: [[YELLOW]]{0} Axes.Combat.CriticalHit=CRITICAL HIT! Axes.Combat.GI.Proc=[[GREEN]]**STRUCK WITH GREAT FORCE** -Axes.Combat.GI.Struck= ** ** BRIFO GAN EFFAITH FWYAF +Axes.Combat.GI.Struck=** ** BRIFO GAN EFFAITH FWYAF Axes.Combat.SS.Length=Skull Splitter Length: [[YELLOW]]{0}s Axes.SubSkill.SkullSplitter.Name=Skull Splitter Axes.SubSkill.SkullSplitter.Description=Deal AoE Damage @@ -55,7 +55,7 @@ Axes.Skills.SS.On=actifadu Penglog Llorweddol Axes.Skills.SS.Refresh=[[GREEN]] Eich [[YELLOW]] Penglog Llorweddol [[GREEN]] gallu ei hadnewyddu! Axes.Skills.SS.Other.Off=Skull Splitter[[GREEN]] has worn off for [[YELLOW]]{0} Axes.Skills.SS.Other.On=[[GREEN]] {0} [[DARK_GREEN]] wedi defnyddio [[RED]] Llorweddol Benglog! -Axes.Skillup= sgiliau Echelau cynyddu {0}. Cyfanswm ({1}) +Axes.Skillup=sgiliau Echelau cynyddu {0}. Cyfanswm ({1}) Excavation.Ability.Lower=[[GRAY]]**YOU LOWER YOUR SHOVEL** Excavation.Ability.Ready=[[GREEN]]**YOU READY YOUR SHOVEL** Excavation.SubSkill.GigaDrillBreaker.Name=Giga Drill Breaker @@ -112,10 +112,10 @@ Herbalism.Listener=Meddygaeth lysieuol: Herbalism.SkillName=HERBALISM Herbalism.Skills.GTe.On=[[GREEN]]**GREEN TERRA ACTIVATED** Herbalism.Skills.GTe.Refresh=[[GREEN]] Eich [[YELLOW]] Green Terra [[GREEN]] gallu ei hadnewyddu! -Herbalism.Skills.GTe.Other.Off= Green terra [[GREEN]] wedi gwisgo i ffwrdd ar gyfer [[YELLOW]] {0} +Herbalism.Skills.GTe.Other.Off=Green terra [[GREEN]] wedi gwisgo i ffwrdd ar gyfer [[YELLOW]] {0} Herbalism.Skills.GTe.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Green Terra! Herbalism.Skillup=Herbalism skill increased by {0}. Total ({1}) -Mining.Ability.Length= Hyd Torri\'r Super: [[YELLOW]] {0} s +Mining.Ability.Length=Hyd Torri\'r Super: [[YELLOW]] {0} s Mining.Ability.Locked.0=LOCKED UNTIL {0}+ SKILL (BLAST MINING) Mining.Ability.Locked.1=LOCKED UNTIL {0}+ SKILL (BIGGER BOMBS) Mining.Ability.Locked.2=LOCKED UNTIL {0}+ SKILL (DEMOLITIONS EXPERTISE) @@ -140,9 +140,9 @@ Mining.Skills.SuperBreaker.On=[[GREEN]]**SUPER BREAKER ACTIVATED** Mining.Skills.SuperBreaker.Other.Off=Super Breaker[[GREEN]] has worn off for [[YELLOW]]{0} Mining.Skills.SuperBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Super Breaker! Mining.Skills.SuperBreaker.Refresh=[[GREEN]] Eich [[YELLOW]] Super Torri\'r [[GREEN]] gallu ei hadnewyddu! -Mining.Skillup= sgiliau Mwyngloddio cynyddu {0}. Cyfanswm ({1}) +Mining.Skillup=sgiliau Mwyngloddio cynyddu {0}. Cyfanswm ({1}) Mining.Blast.Boom=[[GRAY]]**BOOM** -Mining.Blast.Radius.Increase= Chwyth Cynnydd Radiws [[YELLOW]] {0} +Mining.Blast.Radius.Increase=Chwyth Cynnydd Radiws [[YELLOW]] {0} Mining.Blast.Rank=Blast Mining: [[YELLOW]] Rank {0}/8 [[GRAY]]({1}) Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Blast Mining! Mining.Blast.Refresh=[[GREEN]] Eich [[YELLOW]] Mwyngloddio Chwyth [[GREEN]] gallu ei hadnewyddu! @@ -182,7 +182,7 @@ Repair.Skills.NotFullDurability=[[DARK_RED]]You can\'t salvage damaged items. Repair.Skills.Mastery=Repair Mastery: [[YELLOW]]Extra {0} durability restored Repair.Skills.StackedItems=[[DARK_RED]]You can\'t repair stacked items. Repair.Skills.Super.Chance=Super Repair Chance: [[YELLOW]]{0} -Repair.Skillup= sgiliau Atgyweirio cynyddu {0}. Cyfanswm ({1}) +Repair.Skillup=sgiliau Atgyweirio cynyddu {0}. Cyfanswm ({1}) Repair.Arcane.Chance.Downgrade=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}% Repair.Arcane.Chance.Success=[[GRAY]] Cyfradd Llwyddiant AF: [[YELLOW]] {0}% Repair.Arcane.Downgrade=Arcane power has decreased for this item. @@ -212,7 +212,7 @@ Swords.SkillName=SWORDS Swords.Skills.SS.Off=**Serrated Strikes has worn off** Swords.Skills.SS.On=[[GREEN]] ** Streiciau danheddog actifadu ** Swords.Skills.SS.Refresh=[[GREEN]]Your [[YELLOW]]Serrated Strikes [[GREEN]]ability is refreshed! -Swords.Skills.SS.Other.Off= Streiciau danheddog [[GREEN]] wedi gwisgo i ffwrdd ar gyfer [[YELLOW]] {0} +Swords.Skills.SS.Other.Off=Streiciau danheddog [[GREEN]] wedi gwisgo i ffwrdd ar gyfer [[YELLOW]] {0} Swords.Skills.SS.Other.On=[[GREEN]] {0} [[DARK_GREEN]] wedi defnyddio [[RED]] Streiciau danheddog! Swords.Skillup=Swords skill increased by {0}. Total ({1}) Swords.SS.Length=Serrated Strikes Length: [[YELLOW]]{0}s @@ -250,14 +250,14 @@ Taming.SubSkill.ThickFur.Description=DMG Reduction, Fire Resistance Taming.Listener.Wolf=[[DARK_GRAY]] Eich sgrialu i blaidd yn \u00f4l i chi ... Taming.Listener=Taming: Taming.SkillName=TAMING -Taming.Skillup= sgiliau Ddofi cynyddu {0}.\u00a0Cyfanswm ({1}) +Taming.Skillup=sgiliau Ddofi cynyddu {0}.\u00a0Cyfanswm ({1}) Taming.Summon.Complete=[[GREEN]]Summoning complete Taming.Summon.Fail.Ocelot=You have too many ocelots nearby to summon any more. Taming.Summon.Fail.Wolf=You have too many wolves nearby to summon any more. Unarmed.Ability.Berserk.Length=Berserk Length: [[YELLOW]]{0}s Unarmed.Ability.Bonus.0=Iron Arm Style Unarmed.Ability.Bonus.1=+{0} DMG Upgrade -Unarmed.Ability.Chance.ArrowDeflect= Saeth wyro cyfle: [[YELLOW]] {0} +Unarmed.Ability.Chance.ArrowDeflect=Saeth wyro cyfle: [[YELLOW]] {0} Unarmed.Ability.Chance.Disarm=Disarm Chance: [[YELLOW]]{0} Unarmed.Ability.IronGrip.Attacker=Your opponent has an iron grip! Unarmed.Ability.IronGrip.Defender=[[GREEN]]Your iron grip kept you from being disarmed! @@ -273,9 +273,9 @@ Unarmed.SubSkill.ArrowDeflect.Name=Arrow Deflect Unarmed.SubSkill.ArrowDeflect.Description=Deflect arrows Unarmed.Listener=Dim Arfau: Unarmed.SkillName=UNARMED -Unarmed.Skills.Berserk.Off= ** arno\\\'i hun wedi gwisgo i ffwrdd ** +Unarmed.Skills.Berserk.Off=** arno\\\'i hun wedi gwisgo i ffwrdd ** Unarmed.Skills.Berserk.On=[[GREEN]]**BERSERK ACTIVATED** -Unarmed.Skills.Berserk.Other.Off= arno\'i hun [[GREEN]] wedi gwisgo i ffwrdd ar gyfer [[YELLOW]] {0} +Unarmed.Skills.Berserk.Other.Off=arno\'i hun [[GREEN]] wedi gwisgo i ffwrdd ar gyfer [[YELLOW]] {0} Unarmed.Skills.Berserk.Other.On=[[GREEN]] {0} [[DARK_GREEN]] wedi defnyddio [[RED]] arno\'i hun! Unarmed.Skills.Berserk.Refresh=[[GREEN]]Your [[YELLOW]]Berserk [[GREEN]]ability is refreshed! Unarmed.Skillup=Unarmed skill increased by {0}. Total ({1}) @@ -295,9 +295,9 @@ Woodcutting.SkillName=Torri coed Woodcutting.Skills.TreeFeller.Off=**Tree Feller has worn off** Woodcutting.Skills.TreeFeller.On=[[GREEN]]**TREE FELLER ACTIVATED** Woodcutting.Skills.TreeFeller.Refresh=[[GREEN]] Eich [[YELLOW]] Feller Coed [[GREEN]] gallu ei hadnewyddu! -Woodcutting.Skills.TreeFeller.Other.Off= Feller Coed [[GREEN]] wedi gwisgo i ffwrdd ar gyfer [[YELLOW]] {0} +Woodcutting.Skills.TreeFeller.Other.Off=Feller Coed [[GREEN]] wedi gwisgo i ffwrdd ar gyfer [[YELLOW]] {0} Woodcutting.Skills.TreeFeller.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Tree Feller! -Woodcutting.Skills.TreeFeller.Splinter= EICH AXE GWAHANU I DDWSINAU O DARNAU! +Woodcutting.Skills.TreeFeller.Splinter=EICH AXE GWAHANU I DDWSINAU O DARNAU! Woodcutting.Skills.TreeFeller.Threshold=That tree is too large! Woodcutting.Skillup=Woodcutting skill increased by {0}. Total ({1}) Ability.Generic.Refresh=[[GREEN]]**ABILITIES REFRESHED!** @@ -321,10 +321,10 @@ Commands.Ability.Off=Ability use toggled [[RED]]off Commands.Ability.On=Ability use toggled [[GREEN]]on Commands.AdminChat.Off=Admin Sgwrs unig [[RED]] Oddi ar Commands.AdminChat.On=Admin Chat only [[GREEN]]On -Commands.AdminToggle= - sgwrs gweinyddol Toggle +Commands.AdminToggle=- sgwrs gweinyddol Toggle Commands.Chat.Console=*Console* -Commands.Disabled= Mae\'r gorchymyn yn anabl. -Commands.DoesNotExist= nid Chwaraewr yn bodoli yn y gronfa ddata! +Commands.Disabled=Mae\'r gorchymyn yn anabl. +Commands.DoesNotExist=nid Chwaraewr yn bodoli yn y gronfa ddata! Commands.GodMode.Disabled=mcMMO Godmode Disabled Commands.GodMode.Enabled=mcMMO Godmode Enabled Commands.GodMode.Forbidden=[mcMMO] God Mode not permitted on this world (See Permissions) @@ -353,9 +353,9 @@ Commands.Party.Accept=- Accept party invite Commands.Party.Chat.Off=Party Chat only [[RED]]Off Commands.Party.Chat.On=Party Chat only [[GREEN]]On Commands.Party.Commands=[[GREEN]]--PARTY COMMANDS-- -Commands.Party.Invite.0= RHYBUDD: [[GREEN]] fod wedi derbyn gwahoddiad i barti {0} o {1} -Commands.Party.Kick= oeddech yn cicio o blaid {0}! -Commands.Party.Leave= Yr ydych wedi gadael y blaid honno +Commands.Party.Invite.0=RHYBUDD: [[GREEN]] fod wedi derbyn gwahoddiad i barti {0} o {1} +Commands.Party.Kick=oeddech yn cicio o blaid {0}! +Commands.Party.Leave=Yr ydych wedi gadael y blaid honno Commands.Party.None=You are not in a party. Commands.Party.Quit=- Leave your current party Commands.Party.Teleport= [[RED]]- Teleport to party member @@ -394,8 +394,8 @@ Party.Owner.NotLeader=[[DARK_RED]]You are no longer the party leader. Party.Owner.Player=[[GREEN]]You are now the party leader. Party.Password.Incorrect=Party password is incorrect. Party.Password.Set=[[GREEN]] Blaid cyfrinair wedi ei osod i {0} -Party.Player.Invalid= Nid yw hynny\'n chwaraewr ddilys. -Party.Teleport.Dead= Ni allwch teleport y chwaraewr yn farw. +Party.Player.Invalid=Nid yw hynny\'n chwaraewr ddilys. +Party.Teleport.Dead=Ni allwch teleport y chwaraewr yn farw. Party.Teleport.Player=[[GREEN]]You have teleported to {0}. Party.Teleport.Self=You can\'t teleport to yourself! Party.Teleport.Target=[[GREEN]] {0} wedi teleported i chi. @@ -429,7 +429,7 @@ Effects.Template=[[DARK_AQUA]]{0}: [[GREEN]]{1} Guides.Available=[[GRAY]]Guide for {0} available - type /{1} ? [page] Guides.Header=[[GOLD]]-=[[GREEN]]{0} Guide[[GOLD]]=- Guides.Page.Invalid=Not a valid page number! -Guides.Usage= Usage is /{0} ? [page] +Guides.Usage=Usage is /{0} ? [page] Inspect.Offline=You do not have permission to inspect offline players! Inspect.OfflineStats=mcMMO Stats for Offline Player [[YELLOW]]{0} Inspect.Stats=[[GREEN]]mcMMO Stats for [[YELLOW]]{0} @@ -441,7 +441,7 @@ Skills.Disarmed=[[DARK_RED]] Rydych wedi cael eich diarfogi! Skills.Header=-----[][[GREEN]]{0}[[RED]][]----- Skills.NeedMore=[[DARK_RED]] y bydd angen mwy o [[GRAY]]{0} Skills.Stats={0}[[GREEN]]{1}[[DARK_AQUA]] XP([[GRAY]]{2}[[DARK_AQUA]]/[[GRAY]]{3}[[DARK_AQUA]]) -Skills.TooTired= Yr ydych yn rhy flinedig i ddefnyddio\'r gallu eto. [[YELLOW]]({0}s) +Skills.TooTired=Yr ydych yn rhy flinedig i ddefnyddio\'r gallu eto. [[YELLOW]]({0}s) Stats.Header.Combat=[GOLD]] - = GWRTHSEFYLL SGILIAU = - Stats.Header.Gathering=[[GOLD]] -= CASGLU SGILIAU = = - Stats.Header.Misc=[[GOLD]]-=MISC SKILLS=- diff --git a/bukkit/src/main/resources/locale/locale_da.properties b/bukkit/src/main/resources/locale/locale_da.properties index 087f11d89..2a5177942 100644 --- a/bukkit/src/main/resources/locale/locale_da.properties +++ b/bukkit/src/main/resources/locale/locale_da.properties @@ -380,7 +380,7 @@ Commands.Usage.Page=side Commands.Usage.Player=spiller Commands.Usage.Skill=Evne Commands.Usage.XP=xp -mcMMO.NoInvites= Du har ingen invitationer p\u00e5 nuv\u00e6rende tidspunkt +mcMMO.NoInvites=Du har ingen invitationer p\u00e5 nuv\u00e6rende tidspunkt mcMMO.NoPermission=[[DARK_RED]]Ikke nok Tilladelser. mcMMO.NoSkillNote=[[DARK_GRAY]]Hvis du ikke har adgang til en evne, vil den evne ikke blive vist her. Party.Forbidden=[mcMMO] grupper er ikke tilladt i denne verden (Se Tilladelser) @@ -430,8 +430,8 @@ Effects.Template=[[DARK_AQUA]]{0}: [[GREEN]]{1} Guides.Available=[[GRAY]]Guide for {0} tilg\u00e6ngelige - skriv /{1} ? [page] Guides.Header=[[GOLD]]-=[[GREEN]]{0} Guide[[GOLD]]=- Guides.Page.Invalid=Ikke et gyldigt side nummer! -Guides.Usage= Korrekt brug er /{0} ? [page] -Inspect.Offline= Du har ikke tilladelse til at inspicere offline spillere! +Guides.Usage=Korrekt brug er /{0} ? [page] +Inspect.Offline=Du har ikke tilladelse til at inspicere offline spillere! Inspect.OfflineStats=mcMMO Stats for Offline Spillere [[YELLOW]]{0} Inspect.Stats=[[GREEN]]mcMMO F\u00e6rdigheder for [[YELLOW]]{0} Inspect.TooFar=Du er for langt v\u00e6k til at inspicere denne spiller! diff --git a/bukkit/src/main/resources/locale/locale_de.properties b/bukkit/src/main/resources/locale/locale_de.properties index 722c69880..10b051723 100644 --- a/bukkit/src/main/resources/locale/locale_de.properties +++ b/bukkit/src/main/resources/locale/locale_de.properties @@ -30,7 +30,6 @@ #Giga Bohrhammer in Giga Bohrer umbenannt. #Added Guides.Smelting.Section.1 # --Lumis31 - #ACROBATICS Acrobatics.Ability.Proc=[[GREEN]]**Grazi\u00f6s Abgerollt** Acrobatics.Combat.Proc=[[GREEN]]**Ausgewichen** @@ -47,7 +46,6 @@ Acrobatics.SubSkill.Roll.GraceChance=Grazi\u00f6se Rolle-Chance: [[YELLOW]]{0} Acrobatics.Roll.Text=**Abgerollt** Acrobatics.SkillName=AKROBATIK Acrobatics.Skillup=Akrobatik Skill um {0} gestiegen. Gesamt ({1}) - #ALCHEMY Alchemy.SubSkill.Catalysis.Name=Katalyse Alchemy.SubSkill.Catalysis.Description=Erh\u00F6ht die Braugeschwindigkeit @@ -60,7 +58,6 @@ Alchemy.Concoctions.Rank=Braukunst Rang: [[YELLOW]]{0}/{1} Alchemy.Concoctions.Ingredients=Zutaten [[[YELLOW]]{0}[[RED]]]: [[YELLOW]]{1} Alchemy.SkillName=ALCHEMIE Alchemy.Skillup=Alchemie Skill um {0} gestiegen. Gesamt ({1}) - #ARCHERY Archery.Combat.DazeChance=Chance auf Bet\u00e4ubung: [[YELLOW]]{0} Archery.Combat.RetrieveChance=Chance auf Pfeil-R\u00fcckgewinnung: [[YELLOW]]{0} @@ -74,7 +71,6 @@ Archery.SubSkill.ArrowRetrieval.Description=Chance auf Pfeil-R\u00fcckgewinnung Archery.Listener=Bogen: Archery.SkillName=BOGEN Archery.Skillup=Bogenschie\u00DFen Fertigkeit ist um {0} gestiegen. Gesamt ({1}) - #AXES Axes.Ability.Bonus.0=Axt-Beherrschung Axes.Ability.Bonus.1={0} Zusatz-Schaden @@ -109,7 +105,6 @@ Axes.Skills.SS.Refresh=[[GREEN]]Dein [[YELLOW]]Sch\u00e4del-Spalter [[GREEN]]ist Axes.Skills.SS.Other.Off={0}s [[RED]]Sch\u00e4del-Spalter[[GREEN]] ist [[GREEN]]abgenutzt Axes.Skills.SS.Other.On=[[GREEN]]{0}[[DARK_GREEN]] benutzte [[RED]]Sch\u00e4del-Spalter! Axes.Skillup=Axt Skill um {0} gestiegen. Gesamt ({1}) - #EXCAVATION Excavation.Ability.Lower=[[GRAY]]**Du senkst deine SCHAUFEL** Excavation.Ability.Ready=[[GREEN]]**Deine SCHAUFEL ist bereit** @@ -126,7 +121,6 @@ Excavation.Skills.GigaDrillBreaker.Refresh=[[GREEN]]Dein [[YELLOW]]Giga Bohrer [ Excavation.Skills.GigaDrillBreaker.Other.Off={0}s [[RED]]Giga Bohrer[[GREEN]] ist [[GREEN]]ausgelaufen Excavation.Skills.GigaDrillBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]] benutzte [[RED]]Giga Bohrer! Excavation.Skillup=Graben Skill um {0} gestiegen. Gesamt ({1}) - #FISHING Fishing.Ability.Chance=Anbei\u00DFwahrscheinlichkeit: [[YELLOW]]{0} Fishing.Ability.Info=Zauber-J\u00e4ger: [[GRAY]] **Verbessert sich mit Schatz-J\u00e4ger Rang** @@ -134,7 +128,7 @@ Fishing.Ability.Locked.0=GESPERRT bis Skill {0}+ (Rei\u00DFen) Fishing.Ability.Locked.1=GESPERRT bis Skill {0}+ (Eisangeln) Fishing.Ability.Locked.2=GESPERRT bis Skill {0}+ (Profiangel) Fishing.Ability.Rank=Schatz-J\u00e4ger Rang: [[YELLOW]]{0}/{1} -Fishing.Ability.TH.DropRate= Drop Rate: [[DARK_RED]]Falle: [[YELLOW]]{0} [[GRAY]]Oft: [[YELLOW]]{1} [[GREEN]]Gelegentlich: [[YELLOW]]{2}\n[[BLUE]]Au\u00DFergew\u00F6hnlich: [[YELLOW]]{3} [[LIGHT_PURPLE]]Selten: [[YELLOW]]{4} [[GOLD]]Schatz: [[YELLOW]]{5} [[AQUA]]Schallplatte: [[YELLOW]]{6} +Fishing.Ability.TH.DropRate=Drop Rate: [[DARK_RED]]Falle: [[YELLOW]]{0} [[GRAY]]Oft: [[YELLOW]]{1} [[GREEN]]Gelegentlich: [[YELLOW]]{2}\n[[BLUE]]Au\u00DFergew\u00F6hnlich: [[YELLOW]]{3} [[LIGHT_PURPLE]]Selten: [[YELLOW]]{4} [[GOLD]]Schatz: [[YELLOW]]{5} [[AQUA]]Schallplatte: [[YELLOW]]{6} Fishing.Ability.TH.MagicRate=Zauber-J\u00e4ger Chance: [[YELLOW]]{0} Fishing.Ability.Shake=Rei\u00DFen-Chance: [[YELLOW]]{0} Fishing.Ability.IceFishing=Eisangeln: Angeln im Eis @@ -158,7 +152,6 @@ Fishing.Ability.TH.Boom=[[GRAY]]KARPADOR SETZT PLATSCHER EIN!!! Fishing.Ability.TH.Poison=[[GRAY]]Hier stinkt etwas... Fishing.SkillName=ANGELN Fishing.Skillup=Angel Skill um {0} gestiegen. Gesamt ({1}) - #HERBALISM Herbalism.Ability.DoubleDropChance=Chance auf Doppel-Drops: [[YELLOW]]{0} Herbalism.Ability.FD=Bauernfr\u00fchst\u00fcck: [[YELLOW]]Stufe {0} @@ -195,7 +188,6 @@ Herbalism.Skills.GTe.Refresh=[[GREEN]]Deine [[YELLOW]]Gr\u00fcnes Land [[GREEN]] Herbalism.Skills.GTe.Other.Off={0}s [[RED]]Gr\u00fcnes Land[[GREEN]] ist [[GREEN]]ausgelaufen. Herbalism.Skills.GTe.Other.On=[[GREEN]]{0}[[DARK_GREEN]] benutzte [[RED]]Gr\u00fcnes Land! Herbalism.Skillup=Pflanzenkunde Skill um {0} gestiegen. Gesamt ({1}) - #MINING Mining.Ability.Length=Super-Brecher Dauer: [[YELLOW]]{0}s Mining.Ability.Locked.0=GESPERRT bis Skill {0}+ (Z\u00fcndstoff) @@ -223,7 +215,6 @@ Mining.Skills.SuperBreaker.Other.Off={0}s [[RED]]Super-Brecher[[GREEN]] ist [[GR Mining.Skills.SuperBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]] benutzte [[RED]]Super-Brecher! Mining.Skills.SuperBreaker.Refresh=[[GREEN]]Dein [[YELLOW]]Super-Brecher [[GREEN]]ist wieder bereit! Mining.Skillup=Bergbau Fertigkeit ist um {0} gestiegen. Gesamt ({1}) - #Blast Mining Mining.Blast.Boom=[[GRAY]]**BOOM** Mining.Blast.Effect=+{0} Erze -{1} Schutt, {2}x Drops @@ -231,7 +222,6 @@ Mining.Blast.Radius.Increase=Z\u00fcndstoff Radius Erh\u00f6hung: [[YELLOW]]+{0} Mining.Blast.Rank=Z\u00fcndstoff Rang:[[YELLOW]] {0}/8 [[GRAY]]({1}) Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] benutzte [[RED]]Z\u00fcndstoff! Mining.Blast.Refresh=[[GREEN]]Dein [[YELLOW]]Z\u00fcndstoff [[GREEN]]ist wieder bereit! - #REPAIR Repair.SubSkill.Repair.Name=Reparatur Repair.SubSkill.Repair.Description=Repariere Werkzeuge & R\u00fcstung @@ -265,7 +255,6 @@ Repair.Skills.StackedItems=[[DARK_RED]]Du kannst keine gestapelten Gegenst\u00e4 Repair.Skills.Super.Chance=Super-Reparatur Chance: [[YELLOW]]{0} Repair.Skillup=Reparatur Skill um {0} gestiegen. Gesamt ({1}) Repair.Pretty.Name=Reparatur - #Arcane Forging Repair.Arcane.Chance.Downgrade=[[GRAY]]AS Verminderungs Chance: [[YELLOW]]{0}% Repair.Arcane.Chance.Success=[[GRAY]]AS Erfolgs-Rate: [[YELLOW]]{0}% @@ -274,7 +263,6 @@ Repair.Arcane.Fail=Der Gegenstands wurde entzaubert. Repair.Arcane.Lost=Du hast nicht gen\u00fcgend Skill um Verzauberungen zu erhalten. Repair.Arcane.Perfect=[[GREEN]]Du hast den Zauber-Wert des Gegenstands erhalten. Repair.Arcane.Rank=Arkanes Schmieden Rang: [[YELLOW]]{0}/{1} - #SALVAGE Salvage.Pretty.Name=Verwerten Salvage.SubSkill.AdvancedSalvage.Name=Fortgeschrittenes Verwerten @@ -297,7 +285,6 @@ Salvage.Skills.ArcaneSuccess=[[GREEN]]Du konntest alles Wissen aus diesem Item e Salvage.Listener.Anvil=[[DARK_RED]]Du hast einen Verwertungs-Amboss platziert, benutze ihn um Werkzeuge und R\u00FCstung zu verwerten. Salvage.Listener=Verwerten: Salvage.SkillName=VERWERTEN - #SWORDS Swords.Ability.Lower=[[GRAY]]**Du senkst dein SCHWERT** Swords.Ability.Ready=[[GREEN]]**Dein SCHWERT ist bereit** @@ -328,7 +315,6 @@ Swords.Skills.SS.Other.Off={0}s [[RED]]S\u00e4gezahnschlag[[GREEN]] ist [[GREEN] Swords.Skills.SS.Other.On=[[GREEN]]{0}[[DARK_GREEN]] benutzte [[RED]]S\u00e4gezahnschlag! Swords.Skillup=Schwert Skill um {0} gestiegen. Gesamt ({1}) Swords.SS.Length=S\u00e4gezahnschlag Dauer: [[YELLOW]]{0}s - #TAMING Taming.Ability.Bonus.0=Umweltbewusst Taming.Ability.Bonus.1=W\u00f6lfe weichen Gefahren aus @@ -373,13 +359,12 @@ Taming.Listener=Z\u00e4hmen: Taming.SkillName=Z\u00c4HMEN Taming.Skillup=Z\u00e4hhmen Skill um {0} gestiegen. Gesamt ({1}) Taming.Summon.Complete=[[GREEN]]Beschw\u00f6rung abgeschlossen -Taming.Summon.Lifespan= (Lebenszeit: {0}s) +Taming.Summon.Lifespan=(Lebenszeit: {0}s) Taming.Summon.Fail.Ocelot=Du hast zu viele Ozelots um dich, um weitere zu beschw\u00f6ren. Taming.Summon.Fail.Wolf=Du hast zu viele W\u00f6lfe um dich, um weitere zu beschw\u00f6ren. Taming.Summon.Fail.Horse=Du hast zu viele Pferde um dich, um weitere zu beschw\u00f6ren. Taming.Summon.Fail.TooMany=Du hast das Maximum an beschworenen Tieren erreicht [[YELLOW]]({0}) Taming.Summon.Name.Format={0}''s {1} - #UNARMED Unarmed.Ability.Berserk.Length=Berserker Dauer: [[YELLOW]]{0}s Unarmed.Ability.Bonus.0=Eiserner Arm @@ -409,7 +394,6 @@ Unarmed.Skills.Berserk.Other.Off={0}s [[RED]]Berserker[[GREEN]] ist [[GREEN]]aus Unarmed.Skills.Berserk.Other.On=[[GREEN]]{0}[[DARK_GREEN]] benutzte [[RED]]Berserker! Unarmed.Skills.Berserk.Refresh=[[GREEN]]Dein [[YELLOW]]Berserker [[GREEN]]ist wieder bereit! Unarmed.Skillup=Unbewaffnet Skill um {0} gestiegen. Gesamt ({1}) - #WOODCUTTING Woodcutting.Ability.0=Bl\u00e4ttersturm Woodcutting.Ability.1=Bl\u00e4st Bl\u00e4tter davon @@ -432,13 +416,11 @@ Woodcutting.Skills.TreeFeller.Other.On=[[GREEN]]{0}[[DARK_GREEN]] benutzte [[RED Woodcutting.Skills.TreeFeller.Splinter=Deine Axt zersplittert in tausend kleine Teile! Woodcutting.Skills.TreeFeller.Threshold=Dieser Baum ist zu gro\u00DF! Woodcutting.Skillup=Holzf\u00e4ller Skill um {0} gestiegen. Gesamt ({1}) - #ABILITIY ##generic Ability.Generic.Refresh=[[GREEN]]**F\u00e4higkeit wieder BEREIT!** Ability.Generic.Template.Lock=[[GRAY]]{0} Ability.Generic.Template=[[GOLD]]{0}: [[DARK_AQUA]]{1} - #COMBAT Combat.ArrowDeflect=[[WHITE]]**Pfeil ABGELENKT** Combat.BeastLore=[[GREEN]]**BESTIENKUNDE** @@ -448,7 +430,6 @@ Combat.Gore=[[GREEN]]**AUFGESCHLITZT** Combat.StruckByGore=**du wurdest AUFGESCHLITZT** Combat.TargetDazed=Ziel wurde [[DARK_RED]]BET\u00c4UBT Combat.TouchedFuzzy=[[DARK_RED]]Ungl\u00fccklich ber\u00fchrt. Schwindelgef\u00fchl. - #COMMANDS ##generic mcMMO.Description=[[DARK_AQUA]]\u00DCber das [[YELLOW]]mcMMO[[DARK_AQUA]] Projekt: [[GOLD]]mcMMO ist ein [[RED]]open source[[GOLD]] RPG mod der im Februar 2011,[[GOLD]]von [[BLUE]]com.gmail.nossr50[[GOLD]] erstellt wurde. Ziel ist es eine gute RPG Erfahrung zu vermitteln.,[[DARK_AQUA]]Tipps:,[[GOLD]] - [[GREEN]]Benutz [[RED]]/mcmmo help[[GREEN]] um Befehle zu sehen,[[GOLD]] - [[GREEN]]Tippe [[RED]]/SKILLNAME[[GREEN]] um detaillierte Skillinformationen zu sehen,[[DARK_AQUA]]Entwickler:,[[GOLD]] - [[GREEN]]com.gmail.nossr50 [[BLUE]](Gr\u00FCnder),[[GOLD]] - [[GREEN]]GJ [[BLUE]](Projektleitung),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](Entwickler),[[GOLD]] - [[GREEN]]bm01 [[BLUE]](Entwickler),[[GOLD]] - [[GREEN]]TfT_02 [[BLUE]](Entwickler),[[GOLD]] - [[GREEN]]Glitchfinder [[BLUE]](Entwickler),[[GOLD]] - [[GREEN]]t00thpick1 [[BLUE]](Entwickler),[[GOLD]] - [[GREEN]]lumis31 [[BLUE]](Deutsche \u00DCbersetzung), [[DARK_AQUA]]N\u00FCtzliche Links:,[[GOLD]] - [[GREEN]]https://github.com/mcMMO-Dev/mcMMO/issues[[GOLD]] Bug Reporting,[[GOLD]] - [[GREEN]]#mcmmo @ irc.esper.net[[GOLD]] IRC Chat, @@ -471,7 +452,7 @@ Commands.Cooldowns.Row.Y=\ [[AQUA]]{0}[[WHITE]] - [[DARK_GREEN]]Bereit! Commands.Database.Cooldown=Du musst 1 Sekunde warten bevor du diesen Befehl erneut verwenden darfst. Commands.Database.Processing=Dein vorheriger Befehl wird noch verarbeitet. Bitte warten. Commands.Disabled=Dieser Befehl ist deaktiviert. -Commands.DoesNotExist= [[RED]]Spieler in Datenbank nicht vorhanden! +Commands.DoesNotExist=[[RED]]Spieler in Datenbank nicht vorhanden! Commands.GodMode.Disabled=mcMMO Godmode deaktiviert Commands.GodMode.Enabled=mcMMO Godmode aktiviert Commands.GodMode.Forbidden=[mcMMO] Der Godmode ist in dieser Welt nicht erlaubt(Siehe Permissions) @@ -557,7 +538,7 @@ Commands.Party.Alliance.Invite.Accepted=[[GREEN]]B\u00FCndnis Anfrage angenommen Commands.Party.Alliance.None=Deine Party hat keine Verb\u00FCndeten. Commands.Party.Alliance.AlreadyAllies=Deine Party ist bereits in einem B\u00FCndnis. Trenne mit[[DARK_AQUA]]/party alliance disband Commands.Party.Alliance.Help.0=Diese Party ist in keinem B\u00FCndnis. Lade einen Party Anf\u00FChrer an. -Commands.Party.Alliance.Help.1= um zu verb\u00FCnden [[DARK_AQUA]]/party alliance invite [[RED]]. +Commands.Party.Alliance.Help.1=um zu verb\u00FCnden [[DARK_AQUA]]/party alliance invite [[RED]]. Commands.ptp.Enabled=Party Teleport [[GREEN]]aktiviert Commands.ptp.Disabled=Party Teleport [[RED]]deaktiviert Commands.ptp.NoRequests=Du hast aktuell keine teleportanfragen. @@ -606,7 +587,6 @@ Commands.Usage.XP=xp mcMMO.NoInvites=Du hast zurzeit keine Einladungen mcMMO.NoPermission=[[DARK_RED]]Unzureichende Berechtigungen. mcMMO.NoSkillNote=[[DARK_GRAY]]Wenn du keinen Zugriff auf einen Skill hast wird er hier nicht angezeigt. - ##party Party.Forbidden=[mcMMO] Parties not permitted on this world (See Permissions) Party.Help.0=Proper usage is [[DARK_AQUA]]{0} [password]. @@ -633,7 +613,7 @@ Party.NotOwner=[[DARK_RED]]You are not the party leader. Party.Target.NotOwner=[[DARK_RED]]{0} is not the party leader. Party.Owner.New=[[GREEN]]{0} is the new party leader. Party.Owner.NotLeader=[[DARK_RED]]You are no longer the party leader. -Party.Owner.Player =[[GREEN]]You are now the party leader. +Party.Owner.Player=[[GREEN]]You are now the party leader. Party.Password.None=This party is password protected. Please provide a password to join. Party.Password.Incorrect=Party password is incorrect. Party.Password.Set=[[GREEN]]Party password set to {0} @@ -683,7 +663,6 @@ Party.ItemShare.Category.Mining=Mining Party.ItemShare.Category.Herbalism=Herbalism Party.ItemShare.Category.Woodcutting=Woodcutting Party.ItemShare.Category.Misc=Misc - ##xp Commands.XPGain.Acrobatics=Fallen Commands.XPGain.Alchemy=Tr\u00E4nke brauen @@ -710,27 +689,23 @@ Commands.xprate.proper.2=Bitte spezifiziere mit true/false ob dies ein XP-Event Commands.xprate.started.0=[[GOLD]]Das XP EVENT f\u00fcr mcMMO hat BEGONNEN! Commands.xprate.started.1=[[GOLD]]Die mcMMO XP RATE liegt nun bei {0}x! XPRate.Event=[[GOLD]]mcMMO hat gerade ein XP-RATE Event. Derzeitige XP Rate: {0}x! - #EFFECTS ##generic Effects.Effects=EFFEKTE Effects.Child=[[DARK_GRAY]]LVL: [[GREEN]]{0} Effects.Level=[[DARK_GRAY]]LVL: [[GREEN]]{0} [[DARK_AQUA]]XP[[YELLOW]]([[GOLD]]{1}[[YELLOW]]/[[GOLD]]{2}[[YELLOW]]) -Effects.Parent= [[GOLD]]{0} - +Effects.Parent=[[GOLD]]{0} - Effects.Template=[[DARK_AQUA]]{0}: [[GREEN]]{1} - #GUIDES Guides.Available=[[GRAY]]Anleitung f\u00FCr {0} vorhanden - tippe /{1} ? [Seite] Guides.Header=[[GOLD]]-=[[GREEN]]{0} Anleitung[[GOLD]]=- Guides.Page.Invalid=Keine g\u00FCltige Seitenzahl! Guides.Page.OutOfRange=Es gibt nur insgesamt {0} Seiten. -Guides.Usage= Der Befehl ist /{0} ? [Seite] - +Guides.Usage=Der Befehl ist /{0} ? [Seite] ##Acrobatics Guides.Acrobatics.Section.0=[[DARK_AQUA]]\u00DCber Akrobatik:\n[[YELLOW]]Akrobatik ist die Kunst sich grazi\u00F6s fortzubewegen.\n[[YELLOW]]Fall- und Kampfschaden werden reduziert\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]XP sammelst du indem du in K\u00E4mpfen\n[[YELLOW]]ausweichst, oder St\u00FCrze aus gro\u00DFen H\u00F6hen \u00FCberlebst. Guides.Acrobatics.Section.1=[[DARK_AQUA]]Wie funktioniert Rollen?\n[[YELLOW]]Ab und zu rollst du beim Fallen ab und der Fallschaden wird\n[[YELLOW]]reduziert. Wenn du den Schleichen Knopf w\u00E4hrend dem Fallen\n[[YELLOW]]h\u00E4ltst, verdoppelt sich die Wahrscheinlichkeit abzurollen.\n[[YELLOW]]In dem Fall rollst du grazi\u00F6s ab.\n[[YELLOW]]Grazi\u00F6se Rollen sind gleich wie normale Rollen, nur dass\n[[YELLOW]]sie \u00F6fter passieren und damit mehr Schutz vor St\u00FCrzen\n[[YELLOW]]liefern. Guides.Acrobatics.Section.2=[[DARK_AQUA]]Wie funktioniert Ausweichen?\n[[YELLOW]]Ausweichen ist eine passive F\u00E4higkeit\n[[YELLOW]]die ab und zu den Schaden in K\u00E4mpfen halbiert.\n[[YELLOW]]Die Wahrscheinlichkeit auszuweichen ist abh\u00E4ngig vom \n[[YELLOW]]Akrobatiklevel. - ##Alchemy Guides.Alchemy.Section.0=[[DARK_AQUA]]\u00DCber Alchemie:\n[[YELLOW]]In Alchemie musst du Tr\u00E4nke brauen.\n[[YELLOW]]Mit h\u00F6herem Level werden die Tr\u00E4nke schneller\n[[YELLOW]]gebraut und neue Zutaten f\u00FCr zun\u00E4chst unerh\u00E4ltliche Tr\u00E4nke \n[[YELLOW]]freigeschaltet.\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Tr\u00E4nke brauen. Guides.Alchemy.Section.1=[[DARK_AQUA]]Wie funktioniert Katalyse?\n[[YELLOW]]Katalyse beschleunigt das Brauen von Tr\u00E4nken bis\n[[YELLOW]]zu 4-facher Geschwindigkeit bei Level 1000.\n[[YELLOW]] @@ -739,14 +714,12 @@ Guides.Alchemy.Section.3=[[DARK_AQUA]]Braukunst Tier 1 Zutaten:\n[[YELLOW]]Lohne Guides.Alchemy.Section.4=[[DARK_AQUA]]Braukunst Tier 2 Zutaten:\n[[YELLOW]]Karotte (Eile)\n[[YELLOW]]Schleimball (Langsamkeit)\n\n[[DARK_AQUA]]Braukunst Tier 3 Zutaten:\n[[YELLOW]]Quarz (Absoption)\n[[YELLOW]]Roter Pilz (Springen) Guides.Alchemy.Section.5=[[DARK_AQUA]]Braukunst Tier 4 Zutaten:\n[[YELLOW]]Apfel (Gesundheitsboost)\n[[YELLOW]]Verrottetes Fleisch (Hunger)\n\n[[DARK_AQUA]]Braukunst Tier 5 Zutaten:\n[[YELLOW]]Brauner Pilz(\u00DCbelkeit)\n[[YELLOW]]Tintensack (Blindheit) Guides.Alchemy.Section.6=[[DARK_AQUA]]Braukunst Tier 6 Zutaten:\n[[YELLOW]]Gras (S\u00E4ttigung)\n\n[[DARK_AQUA]]Braukunst Tier 7 Zutaten:\n[[YELLOW]]Giftige Kartoffel(Verwesung)\n\n[[DARK_AQUA]]Braukunst Tier 8 Zutaten:\n[[YELLOW]]Normaler Goldener Apfel (Resistenz) - ##Archery Guides.Archery.Section.0=[[DARK_AQUA]]\u00DCber Bogenschie\u00DFen:\n[[YELLOW]]In Bogenschie\u00DFen geht es um die Verwendung von Pfeil und\n[[YELLOW]]Bogen.\n\n[[YELLOW]]Es gibt unterschiedliche Kampfboni, wie Zusatzschaden,\n[[YELLOW]]der mit dem Level steigt und der F\u00E4higkeit Feinde im PVP\n[[YELLOW]]zu bet\u00E4uben. Zus\u00E4tzlich kannst du einige verschossene\n[[YELLOW]]Pfeile aus den Leichen deiner Feinde wiedergewinnen. Guides.Archery.Section.1=[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]XP erh\u00E4ltst du durch das Abschie\u00DFen von Monstern und\n[[YELLOW]]anderen Spielern. Guides.Archery.Section.2=[[DARK_AQUA]]Wie funktioniert der Kunstschuss?\n[[YELLOW]]Kunstschuss erh\u00F6ht den Schaden deines Schusses.\n[[YELLOW]]Der Zusatzschaden steigt mit deinem Bogen Level.\n[[YELLOW]]In den Standardeinstellungen steigt der Schaden um 10%\n[[YELLOW]]alle 50 Level, mit einem Maximum von 200% extra. Guides.Archery.Section.3=[[DARK_AQUA]]Wie Funktioniert Bet\u00E4ubung?\n[[YELLOW]]Du hast eine passive Wahrscheinlichkeit andere Spieler\n[[YELLOW]]zu bet\u00E4uben wenn du sie anschie\u00DFt. Der Spieler wird\n[[YELLOW]]gezwungen f\u00FCr eine kurze Weile senkrecht nach oben zu\n[[YELLOW]]schauen.\n[[YELLOW]]Ein Bet\u00E4ubungsschuss f\u00FCgt au\u00DFerdem 4 Schadenspunkte \n[[YELLOW]](2 Herzen) extra zu. Guides.Archery.Section.4=[[DARK_AQUA]]Wie funktioniert die Pfeilr\u00FCckgewinnung?\n[[YELLOW]]Du hast eine passive Wahrscheinlichkeit einige Pfeile\n[[YELLOW]]zur\u00FCckzubekommen wenn du Monster mit dem Bogen t\u00F6test.\n[[YELLOW]]Die Wahrscheinlichkeit steigt mit dem Bogen Level.\n[[YELLOW]]Standardm\u00E4\u00DFig steigt diese F\u00E4higkeit um 0.1% pro Level, bis\n[[YELLOW]]100% bei Level 1000. - ##Axes Guides.Axes.Section.0=[[DARK_AQUA]]\u00DCber Axt:\n[[YELLOW]]Mit dem Axt Skill kannst du die Axt f\u00FCr viel mehr als\n[[YELLOW]]nur abholzen verwenden! Du kannst Monster und Spieler\n[[YELLOW]]sprichw\u00F6rtlich weghacken und ihnen t\u00F6dliche\n[[YELLOW]]Schl\u00E4ge verpassen oder sie zur\u00FCckweichen lassen\n[[YELLOW]]Deine Axt zerst\u00F6rt au\u00DFerdem sehr gut R\u00FCstungen,\n[[YELLOW]]was mit h\u00F6herem Level noch mehr ansteigt. Guides.Axes.Section.1=[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Um XP zu bekommen musst du Spieler oder Monster \n[[YELLOW]]mit einer Axt schlagen. @@ -755,7 +728,6 @@ Guides.Axes.Section.3=[[DARK_AQUA]]Wie funktionieren kritische Treffer?\n[[YELLO Guides.Axes.Section.4=[[DARK_AQUA]]Wie funktioniert die Axt-Beherrschung?\n[[YELLOW]]Axt Beherrschung ist eine passive F\u00E4higkeit die deinen\n[[YELLOW]]Axt-Schl\u00E4gen Zusatzschaden hinzuf\u00FCgt.\n[[YELLOW]]Standardm\u00E4\u00DFig steigt der Schaden um 1 alle 50 Level,\n[[YELLOW]]maximal auf 4 Extraschaden bei Level 200. Guides.Axes.Section.5=[[DARK_AQUA]]Wie funktioniert Wucht?\n[[YELLOW]]Schlage m\u00E4chtig zu und zerst\u00F6re R\u00FCstungen!\n[[YELLOW]]Wucht hat eine passive Wahrscheinlichkeit gegnerische\n[[YELLOW]]R\u00FCstung zu besch\u00E4digen. Dieser Schaden steigt mit deinem Axt\n[[YELLOW]]Level. Guides.Axes.Section.6=[[DARK_AQUA]]Wie funktioniert der Wucht-Schlag?\n[[YELLOW]]Du hast eine passive Chance Monster und\n[[YELLOW]]Spieler beim Schlag zur\u00FCckweichen zu lassen\n[[YELLOW]]Standardm\u00E4\u00DFig ist die Wahrscheinlichkeit 25%\n[[YELLOW]]Zus\u00E4tzlich f\u00FCgst du Zusatzschaden zu. - ##Excavation Guides.Excavation.Section.0=[[DARK_AQUA]]\u00DCber Graben:\n[[YELLOW]]Graben ist die F\u00E4higkeit Sch\u00E4tze im Dreck zu finden.\n[[YELLOW]]Durch Aufgraben des Landes wirst du Sch\u00E4tze finden\n[[YELLOW]]Je l\u00E4nger du das tust, desto mehr Sch\u00E4tze findest du.\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]XP erh\u00E4ltst du durch Schaufeln.\n[[YELLOW]]Nur bestimmte Materialen geben XP und Sch\u00E4tze. Guides.Excavation.Section.1=[[DARK_AQUA]]Kompatible Materialien:\n[[YELLOW]]Gras, Erde, Sand, Lehm, Kies, Myzel, Seelensand, Schnee @@ -764,7 +736,6 @@ Guides.Excavation.Section.3=[[DARK_AQUA]]Was ist der Giga Bohrer?\n[[YELLOW]]Gig Guides.Excavation.Section.4=[[DARK_AQUA]]Wie funktioniert der Schatz J\u00E4ger?\n[[YELLOW]]Jeder m\u00F6gliche Schatz hat seine eigene Level Voraussetzung\n[[YELLOW]]um zu erscheinen, folglich ist es schwer[[YELLOW]]zu sagen inwiefern es \n[[YELLOW]]dir hilft ein höheres Level zu haben.\n[[YELLOW]]Je h\u00F6her das Level, desto mehr Sch\u00E4tze k\u00F6nnen gefunden\n[[YELLOW]]werden. Guides.Excavation.Section.5=Beachte au\u00DFerdem, dass jedes kompatible Material seine\n[[YELLOW]]eigenen einzigartigen Sch\u00E4tze hat.\n[[YELLOW]]Anders ausgedr\u00FCckt: Sch\u00E4tze die du in Kies findest\n[[YELLOW]]gibt es nicht zwingend in Erde. Guides.Excavation.Section.6=[[DARK_AQUA]]Bemerkung zu Graben:\n[[YELLOW]]Graben Drops sind vollkommen anpassbar\n[[YELLOW]]Ergebnisse unterscheiden sich deshalb von Server zu Server. - ##Fishing Guides.Fishing.Section.0=[[DARK_AQUA]]\u00DCber Angeln:\n[[YELLOW]]Mit dem Angeln Skill ist Angeln wieder aufregend!\n[[YELLOW]]Finde versteckte Sch\u00E4tze oder Rei\u00DFe Items von Monstern.\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Fang Fische. Guides.Fishing.Section.1=[[DARK_AQUA]]Wie funktioniert der Schatz J\u00E4ger?\n[[YELLOW]]Mit dieser F\u00E4higkeit kannst du beim Angeln Sch\u00E4tze finden.\n[[YELLOW]]Diese k\u00F6nnen sogar verzaubert sein!\n[[YELLOW]]Jeder m\u00F6gliche Schatz kann mit jedem Level gefunden\n[[YELLOW]]werden. Die H\u00E4ufigkeit h\u00E4ngt von dem Wert des Items ab.\n[[YELLOW]]Je h\u00F6her der Angeln Skill ist, desto einfacher wird es\n[[YELLOW]]wertvolle Sch\u00E4tze zu finden. @@ -773,7 +744,6 @@ Guides.Fishing.Section.3=[[DARK_AQUA]]Wie funktioniert die Profiangel?\n[[YELLOW Guides.Fishing.Section.4=[[DARK_AQUA]]Wie funktioniert Rei\u00DFen?\n[[YELLOW]]Diese F\u00E4higkeit erm\u00F6glich es Monstern Items zu entrei\u00DFen,\n[[YELLOW]]indem du sie an deine Angel h\u00E4ngst. \n[[YELLOW]]Die Monster lassen das Item, das sie normalerweise beim Tod\n[[YELLOW]]fallen lassen fallen.\n[[YELLOW]]Au\u00DFerdem gibt es eine kleine Wahrscheinlichkeit Monstersch\u00E4del\n[[YELLOW]]zu bekommen. Guides.Fishing.Section.5=[[DARK_AQUA]]Wie funktioniert die Fischer-Mahlzeit?\n[[YELLOW]]Du wirst beim Essen von Fisch besser satt. Guides.Fishing.Section.6=[[DARK_AQUA]]Bemerkung zum Angeln:\n[[YELLOW]]Angeln Drops sind vollkommen anpassbar.\n[[YELLOW]]Ergebnisse unterscheiden sich deshalb von Server zu Server. - ##Herbalism Guides.Herbalism.Section.0=[[DARK_AQUA]]\u00DCber Pflanzenkunde\n[[YELLOW]]In Pflanzenkunde geht es um das Ernten.\n\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Ernte Pflanzen. Guides.Herbalism.Section.1=[[DARK_AQUA]]Kompatible Blocks\n[[YELLOW]]Weizen, Kartoffeln, Karotten, Melonen, K\u00FCrbisse,\n[[YELLOW]]Zuckerrohr, Kakaobohnen, Blumen, Kakteen,\n[[YELLOW]]Pilze, Netherwarzen, Seerosen und Ranken. @@ -783,7 +753,6 @@ Guides.Herbalism.Section.4=[[DARK_AQUA]]Wie funktioniert der Gr\u00FCne Daumen(B Guides.Herbalism.Section.5=[[DARK_AQUA]]Wie funktioniert das Bauernfr\u00FChst\u00FCck?\n[[YELLOW]]Du wirst beim Essen von Brot, Keksen, Melonen, Pilzsuppe,\n[[YELLOW]]Karotten und Kartoffeln satter. Guides.Herbalism.Section.6=[[DARK_AQUA]]Wie funktioniert Hylians Gl\u00FCck?\n[[YELLOW]]Diese passive F\u00E4higkeit gibt dir eine Chance Items zu finden\n[[YELLOW]]wenn du bestimmte Bl\u00F6cke mit dem Schwert abbaust. Guides.Herbalism.Section.7=[[DARK_AQUA]]Wie funktionieren Doppeldrops?\n[[YELLOW]]Du erh\u00E4ltst beim Ernten mehr Ertrag. - ##Mining Guides.Mining.Section.0=[[DARK_AQUA]]\u00DCber Bergbau:\n[[YELLOW]]Im Bergbau musst du Steine und Erze sammeln. Du erh\u00E4ltst\n[[YELLOW]]ab und zu zus\u00E4tzliche Drops.\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Um Erfahrung zu sammeln musst du mit der Spitzhacke abbauen.\n[[YELLOW]]Nur bestimmte Blocks geben XP. Guides.Mining.Section.1=[[DARK_AQUA]]Kompatible Materialien:\n[[YELLOW]]Stein, Kohleerz, Eisenerz, Golderz, Diamanterz, Redstoneerz,\n[[YELLOW]]Lapiserz, Obsidian, Bemooster Bruchstein, Endstein,\n[[YELLOW]]Glowstone, und Netherrack. @@ -791,31 +760,26 @@ Guides.Mining.Section.2=[[DARK_AQUA]]Wie funktioniert Super-Brecher?:\n[[YELLOW] Guides.Mining.Section.3=[[DARK_AQUA]]Was ist Super-Brecher?\n[[YELLOW]]Super-Brecher ist eine F\u00E4higkeit deren Dauer\n[[YELLOW]]vom Bergbau Skill abh\u00E4ngt. Es verdreifacht die \n[[YELLOW]]Wahrscheinlichkeit Sch\u00E4tze zu finden und erm\u00F6glicht\n[[YELLOW]]sofortiges Abbauen kompatibler Materialien. Guides.Mining.Section.4=[[DARK_AQUA]]Wie benutzt man Z\u00FCndstoff?:\n[[YELLOW]]Halte ein Feuerzeug in der Hand, b\u00FCck dich und klicke aus\n[[YELLOW]]sicherer Entfernung mit der rechten Maustaste auf das TNT.\n[[YELLOW]]Das TNT wird sofort explodieren. Guides.Mining.Section.5=[[DARK_AQUA]]Wie funktioniert Z\u00FCndstoff?\n[[YELLOW]]Z\u00FCndstoff ist eine F\u00E4higkeit mit einer Abklingzeit, deren St\u00E4rke\n[[YELLOW]]vom Level abh\u00E4ngt. Sie erlaubt dir beim Abbauen mit TNT dieses\n[[YELLOW]]aus der Ferne zu z\u00FCnden. Z\u00FCndstoff besteht aus 3 Teilen.\n[[YELLOW]]Erstens dem Sprengmeister mit gr\u00F6\u00DFeren Explosionen\n[[YELLOW]]Zweitens dem Explosions-Experten, der Schaden von TNT\n[[YELLOW]]reduziert.\n[[YELLOW]]Die dritte F\u00E4higkeit erh\u00F6ht einfach den Erzertrag und\n[[YELLOW]]und reduziert den Schutt. - ##Repair Guides.Repair.Section.0=[[DARK_AQUA]]\u00DCber Reparatur:\n[[YELLOW]]Reparatur erlaub dir an einem Eisenblock Werkzeuge und\n[[YELLOW]]Waffen zu reparieren.\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Repariere Werkzeuge am Eisenblockamboss\n[[RED]]Achtung: [[YELLOW]]Das ist nicht der normale Minecraft Amboss! Guides.Repair.Section.1=[[DARK_AQUA]]Wie kann ich Reparatur verwenden?\n[[YELLOW]]Platziere einen mcMMO Amboss, halte das zu reparierende Item\n[[YELLOW]]in der Hand und klicke mit der rechten Maustaste auf ihn. Zum\n[[YELLOW]]Reparieren benötigst du die Ausgangsmaterialien im Inventar,\n[[YELLOW]]diese werden dir im Zuge der Reparatur abgezogen. Guides.Repair.Section.2=[[DARK_AQUA]]Wie funktioniert der Reparatur Meister?\n[[YELLOW]]Mit dem Reparatur Meister wird dein Werkzeug ein bisschen\n[[YELLOW]]besser als normalerweise repariert.\n[[YELLOW]]Der Bonus ist abh\u00E4ngig vom Reparatur Level. Guides.Repair.Section.3=[[DARK_AQUA]]Wie funktioniert Super Reparatur?\n[[YELLOW]]Mit Super Reparatur werden ab und zu deine Items\n[[YELLOW]]doppelt so gut repariert. Guides.Repair.Section.4=[[DARK_AQUA]]Wie funktioniert Arkanes Schmieden?\n[[YELLOW]]Diese F\u00E4higkeit erm\u00F6glicht dir mit einer gewissen\n[[YELLOW]]Wahrscheinlichkeit Verzauberungen auf Items zu erhalten.\n[[YELLOW]]Verzauberungen k\u00F6nnen erhalten, vermindert werden oder\n[[YELLOW]]ganz verloren gehen. - ##Salvage Guides.Salvage.Section.0=[[DARK_AQUA]]\u00DCber Verwerten:\n[[YELLOW]]Mit einem Goldamboss kannst du R\u00FCstungen und\n[[YELLOW]]Werkzeuge verwerten.\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Verwerten ist ein vom Angeln und Reparieren abh\u00E4ngiger Skill\n[[YELLOW]]Sein Level ist die H\u00E4lfte von deren Summe. Guides.Salvage.Section.1=[[DARK_AQUA]]Wie funktioniert Verwerten?\n[[YELLOW]]Platziere einen Goldamboss und rechtsklicke mit dem Item in\n[[YELLOW]]der Hand. Das item wird zerst\u00F6rt und in seine\n[[YELLOW]]Bestandteile zerlegt.\n\n[[YELLOW]]Beispielsweise gibt eine Eisenaxt Eisenbarren. Guides.Salvage.Section.2=[[DARK_AQUA]]Wie funktioniert Fortgeschrittenes Verwerten?\n[[YELLOW]]Sobald freigeschaltet, kannst du besch\u00E4digte Items verwerten.\n[[YELLOW]]Der Ertrag steigt mit dem Level.\n[[YELLOW]]Der Mindestertrag ist immer 1 Item, ansonsten kannst du nicht\n[[YELLOW]]verwerten. Guides.Salvage.Section.3=[[DARK_AQUA]]Zur Verbildlichung ein Beispiel:\n[[YELLOW]]Sagen wir verwerten eine Goldene Spitzhacke mit 80%\n[[YELLOW]]Haltbarkeit, bedeutet das, dass wir nur 2 Gold bekommen\n[[YELLOW]]k\u00F6nnen (Spitzhacke=3 Goldbarren, also jeder 33,33%\n[[YELLOW]]Haltbarkeit) was 66% entspricht. Wenn dein\n[[YELLOW]]Ertragsprozentsatz unter 66% liegt wirst du keine 2 Barren\n[[YELLOW]]bekommen k\u00F6nnen. Wenn sie dar\u00FCber ist, kannst du den\n[[YELLOW]]"gesamten Betrag" bekommen, der aus 2 Eisenbarren besteht. Guides.Salvage.Section.4=[[DARK_AQUA]]Wie funktioniert Arkanes Verwerten?\n[[YELLOW]]Diese F\u00E4higkeit erm\u00F6glicht es verzauberte B\u00FCcher beim\n[[YELLOW]]Verwerten von verzauberten Items zu bekommen.\n[[YELLOW]]Verzauberungen k\u00F6nnen vollkommen oder teilweise extrahiert\n[[YELLOW]]werden.\n[[YELLOW]]Bei einer teilweisen Extraktion wird das Verzauberungslevel\n[[YELLOW]]reduziert. - ##Smelting Guides.Smelting.Section.0=Kommt irgendwann mal... Guides.Smelting.Section.1=Immer noch hier? - ##Swords Guides.Swords.Section.0=[[DARK_AQUA]]\u00DCber Schwerter:\n[[YELLOW]]Diese F\u00E4higkeit gibt Kampfboni bei Benutzung\n[[YELLOW]]des Schwertes.\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Verletze Monster und Spieler mit dem Schwert. Guides.Swords.Section.1=[[DARK_AQUA]]Wie funktioniert der S\u00E4gezahnschlag??\n[[YELLOW]]S\u00E4gezahnschlag ist eine aktive F\u00E4higkeit die du mit Rechtsklick \n[[YELLOW]]aktivierst.\n[[YELLOW]]Mit dieser F\u00E4higkeit kannst du Fl\u00E4chenschaden verteilen. \n[[YELLOW]]Au\u00DFerdem blutet das Ziel f\u00FCr kurze Zeit. Guides.Swords.Section.2=[[DARK_AQUA]]Wie funktioniert der Gegenangriff?\n[[YELLOW]]Gegenangriff ist eine aktive F\u00E4higkeit,\n[[YELLOW]]bei der Angriffe von Monstern beim Blocken um bis zu 50%\n[[YELLOW]]des erhaltenen Schadens reflektiert werden k\u00F6nnen. Guides.Swords.Section.3=[[DARK_AQUA]]Wie funktioniert Blutung?\n[[YELLOW]]Blutung f\u00FCgt den Gegnern alle 2 Sekunden Schaden zu. Das\n[[YELLOW]]Bluten geht solange bis die F\u00E4higkeit ausl\u00E4uft oder der\n[[YELLOW]]Gegner stirbt.\n[[YELLOW]]Die Dauer der Blutung erh\u00F6ht sich mit dem Schwert Skill. - ##Taming Guides.Taming.Section.0=[[DARK_AQUA]]\u00DCber Z\u00E4hmen:\n[[YELLOW]]Z\u00E4hmen gibt dem Spieler diverse Kampfboni beim Kampf mit\n[[YELLOW]]gez\u00E4hmten W\u00F6lfen.\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Um XP zu bekommen musst du Tiere z\u00E4hmen oder mit\n[[YELLOW]]deinen W\u00F6lfen k\u00E4mpfen. Guides.Taming.Section.1=[[DARK_AQUA]]Wie funktioniert Ruf der Wildnis?\n[[YELLOW]]Ruf der Wildnis ist eine aktive F\u00E4higkeit die dir erlaubt\n[[YELLOW]]einen Wolf, einen Ozelot oder ein Pferd an deine Seite zu\n[[YELLOW]]rufen. \n[[YELLOW]]Das tust du, indem du Linksklickst w\u00E4hrend du Knochen, Fisch\n[[YELLOW]]oder \u00C4pfel in der Hand h\u00E4ltst. @@ -826,7 +790,6 @@ Guides.Taming.Section.5=[[DARK_AQUA]]Wie funktioniert Umweltbewusst?\n[[YELLOW]] Guides.Taming.Section.6=[[DARK_AQUA]]Wie funktioniert Dicker Pelz?\n[[YELLOW]]Diese passive F\u00E4higkeit reduziert Schaden und \n[[YELLOW]]macht W\u00F6lfe feuerresistent. Guides.Taming.Section.7=[[DARK_AQUA]]Wie funktioniert Schocksicher?\n[[YELLOW]]Diese passive F\u00E4higkeit reduziert den Schaden\n[[YELLOW]]durch Explosionen. Guides.Taming.Section.8=[[DARK_AQUA]]Wie funktioniert Schnell-Imbiss?\n[[YELLOW]]Diese passive F\u00E4higkeit gibt dem Wolf eine Chance sich zu \n[[YELLOW]]erholen wann immer er einen Gegner verletzt. - ##Unarmed Guides.Unarmed.Section.0=[[DARK_AQUA]]\u00DCber Unbewaffnet:\n[[YELLOW]]Mit Unbewaffnet kann der echte Mann endlich mit seinen\n[[YELLOW]]F\u00E4usten angemessen zuschlagen. \n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]K\u00E4mpfe unbewaffnet gegen Monster und andere Spieler Guides.Unarmed.Section.1=[[DARK_AQUA]]Wie funktioniert Berserker?\n[[YELLOW]]Berserker ist eine aktive F\u00E4higkeit die mit Rechtsklick\n[[YELLOW]]aktiviert wird.\n[[YELLOW]]Im Berserker Modus f\u00FCgst du 50% mehr Schaden zu und\n[[YELLOW]]kannst weiche Materiale wie Gras und Erde sofort abbauen. @@ -834,19 +797,16 @@ Guides.Unarmed.Section.2=[[DARK_AQUA]]Wie funktioniert der Eiserne Arm?\n[[YELLO Guides.Unarmed.Section.3=[[DARK_AQUA]]Wie funktioniert Pfeilablenkung?\n[[YELLOW]]Pfeilablenkung ist eine passive F\u00E4higkeit die ab und zu\n[[YELLOW]]Pfeile von Skeletten und angreifenden Spielern ablenkt.\n[[YELLOW]]Diese Pfeile prallen einfach ab und fallen auf den Boden. Guides.Unarmed.Section.4=[[DARK_AQUA]]Wie funktioniert der Eiserne Griff?\n[[YELLOW]]Eiserner Griff ist eine passive F\u00E4higkeit die Entwaffnung\n[[YELLOW]]verhindert. Mit h\u00F6herem Level ist es umso einfacher\n[[YELLOW]]Entwaffnung zu verhindern. Guides.Unarmed.Section.5=[[DARK_AQUA]]Wie funktioniert Entwaffnen?\n[[YELLOW]]Diese passive F\u00E4higkeit erm\u00F6glich es den Gegner zu\n[[YELLOW]]entwaffnen, sodass seine Waffe auf den Boden f\u00E4llt. - ##Woodcutting Guides.Woodcutting.Section.0=[[DARK_AQUA]]\u00DCber Holzf\u00E4ller:\n[[YELLOW]]Im Holzf\u00E4llen geht es um das F\u00E4llen von B\u00E4umen.\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Du kriegst XP f\u00FCr das abholzen von Baumst\u00E4mmen. Guides.Woodcutting.Section.1=[[DARK_AQUA]]Wie funktioniert der Baumf\u00E4ller?\n[[YELLOW]]Baumf\u00E4ller ist eine aktive F\u00E4higkeit. Mache mit der Axt in der\n[[YELLOW]]Hand einen Rechtsklick um sie zu aktivieren. Der Baum\n[[YELLOW]]wird sofortig gef\u00E4llt und alle St\u00E4mme abgebaut. Guides.Woodcutting.Section.2=[[DARK_AQUA]]Wie funktioniert Bl\u00E4ttersturm?\n[[YELLOW]]Bl\u00E4ttersturm ist eine passive F\u00E4higkeit die Bl\u00E4tter\n[[YELLOW]]bei Ber\u00FChrung mit der Axt sofortig bricht. Standardm\u00E4\u00DFig\n[[YELLOW]]wird diese F\u00E4higkeit bei Level 100 freigeschaltet. Guides.Woodcutting.Section.3=[[DARK_AQUA]]Wie funktionieren Doppel-Drops?\n[[YELLOW]]Diese passive F\u00E4higkeit gibt dir ab und zu doppelten\n[[YELLOW]]Ertrag f\u00FCr jeden Stamm den du f\u00E4llst. - #INSPECT -Inspect.Offline= [[RED]]Du hast nicht die Rechte um offline Spieler zu inspizieren! +Inspect.Offline=[[RED]]Du hast nicht die Rechte um offline Spieler zu inspizieren! Inspect.OfflineStats=mcMMO Stats f\u00FCr Offline Spieler [[YELLOW]]{0} Inspect.Stats=[[GREEN]]mcMMO Stats f\u00FCr [[YELLOW]]{0} Inspect.TooFar=Du bist zu weit entfernt um den Spieler zu inspizieren! - #ITEMS Item.ChimaeraWing.Fail=**CHIMAERA FL\u00DCGEL GESCHEITERT!** Item.ChimaeraWing.Pass=**CHIMAERA FL\u00DCGEL* @@ -857,34 +817,30 @@ Item.Injured.Wait=Du wurdest vor kurzem verletzt und musst warten bis du das ver Item.FluxPickaxe.Name=Flux Spitzhacke Item.FluxPickaxe.Lore.1=[[GRAY]]Hat eine Wahrscheinlichkeit Erze sofort zu schmelzen. Item.FluxPickaxe.Lore.2=[[GRAY]]Ben\u00F6tigt Schmelzen Level {0}+ - #TELEPORTATION Teleport.Commencing=[[GRAY]]Beginne Teleport in [[GOLD]]({0}) [[GRAY]]Sekunden, bitte stillhalten... Teleport.Cancelled=[[DARK_RED]]Teleport abgebrochen! - #SKILLS Skills.Child=[[GOLD]](VERWANDTER SKILL) Skills.Disarmed=[[DARK_RED]]Du wurdest entwaffnet! Skills.Header=-----[][[GREEN]]{0}[[RED]][]----- Skills.NeedMore=[[DARK_RED]]Du brauchst mehr[[GRAY]]{0} -Skills.Parents = ELTERN +Skills.Parents=ELTERN Skills.Stats={0}[[GREEN]]{1}[[DARK_AQUA]] XP([[GRAY]]{2}[[DARK_AQUA]]/[[GRAY]]{3}[[DARK_AQUA]]) Skills.ChildStats={0}[[GREEN]]{1} Skills.TooTired=Du bist zu m\u00FCde um diese F\u00E4higkeit zu verwenden. [[YELLOW]]({0}s) Skills.Cancelled={0} abgebrochen! Skills.ConfirmOrCancel=[[GREEN]]Erneuter Rechtsklick zur Best\u00E4tigung [[GOLD]]{0}[[GREEN]]. Linksklick zum abbrechen. - #STATISTICS Stats.Header.Combat=[[GOLD]]-=KAMPFSKILLS=- Stats.Header.Gathering=[[GOLD]]-=SAMMELSKILLS=- Stats.Header.Misc=[[GOLD]]-=DIV.SKILLS=- Stats.Own.Stats=[[GREEN]][mcMMO] Stats - #PERKS Perks.XP.Name=Erfahrung Perks.XP.Desc=Erhalte mehr Erfahrung in bestimmen Skills. Perks.Lucky.Name=Gl\u00FCck -Perks.Lucky.Desc= {0} Skills und F\u00E4higkeiten werden um 33.3% \u00F6fter aktiviert. +Perks.Lucky.Desc={0} Skills und F\u00E4higkeiten werden um 33.3% \u00F6fter aktiviert. Perks.Lucky.Desc.Login=Bestimmte Skills und F\u00E4higkeiten werden um 33.3% \u00F6fter aktiviert. Perks.Lucky.Bonus=[[GOLD]] ({0} mit Gl\u00FCcksbonus) Perks.Cooldowns.Name=Schnelle Erholung @@ -892,7 +848,6 @@ Perks.Cooldowns.Desc=Verk\u00FCrzt die Abklingzeit um {0}. Perks.ActivationTime.Name=Ausdauer Perks.ActivationTime.Desc=Erh\u00F6ht die F\u00E4higkeitszeit um {0} Sekunden. Perks.ActivationTime.Bonus=[[GOLD]] ({0}s mit Ausdauer Bonus) - #HARDCORE Hardcore.Mode.Disabled=[[GOLD]][mcMMO] Hardcore Modus {0} deaktiviert f\u00FCr {1}. Hardcore.Mode.Enabled=[[GOLD]][mcMMO] Hardcore Modus {0} aktiviert f\u00FCr {1}. @@ -905,7 +860,6 @@ Hardcore.Vampirism.Killer.Success=[[GOLD]][mcMMO] [[DARK_AQUA]]Du hast [[BLUE]]{ Hardcore.Vampirism.Victim.Failure=[[GOLD]][mcMMO] [[YELLOW]]{0}[[GRAY]] hat es nicht geschafft Wissen von dir zu stehlen! Hardcore.Vampirism.Victim.Success=[[GOLD]][mcMMO] [[YELLOW]]{0}[[DARK_RED]] hat[[BLUE]]{1}[[DARK_RED]] Level von dir gestohlen! Hardcore.Vampirism.PercentageChanged=[[GOLD]][mcMMO] Der Vampirismus Prozentsatz wurde auf {0} ge\u00E4ndert. - #MOTD MOTD.Donate=[[DARK_AQUA]]Spenden Info: MOTD.Hardcore.Enabled=[[GOLD]][mcMMO] [[DARK_AQUA]]Hardcore Modus aktiviert: [[DARK_RED]]{0} @@ -914,7 +868,6 @@ MOTD.Hardcore.Vampirism.Stats=[[GOLD]][mcMMO] [[DARK_AQUA]]Vampirismus Prozentsa MOTD.PerksPrefix=[mcMMO Boni] MOTD.Version=[[GOLD]][mcMMO] Verwende Version[[DARK_AQUA]]{0} MOTD.Website=[[GOLD]][mcMMO] [[GREEN]]{0}[[YELLOW]] - mcMMO Webseite - #SMELTING Smelting.Ability.FluxMining=Schmelztiegel: [[YELLOW]]{0} Smelting.Ability.FuelEfficiency=Brennstoff Effizienz Multiplikator: [[YELLOW]]{0}x @@ -932,7 +885,6 @@ Smelting.SubSkill.FluxMining.Name=Schmelztiegel Smelting.SubSkill.FluxMining.Description=M\u00F6glichkeit, Erze direkt beim Abbauen zu Schmelzen Smelting.Listener=Schmelzen: Smelting.SkillName=SCHMELZEN - #COMMAND DESCRIPTIONS Commands.Description.addlevels=Gib einem Spieler mcMMO Level Commands.Description.adminchat=Schalte den mcMMO Adminchat an/aus oder sende Adminchat Nachrichten @@ -964,11 +916,9 @@ Commands.Description.skillreset=Setze die mcMMO Level f\u00FCr einen Spieler zur Commands.Description.vampirism=Schalte Vampirismus an/aus / \u00E4ndere den Vampirismus Prozentsatz Commands.Description.xplock=Setze deine mcMMO XP-Leiste auf einen bestimmten Skill fest Commands.Description.xprate=\u00C4ndere die mcMMO XP Rate oder starte ein XP Event - #UPDATE CHECKER UpdateChecker.Outdated=Du verwendest eine veraltete mcMMO Version! UpdateChecker.NewAvailable=Eine neue Version ist auf BukkitDev erh\u00E4ltlich. - #SCOREBOARD HEADERS Scoreboard.Header.PlayerStats=mcMMO Stats Scoreboard.Header.PlayerCooldowns=mcMMO Abklingzeiten @@ -982,7 +932,6 @@ Scoreboard.Misc.RemainingXP=Verbliebene XP Scoreboard.Misc.Cooldown=[[LIGHT_PURPLE]]Abklingzeit Scoreboard.Misc.Overall=[[GOLD]]Insgesamt Scoreboard.Misc.Ability=F\u00E4higkeit - #DATABASE RECOVERY Profile.Loading.Success=[[GREEN]]Your mcMMO profile has been loaded. Profile.Loading.Failure=mcMMO still cannot load your data. You may want to [[AQUA]]contact the server owner.\n[[YELLOW]]You can still play on the server, but you will have [[BOLD]]no mcMMO levels[[YELLOW]] and any XP you get [[BOLD]]will not be saved[[YELLOW]]. diff --git a/bukkit/src/main/resources/locale/locale_en_US.properties b/bukkit/src/main/resources/locale/locale_en_US.properties index f978e815d..1c8484d20 100644 --- a/bukkit/src/main/resources/locale/locale_en_US.properties +++ b/bukkit/src/main/resources/locale/locale_en_US.properties @@ -1,5 +1,4 @@ #I'm going to try to normalize our locale file, forgive the mess for now. - #DO NOT USE COLOR CODES IN THE JSON KEYS #COLORS ARE DEFINED IN advanced.yml IF YOU WISH TO CHANGE THEM JSON.Rank=Rank @@ -47,17 +46,13 @@ JSON.Hover.SuperAbility=[[DARK_PURPLE]]{0}&r JSON.Hover.MaxRankSkillName=[[GOLD]]{0}&r JSON.Hover.AtSymbolSkills=[[YELLOW]]@ JSON.Hover.AtSymbolURL=[[YELLOW]]@ - #This is the message sent to players when an ability is activated JSON.Notification.SuperAbility={0} - #These are the JSON Strings used for SubSkills JSON.Acrobatics.Roll.Interaction.Activated=Test [[RED]]Rolled Test JSON.Acrobatics.SubSkill.Roll.Details.Tips=If you hold sneak while falling you can prevent up to twice the damage that you would normally take! - #DO NOT USE COLOR CODES IN THE JSON KEYS #COLORS ARE DEFINED IN advanced.yml IF YOU WISH TO CHANGE THEM - # BEGIN STYLING Ability.Generic.Refresh=[[GREEN]]**ABILITIES REFRESHED!** Ability.Generic.Template.Lock=[[GRAY]]{0} @@ -123,7 +118,6 @@ XPBar.Complex.Template={0} [[DARK_AQUA]] {4}[[WHITE]]% [[DARK_AQUA]]([[WHITE]]{1 # XP BAR Allows for the following variables -- {0} = Skill Level, {1} Current XP, {2} XP Needed for next level, {3} Power Level, {4} Percentage of Level # Make sure you turn on Experience_Bars.ThisMayCauseLag.AlwaysUpdateTitlesWhenXPIsGained if you want the XP bar title to update every time a player gains XP! # END STYLING - #ACROBATICS Acrobatics.Ability.Proc=[[GREEN]]**Graceful Landing** Acrobatics.Combat.Proc=[[GREEN]]**Dodged** @@ -155,8 +149,6 @@ Alchemy.Listener=Alchemy: Alchemy.Ability.Locked.0=LOCKED UNTIL {0}+ SKILL (CATALYSIS) Alchemy.SkillName=ALCHEMY #ARCHERY - - Archery.SubSkill.SkillShot.Name=Skill Shot Archery.SubSkill.SkillShot.Description=Increases damage done with bows Archery.SubSkill.SkillShot.Stat=Skill Shot Bonus Damage @@ -303,7 +295,6 @@ Mining.SubSkill.BiggerBombs.Description=Increases TNT explosion radius Mining.SubSkill.DemolitionsExpertise.Name=Demolitions Expertise Mining.SubSkill.DemolitionsExpertise.Description=Decreases damage from TNT explosions Mining.SubSkill.DemolitionsExpertise.Stat=Demolitions Expert Damage Decrease - Mining.Listener=Mining: Mining.SkillName=MINING Mining.Skills.SuperBreaker.Off=**Super Breaker has worn off** @@ -457,7 +448,7 @@ Taming.Listener.Wolf=[[DARK_GRAY]]Your wolf scurries back to you... Taming.Listener=Taming: Taming.SkillName=TAMING Taming.Summon.Complete=[[GREEN]]Summoning complete -Taming.Summon.Lifespan= (Lifespan: {0}s) +Taming.Summon.Lifespan=(Lifespan: {0}s) Taming.Summon.Fail.Ocelot=[[RED]]You have too many ocelots nearby to summon any more. Taming.Summon.Fail.Wolf=[[RED]]You have too many wolves nearby to summon any more. Taming.Summon.Fail.Horse=[[RED]]You have too many horses nearby to summon any more. @@ -521,7 +512,6 @@ Woodcutting.Skills.TreeFeller.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED Woodcutting.Skills.TreeFeller.Splinter=YOUR AXE SPLINTERS INTO DOZENS OF PIECES! Woodcutting.Skills.TreeFeller.Threshold=That tree is too large! #ABILITIY - #COMBAT Combat.ArrowDeflect=[[WHITE]]**ARROW DEFLECT** Combat.BeastLore=[[GREEN]]**BEAST LORE** @@ -553,7 +543,7 @@ Commands.Cooldowns.Row.Y=\ [[AQUA]]{0}[[WHITE]] - [[DARK_GREEN]]Ready! Commands.Database.Cooldown=You must wait {0} seconds before using this command again. Commands.Database.Processing=Your previous command is still being processed. Please wait. Commands.Disabled=This command is disabled. -Commands.DoesNotExist= [[RED]]Player does not exist in the database! +Commands.DoesNotExist=[[RED]]Player does not exist in the database! Commands.GodMode.Disabled=mcMMO Godmode Disabled Commands.GodMode.Enabled=mcMMO Godmode Enabled Commands.AdminChatSpy.Enabled=mcMMO Party Chat Spy Enabled @@ -727,7 +717,7 @@ Party.NotOwner=[[DARK_RED]]You are not the party leader. Party.Target.NotOwner=[[DARK_RED]]{0} is not the party leader. Party.Owner.New=[[GREEN]]{0} is the new party leader. Party.Owner.NotLeader=[[DARK_RED]]You are no longer the party leader. -Party.Owner.Player =[[GREEN]]You are now the party leader. +Party.Owner.Player=[[GREEN]]You are now the party leader. Party.Password.None=[[RED]]This party is password protected. Please provide a password to join. Party.Password.Incorrect=[[RED]]Party password is incorrect. Party.Password.Set=[[GREEN]]Party password set to {0} @@ -807,14 +797,13 @@ Commands.Event.Stop.Subtitle=[[GREEN]]I hope you had fun! Commands.Event.XP=[[DARK_AQUA]]XP Rate is now [[GOLD]]{0}[[DARK_AQUA]]x Commands.xprate.started.0=[[GOLD]]XP EVENT FOR mcMMO HAS STARTED! Commands.xprate.started.1=[[GOLD]]mcMMO XP RATE IS NOW {0}x! -XPRate.Event= [[GOLD]]mcMMO is currently in an XP rate event! XP rate is {0}x! - +XPRate.Event=[[GOLD]]mcMMO is currently in an XP rate event! XP rate is {0}x! #GUIDES Guides.Available=[[GRAY]]Guide for {0} available - type /{1} ? [page] Guides.Header=[[GOLD]]-=[[GREEN]]{0} Guide[[GOLD]]=- Guides.Page.Invalid=Not a valid page number! Guides.Page.OutOfRange=That page does not exist, there are only {0} total pages. -Guides.Usage= Usage is /{0} ? [page] +Guides.Usage=Usage is /{0} ? [page] ##Acrobatics Guides.Acrobatics.Section.0=[[DARK_AQUA]]About Acrobatics:\n[[YELLOW]]Acrobatics is the art of moving Gracefuly in mcMMO.\n[[YELLOW]]It provides combat bonuses and environment damage bonuses.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you need to perform a dodge\n[[YELLOW]]in combat or survive falls from heights that damage you. Guides.Acrobatics.Section.1=[[DARK_AQUA]]How does Rolling work?\n[[YELLOW]]You have a passive chance when you take fall damage\n[[YELLOW]]to negate the damage done. You can hold the sneak button to\n[[YELLOW]]double your chances during the fall.\n[[YELLOW]]This triggers a Graceful Roll instead of a standard one.\n[[YELLOW]]Graceful Rolls are like regular rolls but are twice as likely to\n[[YELLOW]]occur and provide more damage safety than regular rolls.\n[[YELLOW]]Rolling chance is tied to your skill level @@ -912,7 +901,7 @@ Guides.Woodcutting.Section.1=[[DARK_AQUA]]How does Tree Feller work?\n[[YELLOW]] Guides.Woodcutting.Section.2=[[DARK_AQUA]]How does Leaf Blower work?\n[[YELLOW]]Leaf Blower is a passive ability that will cause leaf\n[[YELLOW]]blocks to break instantly when hit with an axe. By default,\n[[YELLOW]]this ability unlocks at level 100. Guides.Woodcutting.Section.3=[[DARK_AQUA]]How do Double Drops work?\n[[YELLOW]]This passive ability gives you a chance to obtain an extra\n[[YELLOW]]block for every log you chop. #INSPECT -Inspect.Offline= [[RED]]You do not have permission to inspect offline players! +Inspect.Offline=[[RED]]You do not have permission to inspect offline players! Inspect.OfflineStats=mcMMO Stats for Offline Player [[YELLOW]]{0} Inspect.Stats=[[GREEN]]mcMMO Stats for [[YELLOW]]{0} Inspect.TooFar=You are too far away to inspect that player! @@ -937,7 +926,7 @@ Skills.Disarmed=[[DARK_RED]]You have been disarmed! Skills.Header=-----[] [[GREEN]]{0}[[RED]] []----- Skills.NeedMore=[[DARK_RED]]You need more [[GRAY]]{0} Skills.NeedMore.Extra=[[DARK_RED]]You need more [[GRAY]]{0}{1} -Skills.Parents= PARENTS +Skills.Parents=PARENTS Skills.Stats={0}[[GREEN]]{1}[[DARK_AQUA]] XP([[GRAY]]{2}[[DARK_AQUA]]/[[GRAY]]{3}[[DARK_AQUA]]) Skills.ChildStats={0}[[GREEN]]{1} Skills.TooTired=You are too tired to use that ability again. [[YELLOW]]({0}s) diff --git a/bukkit/src/main/resources/locale/locale_es.properties b/bukkit/src/main/resources/locale/locale_es.properties index afdbffff4..6f4d0e969 100644 --- a/bukkit/src/main/resources/locale/locale_es.properties +++ b/bukkit/src/main/resources/locale/locale_es.properties @@ -296,7 +296,7 @@ Unarmed.Ability.Bonus.1=+{0} Mejora de DA\u00d1O Unarmed.Ability.Chance.ArrowDeflect=Probabilidad de Desviar Flechas: [[YELLOW]]{0}% Unarmed.Ability.Chance.Disarm=Probabilidad de Desarmar: [[YELLOW]]{0} Unarmed.Ability.Chance.IronGrip=Probabilidad de agarre de hierro: [[YELLOW]]{0} -Unarmed.Ability.IronGrip.Attacker= Tu oponente tiene agarre de hierro! +Unarmed.Ability.IronGrip.Attacker=Tu oponente tiene agarre de hierro! Unarmed.Ability.IronGrip.Defender=[[GREEN]]Tu agarre de hierro te salvo de ser desarmado! Unarmed.Ability.Lower=[[GRAY]]**BAJAS TUS PU\u00d1OS** Unarmed.Ability.Ready=[[GREEN]]**LEVANTASTE LA GUARDIA** @@ -561,7 +561,7 @@ Guides.Available=[[GRAY]]Guia para {0} disponible - tipo /{1} ? [page] Guides.Header=[[GOLD]]-=[[GREEN]]{0} Guia[[GOLD]]=- Guides.Page.Invalid=Numero de pagina no disponible Guides.Page.OutOfRange=La pagina no existe, solo hay {0} paginas en total -Guides.Usage= El uso es /{0} ? [page] +Guides.Usage=El uso es /{0} ? [page] Guides.Smelting.Section.0=Muy pronto... Inspect.Offline=\u00a1No tienen permiso para inspeccionar jugadores fuera de linea! Inspect.OfflineStats=Estad\u00edsticas de mcMMO para el Jugador Desconectado [[YELLOW]]{0} diff --git a/bukkit/src/main/resources/locale/locale_fr.properties b/bukkit/src/main/resources/locale/locale_fr.properties index 230bab883..87a00b7c9 100644 --- a/bukkit/src/main/resources/locale/locale_fr.properties +++ b/bukkit/src/main/resources/locale/locale_fr.properties @@ -69,10 +69,7 @@ Axes.Skills.SS.Refresh=[[GREEN]]Votre comp\u00e9tence [[YELLOW]]Tranche-cr\u00e2 Axes.Skills.SS.Other.Off=Tranche-cr\u00e2ne[[GREEN]] s\'est termin\u00e9 pour [[YELLOW]]{0} Axes.Skills.SS.Other.On=[[GREEN]]{0}[[DARK_GREEN]] a utilis\u00e9 [[RED]]Tranche-cr\u00e2ne ! Axes.Skillup=Le talent Haches augmente de {0}. Total ({1}) - - Axes.Ability.Bonus.0=Ma\u00eetrise des haches - Excavation.Ability.Lower=[[GRAY]]**VOUS ABAISSEZ VOTRE PELLE** Excavation.Ability.Ready=[[GREEN]]**VOUS LEVEZ VOTRE PELLE** Excavation.SubSkill.GigaDrillBreaker.Name=Foreur (Comp\u00e9tence) @@ -94,7 +91,7 @@ Fishing.Ability.Locked.0=BLOCKE JUSQU\'A {0}+ COMPETENCE (SHAKE) Fishing.Ability.Locked.1=Bloqu\u00e9 jusqu\'\u00e0 {0}+ niveaux de talent (PECHEUR SUR GLACE) Fishing.Ability.Locked.2=Bloqu\u00e9 jusqu\'\u00e0 {0}+ niveau(x) (Ma\u00eetre P\u00eacheur) Fishing.Ability.Rank=Chasseur de tr\u00e9sors : [[YELLOW]]{0}/{1} -Fishing.Ability.TH.DropRate= Taux de Loot: [[DARK_RED]]Pi\u00e8ge: [[YELLOW]]{0} [[GRAY]]Commun: [[YELLOW]]{1} [[GREEN]]Non commun: [[YELLOW]]{2}\n[[BLUE]]Rare: [[YELLOW]]{3} [[LIGHT_PURPLE]]\u00c9pique: [[YELLOW]]{4} [[GOLD]]L\u00e9gendaire: [[YELLOW]]{5} [[AQUA]]Record: [[YELLOW]]{6} +Fishing.Ability.TH.DropRate=Taux de Loot: [[DARK_RED]]Pi\u00e8ge: [[YELLOW]]{0} [[GRAY]]Commun: [[YELLOW]]{1} [[GREEN]]Non commun: [[YELLOW]]{2}\n[[BLUE]]Rare: [[YELLOW]]{3} [[LIGHT_PURPLE]]\u00c9pique: [[YELLOW]]{4} [[GOLD]]L\u00e9gendaire: [[YELLOW]]{5} [[AQUA]]Record: [[YELLOW]]{6} Fishing.Ability.TH.MagicRate=Chasse magique: [[YELLOW]]{0} Fishing.Ability.Shake=Chance d\'esquive : [[YELLOW]]{0} Fishing.Ability.IceFishing=P\u00eache sur Glace: Allez p\u00eacher sur de la glace @@ -124,7 +121,7 @@ Herbalism.Ability.GTe.Length=Dur\u00e9e de Main verte : [[YELLOW]]{0}s Herbalism.Ability.GTe.NeedMore=Vous avez besoin de plus de graines pour r\u00e9pandre la terre verte Herbalism.Ability.GTh.Chance=Chances de Mains Vertes: [[YELLOW]]{0} Herbalism.Ability.GTh.Fail=**MAINS VERTES \u00c9CHOU\u00c9ES** -Herbalism.Ability.GTh.Stage= Vos sens de jardinier vous indique que [[YELLOW]] Ce champ est en train de pousser {0} +Herbalism.Ability.GTh.Stage=Vos sens de jardinier vous indique que [[YELLOW]] Ce champ est en train de pousser {0} Herbalism.Ability.GTh=[[GREEN]]**DOIGTS VERTS** Herbalism.Ability.HylianLuck=Probabilit\u00e9 de chance d\'Hylian: [[YELLOW]]{0} Herbalism.Ability.Lower=[[GRAY]]**VOUS ABAISSEZ VOTRE HOUE** @@ -330,7 +327,7 @@ Taming.Skills.Charge.NoneNearby=**AUCUN LOUP DISPONIBLE A PROXIMIT\u00c9** Taming.Skills.Charge.NoTarget=**AUCUNE CIBLE TROUV\u00c9E** Taming.Skillup=Le talent Apprivoisement augmente de {0}. Total ({1}) Taming.Summon.Complete=[[GREEN]]Appel r\u00e9ussi -Taming.Summon.Lifespan= (Dur\u00e9e de vie: {0}s) +Taming.Summon.Lifespan=(Dur\u00e9e de vie: {0}s) Taming.Summon.Fail.Ocelot=Il y a d\u00e9j\u00e0 trop d\'ocelots dans les environs. Taming.Summon.Fail.Wolf=Il y a d\u00e9j\u00e0 trop de loups dans les environs. Taming.Summon.Fail.Horse=Il y a d\u00e9j\u00e0 trop de chevaux dans les environs. @@ -502,7 +499,7 @@ Commands.Party.Alliance.Invite.Accepted=[[GREEN]]Invitation d\'alliance accept\u Commands.Party.Alliance.None=Votre groupe n\'a pas d\'alli\u00e9. Commands.Party.Alliance.AlreadyAllies=Votre groupe a d\u00e9j\u00e0 une alliance. D\u00e9faites-la avec [[DARK_AQUA]]/party alliance disband Commands.Party.Alliance.Help.0=Cette guilde n\'a pas form\u00e9 d\'alliance. Invitez un chef de groupe. -Commands.Party.Alliance.Help.1= \u00e0 une alliance [[DARK_AQUA]]/party alliance invite [[RED]]. +Commands.Party.Alliance.Help.1=\u00e0 une alliance [[DARK_AQUA]]/party alliance invite [[RED]]. Commands.ptp.Enabled=T\u00e9l\u00e9portation de guilde [[GREEN]]activ\u00e9e Commands.ptp.Disabled=T\u00e9l\u00e9portation de guilde [[RED]]d\u00e9sactiv\u00e9e Commands.ptp.NoRequests=Vous n\'avez pas de requ\u00eates de t\u00e9l\u00e9portation en ce moment @@ -660,7 +657,7 @@ Guides.Available=[[GRAY]]Guide pour le/la {0} est disponible - \u00e9crivez /{1} Guides.Header=[[GOLD]]-=[[GREEN]]{0} Guide[[GOLD]]=- Guides.Page.Invalid=Le num\u00e9ro de page est invalide Guides.Page.OutOfRange=Cette page n\'existe pas, il y a seulement {0} pages totales. -Guides.Usage= L\'utilisation est /{0} ? [page] +Guides.Usage=L\'utilisation est /{0} ? [page] Guides.Acrobatics.Section.0=[[DARK_AQUA]]A propos de l\'Acrobatie:\n[[YELLOW]]L\'acrobatie est l\'art de bouger gracieusement dans mcMMO.\n[[YELLOW]]Donne des bonus au combat et de r\u00e9sistance aux d\u00e9g\u00e2ts physiques.\n[[DARK_AQUA]]GAIN D\'XP:\n[[YELLOW]]Pour gagner de l\'exp\u00e9rience, vous devez esquiver des d\u00e9g\u00e2ts\n[[YELLOW]]en combat ou encaisser des d\u00e9g\u00e2ts de chute. Guides.Acrobatics.Section.1=[[DARK_AQUA]]Comment fonctionne la Roulade?\n[[YELLOW]]Vous avez une chance, lorsque vous prenez des d\u00e9g\u00e2ts dus \u00e0 une chute,\n[[YELLOW]]d\'esquiver ces d\u00e9g\u00e2ts. Maintenez la touche pour s\'accroupir\n[[YELLOW]]pour doubler les chances d\'esquiver ces d\u00e9g\u00e2ts.\n[[YELLOW]]Cette manipulation activera la Roulade Gracieuse. \n[[YELLOW]]La Roulade Gracieuse fonctionne comme une Roulade classique,\n[[YELLOW]]mais vous avez deux fois plus de chance d\'\u00e9chapper aux d\u00e9g\u00e2ts.\n[[YELLOW]]Votre pourcentage de chance de Roulade d\u00e9pend du niveau de votre Comp\u00e9tence. Guides.Acrobatics.Section.2=[[DARK_AQUA]]Comment fonctionne l\'esquive?\n[[YELLOW]]L\'esquive est une capacit\u00e9 passive qui peut vous permettre de\n[[YELLOW]]diminuer les d\u00e9g\u00e2ts de moiti\u00e9 lorsque vous \u00eates bless\u00e9 au combat.\n[[YELLOW]]Les chances d\'esquiver sont fonction de votre niveau de comp\u00e9tence. diff --git a/bukkit/src/main/resources/locale/locale_hu_HU.properties b/bukkit/src/main/resources/locale/locale_hu_HU.properties index 6d809d666..b1364aa3c 100644 --- a/bukkit/src/main/resources/locale/locale_hu_HU.properties +++ b/bukkit/src/main/resources/locale/locale_hu_HU.properties @@ -41,12 +41,12 @@ Mining.Skillup=B\u00e1ny\u00e1szat fejl\u0151d\u00f6tt {0} szinttel. \u00d6sszes Mining.Blast.Refresh=[[GREEN]]A [[YELLOW]]Robban\u00f3 B\u00e1ny\u00e1szat [[GREEN]]k\u00e9pess\u00e9ged \u00fajra el\u00e9rhet\u0151! Repair.SubSkill.Repair.Name=Jav\u00edt\u00e1s Repair.SubSkill.Repair.Description=Eszk\u00f6z\u00f6k \u00e9s felszerel\u00e9sek jav\u00edt\u00e1sa -Repair.SubSkill.GoldRepair.Description= Arany eszk\u00f6z\u00f6k \u00e9s felszerel\u00e9sek jav\u00edt\u00e1sa -Repair.SubSkill.IronRepair.Description= Vas eszk\u00f6z\u00f6k \u00e9s felszerel\u00e9sek jav\u00edt\u00e1sa +Repair.SubSkill.GoldRepair.Description=Arany eszk\u00f6z\u00f6k \u00e9s felszerel\u00e9sek jav\u00edt\u00e1sa +Repair.SubSkill.IronRepair.Description=Vas eszk\u00f6z\u00f6k \u00e9s felszerel\u00e9sek jav\u00edt\u00e1sa Repair.SubSkill.StoneRepair.Description=K\u0151 eszk\u00f6z\u00f6k jav\u00edt\u00e1sa Repair.SubSkill.RepairMastery.Name=Jav\u00edt\u00f3 mester Repair.SubSkill.SuperRepair.Name=Szuper jav\u00edt\u00e1s -Repair.SubSkill.DiamondRepair.Description= Gy\u00e9m\u00e1nt eszk\u00f6z\u00f6k \u00e9s felszerel\u00e9sek jav\u00edt\u00e1sa +Repair.SubSkill.DiamondRepair.Description=Gy\u00e9m\u00e1nt eszk\u00f6z\u00f6k \u00e9s felszerel\u00e9sek jav\u00edt\u00e1sa Repair.SubSkill.ArcaneForging.Description=M\u00e1gikus t\u00e1rgyak megjav\u00edt\u00e1sa Repair.Listener=Jav\u00edt\u00e1s: Repair.SkillName=JAV\u00cdT\u00c1S diff --git a/bukkit/src/main/resources/locale/locale_it.properties b/bukkit/src/main/resources/locale/locale_it.properties index 7c939b768..b1cce913e 100644 --- a/bukkit/src/main/resources/locale/locale_it.properties +++ b/bukkit/src/main/resources/locale/locale_it.properties @@ -14,7 +14,6 @@ Acrobatics.SubSkill.Roll.GraceChance=Possibilit\u00E0 di Capriola Aggraziata: [[ Acrobatics.Roll.Text=**Capriola Eseguita** Acrobatics.SkillName=ACROBATICA Acrobatics.Skillup=L'abilit\u00E0 Acrobatica \u00E8 aumentata di {0}. Totale ({1}) - #ALCHEMY Alchemy.SubSkill.Catalysis.Name=Catalisi Alchemy.SubSkill.Catalysis.Description=Aumenta la velocit\u00E0 di produzione delle pozioni @@ -27,7 +26,6 @@ Alchemy.Concoctions.Rank=Grado Intrugli: [[YELLOW]]{0}/{1} Alchemy.Concoctions.Ingredients=Ingredienti [[[YELLOW]]{0}[[RED]]]: [[YELLOW]]{1} Alchemy.SkillName=ALCHIMIA Alchemy.Skillup=L'abilit\u00E0 Alchimia \u00E8 aumentata di {0}. Totale ({1}) - #ARCHERY Archery.Combat.DazeChance=Possibilit\u00E0 di Stordire: [[YELLOW]]{0} Archery.Combat.RetrieveChance=Possibilit\u00E0 di Recuperare Frecce: [[YELLOW]]{0} @@ -41,7 +39,6 @@ Archery.SubSkill.ArrowRetrieval.Description=Probabilit\u00E0 di recuperare frecc Archery.Listener=Tiro con l'Arco: Archery.SkillName=Arco Archery.Skillup=L'abilit\u00E0 Tiro con l'Arco \u00E8 aumentata di {0}. Totale ({1}) - #AXES Axes.Ability.Bonus.0=Maestria con l'Ascia Axes.Ability.Bonus.1={0} Danni Bonus @@ -76,7 +73,6 @@ Axes.Skills.SS.Refresh=[[GREEN]]La tua capacit\u00E0 [[YELLOW]]Spacca Crani [[GR Axes.Skills.SS.Other.Off=Spacca Crani[[GREEN]] si \u00E8 esaurito per [[YELLOW]]{0} Axes.Skills.SS.Other.On=[[GREEN]]{0}[[DARK_GREEN]] ha usato [[RED]]Spacca Crani! Axes.Skillup=L'abilit\u00E0 Asce \u00E8 aumentata di {0}. Totale ({1}) - #EXCAVATION Excavation.Ability.Lower=[[GRAY]]**ABBASSI LA PALA** Excavation.Ability.Ready=[[GREEN]]**PREPARI LA PALA** @@ -93,7 +89,6 @@ Excavation.Skills.GigaDrillBreaker.Refresh=[[GREEN]]La tua capacit\u00E0 [[YELLO Excavation.Skills.GigaDrillBreaker.Other.Off=Giga-Trivella Demolitrice[[GREEN]] si \u00E8 esaurita per [[YELLOW]]{0} Excavation.Skills.GigaDrillBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]] ha usato [[RED]]Giga-Trivella Demolitrice! Excavation.Skillup=L'abilit\u00E0 Escavazione \u00E8 aumentata di {0}. Totale ({1}) - #FISHING Fishing.Ability.Chance=Possibilit\u00E0 di Morso: [[YELLOW]]{0} Fishing.Ability.Info=Cacciatore di Magia: [[GRAY]] **Migliora insieme al Grado di Cacciatore di Tesori** @@ -101,7 +96,7 @@ Fishing.Ability.Locked.0=BLOCCATO FINO AD ABILIT\u00C0 {0}+ (SCUOTERE) Fishing.Ability.Locked.1=BLOCCATO FINO AD ABILIT\u00C0 {0}+ (PESCA SUL GHIACCIO) Fishing.Ability.Locked.2=BLOCCATO FINO AD ABILIT\u00C0 {0}+ (PESCATORE PROVETTO) Fishing.Ability.Rank=Grado di Cacciatore di Tesori: [[YELLOW]]{0}/5 -Fishing.Ability.TH.DropRate= Tasso di Drop: [[DARK_RED]]Trap: [[YELLOW]]{0} [[GRAY]]Comune: [[YELLOW]]{1} [[GREEN]]Non Comune: [[YELLOW]]{2}\n[[BLUE]]Raro: [[YELLOW]]{3} [[LIGHT_PURPLE]]Epico: [[YELLOW]]{4} [[GOLD]]Leggendario: [[YELLOW]]{5} [[AQUA]]Record: [[YELLOW]]{6} +Fishing.Ability.TH.DropRate=Tasso di Drop: [[DARK_RED]]Trap: [[YELLOW]]{0} [[GRAY]]Comune: [[YELLOW]]{1} [[GREEN]]Non Comune: [[YELLOW]]{2}\n[[BLUE]]Raro: [[YELLOW]]{3} [[LIGHT_PURPLE]]Epico: [[YELLOW]]{4} [[GOLD]]Leggendario: [[YELLOW]]{5} [[AQUA]]Record: [[YELLOW]]{6} Fishing.Ability.TH.MagicRate=Possibilit\u00E0 di Cacciatore di Magia: [[YELLOW]]{0} Fishing.Ability.Shake=Probabilit\u00E0 di Scuotere: [[YELLOW]]{0} Fishing.Ability.IceFishing=Pesca sul Ghiaccio: Vai a pescare sul ghiaccio @@ -125,14 +120,13 @@ Fishing.Ability.TH.Boom=[[GRAY]]TEMPO DI BOOM!!! Fishing.Ability.TH.Poison=[[GRAY]]C'\u00E8 qualcosa che non va bene... Fishing.SkillName=PESCA Fishing.Skillup=L'abilit\u00E0 Pesca \u00E8 aumentata di {0}. Totale ({1}) - #HERBALISM Herbalism.Ability.DoubleDropChance=Possibilit\u00E0 di Doppio Drop: [[YELLOW]]{0} Herbalism.Ability.FD=Dieta del Contadino: [[YELLOW]]Grado {0} Herbalism.Ability.GTe.Length=Durata di Terra Verde: [[YELLOW]]{0}s Herbalism.Ability.GTe.NeedMore=Ti servono pi\u00F9 semi per diffondere Terra Verde. Herbalism.Ability.GTh.Chance=Possibilit\u00E0 di Pollice Verde: [[YELLOW]]{0} -Herbalism.Ability.GTh.Fail= [[RED]]**POLLICE VERDE FALLITO** +Herbalism.Ability.GTh.Fail=[[RED]]**POLLICE VERDE FALLITO** Herbalism.Ability.GTh.Stage=Stadio di Pollice Verde: [[YELLOW]] Il raccolto cresce allo stadio {0} Herbalism.Ability.GTh=[[GREEN]]**POLLICE VERDE** Herbalism.Ability.HylianLuck=Probabilit\u00E0 di Fortuna Hylian: [[YELLOW]]{0} @@ -163,7 +157,6 @@ Herbalism.Skills.GTe.Refresh=[[GREEN]]La tua abilit\u00E0 [[YELLOW]]Terra Verde Herbalism.Skills.GTe.Other.Off=Terra Verde[[GREEN]] si \u00E8 esaurita per [[YELLOW]]{0} Herbalism.Skills.GTe.Other.On=[[GREEN]]{0}[[DARK_GREEN]] ha usato [[RED]]Terra Verde! Herbalism.Skillup=L'abilit\u00E0 Erboristeria \u00E8 aumentata di {0}. Totale ({1}) - #MINING Mining.Ability.Length=Durata di Super Demolitore: [[YELLOW]]{0}s Mining.Ability.Locked.0=BLOCCATO FINO AD ABILIT\u00C0 {0}+ (ESTRAZIONE ESPLOSIVA) @@ -191,7 +184,6 @@ Mining.Skills.SuperBreaker.Other.Off=Super Demolitore[[GREEN]] si \u00E8 esaurit Mining.Skills.SuperBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]] ha usato [[RED]]Super Demolitore! Mining.Skills.SuperBreaker.Refresh=[[GREEN]]La tua capacit\u00E0 [[YELLOW]]Super Demolitore [[GREEN]]si \u00E8 rigenerata! Mining.Skillup=L'abilit\u00E0 Estrazione \u00E8 aumentata di {0}. Totale ({1}) - #Blast Mining Mining.Blast.Boom=[[GRAY]]**BOOM** Mining.Blast.Effect=+{0} minerale raccolto, -{1} macerie prodotte, drop x{2} @@ -199,7 +191,6 @@ Mining.Blast.Radius.Increase=Incremento del Raggio di Esplosione: [[YELLOW]]+{0} Mining.Blast.Rank=Estrazione Esplosiva: [[YELLOW]] Grado {0}/8 [[GRAY]]({1}) Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] ha usato [[RED]]Estrazione Esplosiva! Mining.Blast.Refresh=[[GREEN]]La tua capacit\u00E0 [[YELLOW]]Estrazione Esplosiva [[GREEN]]si \u00E8 rigenerata! - #REPAIR Repair.SubSkill.Repair.Name=Riparazione Repair.SubSkill.Repair.Description=Ripara Attrezzi & Armature @@ -221,7 +212,7 @@ Repair.Error=[[DARK_RED]]mcMMO si \u00E8 imbattuto in un errore mentre tentava d Repair.Listener.Anvil=[[DARK_RED]]Hai piazzato un'incudine; le incudini possono riparare attrezzi e armature. Repair.Listener=Riparazione: Repair.SkillName=RIPARAZIONE -Repair.Skills.AdeptDiamond= [[DARK_RED]]Non sei abbastanza abile da riparare il Diamante. +Repair.Skills.AdeptDiamond=[[DARK_RED]]Non sei abbastanza abile da riparare il Diamante. Repair.Skills.AdeptGold=[[DARK_RED]]Non sei abbastanza abile da riparare l'Oro. Repair.Skills.AdeptIron=[[DARK_RED]]Non sei abbastanza abile da riparare il Ferro. Repair.Skills.AdeptStone=[[DARK_RED]]Non sei abbastanza abile da riparare la Pietra. @@ -233,7 +224,6 @@ Repair.Skills.StackedItems=[[DARK_RED]]Non puoi riparare oggetti ammucchiati. Repair.Skills.Super.Chance=Possibilit\u00E0 Super Riparazione: [[YELLOW]]{0} Repair.Skillup=L'abilit\u00E0 Riparazione \u00E8 aumentata di {0}. Totale ({1}) Repair.Pretty.Name=Riparazione - #Arcane Forging Repair.Arcane.Chance.Downgrade=[[GRAY]]Probabilit\u00E0 di Degradazione di FA: [[YELLOW]]{0}% Repair.Arcane.Chance.Success=[[GRAY]]Tasso di Successo di FA: [[YELLOW]]{0}% @@ -242,7 +232,6 @@ Repair.Arcane.Fail=Il potere arcano ha abbandonato l'oggetto permanentemente. Repair.Arcane.Lost=Non sei stato abbastanza abile da mantenere alcun incantesimo. Repair.Arcane.Perfect=[GREEN]]Hai mantenuto le energie arcane in questo oggetto. Repair.Arcane.Rank=Forgiatura Arcana: [[YELLOW]]Grado {0}/4 - #SALVAGE Salvage.Pretty.Name=Rottamazione Salvage.SubSkill.AdvancedSalvage.Name=Rottamazione Avanzata @@ -258,14 +247,13 @@ Salvage.Arcane.ExtractPartial=[[GRAY]]Probabilit\u00E0 di incantamento AS parzia Salvage.Skills.Success=[[GREEN]]Oggetto rottamato! Salvage.Skills.Adept.Damaged=[[DARK_RED]]Non sei abbastanza abile da rottamare gli oggetti danneggiati. Salvage.Skills.Adept.Level=Devi essere di livello [[YELLOW]]{0}[[RED]] per rottamare [[YELLOW]]{1} -Salvage.Skills.TooDamaged= [[DARK_RED]]Questo oggetto \u00E8 troppo danneggiato per essere rottamato. +Salvage.Skills.TooDamaged=[[DARK_RED]]Questo oggetto \u00E8 troppo danneggiato per essere rottamato. Salvage.Skills.ArcaneFailed=Non sei stato capace di estrarre la conoscenza contenuta in questo oggetto. Salvage.Skills.ArcanePartial=Sei stato solo in grado di estrarre alcune delle conoscenze contenute all'interno di questo oggetto. Salvage.Skills.ArcaneSuccess=[[GREEN]]Sei in grado di estrarre tutte le conoscenze contenute in questo oggetto! Salvage.Listener.Anvil=[[DARK_RED]]Hai piazzato un'incudine da Rottamazione, usala per Rottamare attrezzi e armature. Salvage.Listener=Rottamazione: Salvage.SkillName=ROTTAMAZIONE - #SWORDS Swords.Ability.Lower=[[GRAY]]**ABBASSI LA SPADA** Swords.Ability.Ready=[[GREEN]]**PREPARI LA SPADA** @@ -296,7 +284,6 @@ Swords.Skills.SS.Other.Off=Colpi Seghettati[[GREEN]] si \u00E8 esaurito per [[YE Swords.Skills.SS.Other.On=[[GREEN]]{0}[[DARK_GREEN]] ha usato [[RED]]Colpi Seghettati! Swords.Skillup=L'abilit\u00E0 Spade \u00E8 aumentata di {0}. Totale ({1}) Swords.SS.Length=Durata di Colpi Seghettati: [[YELLOW]]{0}s - #TAMING Taming.Ability.Bonus.0=Sicurezza Ambientale Taming.Ability.Bonus.1=I lupi evitano il pericolo @@ -341,13 +328,12 @@ Taming.Listener=Addomesticamento: Taming.SkillName=ADDOMESTICAMENTO Taming.Skillup=L'abilit\u00E0 Addomesticamento \u00E8 aumentata di {0}. Totale ({1}) Taming.Summon.Complete=[[GREEN]]Evocazione completa -Taming.Summon.Lifespan= (Durata: {0}s) +Taming.Summon.Lifespan=(Durata: {0}s) Taming.Summon.Fail.Ocelot=Hai troppi ocelot vicino per poterne evocare degli altri. Taming.Summon.Fail.Wolf=Hai troppi lupi vicino per poterne evocare degli altri. Taming.Summon.Fail.Horse=Hai troppi cavalli nelle vicinanze per evocarne altri. Taming.Summon.Fail.TooMany=Hai raggiunto il limite massimo di animali evocabili. [[YELLOW]]({0}) Taming.Summon.Name.Format={1} di {0} - #UNARMED Unarmed.Ability.Berserk.Length=Durata di Furore: [[YELLOW]]{0}s Unarmed.Ability.Bonus.0=Stile del Braccio di Ferro @@ -377,7 +363,6 @@ Unarmed.Skills.Berserk.Other.Off=Furore[[GREEN]] si \u00E8 esaurito per [[YELLOW Unarmed.Skills.Berserk.Other.On=[[GREEN]]{0}[[DARK_GREEN]] ha usato [[RED]]Furore! Unarmed.Skills.Berserk.Refresh=[[GREEN]]La tua capacit\u00E0 [[YELLOW]]Furore [[GREEN]]si \u00E8 rigenerata! Unarmed.Skillup=L'abilit\u00E0 Lotta \u00E8 aumentata di {0}. Totale ({1}) - #WOODCUTTING Woodcutting.Ability.0=Soffia Foglie Woodcutting.Ability.1=Soffia via le foglie @@ -400,13 +385,11 @@ Woodcutting.Skills.TreeFeller.Other.On=[[GREEN]]{0}[[DARK_GREEN]] ha usato [[RED Woodcutting.Skills.TreeFeller.Splinter=LA TUA ASCIA SI FRANTUMA IN DECINE DI PEZZI! Woodcutting.Skills.TreeFeller.Threshold=Quell'albero \u00E8 troppo grande! Woodcutting.Skillup=L'abilit\u00E0 Taglialegna \u00E8 aumentata di {0}. Totale ({1}) - #ABILITIY ##generic Ability.Generic.Refresh=[[GREEN]]**CAPACIT\u00C0 RIGENERATE!** Ability.Generic.Template.Lock=[[GRAY]]{0} Ability.Generic.Template=[[GOLD]]{0}: [[DARK_AQUA]]{1} - #COMBAT Combat.ArrowDeflect=[[WHITE]]**FRECCIA DEVIATA** Combat.BeastLore=[[GREEN]]**CONOSCENZA DELLE BESTIE** @@ -416,7 +399,6 @@ Combat.Gore=[[GREEN]]**SBRANATO** Combat.StruckByGore=**SEI STATO SBRANATO** Combat.TargetDazed=Il bersaglio \u00E8 rimasto [[DARK_RED]]Stordito Combat.TouchedFuzzy=Urto Stordino. Vado nel Pallone. - #COMMANDS ##generic mcMMO.Description=[[DARK_AQUA]]Riguardo il [[DARK_AQUA]]Progetto [[YELLOW]]mcMMO:,[[GOLD]]mcMMO \u00E8 una mod GdR [[RED]]open source[[GOLD]] creata nel Febbraio 2011,[[GOLD]]da [[BLUE]]com.gmail.nossr50[[GOLD]]. L'obiettivo \u00E8 quello di fornire un'esperienza GdR di qualit\u00E0.,[[DARK_AQUA]]Suggerimenti:,[[GOLD]] - [[GREEN]]Usa [[RED]]/mcmmo help[[GREEN]] per vedere i comandi,[[GOLD]] - [[GREEN]]Digita [[RED]]/NOMEABILIT\u00C0[[GREEN]] per vedere informazioni dettagliate su un'abilit\u00E0,[[DARK_AQUA]]Sviluppatori:,[[GOLD]] - [[GREEN]]com.gmail.nossr50 [[BLUE]](Fondatore),[[GOLD]] - [[GREEN]]GJ [[BLUE]](Capo Progetto),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](Sviluppatore),[[GOLD]] - [[GREEN]]bm01 [[BLUE]](Sviluppatore),[[GOLD]] - [[GREEN]]TfT_02 [[BLUE]](Sviluppatore),[[GOLD]] - [[GREEN]]Glitchfinder [[BLUE]](Sviluppatore),[[GOLD]] - [[GREEN]]t00thpick1 [[BLUE]](Sviluppatore),[[DARK_AQUA]]Link Utili:,[[GOLD]] - [[GREEN]]https://github.com/mcMMO-Dev/mcMMO/issues[[GOLD]] Segnalazione Bug,[[GOLD]] - [[GREEN]]#mcmmo @ irc.esper.net[[GOLD]] IRC Chat, @@ -525,7 +507,7 @@ Commands.Party.Alliance.Invite.Accepted=[[GREEN]]Invito di alleanza accettato. Commands.Party.Alliance.None=Il tuo gruppo non ha un alleato. Commands.Party.Alliance.AlreadyAllies=Il tuo gruppo ha gi\u00E0 un'alleato. Sciogli l'alleanza con [[DARK_AQUA]]/party alliance disband Commands.Party.Alliance.Help.0=Questo gruppo non ha formato un'alleanza. Invita un capo gruppo. -Commands.Party.Alliance.Help.1= fai un'alleanza con [[DARK_AQUA]]/party alliance invite [[RED]]. +Commands.Party.Alliance.Help.1=fai un'alleanza con [[DARK_AQUA]]/party alliance invite [[RED]]. Commands.ptp.Enabled=Teletrasporto del gruppo [[GREEN]]abilitato Commands.ptp.Disabled=Teletrasporto del gruppo [[RED]]disabilitato Commands.ptp.NoRequests=Non hai richieste di teletrasporto in questo momento @@ -557,7 +539,7 @@ Commands.SkillInfo=[[GREEN]]- Vedi informazioni dettagliate su un'abilit\u00E0 Commands.Stats.Self=LE TUE STATISTICHE Commands.Stats=[[GREEN]]- Visualizza le tue statistiche mcMMO Commands.ToggleAbility=[[GREEN]]- Attiva o disattiva l'attivazione delle abilit\u00E0 con click destro -Commands.Usage.0= [[RED]]L'uso appropriato \u00E8 /{0} +Commands.Usage.0=[[RED]]L'uso appropriato \u00E8 /{0} Commands.Usage.1=L'uso appropriato \u00E8 /{0} {1} Commands.Usage.2=L'uso appropriato \u00E8 /{0} {1} {2} Commands.Usage.3=L'uso appropriato \u00E8 /{0} {1} {2} {3} @@ -574,7 +556,6 @@ Commands.Usage.XP=xp mcMMO.NoInvites=Non hai inviti in questo momento mcMMO.NoPermission=[[DARK_RED]]Permessi insufficienti. mcMMO.NoSkillNote=[[DARK_GRAY]]Se non hai accesso a un'abilit\u00E0 non sar\u00E0 mostrata qui. - ##party Party.Forbidden=[mcMMO] I gruppi non sono permessi in questo mondo (vedi i Permessi) Party.Help.0=L'uso appropriato \u00E8 [[DARK_AQUA]]{0} [password]. @@ -651,7 +632,6 @@ Party.ItemShare.Category.Mining=Estrazione Party.ItemShare.Category.Herbalism=Erboristeria Party.ItemShare.Category.Woodcutting=Taglialegna Party.ItemShare.Category.Misc=Varie - ##xp Commands.XPGain.Acrobatics=Cadere Commands.XPGain.Alchemy=Preparazione Pozioni @@ -678,27 +658,23 @@ Commands.xprate.proper.2=Per favore specifica "true" o "false" per indicare se q Commands.xprate.started.0=[[GOLD]]\u00C8 INIZIATO UN EVENTO XP PER mcMMO! Commands.xprate.started.1=[[GOLD]]IL TASSO DI XP DI mcMMO ORA \u00C8 {0}x! XPRate.Event=[[GOLD]]\u00C8 in corso un evento mcMMO sul tasso XP! Il tasso XP \u00E8 {0}x! - #EFFECTS ##generic Effects.Effects=EFFETTI Effects.Child=[[DARK_GRAY]]LVL: [[GREEN]]{0} Effects.Level=[[DARK_GRAY]]LVL: [[GREEN]]{0} [[DARK_AQUA]]XP[[YELLOW]]([[GOLD]]{1}[[YELLOW]]/[[GOLD]]{2}[[YELLOW]]) -Effects.Parent= [[GOLD]]{0} - +Effects.Parent=[[GOLD]]{0} - Effects.Template=[[DARK_AQUA]]{0}: [[GREEN]]{1} - #GUIDES Guides.Available=[[GRAY]]Guida per {0} disponibile - digita /{1} ? [pagina] Guides.Header=[[GOLD]]-=[[GREEN]]{0} Guida[[GOLD]]=- Guides.Page.Invalid=Non \u00E8 un numero di pagina valido! Guides.Page.OutOfRange=Quella pagina non esiste, ci sono solo {0} pagine in totale. -Guides.Usage= L'uso \u00E8 /{0} ? [pagina] - +Guides.Usage=L'uso \u00E8 /{0} ? [pagina] ##Acrobatics Guides.Acrobatics.Section.0=[[DARK_AQUA]]Riguardo L'Acrobatica:\n[[YELLOW]]L'Acrobatica \u00E8 l'arte di muoversi con grazia in mcMMO.\n[[YELLOW]]Essa fornisce bonus di combattimento e bonus di danni ambientali.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Per guadagnare XP in questa abilit\u00E0 \u00E8 necessario\n[[YELLOW]]eseguire schivate in combattimento\n[[YELLOW]]o sopravvivere a cadute che danneggiano. Guides.Acrobatics.Section.1=[[DARK_AQUA]]Come funziona Rotolamento?\n[[YELLOW]]Hai una possibilit\u00E0 passiva quando prendi danni da caduta\n[[YELLOW]]di annullare il danno subito. Puoi tenere premuto il pulsante di\n[[YELLOW]]accovacciata per raddoppiare la possibilit\u00E0 durante la caduta.\n[[YELLOW]]Questo attiva una Capriola Aggraziata invece di quella\n[[YELLOW]]standard. Le Capriole Aggraziate sono come quelle normali\n[[YELLOW]]ma hanno il doppio delle probabilit\u00E0 di verificarsi e forniscono\n[[YELLOW]]pi\u00F9 sicurezza. La possibilit\u00E0 di capriola \u00E8 legata al livello abilit\u00E0 Guides.Acrobatics.Section.2=[[DARK_AQUA]]Come funziona la Schivata?\n[[YELLOW]]La Schivata \u00E8 una possibilit\u00E0 passiva quando si \u00E8\n[[YELLOW]]feriti in combattimento di dimezzare il danno preso.\n[[YELLOW]]\u00C8 legato al tuo livello di abilit\u00E0. - ##Alchemy Guides.Alchemy.Section.0=[[DARK_AQUA]]Riguardo l'Alchimia:\n[[YELLOW]]L'Alchimia riguarda il preparare pozioni.\n[[YELLOW]]Fornisce un aumento di velocit\u00E0 nella produzione di pozioni, cos\u00EC\n[[YELLOW]]come l'aggiunta di nuove (prima) pozioni introvabili.\n\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Per guadagnare XP in questa abilit\u00E0 devi preparare pozioni. Guides.Alchemy.Section.1=[[DARK_AQUA]]Come funziona la Catalisi?\n[[YELLOW]]La Catalisi accelera il processo di preparazione,\n[[YELLOW]]con una velocit\u00E0 massima di 4x al livello 1000.\n[[YELLOW]]Questa abilit\u00E0 \u00E8 sbloccata al livello 100 di default. @@ -707,13 +683,11 @@ Guides.Alchemy.Section.3=[[DARK_AQUA]]Ingredienti Intrugli livello 1:\n[[YELLOW] Guides.Alchemy.Section.4=[[DARK_AQUA]]Ingredienti Intrugli livello 2:\n[[YELLOW]]Carota (Pozione della Velocit\u00E0)\n[[YELLOW]]Palla di Gelatina (Pozione di Noia)\n\n[[DARK_AQUA]]Ingredienti Intrugli livello 3:\n[[YELLOW]]Quarzo (Pozione di Assorbimento)\n[[YELLOW]]Fungo Rosso (Pozione del Salto) Guides.Alchemy.Section.5=[[DARK_AQUA]]Ingredienti Intrugli livello 4:\n[[YELLOW]]Mela (Pozione di Potenziamento Salute)\n[[YELLOW]]Carne Marcia (Pozione della Fame)\n\n[[DARK_AQUA]]Ingredienti Intrugli livello 5:\n[[YELLOW]]Fungo Marrone (Pozione di Nausea)\n[[YELLOW]]Sacca d'Inchiostro (Pozione di Cecit\u00E0) Guides.Alchemy.Section.6=[[DARK_AQUA]]Ingredienti Intrugli livello 6:\n[[YELLOW]]Felce (Pozione di Saturazione)\n\n[[DARK_AQUA]]Ingredienti Intrugli livello 7:\n[[YELLOW]]Patata Velenosa (Pozione di Decadimento)\n\n[[DARK_AQUA]]Concoctions tier 8 ingredients:\n[[YELLOW]]Mela d'Oro (Pozione di Resistenza) - ##Archery Guides.Archery.Section.0=[[DARK_AQUA]]Riguardo Tiro con l'Arco:\n[[YELLOW]]Tiro con l'Arco riguarda il tirare con arco e freccia.\n[[YELLOW]]Fornisce vari bonus di combattimento, come un incremento\n[[YELLOW]]di danno che scala con il livello e l'abilit\u00E0 di stordire i tuoi\n[[YELLOW]]avversari in PvP. Inoltre puoi recuperare alcune delle\n[[YELLOW]]frecce spese dai cadaveri dei tuoi nemici.\n\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Per guadagnare XP in questa abilit\u00E0 \u00E8 necessario\n[[YELLOW]]colpire i mob o gli altri giocatori. Guides.Archery.Section.1=[[DARK_AQUA]]Come funziona Tiro da Maestro?\n[[YELLOW]]Tiro da Maestro fornisce un danno aggiuntivo ai tuoi colpi.\n[[YELLOW]]Il danno bonus da Tiro da Maestro aumenta\n[[YELLOW]]all'aumentare del livello di Tiro con l'Arco.\n[[YELLOW]]Con le impostazioni di default, il danno dei tiri con l'arco\n[[YELLOW]]aumenta del 10% ogni 50 livelli, fino a un massimo del 200%. Guides.Archery.Section.2=[[DARK_AQUA]]Come funziona Stordire?\n[[YELLOW]]Hai una possibilit\u00E0 passiva di stordire gli altri giocatori quando\n[[YELLOW]]li colpisci. Quando Stordire si innesca costringe gli avversari\n[[YELLOW]]a guardare verso l'alto per una breve durata.\n[[YELLOW]]Un colpo di Stordire procura anche ulteriori 4 danni (2 cuori). Guides.Archery.Section.3=[[DARK_AQUA]]Come funziona Recupero Frecce?\n[[YELLOW]]Hai una possibilit\u00E0 passiva di recuperare alcune\n[[YELLOW]]delle tue frecce quando uccidi un mob con l'arco.\n[[YELLOW]]Questa possibilit\u00E0 \u00E8 aumentata dal livello in Tiro con l'Arco.\n[[YELLOW]Di default, questa capacit\u00E0 aumenta di 0.1% per livello,\n[[YELLOW]]fino al 100% al livello 1000. - ##Axes Guides.Axes.Section.0=[[DARK_AQUA]]Riguardo Asce:\n[[YELLOW]]Con l'abilit\u00E0 Asce \u00E8 possibile utilizzare l'ascia per molto di\n[[YELLOW]]pi\u00F9 che solo deforestare! \u00E8 possibile incidere e sgretolare\n[[YELLOW]]mob e giocatori per guadagnare XP, colpire mob con l'effetto\n[[YELLOW]]di contraccolpo e infliggere danni critici MORTALI sui mob e\n[[YELLOW]]giocatori. La tua ascia diventa anche un biotrituratore\n[[YELLOW]]portatile, abbattendo l'armatura del nemico con facilit\u00E0 con\n[[YELLOW]]l'aumentare del livello.\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Per guadagnare XP in questa abilit\u00E0 devi colpire mob\n[[YELLOW]]o altri giocatori con la tua Ascia. Guides.Axes.Section.1=[[DARK_AQUA]]Come funziona Spacca Crani?\n[[YELLOW]]Questa capacit\u00E0 consente di fare un colpo EaA\n[[YELLOW]](Effetto ad Area). Questo EaA infligger\u00E0 la met\u00E0 del danno\n[[YELLOW]]fatto all'obbiettivo principale, quindi \u00E8 ottimo per sgombrare\n[[YELLOW]]grandi mucchi di mob. @@ -721,7 +695,6 @@ Guides.Axes.Section.2=[[DARK_AQUA]]Come funziona Colpi Critici?\n[[YELLOW]]Colpi Guides.Axes.Section.3=[[DARK_AQUA]]Come funziona Mestria con l'Ascia?\n[[YELLOW]]Maestria con l'Ascia \u00E8 una capacit\u00E0 passiva\n[[YELLOW]]che aggiunge danno ai tuoi colpi quando usi delle Asce.\n[[YELLOW]]Di default il bonus danno aumenta di 1 ogni 50 livelli,\n[[YELLOW]]fino a 4 danni extra al livello 200. Guides.Axes.Section.4=[[DARK_AQUA]]Come funziona Sfonda Armature?\n[[YELLOW]]Un attacco con abbastanza forza da frantumare un armatura!\n[[YELLOW]]Sfonda Armature ha una possibilit\u00E0 passiva di danneggiare\n[[YELLOW]]l'armatura dell'avversario. Il livello in Asce aumenta il danno. Guides.Axes.Section.5=[[DARK_AQUA]]Come funziona Impatto Maggiore?\n[[YELLOW]]Hai una possibilit\u00E0 passiva di ottenere un maggiore impatto\n[[YELLOW]]colpendo i mob o i giocatori con un'ascia.\n[[YELLOW]]Di default la possibilit\u00E0 \u00E8 del 25%. Questa capacit\u00E0\n[[YELLOW]]ha un estremo effetto contraccolpo, simile all'incantesimo\n[[YELLOW]]Contraccolpo. Inoltre, infligge danno bonus al bersaglio. - ##Excavation Guides.Excavation.Section.0=[[DARK_AQUA]]Riguardo l'Escavazione:\n[[YELLOW]]L'Escavazione \u00E8 l'atto di scavare per trovare tesori.\n[[YELLOW]]Scavando la terra si trovano tesori.\n[[YELLOW]]Quanto pi\u00F9 si esegue questa operazione\n[[YELLOW]]pi\u00F9 tesori si possono trovare.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Per guadagnare XP devi scavare con una pala in mano.\n[[YELLOW]]Solo alcuni materiali possono essere scavati per tesori e XP. Guides.Excavation.Section.1=[[DARK_AQUA]]Materiali Compatibili:\n[[YELLOW]]Erba, Terra, Sabbia, Argilla, Ghiaia, Micelio,\n[[YELLOW]]Sabbia delle Anime, Neve @@ -729,7 +702,6 @@ Guides.Excavation.Section.2=[[DARK_AQUA]]Come usare Giga-Trivella Demolitrice:\n Guides.Excavation.Section.3=[[DARK_AQUA]]Cos'\u00E8 Giga-Trivella Demolitrice?\n[[YELLOW]]Giga-Trivella Demolitrice \u00E8 una capacit\u00E0 con raffreddamento\n[[YELLOW]]legata all'abilit\u00E0 Escavazione. Triplica la possibilit\u00E0\n[[YELLOW]]di trovare tesori e abilita la rottura istantanea\n[[YELLOW]]sui materiali di Escavazione. Guides.Excavation.Section.4=[[DARK_AQUA]]Come funziona Cacciatore di Tesori?\n[[YELLOW]]Ogni possibile tesoro per Escavazione ha il suo livello\n[[YELLOW]]di abilit\u00E0 richiesto per essere droppato, di conseguenza \u00E8\n[[YELLOW]]difficile dire quanto ti sta aiutando.\n[[YELLOW]]Basta tenere a mente che pi\u00F9 alta \u00E8 l'abilit\u00E0 di Escavazione,\n[[YELLOW]]pi\u00F9 tesori si possono trovare.\n[[YELLOW]]E anche tenere a mente che ogni tipo di materiale\n[[YELLOW]]di Escavazione compatibile ha la sua lista di tesori unici.\n[[YELLOW]]In altre parole si trovano diversi tesori nella Terra\n[[YELLOW]]da quelli che si troverebbero nella Ghiaia. Guides.Excavation.Section.5=[[DARK_AQUA]]Note sull'Escavazione:\n[[YELLOW]]I drop dell'Escavazione sono completamente personalizzabili\n[[YELLOW]]Quindi, i risultati variano da server a server. - ##Fishing Guides.Fishing.Section.0=[[DARK_AQUA]]Riguardo la Pesca:\n[[YELLOW]]Con l'abilit\u00E0 Pesca, pescare \u00E8 di nuovo emozionante!\n[[YELLOW]]Trovare tesori nascosti, e scrollare oggetti dai mob.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Catturare pesci. Guides.Fishing.Section.1=[[DARK_AQUA]]Come funziona Cacciatore di Tesori?\n[[YELLOW]]Questa capacit\u00E0 consente di trovare tesori pescando\n[[YELLOW]]con una piccola possibilit\u00E0 di oggetti incantati.\n[[YELLOW]]Ogni possibile tesoro di pesca ha una possibilit\u00E0\n[[YELLOW]]di uscire a ogni livello. Dipende per\u00F2 dalla\n[[YELLOW]]rarit\u00E0 dell'oggetto ogni quanto esce.\n[[YELLOW]]Pi\u00F9 \u00E8 alta la tua abilit\u00E0 di Pesca, maggiori\n[[YELLOW]]sono le possibilit\u00E0 di trovare tesori migliori. @@ -738,7 +710,6 @@ Guides.Fishing.Section.3=[[DARK_AQUA]]Come funziona Pescatore Provetto?\n[[YELLO Guides.Fishing.Section.4=[[DARK_AQUA]]Come funziona Scuotere?\n[[YELLOW]]Questa capacit\u00E0 attiva consente di scrollare oggetti sciolti\n[[YELLOW]]dai mob agganciandoli con una canna da pesca.\n[[YELLOW]]I mob dropperanno gli oggetti che normalmente droppano\n[[YELLOW]]alla morte. \u00C8 anche possibile acquisire le teste dei mob,\n[[YELLOW]]che sono normalmente inottenibili in modalit\u00E0 sopravvivenza. Guides.Fishing.Section.5=[[DARK_AQUA]]Come funziona Dieta del Pescatore?\n[[YELLOW]]Questa capacit\u00E0 passiva aumenta la fame ripristinata \n[[YELLOW]]mangiando pesce. Guides.Fishing.Section.6=[[DARK_AQUA]]Note sulla Pesca:\n[[YELLOW]]I drop di pesca sono completamente personalizzabili,\n[[YELLOW]]quindi variano da server a server. - ##Herbalism Guides.Herbalism.Section.0=[[DARK_AQUA]]Riguardo l'Erboristeria:\n[[YELLOW]]L'Erboristeria riguarda il raccogliere le erbe e le piante.\n\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Raccogliendo piante ed erbe. Guides.Herbalism.Section.1=[[DARK_AQUA]]Blocchi Compatibili\n[[YELLOW]]Grano, Patate, Carote, Meloni, \n[[YELLOW]]Zucchine, Canne da Zucchero, Fave di Cacao, Fiori, Cactus,\n[[YELLOW]]Funghi, Verruche del Nether, Ninfee, e Rampicanti. @@ -748,7 +719,6 @@ Guides.Herbalism.Section.4=[[DARK_AQUA]]Come funziona Pollice Verde (Pietre/Matt Guides.Herbalism.Section.5=[[DARK_AQUA]]Come funziona Dieta del Contadino?\n[[YELLOW]]Questa capacit\u00E0 passiva aumenta la fame ripristinata \n[[YELLOW]]mangiando Pane, Biscotti, Meloni, Zuppe di Funghi, Carote,\n[[YELLOW]]e Patate. Guides.Herbalism.Section.6=[[DARK_AQUA]]Come funziona Fortuna Hylian?\n[[YELLOW]]Questa capacit\u00E0 passiva d\u00E0 una possibilit\u00E0 di trovare\n[[YELLOW]]oggetti rari quando certi blocchi sono rotti con una spada. Guides.Herbalism.Section.7=[[DARK_AQUA]]Come funziona il Doppio Drop?\n[[YELLOW]]Questa abilit\u00E0 passiva d\u00E0 ai giocatori pi\u00F9 resa\n[[YELLOW]]dai loro raccolti. - ##Mining Guides.Mining.Section.0=[[DARK_AQUA]]Riguardo l'Estrazione:\n[[YELLOW]]L'Estrazione consiste nell'estrarre pietra e minerali.\n[[YELLOW]]Fornisce bonus alla quantit\u00E0 di materiali droppati minando.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Per guadagnare XP in questa abilit\u00E0, devi minare con un piccone.\n[[YELLOW]]Solo alcuni blocchi assegnano XP. Guides.Mining.Section.1=[[DARK_AQUA]]Materiali compatibili:\n[[YELLOW]]Pietra, Carbone Grezzo, Ferro Grezzo, Oro Grezzo, Diamante Grezzo, Pietrarossa Grezza,\n[[YELLOW]]Lapislazzuli Grezzo, Ossidiana, Pietra Muschiosa, Pietra dell'End,\n[[YELLOW]]Luminite e Netherrack. @@ -756,30 +726,25 @@ Guides.Mining.Section.2=[[DARK_AQUA]]Come usare il Super Demolitore:\n[[YELLOW]] Guides.Mining.Section.3=[[DARK_AQUA]]Cos'\u00E8 il Super Demolitore?\n[[YELLOW]]Il Super Demolitore \u00E8 una capacit\u00E0 a tempo legata all'abilit\u00E0\n[[YELLOW]]Estrazione. Triplica la possibilit\u00E0 di drop di oggetti extra e\n[[YELLOW]]abilita la rottura istantanea dei materiali estratti. Guides.Mining.Section.4=[[DARK_AQUA]]Come usare l'Estrazione Esplosiva:\n[[YELLOW]]Con un detonatore in mano, un acciarino di default,\n[[YELLOW]]accovacciati e fai click destro su TNT a distanza. Questo causer\u00E0\n[[YELLOW]]l'esplosione istantanea della TNT. Guides.Mining.Section.5=[[DARK_AQUA]]Come funziona Estrazione Esplosiva?\n[[YELLOW]]Estrazione Esplosiva \u00E8 una capacit\u00E0 legata all'abilit\u00E0\n[[YELLOW]]Estrazione. Da bonus minando con la TNT e consente di\n[[YELLOW]]detonare da lontano la TNT. Ci sono tre parti di Estrazione\n[[YELLOW]]Esplosiva. La prima parte \u00E8 Bombe Pi\u00F9 Grandi, che aumenta il\n[[YELLOW]]raggio d'esplosione. La seconda parte \u00E8 Esperto di Demolizioni,\n[[YELLOW]]che riduce il danno dalle esplosioni di TNT. La terza parte\n[[YELLOW]]aumenta semplicemente la quantit\u00E0 di minerali droppati dalla \n[[YELLOW]]TNT e riduce i detriti droppati. - ##Repair Guides.Repair.Section.0=[[DARK_AQUA]]Riguardo la Riparazione:\n[[YELLOW]]La Riparazione consente di utilizzare un blocco di ferro\n[[YELLOW]]per riparare armature e strumenti.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Riparando strumenti e armature con l'incudine mcMMO.\n[[YELLOW]]Questa \u00E8 di default un blocco di ferro e non deve essere\n[[YELLOW]]confusa con l'incudine di Minecraft Vanilla. Guides.Repair.Section.1=[[DARK_AQUA]]Come posso usare Riparazione?\n[[YELLOW]]Piazza un'incudine mcMMO e fai click destro per riparare \n[[YELLOW]]l'oggetto in mano. Questo consuma 1 oggetto per ogni uso. Guides.Repair.Section.2=[[DARK_AQUA]]Come funziona Maestria nella Riparazione?\n[[YELLOW]]Maestria nella Riparazione aumenta la quantit\u00E0 di riparazione.\n[[YELLOW]]La riparazione extra dipende dal tuo livello di Riparazione. Guides.Repair.Section.3=[[DARK_AQUA]]Come funziona Super Riparazione?\n[[YELLOW]]Super Riparazione \u00E8 una capacit\u00E0 passiva. Riparando un oggetto,\n[[YELLOW]]concede ai giocatori una possibilit\u00E0 di riparare un oggetto con\n[[YELLOW]]doppia efficacia. Guides.Repair.Section.4=[[DARK_AQUA]]Come funziona Forgiatura Arcana?\n[[YELLOW]]Questa capacit\u00E0 passiva consente di riparare oggetti con\n[[YELLOW]]una certa possibilit\u00E0 di mantenere i suoi incantesimi. Gli\n[[YELLOW]]incantesimi possono essere mantenuti ai loro livelli,\n[[YELLOW]]degradati a livelli pi\u00F9 bassi, o persi del tutto. - ##Salvage Guides.Salvage.Section.0=[[DARK_AQUA]]Riguardo la Rottamazione:\n[[YELLOW]]La Rottamazione consente di usare un blocco d'oro\n[[YELLOW]]per rottamare armature e strumenti.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Rottamazione \u00E8 un'abilit\u00E0 figlia di Riparazione\n[[YELLOW]]e Pesca, il livello di abilit\u00E0 \u00E8 basato sui livelli\n[[YELLOW]]di Pesca e Riparazione. Guides.Salvage.Section.1=[[DARK_AQUA]]Come posso usare la Rottamazione?\n[[YELLOW]]Piazza un'incudine di Rottamazione mcMMO e facci click\n[[YELLOW]]destro per rottamare l'oggetto che hai in mano. Esso si\n[[YELLOW]]romper\u00E0 e restituir\u00E0 i materiali usati per costruirlo.\n\n[[YELLOW]]Per esempio, rottamando un piccone di ferro dar\u00E0 lingotti\n[[YELLOW]]di ferro. Guides.Salvage.Section.2=[[DARK_AQUA]]Come funziona la Rottamazione Avanzata?\n[[YELLOW]]Quando sbloccata, questa capacit\u00E0 consente di rottamare\n[[YELLOW]]oggetti danneggiati. La percentuale di resa aumenta con\n[[YELLOW]]il salire di livello. Una resa maggiore significa che si possono\n[[YELLOW]]ottenere pi\u00F9 materiali indietro. Con la Rottamazione\n[[YELLOW]]Avanzata si otterr\u00E0 sempre 1 materiale indietro, a meno che\n[[YELLOW]]non sia troppo danneggiato. Quindi non ci si deve preoccupare\n[[YELLOW]]di distruggere oggetti senza ottenere nulla in cambio. Guides.Salvage.Section.3=[[DARK_AQUA]]Per illustrare come funziona, ecco un esempio:\n[[YELLOW]]Diciamo che rottamiamo un piccone d'oro danneggiato per il 20%,\n[[YELLOW]]ci\u00F2 significa che l'importo massimo che potrebbe ottenere solo 2\n[[YELLOW]](Perch\u00E9 il piccone \u00E8 fatto con 3 lingotti - ciascuno del valore di\n[[YELLOW]]33,33% durabilit\u00E0) che \u00E8 uguale a 66%. Se la percentuale di\n[[YELLOW]]resa \u00E8 sotto il 66% non si \u00E8 in grado di ottenere 2 lingotti.\n[[YELLOW]]Se \u00E8 al di sopra di questo valore si \u00E8 in grado di ottenere lo\n[[YELLOW]]"intero importo", il che significa che si otterranno 2 lingotti. Guides.Salvage.Section.4=[[DARK_AQUA]]Come funziona la Rottamazione Arcana?\n[[YELLOW]]Questa capacit\u00E0 consente di ottenere libri incantati\n[[YELLOW]]durante la rottamazione di oggetti incantati. A seconda del\n[[YELLOW]]livello la possibilit\u00E0 di estrarre con successo\n[[YELLOW]]un incantesimo totale o parziale varia.\n\n[[YELLOW]]Quando un incantesimo \u00E8 parzialmente estratto, il libro\n[[YELLOW]]incantato avr\u00E0 un livello inferiore. - ##Smelting Guides.Smelting.Section.0=Prossimamente... - ##Swords Guides.Swords.Section.0=[[DARK_AQUA]]Riguardo Spade:\n[[YELLOW]]Questa abilit\u00E0 d\u00E0 bonus di combattimento a chi\n[[YELLOW]]combatte con una spada.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Il guadagno degli XP \u00E8 basato sul danno inflitto\n[[YELLOW]]ai mob o ad altri giocatori con una spada. Guides.Swords.Section.1=[[DARK_AQUA]]Come funziona Colpi Seghettati?\n[[YELLOW]]Colpi Seghettati \u00E8 una capacit\u00E0 attiva, puoi attivarla facendo\n[[YELLOW]]click destro con una spada. Questa capacit\u00E0 permette di fare\n[[YELLOW]]un colpo EaA (Effetto ad Area). Questo EaA far\u00E0 il 25% in pi\u00F9\n[[YELLOW]]di danni e infligger\u00E0 un effetto di sanguinamento che dura 5 tick. Guides.Swords.Section.2=[[DARK_AQUA]]Come funziona Contrattacco?\n[[YELLOW]]Contrattacco \u00E8 una capacit\u00E0 attiva. Quando si ricevono\n[[YELLOW]]colpi dai mob, hai una possibilit\u00E0 di riflettere il 50% \n[[YELLOW]]del danno preso. Guides.Swords.Section.3=[[DARK_AQUA]]Come funziona Emorragia?\n[[YELLOW]]Emorragia causa ai nemici danno ogni due secondi. Il \n[[YELLOW]]bersaglio sanguina fino allo svanire dell'effetto,\n[[YELLOW]]o alla morte, quello che viene prima.\n[[YELLOW]]La durata dell'Emorragia \u00E8 aumentata dall'abilit\u00E0 Spade. - ##Taming Guides.Taming.Section.0=[[DARK_AQUA]]Riguardo l'Addomesticamento:\n[[YELLOW]]L'Addomesticamento dar\u00E0 ai giocatori vari bonus di combattimento\n[[YELLOW]]quando si usano lupi addomesticati.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Per guadagnare XP in questa abilit\u00E0, devi addomesticare\n[[YELLOW]]lupi/ocelot o entrare in combattimento con i tuoi lupi. Guides.Taming.Section.1=[[DARK_AQUA]]Come funziona Richiamo della Natura?\n[[YELLOW]]Richiamo della Natura \u00E8 una capacit\u00E0 attiva che consente\n[[YELLOW]]di evocare un lupo o un ocelot al proprio fianco. Puoi\n[[YELLOW]]farlo facendo click sinistro con in mano ossa o pesce. @@ -790,7 +755,6 @@ Guides.Taming.Section.5=[[DARK_AQUA]]Come funziona Sicurezza Ambientale?\n[[YELL Guides.Taming.Section.6=[[DARK_AQUA]]Come funziona Pelliccia Folta?\n[[YELLOW]]Questa capacit\u00E0 passiva riduce il danno\n[[YELLOW]]e rende i lupi resistenti al fuoco. Guides.Taming.Section.7=[[DARK_AQUA]]Come funziona A Prova d'Urto?\n[[YELLOW]]Questa capacit\u00E0 passiva riduce il danno fatto ai lupi\n[[YELLOW]]dalle esplosioni. Guides.Taming.Section.8=[[DARK_AQUA]]Come funziona il Servizio Fast Food?\n[[YELLOW]]Questa capacit\u00E0 passiva d\u00E0 ai lupi la possibilit\u00E0 di guarire\n[[YELLOW]]ogni volta che fanno un attacco. - ##Unarmed Guides.Unarmed.Section.0=[[DARK_AQUA]]Riguardo la Lotta:\n[[YELLOW]]La Lotta dar\u00E0 ai giocatori vari bonus di combattimento\n[[YELLOW]]quando si usano i pugni come arma.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Gli XP si ottengono in base alla quantit\u00E0 di danno\n[[YELLOW]]inflitto ai mob o agli altri giocatori senza armi. Guides.Unarmed.Section.1=[[DARK_AQUA]]Come funziona Furore?\n[[YELLOW]]Furore \u00E8 una capacit\u00E0 attiva che si attiva con il click\n[[YELLOW]]destro. In modalit\u00E0 Furore, Fai il 50% di danni\n[[YELLOW]]in pi\u00F9 e puoi rompere istantaneamente i materiali\n[[YELLOW]]deboli, come Terra ed Erba. @@ -798,19 +762,16 @@ Guides.Unarmed.Section.2=[[DARK_AQUA]]Come funziona Braccio di Ferro?\n[[YELLOW] Guides.Unarmed.Section.3=[[DARK_AQUA]]Come funziona Deviazione Frecce?\n[[YELLOW]]Deviare Frecce \u00E8 una capacit\u00E0 passiva che d\u00E0 la\n[[YELLOW]]possibilit\u00E0 di deviare frecce tirate da Scheletri o altri\n[[YELLOW]]giocatori. La freccia cadr\u00E0 a terra innocuamente. Guides.Unarmed.Section.4=[[DARK_AQUA]]Come funziona Presa di Ferro?\n[[YELLOW]]Presa di Ferro \u00E8 una capacit\u00E0 passiva che disarma.\n[[YELLOW]]Come sale il livello di lotta, aumenta la possibilit\u00E0\n[[YELLOW]]di prevenire un disarmo. Guides.Unarmed.Section.5=[[DARK_AQUA]]Come funziona Disarmo?\n[[YELLOW]]Questa capacit\u00E0 passiva permette ai giocatori di\n[[YELLOW]]disarmare gli altri giocatori, facendo cadere\n[[YELLOW]]a terra l'oggetto in mano del bersaglio. - ##Woodcutting Guides.Woodcutting.Section.0=[[DARK_AQUA]]Riguardo Taglialegna:\n[[YELLOW]]Taglialegna sta tutto nell'abbattere alberi.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Gli XP si guadagnano ogni volta che si rompono ceppi di legno. Guides.Woodcutting.Section.1=[[DARK_AQUA]]Come funziona Abbattitore d'Alberi?\n[[YELLOW]]Abbattitore d'Alberi \u00E8 una capacit\u00E0 attiva, puoi fare\n[[YELLOW]]click destro con in mano un'Ascia. Questo causer\u00E0\n[[YELLOW]]la rottura istantanea dell'albero, droppando tutto\n[[YELLOW]]il suo legno contemporaneamente. Guides.Woodcutting.Section.2=[[DARK_AQUA]]Come funziona Soffia Foglie?\n[[YELLOW]]Soffia Foglie \u00E8 una capacit\u00E0 passiva che causer\u00E0 la\n[[YELLOW]]rottura istantanea dei blocchi di foglie colpiti con un ascia.\n[[YELLOW]]Di default, questa capacit\u00E0 si sblocca al livello 100. Guides.Woodcutting.Section.3=[[DARK_AQUA]]Come funziona Doppi Drop?\n[[YELLOW]]Questa \u00E8 una capacit\u00E0 passiva che permette di ottenere\n[[YELLOW]]un blocco extra per ogni ceppo di legno che si taglia. - #INSPECT Inspect.Offline=Non hai il permesso di esaminare giocatori disconnessi! Inspect.OfflineStats=Statistiche mcMMO del Giocatore Disconnesso [[YELLOW]]{0} Inspect.Stats=[[GREEN]]Statistiche mcMMO di [[YELLOW]]{0} Inspect.TooFar=Sei troppo lontano da quel giocatore per esaminarlo! - #ITEMS Item.ChimaeraWing.Fail=**ALA CHIMERICA FALLITA!** Item.ChimaeraWing.Pass=**ALA CHIMERICA** @@ -821,11 +782,9 @@ Item.Injured.Wait=Sei stato ferito di recente e devi aspettare per usarlo. [[YEL Item.FluxPickaxe.Name=Piccone Cuocente Item.FluxPickaxe.Lore.1=[[GRAY]]Ha la possibilit\u00E0 di fusione immediata dei minerali. Item.FluxPickaxe.Lore.2=[[GRAY]]Richiede livello di Fusione {0}+ - #TELEPORTATION Teleport.Commencing=[[GRAY]]Il teletrasporto avr\u00E0 inizio fra [[GOLD]]({0}) [[GRAY]]secondi, resta fermo per favore... Teleport.Cancelled=[[DARK_RED]]Teletrasporto annullato! - #SKILLS Skills.Child=[[GOLD]](ABILIT\u00C0 FIGLIA) Skills.Disarmed=[[DARK_RED]]Sei stato disarmato! @@ -837,13 +796,11 @@ Skills.ChildStats={0}[[GREEN]]{1} Skills.TooTired=Sei troppo stanco per usare ancora questa capacit\u00E0. [[YELLOW]]({0}s) Skills.Cancelled={0} annullata! Skills.ConfirmOrCancel=[[GREEN]]Clicca ancora col destro per confermare [[GOLD]]{0}[[GREEN]]. Clicca col sinistro per annullare. - #STATISTICS Stats.Header.Combat=[[GOLD]]-=ABILIT\u00C0 DI COMBATTIMENTO=- Stats.Header.Gathering=[[GOLD]]-=ABILIT\u00C0 DI RACCOLTA=- Stats.Header.Misc=[[GOLD]]-=ABILIT\u00C0 VARIE=- Stats.Own.Stats=[[GREEN]][mcMMO] Statistiche - #PERKS Perks.XP.Name=Esperienza Perks.XP.Desc=Ricevi XP incrementati in determinate abilit\u00E0. @@ -856,7 +813,6 @@ Perks.Cooldowns.Desc=Riduce la durata della ricarica di {0}. Perks.ActivationTime.Name=Resistenza Perks.ActivationTime.Desc=Incrementa il tempo di attivazione della capacit\u00E0 di {0} secondi. Perks.ActivationTime.Bonus=[[GOLD]] ({0}s con il Vantaggio Resistenza) - #HARDCORE Hardcore.Mode.Disabled=[[GOLD]][mcMMO] Modalit\u00E0 Hardcore {0} disattivata per {1}. Hardcore.Mode.Enabled=[[GOLD]][mcMMO] Modalit\u00E0 Hardcore {0} attivata per {1}. @@ -869,7 +825,6 @@ Hardcore.Vampirism.Killer.Success=[[GOLD]][mcMMO] [[DARK_AQUA]]Hai rubato [[BLUE Hardcore.Vampirism.Victim.Failure=[[GOLD]][mcMMO] [[YELLOW]]{0}[[GRAY]] non \u00E8 riuscito a rubarti ci\u00F2 che conosci! Hardcore.Vampirism.Victim.Success=[[GOLD]][mcMMO] [[YELLOW]]{0}[[DARK_RED]] ti ha rubato [[BLUE]]{1}[[DARK_RED]] livelli! Hardcore.Vampirism.PercentageChanged=[[GOLD]][mcMMO] La percentuale di perdita \u00E8 cambiata a {0}. - #MOTD MOTD.Donate=[[DARK_AQUA]]Info Donazioni: MOTD.Hardcore.Enabled=[[GOLD]][mcMMO] [[DARK_AQUA]]Modalit\u00E0 hardcore abilitata: [[DARK_RED]]{0} @@ -878,7 +833,6 @@ MOTD.Hardcore.Vampirism.Stats=[[GOLD]][mcMMO] [[DARK_AQUA]]Salasso di Statistich MOTD.PerksPrefix=[Vantaggi mcMMO] MOTD.Version=[[GOLD]][mcMMO] versione [[DARK_AQUA]]{0} MOTD.Website=[[GOLD]][mcMMO] [[GREEN]]{0}[[YELLOW]] - Sito di mcMMO - #SMELTING Smelting.Ability.FluxMining=Possibilit\u00E0 di Estrazione Cuocente: [[YELLOW]]{0} Smelting.Ability.FuelEfficiency=Moltiplicatore di Efficienza Combustibile: [[YELLOW]]{0}x @@ -896,17 +850,16 @@ Smelting.SubSkill.FluxMining.Name=Estrazione Cuocente Smelting.SubSkill.FluxMining.Description=Probabilit\u00E0 che i minerali siano fusi istantaneamente mentre li si estrae Smelting.Listener=Fusione: Smelting.SkillName=FUSIONE - #COMMAND DESCRIPTIONS Commands.Description.addlevels=Aggiungi XP di mcMMO a un utente -Commands.Description.adminchat= Attiva o disattiva la chat amministratori di mcMMO o invia messaggi in chat amministratori +Commands.Description.adminchat=Attiva o disattiva la chat amministratori di mcMMO o invia messaggi in chat amministratori Commands.Description.addxp=Aggiunge XP mcMMO a un utente Commands.Description.hardcore=Modifica la percentuale hardcore di mcMMO o attiva/disattiva la modalit\u00E0 hardcore Commands.Description.inspect=Visualizza dettagliate informazioni mcMMO su un altro giocatore Commands.Description.mcability=Attiva o disattiva il fatto che le capacit\u00E0 mcMMO vengano preparate con un clic destro. Commands.Description.mccooldown=Vedi tutto sulle ricariche delle abilit\u00E0 mcMMO Commands.Description.mcgod=Attiva o Disattiva la modalit\u00E0 dio mcMMO -Commands.Description.mchud= Cambia il tuo stile di HUD di mcMMO +Commands.Description.mchud=Cambia il tuo stile di HUD di mcMMO Commands.Description.mcmmo=Mostra una breve descrizione di mcMMO Commands.Description.mcnotify=Attiva o disattiva la visualizzazione delle notifiche delle capacit\u00E0 di mcMMO in chat Commands.Description.mcpurge=Elimina dal database mcMMO gli utenti senza livelli mcMMO e quelli che non si sono connessi negli ultimi {0} mesi. @@ -928,11 +881,9 @@ Commands.Description.skillreset=Azzera i livelli mcMMO di un utente Commands.Description.vampirism=Modify the mcMMO vampirism percentage or toggle vampirism mode on/off Commands.Description.xplock=Blocca la tua barra XP di mcMMO su una specifica abilit\u00E0 di mcMMO Commands.Description.xprate=Modifica il tasso XP di mcMMO o d\u00E0 inizio a un evento XP mcMMO. - #UPDATE CHECKER UpdateChecker.Outdated=Stai usando una versione non aggiornata di mcMMO! UpdateChecker.NewAvailable=\u00C8 disponibile una nuova versione su BukkitDev. - #SCOREBOARD HEADERS Scoreboard.Header.PlayerStats=Statistiche mcMMO Scoreboard.Header.PlayerCooldowns=Ricariche mcMMO @@ -946,7 +897,6 @@ Scoreboard.Misc.RemainingXP=XP restanti Scoreboard.Misc.Cooldown=[[LIGHT_PURPLE]]Ricarica Scoreboard.Misc.Overall=[[GOLD]]Complessivo Scoreboard.Misc.Ability=Capacit\u00E0 - #DATABASE RECOVERY Profile.Loading.Success=[[GREEN]]Il tuo profilo mcMMO \u00E8 stato caricato. Profile.Loading.Failure=mcMMO non pu\u00F2 ancora caricare i tuoi dati. Si consiglia di [[AQUA]]contattare il proprietario del server.\n[[YELLOW]]Puoi ancora giocare sul server, ma non avrai [[BOLD]]livelli mcMMO[[YELLOW]] e gli XP che otterrai [[BOLD]]non verranno salvati[[YELLOW]]. diff --git a/bukkit/src/main/resources/locale/locale_ko.properties b/bukkit/src/main/resources/locale/locale_ko.properties index a974ee7f2..ea45ff82b 100644 --- a/bukkit/src/main/resources/locale/locale_ko.properties +++ b/bukkit/src/main/resources/locale/locale_ko.properties @@ -14,7 +14,6 @@ # Axes.Ability.Refresh.1 # # --wolfwork - #ACROBATICS Acrobatics.Ability.Proc=[[GREEN]]**\uC6B0\uC544\uD55C \uAD6C\uB974\uAE30** Acrobatics.Combat.Proc=[[GREEN]]**\uD68C\uD53C** @@ -31,7 +30,6 @@ Acrobatics.SubSkill.Roll.GraceChance=\uC6B0\uC544\uD55C \uAD6C\uB974\uAE30 \uD65 Acrobatics.Roll.Text=**\uAD6C\uB974\uAE30** Acrobatics.SkillName=\uACE1\uC608 Acrobatics.Skillup=\uB099\uBC95 \uAE30\uC220\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #ALCHEMY Alchemy.SubSkill.Catalysis.Name=\uCD09\uB9E4 Alchemy.SubSkill.Catalysis.Description=\uD3EC\uC158 \uC591\uC870 \uC18D\uB3C4 \uC99D\uAC00 @@ -44,7 +42,6 @@ Alchemy.Concoctions.Rank=\uD63C\uD569 \uB7AD\uD06C: [[YELLOW]]{0}/{1} Alchemy.Concoctions.Ingredients=\uC131\uBD84 [[[YELLOW]]{0}[[RED]]]: [[YELLOW]]{1} Alchemy.SkillName=\uC5F0\uAE08\uC220 Alchemy.Skillup=\uC5F0\uAE08\uC220 \uAE30\uC220\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #ARCHERY Archery.Combat.DazeChance=\uD604\uD639 \uD655\uB960: [[YELLOW]]{0} Archery.Combat.RetrieveChance=\uD654\uC0B4 \uD68C\uC218 \uD655\uB960: [[YELLOW]]{0} @@ -58,7 +55,6 @@ Archery.SubSkill.ArrowRetrieval.Description=\uC2DC\uCCB4\uC5D0\uC11C \uD654\uC0B Archery.Listener=\uAD81\uC220(ARCHERY): Archery.SkillName=\uAD81\uC220 Archery.Skillup=\uAD81\uC220 \uAE30\uC220\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #AXES Axes.Ability.Bonus.0=\uB3C4\uB07C \uB9C8\uC2A4\uD130\uB9AC Axes.Ability.Bonus.1={0} \uCD94\uAC00 \uD53C\uD574 @@ -93,7 +89,6 @@ Axes.Skills.SS.Refresh=[[GREEN]]\uB2F9\uC2E0\uC758 [[YELLOW]]\uBF08 \uCABC\uAC1C Axes.Skills.SS.Other.Off={0}\uB2D8\uC774 [[RED]]\uBF08 \uCABC\uAC1C\uAE30\uB97C[[GREEN]] \uC900\uBE44 \uD574\uC81C\uD588\uC2B5\uB2C8\uB2E4 Axes.Skills.SS.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\uB2D8\uC774 [[RED]]\uBF08 \uCABC\uAC1C\uAE30\uB97C \uC0AC\uC6A9\uD588\uC2B5\uB2C8\uB2E4! Axes.Skillup=\uBD80\uC220 \uAE30\uC220\uC774 {0} \uC62C\uB77C \uCD1D ({1}) \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #EXCAVATION Excavation.Ability.Lower=[[GRAY]]**\uC0BD \uC900\uBE44 \uD574\uC81C** Excavation.Ability.Ready=[[GREEN]]**\uC0BD \uC900\uBE44 \uC644\uB8CC** @@ -110,7 +105,6 @@ Excavation.Skills.GigaDrillBreaker.Refresh=[[GREEN]]\uB2F9\uC2E0\uC758 [[YELLOW] Excavation.Skills.GigaDrillBreaker.Other.Off={0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uAE30\uAC00 \uB4DC\uB9B4 \uBC84\uC11C\uCEE4\uB97C \uC0AC\uC6A9\uD588\uC2B5\uB2C8\uB2E4! Excavation.Skills.GigaDrillBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uAE30\uAC00 \uB4DC\uB9B4 \uBC84\uC11C\uCEE4\uB97C \uC0AC\uC6A9 \uD588\uC2B5\uB2C8\uB2E4! Excavation.Skillup=\uBC1C\uAD74 \uAE30\uC220\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #FISHING Fishing.Ability.Chance=\uC785\uC9C8 \uD655\uB960: [[YELLOW]]{0} Fishing.Ability.Info=\uB9E4\uC9C1 \uD5CC\uD130: [[GRAY]] **\uD2B8\uB808\uC838 \uD5CC\uD130 \uB7AD\uD06C \uD5A5\uC0C1** @@ -118,7 +112,7 @@ Fishing.Ability.Locked.0={0}\uB808\uBCA8 \uB54C \uAE30\uC220 \uD574\uC81C (\uD75 Fishing.Ability.Locked.1={0}\uB808\uBCA8 \uB54C \uAE30\uC220 \uD574\uC81C (\uC5BC\uC74C \uB09A\uC2DC) Fishing.Ability.Locked.2={0}\uB808\uBCA8 \uB54C \uAE30\uC220 \uD574\uC81C (\uB09A\uC2DC\uAFBC \uC7A5\uC778) Fishing.Ability.Rank=\uD2B8\uB808\uC838 \uD5CC\uD130 \uB7AD\uD06C: [[YELLOW]]{0}/5\uB7AD\uD06C -Fishing.Ability.TH.DropRate= \uB4DC\uB86D \uBE44\uC728: [[DARK_RED]]\uD568\uC815: [[YELLOW]]{0} [[GRAY]]\uACF5\uD1B5: [[YELLOW]]{1} [[GREEN]]\uBE44\uACF5\uD1B5: [[YELLOW]]{2}\n[[BLUE]]\uB808\uC5B4: [[YELLOW]]{3} [[LIGHT_PURPLE]]\uC5D0\uD53D: [[YELLOW]]{4} [[GOLD]]\uB808\uC804\uB4DC\uB9AC: [[YELLOW]]{5} [[AQUA]]\uB808\uCF54\uB4DC: [[YELLOW]]{6} +Fishing.Ability.TH.DropRate=\uB4DC\uB86D \uBE44\uC728: [[DARK_RED]]\uD568\uC815: [[YELLOW]]{0} [[GRAY]]\uACF5\uD1B5: [[YELLOW]]{1} [[GREEN]]\uBE44\uACF5\uD1B5: [[YELLOW]]{2}\n[[BLUE]]\uB808\uC5B4: [[YELLOW]]{3} [[LIGHT_PURPLE]]\uC5D0\uD53D: [[YELLOW]]{4} [[GOLD]]\uB808\uC804\uB4DC\uB9AC: [[YELLOW]]{5} [[AQUA]]\uB808\uCF54\uB4DC: [[YELLOW]]{6} Fishing.Ability.TH.MagicRate=\uB9E4\uC9C1 \uD5CC\uD130 \uD655\uB960: [[YELLOW]]{0} Fishing.Ability.Shake=\uD754\uB4E4\uAE30 \uD655\uB960: [[YELLOW]]{0} Fishing.Ability.IceFishing=\uC5BC\uC74C \uB09A\uC2DC: \uC5BC\uC74C\uC5D0\uC11C \uB09A\uC2DC @@ -142,7 +136,6 @@ Fishing.Ability.TH.Boom=[[GRAY]]\uD3ED\uBC1C \uC2DC\uAC04!!! Fishing.Ability.TH.Poison=[[GRAY]]\uB08C\uC0C8\uAC00 \uC88B\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4... Fishing.SkillName=\uB09A\uC2DC Fishing.Skillup=\uB09A\uC2DC \uAE30\uC220\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #HERBALISM Herbalism.Ability.DoubleDropChance=2\uBC30 \uB4DC\uB86D \uD655\uB960: [[YELLOW]]{0} Herbalism.Ability.FD=\uB18D\uBD80\uC758 \uB2E4\uC774\uC5B4\uD2B8: [[YELLOW]]{0}\uB7AD\uD06C @@ -180,7 +173,6 @@ Herbalism.Skills.GTe.Refresh=[[GREEN]]\uB2F9\uC2E0\uC758 [[YELLOW]]\uC7AC\uBC30\ Herbalism.Skills.GTe.Other.Off={0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uC7AC\uBC30\uC758 \uB300\uC9C0\uB97C \uC0AC\uC6A9\uD588\uC2B5\uB2C8\uB2E4! Herbalism.Skills.GTe.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uC7AC\uBC30\uC758 \uB300\uC9C0\uB97C \uC0AC\uC6A9\uD588\uC2B5\uB2C8\uB2E4! Herbalism.Skillup=\uC57D\uCD08\uD559 \uAE30\uC220\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #MINING Mining.Ability.Length=\uD30C\uAD34\uC790 \uC9C0\uC18D\uC2DC\uAC04: [[YELLOW]]{0}s Mining.Ability.Locked.0={0}\uB808\uBCA8 \uB54C \uAE30\uC220 \uD574\uC81C (\uD3ED\uBC1C \uCC44\uAD74) @@ -208,7 +200,6 @@ Mining.Skills.SuperBreaker.Other.Off={0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uD30C Mining.Skills.SuperBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uD30C\uAD34\uC790\uB97C \uC0AC\uC6A9\uD588\uC2B5\uB2C8\uB2E4! Mining.Skills.SuperBreaker.Refresh=[[GREEN]]\uB2F9\uC2E0\uC758 [[YELLOW]]\uD30C\uAD34\uC790\uB294 [[GREEN]]\uC774\uC81C \uC0AC\uC6A9 \uAC00\uB2A5\uD569\uB2C8\uB2E4! Mining.Skillup=\uCC44\uAD11 \uAE30\uC220\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #Blast Mining Mining.Blast.Boom=[[GRAY]]**\uD3ED\uBC1C** Mining.Blast.Effect=+{0} \uAD11\uBB3C \uC774\uC775, -{1} \uD30C\uD3B8 \uC0B0\uCD9C, {2}x \uB4DC\uB86D @@ -216,7 +207,6 @@ Mining.Blast.Radius.Increase=\uD3ED\uBC1C \uBC18\uACBD \uC99D\uAC00: [[YELLOW]]+ Mining.Blast.Rank=\uD3ED\uBC1C \uCC44\uAD74: [[YELLOW]]{0}/8\uB7AD\uD06C [[GRAY]]({1}) Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uD3ED\uBC1C \uCC44\uAD74\uC744 \uC0AC\uC6A9\uD558\uC168\uC2B5\uB2C8\uB2E4! Mining.Blast.Refresh=[[GREEN]]\uB2F9\uC2E0\uC758 [[YELLOW]]\uD3ED\uBC1C \uCC44\uAD74 [[GREEN]]\uAE30\uC220\uC740 \uC774\uC81C \uC0AC\uC6A9 \uAC00\uB2A5\uD569\uB2C8\uB2E4! - #REPAIR Repair.SubSkill.Repair.Name=\uC218\uB9AC Repair.SubSkill.Repair.Description=\uB3C4\uAD6C & \uBC29\uC5B4\uAD6C \uC218\uB9AC @@ -250,7 +240,6 @@ Repair.Skills.StackedItems=[[DARK_RED]]\uD55C\uBC88\uC5D0 \uB9CE\uC740 \uC544\uC Repair.Skills.Super.Chance=\uC288\uD37C \uC218\uB9AC \uD655\uB960: [[YELLOW]]{0} Repair.Skillup=\uC218\uB9AC \uAE30\uC220\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 Repair.Pretty.Name=\uC218\uB9AC - #Arcane Forging Repair.Arcane.Chance.Downgrade=[[GRAY]]\uC778\uCC48\uD2B8 \uC218\uB9AC \uACA9\uD558 \uD655\uB960: [[YELLOW]]{0}% Repair.Arcane.Chance.Success=[[GRAY]]\uC778\uCC48\uD2B8 \uC218\uB9AC \uC131\uACF5 \uD655\uB960: [[YELLOW]]{0}% @@ -259,7 +248,6 @@ Repair.Arcane.Fail=\uC774 \uC544\uC774\uD15C\uC758 \uC778\uCC48\uD2B8\uB294 \uC6 Repair.Arcane.Lost=\uB2F9\uC2E0\uC740 \uBAA8\uB4E0 \uC778\uCC48\uD2B8\uB97C \uC720\uC9C0\uD560 \uAE30\uC220\uC774 \uCDA9\uBD84\uCE58 \uC54A\uC2B5\uB2C8\uB2E4. Repair.Arcane.Perfect=[[GREEN]]\uC774 \uC544\uC774\uD15C\uC758 \uC778\uCC48\uD2B8\uB97C \uC9C0\uC18D\uC2DC\uCF30\uC2B5\uB2C8\uB2E4. Repair.Arcane.Rank=\uC778\uCC48\uD2B8 \uC218\uB9AC: [[YELLOW]]{0}/{1}\uB7AD\uD06C - #SALVAGE Salvage.Pretty.Name=\uD68C\uC218 Salvage.SubSkill.AdvancedSalvage.Name=\uC804\uBB38\uC801\uC778 \uD68C\uC218 @@ -282,7 +270,6 @@ Salvage.Skills.ArcaneSuccess=[[GREEN]]\uB2F9\uC2E0\uC740 \uC774 \uC544\uC774\uD1 Salvage.Listener.Anvil=[[DARK_RED]]\uB2F9\uC2E0\uC740 \uD68C\uC218 \uBAA8\uB8E8\uB97C \uB193\uC558\uC2B5\uB2C8\uB2E4, \uB3C4\uAD6C\uB098 \uBC29\uC5B4\uAD6C \uD68C\uC218\uC5D0 \uC4F0\uC785\uB2C8\uB2E4. Salvage.Listener=\uD68C\uC218(SALVAGE): Salvage.SkillName=\uD68C\uC218 - #SWORDS Swords.Ability.Lower=[[GRAY]]**\uAC80 \uC900\uBE44 \uD574\uC81C** Swords.Ability.Ready=[[GREEN]]**\uAC80 \uC900\uBE44 \uC644\uB8CC** @@ -313,7 +300,6 @@ Swords.Skills.SS.Other.Off={0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uD1B1\uB0A0 \uA Swords.Skills.SS.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uD1B1\uB0A0 \uACF5\uACA9 \uC2A4\uD0AC\uC744 \uC0AC\uC6A9\uD588\uC2B5\uB2C8\uB2E4! Swords.Skillup=\uAC80\uC220 \uC2A4\uD0AC\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 Swords.SS.Length=\uD1B1\uB0A0 \uACF5\uACA9 \uC9C0\uC18D\uC2DC\uAC04: [[YELLOW]]{0}\uCD08 - #TAMING Taming.Ability.Bonus.0=\uD658\uACBD \uC778\uC2DD Taming.Ability.Bonus.1=\uB291\uB300 \uC704\uD5D8 \uD68C\uD53C @@ -364,7 +350,6 @@ Taming.Summon.Fail.Ocelot=\uB2F9\uC2E0 \uADFC\uCC98\uC5D0 \uC774\uBBF8 \uB9CE\uC Taming.Summon.Fail.Wolf=\uB2F9\uC2E0 \uADFC\uCC98\uC5D0 \uC774\uBBF8 \uB9CE\uC740 \uB291\uB300\uAC00 \uC788\uC5B4 \uB354\uB294 \uC18C\uD658\uC2DC\uD0AC \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. Taming.Summon.Fail.Horse=\uB2F9\uC2E0 \uADFC\uCC98\uC5D0 \uC774\uBBF8 \uB9CE\uC740 \uB9D0\uC774 \uC788\uC5B4 \uB354\uB294 \uC18C\uD658\uC2DC\uD0AC \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. Taming.Summon.Name.Format={0}\uC758 {1} - #UNARMED Unarmed.Ability.Berserk.Length=\uBC84\uC11C\uCEE4 \uC9C0\uC18D\uC2DC\uAC04: [[YELLOW]]{0}\uCD08 Unarmed.Ability.Bonus.0=\uC544\uC774\uC5B8 \uC554 \uC2A4\uD0C0\uC77C @@ -394,7 +379,6 @@ Unarmed.Skills.Berserk.Other.Off={0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uBC84\uC1 Unarmed.Skills.Berserk.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uBC84\uC11C\uCEE4\uB97C \uC0AC\uC6A9\uD569\uB2C8\uB2E4! Unarmed.Skills.Berserk.Refresh=[[GREEN]]\uB2F9\uC2E0\uC758 [[YELLOW]]\uBC84\uC11C\uCEE4 [[GREEN]]\uC2A4\uD0AC\uC740 \uC774\uC81C \uC0AC\uC6A9 \uAC00\uB2A5\uD569\uB2C8\uB2E4! Unarmed.Skillup=\uBE44\uBB34\uC7A5 \uC2A4\uD0AC\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #WOODCUTTING Woodcutting.Ability.0=\uB098\uBB47\uC78E \uB5A8\uC5B4\uD2B8\uB9AC\uAE30 Woodcutting.Ability.1=\uB098\uBB47\uC78E \uCCAD\uC18C @@ -417,13 +401,11 @@ Woodcutting.Skills.TreeFeller.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\uB2D8\uC740 [[ Woodcutting.Skills.TreeFeller.Splinter=\uB3C4\uB07C \uD30C\uD3B8 \uC870\uAC01 \uC218\uC9D1! Woodcutting.Skills.TreeFeller.Threshold=\uADF8 \uB098\uBB34\uB294 \uB108\uBB34 \uD07D\uB2C8\uB2E4! Woodcutting.Skillup=\uBC8C\uBAA9 \uC2A4\uD0AC\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #ABILITIY ##generic Ability.Generic.Refresh=[[GREEN]]**\uB2A5\uB825\uC774 \uC7AC \uACF5\uAE09 \uB418\uC5C8\uC2B5\uB2C8\uB2E4!** Ability.Generic.Template.Lock=[[GRAY]]{0} Ability.Generic.Template=[[GOLD]]{0}: [[DARK_AQUA]]{1} - #COMBAT Combat.ArrowDeflect=[[WHITE]]**\uD654\uC0B4 \uD68C\uD53C** Combat.BeastLore=[[GREEN]]**\uC9D0\uC2B9\uC758 \uD3EC\uD6A8** @@ -433,7 +415,6 @@ Combat.Gore=[[GREEN]]**\uB3CC\uC9C4** Combat.StruckByGore=**\uB3CC\uC9C4\uC5D0 \uB9DE\uC558\uC2B5\uB2C8\uB2E4** Combat.TargetDazed=\uBAA9\uD45C\uAC00 [[DARK_RED]]\uD63C\uB780\uC2A4\uB7EC\uC6CC\uD569\uB2C8\uB2E4 Combat.TouchedFuzzy=[[DARK_RED]]\uD63C\uB780\uC774 \uC77C\uC5B4\uB0AC\uC2B5\uB2C8\uB2E4. \uC544~ \uC5B4\uC9C0\uB7EC\uC6CC. - #COMMANDS ##generic mcMMO.Description=mcMMO[[DARK_AQUA]] \uD504\uB85C\uC81D\uD2B8\uC5D0 \uB300\uD574\uC11C:,[[GOLD]]mcMMO\uB294 \uD55C [[RED]]\uC624\uD508 \uC18C\uC2A4[[GOLD]] RPG \uBAA8\uB4DC\uB85C 2011\uB144 2\uC6D4\uC5D0 [[BLUE]]com.gmail.nossr50[[GOLD]]\uB2D8\uC774 \uB9CC\uB4E4\uC5C8\uC2B5\uB2C8\uB2E4. \uBAA9\uD45C\uB294 \uC9C8\uC88B\uC740 RPG \uACBD\uD5D8\uC744 \uC81C\uACF5\uD558\uB294 \uAC83 \uC785\uB2C8\uB2E4.,[[DARK_AQUA]]\uD301:,[[GOLD]] - [[RED]]/mcmmo help[[GREEN]] \uBA85\uB839\uC5B4\uB4E4\uC744 \uBD05\uB2C8\uB2E4,[[GOLD]] - [[GREEN]]\uD0C0\uC785 [[RED]]/\uC2A4\uD0AC\uC774\uB984[[GREEN]] \uC790\uC138\uD55C \uC2A4\uD0AC \uC815\uBCF4\uB97C \uBD05\uB2C8\uB2E4,[[DARK_AQUA]]\uAC1C\uBC1C\uC790\uB4E4:,[[GOLD]] - [[GREEN]]com.gmail.nossr50 [[BLUE]](\uC81C\uC791\uC790),[[GOLD]] - [[GREEN]]GJ [[BLUE]](\uD504\uB85C\uC81D\uD2B8 \uC8FC\uC7A5),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](\uAC1C\uBC1C\uC790),[[GOLD]] - [[GREEN]]bm01 [[BLUE]](\uAC1C\uBC1C\uC790),[[GOLD]] - [[GREEN]]TfT_02 [[BLUE]](\uAC1C\uBC1C\uC790),[[GOLD]] - [[GREEN]]Glitchfinder [[BLUE]](\uAC1C\uBC1C\uC790),[[GOLD]] - [[GREEN]]t00thpick1 [[BLUE]](\uAC1C\uBC1C\uC790),[[DARK_AQUA]]\uC720\uC6A9\uD55C \uB9C1\uD06C:,[[GOLD]] - [[GREEN]]https://github.com/mcMMO-Dev/mcMMO/issues[[GOLD]] \uBC84\uADF8 \uBCF4\uACE0,[[GOLD]] - [[GREEN]]#mcmmo @ irc.esper.net[[GOLD]] IRC \uCC44\uD305, @@ -456,7 +437,7 @@ Commands.Cooldowns.Row.Y=\ [[AQUA]]{0}[[WHITE]] - [[DARK_GREEN]]\uC900\uBE44! Commands.Database.Cooldown=\uC774 \uBA85\uB839\uC5B4\uB97C \uB2E4\uC2DC \uCE58\uAE30\uC804\uC5D0 1\uCD08\uB97C \uAE30\uB2EC\uB824\uC57C\uB9CC \uD569\uB2C8\uB2E4. Commands.Database.Processing=\uB2F9\uC2E0\uC758 \uC774\uC804 \uBA85\uB839\uC5B4\uB294 \uC5EC\uC804\uD788 \uC791\uC5C5\uC911\uC785\uB2C8\uB2E4. \uAE30\uB2E4\uB824\uC8FC\uC138\uC694. Commands.Disabled=\uC774 \uBA85\uB839\uC5B4\uB294 \uBE44\uD65C\uC131\uD654 \uB418\uC788\uC2B5\uB2C8\uB2E4. -Commands.DoesNotExist= [[RED]]\uD50C\uB808\uC774\uC5B4\uB294 \uB370\uC774\uD130\uBCA0\uC774\uC2A4\uC5D0 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4! +Commands.DoesNotExist=[[RED]]\uD50C\uB808\uC774\uC5B4\uB294 \uB370\uC774\uD130\uBCA0\uC774\uC2A4\uC5D0 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4! Commands.GodMode.Disabled=mcMMO \uBD88\uC0AC\uC2E0 \uBAA8\uB4DC \uBE44\uD65C\uC131\uD654 Commands.GodMode.Enabled=mcMMO \uBD88\uC0AC\uC2E0 \uBAA8\uB4DC \uD65C\uC131\uD654 Commands.GodMode.Forbidden=[mcMMO] \uC774 \uC6D4\uB4DC\uC5D0\uC11C \uBD88\uC0AC\uC2E0 \uBAA8\uB4DC\uB294 \uD5C8\uC6A9 \uAE08\uC9C0\uC785\uB2C8\uB2E4 (\uD384\uBBF8\uC120 \uD655\uC778) @@ -542,7 +523,7 @@ Commands.Party.Alliance.Invite.Accepted=[[GREEN]]\uB3D9\uB9F9 \uCD08\uB300 \uC21 Commands.Party.Alliance.None=\uB2F9\uC2E0\uC740 \uB3D9\uB9F9\uC744 \uAC00\uC9C0\uACE0 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. Commands.Party.Alliance.AlreadyAllies=\uB2F9\uC2E0\uC758 \uD30C\uD2F0\uB294 \uC774\uBBF8 \uB3D9\uB9F9\uC744 \uAC00\uC9C0\uACE0 \uC788\uC2B5\uB2C8\uB2E4. \uAD00\uACC4\uB97C \uD574\uC9C0\uD558\uB824\uBA74 [[DARK_AQUA]]/party alliance disband Commands.Party.Alliance.Help.0=\uC774 \uD30C\uD2F0\uB294 \uB3D9\uB9F9 \uD615\uD0DC\uB97C \uAC00\uC9C0\uACE0 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uD30C\uD2F0\uC7A5\uC744 \uCD08\uB300\uD558\uC138\uC694 -Commands.Party.Alliance.Help.1= \uB3D9\uB9F9\uC744 \uD558\uB824\uBA74 [[DARK_AQUA]]/party alliance invite [[RED]]. +Commands.Party.Alliance.Help.1=\uB3D9\uB9F9\uC744 \uD558\uB824\uBA74 [[DARK_AQUA]]/party alliance invite [[RED]]. Commands.ptp.Enabled=\uD30C\uD2F0 \uD154\uB808\uD3EC\uD2B8 [[GREEN]]\uD65C\uC131\uD654\uB428 Commands.ptp.Disabled=\uD30C\uD2F0 \uD154\uB808\uD3EC\uD2B8 [[RED]]\uBE44\uD65C\uC131\uD654\uB428 Commands.ptp.NoRequests=\uB2F9\uC2E0\uC740 \uC774 \uC2DC\uAC04\uC5D0 \uD154\uB808\uD3EC\uD2B8 \uC694\uCCAD\uC744 \uD558\uC2E4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 @@ -591,7 +572,6 @@ Commands.Usage.XP=xp mcMMO.NoInvites=\uC774 \uC2DC\uAC04\uC5D0 \uB2F9\uC2E0\uC740 \uCD08\uB300\uD558\uC9C0 \uBABB\uD569\uB2C8\uB2E4 mcMMO.NoPermission=[[DARK_RED]]\uAD8C\uD55C\uC774 \uBD80\uC871\uD569\uB2C8\uB2E4. mcMMO.NoSkillNote=[[DARK_GRAY]]\uB9CC\uC57D \uB2F9\uC2E0\uC774 \uC2A4\uD0AC\uC744 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uB2E4\uBA74 \uC5EC\uAE30\uC5D0 \uD45C\uC2DC\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. - ##party Party.Forbidden=[mcMMO] \uC774 \uC6D4\uB4DC\uC5D0\uC11C \uD30C\uD2F0\uB97C \uD558\uC2E4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 (\uD384\uBBF8\uC120 \uD655\uC778) Party.Help.0=\uC62C\uBC14\uB978 \uC0AC\uC6A9\uBC95 [[DARK_AQUA]]{0} <\uD50C\uB808\uC774\uC5B4> [\uBE44\uBC00\uBC88\uD638]. @@ -618,7 +598,7 @@ Party.NotOwner=[[DARK_RED]]\uB2F9\uC2E0\uC740 \uD30C\uD2F0\uC7A5\uC774 \uC544\uB Party.Target.NotOwner=[[DARK_RED]]{0}\uB2D8\uC740 \uD30C\uD2F0\uC7A5\uC774 \uC544\uB2D9\uB2C8\uB2E4. Party.Owner.New=[[GREEN]]{0}\uB2D8\uC774 \uC0C8 \uD30C\uD2F0\uC7A5\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4. Party.Owner.NotLeader=[[DARK_RED]]\uB2F9\uC2E0\uC740 \uC774\uC81C \uD30C\uD2F0\uC7A5\uC774 \uC544\uB2D9\uB2C8\uB2E4. -Party.Owner.Player =[[GREEN]]\uB2F9\uC2E0\uC740 \uC774\uC81C \uD30C\uD2F0\uC7A5\uC785\uB2C8\uB2E4. +Party.Owner.Player=[[GREEN]]\uB2F9\uC2E0\uC740 \uC774\uC81C \uD30C\uD2F0\uC7A5\uC785\uB2C8\uB2E4. Party.Password.None=\uC774 \uD30C\uD2F0\uB294 \uBE44\uBC00\uBC88\uD638\uB85C \uBCF4\uD638\uB418\uACE0 \uC788\uC2B5\uB2C8\uB2E4. \uAC00\uC785\uD560\uB54C \uBE44\uBC00\uBC88\uD638\uB97C \uC81C\uACF5\uD574\uC8FC\uC138\uC694. Party.Password.Incorrect=\uD30C\uD2F0 \uBE44\uBC00\uBC88\uD638\uAC00 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. Party.Password.Set=[[GREEN]]\uC124\uC815\uD55C \uD30C\uD2F0 \uBE44\uBC00\uBC88\uD638\uB294 {0} \uC785\uB2C8\uB2E4 @@ -668,7 +648,6 @@ Party.ItemShare.Category.Mining=\uCC44\uAD11 Party.ItemShare.Category.Herbalism=\uC57D\uCD08\uD559 Party.ItemShare.Category.Woodcutting=\uBC8C\uBAA9 Party.ItemShare.Category.Misc=\uAE30\uD0C0 - ##xp Commands.XPGain.Acrobatics=\uB5A8\uC5B4\uC9C0\uAE30 Commands.XPGain.Alchemy=\uD3EC\uC158 \uC591\uC870\uD558\uAE30 @@ -694,28 +673,24 @@ Commands.xprate.proper.1=\uACBD\uD5D8\uCE58 \uBC30\uC728\uC744 \uCD08\uAE30\uD65 Commands.xprate.proper.2=\uC774\uAC83\uC740 XP \uC774\uBCA4\uD2B8\uC778\uC9C0 \uC544\uB2CC\uC9C0 true \uB610\uB294 false\uB85C \uB098\uD0C0\uB0B4\uAE30 \uC704\uD574 \uC9C0\uC815\uD558\uC2ED\uC2DC\uC624 Commands.xprate.started.0=[[GOLD]]mcMMO \uACBD\uD5D8\uCE58 \uC774\uBCA4\uD2B8\uAC00 \uC2DC\uC791\uB418\uC5C8\uC2B5\uB2C8\uB2E4! Commands.xprate.started.1=[[GOLD]]mcMMO \uACBD\uD5D8\uCE58 \uBC30\uC728\uC740 {0}\uBC30 \uC785\uB2C8\uB2E4! -XPRate.Event= [[GOLD]]mcMMO \uB294 \uD604\uC7AC \uACBD\uD5D8\uCE58 \uC774\uBCA4\uD2B8 \uC911\uC785\uB2C8\uB2E4! \uACBD\uD5D8\uCE58\uB294 {0}\uBC30 \uC785\uB2C8\uB2E4! - +XPRate.Event=[[GOLD]]mcMMO \uB294 \uD604\uC7AC \uACBD\uD5D8\uCE58 \uC774\uBCA4\uD2B8 \uC911\uC785\uB2C8\uB2E4! \uACBD\uD5D8\uCE58\uB294 {0}\uBC30 \uC785\uB2C8\uB2E4! #EFFECTS ##generic Effects.Effects=\uD6A8\uACFC Effects.Child=[[DARK_GRAY]]LVL: [[GREEN]]{0} Effects.Level=[[DARK_GRAY]]LVL: [[GREEN]]{0} [[DARK_AQUA]]XP[[YELLOW]]([[GOLD]]{1}[[YELLOW]]/[[GOLD]]{2}[[YELLOW]]) -Effects.Parent= [[GOLD]]{0} - +Effects.Parent=[[GOLD]]{0} - Effects.Template=[[DARK_AQUA]]{0}: [[GREEN]]{1} - #GUIDES Guides.Available=[[GRAY]]{0} \uAC00\uC774\uB4DC\uAC00 \uC788\uC2B5\uB2C8\uB2E4 - \uD0C0\uC785 /{1} ? [\uD398\uC774\uC9C0] Guides.Header=[[GOLD]]-=[[GREEN]]{0} \uAC00\uC774\uB4DC[[GOLD]]=- Guides.Page.Invalid=\uC62C\uBC14\uB978 \uD398\uC774\uC9C0 \uBC88\uD638\uAC00 \uC544\uB2D9\uB2C8\uB2E4! Guides.Page.OutOfRange=\uADF8 \uD398\uC774\uC9C0\uB294 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4, \uC624\uC9C1 \uCD1D {0} \uD398\uC774\uC9C0\uAC00 \uC788\uC2B5\uB2C8\uB2E4. -Guides.Usage= \uC0AC\uC6A9\uBC95 /{0} ? [\uD398\uC774\uC9C0] - +Guides.Usage=\uC0AC\uC6A9\uBC95 /{0} ? [\uD398\uC774\uC9C0] ##Acrobatics Guides.Acrobatics.Section.0=[[DARK_AQUA]]\uACE1\uC608\uC5D0 \uB300\uD558\uC5EC:\n[[YELLOW]]\uACE1\uC608\uB294 mcMMO\uC758 \uC6B0\uC640\uD558\uAC8C \uC6C0\uC9C1\uC774\uB294 \uC608\uC220\uC785\uB2C8\uB2E4.\n[[YELLOW]]\uC804\uD22C \uD2B9\uD61C\uC640 \uD658\uACBD \uC190\uC0C1 \uD2B9\uD61C\uB97C \uC99D\uAC00\uC2DC\uD0B5\uB2C8\uB2E4.\n\n[[DARK_AQUA]]XP \uC5BB\uAE30:\n[[YELLOW]]\uC774 \uC2A4\uD0AC\uC758 XP\uB97C \uC5BB\uC744\uB824\uBA74 \uC804\uD22C\uB098 \uC0DD\uC874\uC5D0\uC11C \uD53C\uD574\uB97C \n[[YELLOW]]\uC785\uB294 \uB099\uD558\uC5D0\uC11C \uCC29\uC9C0 \uD589\uB3D9\uC774 \uC694\uAD6C\uB429\uB2C8\uB2E4. Guides.Acrobatics.Section.1=[[DARK_AQUA]]\uC5B4\uB5BB\uAC8C \uAD6C\uB974\uAE30\uB97C \uD558\uB098\uC694?\n[[YELLOW]]\uB2F9\uC2E0\uC774 \uB099\uD558 \uD53C\uD574\uB97C \uBC1B\uC744 \uB54C \uD53C\uD574\uB97C \uBB34\uD6A8\uD654\uD560\n[[YELLOW]]\uC9C0\uC18D\uC801\uC778 \uAE30\uD68C\uB97C \uAC00\uC9C0\uAC8C \uB429\uB2C8\uB2E4. \uCB48\uAD6C\uB9AC\uAE30 \uBC84\uD2BC\uC744 \uB204\uB974\uACE0 \uC788\uC73C\uBA74\n[[YELLOW]]\uB5A8\uC5B4\uC9C0\uB294 \uB3D9\uC548 \uB450\uBC30\uC758 \uAE30\uD68C\uB97C \uAC00\uC9C0\uAC8C \uB429\uB2C8\uB2E4.\n[[YELLOW]]This triggers a Graceful Roll instead of a standard one.\n[[YELLOW]]Graceful Rolls are like regular rolls but are twice as likely to\n[[YELLOW]]occur and provide more damage safety than regular rolls.\n[[YELLOW]]Rolling chance is tied to your skill level Guides.Acrobatics.Section.2=[[DARK_AQUA]]\uC5B4\uB5BB\uAC8C \uD68C\uD53C\uB97C \uD558\uB098\uC694?\n[[YELLOW]]\uD68C\uD53C\uB294 \uB2F9\uC2E0\uC774 \uC804\uD22C\uC5D0\uC11C \uC0C1\uCC98\uB97C \uC785\uC744 \uB54C \uC785\uB294\n[[YELLOW]]\uD53C\uD574\uB97C \uBC18\uAC10\uC2DC\uD0A4\uB294 \uC9C0\uC18D\uC801\uC778 \uAE30\uD68C\uC785\uB2C8\uB2E4.\n[[YELLOW]]\uC774\uAC83\uC740 \uB2F9\uC2E0\uC758 \uC2A4\uD0AC \uB808\uBCA8\uACFC \uC5F0\uACB0\uB429\uB2C8\uB2E4. - ##Alchemy Guides.Alchemy.Section.0=[[DARK_AQUA]]About Alchemy:\n[[YELLOW]]Alchemy is about brewing potions.\n[[YELLOW]]It provides a speed increase in the potion brew time, as well\n[[YELLOW]]as the addition of new (previously) unobtainable potions.\n\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you need to brew potions. Guides.Alchemy.Section.1=[[DARK_AQUA]]How does Catalysis work?\n[[YELLOW]]Catalysis speeds of the brewing process, with a\n[[YELLOW]]max speed of 4x at level 1000.\n[[YELLOW]]This ability is unlocked at level 100 by default. @@ -724,13 +699,11 @@ Guides.Alchemy.Section.3=[[DARK_AQUA]]Concoctions tier 1 ingredients:\n[[YELLOW] Guides.Alchemy.Section.4=[[DARK_AQUA]]Concoctions tier 2 ingredients:\n[[YELLOW]]Carrot (Potion of Haste)\n[[YELLOW]]Slimeball (Potion of Dullness)\n\n[[DARK_AQUA]]Concoctions tier 3 ingredients:\n[[YELLOW]]Quartz (Potion of Absorption)\n[[YELLOW]]Red Mushroom (Potion of Leaping) Guides.Alchemy.Section.5=[[DARK_AQUA]]Concoctions tier 4 ingredients:\n[[YELLOW]]Apple (Potion of Health Boost)\n[[YELLOW]]Rotten Flesh (Potion of Hunger)\n\n[[DARK_AQUA]]Concoctions tier 5 ingredients:\n[[YELLOW]]Brown Mushroom (Potion of Nausea)\n[[YELLOW]]Ink Sack (Potion of Blindness) Guides.Alchemy.Section.6=[[DARK_AQUA]]Concoctions tier 6 ingredients:\n[[YELLOW]]Fern (Potion of Saturation)\n\n[[DARK_AQUA]]Concoctions tier 7 ingredients:\n[[YELLOW]]Poisonous Potato (Potion of Decay)\n\n[[DARK_AQUA]]Concoctions tier 8 ingredients:\n[[YELLOW]]Regular Golden Apple (Potion of Resistance) - ##Archery Guides.Archery.Section.0=[[DARK_AQUA]]\uAD81\uC220\uC5D0 \uB300\uD558\uC5EC:\n[[YELLOW]]\uAD81\uC220\uC740 \uD65C\uACFC \uD654\uC0B4\uB85C \uC3D8\uB294 \uAC83\uC744 \uB73B\uD569\uB2C8\uB2E4.\n[[YELLOW]]\uAD81\uC220\uC740 PVP\uC5D0\uC11C \uB2F9\uC2E0\uC774 \uC801\uC744 \uD604\uD639\uC2DC\uD0A4\uB294 \uB2A5\uB825\uACFC\n[[YELLOW]]\uB808\uBCA8 \uD06C\uAE30\uC758 \uB370\uBBF8\uC9C0 \uBD80\uC2A4\uD130\uB97C \uAC19\uC740 \uAC83\uC73C\uB85C\n[[YELLOW]]\uC804\uD22C \uBCF4\uB108\uC2A4\uB97C \uC81C\uACF5\uD569\uB2C8\uB2E4. In addition to this, you can retrieve\n[[YELLOW]]some of your spent arrows from the corpses of your foes.\n\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you need to shoot mobs or\n[[YELLOW]]other players. Guides.Archery.Section.1=[[DARK_AQUA]]How does Skill Shot work?\n[[YELLOW]]Skill Shot provides additional damage to your shots.\n[[YELLOW]]The bonus damage from Skill Shot increases as you\n[[YELLOW]]level in Archery.\n[[YELLOW]]With the default settings, your archery damage increases 10%\n[[YELLOW]]every 50 levels, to a maximum of 200% bonus damage. Guides.Archery.Section.2=[[DARK_AQUA]]How does Daze work?\n[[YELLOW]]You have a passive chance to daze other players when\n[[YELLOW]]you shoot them. When Daze triggers it forces your opponents\n[[YELLOW]]to look straight up for a short duration.\n[[YELLOW]]A Daze shot also deals an additional 4 damage (2 hearts). Guides.Archery.Section.3=[[DARK_AQUA]]How does Arrow Retrieval work?\n[[YELLOW]]You have a passive chance to retrieve some of your arrows\n[[YELLOW]]when you kill a mob with your bow.\n[[YELLOW]]This chance increases as you level in Archery.\n[[YELLOW]]By default, this ability increases by 0.1% per level, up to 100%\n[[YELLOW]]at level 1000. - ##Axes Guides.Axes.Section.0=[[DARK_AQUA]]About Axes:\n[[YELLOW]]With the Axes skill you can use your axe for much more then\n[[YELLOW]]just deforesting! You can hack and chop away at mobs\n[[YELLOW]]and players to gain XP, hitting mobs with the effect of\n[[YELLOW]]knockback and inflicting DEADLY criticals on mobs and players.\n[[YELLOW]]Your axe also becomes a hand-held woodchipper,\n[[YELLOW]]breaking down the enemy's armor with ease as your level\n[[YELLOW]]increases.\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you need hit other mobs or players\n[[YELLOW]]with an Axe. Guides.Axes.Section.1=[[DARK_AQUA]]How does Skull Splitter work?\n[[YELLOW]]This ability allows you to deal an AoE (Area of Effect) hit.\n[[YELLOW]]This AoE hit will deal half as much damage as you did to the\n[[YELLOW]]main target, so it's great for clearing out large piles of mobs. @@ -738,7 +711,6 @@ Guides.Axes.Section.2=[[DARK_AQUA]]How does Critical Strikes work?\n[[YELLOW]]Cr Guides.Axes.Section.3=[[DARK_AQUA]]How does Axe Mastery work?\n[[YELLOW]]Axe Mastery is a passive ability that will add additional damage\n[[YELLOW]]to your hits when using Axes.\n[[YELLOW]]By default, the bonus damage increases by 1 every 50 levels,\n[[YELLOW]]up to a cap of 4 extra damage at level 200. Guides.Axes.Section.4=[[DARK_AQUA]]How does Armor Impact work?\n[[YELLOW]]Strike with enough force to shatter armor!\n[[YELLOW]]Armor Impact has a passive chance to damage your\n[[YELLOW]]opponent's armor. This damage increases as you level in Axes. Guides.Axes.Section.5=[[DARK_AQUA]]How does Greater Impact work?\n[[YELLOW]]You have a passive chance to achieve a greater impact when\n[[YELLOW]]hitting mobs or players with your axe.\n[[YELLOW]]By default this chance is 25%. This passive ability has an\n[[YELLOW]]extreme knockback effect, similar to the Knockback II\n[[YELLOW]]enchantment. In addition, it deals bonus damage to the target. - ##Excavation Guides.Excavation.Section.0=[[DARK_AQUA]]About Excavation:\n[[YELLOW]]Excavation is the act of digging up dirt to find treasures.\n[[YELLOW]]By excavating the land you will find treasures.\n[[YELLOW]]The more you do this the more treasures you can find.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you must dig with a shovel in hand.\n[[YELLOW]]Only certain materials can be dug up for treasures and XP. Guides.Excavation.Section.1=[[DARK_AQUA]]Compatible Materials:\n[[YELLOW]]Grass, Dirt, Sand, Clay, Gravel, Mycelium, Soul Sand, Snow @@ -746,7 +718,6 @@ Guides.Excavation.Section.2=[[DARK_AQUA]]How to use Giga Drill Breaker:\n[[YELLO Guides.Excavation.Section.3=[[DARK_AQUA]]What is Giga Drill Breaker?\n[[YELLOW]]Giga Drill Breaker is an ability with a cooldown\n[[YELLOW]]tied to Excavation skill. It triples your chance\n[[YELLOW]]of finding treasures and enables instant break\n[[YELLOW]]on Excavation materials. Guides.Excavation.Section.4=[[DARK_AQUA]]How does Treasure Hunter work?\n[[YELLOW]]Every possible treasure for Excavation has its own\n[[YELLOW]]skill level requirement for it to drop, as a result it's\n[[YELLOW]]difficult to say how much it is helping you.\n[[YELLOW]]Just keep in mind that the higher your Excavation skill\n[[YELLOW]]is, the more treasures that can be found.\n[[YELLOW]]And also keep in mind that each type of Excavation\n[[YELLOW]]compatible material has its own unique list of treasures.\n[[YELLOW]]In other words you will find different treasures in Dirt\n[[YELLOW]]than you would in Gravel. Guides.Excavation.Section.5=[[DARK_AQUA]]Notes about Excavation:\n[[YELLOW]]Excavation drops are completely customizeable\n[[YELLOW]]So results vary server to server. - ##Fishing Guides.Fishing.Section.0=[[DARK_AQUA]]About Fishing:\n[[YELLOW]]With the Fishing skill, Fishing is exciting again!\n[[YELLOW]]Find hidden treasures, and shake items off mobs.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]Catch fish. Guides.Fishing.Section.1=[[DARK_AQUA]]How does Treasure Hunter work?\n[[YELLOW]]This ability allows you to find treasure from fishing \n[[YELLOW]]with a small chance of the items being enchanted.\n[[YELLOW]]Every possible treasure for Fishing has a chance\n[[YELLOW]]to drop on any level. It depends however\n[[YELLOW]]what the rarity of the item is how often it will drop.\n[[YELLOW]]The higher your Fishing skill is, the better\n[[YELLOW]]your chances are to find better treasures. @@ -755,7 +726,6 @@ Guides.Fishing.Section.3=[[DARK_AQUA]]How does Master Angler work?\n[[YELLOW]]Th Guides.Fishing.Section.4=[[DARK_AQUA]]How does Shake work?\n[[YELLOW]]This active ability allows you to shake items loose from mobs\n[[YELLOW]]by hooking them with the fishing rod. \n[[YELLOW]]Mobs will drop items they would normally drop on death.\n[[YELLOW]]It is also possible to acquire mob skulls, which are normally \n[[YELLOW]]unobtainable in survival mode. Guides.Fishing.Section.5=[[DARK_AQUA]]How does Fisherman's Diet work?\n[[YELLOW]]This passive skill increases the amount of hunger restored \n[[YELLOW]]from eating fish. Guides.Fishing.Section.6=[[DARK_AQUA]]Notes about Fishing:\n[[YELLOW]]Fishing drops are completely customizable,\n[[YELLOW]]so results vary server to server. - ##Herbalism Guides.Herbalism.Section.0=[[DARK_AQUA]]About Herbalism:\n[[YELLOW]]Herbalism is about collecting herbs and plants.\n\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]Collect plants and herbs. Guides.Herbalism.Section.1=[[DARK_AQUA]]Compatible Blocks\n[[YELLOW]]Wheat, Potatoes, Carrots, Melons, \n[[YELLOW]]Pumpkins, Sugar Canes, Cocoa Beans, Flowers, Cacti, Mushrooms,\n[[YELLOW]]Nether Wart, Lily Pads, and Vines. @@ -765,7 +735,6 @@ Guides.Herbalism.Section.4=[[DARK_AQUA]]How does Green Thumb (Cobble/Stone Brick Guides.Herbalism.Section.5=[[DARK_AQUA]]How does Farmer's Diet work?\n[[YELLOW]]This passive skill increases the amount of hunger restored \n[[YELLOW]]when eating Bread, Cookies, Melons, Mushroom Soup, Carrots,\n[[YELLOW]]and Potatoes. Guides.Herbalism.Section.6=[[DARK_AQUA]]How does Hylian Luck work?\n[[YELLOW]]This passive ability gives you a chance to find rare items\n[[YELLOW]]when certain blocks are broken with a sword. Guides.Herbalism.Section.7=[[DARK_AQUA]]How do Double Drops work?\n[[YELLOW]]This passive ability gives players more yield from their\n[[YELLOW]]harvests. - ##Mining Guides.Mining.Section.0=[[DARK_AQUA]]About Mining:\n[[YELLOW]]Mining consists of mining stone and ores. It provides bonuses\n[[YELLOW]]to the amount of materials dropped while mining.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill, you must mine with a pickaxe in hand.\n[[YELLOW]]Only certain blocks award XP. Guides.Mining.Section.1=[[DARK_AQUA]]Compatible Materials:\n[[YELLOW]]Stone, Coal Ore, Iron Ore, Gold Ore, Diamond Ore, Redstone Ore,\n[[YELLOW]]Lapis Ore, Obsidian, Mossy Cobblestone, Ender Stone,\n[[YELLOW]]Glowstone, and Netherrack. @@ -773,30 +742,25 @@ Guides.Mining.Section.2=[[DARK_AQUA]]How to use Super Breaker:\n[[YELLOW]]With a Guides.Mining.Section.3=[[DARK_AQUA]]What is Super Breaker?\n[[YELLOW]]Super Breaker is an ability with a cooldown tied to the Mining\n[[YELLOW]]skill. It triples your chance of extra items dropping and\n[[YELLOW]]enables instant break on Mining materials. Guides.Mining.Section.4=[[DARK_AQUA]]How to use Blast Mining:\n[[YELLOW]]With a detonator in hand, which is a flint & steel by default,\n[[YELLOW]]crouch and right-click on TNT from a distance. This will cause the TNT\n[[YELLOW]]to instantly explode. Guides.Mining.Section.5=[[DARK_AQUA]]How does Blast Mining work?\n[[YELLOW]]Blast Mining is an ability with a cooldown tied to the Mining\n[[YELLOW]]skill. It gives bonuses when mining with TNT and allows you\n[[YELLOW]]to remote detonate TNT. There are three parts to Blast Mining.\n[[YELLOW]]The first part is Bigger Bombs, which increases blast radius.\n[[YELLOW]]The second is Demolitions Expert, which decreases damage\n[[YELLOW]]from TNT explosions. The third part simply increases the\n[[YELLOW]]amount of ores dropped from TNT and decreases the\n[[YELLOW]]debris dropped. - ##Repair Guides.Repair.Section.0=[[DARK_AQUA]]About Repair:\n[[YELLOW]]Repair allows you to use an iron block to repair armor and\n[[YELLOW]]tools, or a gold block to salvage armor and tools.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]Repair tools or armor using the mcMMO Anvil. This is an\n[[YELLOW]]iron block by default and should not be confused with\n[[YELLOW]]the Vanilla Minecraft Anvil. Guides.Repair.Section.1=[[DARK_AQUA]]How can I use Repair?\n[[YELLOW]]Place down a mcMMO Anvil and right-click to repair the item \n[[YELLOW]]you're currently holding. This consumes 1 item on every use. Guides.Repair.Section.2=[[DARK_AQUA]]How does Repair Mastery work?\n[[YELLOW]]Repair Mastery increases the repair amount. The extra amount\n[[YELLOW]]repaired is influenced by your Repair skill level. Guides.Repair.Section.3=[[DARK_AQUA]]How does Super Repair work?\n[[YELLOW]]Super Repair is a passive ability. When repairing an item,\n[[YELLOW]]it grants players a chance to repair an item with\n[[YELLOW]]double effectiveness. Guides.Repair.Section.4=[[DARK_AQUA]]How does Arcane Forging work?\n[[YELLOW]]This passive ability allows you to repair items with a certain\n[[YELLOW]]chance of maintaining its enchantments. The enchants may be\n[[YELLOW]]kept at their existing levels, downgraded to a lower level,\n[[YELLOW]]or lost entirely. - ##Salvage Guides.Salvage.Section.0=[[DARK_AQUA]]About Salvage:\n[[YELLOW]]Salvage allows you to use an gold block to salvage armor and\n[[YELLOW]]tools.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]Salvage is a child skill of Repair and Fishing, your Salvage\n[[YELLOW]]skill level is based on your Fishing and Repair skill levels. Guides.Salvage.Section.1=[[DARK_AQUA]]How can I use Salvage?\n[[YELLOW]]Place down a mcMMO Salvage Anvil and right-click to salvage\n[[YELLOW]]the item you're currently holding. This will break apart the item,\n[[YELLOW]]and give back materials used to craft the item.\n\n[[YELLOW]]For example, salvaging an iron pickaxe will give you iron bars. Guides.Salvage.Section.2=[[DARK_AQUA]]How does Advanced Salvage work?\n[[YELLOW]]When unlocked, this ability allows you to salvage damaged items.\n[[YELLOW]]The yield percentage increases as you level up. A higher yield\n[[YELLOW]]means that you can get more materials back.\n[[YELLOW]]With advanced salvage you will always get 1 material back,\n[[YELLOW]]unless the item is too damaged. So you don't have to worry\n[[YELLOW]]about destroying items without getting anything in return. Guides.Salvage.Section.3=[[DARK_AQUA]]To illustrate how this works, here's an example:\n[[YELLOW]]Let's say we salvage a gold pickaxe which is damaged for 20%,\n[[YELLOW]]this means that the maximum amount you could get is only 2\n[[YELLOW]](because the pick is crafted with 3 ingots - each worth\n[[YELLOW]]33,33% durability) which is equal to 66%. If your yield\n[[YELLOW]]percentage is below 66% you are not able to get 2 ingots.\n[[YELLOW]]If it is above this value you are able to gain the "full amount",\n[[YELLOW]]which means that you will get 2 ingots. Guides.Salvage.Section.4=[[DARK_AQUA]]How does Arcane Salvage work?\n[[YELLOW]]This ability allows you to get enchanted books when salvaging\n[[YELLOW]]enchanted items. Depending on your level the chance of\n[[YELLOW]]successfully extracting a full or partial enchantment varies.\n\n[[YELLOW]]When an enchantment is partially extracted, the enchantment\n[[YELLOW]]book will have a lower level enchantment compared to what\n[[YELLOW]]it was on the item. - ##Smelting Guides.Smelting.Section.0=Coming soon... - ##Swords Guides.Swords.Section.0=[[DARK_AQUA]]About Swords:\n[[YELLOW]]This skill awards combat bonuses to anyone fighting with a\n[[YELLOW]]sword.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]XP is gained based on the amount of damage dealt to mobs or \n[[YELLOW]]other players when wielding a sword. Guides.Swords.Section.1=[[DARK_AQUA]]How does Serrated Strikes work?\n[[YELLOW]]Serrated Strikes is an active ability, you can activate it by\n[[YELLOW]]right-clicking with a sword. This ability allows you to deal \n[[YELLOW]]an AoE (Area of Effect) hit. This AoE will do a bonus 25%\n[[YELLOW]]damage and will inflict a bleed effect that lasts for 5 ticks. Guides.Swords.Section.2=[[DARK_AQUA]]How does Counter Attack work?\n[[YELLOW]]Counter Attack is an active ability. When blocking and taking\n[[YELLOW]]hits from mobs, you will have a chance to reflect 50% of \n[[YELLOW]]the damage that was taken. Guides.Swords.Section.3=[[DARK_AQUA]]How does Bleed work?\n[[YELLOW]]Bleed causes enemies to take damage every two seconds. The \n[[YELLOW]]target will bleed until the effect wears off, or death, \n[[YELLOW]]whichever comes first.\n[[YELLOW]]The duration of the bleed is increased by your sword skill. - ##Taming Guides.Taming.Section.0=[[DARK_AQUA]]About Taming:\n[[YELLOW]]Taming will give players various combat bonuses when using\n[[YELLOW]]tamed wolves.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill, you need to tame wolves/ocelots or\n[[YELLOW]]get into combat with your wolves. Guides.Taming.Section.1=[[DARK_AQUA]]How does Call of the Wild work?\n[[YELLOW]]Call of the Wild is an active ability that will allow you to summon\n[[YELLOW]]a wolf or an ocelot by your side. You can do this by\n[[YELLOW]]left-clicking while holding bones or fish. @@ -807,7 +771,6 @@ Guides.Taming.Section.5=[[DARK_AQUA]]How does Environmentally Aware work?\n[[YEL Guides.Taming.Section.6=[[DARK_AQUA]]How does Thick Fur work?\n[[YELLOW]]This passive ability will reduce damage and make wolves\n[[YELLOW]]fire resistant. Guides.Taming.Section.7=[[DARK_AQUA]]How does Shock Proof work?\n[[YELLOW]]This passive ability reduces damage done to wolves\n[[YELLOW]]from explosions. Guides.Taming.Section.8=[[DARK_AQUA]]How does Fast Food Service work?\n[[YELLOW]]This passive ability gives wolves a chance to heal whenever\n[[YELLOW]]they perform an attack. - ##Unarmed Guides.Unarmed.Section.0=[[DARK_AQUA]]About Unarmed:\n[[YELLOW]]Unarmed will give players various combat bonuses when using\n[[YELLOW]]your fists as a weapon. \n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]XP is gained based on the amount of damage dealt to mobs \n[[YELLOW]]or other players when unarmed. Guides.Unarmed.Section.1=[[DARK_AQUA]]How does Berserk work?\n[[YELLOW]]Beserk is an active ability that is activated by\n[[YELLOW]]right-clicking. While in Beserk mode, you deal 50% more\n[[YELLOW]]damage and you can break weak materials instantly, such as\n[[YELLOW]]Dirt and Grass. @@ -815,19 +778,16 @@ Guides.Unarmed.Section.2=[[DARK_AQUA]]How does Iron Arm work?\n[[YELLOW]]Iron Ar Guides.Unarmed.Section.3=[[DARK_AQUA]]How does Arrow Deflect work?\n[[YELLOW]]Arrow Deflect is a passive ability that gives you a chance\n[[YELLOW]]to deflect arrows shot by Skeletons or other players.\n[[YELLOW]]The arrow will fall harmlessly to the ground. Guides.Unarmed.Section.4=[[DARK_AQUA]]How does Iron Grip work?\n[[YELLOW]]Iron Grip is a passive ability that counters disarm. As your\n[[YELLOW]]unarmed level increases, the chance of preventing a disarm increases. Guides.Unarmed.Section.5=[[DARK_AQUA]]How does Disarm work?\n[[YELLOW]]This passive ability allows players to disarm other players,\n[[YELLOW]]causing the target's equipped item to fall to the ground. - ##Woodcutting Guides.Woodcutting.Section.0=[[DARK_AQUA]]About Woodcutting:\n[[YELLOW]]Woodcutting is all about chopping down trees.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]XP is gained whenever you break log blocks. Guides.Woodcutting.Section.1=[[DARK_AQUA]]How does Tree Feller work?\n[[YELLOW]]Tree Feller is an active ability, you can right-click\n[[YELLOW]]while holding an ax to activate Tree Feller. This will\n[[YELLOW]]cause the entire tree to break instantly, dropping all\n[[YELLOW]]of its logs at once. Guides.Woodcutting.Section.2=[[DARK_AQUA]]How does Leaf Blower work?\n[[YELLOW]]Leaf Blower is a passive ability that will cause leaf\n[[YELLOW]]blocks to break instantly when hit with an axe. By default,\n[[YELLOW]]this ability unlocks at level 100. Guides.Woodcutting.Section.3=[[DARK_AQUA]]How do Double Drops work?\n[[YELLOW]]This passive ability gives you a chance to obtain an extra\n[[YELLOW]]block for every log you chop. - #INSPECT -Inspect.Offline= [[RED]]\uADF8 \uD50C\uB808\uC774\uC5B4\uB294 \uC624\uD504\uB77C\uC778 \uC785\uB2C8\uB2E4, \uC624\uC9C1 op\uB4E4\uB9CC \uAC80\uC0AC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4! +Inspect.Offline=[[RED]]\uADF8 \uD50C\uB808\uC774\uC5B4\uB294 \uC624\uD504\uB77C\uC778 \uC785\uB2C8\uB2E4, \uC624\uC9C1 op\uB4E4\uB9CC \uAC80\uC0AC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4! Inspect.OfflineStats=mcMMO \uC624\uD504\uB77C\uC778 \uC720\uC800 \uC2A4\uD15F\uC740 [[YELLOW]]{0} \uC785\uB2C8\uB2E4 Inspect.Stats=[[GREEN]]mcMMO \uC2A4\uD15F\uC740 [[YELLOW]]{0} \uC785\uB2C8\uB2E4 Inspect.TooFar=\uB2F9\uC2E0\uC740 \uADF8 \uD50C\uB808\uC774\uC5B4\uC640 \uB108\uBB34 \uBA40\uB9AC \uB5A8\uC5B4\uC838 \uC788\uC5B4 \uAC80\uC0AC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4! - #ITEMS Item.ChimaeraWing.Fail=**\uD0A4\uBA54\uB77C\uC758 \uB0A0\uAC1C \uC2E4\uD328!** Item.ChimaeraWing.Pass=**\uD0A4\uBA54\uB77C \uB0A0\uAC1C** @@ -838,29 +798,25 @@ Item.Injured.Wait=\uB2F9\uC2E0\uC740 \uCD5C\uADFC\uC5D0 \uBD80\uC0C1\uC744 \uB2F Item.FluxPickaxe.Name=\uC6A9\uD574 \uACE1\uAD2D\uC774 Item.FluxPickaxe.Lore.1=[[GRAY]]\uAD11\uBB3C\uC744 \uC989\uC2DC \uC81C\uB828\uD560 \uAE30\uD68C\uB97C \uAC00\uC9D1\uB2C8\uB2E4. Item.FluxPickaxe.Lore.2=[[GRAY]]\uC81C\uB828 \uC694\uAD6C \uB808\uBCA8 {0} \uC774\uC0C1 - #TELEPORTATION Teleport.Commencing=[[GRAY]]\uD154\uB808\uD3EC\uD2B8\uAC00 [[GOLD]]({0}) [[GRAY]]\uCD08\uC548\uC5D0 \uC2DC\uC791\uB429\uB2C8\uB2E4, \uAC00\uB9CC\uD788 \uAE30\uB2EC\uB824\uC8FC\uC138\uC694... Teleport.Cancelled=[[DARK_RED]]\uD154\uB808\uD3EC\uD2B8 \uCDE8\uC18C\uB428! - #SKILLS Skills.Child=[[GOLD]](\uD558\uC704 \uC2A4\uD0AC) Skills.Disarmed=[[DARK_RED]]\uB2F9\uC2E0\uC740 \uBB34\uC7A5 \uD574\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4! Skills.Header=-----[][[GREEN]]{0}[[RED]][]----- Skills.NeedMore=[[DARK_RED]]\uB2F9\uC2E0\uC740 [[GRAY]]{0}\uAC00 \uB354 \uD544\uC694\uD569\uB2C8\uB2E4 -Skills.Parents = \uC0C1\uC704\uB4E4 +Skills.Parents=\uC0C1\uC704\uB4E4 Skills.Stats={0}[[GREEN]]{1}[[DARK_AQUA]] XP([[GRAY]]{2}[[DARK_AQUA]]/[[GRAY]]{3}[[DARK_AQUA]]) Skills.ChildStats={0}[[GREEN]]{1} Skills.TooTired=\uC2A4\uD0AC \uC7AC \uC0AC\uC6A9 \uB300\uAE30\uC2DC\uAC04: ({0}\uCD08) Skills.Cancelled={0} \uCDE8\uC18C\uB428! Skills.ConfirmOrCancel=[[GREEN]]\uB2E4\uC2DC \uC6B0-\uD074\uB9AD\uC744 \uD558\uBA74 \uD655\uC778 [[GOLD]]{0}[[GREEN]]. \uC88C-\uD074\uB9AD\uC744 \uD558\uBA74 \uCDE8\uC18C\uAC00 \uB429\uB2C8\uB2E4. - #STATISTICS Stats.Header.Combat=[[GOLD]]-=\uC804\uD22C \uC2A4\uD0AC=- Stats.Header.Gathering=[[GOLD]]-=\uC218\uC9D1 \uC2A4\uD0AC=- Stats.Header.Misc=[[GOLD]]-=\uAE30\uD0C0 \uC2A4\uD0AC=- Stats.Own.Stats=[[GREEN]][mcMMO] \uC2A4\uD15F - #PERKS Perks.XP.Name=\uACBD\uD5D8\uCE58 Perks.XP.Desc=\uD2B9\uC815 \uC2A4\uD0AC\uC5D0 \uACBD\uD5D8\uCE58 \uBD80\uC2A4\uD2B8\uB97C \uBC1B\uC74C. @@ -873,7 +829,6 @@ Perks.Cooldowns.Desc=\uC7AC\uC0AC\uC6A9\uB300\uAE30\uC2DC\uAC04\uC744 {0}\uB9CC\ Perks.ActivationTime.Name=\uC778\uB0B4\uB825 Perks.ActivationTime.Desc=\uB2A5\uB825 \uD65C\uC131 \uC2DC\uAC04\uC774 {0}\uCD08\uB85C \uC99D\uAC00\uD569\uB2C8\uB2E4. Perks.ActivationTime.Bonus=[[GOLD]] ({0}\uCD08\uC758 \uC778\uB0B4\uB825 \uD2B9\uC804) - #HARDCORE Hardcore.Mode.Disabled=[[GOLD]][mcMMO] \uD558\uB4DC\uCF54\uC5B4 \uBAA8\uB4DC {0}\uAC00 {1}\uC5D0 \uBE44\uD65C\uC131\uD654\uB428. Hardcore.Mode.Enabled=[[GOLD]][mcMMO] \uD558\uB4DC\uCF54\uC5B4 \uBAA8\uB4DC {0}\uAC00 {1}\uC5D0 \uD65C\uC131\uD654\uB428. @@ -886,7 +841,6 @@ Hardcore.Vampirism.Killer.Success=[[GOLD]][mcMMO] [[DARK_AQUA]]\uB2F9\uC2E0\uC74 Hardcore.Vampirism.Victim.Failure=[[GOLD]][mcMMO] [[YELLOW]]{0}[[GRAY]]\uB2D8\uC740 \uB2F9\uC2E0\uC758 \uC9C0\uC2DD\uC744 \uAC00\uC838\uAC08\uC218 \uC5C6\uC5C8\uC2B5\uB2C8\uB2E4! Hardcore.Vampirism.Victim.Success=[[GOLD]][mcMMO] [[YELLOW]]{0}[[DARK_RED]]\uB2D8\uC740 \uB2F9\uC2E0\uC5D0\uAC8C\uC11C [[BLUE]]{1}[[DARK_RED]] \uB808\uBCA8\uC744 \uD6D4\uCCD0\uAC14\uC2B5\uB2C8\uB2E4! Hardcore.Vampirism.PercentageChanged=[[GOLD]][mcMMO] \uC2A4\uD15F \uD761\uD608 \uBE44\uC728\uC774 {0}\uB85C \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4. - #MOTD MOTD.Donate=[[DARK_AQUA]]\uAE30\uBD80 \uC815\uBCF4: MOTD.Hardcore.Enabled=[[GOLD]][mcMMO] [[DARK_AQUA]]\uD558\uB4DC\uCF54\uC5B4 \uBAA8\uB4DC \uD65C\uC131\uD654\uB428: [[DARK_RED]]{0} @@ -895,7 +849,6 @@ MOTD.Hardcore.Vampirism.Stats=[[GOLD]][mcMMO] [[DARK_AQUA]]\uBC40\uD30C\uC774\uC MOTD.PerksPrefix=[mcMMO \uD2B9\uC804] MOTD.Version=[[GOLD]][mcMMO] \uAD6C\uB3D9\uC911\uC778 \uBC84\uC804 [[DARK_AQUA]]{0} MOTD.Website=[[GOLD]][mcMMO] [[GREEN]]{0}[[YELLOW]] - mcMMO \uC6F9\uC0AC\uC774\uD2B8 - #SMELTING Smelting.Ability.FluxMining=\uC720\uB3D9 \uCC44\uAD74 \uD655\uB960: [[YELLOW]]{0} Smelting.Ability.FuelEfficiency=\uC720\uB3D9 \uD6A8\uC728\uC131 \uBC30\uC728: [[YELLOW]]{0}x @@ -914,7 +867,6 @@ Smelting.SubSkill.FluxMining.Description=\uCC44\uAD74\uC911 \uAD11\uBB3C \uC989\ Smelting.FluxMining.Success=[[GREEN]]\uAD11\uBB3C\uC774 \uC7AC\uB828\uB418\uC5C8\uC2B5\uB2C8\uB2E4! Smelting.Listener=\uC81C\uB828(Smelting): Smelting.SkillName=\uC81C\uB828 - #COMMAND DESCRIPTIONS Commands.Description.addlevels=mcMMO \uB808\uBCA8\uC744 \uC720\uC800\uC5D0\uAC8C \uCD94\uAC00 Commands.Description.adminchat=mcMMO \uAD00\uB9AC\uC790 \uCC44\uD305 \uCF1C\uAE30/\uB044\uAE30\uB098 \uAD00\uB9AC\uC790 \uCC44\uD305 \uBA54\uC138\uC9C0 \uBCF4\uB0B4\uAE30 @@ -946,11 +898,9 @@ Commands.Description.skillreset=\uC720\uC800\uC758 mcMMO \uB808\uBCA8 \uC7AC\uC1 Commands.Description.vampirism=mcMMO \uBC40\uD30C\uC774\uC5B4\uB9AC\uC810 \uBE44\uC728\uC774\uB098 \uBC40\uD30C\uC774\uC5B4\uB9AC\uC810 \uBAA8\uB4DC \uCF1C\uAE30/\uB044\uAE30 Commands.Description.xplock=\uBA85\uD655\uD55C mcMMO \uAE30\uC220\uC758 mcMMO xp \uBC14\uB97C \uC7A0\uAE08 Commands.Description.xprate=mcMMO XP \uBC30\uC728 \uC218\uC815\uC774\uB098 mcMMO XP \uC774\uBCA4\uD2B8 \uC2DC\uC791 - #UPDATE CHECKER UpdateChecker.outdated=\uB2F9\uC2E0\uC740 mcMMO \uAD6C\uBC84\uC804\uC744 \uC0AC\uC6A9\uC911\uC785\uB2C8\uB2E4! UpdateChecker.newavailable=\uC2E0 \uBC84\uC804\uC774 BukkitDev\uC5D0 \uC5C5\uB85C\uB4DC\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4. - #SCOREBOARD HEADERS Scoreboard.Header.PlayerStats=mcMMO \uC2A4\uD15F Scoreboard.Header.PlayerCooldowns=mcMMO \uC7AC \uC0AC\uC6A9 \uB300\uAE30\uC2DC\uAC04 @@ -963,7 +913,6 @@ Scoreboard.Misc.CurrentXP=[[GREEN]]\uD604\uC7AC XP Scoreboard.Misc.RemainingXP=\uB0A8\uC740 XP Scoreboard.Misc.Cooldown=[[LIGHT_PURPLE]]\uC7AC \uC0AC\uC6A9 \uB300\uAE30\uC2DC\uAC04 Scoreboard.Misc.Overall=[[GOLD]]\uC885\uD569 - #DATABASE RECOVERY Profile.Loading.Success=[[GREEN]]\uB2F9\uC2E0\uC758 mcMMO \uD504\uB85C\uD30C\uC77C\uC774 \uBD88\uB7EC\uC640\uC84C\uC2B5\uB2C8\uB2E4. Profile.Loading.Failure=mcMMO\uB294 \uC5EC\uC804\uD788 \uB2F9\uC2E0\uC758 \uB370\uC774\uD130\uB97C \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uB2F9\uC2E0\uC740 \uC544\uB9C8\uB3C4 [[AQUA]]\uC11C\uBC84\uAD00\uB9AC\uC790\uC640 \uC5F0\uB77D[[RED]]\uD558\uAE30\uB97C \uC6D0\uD560 \uAC83\uC785\uB2C8\uB2E4.\n[[YELLOW]]\uB2F9\uC2E0\uC740 \uC5EC\uC804\uD788 \uC11C\uBC84\uC5D0\uC11C \uAC8C\uC784\uC911\uC774\uC9C0\uB9CC, \uB2F9\uC2E0\uC740 [[BOLD]]mcMMO \uB808\uBCA8\uC774 \uC5C6\uACE0[[YELLOW]] \uB2F9\uC2E0\uC774 \uC5BB\uC740 \uC5B4\uB290 XP\uB3C4 [[BOLD]]\uC800\uC7A5\uB418\uC9C0 \uC54A\uC744 \uAC81\uB2C8\uB2E4[[YELLOW]]. diff --git a/bukkit/src/main/resources/locale/locale_nl.properties b/bukkit/src/main/resources/locale/locale_nl.properties index 83479f641..193e9188a 100644 --- a/bukkit/src/main/resources/locale/locale_nl.properties +++ b/bukkit/src/main/resources/locale/locale_nl.properties @@ -17,7 +17,7 @@ Archery.SubSkill.Daze.Description=Verward tegenstanders en doet {0} schade Archery.SubSkill.ArrowRetrieval.Description=Kans om pijlen te krijgen van lijken Archery.Listener=Boogschieten: Archery.SkillName=BOOGSCHIETEN -Archery.Skillup= Boogschieten ervaring toegenomen met {0}. Totaal ({1}) +Archery.Skillup=Boogschieten ervaring toegenomen met {0}. Totaal ({1}) Axes.Ability.Bonus.0=Bijl Meesterschap Axes.Ability.Bonus.1=Bonus {0} schade Axes.Ability.Bonus.4=Grotere impact @@ -39,7 +39,7 @@ Axes.SubSkill.GreaterImpact.Name=Grotere impact Axes.SubSkill.GreaterImpact.Description=Deal bonus schade aan unarmored vijanden Axes.Listener=Bijlen Axes.SkillName=BIJLEN -Axes.Skills.SS.Off= ** Skull Splitter is uitgewerkt ** +Axes.Skills.SS.Off=** Skull Splitter is uitgewerkt ** Axes.Skills.SS.On=[[GREEN]]**SCHEDEL SPLIJTER GEACTIVEERD** Axes.Skills.SS.Refresh=[[GREEN]]Je [[YELLOW]]Schedel Splijter [[GREEN]]kracht is hersteld! Axes.Skills.SS.Other.Off=Skull Splitter [[GREEN]]is uitgewerkt voor [[GEEL]]{0} @@ -53,15 +53,15 @@ Excavation.SubSkill.TreasureHunter.Name=Schatten Jager Excavation.SubSkill.TreasureHunter.Description=Mogelijkheid om te graven naar schatten Excavation.Listener=Uitgraving: Excavation.SkillName=Uitgraving -Excavation.Skills.GigaDrillBreaker.Off= ** Giga Drill Breeker is uitgewerkt ** +Excavation.Skills.GigaDrillBreaker.Off=** Giga Drill Breeker is uitgewerkt ** Excavation.Skills.GigaDrillBreaker.On=[[GREEN]]**GIGA DRILL BREKER GEACTIVEERD** Excavation.Skills.GigaDrillBreaker.Refresh=[[GREEN]]Je [[YELLOW]]Giga Drill Breeker [[GREEN]] kracht is hersteld! -Excavation.Skills.GigaDrillBreaker.Other.Off= Giga Drill Breaker [[GREEN]] is uitgewerkt voor [[GEEL]] {0} +Excavation.Skills.GigaDrillBreaker.Other.Off=Giga Drill Breaker [[GREEN]] is uitgewerkt voor [[GEEL]] {0} Excavation.Skills.GigaDrillBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]] heeft [[RED]]Giga Drill Breaker [[DARK_GREEN]]gebruikt! Excavation.Skillup=Uitgravings ervaring toegenomen met {0}. Totaal ({1}) Fishing.Ability.Info=Magische Jager: [[GRAY]] ** verbetert bij Treasure Hunter Rank ** Fishing.Ability.Shake=Schud Kans: [[YELLOW]]{0} -Fishing.Ability.IceFishing= Ice Vissen: Ga vissen in ijs +Fishing.Ability.IceFishing=Ice Vissen: Ga vissen in ijs Fishing.SubSkill.TreasureHunter.Name=Schatten Jager (Passief) Fishing.SubSkill.TreasureHunter.Description=Vis misc. objecten op Fishing.SubSkill.MagicHunter.Name=Magische Jager @@ -108,12 +108,12 @@ Mining.SubSkill.BiggerBombs.Description=Verhoogt TNT explosie radius Mining.SubSkill.DemolitionsExpertise.Description=Vermindert schade door TNT explosies Mining.Listener=Mijnbouw: Mining.SkillName=MIJNBOUW -Mining.Skills.SuperBreaker.Off= ** Super Breaker is uitgewerkt ** +Mining.Skills.SuperBreaker.Off=** Super Breaker is uitgewerkt ** Mining.Skills.SuperBreaker.Other.Off=Super Breker [[GREEN]]is uitgewerkt voor [[YELLOW]]{0} Mining.Skills.SuperBreaker.Refresh=[[GREEN]]Je[[YELLOW]]Super Breeker [[GREEN]]kracht is hersteld! Mining.Skillup=Mijn ervaring toegenomen met {0}. Totaal: ({1}) Mining.Blast.Boom=[[GRAY]]**BOEM** -Mining.Blast.Radius.Increase= Ontploffings Radius Verhoging: [[YELLOW]] {0} +Mining.Blast.Radius.Increase=Ontploffings Radius Verhoging: [[YELLOW]] {0} Mining.Blast.Rank=Explosie Mining: [[YELLOW]] Rang {0}/8 [[GRAY]]({1}) Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] heeft [[RED]] Blast Mining![DARK_GREEN] gebruikt Mining.Blast.Refresh=[[GREEN]]Je [[YELLOW]]explosie mijn [[GREEN]]kracht is hersteld! @@ -218,7 +218,7 @@ Unarmed.Skills.Berserk.Other.On=[[GREEN]]{0}[[DARK_GREEN]] heeft [[RED]]Razernij Unarmed.Skills.Berserk.Refresh=[[GREEN]]Je [[YELLOW]]Razernij [[GREEN]]kracht is hersteld! Woodcutting.Ability.0=Bladblazer Woodcutting.Ability.1=Bladeren wegblazen -Woodcutting.Ability.Length= Boom Feller Lengte: [[GEEL]]{0}s +Woodcutting.Ability.Length=Boom Feller Lengte: [[GEEL]]{0}s Woodcutting.Ability.Locked.0=Vergrendeld totdat {0}+ VAARDIGHEID (BLADBLAZER) Woodcutting.SubSkill.TreeFeller.Name=Tree Feller Woodcutting.SubSkill.TreeFeller.Description=Laat bomen ontploffen @@ -228,10 +228,10 @@ Woodcutting.SubSkill.HarvestLumber.Name=Dubbele drops Woodcutting.SubSkill.HarvestLumber.Description=Het dubbele van de normale buit Woodcutting.Listener=Houthakken: Woodcutting.SkillName=Houthakken -Woodcutting.Skills.TreeFeller.Off= ** Boom Feller is uitgewerkt ** +Woodcutting.Skills.TreeFeller.Off=** Boom Feller is uitgewerkt ** Woodcutting.Skills.TreeFeller.On=[[GREEN]]**BOOM FELLER GEACTIVEERD** Woodcutting.Skills.TreeFeller.Refresh=[[GREEN]]Je [[YELLOW]]Boom Feller [[GREEN]]kracht is hersteld! -Woodcutting.Skills.TreeFeller.Other.Off= Boom Feller [[GREEN]] is uitgewerkt voor [[GEEL]]{0} +Woodcutting.Skills.TreeFeller.Other.Off=Boom Feller [[GREEN]] is uitgewerkt voor [[GEEL]]{0} Woodcutting.Skills.TreeFeller.Other.On=[[GREEN]]{0}[[DARK)GREEN]]heeft[[RED]]Tree Feller[[DARK_GREEN]]gebruikt! Woodcutting.Skills.TreeFeller.Splinter=JOU BIJL SPLINTERT IN DUIZENDEN STUKJES! Woodcutting.Skills.TreeFeller.Threshold=Die boom is te groot! @@ -264,8 +264,8 @@ Commands.mcrank.Player=DOELWIT: [[WHITE]]{0} Commands.mmoedit=[player] [[RED]] - Pas doel aan Commands.mmoedit.Modified.1=[[GREEN]]Uw level in {0} is veranderd naar {1} Commands.mmoedit.Modified.2={0} is aangepast voor {1}. -Commands.mcconvert.Database.Same= Je makt al gebruik van de {0} database! -Commands.mcconvert.Database.InvalidType= {0} is geen geldig soort database. +Commands.mcconvert.Database.Same=Je makt al gebruik van de {0} database! +Commands.mcconvert.Database.InvalidType={0} is geen geldig soort database. Commands.ModDescription=- Lees instructie mod beschrijving Commands.NoConsole=Deze commando wordt niet ondersteund vanuit de console. Commands.Other=[[GREEN]]--OVERIGE COMMANDS-- @@ -293,16 +293,16 @@ Commands.Party.Teleport= [[RED]]- Teleport naar een groepslid Commands.Party.Toggle=- Zet Party Chat aan/uit Commands.Party.1=- Maak een nieuwe groep Commands.Party.2=- Ga bij een spelers groep -Commands.ptp.NoRequests= Je hebt geen teleporteren aanvragen op dit moment +Commands.ptp.NoRequests=Je hebt geen teleporteren aanvragen op dit moment Commands.ptp.RequestExpired=Groep\'s teleport verzoek is verlopen! Commands.PowerLevel.Leaderboard=--mcMMO[[BLUE]] Kracht Level [[YELLOW]]Leiderbord-- Commands.PowerLevel=[[DARK_RED]]KRACHT LEVEL: [[GREEN]]{0} Commands.Reset=Reset een niveau level naar 0 -Commands.Skill.Invalid= Dat is geen geldig skillname! +Commands.Skill.Invalid=Dat is geen geldig skillname! Commands.Skill.Leaderboard=--mcMMO [[BLUE]]{0}[[YELLOW]] Ranglijst -- Commands.Stats.Self=Je status Commands.Stats=- Laat je mcMMO statussen zien -Commands.ToggleAbility= - Toggle Kracht activering met rechts klikken +Commands.ToggleAbility=- Toggle Kracht activering met rechts klikken Commands.Usage.Level=niveau Commands.Usage.Message=bericht Commands.Usage.PartyName=naam diff --git a/bukkit/src/main/resources/locale/locale_pl.properties b/bukkit/src/main/resources/locale/locale_pl.properties index 22a0f5fed..0f37b39d6 100644 --- a/bukkit/src/main/resources/locale/locale_pl.properties +++ b/bukkit/src/main/resources/locale/locale_pl.properties @@ -512,7 +512,7 @@ Guides.Available=[[GRAY]]Przewodnik dla {0} jest dost\u0119pny - wpisz /{1} ? [s Guides.Header=[[GOLD]]-=[[GREEN]]{0} Przewodnik[[GOLD]]=- Guides.Page.Invalid=Niew\u0142a\u015bciwa strona! Guides.Page.OutOfRange=Ta strona nie istnieje, jest tylko {0} stron. -Guides.Usage= W\u0142a\u015bciwa Komenda to /{0} ? [strona] +Guides.Usage=W\u0142a\u015bciwa Komenda to /{0} ? [strona] Guides.Smelting.Section.0=Wkrotce... Inspect.Offline=Nie masz odpowiednich uprawnie\u0144 aby przygl\u0105da\u0107 si\u0119 graczom offline! Inspect.OfflineStats=Statystyki Gracza Offline [[YELLOW]]{0} diff --git a/bukkit/src/main/resources/locale/locale_ru.properties b/bukkit/src/main/resources/locale/locale_ru.properties index 82da31f19..8da1c6ee4 100644 --- a/bukkit/src/main/resources/locale/locale_ru.properties +++ b/bukkit/src/main/resources/locale/locale_ru.properties @@ -26,7 +26,7 @@ Archery.Listener=\u0421\u0442\u0440\u0435\u043b\u044c\u0431\u0430 \u0438\u0437 \ Archery.SkillName=\u0421\u0422\u0420\u0415\u041b\u042c\u0411\u0410 \u0418\u0417 \u041b\u0423\u041a\u0410 Archery.Skillup=\u0423\u0440\u043e\u0432\u0435\u043d\u044c \u043d\u0430\u0432\u044b\u043a\u0430 \"\u0421\u0442\u0440\u0435\u043b\u044c\u0431\u0430 \u0438\u0437 \u043b\u0443\u043a\u0430\" \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d \u043d\u0430 {0}. \u0412\u0441\u0435\u0433\u043e ({1}) Axes.Ability.Bonus.0=\u041c\u0430\u0441\u0442\u0435\u0440 \u0422\u043e\u043f\u043e\u0440\u0430 -Axes.Ability.Bonus.1= \u041d\u0430\u043d\u043e\u0441\u0438\u0442 {0} \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0423\u0440\u043e\u043d\u0430 +Axes.Ability.Bonus.1=\u041d\u0430\u043d\u043e\u0441\u0438\u0442 {0} \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0423\u0440\u043e\u043d\u0430 Axes.Ability.Bonus.2=\u0411\u0440\u043e\u043d\u0435\u0431\u043e\u0439\u043d\u044b\u0439 \u0423\u0434\u0430\u0440 Axes.Ability.Bonus.3=\u041d\u0430\u043d\u043e\u0441\u0438\u0442 {0} \u0414\u043e\u043f\u043e\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0423\u0440\u043e\u043d\u0430 \u0431\u0440\u043e\u043d\u0435 Axes.Ability.Bonus.4=\u0412\u0435\u043b\u0438\u043a\u0438\u0439 \u0423\u0434\u0430\u0440 @@ -501,7 +501,7 @@ Party.Help.2=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 Party.Help.3=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 [[DARK_AQUA]]{0} [password] [[RED]]\u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0435\u043d\u0438\u0442\u044c\u0441\u044f \u0438\u043b\u0438 [[DARK_AQUA]]{1} [[RED]]\u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0439\u0442\u0438 Party.Help.4=\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043b\u0438 \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0448\u0443 \u0433\u0440\u0443\u043f\u043f\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 [[DARK_AQUA]]{0} Party.Help.5=\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u0435\u043c \u0432\u0430\u0448\u0443 \u0433\u0440\u0443\u043f\u043f\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 [[DARK_AQUA]]{0} -Party.Help.6= \u0427\u0442\u043e\u0431\u044b \u0432\u044b\u0433\u043d\u0430\u0442\u044c \u0438\u0433\u0440\u043e\u043a\u0430 \u0438\u0437 \u0432\u0430\u0448\u0435\u0439 \u043f\u0430\u0442\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 [[DARK_AQUA]] {0} +Party.Help.6=\u0427\u0442\u043e\u0431\u044b \u0432\u044b\u0433\u043d\u0430\u0442\u044c \u0438\u0433\u0440\u043e\u043a\u0430 \u0438\u0437 \u0432\u0430\u0448\u0435\u0439 \u043f\u0430\u0442\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 [[DARK_AQUA]] {0} Party.Help.7=\u0427\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0439 \u0433\u0440\u0443\u043f\u043f\u043e\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 [[DARK_AQUA]]{0} Party.Help.8=\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0430\u0448\u0443 \u0433\u0440\u0443\u043f\u043f\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 [[DARK_AQUA]]{0} Party.Help.9=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 [[DARK_AQUA]]{0} [[RED]]\u0434\u043b\u044f \u0434\u0435\u043b\u0435\u0436\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u0430\u043c\u0438 \u043c\u0435\u0436\u0434\u0443 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0430\u043c\u0438 \u0433\u0440\u0443\u043f\u043f\u044b @@ -585,7 +585,7 @@ Guides.Available=[[GRAY]]\u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\ Guides.Header=[[GOLD]]-=[[GREEN]]{0} \u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e[[GOLD]]=- Guides.Page.Invalid=\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b! Guides.Page.OutOfRange=\u042d\u0442\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0432\u0441\u0435\u0433\u043e \u0435\u0441\u0442\u044c {0} \u0441\u0442\u0440\u0430\u043d\u0438\u0446. -Guides.Usage= \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 /{0} ? [\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430] +Guides.Usage=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 /{0} ? [\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430] Guides.Acrobatics.Section.0=[[DARK_AQUA]]\u041e \u043d\u0430\u0432\u044b\u043a\u0435 \u0410\u043a\u0440\u043e\u0431\u0430\u0442\u0438\u043a\u0430:\n[[YELLOW]]\u0410\u043a\u0440\u043e\u0431\u0430\u0442\u0438\u043a\u0430 - \u044d\u0442\u043e \u043d\u0430\u0432\u044b\u043a \u0433\u0440\u0430\u0446\u0438\u043e\u0437\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0432 mcMMO.\n[[YELLOW]]\u041e\u043d \u0434\u0430\u0435\u0442 \u0431\u043e\u043d\u0443\u0441\u044b \u0432 \u0431\u043e\u044e \u0438 \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u043e\u0442 \u043f\u0440\u0438\u0440\u043e\u0434\u043d\u044b\u0445 \u043f\u043e\u0432\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439.\n\n[[DARK_AQUA]]\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u043f\u044b\u0442\u0430:\n[[YELLOW]]\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u043f\u044b\u0442 \u0432 \u044d\u0442\u043e\u043c \u043d\u0430\u0432\u044b\u043a\u0435, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0443\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \n[[YELLOW]]\u0432 \u0431\u043e\u044e \u0438\u043b\u0438 \u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u044b\u0441\u043e\u0442\u044b, \u043f\u043e\u043b\u0443\u0447\u0430\u044f \u0443\u0440\u043e\u043d. Guides.Acrobatics.Section.1=[[DARK_AQUA]]\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0443\u043c\u0435\u043d\u0438\u0435 \u041f\u0440\u044b\u0436\u043e\u043a?\n[[YELLOW]]\u0423 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0448\u0430\u043d\u0441 \u0441\u0432\u0435\u0441\u0442\u0438 \u043d\u0430 \u043d\u0435\u0442 \u0443\u0440\u043e\u043d \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u0438.\n[[YELLOW]]\u0415\u0441\u043b\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u044b\u0436\u043a\u0430 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u043a\u0440\u0430\u0441\u0442\u044c\u0441\u044f (Left Shift),\n[[YELLOW]]\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0432\u043e\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0448\u0430\u043d\u0441.\n[[YELLOW]]\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u0418\u0437\u044f\u0449\u043d\u044b\u0439 \u041f\u0440\u044b\u0436\u043e\u043a \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e.\n[[YELLOW]]\u0418\u0437\u044f\u0449\u043d\u044b\u0435 \u041f\u0440\u044b\u0436\u043a\u0438 \u043f\u043e\u0445\u043e\u0436\u0438 \u043d\u0430 \u043e\u0431\u044b\u0447\u043d\u044b\u0435, \u043d\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0432 \u0434\u0432\u0430\n[[YELLOW]]\u0440\u0430\u0437\u0430 \u0440\u0435\u0436\u0435 \u0438 \u0434\u0430\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0437\u0430\u0449\u0438\u0442\u0443 \u043f\u0440\u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u0438.\n[[YELLOW]]\u0428\u0430\u043d\u0441 \u043d\u0430 \u0443\u0434\u0430\u0447\u043d\u044b\u0439 \u043f\u0440\u044b\u0436\u043e\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043d\u0430\u0432\u044b\u043a\u0430. Guides.Acrobatics.Section.2=[[DARK_AQUA]]\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0443\u043c\u0435\u043d\u0438\u0435 \u0423\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435?\n[[YELLOW]]\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u0443\u043c\u0435\u043d\u0438\u044e \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0430\u0441\u0441\u0438\u0432\u043d\u044b\u0439 \u0448\u0430\u043d\u0441 \u0443\u043a\u043b\u043e\u043d\u0438\u0442\u044c\u0441\u044f\n[[YELLOW]]\u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0431\u044b\u0442\u0432\u044b, \u0447\u0442\u043e \u0432\u0434\u0432\u043e\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0443\u0440\u043e\u043d.\n[[YELLOW]]\u0428\u0430\u043d\u0441 \u043d\u0430 \u0443\u0434\u0430\u0447\u043d\u043e\u0435 \u0443\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043d\u0430\u0432\u044b\u043a\u0430. diff --git a/bukkit/src/main/resources/locale/locale_th_TH.properties b/bukkit/src/main/resources/locale/locale_th_TH.properties index 83b273567..1544c9ac0 100644 --- a/bukkit/src/main/resources/locale/locale_th_TH.properties +++ b/bukkit/src/main/resources/locale/locale_th_TH.properties @@ -545,7 +545,7 @@ Guides.Available=[[GRAY]]\u0e41\u0e19\u0e30\u0e19\u0e33 {0} \u0e04\u0e27\u0e23\u Guides.Header=[[GOLD]]-=[[GREEN]]{0} \u0e41\u0e19\u0e30\u0e19\u0e33[[GOLD]]=- Guides.Page.Invalid=\u0e44\u0e21\u0e48\u0e43\u0e0a\u0e48\u0e15\u0e31\u0e27\u0e40\u0e25\u0e02\u0e17\u0e35\u0e48\u0e16\u0e39\u0e01\u0e15\u0e49\u0e2d\u0e07! Guides.Page.OutOfRange=\u0e44\u0e21\u0e48\u0e21\u0e35\u0e2b\u0e19\u0e49\u0e32\u0e19\u0e35\u0e2d\u0e22\u0e39\u0e48 \u0e21\u0e35\u0e40\u0e1e\u0e35\u0e22\u0e07 {0} \u0e2b\u0e19\u0e49\u0e32. -Guides.Usage= \u0e43\u0e0a\u0e49 /{0} ? [\u0e2b\u0e19\u0e49\u0e32] +Guides.Usage=\u0e43\u0e0a\u0e49 /{0} ? [\u0e2b\u0e19\u0e49\u0e32] Guides.Smelting.Section.0=\u0e40\u0e23\u0e47\u0e27\u0e46\u0e19\u0e35\u0e49... Inspect.Offline=\u0e04\u0e38\u0e13\u0e44\u0e21\u0e48\u0e44\u0e14\u0e49\u0e23\u0e31\u0e1a\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e4c\u0e43\u0e19\u0e01\u0e32\u0e23\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a\u0e1c\u0e39\u0e49\u0e40\u0e25\u0e48\u0e19 Offline! Inspect.OfflineStats=mcMMO \u0e2a\u0e16\u0e34\u0e15\u0e34\u0e1c\u0e39\u0e49\u0e40\u0e25\u0e48\u0e19 Offline [[YELLOW]]{0} diff --git a/bukkit/src/main/resources/locale/locale_zh_CN.properties b/bukkit/src/main/resources/locale/locale_zh_CN.properties index 314e9e138..f8b848f77 100644 --- a/bukkit/src/main/resources/locale/locale_zh_CN.properties +++ b/bukkit/src/main/resources/locale/locale_zh_CN.properties @@ -284,7 +284,7 @@ Taming.Ability.Bonus.8=\u5feb\u9910\u670d\u52a1 Taming.Ability.Bonus.9={0} \u7684\u51e0\u7387\u653b\u51fb\u65f6\u56de\u8840 Taming.Ability.Bonus.10=\u72ac\u795e\u7684\u5e87\u62a4 Taming.Ability.Bonus.11=\u53d7\u5230\u9b54\u6cd5\u6216\u4e2d\u6bd2\u4f24\u5bb3\u65f6\u6062\u590d\u751f\u547d\u503c -Taming.Ability.Locked.0= {0}+ \u7ea7\u540e\u89e3\u9501 (\u73af\u5883\u611f\u77e5) +Taming.Ability.Locked.0={0}+ \u7ea7\u540e\u89e3\u9501 (\u73af\u5883\u611f\u77e5) Taming.Ability.Locked.1=\u9501\u5b9a\u76f4\u5230 {0}+ \u6280\u80fd (\u539a\u5b9e\u7684\u76ae\u6bdb) Taming.Ability.Locked.2=\u9501\u5b9a\u76f4\u5230 {0}+ \u6280\u80fd (\u51b2\u51fb\u62b5\u6297) Taming.Ability.Locked.3=\u9501\u5b9a\u76f4\u5230 {0}+ \u6280\u80fd (\u5229\u722a) @@ -646,7 +646,7 @@ Guides.Available=[[GRAY]]{0} \u7684\u5411\u5bfc - \u8f93\u5165/{1} ? [\u9875\u65 Guides.Header=[[GOLD]]-=[[GREEN]]{0} \u5411\u5bfc[[GOLD]]=- Guides.Page.Invalid=\u4e0d\u662f\u4e00\u4e2a\u6709\u6548\u7684\u9875\u6570! Guides.Page.OutOfRange=\u90a3\u9875\u4e0d\u5b58\u5728, \u603b\u5171\u53ea\u6709 {0} \u9875 -Guides.Usage= \u7528\u6cd5 /{0} ? [\u9875\u6570] +Guides.Usage=\u7528\u6cd5 /{0} ? [\u9875\u6570] Guides.Acrobatics.Section.0=[[DARK_AQUA]]\u5173\u4e8e\u6742\u6280:\n[[YELLOW]]\u6742\u6280\u662f mcMMO \u4e2d\u4f18\u96c5\u79fb\u52a8\u7684\u827a\u672f\u3002\n[[YELLOW]]\u5b83\u63d0\u4f9b\u4e86\u6218\u6597\u52a0\u6210\u548c\u73af\u5883\u4f24\u5bb3\u52a0\u6210\u3002\n\n[[DARK_AQUA]]\u7ecf\u9a8c\u83b7\u53d6:\n[[YELLOW]]\u901a\u8fc7\u5728\u6218\u6597\u4e2d\u95ea\u907f\u6216\u8005\u4ece\u9ad8\u5904\n[[YELLOW]]\u8dcc\u843d\u65f6\u53d7\u4f24\u5e76\u5e78\u5b58\u6765\u83b7\u5f97\u7ecf\u9a8c\u3002 Guides.Acrobatics.Section.1=[[DARK_AQUA]]\u7ffb\u6eda\u662f\u5982\u4f55\u5de5\u4f5c\u7684\uff1f\n[[YELLOW]]\u5f53\u60a8\u53d7\u5230\u8dcc\u843d\u4f24\u5bb3\u65f6\u60a8\u6709\u88ab\u52a8\u673a\u4f1a\u6765\u514d\u53d7\u4f24\u5bb3\u3002\n[[YELLOW]]\u60a8\u53ef\u4ee5\u5728\u8dcc\u843d\u4e2d\u6309\u4f4f\u6f5c\u884c\u952e\u6765\u63d0\u5347\u89e6\u53d1\u51e0\u7387\u3002\n[[YELLOW]]\u8fd9\u5c06\u89e6\u53d1\u4e00\u4e2a\u4f18\u96c5\u5730\u7ffb\u6eda\u800c\u4e0d\u662f\u666e\u901a\u7684\u7ffb\u6eda\u3002\n[[YELLOW]]\u4f18\u96c5\u5730\u7ffb\u6eda\u7c7b\u4f3c\u666e\u901a\u7684\u7ffb\u6eda\u4f46\u662f\u5b83\u6709\u53cc\u500d\u51e0\u7387\n[[YELLOW]]\u53d1\u751f\uff0c\u5e76\u4e14\u80fd\u591f\u63d0\u4f9b\u6bd4\u666e\u901a\u5730\u7ffb\u6eda\u66f4\u9ad8\u7684\u4f24\u5bb3\u51cf\u514d\u3002\n[[YELLOW]]\u7ffb\u6eda\u51e0\u7387\u53d6\u51b3\u4e8e\u60a8\u7684\u6280\u80fd\u7b49\u7ea7 Guides.Acrobatics.Section.2=[[DARK_AQUA]]\u95ea\u907f\u662f\u5982\u4f55\u5de5\u4f5c\u7684?\n[[YELLOW]]\u95ea\u907f\u662f\u4e00\u4e2a\u88ab\u52a8\u6280\u80fd\n[[YELLOW]]\u4ed6\u5728\u4f60\u88ab\u653b\u51fb\u65f6\u6709\u4e00\u5b9a\u51e0\u7387\u88ab\u6fc0\u53d1\n[[YELLOW]]\u8fd9\u4e2a\u51e0\u7387\u548c\u4f60\u7684\u6280\u80fd\u7b49\u7ea7\u6709\u5173 diff --git a/bukkit/src/main/resources/locale/locale_zh_TW.properties b/bukkit/src/main/resources/locale/locale_zh_TW.properties index 5c7140072..6909761e4 100644 --- a/bukkit/src/main/resources/locale/locale_zh_TW.properties +++ b/bukkit/src/main/resources/locale/locale_zh_TW.properties @@ -449,7 +449,7 @@ Commands.Party.2=- \u52a0\u5165\u73a9\u5bb6\u7684\u968a\u4f0d\u88e1 Commands.ptp.Enabled=\u968a\u4f0d\u50b3\u9001 [[GREEN]]\u5141\u8a31 Commands.ptp.Disabled=\u968a\u4f0d\u50b3\u9001 [[RED]]\u4e0d\u5141\u8a31 Commands.ptp.NoRequests=\u4f60\u73fe\u5728\u4e0d\u53ef\u4ee5\u50b3\u9001 -Commands.ptp.NoWorldPermissions= [mcMMO]\u60a8\u6c92\u6709\u6b0a\u9650\u50b3\u9001\u5230\u4e16\u754c{0}. +Commands.ptp.NoWorldPermissions=[mcMMO]\u60a8\u6c92\u6709\u6b0a\u9650\u50b3\u9001\u5230\u4e16\u754c{0}. Commands.ptp.Request1={0} [[GREEN]]\u5df2\u50b3\u9001\u81f3\u4f60\u65c1\u908a. Commands.ptp.Request2=[[GREEN]]\u4f60\u50b3\u9001\u7684\u8a71\u8acb\u8f38\u5165[[YELLOW]]/ptp accept. [[GREEN]]\u5728[[RED]]{0} [[GREEN]]\u79d2\u5167\u5fc5\u9808\u5b8c\u6210 Commands.ptp.AcceptAny.Enabled=\u968a\u4f0d\u50b3\u9001\u8acb\u6c42\u78ba\u8a8d [[GREEN]]\u555f\u7528 @@ -534,7 +534,7 @@ Party.Teleport.Player=[[GREEN]]\u4f60\u5df2\u7d93\u50b3\u9001\u5230 {0}. Party.Teleport.Self=\u4f60\u7121\u6cd5\u50b3\u9001\u5230\u4f60\u81ea\u5df1\u8eab\u65c1! Party.Teleport.Target=[[GREEN]]{0} \u5df2\u7d93\u50b3\u9001\u5230\u4f60\u8eab\u908a. Party.Teleport.Disabled={0} \u4e0d\u5141\u8a31\u968a\u4f0d\u50b3\u9001. -Party.Rename.Same= {0}\u4f60\u7684\u968a\u4f0d\u5df2\u7d93\u662f\u9019\u500b\u540d\u5b57\u4e86! +Party.Rename.Same={0}\u4f60\u7684\u968a\u4f0d\u5df2\u7d93\u662f\u9019\u500b\u540d\u5b57\u4e86! Party.Join.Self=\u4f60\u7121\u6cd5\u52a0\u5165\u81ea\u5df1! Party.Unlocked=[[GRAY]]\u968a\u4f0d\u5df2\u89e3\u9396! Party.Disband=[[GRAY]]\u968a\u4f0d\u5df2\u89e3\u6563 @@ -739,7 +739,7 @@ Commands.Description.mcgod=\u5207\u63dbmcMMo\u795e\u4e4b\u6a21\u5f0f(\u958b/\u95 Commands.Description.mchud=\u66f4\u63db\u4f60\u7684McMMO HUD\u98a8\u683c Commands.Description.mcmmo=\u986f\u793amcMMO\u7684\u7c21\u8981\u8aaa\u660e Commands.Description.mcnotify=\u5207\u63dbmcMMO\u7684\u804a\u5929\u986f\u793a\u901a\u77e5 (\u958b/\u95dc) -Commands.Description.mcpurge= \u6e05\u9664mcMMO\u6280\u80fd\u7b49\u7d1a\u70ba0\u6216\u8d85\u904e{0}\u500b\u6708\u672a\u767b\u5165\u7684\u7528\u6236\u8cc7\u6599. +Commands.Description.mcpurge=\u6e05\u9664mcMMO\u6280\u80fd\u7b49\u7d1a\u70ba0\u6216\u8d85\u904e{0}\u500b\u6708\u672a\u767b\u5165\u7684\u7528\u6236\u8cc7\u6599. Commands.Description.mcrank=\u986f\u793a\u6240\u6709mcMMO\u7684\u6392\u540d Commands.Description.mcrefresh=\u66f4\u65b0\u6240\u6709McMMO\u6280\u80fd\u51b7\u537b\u6642\u9593 Commands.Description.mcremove=\u5f9emcMMO\u8cc7\u6599\u5eab\u4e2d\u522a\u9664\u4f7f\u7528\u8005 diff --git a/bukkit/src/main/resources/plugin.yml b/bukkit/src/main/resources/plugin.yml index 6777dbdc7..ca9c6a039 100644 --- a/bukkit/src/main/resources/plugin.yml +++ b/bukkit/src/main/resources/plugin.yml @@ -1,14 +1,14 @@ name: mcMMO version: ${project.version} description: > - The goal of mcMMO is to take core Minecraft game mechanics and expand them into - add an extensive and quality RPG experience. Everything in mcMMO has been carefully - thought out and is constantly being improved upon. Currently, mcMMO adds thirteen - unique skills to train and level in. Each of these skills is highly customizable - through our configuration files, allowing server admins to tweak mcMMO to best suit - the needs of his or her server. Know that the mcMMO team is dedicated to providing - an ever-evolving experience, and that we carefully read all feedback and bug reports - in order to evaluate and balance the mechanics of mcMMO in every update. + The goal of mcMMO is to take core Minecraft game mechanics and expand them into + add an extensive and quality RPG experience. Everything in mcMMO has been carefully + thought out and is constantly being improved upon. Currently, mcMMO adds thirteen + unique skills to train and level in. Each of these skills is highly customizable + through our configuration files, allowing server admins to tweak mcMMO to best suit + the needs of his or her server. Know that the mcMMO team is dedicated to providing + an ever-evolving experience, and that we carefully read all feedback and bug reports + in order to evaluate and balance the mechanics of mcMMO in every update. author: com.gmail.nossr50 authors: [GJ, NuclearW, bm01, Glitchfinder, TfT_02, t00thpick1, Riking] @@ -715,8 +715,8 @@ permissions: mcmmo.chat.all: description: Implies all mcmmo.chat permissions. (Warning, contains adminchat) children: - mcmmo.chat.adminchat: true - mcmmo.chat.partychat: true + mcmmo.chat.adminchat: true + mcmmo.chat.partychat: true mcmmo.chat.adminchat: description: Allows participation in admin chat mcmmo.chat.partychat: @@ -1270,7 +1270,7 @@ permissions: children: mcmmo.chat.partychat: true mcmmo.commands.defaults: true - mcmmo.motd: true + mcmmo.motd: true mcmmo.skills.all: true mcmmo.defaultsop: default: op @@ -1308,7 +1308,7 @@ permissions: default: false description: implies access to all mcmmo perks children: - mcmmo.perks.all: true + mcmmo.perks.all: true mcmmo.perks.all: default: false description: implies access to all mcmmo perks @@ -2045,7 +2045,7 @@ permissions: default: false description: Implies all mcmmo.tools permissions. children: - mcmmo.tools.all: true + mcmmo.tools.all: true mcmmo.tools.all: default: false description: Implies all mcmmo.tools permissions. diff --git a/bukkit/src/main/resources/potions.yml b/bukkit/src/main/resources/potions.yml index b85bd9739..18b0082dd 100644 --- a/bukkit/src/main/resources/potions.yml +++ b/bukkit/src/main/resources/potions.yml @@ -4,40 +4,40 @@ ### Concoctions: Tier_One_Ingredients: - - BLAZE_POWDER - - FERMENTED_SPIDER_EYE - - GHAST_TEAR - - GLOWSTONE_DUST - - GOLDEN_CARROT - - MAGMA_CREAM - - NETHER_WART - - REDSTONE - - GLISTERING_MELON_SLICE - - SPIDER_EYE - - SUGAR - - GUNPOWDER - - WATER_LILY - - PUFFERFISH - - DRAGON_BREATH + - BLAZE_POWDER + - FERMENTED_SPIDER_EYE + - GHAST_TEAR + - GLOWSTONE_DUST + - GOLDEN_CARROT + - MAGMA_CREAM + - NETHER_WART + - REDSTONE + - GLISTERING_MELON_SLICE + - SPIDER_EYE + - SUGAR + - GUNPOWDER + - WATER_LILY + - PUFFERFISH + - DRAGON_BREATH Tier_Two_Ingredients: - - CARROT - - SLIME_BALL - - PHANTOM_MEMBRANE + - CARROT + - SLIME_BALL + - PHANTOM_MEMBRANE Tier_Three_Ingredients: - - QUARTZ - - RED_MUSHROOM + - QUARTZ + - RED_MUSHROOM Tier_Four_Ingredients: - - APPLE - - ROTTEN_FLESH + - APPLE + - ROTTEN_FLESH Tier_Five_Ingredients: - - BROWN_MUSHROOM - - INK_SAC + - BROWN_MUSHROOM + - INK_SAC Tier_Six_Ingredients: - - FERN + - FERN Tier_Seven_Ingredients: - - POISONOUS_POTATO + - POISONOUS_POTATO Tier_Eight_Ingredients: - - GOLDEN_APPLE + - GOLDEN_APPLE # # Settings for Potions diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 811984bae..3b371f30b 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -1,4 +1,3 @@ - plugins { java } diff --git a/core/src/main/java/com/gmail/nossr50/core/api/AbilityAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/AbilityAPI.java index fb66dc2a6..ed84f56f3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/api/AbilityAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/AbilityAPI.java @@ -1,14 +1,15 @@ package com.gmail.nossr50.core.api; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.runnables.skills.BleedTimerTask; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; public final class AbilityAPI { - private AbilityAPI() {} + private AbilityAPI() { + } public static boolean berserkEnabled(Player player) { return UserManager.getPlayer(player).getAbilityMode(SuperAbilityType.BERSERK); diff --git a/core/src/main/java/com/gmail/nossr50/core/api/ChatAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/ChatAPI.java index 58b6ca907..bcdb7b498 100644 --- a/core/src/main/java/com/gmail/nossr50/core/api/ChatAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/ChatAPI.java @@ -3,25 +3,26 @@ package com.gmail.nossr50.core.api; import com.gmail.nossr50.chat.ChatManager; import com.gmail.nossr50.chat.ChatManagerFactory; import com.gmail.nossr50.chat.PartyChatManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; public final class ChatAPI { - private ChatAPI() {} + private ChatAPI() { + } /** * Send a message to all members of a party *
* This function is designed for API usage. * - * @param plugin The plugin sending the message - * @param sender The name of the sender + * @param plugin The plugin sending the message + * @param sender The name of the sender * @param displayName The display name of the sender - * @param party The name of the party to send to - * @param message The message to send + * @param party The name of the party to send to + * @param message The message to send */ public static void sendPartyChat(Plugin plugin, String sender, String displayName, String party, String message) { getPartyChatManager(plugin, party).handleChat(sender, displayName, message); @@ -32,9 +33,9 @@ public final class ChatAPI { *
* This function is designed for API usage. * - * @param plugin The plugin sending the message - * @param sender The name of the sender to display in the chat - * @param party The name of the party to send to + * @param plugin The plugin sending the message + * @param sender The name of the sender to display in the chat + * @param party The name of the party to send to * @param message The message to send */ public static void sendPartyChat(Plugin plugin, String sender, String party, String message) { @@ -46,10 +47,10 @@ public final class ChatAPI { *
* This function is designed for API usage. * - * @param plugin The plugin sending the message - * @param sender The name of the sender + * @param plugin The plugin sending the message + * @param sender The name of the sender * @param displayName The display name of the sender - * @param message The message to send + * @param message The message to send */ public static void sendAdminChat(Plugin plugin, String sender, String displayName, String message) { ChatManagerFactory.getChatManager(plugin, ChatMode.ADMIN).handleChat(sender, displayName, message); @@ -60,8 +61,8 @@ public final class ChatAPI { *
* This function is designed for API usage. * - * @param plugin The plugin sending the message - * @param sender The name of the sender to display in the chat + * @param plugin The plugin sending the message + * @param sender The name of the sender to display in the chat * @param message The message to send */ public static void sendAdminChat(Plugin plugin, String sender, String message) { diff --git a/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java index fa20f3215..d37cb51ac 100644 --- a/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java @@ -1,9 +1,10 @@ package com.gmail.nossr50.core.api; import com.gmail.nossr50.api.exceptions.*; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.api.exceptions.*; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; @@ -12,7 +13,6 @@ import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.child.FamilyTree; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.block.BlockState; import org.bukkit.entity.Player; @@ -21,7 +21,8 @@ import java.util.Set; import java.util.UUID; public final class ExperienceAPI { - private ExperienceAPI() {} + private ExperienceAPI() { + } /** * Returns whether given string is a valid type of skill suitable for the @@ -62,10 +63,9 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to + * @param player The player to add XP to * @param skillType The skill to add XP to - * @param XP The amount of XP to add - * + * @param XP The amount of XP to add * @throws InvalidSkillException if the given skill is not valid */ @Deprecated @@ -78,12 +78,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add + * @param player The player to add XP to + * @param skillType The skill to add XP to + * @param XP The amount of XP to add * @param xpGainReason The reason to gain XP - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidXPGainReasonException if the given xpGainReason is not valid */ public static void addRawXP(Player player, String skillType, float XP, String xpGainReason) { @@ -95,13 +94,12 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add + * @param player The player to add XP to + * @param skillType The skill to add XP to + * @param XP The amount of XP to add * @param xpGainReason The reason to gain XP - * @param isUnshared true if the XP cannot be shared with party members - * - * @throws InvalidSkillException if the given skill is not valid + * @param isUnshared true if the XP cannot be shared with party members + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidXPGainReasonException if the given xpGainReason is not valid */ public static void addRawXP(Player player, String skillType, float XP, String xpGainReason, boolean isUnshared) { @@ -131,15 +129,13 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * + * @param playerName The player to add XP to + * @param skillType The skill to add XP to + * @param XP The amount of XP to add + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @deprecated We're using uuids to get an offline player * replaced by {@link #addRawXPOffline(UUID uuid, String skillType, float XP)} - * - * @param playerName The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database */ @Deprecated public static void addRawXPOffline(String playerName, String skillType, float XP) { @@ -151,11 +147,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The UUID of player to add XP to + * @param uuid The UUID of player to add XP to * @param skillType The skill to add XP to - * @param XP The amount of XP to add - * - * @throws InvalidSkillException if the given skill is not valid + * @param XP The amount of XP to add + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidPlayerException if the given player does not exist in the database */ public static void addRawXPOffline(UUID uuid, String skillType, float XP) { @@ -167,10 +162,9 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to + * @param player The player to add XP to * @param skillType The skill to add XP to - * @param XP The amount of XP to add - * + * @param XP The amount of XP to add * @throws InvalidSkillException if the given skill is not valid */ @Deprecated @@ -183,12 +177,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add + * @param player The player to add XP to + * @param skillType The skill to add XP to + * @param XP The amount of XP to add * @param xpGainReason The reason to gain XP - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidXPGainReasonException if the given xpGainReason is not valid */ public static void addMultipliedXP(Player player, String skillType, int XP, String xpGainReason) { @@ -201,10 +194,9 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add - * - * @throws InvalidSkillException if the given skill is not valid + * @param skillType The skill to add XP to + * @param XP The amount of XP to add + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidPlayerException if the given player does not exist in the database */ @Deprecated @@ -217,10 +209,9 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to + * @param player The player to add XP to * @param skillType The skill to add XP to - * @param XP The amount of XP to add - * + * @param XP The amount of XP to add * @throws InvalidSkillException if the given skill is not valid */ @Deprecated @@ -233,12 +224,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add + * @param player The player to add XP to + * @param skillType The skill to add XP to + * @param XP The amount of XP to add * @param xpGainReason The reason to gain XP - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidXPGainReasonException if the given xpGainReason is not valid */ public static void addModifiedXP(Player player, String skillType, int XP, String xpGainReason) { @@ -250,13 +240,12 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add + * @param player The player to add XP to + * @param skillType The skill to add XP to + * @param XP The amount of XP to add * @param xpGainReason The reason to gain XP - * @param isUnshared true if the XP cannot be shared with party members - * - * @throws InvalidSkillException if the given skill is not valid + * @param isUnshared true if the XP cannot be shared with party members + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidXPGainReasonException if the given xpGainReason is not valid */ public static void addModifiedXP(Player player, String skillType, int XP, String xpGainReason, boolean isUnshared) { @@ -276,10 +265,9 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add - * - * @throws InvalidSkillException if the given skill is not valid + * @param skillType The skill to add XP to + * @param XP The amount of XP to add + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidPlayerException if the given player does not exist in the database */ @Deprecated @@ -295,10 +283,9 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to + * @param player The player to add XP to * @param skillType The skill to add XP to - * @param XP The amount of XP to add - * + * @param XP The amount of XP to add * @throws InvalidSkillException if the given skill is not valid */ @Deprecated @@ -312,12 +299,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add + * @param player The player to add XP to + * @param skillType The skill to add XP to + * @param XP The amount of XP to add * @param xpGainReason The reason to gain XP - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidXPGainReasonException if the given xpGainReason is not valid */ public static void addXP(Player player, String skillType, int XP, String xpGainReason) { @@ -330,13 +316,12 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add + * @param player The player to add XP to + * @param skillType The skill to add XP to + * @param XP The amount of XP to add * @param xpGainReason The reason to gain XP - * @param isUnshared true if the XP cannot be shared with party members - * - * @throws InvalidSkillException if the given skill is not valid + * @param isUnshared true if the XP cannot be shared with party members + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidXPGainReasonException if the given xpGainReason is not valid */ public static void addXP(Player player, String skillType, int XP, String xpGainReason, boolean isUnshared) { @@ -353,11 +338,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to get XP for + * @param player The player to get XP for * @param skillType The skill to get XP for * @return the amount of XP in a given skill - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws UnsupportedOperationException if the given skill is a child skill */ public static int getXP(Player player, String skillType) { @@ -370,11 +354,10 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to get XP for - * @param skillType The skill to get XP for + * @param skillType The skill to get XP for * @return the amount of XP in a given skill - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ @Deprecated @@ -387,12 +370,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The player to get XP for + * @param uuid The player to get XP for * @param skillType The skill to get XP for * @return the amount of XP in a given skill - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ public static int getOfflineXP(UUID uuid, String skillType) { @@ -404,11 +386,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to get XP for + * @param player The player to get XP for * @param skillType The skill to get XP for * @return the amount of XP in a given skill - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws UnsupportedOperationException if the given skill is a child skill */ public static float getXPRaw(Player player, String skillType) { @@ -421,11 +402,10 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to get XP for - * @param skillType The skill to get XP for + * @param skillType The skill to get XP for * @return the amount of XP in a given skill - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ @Deprecated @@ -438,12 +418,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The player to get XP for + * @param uuid The player to get XP for * @param skillType The skill to get XP for * @return the amount of XP in a given skill - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ public static float getOfflineXPRaw(UUID uuid, String skillType) { @@ -455,11 +434,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to get the XP amount for + * @param player The player to get the XP amount for * @param skillType The skill to get the XP amount for * @return the total amount of XP needed to reach the next level - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws UnsupportedOperationException if the given skill is a child skill */ public static int getXPToNextLevel(Player player, String skillType) { @@ -472,11 +450,10 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to get XP for - * @param skillType The skill to get XP for + * @param skillType The skill to get XP for * @return the total amount of XP needed to reach the next level - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ @Deprecated @@ -489,12 +466,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The player to get XP for + * @param uuid The player to get XP for * @param skillType The skill to get XP for * @return the total amount of XP needed to reach the next level - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ public static int getOfflineXPToNextLevel(UUID uuid, String skillType) { @@ -506,11 +482,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to get the XP amount for + * @param player The player to get the XP amount for * @param skillType The skill to get the XP amount for * @return the amount of XP remaining until the next level - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws UnsupportedOperationException if the given skill is a child skill */ public static int getXPRemaining(Player player, String skillType) { @@ -527,11 +502,10 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to get XP for - * @param skillType The skill to get XP for + * @param skillType The skill to get XP for * @return the amount of XP needed to reach the next level - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ @Deprecated @@ -547,12 +521,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The player to get XP for + * @param uuid The player to get XP for * @param skillType The skill to get XP for * @return the amount of XP needed to reach the next level - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ public static float getOfflineXPRemaining(UUID uuid, String skillType) { @@ -567,10 +540,9 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add levels to + * @param player The player to add levels to * @param skillType Type of skill to add levels to - * @param levels Number of levels to add - * + * @param levels Number of levels to add * @throws InvalidSkillException if the given skill is not valid */ public static void addLevel(Player player, String skillType, int levels) { @@ -583,10 +555,9 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to add levels to - * @param skillType Type of skill to add levels to - * @param levels Number of levels to add - * - * @throws InvalidSkillException if the given skill is not valid + * @param skillType Type of skill to add levels to + * @param levels Number of levels to add + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidPlayerException if the given player does not exist in the database */ @Deprecated @@ -614,11 +585,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The player to add levels to + * @param uuid The player to add levels to * @param skillType Type of skill to add levels to - * @param levels Number of levels to add - * - * @throws InvalidSkillException if the given skill is not valid + * @param levels Number of levels to add + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidPlayerException if the given player does not exist in the database */ public static void addLevelOffline(UUID uuid, String skillType, int levels) { @@ -645,10 +615,9 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to get the level for + * @param player The player to get the level for * @param skillType The skill to get the level for * @return the level of a given skill - * * @throws InvalidSkillException if the given skill is not valid */ public static int getLevel(Player player, String skillType) { @@ -661,10 +630,9 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to get the level for - * @param skillType The skill to get the level for + * @param skillType The skill to get the level for * @return the level of a given skill - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidPlayerException if the given player does not exist in the database */ @Deprecated @@ -677,11 +645,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The player to get the level for + * @param uuid The player to get the level for * @param skillType The skill to get the level for * @return the level of a given skill - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidPlayerException if the given player does not exist in the database */ public static int getLevelOffline(UUID uuid, String skillType) { @@ -707,7 +674,6 @@ public final class ExperienceAPI { * * @param playerName The player to get the power level for * @return the power level of the player - * * @throws InvalidPlayerException if the given player does not exist in the database */ @Deprecated @@ -729,7 +695,6 @@ public final class ExperienceAPI { * * @param uuid The player to get the power level for * @return the power level of the player - * * @throws InvalidPlayerException if the given player does not exist in the database */ public static int getPowerLevelOffline(UUID uuid) { @@ -750,7 +715,6 @@ public final class ExperienceAPI { * * @param skillType The skill to get the level cap for * @return the level cap of a given skill - * * @throws InvalidSkillException if the given skill is not valid */ public static int getLevelCap(String skillType) { @@ -774,13 +738,11 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The name of the player to check - * @param skillType The skill to check - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database - * @throws UnsupportedOperationException if the given skill is a child skill - * + * @param skillType The skill to check * @return the position on the leaderboard + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database + * @throws UnsupportedOperationException if the given skill is a child skill */ @Deprecated public static int getPlayerRankSkill(String playerName, String skillType) { @@ -792,14 +754,12 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The name of the player to check + * @param uuid The name of the player to check * @param skillType The skill to check - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database - * @throws UnsupportedOperationException if the given skill is a child skill - * * @return the position on the leaderboard + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database + * @throws UnsupportedOperationException if the given skill is a child skill */ public static int getPlayerRankSkill(UUID uuid, String skillType) { return mcMMO.getDatabaseManager().readRank(getOfflineProfile(uuid).getPlayerName()).get(getNonChildSkillType(skillType)); @@ -811,10 +771,8 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The name of the player to check - * - * @throws InvalidPlayerException if the given player does not exist in the database - * * @return the position on the power level leaderboard + * @throws InvalidPlayerException if the given player does not exist in the database */ @Deprecated public static int getPlayerRankOverall(String playerName) { @@ -827,10 +785,8 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param uuid The name of the player to check - * - * @throws InvalidPlayerException if the given player does not exist in the database - * * @return the position on the power level leaderboard + * @throws InvalidPlayerException if the given player does not exist in the database */ public static int getPlayerRankOverall(UUID uuid) { return mcMMO.getDatabaseManager().readRank(getOfflineProfile(uuid).getPlayerName()).get(null); @@ -841,10 +797,9 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to set the level of - * @param skillType The skill to set the level for + * @param player The player to set the level of + * @param skillType The skill to set the level for * @param skillLevel The value to set the level to - * * @throws InvalidSkillException if the given skill is not valid */ public static void setLevel(Player player, String skillType, int skillLevel) { @@ -857,10 +812,9 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to set the level of - * @param skillType The skill to set the level for + * @param skillType The skill to set the level for * @param skillLevel The value to set the level to - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidPlayerException if the given player does not exist in the database */ @Deprecated @@ -873,11 +827,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The player to set the level of - * @param skillType The skill to set the level for + * @param uuid The player to set the level of + * @param skillType The skill to set the level for * @param skillLevel The value to set the level to - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidPlayerException if the given player does not exist in the database */ public static void setLevelOffline(UUID uuid, String skillType, int skillLevel) { @@ -889,11 +842,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to set the XP of + * @param player The player to set the XP of * @param skillType The skill to set the XP for - * @param newValue The value to set the XP to - * - * @throws InvalidSkillException if the given skill is not valid + * @param newValue The value to set the XP to + * @throws InvalidSkillException if the given skill is not valid * @throws UnsupportedOperationException if the given skill is a child skill */ public static void setXP(Player player, String skillType, int newValue) { @@ -906,11 +858,10 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to set the XP of - * @param skillType The skill to set the XP for - * @param newValue The value to set the XP to - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @param skillType The skill to set the XP for + * @param newValue The value to set the XP to + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ @Deprecated @@ -923,12 +874,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The player to set the XP of + * @param uuid The player to set the XP of * @param skillType The skill to set the XP for - * @param newValue The value to set the XP to - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @param newValue The value to set the XP to + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ public static void setXPOffline(UUID uuid, String skillType, int newValue) { @@ -940,11 +890,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to change the XP of + * @param player The player to change the XP of * @param skillType The skill to change the XP for - * @param xp The amount of XP to remove - * - * @throws InvalidSkillException if the given skill is not valid + * @param xp The amount of XP to remove + * @throws InvalidSkillException if the given skill is not valid * @throws UnsupportedOperationException if the given skill is a child skill */ public static void removeXP(Player player, String skillType, int xp) { @@ -957,11 +906,10 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to change the XP of - * @param skillType The skill to change the XP for - * @param xp The amount of XP to remove - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @param skillType The skill to change the XP for + * @param xp The amount of XP to remove + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ @Deprecated @@ -974,12 +922,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The player to change the XP of + * @param uuid The player to change the XP of * @param skillType The skill to change the XP for - * @param xp The amount of XP to remove - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @param xp The amount of XP to remove + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ public static void removeXPOffline(UUID uuid, String skillType, int xp) { @@ -992,7 +939,6 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param level The level to get the amount of XP for - * * @throws InvalidFormulaTypeException if the given formulaType is not valid */ public static int getXpNeededToLevel(int level) { @@ -1004,9 +950,8 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param level The level to get the amount of XP for + * @param level The level to get the amount of XP for * @param formulaType The formula type to get the amount of XP for - * * @throws InvalidFormulaTypeException if the given formulaType is not valid */ public static int getXpNeededToLevel(int level, String formulaType) { @@ -1015,17 +960,14 @@ public final class ExperienceAPI { /** * Will add the appropriate type of XP from the block to the player based on the material of the blocks given + * * @param blockStates the blocks to reward XP for * @param mcMMOPlayer the target player */ - public static void addXpFromBlocks(ArrayList blockStates, McMMOPlayer mcMMOPlayer) - { - for(BlockState bs : blockStates) - { - for(PrimarySkillType skillType : PrimarySkillType.values()) - { - if(ExperienceConfig.getInstance().getXp(skillType, bs.getType()) > 0) - { + public static void addXpFromBlocks(ArrayList blockStates, McMMOPlayer mcMMOPlayer) { + for (BlockState bs : blockStates) { + for (PrimarySkillType skillType : PrimarySkillType.values()) { + if (ExperienceConfig.getInstance().getXp(skillType, bs.getType()) > 0) { mcMMOPlayer.applyXpGain(skillType, ExperienceConfig.getInstance().getXp(skillType, bs.getType()), XPGainReason.PVE, XPGainSource.SELF); } } @@ -1034,16 +976,14 @@ public final class ExperienceAPI { /** * Will add the appropriate type of XP from the block to the player based on the material of the blocks given if it matches the given skillType + * * @param blockStates the blocks to reward XP for * @param mcMMOPlayer the target player - * @param skillType target primary skill + * @param skillType target primary skill */ - public static void addXpFromBlocksBySkill(ArrayList blockStates, McMMOPlayer mcMMOPlayer, PrimarySkillType skillType) - { - for(BlockState bs : blockStates) - { - if(ExperienceConfig.getInstance().getXp(skillType, bs.getType()) > 0) - { + public static void addXpFromBlocksBySkill(ArrayList blockStates, McMMOPlayer mcMMOPlayer, PrimarySkillType skillType) { + for (BlockState bs : blockStates) { + if (ExperienceConfig.getInstance().getXp(skillType, bs.getType()) > 0) { mcMMOPlayer.applyXpGain(skillType, ExperienceConfig.getInstance().getXp(skillType, bs.getType()), XPGainReason.PVE, XPGainSource.SELF); } } @@ -1051,15 +991,13 @@ public final class ExperienceAPI { /** * Will add the appropriate type of XP from the block to the player based on the material of the blocks given - * @param blockState The target blockstate + * + * @param blockState The target blockstate * @param mcMMOPlayer The target player */ - public static void addXpFromBlock(BlockState blockState, McMMOPlayer mcMMOPlayer) - { - for(PrimarySkillType skillType : PrimarySkillType.values()) - { - if(ExperienceConfig.getInstance().getXp(skillType, blockState.getType()) > 0) - { + public static void addXpFromBlock(BlockState blockState, McMMOPlayer mcMMOPlayer) { + for (PrimarySkillType skillType : PrimarySkillType.values()) { + if (ExperienceConfig.getInstance().getXp(skillType, blockState.getType()) > 0) { mcMMOPlayer.applyXpGain(skillType, ExperienceConfig.getInstance().getXp(skillType, blockState.getType()), XPGainReason.PVE, XPGainSource.SELF); } } @@ -1067,20 +1005,18 @@ public final class ExperienceAPI { /** * Will add the appropriate type of XP from the block to the player based on the material of the blocks given if it matches the given skillType - * @param blockState The target blockstate + * + * @param blockState The target blockstate * @param mcMMOPlayer The target player - * @param skillType target primary skill + * @param skillType target primary skill */ - public static void addXpFromBlockBySkill(BlockState blockState, McMMOPlayer mcMMOPlayer, PrimarySkillType skillType) - { - if(ExperienceConfig.getInstance().getXp(skillType, blockState.getType()) > 0) - { + public static void addXpFromBlockBySkill(BlockState blockState, McMMOPlayer mcMMOPlayer, PrimarySkillType skillType) { + if (ExperienceConfig.getInstance().getXp(skillType, blockState.getType()) > 0) { mcMMOPlayer.applyXpGain(skillType, ExperienceConfig.getInstance().getXp(skillType, blockState.getType()), XPGainReason.PVE, XPGainSource.SELF); } } - // Utility methods follow. private static void addOfflineXP(UUID playerUniqueId, PrimarySkillType skill, int XP) { PlayerProfile profile = getOfflineProfile(playerUniqueId); diff --git a/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java index ae0da4952..99c98ddc9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java @@ -1,20 +1,21 @@ package com.gmail.nossr50.core.api; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyLeader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.OfflinePlayer; import org.bukkit.entity.Player; import java.util.*; public final class PartyAPI { - private PartyAPI() {} + private PartyAPI() { + } /** * Get the name of the party a player is in. @@ -73,7 +74,7 @@ public final class PartyAPI { *
* This function is designed for API usage. * - * @param player The player to add to the party + * @param player The player to add to the party * @param partyName The party to add the player to * @deprecated parties can have limits, use the other method */ @@ -84,8 +85,7 @@ public final class PartyAPI { if (party == null) { party = new Party(new PartyLeader(player.getUniqueId(), player.getName()), partyName); } else { - if(PartyManager.isPartyFull(player, party)) - { + if (PartyManager.isPartyFull(player, party)) { NotificationManager.sendPlayerInformation(player, NotificationType.PARTY_MESSAGE, "Commands.Party.PartyFull", party.toString()); return; } @@ -97,10 +97,10 @@ public final class PartyAPI { /** * The max party size of the server * 0 or less for no size limit + * * @return the max party size on this server */ - public static int getMaxPartySize() - { + public static int getMaxPartySize() { return Config.getInstance().getPartyMaxSize(); } @@ -109,8 +109,8 @@ public final class PartyAPI { *
* This function is designed for API usage. * - * @param player The player to add to the party - * @param partyName The party to add the player to + * @param player The player to add to the party + * @param partyName The party to add the player to * @param bypassLimit if true bypasses party size limits */ public static void addToParty(Player player, String partyName, boolean bypassLimit) { @@ -151,7 +151,7 @@ public final class PartyAPI { *
* This function is designed for API usage. * - * @param partyName The name of the party to set the leader of + * @param partyName The name of the party to set the leader of * @param playerName The playerName to set as leader */ @Deprecated diff --git a/core/src/main/java/com/gmail/nossr50/core/api/SkillAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/SkillAPI.java index 53a7eb5d1..8d8514ee3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/api/SkillAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/SkillAPI.java @@ -7,7 +7,8 @@ import java.util.Arrays; import java.util.List; public final class SkillAPI { - private SkillAPI() {} + private SkillAPI() { + } /** * Returns a list of strings with mcMMO's skills diff --git a/core/src/main/java/com/gmail/nossr50/core/chat/ChatManager.java b/core/src/main/java/com/gmail/nossr50/core/chat/ChatManager.java index 2cc23d292..92bfc7067 100644 --- a/core/src/main/java/com/gmail/nossr50/core/chat/ChatManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/chat/ChatManager.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.core.chat; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.events.chat.McMMOChatEvent; import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; -import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; @@ -40,24 +40,20 @@ public abstract class ChatManager { * Party Chat Spying * Party messages will be copied to people with the mcmmo.admin.chatspy permission node */ - if(event instanceof McMMOPartyChatEvent) - { + if (event instanceof McMMOPartyChatEvent) { //We need to grab the party chat name McMMOPartyChatEvent partyChatEvent = (McMMOPartyChatEvent) event; //Find the people with permissions - for(Player player : event.getPlugin().getServer().getOnlinePlayers()) - { + for (Player player : event.getPlugin().getServer().getOnlinePlayers()) { //Check for toggled players - if(UserManager.getPlayer(player).isPartyChatSpying()) - { + if (UserManager.getPlayer(player).isPartyChatSpying()) { Party adminParty = UserManager.getPlayer(player).getParty(); //Only message admins not part of this party - if(adminParty != null) - { + if (adminParty != null) { //TODO: Incorporate JSON - if(!adminParty.getName().equalsIgnoreCase(partyChatEvent.getParty())) + if (!adminParty.getName().equalsIgnoreCase(partyChatEvent.getParty())) player.sendMessage(LocaleLoader.getString("Commands.AdminChatSpy.Chat", partyChatEvent.getParty(), message)); } else { player.sendMessage(LocaleLoader.getString("Commands.AdminChatSpy.Chat", partyChatEvent.getParty(), message)); diff --git a/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java b/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java index 5c79f2687..da8410b73 100644 --- a/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java @@ -2,8 +2,8 @@ package com.gmail.nossr50.core.chat; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.party.Party; -import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; import com.gmail.nossr50.core.runnables.party.PartyChatTask; +import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; import org.bukkit.plugin.Plugin; public class PartyChatManager extends ChatManager { diff --git a/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java index 7c27e25f1..0d4b3ad23 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java @@ -32,7 +32,8 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { } @Override - protected void loadKeys() {} + protected void loadKeys() { + } @Override protected boolean validateKeys() { @@ -142,59 +143,115 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { */ /* EXPLOIT TOGGLES */ - public boolean isEndermanEndermiteFarmingPrevented() { return config.getBoolean("ExploitFix.EndermanEndermiteFarms", true); } + public boolean isEndermanEndermiteFarmingPrevented() { + return config.getBoolean("ExploitFix.EndermanEndermiteFarms", true); + } /* Curve settings */ - public FormulaType getFormulaType() { return FormulaType.getFormulaType(config.getString("Experience_Formula.Curve")); } - public boolean getCumulativeCurveEnabled() { return config.getBoolean("Experience_Formula.Cumulative_Curve", false); } + public FormulaType getFormulaType() { + return FormulaType.getFormulaType(config.getString("Experience_Formula.Curve")); + } + + public boolean getCumulativeCurveEnabled() { + return config.getBoolean("Experience_Formula.Cumulative_Curve", false); + } /* Curve values */ - public double getMultiplier(FormulaType type) { return config.getDouble("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.multiplier"); } - public int getBase(FormulaType type) { return config.getInt("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.base"); } - public double getExponent(FormulaType type) { return config.getDouble("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.exponent"); } + public double getMultiplier(FormulaType type) { + return config.getDouble("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.multiplier"); + } + + public int getBase(FormulaType type) { + return config.getInt("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.base"); + } + + public double getExponent(FormulaType type) { + return config.getDouble("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.exponent"); + } /* Global modifier */ - public double getExperienceGainsGlobalMultiplier() { return config.getDouble("Experience_Formula.Multiplier.Global", 1.0); } - public void setExperienceGainsGlobalMultiplier(double value) { config.set("Experience_Formula.Multiplier.Global", value); } + public double getExperienceGainsGlobalMultiplier() { + return config.getDouble("Experience_Formula.Multiplier.Global", 1.0); + } + + public void setExperienceGainsGlobalMultiplier(double value) { + config.set("Experience_Formula.Multiplier.Global", value); + } /* PVP modifier */ - public double getPlayerVersusPlayerXP() { return config.getDouble("Experience_Formula.Multiplier.PVP", 1.0); } + public double getPlayerVersusPlayerXP() { + return config.getDouble("Experience_Formula.Multiplier.PVP", 1.0); + } /* Spawned Mob modifier */ - public double getSpawnedMobXpMultiplier() { return config.getDouble("Experience_Formula.Mobspawners.Multiplier", 0.0); } - public double getBredMobXpMultiplier() { return config.getDouble("Experience_Formula.Breeding.Multiplier", 1.0); } + public double getSpawnedMobXpMultiplier() { + return config.getDouble("Experience_Formula.Mobspawners.Multiplier", 0.0); + } + + public double getBredMobXpMultiplier() { + return config.getDouble("Experience_Formula.Breeding.Multiplier", 1.0); + } /* Skill modifiers */ - public double getFormulaSkillModifier(PrimarySkillType skill) { return config.getDouble("Experience_Formula.Modifier." + StringUtils.getCapitalized(skill.toString())); } + public double getFormulaSkillModifier(PrimarySkillType skill) { + return config.getDouble("Experience_Formula.Modifier." + StringUtils.getCapitalized(skill.toString())); + } /* Custom XP perk */ - public double getCustomXpPerkBoost() { return config.getDouble("Experience_Formula.Custom_XP_Perk.Boost", 1.25); } + public double getCustomXpPerkBoost() { + return config.getDouble("Experience_Formula.Custom_XP_Perk.Boost", 1.25); + } /* Diminished Returns */ - public float getDiminishedReturnsCap() { return (float) config.getDouble("Dimished_Returns.Guaranteed_Minimum_Percentage", 0.05D); } - public boolean getDiminishedReturnsEnabled() { return config.getBoolean("Diminished_Returns.Enabled", false); } - public int getDiminishedReturnsThreshold(PrimarySkillType skill) { return config.getInt("Diminished_Returns.Threshold." + StringUtils.getCapitalized(skill.toString()), 20000); } - public int getDiminishedReturnsTimeInterval() { return config.getInt("Diminished_Returns.Time_Interval", 10); } + public float getDiminishedReturnsCap() { + return (float) config.getDouble("Dimished_Returns.Guaranteed_Minimum_Percentage", 0.05D); + } + + public boolean getDiminishedReturnsEnabled() { + return config.getBoolean("Diminished_Returns.Enabled", false); + } + + public int getDiminishedReturnsThreshold(PrimarySkillType skill) { + return config.getInt("Diminished_Returns.Threshold." + StringUtils.getCapitalized(skill.toString()), 20000); + } + + public int getDiminishedReturnsTimeInterval() { + return config.getInt("Diminished_Returns.Time_Interval", 10); + } /* Conversion */ - public double getExpModifier() { return config.getDouble("Conversion.Exp_Modifier", 1); } + public double getExpModifier() { + return config.getDouble("Conversion.Exp_Modifier", 1); + } /* * XP SETTINGS */ /* General Settings */ - public boolean getExperienceGainsPlayerVersusPlayerEnabled() { return config.getBoolean("Experience.PVP.Rewards", true); } + public boolean getExperienceGainsPlayerVersusPlayerEnabled() { + return config.getBoolean("Experience.PVP.Rewards", true); + } /* Combat XP Multipliers */ - public double getCombatXP(EntityType entity) { return config.getDouble("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); } - public double getAnimalsXP(EntityType entity) { return config.getDouble("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_"), getAnimalsXP()); } - public double getAnimalsXP() { return config.getDouble("Experience.Combat.Multiplier.Animals", 1.0); } - public boolean hasCombatXP(EntityType entity) {return config.contains("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); } + public double getCombatXP(EntityType entity) { + return config.getDouble("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); + } + + public double getAnimalsXP(EntityType entity) { + return config.getDouble("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_"), getAnimalsXP()); + } + + public double getAnimalsXP() { + return config.getDouble("Experience.Combat.Multiplier.Animals", 1.0); + } + + public boolean hasCombatXP(EntityType entity) { + return config.contains("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); + } /* Materials */ - public int getXp(PrimarySkillType skill, Material data) - { + public int getXp(PrimarySkillType skill, Material data) { String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + "."; String explicitString = baseString + StringUtils.getExplicitConfigMaterialString(data); if (config.contains(explicitString)) @@ -209,8 +266,7 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { } /* Materials */ - public int getXp(PrimarySkillType skill, BlockData data) - { + public int getXp(PrimarySkillType skill, BlockData data) { String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + "."; String explicitString = baseString + StringUtils.getExplicitConfigBlockDataString(data); if (config.contains(explicitString)) @@ -224,8 +280,7 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { return 0; } - public boolean doesBlockGiveSkillXP(PrimarySkillType skill, Material data) - { + public boolean doesBlockGiveSkillXP(PrimarySkillType skill, Material data) { String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + "."; String explicitString = baseString + StringUtils.getExplicitConfigMaterialString(data); if (config.contains(explicitString)) @@ -237,8 +292,7 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { return config.contains(wildcardString); } - public boolean doesBlockGiveSkillXP(PrimarySkillType skill, BlockData data) - { + public boolean doesBlockGiveSkillXP(PrimarySkillType skill, BlockData data) { String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + "."; String explicitString = baseString + StringUtils.getExplicitConfigBlockDataString(data); if (config.contains(explicitString)) @@ -254,32 +308,35 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { * Experience Bar Stuff */ - public boolean isPartyExperienceBarsEnabled() - { + public boolean isPartyExperienceBarsEnabled() { return config.getBoolean("Experience_Bars.Update.Party", true); } - public boolean isPassiveGainsExperienceBarsEnabled() - { + public boolean isPassiveGainsExperienceBarsEnabled() { return config.getBoolean("Experience_Bars.Update.Passive", true); } - public boolean getDoExperienceBarsAlwaysUpdateTitle() - { + public boolean getDoExperienceBarsAlwaysUpdateTitle() { return config.getBoolean("Experience_Bars.ThisMayCauseLag.AlwaysUpdateTitlesWhenXPIsGained.Enable", false) || getAddExtraDetails(); } - public boolean getAddExtraDetails() { return config.getBoolean("Experience_Bars.ThisMayCauseLag.AlwaysUpdateTitlesWhenXPIsGained.ExtraDetails", false);} - public boolean isExperienceBarsEnabled() { return config.getBoolean("Experience_Bars.Enable", true); } - public boolean isExperienceBarEnabled(PrimarySkillType primarySkillType) { return config.getBoolean("Experience_Bars."+StringUtils.getCapitalized(primarySkillType.toString())+".Enable", true);} + public boolean getAddExtraDetails() { + return config.getBoolean("Experience_Bars.ThisMayCauseLag.AlwaysUpdateTitlesWhenXPIsGained.ExtraDetails", false); + } - public BarColor getExperienceBarColor(PrimarySkillType primarySkillType) - { - String colorValueFromConfig = config.getString("Experience_Bars."+StringUtils.getCapitalized(primarySkillType.toString())+".Color"); + public boolean isExperienceBarsEnabled() { + return config.getBoolean("Experience_Bars.Enable", true); + } - for(BarColor barColor : BarColor.values()) - { - if(barColor.toString().equalsIgnoreCase(colorValueFromConfig)) + public boolean isExperienceBarEnabled(PrimarySkillType primarySkillType) { + return config.getBoolean("Experience_Bars." + StringUtils.getCapitalized(primarySkillType.toString()) + ".Enable", true); + } + + public BarColor getExperienceBarColor(PrimarySkillType primarySkillType) { + String colorValueFromConfig = config.getString("Experience_Bars." + StringUtils.getCapitalized(primarySkillType.toString()) + ".Color"); + + for (BarColor barColor : BarColor.values()) { + if (barColor.toString().equalsIgnoreCase(colorValueFromConfig)) return barColor; } @@ -287,13 +344,11 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { return BarColor.WHITE; } - public BarStyle getExperienceBarStyle(PrimarySkillType primarySkillType) - { - String colorValueFromConfig = config.getString("Experience_Bars."+StringUtils.getCapitalized(primarySkillType.toString())+".BarStyle"); + public BarStyle getExperienceBarStyle(PrimarySkillType primarySkillType) { + String colorValueFromConfig = config.getString("Experience_Bars." + StringUtils.getCapitalized(primarySkillType.toString()) + ".BarStyle"); - for(BarStyle barStyle : BarStyle.values()) - { - if(barStyle.toString().equalsIgnoreCase(colorValueFromConfig)) + for (BarStyle barStyle : BarStyle.values()) { + if (barStyle.toString().equalsIgnoreCase(colorValueFromConfig)) return barStyle; } @@ -302,27 +357,47 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { } /* Acrobatics */ - public int getDodgeXPModifier() { return config.getInt("Experience.Acrobatics.Dodge", 120); } - public int getRollXPModifier() { return config.getInt("Experience.Acrobatics.Roll", 80); } - public int getFallXPModifier() { return config.getInt("Experience.Acrobatics.Fall", 120); } + public int getDodgeXPModifier() { + return config.getInt("Experience.Acrobatics.Dodge", 120); + } - public double getFeatherFallXPModifier() { return config.getDouble("Experience.Acrobatics.FeatherFall_Multiplier", 2.0); } + public int getRollXPModifier() { + return config.getInt("Experience.Acrobatics.Roll", 80); + } + + public int getFallXPModifier() { + return config.getInt("Experience.Acrobatics.Fall", 120); + } + + public double getFeatherFallXPModifier() { + return config.getDouble("Experience.Acrobatics.FeatherFall_Multiplier", 2.0); + } /* Alchemy */ - public double getPotionXP(PotionStage stage) { return config.getDouble("Experience.Alchemy.Potion_Stage_" + stage.toNumerical(), 10D); } + public double getPotionXP(PotionStage stage) { + return config.getDouble("Experience.Alchemy.Potion_Stage_" + stage.toNumerical(), 10D); + } /* Archery */ - public double getArcheryDistanceMultiplier() { return config.getDouble("Experience.Archery.Distance_Multiplier", 0.025); } + public double getArcheryDistanceMultiplier() { + return config.getDouble("Experience.Archery.Distance_Multiplier", 0.025); + } - public int getFishingShakeXP() { return config.getInt("Experience.Fishing.Shake", 50); } + public int getFishingShakeXP() { + return config.getInt("Experience.Fishing.Shake", 50); + } /* Repair */ - public double getRepairXPBase() { return config.getDouble("Experience.Repair.Base", 1000.0); } - public double getRepairXP(MaterialType repairMaterialType) { return config.getDouble("Experience.Repair." + StringUtils.getCapitalized(repairMaterialType.toString())); } + public double getRepairXPBase() { + return config.getDouble("Experience.Repair.Base", 1000.0); + } + + public double getRepairXP(MaterialType repairMaterialType) { + return config.getDouble("Experience.Repair." + StringUtils.getCapitalized(repairMaterialType.toString())); + } /* Taming */ - public int getTamingXP(EntityType type) - { + public int getTamingXP(EntityType type) { return config.getInt("Experience.Taming.Animal_Taming." + StringUtils.getPrettyEntityTypeString(type)); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java index 915fd6cfa..c5bbfa04e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java @@ -15,14 +15,12 @@ import java.util.List; import java.util.Set; public class CustomArmorConfig extends ConfigLoader { - private boolean needsUpdate = false; - - public List customBoots = new ArrayList(); + public List customBoots = new ArrayList(); public List customChestplates = new ArrayList(); - public List customHelmets = new ArrayList(); - public List customLeggings = new ArrayList(); - + public List customHelmets = new ArrayList(); + public List customLeggings = new ArrayList(); public List repairables = new ArrayList(); + private boolean needsUpdate = false; protected CustomArmorConfig(String fileName) { super("mods", fileName); diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java index 2c2afadc1..73bf3d0bb 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java @@ -11,17 +11,15 @@ import java.util.List; import java.util.Set; public class CustomBlockConfig extends ConfigLoader { - private boolean needsUpdate = false; - - public List customExcavationBlocks = new ArrayList<>(); - public List customHerbalismBlocks = new ArrayList<>(); - public List customMiningBlocks = new ArrayList<>(); - public List customOres = new ArrayList<>(); - public List customLogs = new ArrayList<>(); - public List customLeaves = new ArrayList<>(); - public List customAbilityBlocks = new ArrayList<>(); - + public List customExcavationBlocks = new ArrayList<>(); + public List customHerbalismBlocks = new ArrayList<>(); + public List customMiningBlocks = new ArrayList<>(); + public List customOres = new ArrayList<>(); + public List customLogs = new ArrayList<>(); + public List customLeaves = new ArrayList<>(); + public List customAbilityBlocks = new ArrayList<>(); public HashMap customBlockMap = new HashMap<>(); + private boolean needsUpdate = false; protected CustomBlockConfig(String fileName) { super("mods", fileName); @@ -84,12 +82,10 @@ public class CustomBlockConfig extends ConfigLoader { if (skillType.equals("Mining") && config.getBoolean(skillType + "." + blockName + ".Is_Ore")) { customOres.add(blockMaterial); smeltingXp = config.getInt(skillType + "." + blockName + ".Smelting_XP_Gain", xp / 10); - } - else if (skillType.equals("Woodcutting")) { + } else if (skillType.equals("Woodcutting")) { if (config.getBoolean(skillType + "." + blockName + ".Is_Log")) { customLogs.add(blockMaterial); - } - else { + } else { customLeaves.add(blockMaterial); xp = 0; // Leaves don't grant XP } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java index e0ebd99de..e4ad18bde 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java @@ -10,7 +10,7 @@ import java.util.HashMap; public class CustomEntityConfig extends ConfigLoader { public HashMap customEntityClassMap = new HashMap(); - public HashMap customEntityTypeMap = new HashMap(); + public HashMap customEntityTypeMap = new HashMap(); protected CustomEntityConfig(String fileName) { super("mods", fileName); @@ -30,8 +30,7 @@ public class CustomEntityConfig extends ConfigLoader { try { clazz = ClassUtils.getClass(className); - } - catch (ClassNotFoundException e) { + } catch (ClassNotFoundException e) { plugin.getLogger().warning("Invalid class (" + className + ") detected for " + entityName + "."); plugin.getLogger().warning("This custom entity may not function properly."); } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java index 1f3a429b0..5f859ae85 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java @@ -17,18 +17,15 @@ import java.util.List; import java.util.Set; public class CustomToolConfig extends ConfigLoader { - private boolean needsUpdate = false; - - public List customAxes = new ArrayList(); - public List customBows = new ArrayList(); - public List customHoes = new ArrayList(); + public List customAxes = new ArrayList(); + public List customBows = new ArrayList(); + public List customHoes = new ArrayList(); public List customPickaxes = new ArrayList(); - public List customShovels = new ArrayList(); - public List customSwords = new ArrayList(); - + public List customShovels = new ArrayList(); + public List customSwords = new ArrayList(); public HashMap customToolMap = new HashMap(); - public List repairables = new ArrayList(); + private boolean needsUpdate = false; protected CustomToolConfig(String fileName) { super("mods", fileName); diff --git a/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java index df57b7d32..793ea2434 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java @@ -39,5 +39,6 @@ public class ItemWeightConfig extends ConfigLoader { } @Override - protected void loadKeys() {} + protected void loadKeys() { + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/AdvancedConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/AdvancedConfig.java index 13dc1a48e..6e4dd5155 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/AdvancedConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/AdvancedConfig.java @@ -131,8 +131,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { } /* AXES */ - if(getAxeMasteryRankDamageMultiplier() < 0) - { + if (getAxeMasteryRankDamageMultiplier() < 0) { reason.add("Skills.Axes.AxeMastery.RankDamageMultiplier should be at least 0!"); } @@ -645,18 +644,22 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { } @Override - protected void loadKeys() {} + protected void loadKeys() { + } /* GENERAL */ - public int getStartingLevel() { return config.getInt("Skills.General.StartingLevel", 1); } + public int getStartingLevel() { + return config.getInt("Skills.General.StartingLevel", 1); + } /** * This returns the maximum level at which superabilities will stop lengthening from scaling alongside skill level. * It returns a different value depending on whether or not the server is in retro mode + * * @return the level at which abilities stop increasing in length */ public int getAbilityLengthCap() { - if(!mcMMO.isRetroModeEnabled()) + if (!mcMMO.isRetroModeEnabled()) return config.getInt("Skills.General.Ability.Length.Standard.CapLevel", 50); else return config.getInt("Skills.General.Ability.Length.RetroMode.CapLevel", 500); @@ -665,27 +668,31 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { /** * This returns the frequency at which abilities will increase in length * It returns a different value depending on whether or not the server is in retro mode + * * @return the number of levels required per ability length increase */ public int getAbilityLength() { - if(!mcMMO.isRetroModeEnabled()) + if (!mcMMO.isRetroModeEnabled()) return config.getInt("Skills.General.Ability.Length.Standard.IncreaseLevel", 5); else return config.getInt("Skills.General.Ability.Length.RetroMode.IncreaseLevel", 50); } - public int getEnchantBuff() { return config.getInt("Skills.General.Ability.EnchantBuff", 5); } + public int getEnchantBuff() { + return config.getInt("Skills.General.Ability.EnchantBuff", 5); + } /** * Grabs the max bonus level for a skill used in RNG calculations * All max level values in the config are multiplied by 10 if the server is in retro mode as the values in the config are based around the new 1-100 skill system scaling * A value of 10 in the file will be returned as 100 for retro mode servers to accommodate the change in scaling + * * @param subSkillType target subskill * @return the level at which this skills max benefits will be reached on the curve */ public int getMaxBonusLevel(SubSkillType subSkillType) { String keyPath = subSkillType.getAdvConfigAddress() + ".MaxBonusLevel."; - return mcMMO.isRetroModeEnabled() ? config.getInt(keyPath+"RetroMode", 1000) : config.getInt(keyPath+"Standard", 100); + return mcMMO.isRetroModeEnabled() ? config.getInt(keyPath + "RetroMode", 1000) : config.getInt(keyPath + "Standard", 100); } public int getMaxBonusLevel(AbstractSubSkill abstractSubSkill) { @@ -698,30 +705,25 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { return maximumProbability; } - public double getMaximumProbability(AbstractSubSkill abstractSubSkill) - { + public double getMaximumProbability(AbstractSubSkill abstractSubSkill) { return getMaximumProbability(abstractSubSkill.getSubSkillType()); } /* Notification Settings */ - public boolean doesSkillCommandSendBlankLines() - { + public boolean doesSkillCommandSendBlankLines() { return config.getBoolean("Feedback.SkillCommand.BlankLinesAboveHeader", true); } - public boolean doesNotificationUseActionBar(NotificationType notificationType) - { - return config.getBoolean("Feedback.ActionBarNotifications."+notificationType.toString()+".Enabled", true); + public boolean doesNotificationUseActionBar(NotificationType notificationType) { + return config.getBoolean("Feedback.ActionBarNotifications." + notificationType.toString() + ".Enabled", true); } - public boolean doesNotificationSendCopyToChat(NotificationType notificationType) - { - return config.getBoolean("Feedback.ActionBarNotifications."+notificationType.toString()+".SendCopyOfMessageToChat", false); + public boolean doesNotificationSendCopyToChat(NotificationType notificationType) { + return config.getBoolean("Feedback.ActionBarNotifications." + notificationType.toString() + ".SendCopyOfMessageToChat", false); } - public boolean useTitlesForXPEvent() - { + public boolean useTitlesForXPEvent() { return config.getBoolean("Feedback.Events.XP.SendTitles", true); } @@ -740,6 +742,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { /** * Used to color our details header in our JSON Hover Object tooltips + * * @return the ChatColor for this element */ /*public ChatColor getJSONStatHoverDetailsColor() @@ -788,7 +791,6 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { { return getChatColor(config.getString("Style.JSON.Notification."+notificationType.toString()+".Color")); }*/ - private ChatColor getChatColorFromKey(String keyLocation) { String colorName = config.getString(keyLocation); @@ -829,180 +831,365 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { /** * Some SubSkills have the ability to retain classic functionality + * * @param subSkillType SubSkillType with classic functionality * @return true if the subskill is in classic mode */ - public boolean isSubSkillClassic(SubSkillType subSkillType) - { - return config.getBoolean(subSkillType.getAdvConfigAddress()+".Classic"); + public boolean isSubSkillClassic(SubSkillType subSkillType) { + return config.getBoolean(subSkillType.getAdvConfigAddress() + ".Classic"); } /* ACROBATICS */ - public double getDodgeDamageModifier() { return config.getDouble("Skills.Acrobatics.Dodge.DamageModifier", 2.0D); } + public double getDodgeDamageModifier() { + return config.getDouble("Skills.Acrobatics.Dodge.DamageModifier", 2.0D); + } - public double getRollDamageThreshold() { return config.getDouble("Skills.Acrobatics.Roll.DamageThreshold", 7.0D); } + public double getRollDamageThreshold() { + return config.getDouble("Skills.Acrobatics.Roll.DamageThreshold", 7.0D); + } - public double getGracefulRollDamageThreshold() { return config.getDouble("Skills.Acrobatics.GracefulRoll.DamageThreshold", 14.0D); } + public double getGracefulRollDamageThreshold() { + return config.getDouble("Skills.Acrobatics.GracefulRoll.DamageThreshold", 14.0D); + } /* ALCHEMY */ /*public int getCatalysisUnlockLevel() { return config.getInt("Skills.Alchemy.Catalysis.UnlockLevel", 100); }*/ - public int getCatalysisMaxBonusLevel() { return config.getInt("Skills.Alchemy.Catalysis.MaxBonusLevel", 1000); } + public int getCatalysisMaxBonusLevel() { + return config.getInt("Skills.Alchemy.Catalysis.MaxBonusLevel", 1000); + } - public double getCatalysisMinSpeed() { return config.getDouble("Skills.Alchemy.Catalysis.MinSpeed", 1.0D); } - public double getCatalysisMaxSpeed() { return config.getDouble("Skills.Alchemy.Catalysis.MaxSpeed", 4.0D); } + public double getCatalysisMinSpeed() { + return config.getDouble("Skills.Alchemy.Catalysis.MinSpeed", 1.0D); + } + + public double getCatalysisMaxSpeed() { + return config.getDouble("Skills.Alchemy.Catalysis.MaxSpeed", 4.0D); + } //public int getConcoctionsTierLevel(Alchemy.Tier tier) { return config.getInt("Skills.Alchemy.Rank_Levels.Rank_" + rank); } /* ARCHERY */ - public double getSkillShotRankDamageMultiplier() { return config.getDouble("Skills.Archery.SkillShot.RankDamageMultiplier", 10.0D); } - public double getSkillShotDamageMax() { return config.getDouble("Skills.Archery.SkillShot.MaxDamage", 9.0D); } + public double getSkillShotRankDamageMultiplier() { + return config.getDouble("Skills.Archery.SkillShot.RankDamageMultiplier", 10.0D); + } - public double getDazeBonusDamage() { return config.getDouble("Skills.Archery.Daze.BonusDamage", 4.0D); } + public double getSkillShotDamageMax() { + return config.getDouble("Skills.Archery.SkillShot.MaxDamage", 9.0D); + } - public double getForceMultiplier() { return config.getDouble("Skills.Archery.ForceMultiplier", 2.0D); } + public double getDazeBonusDamage() { + return config.getDouble("Skills.Archery.Daze.BonusDamage", 4.0D); + } + + public double getForceMultiplier() { + return config.getDouble("Skills.Archery.ForceMultiplier", 2.0D); + } /* AXES */ - public double getAxeMasteryRankDamageMultiplier() { return config.getDouble("Skills.Axes.AxeMastery.RankDamageMultiplier", 1.0D); } + public double getAxeMasteryRankDamageMultiplier() { + return config.getDouble("Skills.Axes.AxeMastery.RankDamageMultiplier", 1.0D); + } - public double getCriticalStrikesPVPModifier() { return config.getDouble("Skills.Axes.CriticalStrikes.PVP_Modifier", 1.5D); } - public double getCriticalStrikesPVEModifier() { return config.getDouble("Skills.Axes.CriticalStrikes.PVE_Modifier", 2.0D); } + public double getCriticalStrikesPVPModifier() { + return config.getDouble("Skills.Axes.CriticalStrikes.PVP_Modifier", 1.5D); + } - public double getGreaterImpactChance() { return config.getDouble("Skills.Axes.GreaterImpact.Chance", 25.0D); } - public double getGreaterImpactModifier() { return config.getDouble("Skills.Axes.GreaterImpact.KnockbackModifier", 1.5D); } - public double getGreaterImpactBonusDamage() { return config.getDouble("Skills.Axes.GreaterImpact.BonusDamage", 2.0D); } + public double getCriticalStrikesPVEModifier() { + return config.getDouble("Skills.Axes.CriticalStrikes.PVE_Modifier", 2.0D); + } + + public double getGreaterImpactChance() { + return config.getDouble("Skills.Axes.GreaterImpact.Chance", 25.0D); + } + + public double getGreaterImpactModifier() { + return config.getDouble("Skills.Axes.GreaterImpact.KnockbackModifier", 1.5D); + } + + public double getGreaterImpactBonusDamage() { + return config.getDouble("Skills.Axes.GreaterImpact.BonusDamage", 2.0D); + } public int getArmorImpactIncreaseLevel() { int increaseLevel = config.getInt("Skills.Axes.ArmorImpact.IncreaseLevel", 5); - if(mcMMO.isRetroModeEnabled()) + if (mcMMO.isRetroModeEnabled()) return increaseLevel * 10; return increaseLevel; } - public double getImpactChance() { return config.getDouble("Skills.Axes.ArmorImpact.Chance", 25.0D); } - public double getArmorImpactMaxDurabilityDamage() { return config.getDouble("Skills.Axes.ArmorImpact.MaxPercentageDurabilityDamage", 20.0D); } + public double getImpactChance() { + return config.getDouble("Skills.Axes.ArmorImpact.Chance", 25.0D); + } - public double getSkullSplitterModifier() { return config.getDouble("Skills.Axes.SkullSplitter.DamageModifier", 2.0D); } + public double getArmorImpactMaxDurabilityDamage() { + return config.getDouble("Skills.Axes.ArmorImpact.MaxPercentageDurabilityDamage", 20.0D); + } + + public double getSkullSplitterModifier() { + return config.getDouble("Skills.Axes.SkullSplitter.DamageModifier", 2.0D); + } /* EXCAVATION */ //Nothing to configure, everything is already configurable in config.yml /* FISHING */ //public int getFishingTierLevel(int rank) { return config.getInt("Skills.Fishing.Rank_Levels.Rank_" + rank); } - public double getShakeChance(int rank) { return config.getDouble("Skills.Fishing.ShakeChance.Rank_" + rank); } - public int getFishingVanillaXPModifier(int rank) { return config.getInt("Skills.Fishing.VanillaXPMultiplier.Rank_" + rank); } + public double getShakeChance(int rank) { + return config.getDouble("Skills.Fishing.ShakeChance.Rank_" + rank); + } - public int getFishermanDietRankChange() { return config.getInt("Skills.Fishing.FishermansDiet.RankChange", 200); } + public int getFishingVanillaXPModifier(int rank) { + return config.getInt("Skills.Fishing.VanillaXPMultiplier.Rank_" + rank); + } + + public int getFishermanDietRankChange() { + return config.getInt("Skills.Fishing.FishermansDiet.RankChange", 200); + } /*public int getIceFishingUnlockLevel() { return config.getInt("Skills.Fishing.IceFishing.UnlockLevel", 50); } public int getMasterAnglerUnlockLevel() {return config.getInt("Skills.Fishing.MasterAngler.UnlockLevel", 125); }*/ - public double getMasterAnglerBoatModifier() {return config.getDouble("Skills.Fishing.MasterAngler.BoatModifier", 2.0); } - public double getMasterAnglerBiomeModifier() {return config.getDouble("Skills.Fishing.MasterAngler.BiomeModifier", 2.0); } + public double getMasterAnglerBoatModifier() { + return config.getDouble("Skills.Fishing.MasterAngler.BoatModifier", 2.0); + } + + public double getMasterAnglerBiomeModifier() { + return config.getDouble("Skills.Fishing.MasterAngler.BiomeModifier", 2.0); + } /* HERBALISM */ - public int getFarmerDietRankChange() { return config.getInt("Skills.Herbalism.FarmersDiet.RankChange", 200); } + public int getFarmerDietRankChange() { + return config.getInt("Skills.Herbalism.FarmersDiet.RankChange", 200); + } - public int getGreenThumbStageChange() { return config.getInt("Skills.Herbalism.GreenThumb.StageChange", 200); } + public int getGreenThumbStageChange() { + return config.getInt("Skills.Herbalism.GreenThumb.StageChange", 200); + } /* MINING */ - public int getBlastMiningRankLevel(int rank) { return config.getInt("Skills.Mining.BlastMining.Rank_Levels.Rank_" + rank); } - public double getBlastDamageDecrease(int rank) { return config.getDouble("Skills.Mining.BlastMining.BlastDamageDecrease.Rank_" + rank); } - public double getOreBonus(int rank) { return config.getDouble("Skills.Mining.BlastMining.OreBonus.Rank_" + rank); } - public double getDebrisReduction(int rank) { return config.getDouble("Skills.Mining.BlastMining.DebrisReduction.Rank_" + rank); } - public int getDropMultiplier(int rank) { return config.getInt("Skills.Mining.BlastMining.DropMultiplier.Rank_" + rank); } - public double getBlastRadiusModifier(int rank) { return config.getDouble("Skills.Mining.BlastMining.BlastRadiusModifier.Rank_" + rank); } + public int getBlastMiningRankLevel(int rank) { + return config.getInt("Skills.Mining.BlastMining.Rank_Levels.Rank_" + rank); + } + + public double getBlastDamageDecrease(int rank) { + return config.getDouble("Skills.Mining.BlastMining.BlastDamageDecrease.Rank_" + rank); + } + + public double getOreBonus(int rank) { + return config.getDouble("Skills.Mining.BlastMining.OreBonus.Rank_" + rank); + } + + public double getDebrisReduction(int rank) { + return config.getDouble("Skills.Mining.BlastMining.DebrisReduction.Rank_" + rank); + } + + public int getDropMultiplier(int rank) { + return config.getInt("Skills.Mining.BlastMining.DropMultiplier.Rank_" + rank); + } + + public double getBlastRadiusModifier(int rank) { + return config.getDouble("Skills.Mining.BlastMining.BlastRadiusModifier.Rank_" + rank); + } /* REPAIR */ - public double getRepairMasteryMaxBonus() { return config.getDouble("Skills.Repair.RepairMastery.MaxBonusPercentage", 200.0D); } - public int getRepairMasteryMaxLevel() { return config.getInt("Skills.Repair.RepairMastery.MaxBonusLevel", 100); } + public double getRepairMasteryMaxBonus() { + return config.getDouble("Skills.Repair.RepairMastery.MaxBonusPercentage", 200.0D); + } + + public int getRepairMasteryMaxLevel() { + return config.getInt("Skills.Repair.RepairMastery.MaxBonusLevel", 100); + } /* Arcane Forging */ //public int getArcaneForgingRankLevel(int rank) { return config.getInt("Skills.Repair.ArcaneForging.Rank_Levels.Rank_" + rank); } - public boolean getArcaneForgingEnchantLossEnabled() { return config.getBoolean("Skills.Repair.ArcaneForging.May_Lose_Enchants", true); } - public double getArcaneForgingKeepEnchantsChance(int rank) { return config.getDouble("Skills.Repair.ArcaneForging.Keep_Enchants_Chance.Rank_" + rank); } + public boolean getArcaneForgingEnchantLossEnabled() { + return config.getBoolean("Skills.Repair.ArcaneForging.May_Lose_Enchants", true); + } - public boolean getArcaneForgingDowngradeEnabled() { return config.getBoolean("Skills.Repair.ArcaneForging.Downgrades_Enabled", true); } - public double getArcaneForgingDowngradeChance(int rank) { return config.getDouble("Skills.Repair.ArcaneForging.Downgrades_Chance.Rank_" + rank); } + public double getArcaneForgingKeepEnchantsChance(int rank) { + return config.getDouble("Skills.Repair.ArcaneForging.Keep_Enchants_Chance.Rank_" + rank); + } + + public boolean getArcaneForgingDowngradeEnabled() { + return config.getBoolean("Skills.Repair.ArcaneForging.Downgrades_Enabled", true); + } + + public double getArcaneForgingDowngradeChance(int rank) { + return config.getDouble("Skills.Repair.ArcaneForging.Downgrades_Chance.Rank_" + rank); + } /* SALVAGE */ //public double getSalvageMaxPercentage() { return config.getDouble("Skills.Salvage.MaxPercentage", 100.0D); } //public int getSalvageMaxPercentageLevel() { return config.getInt("Skills.Salvage.MaxPercentageLevel", 1000); } - public boolean getArcaneSalvageEnchantDowngradeEnabled() { return config.getBoolean("Skills.Salvage.ArcaneSalvage.EnchantDowngradeEnabled", true); } - public boolean getArcaneSalvageEnchantLossEnabled() { return config.getBoolean("Skills.Salvage.ArcaneSalvage.EnchantLossEnabled", true); } + public boolean getArcaneSalvageEnchantDowngradeEnabled() { + return config.getBoolean("Skills.Salvage.ArcaneSalvage.EnchantDowngradeEnabled", true); + } + + public boolean getArcaneSalvageEnchantLossEnabled() { + return config.getBoolean("Skills.Salvage.ArcaneSalvage.EnchantLossEnabled", true); + } //public int getArcaneSalvageRankLevel(int rank) { return config.getInt("Skills.Salvage.ArcaneSalvage.Rank_Levels.Rank_" + rank); } - public double getArcaneSalvageExtractFullEnchantsChance(int rank) { return config.getDouble("Skills.Salvage.ArcaneSalvage.ExtractFullEnchant.Rank_" + rank); } - public double getArcaneSalvageExtractPartialEnchantsChance(int rank) { return config.getDouble("Skills.Salvage.ArcaneSalvage.ExtractPartialEnchant.Rank_" + rank); } + public double getArcaneSalvageExtractFullEnchantsChance(int rank) { + return config.getDouble("Skills.Salvage.ArcaneSalvage.ExtractFullEnchant.Rank_" + rank); + } + + public double getArcaneSalvageExtractPartialEnchantsChance(int rank) { + return config.getDouble("Skills.Salvage.ArcaneSalvage.ExtractPartialEnchant.Rank_" + rank); + } /* SMELTING */ - public int getBurnModifierMaxLevel() { return config.getInt("Skills.Smelting.FuelEfficiency.MaxBonusLevel", 100); } - public double getBurnTimeMultiplier() { return config.getDouble("Skills.Smelting.FuelEfficiency.Multiplier", 3.0D); } + public int getBurnModifierMaxLevel() { + return config.getInt("Skills.Smelting.FuelEfficiency.MaxBonusLevel", 100); + } + + public double getBurnTimeMultiplier() { + return config.getDouble("Skills.Smelting.FuelEfficiency.Multiplier", 3.0D); + } /*public int getFluxMiningUnlockLevel() { return config.getInt("Skills.Smelting.FluxMining.UnlockLevel", 250); }*/ - public double getFluxMiningChance() { return config.getDouble("Skills.Smelting.FluxMining.Chance", 33.0D); } + public double getFluxMiningChance() { + return config.getDouble("Skills.Smelting.FluxMining.Chance", 33.0D); + } - public int getSmeltingRankLevel(int rank) { return config.getInt("Skills.Smelting.Rank_Levels.Rank_" + rank); } + public int getSmeltingRankLevel(int rank) { + return config.getInt("Skills.Smelting.Rank_Levels.Rank_" + rank); + } - public int getSmeltingVanillaXPBoostMultiplier(int rank) { return config.getInt("Skills.Smelting.VanillaXPMultiplier.Rank_" + rank); } + public int getSmeltingVanillaXPBoostMultiplier(int rank) { + return config.getInt("Skills.Smelting.VanillaXPMultiplier.Rank_" + rank); + } /* SWORDS */ - public double getRuptureDamagePlayer() { return config.getDouble("Skills.Swords.Rupture.DamagePlayer", 1.0); } - public double getRuptureDamageMobs() { return config.getDouble("Skills.Swords.Rupture.DamageMobs", 2.0); } + public double getRuptureDamagePlayer() { + return config.getDouble("Skills.Swords.Rupture.DamagePlayer", 1.0); + } - public int getRuptureMaxTicks() { return config.getInt("Skills.Swords.Rupture.MaxTicks", 8); } - public int getRuptureBaseTicks() { return config.getInt("Skills.Swords.Rupture.BaseTicks", 2); } + public double getRuptureDamageMobs() { + return config.getDouble("Skills.Swords.Rupture.DamageMobs", 2.0); + } - public double getCounterModifier() { return config.getDouble("Skills.Swords.CounterAttack.DamageModifier", 2.0D); } + public int getRuptureMaxTicks() { + return config.getInt("Skills.Swords.Rupture.MaxTicks", 8); + } - public double getSerratedStrikesModifier() { return config.getDouble("Skills.Swords.SerratedStrikes.DamageModifier", 4.0D); } - public int getSerratedStrikesTicks() { return config.getInt("Skills.Swords.SerratedStrikes.RuptureTicks", 5); } + public int getRuptureBaseTicks() { + return config.getInt("Skills.Swords.Rupture.BaseTicks", 2); + } + + public double getCounterModifier() { + return config.getDouble("Skills.Swords.CounterAttack.DamageModifier", 2.0D); + } + + public double getSerratedStrikesModifier() { + return config.getDouble("Skills.Swords.SerratedStrikes.DamageModifier", 4.0D); + } + + public int getSerratedStrikesTicks() { + return config.getInt("Skills.Swords.SerratedStrikes.RuptureTicks", 5); + } /* TAMING */ //public int getGoreRuptureTicks() { return config.getInt("Skills.Taming.Gore.RuptureTicks", 2); } - public double getGoreModifier() { return config.getDouble("Skills.Taming.Gore.Modifier", 2.0D); } + public double getGoreModifier() { + return config.getDouble("Skills.Taming.Gore.Modifier", 2.0D); + } /*public int getFastFoodUnlock() { return config.getInt("Skills.Taming.FastFood.UnlockLevel", 50); }*/ - public double getFastFoodChance() { return config.getDouble("Skills.Taming.FastFoodService.Chance", 50.0D); } - public double getPummelChance() { return config.getDouble("Skills.Taming.Pummel.Chance", 10.0D); } + public double getFastFoodChance() { + return config.getDouble("Skills.Taming.FastFoodService.Chance", 50.0D); + } + + public double getPummelChance() { + return config.getDouble("Skills.Taming.Pummel.Chance", 10.0D); + } //public int getEnviromentallyAwareUnlock() { return config.getInt("Skills.Taming.EnvironmentallyAware.UnlockLevel", 100); } /*public int getThickFurUnlock() { return config.getInt("Skills.Taming.ThickFur.UnlockLevel", 250); }*/ - public double getThickFurModifier() { return config.getDouble("Skills.Taming.ThickFur.Modifier", 2.0D); } + public double getThickFurModifier() { + return config.getDouble("Skills.Taming.ThickFur.Modifier", 2.0D); + } /*public int getHolyHoundUnlock() {return config.getInt("Skills.Taming.HolyHound.UnlockLevel", 375); }*/ /*public int getShockProofUnlock() { return config.getInt("Skills.Taming.ShockProof.UnlockLevel", 500); }*/ - public double getShockProofModifier() { return config.getDouble("Skills.Taming.ShockProof.Modifier", 6.0D); } + public double getShockProofModifier() { + return config.getDouble("Skills.Taming.ShockProof.Modifier", 6.0D); + } /*public int getSharpenedClawsUnlock() { return config.getInt("Skills.Taming.SharpenedClaws.UnlockLevel", 750); }*/ - public double getSharpenedClawsBonus() { return config.getDouble("Skills.Taming.SharpenedClaws.Bonus", 2.0D); } + public double getSharpenedClawsBonus() { + return config.getDouble("Skills.Taming.SharpenedClaws.Bonus", 2.0D); + } - public double getMinHorseJumpStrength() { return config.getDouble("Skills.Taming.CallOfTheWild.MinHorseJumpStrength", 0.7D); } - public double getMaxHorseJumpStrength() { return config.getDouble("Skills.Taming.CallOfTheWild.MaxHorseJumpStrength", 2.0D); } + public double getMinHorseJumpStrength() { + return config.getDouble("Skills.Taming.CallOfTheWild.MinHorseJumpStrength", 0.7D); + } + + public double getMaxHorseJumpStrength() { + return config.getDouble("Skills.Taming.CallOfTheWild.MaxHorseJumpStrength", 2.0D); + } /* UNARMED */ - public boolean getDisarmProtected() { return config.getBoolean("Skills.Unarmed.Disarm.AntiTheft", false); } + public boolean getDisarmProtected() { + return config.getBoolean("Skills.Unarmed.Disarm.AntiTheft", false); + } /* WOODCUTTING */ /*public int getLeafBlowUnlockLevel() { return config.getInt("Skills.Woodcutting.LeafBlower.UnlockLevel", 100); }*/ /* KRAKEN STUFF */ - public boolean getKrakenEnabled() { return config.getBoolean("Kraken.Enabled", true); } - public int getKrakenTriesBeforeRelease() { return config.getInt("Kraken.Tries_Before_Release", 50); } - public double getKrakenHealth() { return config.getDouble("Kraken.Health", 50.0D); } - public String getKrakenName() { return config.getString("Kraken.Name", "The Kraken"); } - public int getKrakenAttackInterval() { return config.getInt("Kraken.Attack_Interval_Seconds", 1); } - public double getKrakenAttackDamage() { return config.getDouble("Kraken.Attack_Damage", 1.0D); } - public boolean getKrakenGlobalEffectsEnabled() { return config.getBoolean("Kraken.Global_Effects", false); } - public boolean getKrakenEscapeAllowed() { return config.getBoolean("Kraken.Allow_Escaping", false); } - public String getServerUnleashMessage() { return config.getString("Kraken.Unleashed_Message.Server", ""); } - public String getPlayerUnleashMessage() { return config.getString("Kraken.Unleashed_Message.Player", ""); } - public String getPlayerDefeatMessage() { return config.getString("Kraken.Defeated_Message.Killed", ""); } - public String getPlayerEscapeMessage() { return config.getString("Kraken.Defeated_Message.Escape", ""); } + public boolean getKrakenEnabled() { + return config.getBoolean("Kraken.Enabled", true); + } + + public int getKrakenTriesBeforeRelease() { + return config.getInt("Kraken.Tries_Before_Release", 50); + } + + public double getKrakenHealth() { + return config.getDouble("Kraken.Health", 50.0D); + } + + public String getKrakenName() { + return config.getString("Kraken.Name", "The Kraken"); + } + + public int getKrakenAttackInterval() { + return config.getInt("Kraken.Attack_Interval_Seconds", 1); + } + + public double getKrakenAttackDamage() { + return config.getDouble("Kraken.Attack_Damage", 1.0D); + } + + public boolean getKrakenGlobalEffectsEnabled() { + return config.getBoolean("Kraken.Global_Effects", false); + } + + public boolean getKrakenEscapeAllowed() { + return config.getBoolean("Kraken.Allow_Escaping", false); + } + + public String getServerUnleashMessage() { + return config.getString("Kraken.Unleashed_Message.Server", ""); + } + + public String getPlayerUnleashMessage() { + return config.getString("Kraken.Unleashed_Message.Player", ""); + } + + public String getPlayerDefeatMessage() { + return config.getString("Kraken.Defeated_Message.Killed", ""); + } + + public String getPlayerEscapeMessage() { + return config.getString("Kraken.Defeated_Message.Escape", ""); + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/AutoUpdateConfigLoader.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/AutoUpdateConfigLoader.java index 09f32b1e2..da46aa542 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/AutoUpdateConfigLoader.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/AutoUpdateConfigLoader.java @@ -73,16 +73,15 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader { while ((line = reader.readLine()) != null) { if (line.contains("#")) { temp += line + "\n"; - } - else if (line.contains(":")) { + } else if (line.contains(":")) { line = line.substring(0, line.indexOf(":") + 1); if (!temp.isEmpty()) { - if(comments.containsKey(line)) { + if (comments.containsKey(line)) { int index = 0; - while(comments.containsKey(line + index)) { + while (comments.containsKey(line + index)) { index++; } - + line = line + index; } @@ -98,7 +97,7 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader { String actualkey = key.substring(0, key.indexOf(":") + 1); int index = 0; - if(indexed.containsKey(actualkey)) { + if (indexed.containsKey(actualkey)) { index = indexed.get(actualkey); } boolean isAtTop = !output.contains("\n" + actualkey); @@ -109,8 +108,7 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader { indexed.put(actualkey, index + comments.get(key).length() + actualkey.length() + 1); } } - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); } @@ -126,8 +124,7 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader { writer.write(output); writer.flush(); writer.close(); - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/Config.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/Config.java index 6fea3abc7..50aeb0b10 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/Config.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/Config.java @@ -246,104 +246,279 @@ public class Config extends AutoUpdateConfigLoader { */ /* General Settings */ - public boolean getIsMetricsEnabled() { return config.getBoolean("Metrics.bstats", true); } + public boolean getIsMetricsEnabled() { + return config.getBoolean("Metrics.bstats", true); + } //Retro mode will default the value to true if the config file doesn't contain the entry (server is from a previous mcMMO install) - public boolean getIsRetroMode() { return config.getBoolean("General.RetroMode.Enabled", true); } + public boolean getIsRetroMode() { + return config.getBoolean("General.RetroMode.Enabled", true); + } - public String getLocale() { return config.getString("General.Locale", "en_us"); } - public boolean getMOTDEnabled() { return config.getBoolean("General.MOTD_Enabled", true); } - public boolean getShowProfileLoadedMessage() { return config.getBoolean("General.Show_Profile_Loaded", true); } - public boolean getDonateMessageEnabled() { return config.getBoolean("Commands.mcmmo.Donate_Message", true); } - public int getSaveInterval() { return config.getInt("General.Save_Interval", 10); } - public boolean getStatsTrackingEnabled() { return config.getBoolean("General.Stats_Tracking", true); } - public boolean getUpdateCheckEnabled() { return config.getBoolean("General.Update_Check", true); } - public boolean getPreferBeta() { return config.getBoolean("General.Prefer_Beta", false); } - public boolean getVerboseLoggingEnabled() { return config.getBoolean("General.Verbose_Logging", false); } + public String getLocale() { + return config.getString("General.Locale", "en_us"); + } - public String getPartyChatPrefix() { return config.getString("Commands.partychat.Chat_Prefix_Format", "[[GREEN]]([[WHITE]]{0}[[GREEN]])"); } - public boolean getPartyChatColorLeaderName() { return config.getBoolean("Commands.partychat.Gold_Leader_Name", true); } - public boolean getPartyDisplayNames() { return config.getBoolean("Commands.partychat.Use_Display_Names", true); } - public String getPartyChatPrefixAlly() { return config.getString("Commands.partychat.Chat_Prefix_Format_Ally", "[[GREEN]](A)[[RESET]]"); } + public boolean getMOTDEnabled() { + return config.getBoolean("General.MOTD_Enabled", true); + } - public String getAdminChatPrefix() { return config.getString("Commands.adminchat.Chat_Prefix_Format", "[[AQUA]][[[WHITE]]{0}[[AQUA]]]"); } - public boolean getAdminDisplayNames() { return config.getBoolean("Commands.adminchat.Use_Display_Names", true); } + public boolean getShowProfileLoadedMessage() { + return config.getBoolean("General.Show_Profile_Loaded", true); + } - public boolean getMatchOfflinePlayers() { return config.getBoolean("Commands.Generic.Match_OfflinePlayers", false); } - public long getDatabasePlayerCooldown() { return config.getLong("Commands.Database.Player_Cooldown", 1750); } + public boolean getDonateMessageEnabled() { + return config.getBoolean("Commands.mcmmo.Donate_Message", true); + } - public boolean getLevelUpSoundsEnabled() { return config.getBoolean("General.LevelUp_Sounds", true); } - public boolean getRefreshChunksEnabled() { return config.getBoolean("General.Refresh_Chunks", false); } + public int getSaveInterval() { + return config.getInt("General.Save_Interval", 10); + } - public boolean getMobHealthbarEnabled() { return config.getBoolean("Mob_Healthbar.Enabled", true); } + public boolean getStatsTrackingEnabled() { + return config.getBoolean("General.Stats_Tracking", true); + } + + public boolean getUpdateCheckEnabled() { + return config.getBoolean("General.Update_Check", true); + } + + public boolean getPreferBeta() { + return config.getBoolean("General.Prefer_Beta", false); + } + + public boolean getVerboseLoggingEnabled() { + return config.getBoolean("General.Verbose_Logging", false); + } + + public String getPartyChatPrefix() { + return config.getString("Commands.partychat.Chat_Prefix_Format", "[[GREEN]]([[WHITE]]{0}[[GREEN]])"); + } + + public boolean getPartyChatColorLeaderName() { + return config.getBoolean("Commands.partychat.Gold_Leader_Name", true); + } + + public boolean getPartyDisplayNames() { + return config.getBoolean("Commands.partychat.Use_Display_Names", true); + } + + public String getPartyChatPrefixAlly() { + return config.getString("Commands.partychat.Chat_Prefix_Format_Ally", "[[GREEN]](A)[[RESET]]"); + } + + public String getAdminChatPrefix() { + return config.getString("Commands.adminchat.Chat_Prefix_Format", "[[AQUA]][[[WHITE]]{0}[[AQUA]]]"); + } + + public boolean getAdminDisplayNames() { + return config.getBoolean("Commands.adminchat.Use_Display_Names", true); + } + + public boolean getMatchOfflinePlayers() { + return config.getBoolean("Commands.Generic.Match_OfflinePlayers", false); + } + + public long getDatabasePlayerCooldown() { + return config.getLong("Commands.Database.Player_Cooldown", 1750); + } + + public boolean getLevelUpSoundsEnabled() { + return config.getBoolean("General.LevelUp_Sounds", true); + } + + public boolean getRefreshChunksEnabled() { + return config.getBoolean("General.Refresh_Chunks", false); + } + + public boolean getMobHealthbarEnabled() { + return config.getBoolean("Mob_Healthbar.Enabled", true); + } /* Mob Healthbar */ public MobHealthbarType getMobHealthbarDefault() { try { return MobHealthbarType.valueOf(config.getString("Mob_Healthbar.Display_Type", "HEARTS").toUpperCase().trim()); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { return MobHealthbarType.HEARTS; } } - public int getMobHealthbarTime() { return config.getInt("Mob_Healthbar.Display_Time", 3); } + public int getMobHealthbarTime() { + return config.getInt("Mob_Healthbar.Display_Time", 3); + } /* Scoreboards */ - public boolean getScoreboardsEnabled() { return config.getBoolean("Scoreboard.UseScoreboards", true); } - public boolean getPowerLevelTagsEnabled() { return config.getBoolean("Scoreboard.Power_Level_Tags", false); } - public boolean getAllowKeepBoard() { return config.getBoolean("Scoreboard.Allow_Keep", true); } - public int getTipsAmount() { return config.getInt("Scoreboard.Tips_Amount", 5); } - public boolean getShowStatsAfterLogin() { return config.getBoolean("Scoreboard.Show_Stats_After_Login", false); } - public boolean getScoreboardRainbows() { return config.getBoolean("Scoreboard.Rainbows", false); } - public boolean getShowAbilityNames() { return config.getBoolean("Scoreboard.Ability_Names", true); } + public boolean getScoreboardsEnabled() { + return config.getBoolean("Scoreboard.UseScoreboards", true); + } - public boolean getRankUseChat() { return config.getBoolean("Scoreboard.Types.Rank.Print", false); } - public boolean getRankUseBoard() { return config.getBoolean("Scoreboard.Types.Rank.Board", true); } - public int getRankScoreboardTime() { return config.getInt("Scoreboard.Types.Rank.Display_Time", 10); } + public boolean getPowerLevelTagsEnabled() { + return config.getBoolean("Scoreboard.Power_Level_Tags", false); + } - public boolean getTopUseChat() { return config.getBoolean("Scoreboard.Types.Top.Print", true); } - public boolean getTopUseBoard() { return config.getBoolean("Scoreboard.Types.Top.Board", true); } - public int getTopScoreboardTime() { return config.getInt("Scoreboard.Types.Top.Display_Time", 15); } + public boolean getAllowKeepBoard() { + return config.getBoolean("Scoreboard.Allow_Keep", true); + } - public boolean getStatsUseChat() { return config.getBoolean("Scoreboard.Types.Stats.Print", true); } - public boolean getStatsUseBoard() { return config.getBoolean("Scoreboard.Types.Stats.Board", true); } - public int getStatsScoreboardTime() { return config.getInt("Scoreboard.Types.Stats.Display_Time", 10); } + public int getTipsAmount() { + return config.getInt("Scoreboard.Tips_Amount", 5); + } - public boolean getInspectUseChat() { return config.getBoolean("Scoreboard.Types.Inspect.Print", true); } - public boolean getInspectUseBoard() { return config.getBoolean("Scoreboard.Types.Inspect.Board", true); } - public int getInspectScoreboardTime() { return config.getInt("Scoreboard.Types.Inspect.Display_Time", 25); } + public boolean getShowStatsAfterLogin() { + return config.getBoolean("Scoreboard.Show_Stats_After_Login", false); + } - public boolean getCooldownUseChat() { return config.getBoolean("Scoreboard.Types.Cooldown.Print", false); } - public boolean getCooldownUseBoard() { return config.getBoolean("Scoreboard.Types.Cooldown.Board", true); } - public int getCooldownScoreboardTime() { return config.getInt("Scoreboard.Types.Cooldown.Display_Time", 41); } + public boolean getScoreboardRainbows() { + return config.getBoolean("Scoreboard.Rainbows", false); + } - public boolean getSkillUseBoard() { return config.getBoolean("Scoreboard.Types.Skill.Board", true); } - public int getSkillScoreboardTime() { return config.getInt("Scoreboard.Types.Skill.Display_Time", 30); } - public boolean getSkillLevelUpBoard() { return config.getBoolean("Scoreboard.Types.Skill.LevelUp_Board", true); } - public int getSkillLevelUpTime() { return config.getInt("Scoreboard.Types.Skill.LevelUp_Time", 5); } + public boolean getShowAbilityNames() { + return config.getBoolean("Scoreboard.Ability_Names", true); + } + + public boolean getRankUseChat() { + return config.getBoolean("Scoreboard.Types.Rank.Print", false); + } + + public boolean getRankUseBoard() { + return config.getBoolean("Scoreboard.Types.Rank.Board", true); + } + + public int getRankScoreboardTime() { + return config.getInt("Scoreboard.Types.Rank.Display_Time", 10); + } + + public boolean getTopUseChat() { + return config.getBoolean("Scoreboard.Types.Top.Print", true); + } + + public boolean getTopUseBoard() { + return config.getBoolean("Scoreboard.Types.Top.Board", true); + } + + public int getTopScoreboardTime() { + return config.getInt("Scoreboard.Types.Top.Display_Time", 15); + } + + public boolean getStatsUseChat() { + return config.getBoolean("Scoreboard.Types.Stats.Print", true); + } + + public boolean getStatsUseBoard() { + return config.getBoolean("Scoreboard.Types.Stats.Board", true); + } + + public int getStatsScoreboardTime() { + return config.getInt("Scoreboard.Types.Stats.Display_Time", 10); + } + + public boolean getInspectUseChat() { + return config.getBoolean("Scoreboard.Types.Inspect.Print", true); + } + + public boolean getInspectUseBoard() { + return config.getBoolean("Scoreboard.Types.Inspect.Board", true); + } + + public int getInspectScoreboardTime() { + return config.getInt("Scoreboard.Types.Inspect.Display_Time", 25); + } + + public boolean getCooldownUseChat() { + return config.getBoolean("Scoreboard.Types.Cooldown.Print", false); + } + + public boolean getCooldownUseBoard() { + return config.getBoolean("Scoreboard.Types.Cooldown.Board", true); + } + + public int getCooldownScoreboardTime() { + return config.getInt("Scoreboard.Types.Cooldown.Display_Time", 41); + } + + public boolean getSkillUseBoard() { + return config.getBoolean("Scoreboard.Types.Skill.Board", true); + } + + public int getSkillScoreboardTime() { + return config.getInt("Scoreboard.Types.Skill.Display_Time", 30); + } + + public boolean getSkillLevelUpBoard() { + return config.getBoolean("Scoreboard.Types.Skill.LevelUp_Board", true); + } + + public int getSkillLevelUpTime() { + return config.getInt("Scoreboard.Types.Skill.LevelUp_Time", 5); + } /* Database Purging */ - public int getPurgeInterval() { return config.getInt("Database_Purging.Purge_Interval", -1); } - public int getOldUsersCutoff() { return config.getInt("Database_Purging.Old_User_Cutoff", 6); } + public int getPurgeInterval() { + return config.getInt("Database_Purging.Purge_Interval", -1); + } + + public int getOldUsersCutoff() { + return config.getInt("Database_Purging.Old_User_Cutoff", 6); + } /* Backups */ - public boolean getBackupsEnabled() { return config.getBoolean("Backups.Enabled", true); } - public boolean getKeepLast24Hours() { return config.getBoolean("Backups.Keep.Last_24_Hours", true); } - public boolean getKeepDailyLastWeek() { return config.getBoolean("Backups.Keep.Daily_Last_Week", true); } - public boolean getKeepWeeklyPastMonth() { return config.getBoolean("Backups.Keep.Weekly_Past_Months", true); } + public boolean getBackupsEnabled() { + return config.getBoolean("Backups.Enabled", true); + } + + public boolean getKeepLast24Hours() { + return config.getBoolean("Backups.Keep.Last_24_Hours", true); + } + + public boolean getKeepDailyLastWeek() { + return config.getBoolean("Backups.Keep.Daily_Last_Week", true); + } + + public boolean getKeepWeeklyPastMonth() { + return config.getBoolean("Backups.Keep.Weekly_Past_Months", true); + } /* mySQL */ - public boolean getUseMySQL() { return config.getBoolean("MySQL.Enabled", false); } - public String getMySQLTablePrefix() { return config.getString("MySQL.Database.TablePrefix", "mcmmo_"); } - public String getMySQLDatabaseName() { return getStringIncludingInts("MySQL.Database.Name"); } - public String getMySQLUserName() { return getStringIncludingInts("MySQL.Database.User_Name"); } - public int getMySQLServerPort() { return config.getInt("MySQL.Server.Port", 3306); } - public String getMySQLServerName() { return config.getString("MySQL.Server.Address", "localhost"); } - public String getMySQLUserPassword() { return getStringIncludingInts("MySQL.Database.User_Password"); } - public int getMySQLMaxConnections(SQLDatabaseManager.PoolIdentifier identifier) { return config.getInt("MySQL.Database.MaxConnections." + StringUtils.getCapitalized(identifier.toString()), 30); } - public int getMySQLMaxPoolSize(SQLDatabaseManager.PoolIdentifier identifier) { return config.getInt("MySQL.Database.MaxPoolSize." + StringUtils.getCapitalized(identifier.toString()), 10); } - public boolean getMySQLSSL() { return config.getBoolean("MySQL.Server.SSL", true); } + public boolean getUseMySQL() { + return config.getBoolean("MySQL.Enabled", false); + } + + public String getMySQLTablePrefix() { + return config.getString("MySQL.Database.TablePrefix", "mcmmo_"); + } + + public String getMySQLDatabaseName() { + return getStringIncludingInts("MySQL.Database.Name"); + } + + public String getMySQLUserName() { + return getStringIncludingInts("MySQL.Database.User_Name"); + } + + public int getMySQLServerPort() { + return config.getInt("MySQL.Server.Port", 3306); + } + + public String getMySQLServerName() { + return config.getString("MySQL.Server.Address", "localhost"); + } + + public String getMySQLUserPassword() { + return getStringIncludingInts("MySQL.Database.User_Password"); + } + + public int getMySQLMaxConnections(SQLDatabaseManager.PoolIdentifier identifier) { + return config.getInt("MySQL.Database.MaxConnections." + StringUtils.getCapitalized(identifier.toString()), 30); + } + + public int getMySQLMaxPoolSize(SQLDatabaseManager.PoolIdentifier identifier) { + return config.getInt("MySQL.Database.MaxPoolSize." + StringUtils.getCapitalized(identifier.toString()), 10); + } + + public boolean getMySQLSSL() { + return config.getBoolean("MySQL.Server.SSL", true); + } private String getStringIncludingInts(String key) { String str = config.getString(key); @@ -359,111 +534,282 @@ public class Config extends AutoUpdateConfigLoader { } /* Hardcore Mode */ - public boolean getHardcoreStatLossEnabled(PrimarySkillType primarySkillType) { return config.getBoolean("Hardcore.Death_Stat_Loss.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), false); } - public void setHardcoreStatLossEnabled(PrimarySkillType primarySkillType, boolean enabled) { config.set("Hardcore.Death_Stat_Loss.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), enabled); } + public boolean getHardcoreStatLossEnabled(PrimarySkillType primarySkillType) { + return config.getBoolean("Hardcore.Death_Stat_Loss.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), false); + } - public double getHardcoreDeathStatPenaltyPercentage() { return config.getDouble("Hardcore.Death_Stat_Loss.Penalty_Percentage", 75.0D); } - public void setHardcoreDeathStatPenaltyPercentage(double value) { config.set("Hardcore.Death_Stat_Loss.Penalty_Percentage", value); } + public void setHardcoreStatLossEnabled(PrimarySkillType primarySkillType, boolean enabled) { + config.set("Hardcore.Death_Stat_Loss.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), enabled); + } - public int getHardcoreDeathStatPenaltyLevelThreshold() { return config.getInt("Hardcore.Death_Stat_Loss.Level_Threshold", 0); } + public double getHardcoreDeathStatPenaltyPercentage() { + return config.getDouble("Hardcore.Death_Stat_Loss.Penalty_Percentage", 75.0D); + } - public boolean getHardcoreVampirismEnabled(PrimarySkillType primarySkillType) { return config.getBoolean("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), false); } - public void setHardcoreVampirismEnabled(PrimarySkillType primarySkillType, boolean enabled) { config.set("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), enabled); } + public void setHardcoreDeathStatPenaltyPercentage(double value) { + config.set("Hardcore.Death_Stat_Loss.Penalty_Percentage", value); + } - public double getHardcoreVampirismStatLeechPercentage() { return config.getDouble("Hardcore.Vampirism.Leech_Percentage", 5.0D); } - public void setHardcoreVampirismStatLeechPercentage(double value) { config.set("Hardcore.Vampirism.Leech_Percentage", value); } + public int getHardcoreDeathStatPenaltyLevelThreshold() { + return config.getInt("Hardcore.Death_Stat_Loss.Level_Threshold", 0); + } - public int getHardcoreVampirismLevelThreshold() { return config.getInt("Hardcore.Vampirism.Level_Threshold", 0); } + public boolean getHardcoreVampirismEnabled(PrimarySkillType primarySkillType) { + return config.getBoolean("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), false); + } + + public void setHardcoreVampirismEnabled(PrimarySkillType primarySkillType, boolean enabled) { + config.set("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), enabled); + } + + public double getHardcoreVampirismStatLeechPercentage() { + return config.getDouble("Hardcore.Vampirism.Leech_Percentage", 5.0D); + } + + public void setHardcoreVampirismStatLeechPercentage(double value) { + config.set("Hardcore.Vampirism.Leech_Percentage", value); + } + + public int getHardcoreVampirismLevelThreshold() { + return config.getInt("Hardcore.Vampirism.Level_Threshold", 0); + } /* SMP Mods */ - public boolean getToolModsEnabled() { return config.getBoolean("Mods.Tool_Mods_Enabled", false); } - public boolean getArmorModsEnabled() { return config.getBoolean("Mods.Armor_Mods_Enabled", false); } - public boolean getBlockModsEnabled() { return config.getBoolean("Mods.Block_Mods_Enabled", false); } - public boolean getEntityModsEnabled() { return config.getBoolean("Mods.Entity_Mods_Enabled", false); } + public boolean getToolModsEnabled() { + return config.getBoolean("Mods.Tool_Mods_Enabled", false); + } + + public boolean getArmorModsEnabled() { + return config.getBoolean("Mods.Armor_Mods_Enabled", false); + } + + public boolean getBlockModsEnabled() { + return config.getBoolean("Mods.Block_Mods_Enabled", false); + } + + public boolean getEntityModsEnabled() { + return config.getBoolean("Mods.Entity_Mods_Enabled", false); + } /* Items */ - public int getChimaeraUseCost() { return config.getInt("Items.Chimaera_Wing.Use_Cost", 1); } - public int getChimaeraRecipeCost() { return config.getInt("Items.Chimaera_Wing.Recipe_Cost", 5); } - public Material getChimaeraItem() { return Material.matchMaterial(config.getString("Items.Chimaera_Wing.Item_Name", "Feather")); } - public boolean getChimaeraEnabled() { return config.getBoolean("Items.Chimaera_Wing.Enabled", true); } - public boolean getChimaeraPreventUseUnderground() { return config.getBoolean("Items.Chimaera_Wing.Prevent_Use_Underground", true); } - public boolean getChimaeraUseBedSpawn() { return config.getBoolean("Items.Chimaera_Wing.Use_Bed_Spawn", true); } - public int getChimaeraCooldown() { return config.getInt("Items.Chimaera_Wing.Cooldown", 240); } - public int getChimaeraWarmup() { return config.getInt("Items.Chimaera_Wing.Warmup", 5); } - public int getChimaeraRecentlyHurtCooldown() { return config.getInt("Items.Chimaera_Wing.RecentlyHurt_Cooldown", 60); } - public boolean getChimaeraSoundEnabled() { return config.getBoolean("Items.Chimaera_Wing.Sound_Enabled", true); } + public int getChimaeraUseCost() { + return config.getInt("Items.Chimaera_Wing.Use_Cost", 1); + } - public boolean getFluxPickaxeSoundEnabled() { return config.getBoolean("Items.Flux_Pickaxe.Sound_Enabled", true); } + public int getChimaeraRecipeCost() { + return config.getInt("Items.Chimaera_Wing.Recipe_Cost", 5); + } + + public Material getChimaeraItem() { + return Material.matchMaterial(config.getString("Items.Chimaera_Wing.Item_Name", "Feather")); + } + + public boolean getChimaeraEnabled() { + return config.getBoolean("Items.Chimaera_Wing.Enabled", true); + } + + public boolean getChimaeraPreventUseUnderground() { + return config.getBoolean("Items.Chimaera_Wing.Prevent_Use_Underground", true); + } + + public boolean getChimaeraUseBedSpawn() { + return config.getBoolean("Items.Chimaera_Wing.Use_Bed_Spawn", true); + } + + public int getChimaeraCooldown() { + return config.getInt("Items.Chimaera_Wing.Cooldown", 240); + } + + public int getChimaeraWarmup() { + return config.getInt("Items.Chimaera_Wing.Warmup", 5); + } + + public int getChimaeraRecentlyHurtCooldown() { + return config.getInt("Items.Chimaera_Wing.RecentlyHurt_Cooldown", 60); + } + + public boolean getChimaeraSoundEnabled() { + return config.getBoolean("Items.Chimaera_Wing.Sound_Enabled", true); + } + + public boolean getFluxPickaxeSoundEnabled() { + return config.getBoolean("Items.Flux_Pickaxe.Sound_Enabled", true); + } /* Particles */ - public boolean getAbilityActivationEffectEnabled() { return config.getBoolean("Particles.Ability_Activation", true); } - public boolean getAbilityDeactivationEffectEnabled() { return config.getBoolean("Particles.Ability_Deactivation", true); } - public boolean getBleedEffectEnabled() { return config.getBoolean("Particles.Bleed", true); } - public boolean getDodgeEffectEnabled() { return config.getBoolean("Particles.Dodge", true); } - public boolean getFluxEffectEnabled() { return config.getBoolean("Particles.Flux", true); } - public boolean getGreaterImpactEffectEnabled() { return config.getBoolean("Particles.Greater_Impact", true); } - public boolean getCallOfTheWildEffectEnabled() { return config.getBoolean("Particles.Call_of_the_Wild", true); } - public boolean getLevelUpEffectsEnabled() { return config.getBoolean("Particles.LevelUp_Enabled", true); } - public int getLevelUpEffectsTier() { return config.getInt("Particles.LevelUp_Tier", 100); } - public boolean getLargeFireworks() { return config.getBoolean("Particles.LargeFireworks", true); } + public boolean getAbilityActivationEffectEnabled() { + return config.getBoolean("Particles.Ability_Activation", true); + } + + public boolean getAbilityDeactivationEffectEnabled() { + return config.getBoolean("Particles.Ability_Deactivation", true); + } + + public boolean getBleedEffectEnabled() { + return config.getBoolean("Particles.Bleed", true); + } + + public boolean getDodgeEffectEnabled() { + return config.getBoolean("Particles.Dodge", true); + } + + public boolean getFluxEffectEnabled() { + return config.getBoolean("Particles.Flux", true); + } + + public boolean getGreaterImpactEffectEnabled() { + return config.getBoolean("Particles.Greater_Impact", true); + } + + public boolean getCallOfTheWildEffectEnabled() { + return config.getBoolean("Particles.Call_of_the_Wild", true); + } + + public boolean getLevelUpEffectsEnabled() { + return config.getBoolean("Particles.LevelUp_Enabled", true); + } + + public int getLevelUpEffectsTier() { + return config.getInt("Particles.LevelUp_Tier", 100); + } + + public boolean getLargeFireworks() { + return config.getBoolean("Particles.LargeFireworks", true); + } /* PARTY SETTINGS */ - public boolean getPartyFriendlyFire() { return config.getBoolean("Party.FriendlyFire", false);} - public int getPartyMaxSize() {return config.getInt("Party.MaxSize", -1); } - public int getAutoPartyKickInterval() { return config.getInt("Party.AutoKick_Interval", 12); } - public int getAutoPartyKickTime() { return config.getInt("Party.Old_Party_Member_Cutoff", 7); } + public boolean getPartyFriendlyFire() { + return config.getBoolean("Party.FriendlyFire", false); + } - public double getPartyShareBonusBase() { return config.getDouble("Party.Sharing.ExpShare_bonus_base", 1.1D); } - public double getPartyShareBonusIncrease() { return config.getDouble("Party.Sharing.ExpShare_bonus_increase", 0.05D); } - public double getPartyShareBonusCap() { return config.getDouble("Party.Sharing.ExpShare_bonus_cap", 1.5D); } - public double getPartyShareRange() { return config.getDouble("Party.Sharing.Range", 75.0D); } + public int getPartyMaxSize() { + return config.getInt("Party.MaxSize", -1); + } + + public int getAutoPartyKickInterval() { + return config.getInt("Party.AutoKick_Interval", 12); + } + + public int getAutoPartyKickTime() { + return config.getInt("Party.Old_Party_Member_Cutoff", 7); + } + + public double getPartyShareBonusBase() { + return config.getDouble("Party.Sharing.ExpShare_bonus_base", 1.1D); + } + + public double getPartyShareBonusIncrease() { + return config.getDouble("Party.Sharing.ExpShare_bonus_increase", 0.05D); + } + + public double getPartyShareBonusCap() { + return config.getDouble("Party.Sharing.ExpShare_bonus_cap", 1.5D); + } + + public double getPartyShareRange() { + return config.getDouble("Party.Sharing.Range", 75.0D); + } public int getPartyLevelCap() { int cap = config.getInt("Party.Leveling.Level_Cap", 10); return (cap <= 0) ? Integer.MAX_VALUE : cap; } - public int getPartyXpCurveMultiplier() { return config.getInt("Party.Leveling.Xp_Curve_Modifier", 3); } - public boolean getPartyXpNearMembersNeeded() { return config.getBoolean("Party.Leveling.Near_Members_Needed", false); } - public boolean getPartyInformAllMembers() { return config.getBoolean("Party.Leveling.Inform_All_Party_Members_On_LevelUp", false); } + public int getPartyXpCurveMultiplier() { + return config.getInt("Party.Leveling.Xp_Curve_Modifier", 3); + } - public int getPartyFeatureUnlockLevel(PartyFeature partyFeature) { return config.getInt("Party.Leveling." + StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + "_UnlockLevel", 0); } + public boolean getPartyXpNearMembersNeeded() { + return config.getBoolean("Party.Leveling.Near_Members_Needed", false); + } + + public boolean getPartyInformAllMembers() { + return config.getBoolean("Party.Leveling.Inform_All_Party_Members_On_LevelUp", false); + } + + public int getPartyFeatureUnlockLevel(PartyFeature partyFeature) { + return config.getInt("Party.Leveling." + StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + "_UnlockLevel", 0); + } /* Party Teleport Settings */ - public int getPTPCommandCooldown() { return config.getInt("Commands.ptp.Cooldown", 120); } - public int getPTPCommandWarmup() { return config.getInt("Commands.ptp.Warmup", 5); } - public int getPTPCommandRecentlyHurtCooldown() { return config.getInt("Commands.ptp.RecentlyHurt_Cooldown", 60); } - public int getPTPCommandTimeout() { return config.getInt("Commands.ptp.Request_Timeout", 300); } - public boolean getPTPCommandConfirmRequired() { return config.getBoolean("Commands.ptp.Accept_Required", true); } - public boolean getPTPCommandWorldPermissions() { return config.getBoolean("Commands.ptp.World_Based_Permissions", false); } + public int getPTPCommandCooldown() { + return config.getInt("Commands.ptp.Cooldown", 120); + } + + public int getPTPCommandWarmup() { + return config.getInt("Commands.ptp.Warmup", 5); + } + + public int getPTPCommandRecentlyHurtCooldown() { + return config.getInt("Commands.ptp.RecentlyHurt_Cooldown", 60); + } + + public int getPTPCommandTimeout() { + return config.getInt("Commands.ptp.Request_Timeout", 300); + } + + public boolean getPTPCommandConfirmRequired() { + return config.getBoolean("Commands.ptp.Accept_Required", true); + } + + public boolean getPTPCommandWorldPermissions() { + return config.getBoolean("Commands.ptp.World_Based_Permissions", false); + } /* Inspect command distance */ - public double getInspectDistance() { return config.getDouble("Commands.inspect.Max_Distance", 30.0D); } + public double getInspectDistance() { + return config.getDouble("Commands.inspect.Max_Distance", 30.0D); + } /* * ABILITY SETTINGS */ /* General Settings */ - public boolean getUrlLinksEnabled() { return config.getBoolean("Commands.Skills.URL_Links"); } - public boolean getAbilityMessagesEnabled() { return config.getBoolean("Abilities.Messages", true); } - public boolean getAbilitiesEnabled() { return config.getBoolean("Abilities.Enabled", true); } - public boolean getAbilitiesOnlyActivateWhenSneaking() { return config.getBoolean("Abilities.Activation.Only_Activate_When_Sneaking", false); } - public boolean getAbilitiesGateEnabled() { return config.getBoolean("Abilities.Activation.Level_Gate_Abilities"); } + public boolean getUrlLinksEnabled() { + return config.getBoolean("Commands.Skills.URL_Links"); + } - public int getCooldown(SuperAbilityType ability) { return config.getInt("Abilities.Cooldowns." + ability.toString()); } - public int getMaxLength(SuperAbilityType ability) { return config.getInt("Abilities.Max_Seconds." + ability.toString()); } + public boolean getAbilityMessagesEnabled() { + return config.getBoolean("Abilities.Messages", true); + } + + public boolean getAbilitiesEnabled() { + return config.getBoolean("Abilities.Enabled", true); + } + + public boolean getAbilitiesOnlyActivateWhenSneaking() { + return config.getBoolean("Abilities.Activation.Only_Activate_When_Sneaking", false); + } + + public boolean getAbilitiesGateEnabled() { + return config.getBoolean("Abilities.Activation.Level_Gate_Abilities"); + } + + public int getCooldown(SuperAbilityType ability) { + return config.getInt("Abilities.Cooldowns." + ability.toString()); + } + + public int getMaxLength(SuperAbilityType ability) { + return config.getInt("Abilities.Max_Seconds." + ability.toString()); + } /* Durability Settings */ - public int getAbilityToolDamage() { return config.getInt("Abilities.Tools.Durability_Loss", 1); } + public int getAbilityToolDamage() { + return config.getInt("Abilities.Tools.Durability_Loss", 1); + } /* Thresholds */ - public int getTreeFellerThreshold() { return config.getInt("Abilities.Limits.Tree_Feller_Threshold", 500); } + public int getTreeFellerThreshold() { + return config.getInt("Abilities.Limits.Tree_Feller_Threshold", 500); + } /* * SKILL SETTINGS */ - public boolean getDoubleDropsEnabled(PrimarySkillType skill, Material material) { return config.getBoolean("Double_Drops." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); } + public boolean getDoubleDropsEnabled(PrimarySkillType skill, Material material) { + return config.getBoolean("Double_Drops." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); + } public boolean getDoubleDropsDisabled(PrimarySkillType skill) { String skillName = StringUtils.getCapitalized(skill.toString()); @@ -484,70 +830,177 @@ public class Config extends AutoUpdateConfigLoader { } /* Axes */ - public int getAxesGate() { return config.getInt("Skills.Axes.Ability_Activation_Level_Gate", 10); } + public int getAxesGate() { + return config.getInt("Skills.Axes.Ability_Activation_Level_Gate", 10); + } /* Acrobatics */ - public boolean getDodgeLightningDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_Dodge_Lightning", false); } - public int getXPAfterTeleportCooldown() { return config.getInt("Skills.Acrobatics.XP_After_Teleport_Cooldown", 5); } + public boolean getDodgeLightningDisabled() { + return config.getBoolean("Skills.Acrobatics.Prevent_Dodge_Lightning", false); + } + + public int getXPAfterTeleportCooldown() { + return config.getInt("Skills.Acrobatics.XP_After_Teleport_Cooldown", 5); + } /* Alchemy */ - public boolean getEnabledForHoppers() { return config.getBoolean("Skills.Alchemy.Enabled_for_Hoppers", true); } - public boolean getPreventHopperTransferIngredients() { return config.getBoolean("Skills.Alchemy.Prevent_Hopper_Transfer_Ingredients", false); } - public boolean getPreventHopperTransferBottles() { return config.getBoolean("Skills.Alchemy.Prevent_Hopper_Transfer_Bottles", false); } + public boolean getEnabledForHoppers() { + return config.getBoolean("Skills.Alchemy.Enabled_for_Hoppers", true); + } + + public boolean getPreventHopperTransferIngredients() { + return config.getBoolean("Skills.Alchemy.Prevent_Hopper_Transfer_Ingredients", false); + } + + public boolean getPreventHopperTransferBottles() { + return config.getBoolean("Skills.Alchemy.Prevent_Hopper_Transfer_Bottles", false); + } /* Fishing */ - public boolean getFishingDropsEnabled() { return config.getBoolean("Skills.Fishing.Drops_Enabled", true); } - public boolean getFishingOverrideTreasures() { return config.getBoolean("Skills.Fishing.Override_Vanilla_Treasures", true); } - public boolean getFishingExtraFish() { return config.getBoolean("Skills.Fishing.Extra_Fish", true); } - public double getFishingLureModifier() { return config.getDouble("Skills.Fishing.Lure_Modifier", 4.0D); } + public boolean getFishingDropsEnabled() { + return config.getBoolean("Skills.Fishing.Drops_Enabled", true); + } + + public boolean getFishingOverrideTreasures() { + return config.getBoolean("Skills.Fishing.Override_Vanilla_Treasures", true); + } + + public boolean getFishingExtraFish() { + return config.getBoolean("Skills.Fishing.Extra_Fish", true); + } + + public double getFishingLureModifier() { + return config.getDouble("Skills.Fishing.Lure_Modifier", 4.0D); + } /* Mining */ - public Material getDetonatorItem() { return Material.matchMaterial(config.getString("Skills.Mining.Detonator_Name", "FLINT_AND_STEEL")); } - public int getMiningGate() { return config.getInt("Skills.Mining.Ability_Activation_Level_Gate", 10); } + public Material getDetonatorItem() { + return Material.matchMaterial(config.getString("Skills.Mining.Detonator_Name", "FLINT_AND_STEEL")); + } + + public int getMiningGate() { + return config.getInt("Skills.Mining.Ability_Activation_Level_Gate", 10); + } /* Excavation */ - public int getExcavationGate() { return config.getInt("Skills.Excavation.Ability_Activation_Level_Gate", 10); } + public int getExcavationGate() { + return config.getInt("Skills.Excavation.Ability_Activation_Level_Gate", 10); + } /* Repair */ - public boolean getRepairAnvilMessagesEnabled() { return config.getBoolean("Skills.Repair.Anvil_Messages", true); } - public boolean getRepairAnvilPlaceSoundsEnabled() { return config.getBoolean("Skills.Repair.Anvil_Placed_Sounds", true); } - public boolean getRepairAnvilUseSoundsEnabled() { return config.getBoolean("Skills.Repair.Anvil_Use_Sounds", true); } - public Material getRepairAnvilMaterial() { return Material.matchMaterial(config.getString("Skills.Repair.Anvil_Material", "IRON_BLOCK")); } - public boolean getRepairConfirmRequired() { return config.getBoolean("Skills.Repair.Confirm_Required", true); } + public boolean getRepairAnvilMessagesEnabled() { + return config.getBoolean("Skills.Repair.Anvil_Messages", true); + } + + public boolean getRepairAnvilPlaceSoundsEnabled() { + return config.getBoolean("Skills.Repair.Anvil_Placed_Sounds", true); + } + + public boolean getRepairAnvilUseSoundsEnabled() { + return config.getBoolean("Skills.Repair.Anvil_Use_Sounds", true); + } + + public Material getRepairAnvilMaterial() { + return Material.matchMaterial(config.getString("Skills.Repair.Anvil_Material", "IRON_BLOCK")); + } + + public boolean getRepairConfirmRequired() { + return config.getBoolean("Skills.Repair.Confirm_Required", true); + } /* Salvage */ - public boolean getSalvageAnvilMessagesEnabled() { return config.getBoolean("Skills.Salvage.Anvil_Messages", true); } - public boolean getSalvageAnvilPlaceSoundsEnabled() { return config.getBoolean("Skills.Salvage.Anvil_Placed_Sounds", true); } - public boolean getSalvageAnvilUseSoundsEnabled() { return config.getBoolean("Skills.Salvage.Anvil_Use_Sounds", true); } - public Material getSalvageAnvilMaterial() { return Material.matchMaterial(config.getString("Skills.Salvage.Anvil_Material", "GOLD_BLOCK")); } - public boolean getSalvageConfirmRequired() { return config.getBoolean("Skills.Salvage.Confirm_Required", true); } + public boolean getSalvageAnvilMessagesEnabled() { + return config.getBoolean("Skills.Salvage.Anvil_Messages", true); + } + + public boolean getSalvageAnvilPlaceSoundsEnabled() { + return config.getBoolean("Skills.Salvage.Anvil_Placed_Sounds", true); + } + + public boolean getSalvageAnvilUseSoundsEnabled() { + return config.getBoolean("Skills.Salvage.Anvil_Use_Sounds", true); + } + + public Material getSalvageAnvilMaterial() { + return Material.matchMaterial(config.getString("Skills.Salvage.Anvil_Material", "GOLD_BLOCK")); + } + + public boolean getSalvageConfirmRequired() { + return config.getBoolean("Skills.Salvage.Confirm_Required", true); + } /* Unarmed */ - public boolean getUnarmedBlockCrackerSmoothbrickToCracked() { return config.getBoolean("Skills.Unarmed.Block_Cracker.SmoothBrick_To_CrackedBrick", true); } - public boolean getUnarmedItemPickupDisabled() { return config.getBoolean("Skills.Unarmed.Item_Pickup_Disabled_Full_Inventory", true); } - public boolean getUnarmedItemsAsUnarmed() { return config.getBoolean("Skills.Unarmed.Items_As_Unarmed", false); } - public int getUnarmedGate() { return config.getInt("Skills.Unarmed.Ability_Activation_Level_Gate", 10); } + public boolean getUnarmedBlockCrackerSmoothbrickToCracked() { + return config.getBoolean("Skills.Unarmed.Block_Cracker.SmoothBrick_To_CrackedBrick", true); + } + + public boolean getUnarmedItemPickupDisabled() { + return config.getBoolean("Skills.Unarmed.Item_Pickup_Disabled_Full_Inventory", true); + } + + public boolean getUnarmedItemsAsUnarmed() { + return config.getBoolean("Skills.Unarmed.Items_As_Unarmed", false); + } + + public int getUnarmedGate() { + return config.getInt("Skills.Unarmed.Ability_Activation_Level_Gate", 10); + } /* Swords */ - public int getSwordsGate() { return config.getInt("Skills.Swords.Ability_Activation_Level_Gate", 10); } + public int getSwordsGate() { + return config.getInt("Skills.Swords.Ability_Activation_Level_Gate", 10); + } /* Taming */ - public Material getTamingCOTWMaterial(EntityType type) { return Material.matchMaterial(config.getString("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Material")); } - public int getTamingCOTWCost(EntityType type) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Amount"); } - public int getTamingCOTWAmount(EntityType type) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Summon_Amount"); } - public int getTamingCOTWLength(EntityType type) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type)+ ".Summon_Length"); } - public int getTamingCOTWMaxAmount(EntityType type) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type)+ ".Summon_Max_Amount"); } - public double getTamingCOTWRange() { return config.getDouble("Skills.Taming.Call_Of_The_Wild.Range", 40.0D); } + public Material getTamingCOTWMaterial(EntityType type) { + return Material.matchMaterial(config.getString("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Material")); + } + + public int getTamingCOTWCost(EntityType type) { + return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Amount"); + } + + public int getTamingCOTWAmount(EntityType type) { + return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Summon_Amount"); + } + + public int getTamingCOTWLength(EntityType type) { + return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Summon_Length"); + } + + public int getTamingCOTWMaxAmount(EntityType type) { + return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Summon_Max_Amount"); + } + + public double getTamingCOTWRange() { + return config.getDouble("Skills.Taming.Call_Of_The_Wild.Range", 40.0D); + } /* Woodcutting */ - public boolean getWoodcuttingDoubleDropsEnabled(BlockData material) { return config.getBoolean("Double_Drops.Woodcutting." + StringUtils.getFriendlyConfigBlockDataString(material)); } - public boolean getTreeFellerSoundsEnabled() { return config.getBoolean("Skills.Woodcutting.Tree_Feller_Sounds", true); } - public int getWoodcuttingGate() { return config.getInt("Skills.Woodcutting.Ability_Activation_Level_Gate", 10); } + public boolean getWoodcuttingDoubleDropsEnabled(BlockData material) { + return config.getBoolean("Double_Drops.Woodcutting." + StringUtils.getFriendlyConfigBlockDataString(material)); + } + + public boolean getTreeFellerSoundsEnabled() { + return config.getBoolean("Skills.Woodcutting.Tree_Feller_Sounds", true); + } + + public int getWoodcuttingGate() { + return config.getInt("Skills.Woodcutting.Ability_Activation_Level_Gate", 10); + } /* AFK Leveling */ - public boolean getAcrobaticsPreventAFK() { return config.getBoolean("Skills.Acrobatics.Prevent_AFK_Leveling", true); } - public int getAcrobaticsAFKMaxTries() { return config.getInt("Skills.Acrobatics.Max_Tries_At_Same_Location", 3); } - public boolean getHerbalismPreventAFK() { return config.getBoolean("Skills.Herbalism.Prevent_AFK_Leveling", true); } + public boolean getAcrobaticsPreventAFK() { + return config.getBoolean("Skills.Acrobatics.Prevent_AFK_Leveling", true); + } + + public int getAcrobaticsAFKMaxTries() { + return config.getInt("Skills.Acrobatics.Max_Tries_At_Same_Location", 3); + } + + public boolean getHerbalismPreventAFK() { + return config.getBoolean("Skills.Herbalism.Prevent_AFK_Leveling", true); + } /* Level Caps */ public int getPowerLevelCap() { @@ -565,11 +1018,18 @@ public class Config extends AutoUpdateConfigLoader { return config.getInt("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Ability_Activation_Level_Gate"); }*/ - public boolean getTruncateSkills() { return config.getBoolean("General.TruncateSkills", false); } + public boolean getTruncateSkills() { + return config.getBoolean("General.TruncateSkills", false); + } /* PVP & PVE Settings */ - public boolean getPVPEnabled(PrimarySkillType skill) { return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVP", true); } - public boolean getPVEEnabled(PrimarySkillType skill) { return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVE", true); } - + public boolean getPVPEnabled(PrimarySkillType skill) { + return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVP", true); + } + + public boolean getPVEEnabled(PrimarySkillType skill) { + return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVE", true); + } + //public float getMasterVolume() { return (float) config.getDouble("Sounds.MasterVolume", 1.0); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/ConfigLoader.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/ConfigLoader.java index d98cd94bd..56196ab17 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/ConfigLoader.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/ConfigLoader.java @@ -10,8 +10,8 @@ import java.util.List; public abstract class ConfigLoader { protected static final mcMMO plugin = mcMMO.p; protected String fileName; - private File configFile; protected FileConfiguration config; + private File configFile; public ConfigLoader(String relativePath, String fileName) { this.fileName = fileName; @@ -31,12 +31,10 @@ public abstract class ConfigLoader { try { plugin.saveResource(fileName, false); // Normal files - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { plugin.saveResource(configFile.getParentFile().getName() + File.separator + fileName, false); // Mod files } - } - else { + } else { plugin.debug("Loading mcMMO " + fileName + " File..."); } @@ -60,8 +58,7 @@ public abstract class ConfigLoader { protected void validate() { if (validateKeys()) { plugin.debug("No errors found in " + fileName + "!"); - } - else { + } else { plugin.getLogger().warning("Errors were found in " + fileName + "! mcMMO was disabled!"); plugin.getServer().getPluginManager().disablePlugin(plugin); plugin.noErrorsInConfigFiles = false; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/CoreSkillsConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/CoreSkillsConfig.java index 4f7fcb753..7283bc759 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/CoreSkillsConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/CoreSkillsConfig.java @@ -7,25 +7,23 @@ import com.gmail.nossr50.util.StringUtils; public class CoreSkillsConfig extends AutoUpdateConfigLoader { private static CoreSkillsConfig instance; - public CoreSkillsConfig() - { + public CoreSkillsConfig() { super("coreskills.yml"); validate(); } + public static CoreSkillsConfig getInstance() { + if (instance == null) + return new CoreSkillsConfig(); + + return instance; + } + @Override protected void loadKeys() { } - public static CoreSkillsConfig getInstance() - { - if(instance == null) - return new CoreSkillsConfig(); - - return instance; - } - @Override protected boolean validateKeys() { @@ -39,21 +37,21 @@ public class CoreSkillsConfig extends AutoUpdateConfigLoader { /** * Whether or not a skill is enabled * Defaults true + * * @param abstractSubSkill SubSkill definition to check * @return true if subskill is enabled */ - public boolean isSkillEnabled(AbstractSubSkill abstractSubSkill) - { - return config.getBoolean(StringUtils.getCapitalized(abstractSubSkill.getPrimarySkill().toString())+"."+ abstractSubSkill.getConfigKeyName()+".Enabled", true); + public boolean isSkillEnabled(AbstractSubSkill abstractSubSkill) { + return config.getBoolean(StringUtils.getCapitalized(abstractSubSkill.getPrimarySkill().toString()) + "." + abstractSubSkill.getConfigKeyName() + ".Enabled", true); } /** * Whether or not this primary skill is enabled + * * @param primarySkillType target primary skill * @return true if enabled */ - public boolean isPrimarySkillEnabled(PrimarySkillType primarySkillType) - { - return config.getBoolean(StringUtils.getCapitalized(primarySkillType.toString())+".Enabled", true); + public boolean isPrimarySkillEnabled(PrimarySkillType primarySkillType) { + return config.getBoolean(StringUtils.getCapitalized(primarySkillType.toString()) + ".Enabled", true); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/RankConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/RankConfig.java index 0f169b27d..3bb05e439 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/RankConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/RankConfig.java @@ -9,26 +9,24 @@ import java.util.List; public class RankConfig extends AutoUpdateConfigLoader { private static RankConfig instance; - public RankConfig() - { + public RankConfig() { super("skillranks.yml"); validate(); this.instance = this; } - @Override - protected void loadKeys() { - - } - - public static RankConfig getInstance() - { - if(instance == null) + public static RankConfig getInstance() { + if (instance == null) return new RankConfig(); return instance; } + @Override + protected void loadKeys() { + + } + @Override protected boolean validateKeys() { List reason = new ArrayList(); @@ -43,12 +41,12 @@ public class RankConfig extends AutoUpdateConfigLoader { /** * Returns the unlock level for a subskill depending on the gamemode + * * @param subSkillType target subskill - * @param rank the rank we are checking + * @param rank the rank we are checking * @return the level requirement for a subskill at this particular rank */ - public int getSubSkillUnlockLevel(SubSkillType subSkillType, int rank) - { + public int getSubSkillUnlockLevel(SubSkillType subSkillType, int rank) { String key = subSkillType.getRankConfigAddress(); return findRankByRootAddress(rank, key); @@ -56,20 +54,21 @@ public class RankConfig extends AutoUpdateConfigLoader { /** * Returns the unlock level for a subskill depending on the gamemode + * * @param abstractSubSkill target subskill - * @param rank the rank we are checking + * @param rank the rank we are checking * @return the level requirement for a subskill at this particular rank */ - public int getSubSkillUnlockLevel(AbstractSubSkill abstractSubSkill, int rank) - { - String key = abstractSubSkill.getPrimaryKeyName()+"."+abstractSubSkill.getConfigKeyName(); + public int getSubSkillUnlockLevel(AbstractSubSkill abstractSubSkill, int rank) { + String key = abstractSubSkill.getPrimaryKeyName() + "." + abstractSubSkill.getConfigKeyName(); return findRankByRootAddress(rank, key); } /** * Returns the unlock level for a subskill depending on the gamemode - * @param key root address of the subskill in the rankskills.yml file + * + * @param key root address of the subskill in the rankskills.yml file * @param rank the rank we are checking * @return the level requirement for a subskill at this particular rank */ @@ -87,32 +86,27 @@ public class RankConfig extends AutoUpdateConfigLoader { /** * Checks for valid keys for subskill ranks */ - private void checkKeys(List reasons) - { + private void checkKeys(List reasons) { //For now we will only check ranks of stuff I've overhauled - for(SubSkillType subSkillType : SubSkillType.values()) - { + for (SubSkillType subSkillType : SubSkillType.values()) { //Keeping track of the rank requirements and making sure there are no logical errors int curRank = 0; int prevRank = 0; - for(int x = 0; x < subSkillType.getNumRanks(); x++) - { - if(curRank > 0) + for (int x = 0; x < subSkillType.getNumRanks(); x++) { + if (curRank > 0) prevRank = curRank; curRank = getSubSkillUnlockLevel(subSkillType, x); //Do we really care if its below 0? Probably not - if(curRank < 0) - { - reasons.add(subSkillType.getAdvConfigAddress() + ".Rank_Levels.Rank_"+curRank+".LevelReq should be above or equal to 0!"); + if (curRank < 0) { + reasons.add(subSkillType.getAdvConfigAddress() + ".Rank_Levels.Rank_" + curRank + ".LevelReq should be above or equal to 0!"); } - if(prevRank > curRank) - { + if (prevRank > curRank) { //We're going to allow this but we're going to warn them - plugin.getLogger().info("You have the ranks for the subskill "+ subSkillType.toString()+" set up poorly, sequential ranks should have ascending requirements"); + plugin.getLogger().info("You have the ranks for the subskill " + subSkillType.toString() + " set up poorly, sequential ranks should have ascending requirements"); } } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/SoundConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/SoundConfig.java index 05604f686..ec771303a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/SoundConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/SoundConfig.java @@ -5,42 +5,36 @@ import com.gmail.nossr50.util.sounds.SoundType; public class SoundConfig extends AutoUpdateConfigLoader { private static SoundConfig instance; - public SoundConfig() - { + public SoundConfig() { super("sounds.yml"); validate(); this.instance = this; } + public static SoundConfig getInstance() { + if (instance == null) + return new SoundConfig(); + + return instance; + } + @Override protected void loadKeys() { } - public static SoundConfig getInstance() - { - if(instance == null) - return new SoundConfig(); - - return instance; - } - @Override protected boolean validateKeys() { - for(SoundType soundType : SoundType.values()) - { - if(config.getDouble("Sounds."+soundType.toString()+".Volume") < 0) - { - plugin.getLogger().info("[mcMMO] Sound volume cannot be below 0 for "+soundType.toString()); + for (SoundType soundType : SoundType.values()) { + if (config.getDouble("Sounds." + soundType.toString() + ".Volume") < 0) { + plugin.getLogger().info("[mcMMO] Sound volume cannot be below 0 for " + soundType.toString()); return false; } //Sounds with custom pitching don't use pitch values - if(!soundType.usesCustomPitch()) - { - if(config.getDouble("Sounds."+soundType.toString()+".Pitch") < 0) - { - plugin.getLogger().info("[mcMMO] Sound pitch cannot be below 0 for "+soundType.toString()); + if (!soundType.usesCustomPitch()) { + if (config.getDouble("Sounds." + soundType.toString() + ".Pitch") < 0) { + plugin.getLogger().info("[mcMMO] Sound pitch cannot be below 0 for " + soundType.toString()); return false; } } @@ -48,23 +42,22 @@ public class SoundConfig extends AutoUpdateConfigLoader { return true; } - public float getMasterVolume() { return (float) config.getDouble("Sounds.MasterVolume", 1.0); } + public float getMasterVolume() { + return (float) config.getDouble("Sounds.MasterVolume", 1.0); + } - public float getVolume(SoundType soundType) - { - String key = "Sounds."+soundType.toString()+".Volume"; + public float getVolume(SoundType soundType) { + String key = "Sounds." + soundType.toString() + ".Volume"; return (float) config.getDouble(key); } - public float getPitch(SoundType soundType) - { - String key = "Sounds."+soundType.toString()+".Pitch"; + public float getPitch(SoundType soundType) { + String key = "Sounds." + soundType.toString() + ".Pitch"; return (float) config.getDouble(key); } - public boolean getIsEnabled(SoundType soundType) - { - String key = "Sounds."+soundType.toString()+".Enabled"; + public boolean getIsEnabled(SoundType soundType) { + String key = "Sounds." + soundType.toString() + ".Enabled"; return config.getBoolean(key, true); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/WorldBlacklist.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/WorldBlacklist.java index f7364e96a..b1c449221 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/WorldBlacklist.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/WorldBlacklist.java @@ -11,24 +11,31 @@ import java.util.ArrayList; */ public class WorldBlacklist { private static ArrayList blacklist; + private final String blackListFileName = "world_blacklist.txt"; private mcMMO plugin; - private final String blackListFileName = "world_blacklist.txt"; - - public WorldBlacklist(mcMMO plugin) - { + public WorldBlacklist(mcMMO plugin) { this.plugin = plugin; blacklist = new ArrayList<>(); init(); } - public void init() - { + public static boolean isWorldBlacklisted(World world) { + + for (String s : blacklist) { + if (world.getName().equalsIgnoreCase(s)) + return true; + } + + return false; + } + + public void init() { //Make the blacklist file if it doesn't exist File blackListFile = new File(plugin.getDataFolder() + File.separator + blackListFileName); try { - if(!blackListFile.exists()) + if (!blackListFile.exists()) blackListFile.createNewFile(); } catch (IOException e) { e.printStackTrace(); @@ -46,12 +53,11 @@ public class WorldBlacklist { String currentLine; - while((currentLine = bufferedReader.readLine()) != null) - { - if(currentLine.length() == 0) + while ((currentLine = bufferedReader.readLine()) != null) { + if (currentLine.length() == 0) continue; - if(!blacklist.contains(currentLine)) + if (!blacklist.contains(currentLine)) blacklist.add(currentLine); } @@ -60,23 +66,10 @@ public class WorldBlacklist { fileReader.close(); } catch (FileNotFoundException e) { e.printStackTrace(); - } catch (IOException e) - { + } catch (IOException e) { e.printStackTrace(); } - plugin.getLogger().info(blacklist.size()+" entries in mcMMO World Blacklist"); - } - - public static boolean isWorldBlacklisted(World world) - { - - for(String s : blacklist) - { - if(world.getName().equalsIgnoreCase(s)) - return true; - } - - return false; + plugin.getLogger().info(blacklist.size() + " entries in mcMMO World Blacklist"); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java index 1bdf70c9c..4703ecb2e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java @@ -94,8 +94,7 @@ public class PotionConfig extends ConfigLoader { if (potion != null) { potionMap.put(potionName, potion); pass++; - } - else { + } else { fail++; } } @@ -108,18 +107,17 @@ public class PotionConfig extends ConfigLoader { * Returns null if input cannot be parsed. * * @param potion_section ConfigurationSection to be parsed. - * * @return Parsed AlchemyPotion. */ private AlchemyPotion loadPotion(ConfigurationSection potion_section) { try { - + String name = potion_section.getString("Name"); if (name != null) { name = ChatColor.translateAlternateColorCodes('&', name); } - + PotionData data; if (!potion_section.contains("PotionData")) { // Backwards config compatability short dataValue = Short.parseShort(potion_section.getName()); @@ -129,7 +127,7 @@ public class PotionConfig extends ConfigLoader { ConfigurationSection potionData = potion_section.getConfigurationSection("PotionData"); data = new PotionData(PotionType.valueOf(potionData.getString("PotionType", "WATER")), potionData.getBoolean("Extended", false), potionData.getBoolean("Upgraded", false)); } - + Material material = Material.POTION; String mat = potion_section.getString("Material", null); if (mat != null) { @@ -154,18 +152,16 @@ public class PotionConfig extends ConfigLoader { if (type != null) { effects.add(new PotionEffect(type, duration, amplifier)); - } - else { + } else { mcMMO.p.getLogger().warning("Failed to parse effect for potion " + name + ": " + effect); } } } - + Color color = null; if (potion_section.contains("Color")) { color = Color.fromRGB(potion_section.getInt("Color")); - } - else { + } else { color = this.generateColor(effects); } @@ -175,16 +171,14 @@ public class PotionConfig extends ConfigLoader { ItemStack ingredient = loadIngredient(child); if (ingredient != null) { children.put(ingredient, potion_section.getConfigurationSection("Children").getString(child)); - } - else { + } else { mcMMO.p.getLogger().warning("Failed to parse child for potion " + name + ": " + child); } } } return new AlchemyPotion(material, data, name, lore, effects, color, children); - } - catch (Exception e) { + } catch (Exception e) { mcMMO.p.getLogger().warning("Failed to load Alchemy potion: " + potion_section.getName()); return null; } @@ -196,7 +190,6 @@ public class PotionConfig extends ConfigLoader { * Returns null if input cannot be parsed. * * @param ingredient String representing an ingredient. - * * @return Parsed ingredient. */ private ItemStack loadIngredient(String ingredient) { @@ -242,7 +235,7 @@ public class PotionConfig extends ConfigLoader { public AlchemyPotion getPotion(String name) { return potionMap.get(name); } - + public AlchemyPotion getPotion(ItemStack item) { for (AlchemyPotion potion : potionMap.values()) { if (potion.isSimilar(item)) { @@ -251,7 +244,7 @@ public class PotionConfig extends ConfigLoader { } return null; } - + public Color generateColor(List effects) { if (effects != null && !effects.isEmpty()) { List colors = new ArrayList(); @@ -269,7 +262,7 @@ public class PotionConfig extends ConfigLoader { } return null; } - + public Color calculateAverageColor(List colors) { int red = 0; int green = 0; @@ -279,8 +272,8 @@ public class PotionConfig extends ConfigLoader { green += color.getGreen(); blue += color.getBlue(); } - Color color = Color.fromRGB(red/colors.size(), green/colors.size(), blue/colors.size()); + Color color = Color.fromRGB(red / colors.size(), green / colors.size(), blue / colors.size()); return color; } - + } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java index b676c0ad3..af5d4c18d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java @@ -55,31 +55,23 @@ public class RepairConfig extends ConfigLoader { if (ItemUtils.isWoodTool(repairItem)) { repairMaterialType = MaterialType.WOOD; - } - else if (ItemUtils.isStoneTool(repairItem)) { + } else if (ItemUtils.isStoneTool(repairItem)) { repairMaterialType = MaterialType.STONE; - } - else if (ItemUtils.isStringTool(repairItem)) { + } else if (ItemUtils.isStringTool(repairItem)) { repairMaterialType = MaterialType.STRING; - } - else if (ItemUtils.isLeatherArmor(repairItem)) { + } else if (ItemUtils.isLeatherArmor(repairItem)) { repairMaterialType = MaterialType.LEATHER; - } - else if (ItemUtils.isIronArmor(repairItem) || ItemUtils.isIronTool(repairItem)) { + } else if (ItemUtils.isIronArmor(repairItem) || ItemUtils.isIronTool(repairItem)) { repairMaterialType = MaterialType.IRON; - } - else if (ItemUtils.isGoldArmor(repairItem) || ItemUtils.isGoldTool(repairItem)) { + } else if (ItemUtils.isGoldArmor(repairItem) || ItemUtils.isGoldTool(repairItem)) { repairMaterialType = MaterialType.GOLD; - } - else if (ItemUtils.isDiamondArmor(repairItem) || ItemUtils.isDiamondTool(repairItem)) { + } else if (ItemUtils.isDiamondArmor(repairItem) || ItemUtils.isDiamondTool(repairItem)) { repairMaterialType = MaterialType.DIAMOND; } - } - else { + } else { try { repairMaterialType = MaterialType.valueOf(repairMaterialTypeString); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { reason.add(key + " has an invalid MaterialType of " + repairMaterialTypeString); } } @@ -112,16 +104,13 @@ public class RepairConfig extends ConfigLoader { if (ItemUtils.isMinecraftTool(repairItem)) { repairItemType = ItemType.TOOL; - } - else if (ItemUtils.isArmor(repairItem)) { + } else if (ItemUtils.isArmor(repairItem)) { repairItemType = ItemType.ARMOR; } - } - else { + } else { try { repairItemType = ItemType.valueOf(repairItemTypeString); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { reason.add(key + " has an invalid ItemType of " + repairItemTypeString); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java index 76c540838..30a3e7a58 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java @@ -50,31 +50,23 @@ public class SalvageConfig extends ConfigLoader { if (ItemUtils.isWoodTool(salvageItem)) { salvageMaterialType = MaterialType.WOOD; - } - else if (ItemUtils.isStoneTool(salvageItem)) { + } else if (ItemUtils.isStoneTool(salvageItem)) { salvageMaterialType = MaterialType.STONE; - } - else if (ItemUtils.isStringTool(salvageItem)) { + } else if (ItemUtils.isStringTool(salvageItem)) { salvageMaterialType = MaterialType.STRING; - } - else if (ItemUtils.isLeatherArmor(salvageItem)) { + } else if (ItemUtils.isLeatherArmor(salvageItem)) { salvageMaterialType = MaterialType.LEATHER; - } - else if (ItemUtils.isIronArmor(salvageItem) || ItemUtils.isIronTool(salvageItem)) { + } else if (ItemUtils.isIronArmor(salvageItem) || ItemUtils.isIronTool(salvageItem)) { salvageMaterialType = MaterialType.IRON; - } - else if (ItemUtils.isGoldArmor(salvageItem) || ItemUtils.isGoldTool(salvageItem)) { + } else if (ItemUtils.isGoldArmor(salvageItem) || ItemUtils.isGoldTool(salvageItem)) { salvageMaterialType = MaterialType.GOLD; - } - else if (ItemUtils.isDiamondArmor(salvageItem) || ItemUtils.isDiamondTool(salvageItem)) { + } else if (ItemUtils.isDiamondArmor(salvageItem) || ItemUtils.isDiamondTool(salvageItem)) { salvageMaterialType = MaterialType.DIAMOND; } - } - else { + } else { try { salvageMaterialType = MaterialType.valueOf(salvageMaterialTypeString.replace(" ", "_").toUpperCase()); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { reason.add(key + " has an invalid MaterialType of " + salvageMaterialTypeString); } } @@ -99,16 +91,13 @@ public class SalvageConfig extends ConfigLoader { if (ItemUtils.isMinecraftTool(salvageItem)) { salvageItemType = ItemType.TOOL; - } - else if (ItemUtils.isArmor(salvageItem)) { + } else if (ItemUtils.isArmor(salvageItem)) { salvageItemType = ItemType.ARMOR; } - } - else { + } else { try { salvageItemType = ItemType.valueOf(salvageItemTypeString.replace(" ", "_").toUpperCase()); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { reason.add(key + " has an invalid ItemType of " + salvageItemTypeString); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java index a645ffb50..aec76a097 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java @@ -25,10 +25,10 @@ public class TreasureConfig extends ConfigLoader { public HashMap> excavationMap = new HashMap>(); - public HashMap> shakeMap = new HashMap>(); - public HashMap> hylianMap = new HashMap>(); + public HashMap> shakeMap = new HashMap>(); + public HashMap> hylianMap = new HashMap>(); - public HashMap> fishingRewards = new HashMap>(); + public HashMap> fishingRewards = new HashMap>(); public HashMap> fishingEnchantments = new HashMap>(); private TreasureConfig() { diff --git a/core/src/main/java/com/gmail/nossr50/core/data/UserManager.java b/core/src/main/java/com/gmail/nossr50/core/data/UserManager.java index 0768f4829..62f36fbe2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/UserManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/UserManager.java @@ -13,7 +13,8 @@ import java.util.Collection; public final class UserManager { - private UserManager() {} + private UserManager() { + } /** * Track a new user. @@ -50,12 +51,9 @@ public final class UserManager { mcMMO.p.debug("Saving mcMMOPlayers... (" + onlinePlayers.size() + ")"); for (Player player : onlinePlayers) { - try - { + try { getPlayer(player).getProfile().save(); - } - catch (Exception e) - { + } catch (Exception e) { mcMMO.p.getLogger().warning("Could not save mcMMO player data for player: " + player.getName()); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManager.java index 35deedab1..5b6fab200 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManager.java @@ -7,9 +7,9 @@ public interface ChunkletManager { /** * Loads a specific chunklet * - * @param cx Chunklet X coordinate that needs to be loaded - * @param cy Chunklet Y coordinate that needs to be loaded - * @param cz Chunklet Z coordinate that needs to be loaded + * @param cx Chunklet X coordinate that needs to be loaded + * @param cy Chunklet Y coordinate that needs to be loaded + * @param cz Chunklet Z coordinate that needs to be loaded * @param world World that the chunklet needs to be loaded in */ public void loadChunklet(int cx, int cy, int cz, World world); @@ -17,9 +17,9 @@ public interface ChunkletManager { /** * Unload a specific chunklet * - * @param cx Chunklet X coordinate that needs to be unloaded - * @param cy Chunklet Y coordinate that needs to be unloaded - * @param cz Chunklet Z coordinate that needs to be unloaded + * @param cx Chunklet X coordinate that needs to be unloaded + * @param cy Chunklet Y coordinate that needs to be unloaded + * @param cz Chunklet Z coordinate that needs to be unloaded * @param world World that the chunklet needs to be unloaded from */ public void unloadChunklet(int cx, int cy, int cz, World world); @@ -27,8 +27,8 @@ public interface ChunkletManager { /** * Load a given Chunk's Chunklet data * - * @param cx Chunk X coordinate that is to be loaded - * @param cz Chunk Z coordinate that is to be loaded + * @param cx Chunk X coordinate that is to be loaded + * @param cz Chunk Z coordinate that is to be loaded * @param world World that the Chunk is in */ public void loadChunk(int cx, int cz, World world); @@ -36,8 +36,8 @@ public interface ChunkletManager { /** * Unload a given Chunk's Chunklet data * - * @param cx Chunk X coordinate that is to be unloaded - * @param cz Chunk Z coordinate that is to be unloaded + * @param cx Chunk X coordinate that is to be unloaded + * @param cz Chunk Z coordinate that is to be unloaded * @param world World that the Chunk is in */ public void unloadChunk(int cx, int cz, World world); @@ -45,8 +45,8 @@ public interface ChunkletManager { /** * Informs the ChunkletManager a chunk is loaded * - * @param cx Chunk X coordinate that is loaded - * @param cz Chunk Z coordinate that is loaded + * @param cx Chunk X coordinate that is loaded + * @param cz Chunk Z coordinate that is loaded * @param world World that the chunk was loaded in */ public void chunkLoaded(int cx, int cz, World world); @@ -54,8 +54,8 @@ public interface ChunkletManager { /** * Informs the ChunkletManager a chunk is unloaded * - * @param cx Chunk X coordinate that is unloaded - * @param cz Chunk Z coordinate that is unloaded + * @param cx Chunk X coordinate that is unloaded + * @param cz Chunk Z coordinate that is unloaded * @param world World that the chunk was unloaded in */ public void chunkUnloaded(int cx, int cz, World world); @@ -94,9 +94,9 @@ public interface ChunkletManager { /** * Check to see if a given location is set to true * - * @param x X coordinate to check - * @param y Y coordinate to check - * @param z Z coordinate to check + * @param x X coordinate to check + * @param y Y coordinate to check + * @param z Z coordinate to check * @param world World to check in * @return true if the given location is set to true, false if otherwise */ @@ -113,9 +113,9 @@ public interface ChunkletManager { /** * Set a given location to true, should create stores as necessary if the location does not exist * - * @param x X coordinate to set - * @param y Y coordinate to set - * @param z Z coordinate to set + * @param x X coordinate to set + * @param y Y coordinate to set + * @param z Z coordinate to set * @param world World to set in */ public void setTrue(int x, int y, int z, World world); @@ -130,9 +130,9 @@ public interface ChunkletManager { /** * Set a given location to false, should not create stores if one does not exist for the given location * - * @param x X coordinate to set - * @param y Y coordinate to set - * @param z Z coordinate to set + * @param x X coordinate to set + * @param y Y coordinate to set + * @param z Z coordinate to set * @param world World to set in */ public void setFalse(int x, int y, int z, World world); diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/HashChunkletManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/HashChunkletManager.java index ace73a8a3..e80edc8d0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/HashChunkletManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/HashChunkletManager.java @@ -295,7 +295,7 @@ public class HashChunkletManager implements ChunkletManager { } /** - * @param cStore ChunkletStore to save + * @param cStore ChunkletStore to save * @param location Where on the disk to put it */ private void serializeChunkletStore(ChunkletStore cStore, File location) { @@ -309,17 +309,14 @@ public class HashChunkletManager implements ChunkletManager { fileOut = new FileOutputStream(location); objOut = new ObjectOutputStream(fileOut); objOut.writeObject(cStore); - } - catch (IOException ex) { + } catch (IOException ex) { ex.printStackTrace(); - } - finally { + } finally { if (objOut != null) { try { objOut.flush(); objOut.close(); - } - catch (IOException ex) { + } catch (IOException ex) { ex.printStackTrace(); } } @@ -327,8 +324,7 @@ public class HashChunkletManager implements ChunkletManager { if (fileOut != null) { try { fileOut.close(); - } - catch (IOException ex) { + } catch (IOException ex) { ex.printStackTrace(); } } @@ -348,35 +344,29 @@ public class HashChunkletManager implements ChunkletManager { fileIn = new FileInputStream(location); objIn = new ObjectInputStream(fileIn); storeIn = (ChunkletStore) objIn.readObject(); - } - catch (IOException ex) { + } catch (IOException ex) { if (ex instanceof EOFException) { // EOF should only happen on Chunklets that somehow have been corrupted. //mcMMO.p.getLogger().severe("Chunklet data at " + location.toString() + " could not be read due to an EOFException, data in this area will be lost."); return ChunkletStoreFactory.getChunkletStore(); - } - else if (ex instanceof StreamCorruptedException) { + } else if (ex instanceof StreamCorruptedException) { // StreamCorrupted happens when the Chunklet is no good. //mcMMO.p.getLogger().severe("Chunklet data at " + location.toString() + " is corrupted, data in this area will be lost."); return ChunkletStoreFactory.getChunkletStore(); - } - else if (ex instanceof UTFDataFormatException) { + } else if (ex instanceof UTFDataFormatException) { // UTF happens when the Chunklet cannot be read or is corrupted //mcMMO.p.getLogger().severe("Chunklet data at " + location.toString() + " could not be read due to an UTFDataFormatException, data in this area will be lost."); return ChunkletStoreFactory.getChunkletStore(); } ex.printStackTrace(); - } - catch (ClassNotFoundException ex) { + } catch (ClassNotFoundException ex) { ex.printStackTrace(); - } - finally { + } finally { if (objIn != null) { try { objIn.close(); - } - catch (IOException ex) { + } catch (IOException ex) { ex.printStackTrace(); } } @@ -384,8 +374,7 @@ public class HashChunkletManager implements ChunkletManager { if (fileIn != null) { try { fileIn.close(); - } - catch (IOException ex) { + } catch (IOException ex) { ex.printStackTrace(); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/NullChunkletManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/NullChunkletManager.java index 844dfec6f..643bc6c19 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/NullChunkletManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/NullChunkletManager.java @@ -5,7 +5,7 @@ import org.bukkit.block.Block; /** * A ChunkletManager implementation that does nothing and returns false for all checks. - * + *

* Useful for turning off Chunklets without actually doing much work */ public class NullChunkletManager implements ChunkletManager { diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveChunkletStore.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveChunkletStore.java index 7e896b6b0..8ec8e93b6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveChunkletStore.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveChunkletStore.java @@ -3,7 +3,9 @@ package com.gmail.nossr50.core.data.blockmeta; public class PrimitiveChunkletStore implements ChunkletStore { private static final long serialVersionUID = -3453078050608607478L; - /** X, Z, Y */ + /** + * X, Z, Y + */ public boolean[][][] store = new boolean[16][16][64]; @Override diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveExChunkletStore.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveExChunkletStore.java index 3cf766574..2fd6c0ba8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveExChunkletStore.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveExChunkletStore.java @@ -8,9 +8,42 @@ import java.io.ObjectOutput; public class PrimitiveExChunkletStore implements ChunkletStore, Externalizable { private static final long serialVersionUID = 8603603827094383873L; - /** X, Z, Y */ + /** + * X, Z, Y + */ public boolean[][][] store = new boolean[16][16][64]; + /* + * The address byte: A single byte which contains x and z values which correspond to the x and z Chunklet-coordinates + * + * In Chunklet-coordinates, the only valid values are 0-15, so we can fit both into a single byte. + * + * The top 4 bits of the address byte are for the x value + * The bottom 4 bits of the address byte are for the z value + * + * Examples: + * An address byte with a value 00000001 would be split like so: + * - x = 0000 = 0 + * - z = 0001 = 1 + * => Chunklet coordinates (0, 1) + * + * 01011111 + * - x = 0101 = 5 + * - z = 1111 = 15 + * => Chunklet coordinates (5, 15) + */ + protected static byte makeAddressByte(int x, int z) { + return (byte) ((x << 4) + z); + } + + protected static int addressByteX(byte address) { + return (address & 0xF0) >>> 4; + } + + protected static int addressByteZ(byte address) { + return address & 0x0F; + } + @Override public boolean isTrue(int x, int y, int z) { return store[x][z][y]; @@ -146,35 +179,4 @@ public class PrimitiveExChunkletStore implements ChunkletStore, Externalizable { return column; } - - /* - * The address byte: A single byte which contains x and z values which correspond to the x and z Chunklet-coordinates - * - * In Chunklet-coordinates, the only valid values are 0-15, so we can fit both into a single byte. - * - * The top 4 bits of the address byte are for the x value - * The bottom 4 bits of the address byte are for the z value - * - * Examples: - * An address byte with a value 00000001 would be split like so: - * - x = 0000 = 0 - * - z = 0001 = 1 - * => Chunklet coordinates (0, 1) - * - * 01011111 - * - x = 0101 = 5 - * - z = 1111 = 15 - * => Chunklet coordinates (5, 15) - */ - protected static byte makeAddressByte(int x, int z) { - return (byte) ((x << 4) + z); - } - - protected static int addressByteX(byte address) { - return (address & 0xF0) >>> 4; - } - - protected static int addressByteZ(byte address) { - return address & 0x0F; - } } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManager.java index b48b05c68..fbe6dc900 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManager.java @@ -19,9 +19,9 @@ public interface ChunkManager { /** * Loads a specific chunklet * - * @param cx Chunklet X coordinate that needs to be loaded - * @param cy Chunklet Y coordinate that needs to be loaded - * @param cz Chunklet Z coordinate that needs to be loaded + * @param cx Chunklet X coordinate that needs to be loaded + * @param cy Chunklet Y coordinate that needs to be loaded + * @param cz Chunklet Z coordinate that needs to be loaded * @param world World that the chunklet needs to be loaded in */ public void loadChunklet(int cx, int cy, int cz, World world); @@ -29,9 +29,9 @@ public interface ChunkManager { /** * Unload a specific chunklet * - * @param cx Chunklet X coordinate that needs to be unloaded - * @param cy Chunklet Y coordinate that needs to be unloaded - * @param cz Chunklet Z coordinate that needs to be unloaded + * @param cx Chunklet X coordinate that needs to be unloaded + * @param cy Chunklet Y coordinate that needs to be unloaded + * @param cz Chunklet Z coordinate that needs to be unloaded * @param world World that the chunklet needs to be unloaded from */ public void unloadChunklet(int cx, int cy, int cz, World world); @@ -39,8 +39,8 @@ public interface ChunkManager { /** * Load a given Chunk's Chunklet data * - * @param cx Chunk X coordinate that is to be loaded - * @param cz Chunk Z coordinate that is to be loaded + * @param cx Chunk X coordinate that is to be loaded + * @param cz Chunk Z coordinate that is to be loaded * @param world World that the Chunk is in */ public void loadChunk(int cx, int cz, World world, Entity[] entities); @@ -48,8 +48,8 @@ public interface ChunkManager { /** * Unload a given Chunk's Chunklet data * - * @param cx Chunk X coordinate that is to be unloaded - * @param cz Chunk Z coordinate that is to be unloaded + * @param cx Chunk X coordinate that is to be unloaded + * @param cz Chunk Z coordinate that is to be unloaded * @param world World that the Chunk is in */ public void unloadChunk(int cx, int cz, World world); @@ -57,8 +57,8 @@ public interface ChunkManager { /** * Saves a given Chunk's Chunklet data * - * @param cx Chunk X coordinate that is to be saved - * @param cz Chunk Z coordinate that is to be saved + * @param cx Chunk X coordinate that is to be saved + * @param cz Chunk Z coordinate that is to be saved * @param world World that the Chunk is in */ public void saveChunk(int cx, int cz, World world); @@ -68,8 +68,8 @@ public interface ChunkManager { /** * Informs the ChunkletManager a chunk is loaded * - * @param cx Chunk X coordinate that is loaded - * @param cz Chunk Z coordinate that is loaded + * @param cx Chunk X coordinate that is loaded + * @param cz Chunk Z coordinate that is loaded * @param world World that the chunk was loaded in */ public void chunkLoaded(int cx, int cz, World world); @@ -77,8 +77,8 @@ public interface ChunkManager { /** * Informs the ChunkletManager a chunk is unloaded * - * @param cx Chunk X coordinate that is unloaded - * @param cz Chunk Z coordinate that is unloaded + * @param cx Chunk X coordinate that is unloaded + * @param cz Chunk Z coordinate that is unloaded * @param world World that the chunk was unloaded in */ public void chunkUnloaded(int cx, int cz, World world); @@ -117,9 +117,9 @@ public interface ChunkManager { /** * Check to see if a given location is set to true * - * @param x X coordinate to check - * @param y Y coordinate to check - * @param z Z coordinate to check + * @param x X coordinate to check + * @param y Y coordinate to check + * @param z Z coordinate to check * @param world World to check in * @return true if the given location is set to true, false if otherwise */ @@ -144,9 +144,9 @@ public interface ChunkManager { /** * Set a given location to true, should create stores as necessary if the location does not exist * - * @param x X coordinate to set - * @param y Y coordinate to set - * @param z Z coordinate to set + * @param x X coordinate to set + * @param y Y coordinate to set + * @param z Z coordinate to set * @param world World to set in */ public void setTrue(int x, int y, int z, World world); @@ -168,9 +168,9 @@ public interface ChunkManager { /** * Set a given location to false, should not create stores if one does not exist for the given location * - * @param x X coordinate to set - * @param y Y coordinate to set - * @param z Z coordinate to set + * @param x X coordinate to set + * @param y Y coordinate to set + * @param z Z coordinate to set * @param world World to set in */ public void setFalse(int x, int y, int z, World world); diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/HashChunkManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/HashChunkManager.java index 3fbd3487e..60d971d79 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/HashChunkManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/HashChunkManager.java @@ -11,9 +11,9 @@ import java.io.*; import java.util.*; public class HashChunkManager implements ChunkManager { - private HashMap> regionFiles = new HashMap>(); public HashMap store = new HashMap(); public ArrayList converters = new ArrayList(); + private HashMap> regionFiles = new HashMap>(); private HashMap oldData = new HashMap(); @Override @@ -46,19 +46,16 @@ public class HashChunkManager implements ChunkManager { } throw new RuntimeException("Wrong class type read for chunk meta data for " + x + ", " + z); - } - catch (IOException e) { + } catch (IOException e) { // Assume the format changed return null; //throw new RuntimeException("Unable to process chunk meta data for " + x + ", " + z, e); - } - catch (ClassNotFoundException e) { + } catch (ClassNotFoundException e) { // Assume the format changed //System.out.println("[SpoutPlugin] is Unable to find serialized class for " + x + ", " + z + ", " + e.getMessage()); return null; //throw new RuntimeException("Unable to find serialized class for " + x + ", " + z, e); - } - finally { + } finally { objectStream.close(); } } @@ -75,8 +72,7 @@ public class HashChunkManager implements ChunkManager { objectStream.flush(); objectStream.close(); data.setDirty(false); - } - catch (IOException e) { + } catch (IOException e) { throw new RuntimeException("Unable to write chunk meta data for " + x + ", " + z, e); } } @@ -139,8 +135,7 @@ public class HashChunkManager implements ChunkManager { if (!oldData.containsKey(key)) { oldData.put(key, (new File(world.getWorldFolder(), "mcmmo_data")).exists()); - } - else if (oldData.get(key)) { + } else if (oldData.get(key)) { if (convertChunk(new File(world.getWorldFolder(), "mcmmo_data"), cx, cz, world, true)) { return; } @@ -150,8 +145,9 @@ public class HashChunkManager implements ChunkManager { try { chunkStore = readChunkStore(world, cx, cz); + } catch (Exception e) { + e.printStackTrace(); } - catch (Exception e) { e.printStackTrace(); } if (chunkStore == null) { return; @@ -200,7 +196,8 @@ public class HashChunkManager implements ChunkManager { } @Override - public synchronized void chunkLoaded(int cx, int cz, World world) {} + public synchronized void chunkLoaded(int cx, int cz, World world) { + } @Override public synchronized void chunkUnloaded(int cx, int cz, World world) { @@ -226,8 +223,7 @@ public class HashChunkManager implements ChunkManager { if (worldName.equals(info[0])) { try { saveChunk(Integer.parseInt(info[1]), Integer.parseInt(info[2]), world); - } - catch (Exception e) { + } catch (Exception e) { // Ignore } } @@ -249,8 +245,7 @@ public class HashChunkManager implements ChunkManager { if (worldName.equals(info[0])) { try { unloadChunk(Integer.parseInt(info[1]), Integer.parseInt(info[2]), world); - } - catch (Exception e) { + } catch (Exception e) { // Ignore } } @@ -258,7 +253,8 @@ public class HashChunkManager implements ChunkManager { } @Override - public synchronized void loadWorld(World world) {} + public synchronized void loadWorld(World world) { + } @Override public synchronized void saveAll() { @@ -414,7 +410,8 @@ public class HashChunkManager implements ChunkManager { } @Override - public synchronized void cleanUp() {} + public synchronized void cleanUp() { + } public synchronized void convertChunk(File dataDir, int cx, int cz, World world) { convertChunk(dataDir, cx, cz, world, false); diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/McMMOSimpleRegionFile.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/McMMOSimpleRegionFile.java index 96107af81..53bf0d93d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/McMMOSimpleRegionFile.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/McMMOSimpleRegionFile.java @@ -25,21 +25,21 @@ import java.util.zip.DeflaterOutputStream; import java.util.zip.InflaterInputStream; public class McMMOSimpleRegionFile { - private RandomAccessFile file; + @SuppressWarnings("unused") + private static long TIMEOUT_TIME = 300000; // 5 min private final int[] dataStart = new int[1024]; private final int[] dataActualLength = new int[1024]; private final int[] dataLength = new int[1024]; private final ArrayList inuse = new ArrayList(); - private int segmentSize; - private int segmentMask; private final int rx; private final int rz; private final int defaultSegmentSize; private final File parent; + private RandomAccessFile file; + private int segmentSize; + private int segmentMask; @SuppressWarnings("unused") private long lastAccessTime = System.currentTimeMillis(); - @SuppressWarnings("unused") - private static long TIMEOUT_TIME = 300000; // 5 min public McMMOSimpleRegionFile(File f, int rx, int rz) { this(f, rx, rz, 10); @@ -91,8 +91,7 @@ public class McMMOSimpleRegionFile { } extendFile(); - } - catch (IOException fnfe) { + } catch (IOException fnfe) { throw new RuntimeException(fnfe); } } @@ -139,8 +138,7 @@ public class McMMOSimpleRegionFile { } extendFile(); - } - catch (IOException fnfe) { + } catch (IOException fnfe) { throw new RuntimeException(fnfe); } } @@ -197,8 +195,7 @@ public class McMMOSimpleRegionFile { } file = null; - } - catch (IOException ioe) { + } catch (IOException ioe) { throw new RuntimeException("Unable to close file", ioe); } } @@ -261,8 +258,7 @@ public class McMMOSimpleRegionFile { if (inuse.get(end)) { end++; start = end; - } - else { + } else { end++; } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/NullChunkManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/NullChunkManager.java index a83a98b33..2ea6c9d10 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/NullChunkManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/NullChunkManager.java @@ -10,7 +10,8 @@ import java.io.IOException; public class NullChunkManager implements ChunkManager { @Override - public void closeAll() {} + public void closeAll() { + } @Override public ChunkStore readChunkStore(World world, int x, int z) throws IOException { @@ -18,25 +19,32 @@ public class NullChunkManager implements ChunkManager { } @Override - public void writeChunkStore(World world, int x, int z, ChunkStore data) {} + public void writeChunkStore(World world, int x, int z, ChunkStore data) { + } @Override - public void closeChunkStore(World world, int x, int z) {} + public void closeChunkStore(World world, int x, int z) { + } @Override - public void loadChunklet(int cx, int cy, int cz, World world) {} + public void loadChunklet(int cx, int cy, int cz, World world) { + } @Override - public void unloadChunklet(int cx, int cy, int cz, World world) {} + public void unloadChunklet(int cx, int cy, int cz, World world) { + } @Override - public void loadChunk(int cx, int cz, World world, Entity[] entities) {} + public void loadChunk(int cx, int cz, World world, Entity[] entities) { + } @Override - public void unloadChunk(int cx, int cz, World world) {} + public void unloadChunk(int cx, int cz, World world) { + } @Override - public void saveChunk(int cx, int cz, World world) {} + public void saveChunk(int cx, int cz, World world) { + } @Override public boolean isChunkLoaded(int cx, int cz, World world) { @@ -44,25 +52,32 @@ public class NullChunkManager implements ChunkManager { } @Override - public void chunkLoaded(int cx, int cz, World world) {} + public void chunkLoaded(int cx, int cz, World world) { + } @Override - public void chunkUnloaded(int cx, int cz, World world) {} + public void chunkUnloaded(int cx, int cz, World world) { + } @Override - public void saveWorld(World world) {} + public void saveWorld(World world) { + } @Override - public void unloadWorld(World world) {} + public void unloadWorld(World world) { + } @Override - public void loadWorld(World world) {} + public void loadWorld(World world) { + } @Override - public void saveAll() {} + public void saveAll() { + } @Override - public void unloadAll() {} + public void unloadAll() { + } @Override public boolean isTrue(int x, int y, int z, World world) { @@ -80,23 +95,30 @@ public class NullChunkManager implements ChunkManager { } @Override - public void setTrue(int x, int y, int z, World world) {} + public void setTrue(int x, int y, int z, World world) { + } @Override - public void setTrue(Block block) {} + public void setTrue(Block block) { + } @Override - public void setTrue(BlockState blockState) {} + public void setTrue(BlockState blockState) { + } @Override - public void setFalse(int x, int y, int z, World world) {} + public void setFalse(int x, int y, int z, World world) { + } @Override - public void setFalse(Block block) {} + public void setFalse(Block block) { + } @Override - public void setFalse(BlockState blockState) {} + public void setFalse(BlockState blockState) { + } @Override - public void cleanUp() {} + public void cleanUp() { + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java index 58388c6bf..d0acb78ab 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java @@ -10,11 +10,13 @@ import java.util.UUID; public class PrimitiveChunkStore implements ChunkStore { private static final long serialVersionUID = -1L; - transient private boolean dirty = false; - /** X, Z, Y */ - public boolean[][][] store; private static final int CURRENT_VERSION = 7; private static final int MAGIC_NUMBER = 0xEA5EDEBB; + /** + * X, Z, Y + */ + public boolean[][][] store; + transient private boolean dirty = false; private int cx; private int cz; private UUID worldUid; @@ -137,8 +139,9 @@ public class PrimitiveChunkStore implements ChunkStore { for (int y = 0; y < store[0][0].length; y++) { try { store[x][z][y] = temp[x][y][z]; + } catch (Exception e) { + e.printStackTrace(); } - catch (Exception e) { e.printStackTrace(); } } } } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java index 3d9d1e8f1..433172a51 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java @@ -7,12 +7,12 @@ import org.bukkit.scheduler.BukkitScheduler; import java.io.File; public class BlockStoreConversionMain implements Runnable { - private int taskID, i; - private org.bukkit.World world; BukkitScheduler scheduler; File dataDir; File[] xDirs; BlockStoreConversionXDirectory[] converters; + private int taskID, i; + private org.bukkit.World world; public BlockStoreConversionMain(org.bukkit.World world) { this.taskID = -1; diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionXDirectory.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionXDirectory.java index e262acf49..d20741f5a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionXDirectory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionXDirectory.java @@ -7,12 +7,12 @@ import org.bukkit.scheduler.BukkitScheduler; import java.io.File; public class BlockStoreConversionXDirectory implements Runnable { - private int taskID, i; - private org.bukkit.World world; BukkitScheduler scheduler; File dataDir; File[] zDirs; BlockStoreConversionZDirectory[] converters; + private int taskID, i; + private org.bukkit.World world; public BlockStoreConversionXDirectory() { this.taskID = -1; diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionZDirectory.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionZDirectory.java index 029f33430..af843c23d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionZDirectory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionZDirectory.java @@ -72,8 +72,7 @@ public class BlockStoreConversionZDirectory implements Runnable { try { this.cx = Integer.parseInt(this.cxs); this.cz = Integer.parseInt(this.czs); - } - catch (Exception e) { + } catch (Exception e) { this.dataDir.delete(); stop(); return; @@ -87,8 +86,7 @@ public class BlockStoreConversionZDirectory implements Runnable { if (this.tempChunklet instanceof PrimitiveChunkletStore) { this.primitiveChunklet = (PrimitiveChunkletStore) this.tempChunklet; - } - else if (this.tempChunklet instanceof PrimitiveExChunkletStore) { + } else if (this.tempChunklet instanceof PrimitiveExChunkletStore) { this.primitiveExChunklet = (PrimitiveExChunkletStore) this.tempChunklet; } @@ -115,8 +113,9 @@ public class BlockStoreConversionZDirectory implements Runnable { } this.newManager.setTrue(this.cxPos, this.y2, this.czPos, this.world); + } catch (Exception e) { + e.printStackTrace(); } - catch (Exception e) { e.printStackTrace(); } } } } @@ -136,8 +135,7 @@ public class BlockStoreConversionZDirectory implements Runnable { if (this.primitiveExChunklet != null) { this.oldArray = this.primitiveExChunklet.store[x][z]; - } - else { + } else { return; } @@ -145,8 +143,7 @@ public class BlockStoreConversionZDirectory implements Runnable { if (this.oldArray.length < 64) { return; - } - else if (this.newArray.length < ((this.y * 64) + 64)) { + } else if (this.newArray.length < ((this.y * 64) + 64)) { return; } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java index d8ccae273..69ac60e22 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java @@ -43,13 +43,13 @@ public interface DatabaseManager { public boolean saveUser(PlayerProfile profile); /** - * Retrieve leaderboard info. - * - * @param skill The skill to retrieve info on - * @param pageNumber Which page in the leaderboards to retrieve - * @param statsPerPage The number of stats per page - * @return the requested leaderboard information - */ + * Retrieve leaderboard info. + * + * @param skill The skill to retrieve info on + * @param pageNumber Which page in the leaderboards to retrieve + * @param statsPerPage The number of stats per page + * @return the requested leaderboard information + */ public List readLeaderboard(PrimarySkillType skill, int pageNumber, int statsPerPage); /** @@ -67,20 +67,19 @@ public interface DatabaseManager { * Add a new user to the database. * * @param playerName The name of the player to be added to the database - * @param uuid The uuid of the player to be added to the database + * @param uuid The uuid of the player to be added to the database */ public void newUser(String playerName, UUID uuid); /** * Load a player from the database. * - * @deprecated replaced by {@link #loadPlayerProfile(String playerName, UUID uuid, boolean createNew)} - * * @param playerName The name of the player to load from the database - * @param createNew Whether to create a new record if the player is not - * found + * @param createNew Whether to create a new record if the player is not + * found * @return The player's data, or an unloaded PlayerProfile if not found - * and createNew is false + * and createNew is false + * @deprecated replaced by {@link #loadPlayerProfile(String playerName, UUID uuid, boolean createNew)} */ @Deprecated public PlayerProfile loadPlayerProfile(String playerName, boolean createNew); @@ -97,11 +96,11 @@ public interface DatabaseManager { * Load a player from the database. Attempt to use uuid, fall back on playername * * @param playerName The name of the player to load from the database - * @param uuid The uuid of the player to load from the database - * @param createNew Whether to create a new record if the player is not - * found + * @param uuid The uuid of the player to load from the database + * @param createNew Whether to create a new record if the player is not + * found * @return The player's data, or an unloaded PlayerProfile if not found - * and createNew is false + * and createNew is false */ public PlayerProfile loadPlayerProfile(String playerName, UUID uuid, boolean createNew); diff --git a/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManagerFactory.java b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManagerFactory.java index d1e4bc497..27d8ebd4b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManagerFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManagerFactory.java @@ -11,12 +11,10 @@ public class DatabaseManagerFactory { if (customManager != null) { try { return createDefaultCustomDatabaseManager(); - } - catch (Exception e) { + } catch (Exception e) { mcMMO.p.debug("Could not create custom database manager"); e.printStackTrace(); - } - catch (Throwable e) { + } catch (Throwable e) { mcMMO.p.debug("Failed to create custom database manager"); e.printStackTrace(); } @@ -26,6 +24,10 @@ public class DatabaseManagerFactory { return Config.getInstance().getUseMySQL() ? new SQLDatabaseManager() : new FlatfileDatabaseManager(); } + public static Class getCustomDatabaseManagerClass() { + return customManager; + } + /** * Sets the custom DatabaseManager class for mcMMO to use. This should be * called prior to mcMMO enabling. @@ -38,7 +40,6 @@ public class DatabaseManagerFactory { * versions. * * @param clazz the DatabaseManager class to use - * * @throws IllegalArgumentException if the provided class does not have * an empty constructor */ @@ -46,16 +47,11 @@ public class DatabaseManagerFactory { try { clazz.getConstructor(); customManager = clazz; - } - catch (Throwable e) { + } catch (Throwable e) { throw new IllegalArgumentException("Provided database manager class must have an empty constructor", e); } } - public static Class getCustomDatabaseManagerClass() { - return customManager; - } - public static DatabaseManager createDatabaseManager(DatabaseType type) { switch (type) { case DatabaseType.FLATFILE: @@ -67,8 +63,7 @@ public class DatabaseManagerFactory { case DatabaseType.CUSTOM: try { return createDefaultCustomDatabaseManager(); - } - catch (Throwable e) { + } catch (Throwable e) { e.printStackTrace(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/database/FlatfileDatabaseManager.java b/core/src/main/java/com/gmail/nossr50/core/data/database/FlatfileDatabaseManager.java index 0fa7ad213..6409f7ad9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/database/FlatfileDatabaseManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/FlatfileDatabaseManager.java @@ -20,14 +20,52 @@ import java.io.*; import java.util.*; public final class FlatfileDatabaseManager implements DatabaseManager { + private static final Object fileWritingLock = new Object(); + public static int USERNAME = 0; + public static int SKILLS_MINING = 1; + public static int EXP_MINING = 4; + public static int SKILLS_WOODCUTTING = 5; + public static int EXP_WOODCUTTING = 6; + public static int SKILLS_REPAIR = 7; + public static int SKILLS_UNARMED = 8; + public static int SKILLS_HERBALISM = 9; + public static int SKILLS_EXCAVATION = 10; + public static int SKILLS_ARCHERY = 11; + public static int SKILLS_SWORDS = 12; + public static int SKILLS_AXES = 13; + public static int SKILLS_ACROBATICS = 14; + public static int EXP_REPAIR = 15; + public static int EXP_UNARMED = 16; + public static int EXP_HERBALISM = 17; + public static int EXP_EXCAVATION = 18; + public static int EXP_ARCHERY = 19; + public static int EXP_SWORDS = 20; + public static int EXP_AXES = 21; + public static int EXP_ACROBATICS = 22; + public static int SKILLS_TAMING = 24; + public static int EXP_TAMING = 25; + public static int COOLDOWN_BERSERK = 26; + public static int COOLDOWN_GIGA_DRILL_BREAKER = 27; + public static int COOLDOWN_TREE_FELLER = 28; + public static int COOLDOWN_GREEN_TERRA = 29; + public static int COOLDOWN_SERRATED_STRIKES = 30; + public static int COOLDOWN_SKULL_SPLITTER = 31; + public static int COOLDOWN_SUPER_BREAKER = 32; + public static int SKILLS_FISHING = 34; + public static int EXP_FISHING = 35; + public static int COOLDOWN_BLAST_MINING = 36; + public static int LAST_LOGIN = 37; + public static int HEALTHBAR = 38; + public static int SKILLS_ALCHEMY = 39; + public static int EXP_ALCHEMY = 40; + public static int UUID_INDEX = 41; + public static int SCOREBOARD_TIPS = 42; + public static int COOLDOWN_CHIMAERA_WING = 43; private final HashMap> playerStatHash = new HashMap>(); private final List powerLevels = new ArrayList(); - private long lastUpdate = 0; - private final long UPDATE_WAIT_TIME = 600000L; // 10 minutes private final File usersFile; - private static final Object fileWritingLock = new Object(); - + private long lastUpdate = 0; protected FlatfileDatabaseManager() { usersFile = new File(mcMMO.getUsersFilePath()); checkStructure(); @@ -69,8 +107,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager { // If they're still around, rewrite them to the file. if (!powerless) { writer.append(line).append("\r\n"); - } - else { + } else { purgedUsers++; } } @@ -78,24 +115,20 @@ public final class FlatfileDatabaseManager implements DatabaseManager { // Write the new file out = new FileWriter(usersFilePath); out.write(writer.toString()); - } - catch (IOException e) { + } catch (IOException e) { mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " (Are you sure you formatted it correctly?)" + e.toString()); - } - finally { + } finally { if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } if (out != null) { try { out.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -129,8 +162,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager { boolean rewrite = false; try { lastPlayed = Long.parseLong(character[37]) * Misc.TIME_CONVERSION_FACTOR; - } - catch (NumberFormatException e) { + } catch (NumberFormatException e) { e.printStackTrace(); } if (lastPlayed == 0) { @@ -141,15 +173,13 @@ public final class FlatfileDatabaseManager implements DatabaseManager { if (currentTime - lastPlayed > PURGE_TIME) { removedPlayers++; - } - else { + } else { if (rewrite) { // Rewrite their data with a valid time character[37] = Long.toString(lastPlayed); String newLine = org.apache.commons.lang.StringUtils.join(character, ":"); writer.append(newLine).append("\r\n"); - } - else { + } else { writer.append(line).append("\r\n"); } } @@ -158,24 +188,20 @@ public final class FlatfileDatabaseManager implements DatabaseManager { // Write the new file out = new FileWriter(usersFilePath); out.write(writer.toString()); - } - catch (IOException e) { + } catch (IOException e) { mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " (Are you sure you formatted it correctly?)" + e.toString()); - } - finally { + } finally { if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } if (out != null) { try { out.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -211,24 +237,20 @@ public final class FlatfileDatabaseManager implements DatabaseManager { out = new FileWriter(usersFilePath); // Write out the new file out.write(writer.toString()); - } - catch (Exception e) { + } catch (Exception e) { mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " (Are you sure you formatted it correctly?)" + e.toString()); - } - finally { + } finally { if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } if (out != null) { try { out.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -262,8 +284,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager { String[] character = line.split(":"); if (!(uuid != null && character[UUID_INDEX].equalsIgnoreCase(uuid.toString())) && !character[USERNAME].equalsIgnoreCase(playerName)) { writer.append(line).append("\r\n"); - } - else { + } else { // Otherwise write the new player information writeUserToLine(profile, playerName, uuid, writer); wroteUser = true; @@ -273,8 +294,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager { /* * If we couldn't find the user in the DB we need to add him */ - if(!wroteUser) - { + if (!wroteUser) { writeUserToLine(profile, playerName, uuid, writer); } @@ -282,25 +302,21 @@ public final class FlatfileDatabaseManager implements DatabaseManager { out = new FileWriter(usersFilePath); out.write(writer.toString()); return true; - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); return false; - } - finally { + } finally { if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } if (out != null) { try { out.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -435,16 +451,13 @@ public final class FlatfileDatabaseManager implements DatabaseManager { // Add more in the same format as the line above out.newLine(); - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); - } - finally { + } finally { if (out != null) { try { out.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -506,18 +519,15 @@ public final class FlatfileDatabaseManager implements DatabaseManager { newUser(playerName, uuid); return new PlayerProfile(playerName, uuid, true); } - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); - } - finally { + } finally { // I have no idea why it's necessary to inline tryClose() here, but it removes // a resource leak warning, and I'm trusting the compiler on this one. if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -549,23 +559,19 @@ public final class FlatfileDatabaseManager implements DatabaseManager { try { destination.saveUser(loadFromLine(character)); - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); } convertedUsers++; Misc.printProgress(convertedUsers, progressInterval, startMillis); } - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); - } - finally { + } finally { if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -606,25 +612,21 @@ public final class FlatfileDatabaseManager implements DatabaseManager { out = new FileWriter(usersFilePath); // Write out the new file out.write(writer.toString()); - } - catch (Exception e) { + } catch (Exception e) { mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " (Are you sure you formatted it correctly?)" + e.toString()); - } - finally { + } finally { mcMMO.p.getLogger().info(i + " entries written while saving UUID for " + userName); if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } if (out != null) { try { out.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -665,25 +667,21 @@ public final class FlatfileDatabaseManager implements DatabaseManager { out = new FileWriter(usersFilePath); // Write out the new file out.write(writer.toString()); - } - catch (Exception e) { + } catch (Exception e) { mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " (Are you sure you formatted it correctly?)" + e.toString()); - } - finally { + } finally { mcMMO.p.getLogger().info(i + " entries written while saving UUID batch"); if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } if (out != null) { try { out.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -708,16 +706,13 @@ public final class FlatfileDatabaseManager implements DatabaseManager { String[] character = line.split(":"); users.add(character[USERNAME]); } - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); - } - finally { + } finally { if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -785,16 +780,13 @@ public final class FlatfileDatabaseManager implements DatabaseManager { putStat(powerLevels, playerName, powerLevel); } - } - catch (Exception e) { + } catch (Exception e) { mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " during user " + playerName + " (Are you sure you formatted it correctly?) " + e.toString()); - } - finally { + } finally { if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -1005,11 +997,9 @@ public final class FlatfileDatabaseManager implements DatabaseManager { corrupted = true; if (i == 37) { character[i] = String.valueOf(System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR); - } - else if (i == 38) { + } else if (i == 38) { character[i] = Config.getInstance().getMobHealthbarDefault().toString(); - } - else { + } else { character[i] = "0"; } } @@ -1056,24 +1046,20 @@ public final class FlatfileDatabaseManager implements DatabaseManager { // Write the new file out = new FileWriter(usersFilePath); out.write(writer.toString()); - } - catch (IOException e) { + } catch (IOException e) { mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " (Are you sure you formatted it correctly?)" + e.toString()); - } - finally { + } finally { if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } if (out != null) { try { out.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -1095,8 +1081,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager { try { mcMMO.p.debug("Creating mcmmo.users file..."); new File(mcMMO.getUsersFilePath()).createNewFile(); - } - catch (IOException e) { + } catch (IOException e) { e.printStackTrace(); } } @@ -1124,16 +1109,9 @@ public final class FlatfileDatabaseManager implements DatabaseManager { return statValue; } - private class SkillComparator implements Comparator { - @Override - public int compare(PlayerStat o1, PlayerStat o2) { - return (o2.statVal - o1.statVal); - } - } - private PlayerProfile loadFromLine(String[] character) { - Map skills = getSkillMapFromLine(character); // Skill levels - Map skillsXp = new EnumMap(PrimarySkillType.class); // Skill & XP + Map skills = getSkillMapFromLine(character); // Skill levels + Map skillsXp = new EnumMap(PrimarySkillType.class); // Skill & XP Map skillsDATS = new EnumMap(SuperAbilityType.class); // Ability & Cooldown Map uniquePlayerDataMap = new EnumMap(UniqueDataType.class); MobHealthbarType mobHealthbarType; @@ -1170,30 +1148,26 @@ public final class FlatfileDatabaseManager implements DatabaseManager { try { mobHealthbarType = MobHealthbarType.valueOf(character[HEALTHBAR]); - } - catch (Exception e) { + } catch (Exception e) { mobHealthbarType = Config.getInstance().getMobHealthbarDefault(); } UUID uuid; try { uuid = UUID.fromString(character[UUID_INDEX]); - } - catch (Exception e) { + } catch (Exception e) { uuid = null; } try { scoreboardTipsShown = Integer.valueOf(character[SCOREBOARD_TIPS]); - } - catch (Exception e) { + } catch (Exception e) { scoreboardTipsShown = 0; } try { uniquePlayerDataMap.put(UniqueDataType.CHIMAERA_WING_DATS, Integer.valueOf(character[COOLDOWN_CHIMAERA_WING])); - } - catch (Exception e) { + } catch (Exception e) { uniquePlayerDataMap.put(UniqueDataType.CHIMAERA_WING_DATS, 0); } @@ -1225,7 +1199,8 @@ public final class FlatfileDatabaseManager implements DatabaseManager { } @Override - public void onDisable() { } + public void onDisable() { + } private int getSkillIndex(PrimarySkillType skill) { switch (skill) { @@ -1257,50 +1232,9 @@ public final class FlatfileDatabaseManager implements DatabaseManager { return SKILLS_WOODCUTTING; default: throw new RuntimeException("Primary Skills only"); - + } } - - public static int USERNAME = 0; - public static int SKILLS_MINING = 1; - public static int EXP_MINING = 4; - public static int SKILLS_WOODCUTTING = 5; - public static int EXP_WOODCUTTING = 6; - public static int SKILLS_REPAIR = 7; - public static int SKILLS_UNARMED = 8; - public static int SKILLS_HERBALISM = 9; - public static int SKILLS_EXCAVATION = 10; - public static int SKILLS_ARCHERY = 11; - public static int SKILLS_SWORDS = 12; - public static int SKILLS_AXES = 13; - public static int SKILLS_ACROBATICS = 14; - public static int EXP_REPAIR = 15; - public static int EXP_UNARMED = 16; - public static int EXP_HERBALISM = 17; - public static int EXP_EXCAVATION = 18; - public static int EXP_ARCHERY = 19; - public static int EXP_SWORDS = 20; - public static int EXP_AXES = 21; - public static int EXP_ACROBATICS = 22; - public static int SKILLS_TAMING = 24; - public static int EXP_TAMING = 25; - public static int COOLDOWN_BERSERK = 26; - public static int COOLDOWN_GIGA_DRILL_BREAKER = 27; - public static int COOLDOWN_TREE_FELLER = 28; - public static int COOLDOWN_GREEN_TERRA = 29; - public static int COOLDOWN_SERRATED_STRIKES = 30; - public static int COOLDOWN_SKULL_SPLITTER = 31; - public static int COOLDOWN_SUPER_BREAKER = 32; - public static int SKILLS_FISHING = 34; - public static int EXP_FISHING = 35; - public static int COOLDOWN_BLAST_MINING = 36; - public static int LAST_LOGIN = 37; - public static int HEALTHBAR = 38; - public static int SKILLS_ALCHEMY = 39; - public static int EXP_ALCHEMY = 40; - public static int UUID_INDEX = 41; - public static int SCOREBOARD_TIPS = 42; - public static int COOLDOWN_CHIMAERA_WING = 43; public void resetMobHealthSettings() { BufferedReader in = null; @@ -1319,9 +1253,9 @@ public final class FlatfileDatabaseManager implements DatabaseManager { continue; } String[] character = line.split(":"); - + character[HEALTHBAR] = Config.getInstance().getMobHealthbarDefault().toString(); - + line = new StringBuilder(org.apache.commons.lang.StringUtils.join(character, ":")).append(":").toString(); writer.append(line).append("\r\n"); @@ -1330,28 +1264,31 @@ public final class FlatfileDatabaseManager implements DatabaseManager { // Write the new file out = new FileWriter(usersFilePath); out.write(writer.toString()); - } - catch (IOException e) { + } catch (IOException e) { mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " (Are you sure you formatted it correctly?)" + e.toString()); - } - finally { + } finally { if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } if (out != null) { try { out.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } } } } + + private class SkillComparator implements Comparator { + @Override + public int compare(PlayerStat o1, PlayerStat o2) { + return (o2.statVal - o1.statVal); + } + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/database/SQLDatabaseManager.java b/core/src/main/java/com/gmail/nossr50/core/data/database/SQLDatabaseManager.java index d05476b61..48a3a73ad 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/database/SQLDatabaseManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/SQLDatabaseManager.java @@ -23,10 +23,8 @@ import java.util.concurrent.locks.ReentrantLock; public final class SQLDatabaseManager implements DatabaseManager { private static final String ALL_QUERY_VERSION = "total"; - private String tablePrefix = Config.getInstance().getMySQLTablePrefix(); - private final Map cachedUserIDs = new HashMap(); - + private String tablePrefix = Config.getInstance().getMySQLTablePrefix(); private DataSource miscPool; private DataSource loadPool; private DataSource savePool; @@ -37,20 +35,19 @@ public final class SQLDatabaseManager implements DatabaseManager { String connectionString = "jdbc:mysql://" + Config.getInstance().getMySQLServerName() + ":" + Config.getInstance().getMySQLServerPort() + "/" + Config.getInstance().getMySQLDatabaseName(); - if(Config.getInstance().getMySQLSSL()) + if (Config.getInstance().getMySQLSSL()) connectionString += - "?verifyServerCertificate=false"+ - "&useSSL=true"+ - "&requireSSL=true"; + "?verifyServerCertificate=false" + + "&useSSL=true" + + "&requireSSL=true"; else - connectionString+= + connectionString += "?useSSL=false"; try { // Force driver to load if not yet loaded Class.forName("com.mysql.jdbc.Driver"); - } - catch (ClassNotFoundException e) { + } catch (ClassNotFoundException e) { e.printStackTrace(); return; //throw e; // aborts onEnable() Riking if you want to do this, fully implement it. @@ -128,11 +125,9 @@ public final class SQLDatabaseManager implements DatabaseManager { statement.executeUpdate("DELETE FROM `" + tablePrefix + "huds` WHERE NOT EXISTS (SELECT * FROM `" + tablePrefix + "skills` `s` WHERE `" + tablePrefix + "huds`.`user_id` = `s`.`user_id`)"); statement.executeUpdate("DELETE FROM `" + tablePrefix + "cooldowns` WHERE NOT EXISTS (SELECT * FROM `" + tablePrefix + "skills` `s` WHERE `" + tablePrefix + "cooldowns`.`user_id` = `s`.`user_id`)"); statement.executeUpdate("DELETE FROM `" + tablePrefix + "users` WHERE NOT EXISTS (SELECT * FROM `" + tablePrefix + "skills` `s` WHERE `" + tablePrefix + "users`.`id` = `s`.`user_id`)"); - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(statement); tryClose(connection); massUpdateLock.unlock(); @@ -159,11 +154,9 @@ public final class SQLDatabaseManager implements DatabaseManager { "JOIN " + tablePrefix + "skills s ON (u.id = s.user_id) " + "JOIN " + tablePrefix + "cooldowns c ON (u.id = c.user_id) " + "WHERE ((UNIX_TIMESTAMP() - lastlogin) > " + PURGE_TIME + ")"); - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(statement); tryClose(connection); massUpdateLock.unlock(); @@ -190,11 +183,9 @@ public final class SQLDatabaseManager implements DatabaseManager { statement.setString(1, playerName); success = statement.executeUpdate() != 0; - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(statement); tryClose(connection); } @@ -320,11 +311,9 @@ public final class SQLDatabaseManager implements DatabaseManager { mcMMO.p.getLogger().severe("Failed to update hud settings for " + profile.getPlayerName()); return false; } - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(statement); tryClose(connection); } @@ -356,11 +345,9 @@ public final class SQLDatabaseManager implements DatabaseManager { stats.add(new PlayerStat(column.get(1), Integer.valueOf(column.get(0)))); } - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(resultSet); tryClose(statement); tryClose(connection); @@ -452,11 +439,9 @@ public final class SQLDatabaseManager implements DatabaseManager { resultSet.close(); statement.close(); - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(resultSet); tryClose(statement); tryClose(connection); @@ -471,11 +456,9 @@ public final class SQLDatabaseManager implements DatabaseManager { try { connection = getConnection(PoolIdentifier.MISC); newUser(connection, playerName, uuid); - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(connection); } } @@ -507,11 +490,9 @@ public final class SQLDatabaseManager implements DatabaseManager { writeMissingRows(connection, resultSet.getInt(1)); return resultSet.getInt(1); - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(resultSet); tryClose(statement); } @@ -599,17 +580,14 @@ public final class SQLDatabaseManager implements DatabaseManager { } return profile; - } - catch (SQLException e) { + } catch (SQLException e) { printErrors(e); } } resultSet.close(); - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(resultSet); tryClose(statement); tryClose(connection); @@ -655,19 +633,16 @@ public final class SQLDatabaseManager implements DatabaseManager { resultSet.next(); destination.saveUser(loadFromResult(playerName, resultSet)); resultSet.close(); - } - catch (SQLException e) { + } catch (SQLException e) { printErrors(e); // Ignore } convertedUsers++; Misc.printProgress(convertedUsers, progressInterval, startMillis); } - } - catch (SQLException e) { + } catch (SQLException e) { printErrors(e); - } - finally { + } finally { tryClose(resultSet); tryClose(statement); tryClose(connection); @@ -688,12 +663,10 @@ public final class SQLDatabaseManager implements DatabaseManager { statement.setString(2, userName); statement.execute(); return true; - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); return false; - } - finally { + } finally { tryClose(statement); tryClose(connection); } @@ -728,12 +701,10 @@ public final class SQLDatabaseManager implements DatabaseManager { } return true; - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); return false; - } - finally { + } finally { tryClose(statement); tryClose(connection); } @@ -753,11 +724,9 @@ public final class SQLDatabaseManager implements DatabaseManager { while (resultSet.next()) { users.add(resultSet.getString("user")); } - } - catch (SQLException e) { + } catch (SQLException e) { printErrors(e); - } - finally { + } finally { tryClose(resultSet); tryClose(statement); tryClose(connection); @@ -787,13 +756,13 @@ public final class SQLDatabaseManager implements DatabaseManager { if (!resultSet.next()) { createStatement = connection.createStatement(); createStatement.executeUpdate("CREATE TABLE IF NOT EXISTS `" + tablePrefix + "users` (" - + "`id` int(10) unsigned NOT NULL AUTO_INCREMENT," - + "`user` varchar(40) NOT NULL," - + "`uuid` varchar(36) NULL DEFAULT NULL," - + "`lastlogin` int(32) unsigned NOT NULL," - + "PRIMARY KEY (`id`)," - + "INDEX(`user`(20) ASC)," - + "UNIQUE KEY `uuid` (`uuid`)) DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;"); + + "`id` int(10) unsigned NOT NULL AUTO_INCREMENT," + + "`user` varchar(40) NOT NULL," + + "`uuid` varchar(36) NULL DEFAULT NULL," + + "`lastlogin` int(32) unsigned NOT NULL," + + "PRIMARY KEY (`id`)," + + "INDEX(`user`(20) ASC)," + + "UNIQUE KEY `uuid` (`uuid`)) DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;"); tryClose(createStatement); } tryClose(resultSet); @@ -845,20 +814,20 @@ public final class SQLDatabaseManager implements DatabaseManager { createStatement = connection.createStatement(); createStatement.executeUpdate("CREATE TABLE IF NOT EXISTS `" + tablePrefix + "skills` (" + "`user_id` int(10) unsigned NOT NULL," - + "`taming` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`mining` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`woodcutting` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`repair` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`unarmed` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`herbalism` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`excavation` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`archery` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`swords` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`axes` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`acrobatics` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`fishing` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`alchemy` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`total` int(10) unsigned NOT NULL DEFAULT "+totalLevel+"," + + "`taming` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`mining` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`woodcutting` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`repair` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`unarmed` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`herbalism` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`excavation` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`archery` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`swords` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`axes` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`acrobatics` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`fishing` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`alchemy` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`total` int(10) unsigned NOT NULL DEFAULT " + totalLevel + "," + "PRIMARY KEY (`user_id`)) " + "DEFAULT CHARSET=latin1;"); tryClose(createStatement); @@ -912,11 +881,9 @@ public final class SQLDatabaseManager implements DatabaseManager { createStatement.executeUpdate("DELETE FROM `" + tablePrefix + "huds` WHERE NOT EXISTS (SELECT * FROM `" + tablePrefix + "users` `u` WHERE `" + tablePrefix + "huds`.`user_id` = `u`.`id`)"); createStatement.executeUpdate("DELETE FROM `" + tablePrefix + "cooldowns` WHERE NOT EXISTS (SELECT * FROM `" + tablePrefix + "users` `u` WHERE `" + tablePrefix + "cooldowns`.`user_id` = `u`.`id`)"); createStatement.executeUpdate("DELETE FROM `" + tablePrefix + "skills` WHERE NOT EXISTS (SELECT * FROM `" + tablePrefix + "users` `u` WHERE `" + tablePrefix + "skills`.`user_id` = `u`.`id`)"); - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(resultSet); tryClose(statement); tryClose(createStatement); @@ -1014,11 +981,9 @@ public final class SQLDatabaseManager implements DatabaseManager { } mcMMO.getUpgradeManager().setUpgradeCompleted(upgrade); - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(statement); } } @@ -1048,11 +1013,9 @@ public final class SQLDatabaseManager implements DatabaseManager { statement.setInt(3, 0); statement.execute(); statement.close(); - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(statement); } } @@ -1117,22 +1080,19 @@ public final class SQLDatabaseManager implements DatabaseManager { try { mobHealthbarType = MobHealthbarType.valueOf(result.getString(OFFSET_OTHER + 1)); - } - catch (Exception e) { + } catch (Exception e) { mobHealthbarType = Config.getInstance().getMobHealthbarDefault(); } try { scoreboardTipsShown = result.getInt(OFFSET_OTHER + 2); - } - catch (Exception e) { + } catch (Exception e) { scoreboardTipsShown = 0; } try { uuid = UUID.fromString(result.getString(OFFSET_OTHER + 3)); - } - catch (Exception e) { + } catch (Exception e) { uuid = null; } @@ -1163,7 +1123,7 @@ public final class SQLDatabaseManager implements DatabaseManager { } resultSet.close(); mcMMO.p.getLogger().info("Updating mcMMO MySQL tables to drop name uniqueness..."); - statement.execute("ALTER TABLE `" + tablePrefix + "users` " + statement.execute("ALTER TABLE `" + tablePrefix + "users` " + "DROP INDEX `user`," + "ADD INDEX `user` (`user`(20) ASC)"); } catch (SQLException ex) { @@ -1176,8 +1136,7 @@ public final class SQLDatabaseManager implements DatabaseManager { private void checkUpgradeAddAlchemy(final Statement statement) throws SQLException { try { statement.executeQuery("SELECT `alchemy` FROM `" + tablePrefix + "skills` LIMIT 1"); - } - catch (SQLException ex) { + } catch (SQLException ex) { mcMMO.p.getLogger().info("Updating mcMMO MySQL tables for Alchemy..."); statement.executeUpdate("ALTER TABLE `" + tablePrefix + "skills` ADD `alchemy` int(10) NOT NULL DEFAULT '0'"); statement.executeUpdate("ALTER TABLE `" + tablePrefix + "experience` ADD `alchemy` int(10) NOT NULL DEFAULT '0'"); @@ -1187,8 +1146,7 @@ public final class SQLDatabaseManager implements DatabaseManager { private void checkUpgradeAddBlastMiningCooldown(final Statement statement) throws SQLException { try { statement.executeQuery("SELECT `blast_mining` FROM `" + tablePrefix + "cooldowns` LIMIT 1"); - } - catch (SQLException ex) { + } catch (SQLException ex) { mcMMO.p.getLogger().info("Updating mcMMO MySQL tables for Blast Mining..."); statement.executeUpdate("ALTER TABLE `" + tablePrefix + "cooldowns` ADD `blast_mining` int(32) NOT NULL DEFAULT '0'"); } @@ -1197,8 +1155,7 @@ public final class SQLDatabaseManager implements DatabaseManager { private void checkUpgradeAddUniqueChimaeraWing(final Statement statement) throws SQLException { try { statement.executeQuery("SELECT `chimaera_wing` FROM `" + tablePrefix + "cooldowns` LIMIT 1"); - } - catch (SQLException ex) { + } catch (SQLException ex) { mcMMO.p.getLogger().info("Updating mcMMO MySQL tables for Chimaera Wing..."); statement.executeUpdate("ALTER TABLE `" + tablePrefix + "cooldowns` ADD `chimaera_wing` int(32) NOT NULL DEFAULT '0'"); } @@ -1207,8 +1164,7 @@ public final class SQLDatabaseManager implements DatabaseManager { private void checkUpgradeAddFishing(final Statement statement) throws SQLException { try { statement.executeQuery("SELECT `fishing` FROM `" + tablePrefix + "skills` LIMIT 1"); - } - catch (SQLException ex) { + } catch (SQLException ex) { mcMMO.p.getLogger().info("Updating mcMMO MySQL tables for Fishing..."); statement.executeUpdate("ALTER TABLE `" + tablePrefix + "skills` ADD `fishing` int(10) NOT NULL DEFAULT '0'"); statement.executeUpdate("ALTER TABLE `" + tablePrefix + "experience` ADD `fishing` int(10) NOT NULL DEFAULT '0'"); @@ -1218,8 +1174,7 @@ public final class SQLDatabaseManager implements DatabaseManager { private void checkUpgradeAddMobHealthbars(final Statement statement) throws SQLException { try { statement.executeQuery("SELECT `mobhealthbar` FROM `" + tablePrefix + "huds` LIMIT 1"); - } - catch (SQLException ex) { + } catch (SQLException ex) { mcMMO.p.getLogger().info("Updating mcMMO MySQL tables for mob healthbars..."); statement.executeUpdate("ALTER TABLE `" + tablePrefix + "huds` ADD `mobhealthbar` varchar(50) NOT NULL DEFAULT '" + Config.getInstance().getMobHealthbarDefault() + "'"); } @@ -1228,8 +1183,7 @@ public final class SQLDatabaseManager implements DatabaseManager { private void checkUpgradeAddScoreboardTips(final Statement statement) throws SQLException { try { statement.executeQuery("SELECT `scoreboardtips` FROM `" + tablePrefix + "huds` LIMIT 1"); - } - catch (SQLException ex) { + } catch (SQLException ex) { mcMMO.p.getLogger().info("Updating mcMMO MySQL tables for scoreboard tips..."); statement.executeUpdate("ALTER TABLE `" + tablePrefix + "huds` ADD `scoreboardtips` int(10) NOT NULL DEFAULT '0' ;"); } @@ -1250,17 +1204,14 @@ public final class SQLDatabaseManager implements DatabaseManager { try { statement.executeUpdate("ALTER TABLE `" + tablePrefix + "skills` ADD INDEX `idx_" + skill_name + "` (`" + skill_name + "`) USING BTREE"); - } - catch (SQLException ex) { + } catch (SQLException ex) { // Ignore } } } - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(resultSet); } } @@ -1286,17 +1237,202 @@ public final class SQLDatabaseManager implements DatabaseManager { statement.executeUpdate("ALTER TABLE `" + tablePrefix + "users` ADD `uuid` varchar(36) NULL DEFAULT NULL"); statement.executeUpdate("ALTER TABLE `" + tablePrefix + "users` ADD UNIQUE INDEX `uuid` (`uuid`) USING BTREE"); } - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(resultSet); } new GetUUIDUpdatesRequired().runTaskLaterAsynchronously(mcMMO.p, 100); // wait until after first purge } + private void checkUpgradeDropPartyNames(final Statement statement) { + ResultSet resultSet = null; + + try { + resultSet = statement.executeQuery("SELECT * FROM `" + tablePrefix + "users` LIMIT 1"); + + ResultSetMetaData rsmeta = resultSet.getMetaData(); + boolean column_exists = false; + + for (int i = 1; i <= rsmeta.getColumnCount(); i++) { + if (rsmeta.getColumnName(i).equalsIgnoreCase("party")) { + column_exists = true; + break; + } + } + + if (column_exists) { + mcMMO.p.getLogger().info("Removing party name from users table..."); + statement.executeUpdate("ALTER TABLE `" + tablePrefix + "users` DROP COLUMN `party`"); + } + } catch (SQLException ex) { + printErrors(ex); + } finally { + tryClose(resultSet); + } + } + + private void checkUpgradeSkillTotal(final Connection connection) throws SQLException { + ResultSet resultSet = null; + Statement statement = null; + + try { + connection.setAutoCommit(false); + statement = connection.createStatement(); + resultSet = statement.executeQuery("SELECT * FROM `" + tablePrefix + "skills` LIMIT 1"); + + ResultSetMetaData rsmeta = resultSet.getMetaData(); + boolean column_exists = false; + + for (int i = 1; i <= rsmeta.getColumnCount(); i++) { + if (rsmeta.getColumnName(i).equalsIgnoreCase("total")) { + column_exists = true; + break; + } + } + + if (!column_exists) { + mcMMO.p.getLogger().info("Adding skill total column to skills table..."); + statement.executeUpdate("ALTER TABLE `" + tablePrefix + "skills` ADD COLUMN `total` int NOT NULL DEFAULT '0'"); + statement.executeUpdate("UPDATE `" + tablePrefix + "skills` SET `total` = (taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy)"); + statement.executeUpdate("ALTER TABLE `" + tablePrefix + "skills` ADD INDEX `idx_total` (`total`) USING BTREE"); + connection.commit(); + } + } catch (SQLException ex) { + printErrors(ex); + } finally { + connection.setAutoCommit(true); + tryClose(resultSet); + tryClose(statement); + } + } + + private void checkUpgradeDropSpout(final Statement statement) { + ResultSet resultSet = null; + + try { + resultSet = statement.executeQuery("SELECT * FROM `" + tablePrefix + "huds` LIMIT 1"); + + ResultSetMetaData rsmeta = resultSet.getMetaData(); + boolean column_exists = false; + + for (int i = 1; i <= rsmeta.getColumnCount(); i++) { + if (rsmeta.getColumnName(i).equalsIgnoreCase("hudtype")) { + column_exists = true; + break; + } + } + + if (column_exists) { + mcMMO.p.getLogger().info("Removing Spout HUD type from huds table..."); + statement.executeUpdate("ALTER TABLE `" + tablePrefix + "huds` DROP COLUMN `hudtype`"); + } + } catch (SQLException ex) { + printErrors(ex); + } finally { + tryClose(resultSet); + } + } + + private int getUserID(final Connection connection, final String playerName, final UUID uuid) { + if (uuid == null) + return getUserIDByName(connection, playerName); + + if (cachedUserIDs.containsKey(uuid)) + return cachedUserIDs.get(uuid); + + ResultSet resultSet = null; + PreparedStatement statement = null; + + try { + statement = connection.prepareStatement("SELECT id, user FROM " + tablePrefix + "users WHERE uuid = ? OR (uuid IS NULL AND user = ?)"); + statement.setString(1, uuid.toString()); + statement.setString(2, playerName); + resultSet = statement.executeQuery(); + + if (resultSet.next()) { + int id = resultSet.getInt("id"); + + cachedUserIDs.put(uuid, id); + + return id; + } + } catch (SQLException ex) { + printErrors(ex); + } finally { + tryClose(resultSet); + tryClose(statement); + } + + return -1; + } + + private int getUserIDByName(final Connection connection, final String playerName) { + ResultSet resultSet = null; + PreparedStatement statement = null; + + try { + statement = connection.prepareStatement("SELECT id, user FROM " + tablePrefix + "users WHERE user = ?"); + statement.setString(1, playerName); + resultSet = statement.executeQuery(); + + if (resultSet.next()) { + int id = resultSet.getInt("id"); + + return id; + } + } catch (SQLException ex) { + printErrors(ex); + } finally { + tryClose(resultSet); + tryClose(statement); + } + + return -1; + } + + private void tryClose(AutoCloseable closeable) { + if (closeable != null) { + try { + closeable.close(); + } catch (Exception e) { + // Ignore + } + } + } + + @Override + public void onDisable() { + mcMMO.p.debug("Releasing connection pool resource..."); + miscPool.close(); + loadPool.close(); + savePool.close(); + } + + public void resetMobHealthSettings() { + PreparedStatement statement = null; + Connection connection = null; + + try { + connection = getConnection(PoolIdentifier.MISC); + statement = connection.prepareStatement("UPDATE " + tablePrefix + "huds SET mobhealthbar = ?"); + statement.setString(1, Config.getInstance().getMobHealthbarDefault().toString()); + statement.executeUpdate(); + } catch (SQLException ex) { + printErrors(ex); + } finally { + tryClose(statement); + tryClose(connection); + } + } + + public enum PoolIdentifier { + MISC, + LOAD, + SAVE + } + private class GetUUIDUpdatesRequired extends BukkitRunnable { public void run() { massUpdateLock.lock(); @@ -1329,204 +1465,4 @@ public final class SQLDatabaseManager implements DatabaseManager { } } } - - private void checkUpgradeDropPartyNames(final Statement statement) { - ResultSet resultSet = null; - - try { - resultSet = statement.executeQuery("SELECT * FROM `" + tablePrefix + "users` LIMIT 1"); - - ResultSetMetaData rsmeta = resultSet.getMetaData(); - boolean column_exists = false; - - for (int i = 1; i <= rsmeta.getColumnCount(); i++) { - if (rsmeta.getColumnName(i).equalsIgnoreCase("party")) { - column_exists = true; - break; - } - } - - if (column_exists) { - mcMMO.p.getLogger().info("Removing party name from users table..."); - statement.executeUpdate("ALTER TABLE `" + tablePrefix + "users` DROP COLUMN `party`"); - } - } - catch (SQLException ex) { - printErrors(ex); - } - finally { - tryClose(resultSet); - } - } - - private void checkUpgradeSkillTotal(final Connection connection) throws SQLException { - ResultSet resultSet = null; - Statement statement = null; - - try { - connection.setAutoCommit(false); - statement = connection.createStatement(); - resultSet = statement.executeQuery("SELECT * FROM `" + tablePrefix + "skills` LIMIT 1"); - - ResultSetMetaData rsmeta = resultSet.getMetaData(); - boolean column_exists = false; - - for (int i = 1; i <= rsmeta.getColumnCount(); i++) { - if (rsmeta.getColumnName(i).equalsIgnoreCase("total")) { - column_exists = true; - break; - } - } - - if (!column_exists) { - mcMMO.p.getLogger().info("Adding skill total column to skills table..."); - statement.executeUpdate("ALTER TABLE `" + tablePrefix + "skills` ADD COLUMN `total` int NOT NULL DEFAULT '0'"); - statement.executeUpdate("UPDATE `" + tablePrefix + "skills` SET `total` = (taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy)"); - statement.executeUpdate("ALTER TABLE `" + tablePrefix + "skills` ADD INDEX `idx_total` (`total`) USING BTREE"); - connection.commit(); - } - } - catch (SQLException ex) { - printErrors(ex); - } - finally { - connection.setAutoCommit(true); - tryClose(resultSet); - tryClose(statement); - } - } - - private void checkUpgradeDropSpout(final Statement statement) { - ResultSet resultSet = null; - - try { - resultSet = statement.executeQuery("SELECT * FROM `" + tablePrefix + "huds` LIMIT 1"); - - ResultSetMetaData rsmeta = resultSet.getMetaData(); - boolean column_exists = false; - - for (int i = 1; i <= rsmeta.getColumnCount(); i++) { - if (rsmeta.getColumnName(i).equalsIgnoreCase("hudtype")) { - column_exists = true; - break; - } - } - - if (column_exists) { - mcMMO.p.getLogger().info("Removing Spout HUD type from huds table..."); - statement.executeUpdate("ALTER TABLE `" + tablePrefix + "huds` DROP COLUMN `hudtype`"); - } - } - catch (SQLException ex) { - printErrors(ex); - } - finally { - tryClose(resultSet); - } - } - - private int getUserID(final Connection connection, final String playerName, final UUID uuid) { - if (uuid == null) - return getUserIDByName(connection, playerName); - - if (cachedUserIDs.containsKey(uuid)) - return cachedUserIDs.get(uuid); - - ResultSet resultSet = null; - PreparedStatement statement = null; - - try { - statement = connection.prepareStatement("SELECT id, user FROM " + tablePrefix + "users WHERE uuid = ? OR (uuid IS NULL AND user = ?)"); - statement.setString(1, uuid.toString()); - statement.setString(2, playerName); - resultSet = statement.executeQuery(); - - if (resultSet.next()) { - int id = resultSet.getInt("id"); - - cachedUserIDs.put(uuid, id); - - return id; - } - } - catch (SQLException ex) { - printErrors(ex); - } - finally { - tryClose(resultSet); - tryClose(statement); - } - - return -1; - } - - private int getUserIDByName(final Connection connection, final String playerName) { - ResultSet resultSet = null; - PreparedStatement statement = null; - - try { - statement = connection.prepareStatement("SELECT id, user FROM " + tablePrefix + "users WHERE user = ?"); - statement.setString(1, playerName); - resultSet = statement.executeQuery(); - - if (resultSet.next()) { - int id = resultSet.getInt("id"); - - return id; - } - } - catch (SQLException ex) { - printErrors(ex); - } - finally { - tryClose(resultSet); - tryClose(statement); - } - - return -1; - } - - private void tryClose(AutoCloseable closeable) { - if (closeable != null) { - try { - closeable.close(); - } - catch (Exception e) { - // Ignore - } - } - } - - @Override - public void onDisable() { - mcMMO.p.debug("Releasing connection pool resource..."); - miscPool.close(); - loadPool.close(); - savePool.close(); - } - - public enum PoolIdentifier { - MISC, - LOAD, - SAVE - } - - public void resetMobHealthSettings() { - PreparedStatement statement = null; - Connection connection = null; - - try { - connection = getConnection(PoolIdentifier.MISC); - statement = connection.prepareStatement("UPDATE " + tablePrefix + "huds SET mobhealthbar = ?"); - statement.setString(1, Config.getInstance().getMobHealthbarDefault().toString()); - statement.executeUpdate(); - } - catch (SQLException ex) { - printErrors(ex); - } - finally { - tryClose(statement); - tryClose(connection); - } - } } diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java index 36aa98d47..8f3efa7ff 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java @@ -3,12 +3,11 @@ package com.gmail.nossr50.core.datatypes; import com.gmail.nossr50.core.mcmmo.Location; public class LimitedSizeList { - public Location[] limitedSizeOrderedList; private final int size; + public Location[] limitedSizeOrderedList; - public LimitedSizeList(int size) - { + public LimitedSizeList(int size) { this.size = size; limitedSizeOrderedList = new Location[size]; } @@ -16,16 +15,15 @@ public class LimitedSizeList { /** * Adds objects to our limited size ordered list * New objects are added to the front + * * @param newItem */ - public void add(Location newItem) - { + public void add(Location newItem) { Location[] newList = new Location[size]; - for(int i = 0; i < size-1; i++) - { - if(i != 0) - newList[i] = limitedSizeOrderedList[i-1]; + for (int i = 0; i < size - 1; i++) { + if (i != 0) + newList[i] = limitedSizeOrderedList[i - 1]; else newList[i] = newItem; } @@ -35,17 +33,16 @@ public class LimitedSizeList { /** * Returns true if the object is anywhere in our list + * * @param targetLoc the object to check for * @return true if the object is in our list */ - public boolean contains(Location targetLoc) - { - for(Location iter : limitedSizeOrderedList) - { - if(iter == null) + public boolean contains(Location targetLoc) { + for (Location iter : limitedSizeOrderedList) { + if (iter == null) continue; - if(iter.getX() == targetLoc.getX() + if (iter.getX() == targetLoc.getX() && iter.getY() == targetLoc.getY() && iter.getZ() == targetLoc.getZ()) return true; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java index 039742acc..4a6c3c267 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java @@ -10,7 +10,7 @@ public enum ChatMode { private String disabledMessage; private ChatMode(String enabledMessage, String disabledMessage) { - this.enabledMessage = enabledMessage; + this.enabledMessage = enabledMessage; this.disabledMessage = disabledMessage; } diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/database/DatabaseType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/database/DatabaseType.java index 95ca8a16a..691ae2728 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/database/DatabaseType.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/database/DatabaseType.java @@ -14,8 +14,7 @@ public enum DatabaseType { if (typeName.equalsIgnoreCase("file")) { return FLATFILE; - } - else if (typeName.equalsIgnoreCase("mysql")) { + } else if (typeName.equalsIgnoreCase("mysql")) { return SQL; } diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/FormulaType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/FormulaType.java index 27bf84bca..6f6fda9e2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/FormulaType.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/FormulaType.java @@ -8,8 +8,7 @@ public enum FormulaType { public static FormulaType getFormulaType(String string) { try { return valueOf(string); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { return UNKNOWN; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java index 1cb41005f..8bbb7c55d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java @@ -17,6 +17,10 @@ public class SkillXpGain implements Delayed { this.type = type; } + private static long getDuration() { + return TimeUnit.MINUTES.toMillis(ExperienceConfig.getInstance().getDiminishedReturnsTimeInterval()); + } + public PrimarySkillType getSkill() { return type; } @@ -25,15 +29,10 @@ public class SkillXpGain implements Delayed { return xp; } - private static long getDuration() { - return TimeUnit.MINUTES.toMillis(ExperienceConfig.getInstance().getDiminishedReturnsTimeInterval()); - } - public int compareTo(SkillXpGain other) { if (this.expiryTime < other.expiryTime) { return -1; - } - else if (this.expiryTime > other.expiryTime) { + } else if (this.expiryTime > other.expiryTime) { return 1; } return 0; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/interactions/NotificationType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/interactions/NotificationType.java index 648d49060..435a4c031 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/interactions/NotificationType.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/interactions/NotificationType.java @@ -24,8 +24,7 @@ public enum NotificationType { final String niceName; - NotificationType(String niceName) - { + NotificationType(String niceName) { this.niceName = niceName; } diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOUrl.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOUrl.java index 4b64d42ff..aabeded19 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOUrl.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOUrl.java @@ -1,17 +1,15 @@ package com.gmail.nossr50.core.datatypes.json; public class McMMOUrl { - public static final String urlWebsite = "https://www.mcmmo.org"; - public static final String urlDiscord = "https://discord.gg/bJ7pFS9"; - public static final String urlPatreon = "https://www.patreon.com/com.gmail.nossr50"; - public static final String urlWiki = "https://www.mcmmo.org/wiki/"; - public static final String urlSpigot = "http://spigot.mcmmo.org"; + public static final String urlWebsite = "https://www.mcmmo.org"; + public static final String urlDiscord = "https://discord.gg/bJ7pFS9"; + public static final String urlPatreon = "https://www.patreon.com/com.gmail.nossr50"; + public static final String urlWiki = "https://www.mcmmo.org/wiki/"; + public static final String urlSpigot = "http://spigot.mcmmo.org"; public static final String urlTranslate = "https://www.mcmmo.org/translate/"; - public static String getUrl(McMMOWebLinks webLinks) - { - switch(webLinks) - { + public static String getUrl(McMMOWebLinks webLinks) { + switch (webLinks) { case WIKI: return urlWiki; case PATREON: diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java index 86ee8ffec..749fc920c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java @@ -11,28 +11,24 @@ public enum McMMOWebLinks { HELP_TRANSLATE, WIKI; - public String getUrl() - { + public String getUrl() { return McMMOUrl.getUrl(this); } - public String getNiceTitle() - { + public String getNiceTitle() { return StringUtils.getCapitalized(toString()); } - public String getLocaleDescription() - { - switch (this) - { + public String getLocaleDescription() { + switch (this) { case WEBSITE: - return LocaleLoader.getString( "JSON.URL.Website"); + return LocaleLoader.getString("JSON.URL.Website"); case DISCORD: - return LocaleLoader.getString( "JSON.URL.Discord"); + return LocaleLoader.getString("JSON.URL.Discord"); case PATREON: - return LocaleLoader.getString( "JSON.URL.Patreon"); + return LocaleLoader.getString("JSON.URL.Patreon"); case HELP_TRANSLATE: - return LocaleLoader.getString( "JSON.URL.Translation"); + return LocaleLoader.getString("JSON.URL.Translation"); case SPIGOT: return LocaleLoader.getString("JSON.URL.Spigot"); case WIKI: diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java index cf827eae4..df89f3eeb 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java @@ -8,8 +8,7 @@ import org.bukkit.metadata.FixedMetadataValue; */ public class OldName extends FixedMetadataValue { - public OldName(String oldName, mcMMO plugin) - { + public OldName(String oldName, mcMMO plugin) { super(plugin, oldName); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java index e7dca7a1b..54f1995c3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java @@ -15,17 +15,13 @@ public enum ItemShareType { public static ItemShareType getShareType(ItemStack itemStack) { if (ItemUtils.isMobDrop(itemStack)) { return LOOT; - } - else if (ItemUtils.isMiningDrop(itemStack)) { + } else if (ItemUtils.isMiningDrop(itemStack)) { return MINING; - } - else if (ItemUtils.isHerbalismDrop(itemStack)) { + } else if (ItemUtils.isHerbalismDrop(itemStack)) { return HERBALISM; - } - else if (ItemUtils.isWoodcuttingDrop(itemStack)) { + } else if (ItemUtils.isWoodcuttingDrop(itemStack)) { return WOODCUTTING; - } - else if (ItemUtils.isMiscDrop(itemStack)) { + } else if (ItemUtils.isMiscDrop(itemStack)) { return MISC; } diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java index a449f0f30..fee25e3e2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.datatypes.party; -import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; @@ -31,14 +31,14 @@ public class Party { private int level; private float xp; - private ShareMode xpShareMode = ShareMode.NONE; + private ShareMode xpShareMode = ShareMode.NONE; private ShareMode itemShareMode = ShareMode.NONE; - private boolean shareLootDrops = true; - private boolean shareMiningDrops = true; - private boolean shareHerbalismDrops = true; + private boolean shareLootDrops = true; + private boolean shareMiningDrops = true; + private boolean shareHerbalismDrops = true; private boolean shareWoodcuttingDrops = true; - private boolean shareMiscDrops = true; + private boolean shareMiscDrops = true; public Party(String name) { this.name = name; @@ -75,13 +75,11 @@ public class Party { return onlineMembers; } - public List getVisibleMembers(Player player) - { + public List getVisibleMembers(Player player) { ArrayList visibleMembers = new ArrayList<>(); - for(Player p : onlineMembers) - { - if(player.canSee(p)) + for (Player p : onlineMembers) { + if (player.canSee(p)) visibleMembers.add(p); } @@ -113,22 +111,42 @@ public class Party { return name; } + public void setName(String name) { + this.name = name; + } + public PartyLeader getLeader() { return leader; } + public void setLeader(PartyLeader leader) { + this.leader = leader; + } + public String getPassword() { return password; } + public void setPassword(String password) { + this.password = password; + } + public boolean isLocked() { return locked; } + public void setLocked(boolean locked) { + this.locked = locked; + } + public Party getAlly() { return ally; } + public void setAlly(Party ally) { + this.ally = ally; + } + public List getItemShareCategories() { List shareCategories = new ArrayList(); @@ -141,26 +159,6 @@ public class Party { return shareCategories; } - public void setName(String name) { - this.name = name; - } - - public void setLeader(PartyLeader leader) { - this.leader = leader; - } - - public void setPassword(String password) { - this.password = password; - } - - public void setLocked(boolean locked) { - this.locked = locked; - } - - public void setAlly(Party ally) { - this.ally = ally; - } - public int getLevel() { return level; } @@ -251,22 +249,22 @@ public class Party { return Config.getInstance().getPartyLevelCap() < getLevel() + 1; } - public void setXpShareMode(ShareMode xpShareMode) { - this.xpShareMode = xpShareMode; - } - public ShareMode getXpShareMode() { return xpShareMode; } - public void setItemShareMode(ShareMode itemShareMode) { - this.itemShareMode = itemShareMode; + public void setXpShareMode(ShareMode xpShareMode) { + this.xpShareMode = xpShareMode; } public ShareMode getItemShareMode() { return itemShareMode; } + public void setItemShareMode(ShareMode itemShareMode) { + this.itemShareMode = itemShareMode; + } + public boolean sharingDrops(ItemShareType shareType) { switch (shareType) { case HERBALISM: @@ -336,11 +334,9 @@ public class Party { if (otherPlayer == null) { memberName = memberName.substring(0, 1) + ChatColor.GRAY + ChatColor.ITALIC + "" + memberName.substring(1); } - } - else if (otherPlayer != null) { + } else if (otherPlayer != null) { memberList.append(ChatColor.WHITE); - } - else { + } else { memberList.append(ChatColor.GRAY); } diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java index cb568d60e..ba9ec1bd9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java @@ -5,9 +5,9 @@ import com.gmail.nossr50.util.Misc; import org.bukkit.entity.Player; public class PartyTeleportRecord { - private Player requestor; + private Player requestor; private boolean enabled, confirmRequired; - private int timeout, lastUse; + private int timeout, lastUse; public PartyTeleportRecord() { requestor = null; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java index b1649b167..bda169d6c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java @@ -10,12 +10,10 @@ public enum ShareMode { public static ShareMode getShareMode(String string) { try { return valueOf(string); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { if (string.equalsIgnoreCase("even")) { return EQUAL; - } - else if (CommandUtils.shouldDisableToggle(string)) { + } else if (CommandUtils.shouldDisableToggle(string)) { return NONE; } diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java index 6212d8fc1..d4312e6a2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java @@ -1,18 +1,19 @@ package com.gmail.nossr50.core.datatypes.player; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.skills.WorldBlacklist; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.mods.CustomTool; +import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.datatypes.chat.ChatMode; -import com.gmail.nossr50.core.datatypes.mods.CustomTool; -import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.skills.ToolType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; @@ -43,7 +44,6 @@ import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.experience.ExperienceBarManager; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.util.skills.ParticleEffectUtils; import com.gmail.nossr50.util.skills.PerksUtils; @@ -65,41 +65,32 @@ import java.util.Set; import java.util.UUID; public class McMMOPlayer { - private Player player; - private PlayerProfile profile; - private final Map skillManagers = new HashMap(); + private final Map abilityMode = new HashMap(); + private final Map abilityInformed = new HashMap(); + private final Map toolMode = new HashMap(); + private final FixedMetadataValue playerMetadata; + private Player player; + private PlayerProfile profile; private ExperienceBarManager experienceBarManager; - - private Party party; - private Party invite; - private Party allianceInvite; - private int itemShareModifier; - + private Party party; + private Party invite; + private Party allianceInvite; + private int itemShareModifier; private PartyTeleportRecord ptpRecord; - private boolean partyChatMode; private boolean adminChatMode; private boolean displaySkillNotifications = true; - private boolean abilityUse = true; private boolean godMode; private boolean chatSpy = false; //Off by default - - private final Map abilityMode = new HashMap(); - private final Map abilityInformed = new HashMap(); - - private final Map toolMode = new HashMap(); - private int recentlyHurt; private int respawnATS; private int teleportATS; private long databaseATS; //private int chimeraWingLastUse; private Location teleportCommence; - private boolean isUsingUnarmed; - private final FixedMetadataValue playerMetadata; public McMMOPlayer(Player player, PlayerProfile profile) { String playerName = player.getName(); @@ -122,8 +113,7 @@ public class McMMOPlayer { for (PrimarySkillType primarySkillType : PrimarySkillType.values()) { skillManagers.put(primarySkillType, primarySkillType.getManagerClass().getConstructor(McMMOPlayer.class).newInstance(this)); } - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); mcMMO.p.getPluginLoader().disablePlugin(mcMMO.p); } @@ -145,37 +135,33 @@ public class McMMOPlayer { experienceBarManager.hideExperienceBar(primarySkillType); }*/ - public void processPostXpEvent(XPGainReason xpGainReason, PrimarySkillType primarySkillType, Plugin plugin, XPGainSource xpGainSource) - { + public void processPostXpEvent(XPGainReason xpGainReason, PrimarySkillType primarySkillType, Plugin plugin, XPGainSource xpGainSource) { //Updates from Party sources - if(xpGainSource == XPGainSource.PARTY_MEMBERS && !ExperienceConfig.getInstance().isPartyExperienceBarsEnabled()) + if (xpGainSource == XPGainSource.PARTY_MEMBERS && !ExperienceConfig.getInstance().isPartyExperienceBarsEnabled()) return; //Updates from passive sources (Alchemy, Smelting, etc...) - if(xpGainSource == XPGainSource.PASSIVE && !ExperienceConfig.getInstance().isPassiveGainsExperienceBarsEnabled()) + if (xpGainSource == XPGainSource.PASSIVE && !ExperienceConfig.getInstance().isPassiveGainsExperienceBarsEnabled()) return; updateXPBar(primarySkillType, plugin); } - public void processUnlockNotifications(mcMMO plugin, PrimarySkillType primarySkillType, int skillLevel) - { + public void processUnlockNotifications(mcMMO plugin, PrimarySkillType primarySkillType, int skillLevel) { RankUtils.executeSkillUnlockNotifications(plugin, this, primarySkillType, skillLevel); } - public void updateXPBar(PrimarySkillType primarySkillType, Plugin plugin) - { + public void updateXPBar(PrimarySkillType primarySkillType, Plugin plugin) { //Skill Unlock Notifications - if(primarySkillType.isChildSkill()) + if (primarySkillType.isChildSkill()) return; //XP BAR UPDATES experienceBarManager.updateExperienceBar(primarySkillType, plugin); } - public double getProgressInCurrentSkillLevel(PrimarySkillType primarySkillType) - { + public double getProgressInCurrentSkillLevel(PrimarySkillType primarySkillType) { double currentXP = profile.getSkillXpLevel(primarySkillType); double maxXP = profile.getXpToLevel(primarySkillType); @@ -269,7 +255,7 @@ public class McMMOPlayer { /** * Set the mode of an ability. * - * @param ability The ability to check + * @param ability The ability to check * @param isActive True if the ability is active, false otherwise */ public void setAbilityMode(SuperAbilityType ability, boolean isActive) { @@ -289,7 +275,7 @@ public class McMMOPlayer { /** * Set the informed state of an ability. * - * @param ability The ability to check + * @param ability The ability to check * @param isInformed True if the ability is informed, false otherwise */ public void setAbilityInformed(SuperAbilityType ability, boolean isInformed) { @@ -330,7 +316,7 @@ public class McMMOPlayer { /** * Set the current prep mode of a tool. * - * @param tool Tool to set the mode for + * @param tool Tool to set the mode for * @param isPrepared true if the tool should be prepped, false otherwise */ public void setToolPreparationMode(ToolType tool, boolean isPrepared) { @@ -421,9 +407,13 @@ public class McMMOPlayer { * Party Chat Spy */ - public boolean isPartyChatSpying() { return chatSpy; } + public boolean isPartyChatSpying() { + return chatSpy; + } - public void togglePartyChatSpying() { chatSpy = !chatSpy;} + public void togglePartyChatSpying() { + chatSpy = !chatSpy; + } /* * Skill notifications @@ -458,7 +448,7 @@ public class McMMOPlayer { * Begins an experience gain. The amount will be affected by skill modifiers, global rate, perks, and may be shared with the party * * @param skill Skill being used - * @param xp Experience amount to process + * @param xp Experience amount to process */ public void beginXpGain(PrimarySkillType skill, float xp, XPGainReason xpGainReason, XPGainSource xpGainSource) { Validate.isTrue(xp >= 0.0, "XP gained should be greater than or equal to zero."); @@ -492,7 +482,7 @@ public class McMMOPlayer { * Begins an experience gain. The amount will be affected by skill modifiers, global rate and perks * * @param skill Skill being used - * @param xp Experience amount to process + * @param xp Experience amount to process */ public void beginUnsharedXpGain(PrimarySkillType skill, float xp, XPGainReason xpGainReason, XPGainSource xpGainSource) { applyXpGain(skill, modifyXpGain(skill, xp), xpGainReason, xpGainSource); @@ -510,7 +500,7 @@ public class McMMOPlayer { * Applies an experience gain * * @param primarySkillType Skill being used - * @param xp Experience amount to add + * @param xp Experience amount to add */ public void applyXpGain(PrimarySkillType primarySkillType, float xp, XPGainReason xpGainReason, XPGainSource xpGainSource) { if (!primarySkillType.getPermissions(player)) { @@ -603,26 +593,26 @@ public class McMMOPlayer { } } - public void setPartyInvite(Party invite) { - this.invite = invite; - } - public Party getPartyInvite() { return invite; } + public void setPartyInvite(Party invite) { + this.invite = invite; + } + public boolean hasPartyInvite() { return (invite != null); } - public void setParty(Party party) { - this.party = party; - } - public Party getParty() { return party; } + public void setParty(Party party) { + this.party = party; + } + public boolean inParty() { return (party != null); } @@ -639,14 +629,14 @@ public class McMMOPlayer { return ptpRecord; } - public void setPartyAllianceInvite(Party allianceInvite) { - this.allianceInvite = allianceInvite; - } - public Party getPartyAllianceInvite() { return allianceInvite; } + public void setPartyAllianceInvite(Party allianceInvite) { + this.allianceInvite = allianceInvite; + } + public boolean hasPartyAllianceInvite() { return (allianceInvite != null); } @@ -746,7 +736,7 @@ public class McMMOPlayer { * Modifies an experience gain using skill modifiers, global rate and perks * * @param primarySkillType Skill being used - * @param xp Experience amount to process + * @param xp Experience amount to process * @return Modified experience */ private float modifyXpGain(PrimarySkillType primarySkillType, float xp) { @@ -769,7 +759,7 @@ public class McMMOPlayer { public void checkGodMode() { if (godMode && !Permissions.mcgod(player) - || godMode && WorldBlacklist.isWorldBlacklisted(player.getWorld())) { + || godMode && WorldBlacklist.isWorldBlacklisted(player.getWorld())) { toggleGodMode(); player.sendMessage(LocaleLoader.getString("Commands.GodMode.Forbidden")); } @@ -798,8 +788,7 @@ public class McMMOPlayer { //TODO: This is hacky and temporary solution until skills are move to the new system //Potential problems with this include skills with two super abilities (ie mining) - if(!skill.isSuperAbilityUnlocked(getPlayer())) - { + if (!skill.isSuperAbilityUnlocked(getPlayer())) { int diff = RankUtils.getSuperAbilityUnlockRequirement(skill.getAbility()) - getSkillLevel(skill); //Inform the player they are not yet skilled enough @@ -833,8 +822,7 @@ public class McMMOPlayer { int ticks; //Ability cap of 0 or below means no cap - if(abilityLengthCap > 0) - { + if (abilityLengthCap > 0) { ticks = PerksUtils.handleActivationPerks(player, 2 + (Math.min(abilityLengthCap, getSkillLevel(skill)) / abilityLengthVar), ability.getMaxLength()); } else { ticks = PerksUtils.handleActivationPerks(player, 2 + (getSkillLevel(skill) / abilityLengthVar), ability.getMaxLength()); @@ -918,7 +906,6 @@ public class McMMOPlayer { * Calculate the time remaining until the ability's cooldown expires. * * @param ability SuperAbilityType whose cooldown to check - * * @return the number of seconds remaining before the cooldown expires */ public int calculateTimeRemaining(SuperAbilityType ability) { @@ -999,7 +986,7 @@ public class McMMOPlayer { UserManager.remove(thisPlayer); - if(Config.getInstance().getScoreboardsEnabled()) + if (Config.getInstance().getScoreboardsEnabled()) ScoreboardManager.teardownPlayer(thisPlayer); if (inParty()) { diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java index 8dd1013a5..0240f8c77 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java @@ -1,17 +1,17 @@ package com.gmail.nossr50.core.datatypes.player; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.datatypes.experience.SkillXpGain; +import com.gmail.nossr50.core.skills.MobHealthbarType; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.skills.MobHealthbarType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.player.PlayerProfileSaveTask; import com.gmail.nossr50.skills.child.FamilyTree; -import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableMap; import java.util.HashMap; @@ -22,20 +22,17 @@ import java.util.concurrent.DelayQueue; public class PlayerProfile { private final String playerName; + /* Skill Data */ + private final Map skills = new HashMap(); // Skill & Level + private final Map skillsXp = new HashMap(); // Skill & XP + private final Map abilityDATS = new HashMap(); // Ability & Cooldown + private final Map uniquePlayerData = new HashMap<>(); //Misc data that doesn't fit into other categories (chimaera wing, etc..) private UUID uuid; private boolean loaded; private volatile boolean changed; - /* HUDs */ private MobHealthbarType mobHealthbarType; private int scoreboardTipsShown; - - /* Skill Data */ - private final Map skills = new HashMap(); // Skill & Level - private final Map skillsXp = new HashMap(); // Skill & XP - private final Map abilityDATS = new HashMap(); // Ability & Cooldown - private final Map uniquePlayerData = new HashMap<>(); //Misc data that doesn't fit into other categories (chimaera wing, etc..) - // Store previous XP gains for deminished returns private DelayQueue gainedSkillsXp = new DelayQueue(); private HashMap rollingSkillsXp = new HashMap(); @@ -158,7 +155,9 @@ public class PlayerProfile { * Cooldowns */ - public int getChimaerWingDATS() { return uniquePlayerData.get(UniqueDataType.CHIMAERA_WING_DATS);} + public int getChimaerWingDATS() { + return uniquePlayerData.get(UniqueDataType.CHIMAERA_WING_DATS); + } protected void setChimaeraWingDATS(int DATS) { changed = true; @@ -170,7 +169,9 @@ public class PlayerProfile { uniquePlayerData.put(uniqueDataType, newData); } - public long getUniqueData(UniqueDataType uniqueDataType) { return uniquePlayerData.get(uniqueDataType); } + public long getUniqueData(UniqueDataType uniqueDataType) { + return uniquePlayerData.get(uniqueDataType); + } /** * Get the current deactivation timestamp of an ability. @@ -186,7 +187,7 @@ public class PlayerProfile { * Set the current deactivation timestamp of an ability. * * @param ability The {@link SuperAbilityType} to set the DATS for - * @param DATS the DATS of the ability + * @param DATS the DATS of the ability */ protected void setAbilityDATS(SuperAbilityType ability, long DATS) { changed = true; @@ -246,7 +247,7 @@ public class PlayerProfile { * Remove Xp from a skill. * * @param skill Type of skill to modify - * @param xp Amount of xp to remove + * @param xp Amount of xp to remove */ public void removeXp(PrimarySkillType skill, int xp) { if (skill.isChildSkill()) { @@ -282,7 +283,7 @@ public class PlayerProfile { changed = true; //Don't allow levels to be negative - if(level < 0) + if (level < 0) level = 0; skills.put(skill, level); @@ -292,7 +293,7 @@ public class PlayerProfile { /** * Add levels to a skill. * - * @param skill Type of skill to add levels to + * @param skill Type of skill to add levels to * @param levels Number of levels to add */ public void addLevels(PrimarySkillType skill, int levels) { @@ -303,7 +304,7 @@ public class PlayerProfile { * Add Experience to a skill. * * @param skill Type of skill to add experience to - * @param xp Number of experience to add + * @param xp Number of experience to add */ public void addXp(PrimarySkillType skill, float xp) { changed = true; @@ -315,8 +316,7 @@ public class PlayerProfile { for (PrimarySkillType parentSkill : parentSkills) { skillsXp.put(parentSkill, skillsXp.get(parentSkill) + dividedXP); } - } - else { + } else { skillsXp.put(skill, skillsXp.get(skill) + xp); } } @@ -342,7 +342,7 @@ public class PlayerProfile { * This is used for diminished XP returns * * @param primarySkillType Skill being used - * @param xp Experience amount to add + * @param xp Experience amount to add */ public void registerXpGain(PrimarySkillType primarySkillType, float xp) { gainedSkillsXp.add(new SkillXpGain(primarySkillType, xp)); diff --git a/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java b/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java index f5a9e46a7..ce1629b5a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java +++ b/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java @@ -14,7 +14,10 @@ public final class LocaleLoader { private static ResourceBundle bundle = null; private static ResourceBundle enBundle = null; - private LocaleLoader() {}; + private LocaleLoader() { + } + + ; public static String getString(String key) { return getString(key, (Object[]) null); @@ -23,7 +26,7 @@ public final class LocaleLoader { /** * Gets the appropriate string from the Locale files. * - * @param key The key to look up the string with + * @param key The key to look up the string with * @param messageArguments Any arguments to be added to the string * @return The properly formatted locale string */ @@ -34,12 +37,10 @@ public final class LocaleLoader { try { return getString(key, bundle, messageArguments); - } - catch (MissingResourceException ex) { + } catch (MissingResourceException ex) { try { return getString(key, enBundle, messageArguments); - } - catch (MissingResourceException ex2) { + } catch (MissingResourceException ex2) { if (!key.contains("Guides")) { mcMMO.p.getLogger().warning("Could not find locale string: " + key); } @@ -80,8 +81,7 @@ public final class LocaleLoader { if (myLocale.length == 1) { locale = new Locale(myLocale[0]); - } - else if (myLocale.length >= 2) { + } else if (myLocale.length >= 2) { locale = new Locale(myLocale[0], myLocale[1]); } diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/AbstractWorld.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/AbstractWorld.java index e16eb44b7..2c587ba5f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/AbstractWorld.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/AbstractWorld.java @@ -10,8 +10,7 @@ public abstract class AbstractWorld implements World { private final String worldName; - public AbstractWorld(String worldName) - { + public AbstractWorld(String worldName) { this.worldName = worldName; } @@ -27,6 +26,7 @@ public abstract class AbstractWorld implements World { /** * Compares this object to another to see if they are equal + * * @param o the other object * @return true if they are equal */ @@ -40,6 +40,7 @@ public abstract class AbstractWorld implements World { /** * The hash code for the object, used for comparisons + * * @return hash code for this object */ @Override diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Location.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Location.java index 52c6ae403..31377eac9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Location.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Location.java @@ -8,24 +8,28 @@ public interface Location { /** * Returns the position of this location on the x-axis + * * @return x-axis position */ double getX(); /** * Returns the position of this location on the y-axis + * * @return y-axis position */ double getY(); /** * Returns the position of this location on the z-axis + * * @return z-axis position */ double getZ(); /** * The world for this Location + * * @return the world of this location */ World getWorld(); diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java index 87981f308..a69a5ca45 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java @@ -3,12 +3,14 @@ package com.gmail.nossr50.core.mcmmo; public interface Nameable extends Named { /** * Change the name for this entity + * * @param newName the new name of this entity */ void setName(String newName); /** * Returns the original name for this entity before any renaming + * * @return the original name of this entity */ String getOriginalName(); diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Named.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Named.java index 63c20a99d..0104a89c1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Named.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Named.java @@ -7,6 +7,7 @@ package com.gmail.nossr50.core.mcmmo; public interface Named { /** * Returns the name of this entity + * * @return this entity */ String getName(); diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Property.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Property.java index ccb92d9aa..1261ad085 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Property.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Property.java @@ -5,31 +5,34 @@ import java.util.Collection; /** * Properties are Comparable key value pairs for a blocks state * In MC this exists in three forms, Integer, Booleans, and Enums - * + *

* This class partially mirrors MC Internals - * */ public interface Property> { /** * The name of the Property + * * @return name of this property */ String getName(); /** * A collection of allowed values for this property + * * @return the allowed values for this property */ Collection getAllowedValues(); /** * The class of the value for this particular property + * * @return the value's class */ Class getValueClass(); /** * The name for a specific value + * * @param value the value to match * @return the name of this value */ diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/World.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/World.java index 04c4569c4..a14760be2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/World.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/World.java @@ -3,6 +3,7 @@ package com.gmail.nossr50.core.mcmmo; public interface World { /** * Gets the name of this World + * * @return the name of this world */ String getName(); diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Block.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Block.java index 588905bdc..9dcfdd847 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Block.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Block.java @@ -4,6 +4,7 @@ import com.gmail.nossr50.core.mcmmo.Property; /** * Represents a container of properties and values for a Block + * * @see Property * @see BlockState */ @@ -12,27 +13,26 @@ public class Block { private final String unlocalizedName; //The name before it is localized (english) private BlockState blockState; - public Block(String unlocalizedName, BlockState blockState) - { + public Block(String unlocalizedName, BlockState blockState) { this.unlocalizedName = unlocalizedName; - this.blockState = blockState; + this.blockState = blockState; } /** * Gets the name of this block in English + * * @return name of this block in English */ - public String getUnlocalizedName() - { + public String getUnlocalizedName() { return unlocalizedName; } /** * Gets the state of this block + * * @return the state of this block */ - public BlockState getBlockState() - { + public BlockState getBlockState() { return blockState; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/BlockState.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/BlockState.java index 444485f04..574137060 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/BlockState.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/BlockState.java @@ -11,7 +11,7 @@ import java.util.Collection; */ public interface BlockState { //This is the immutable map of all properties for this block state - ImmutableMap, Comparable> getImmutablePropertyMap(); + ImmutableMap, Comparable> getImmutablePropertyMap(); //This will return the keyset for properties on this block state Collection> getPropertyKeyset(); @@ -20,24 +20,27 @@ public interface BlockState { /** * Get the value for the given property key + * * @param property the property key - * @param the type of property + * @param the type of property * @return the value, can be null */ > T getPropertyValue(Property property); /** * This will attempt to find a matching property for this block state + * * @param property the property we want to match - * @param value the value we are trying to match - * @param the type of the property - * @param the type of the value + * @param value the value we are trying to match + * @param the type of the property + * @param the type of the value * @return the matching property on this block state, can be null */ , V extends T> BlockState findProperty(Property property, V value); /** * This returns the block that this state belongs to + * * @return the parent Block */ Block getBlock(); diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Entity.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Entity.java index 401adce52..f6c6d9ed7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Entity.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Entity.java @@ -12,12 +12,14 @@ import java.util.UUID; public interface Entity extends Location, Named { /** * The UUID for this entity + * * @return this entity's UUID */ UUID getUUID(); /** * The Location for this entity + * * @return this entity's location */ Location getLocation(); diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Living.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Living.java index 05ff0153c..23be2deb7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Living.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Living.java @@ -6,12 +6,14 @@ package com.gmail.nossr50.core.mcmmo.entity; public interface Living { /** * Whether or not this entity is still alive + * * @return true if the entity is alive */ Boolean isAlive(); /** * Change the health of an entity + * * @param newHealth the new health value for the entity */ void setHealth(int newHealth); @@ -19,6 +21,7 @@ public interface Living { /** * Damage an entity * This damage will be reduced by any defensive modifiers such as armor + * * @param damage the damage to deal to this entity */ void damage(int damage); @@ -26,6 +29,7 @@ public interface Living { /** * Damage an entity and attribute it to a source * This damage will be reduced by any defensive modifiers such as armor + * * @param source the source responsible for the damage * @param damage the damage to deal to this entity */ diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java index 328f5dd69..cd7b23493 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java @@ -10,12 +10,14 @@ public interface Player extends Living, Nameable { /** * Players are not always online + * * @return true if the player is online */ Boolean isOnline(); /** * Gets the McMMOPlayer for this Player + * * @return the associated McMMOPlayer, can be null */ McMMOPlayer getMcMMOPlayer(); diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/Cancellable.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/Cancellable.java index 6237f4447..22e71324c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/Cancellable.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/Cancellable.java @@ -7,12 +7,14 @@ public interface Cancellable { /** * Whether or not the event is cancelled + * * @return true if cancelled */ Boolean isCancelled(); /** * Sets an events cancellation to b + * * @param b */ void setCancelled(boolean b); diff --git a/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java b/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java index c7073a128..45bcbba10 100644 --- a/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.core.party; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.database.UpgradeType; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; @@ -10,16 +11,15 @@ import com.gmail.nossr50.core.datatypes.party.PartyLeader; import com.gmail.nossr50.core.datatypes.party.ShareMode; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.events.party.McMMOPartyAllianceChangeEvent; -import com.gmail.nossr50.events.party.McMMOPartyChangeEvent; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.sounds.SoundManager; import com.gmail.nossr50.core.util.sounds.SoundType; +import com.gmail.nossr50.events.party.McMMOPartyAllianceChangeEvent; +import com.gmail.nossr50.events.party.McMMOPartyChangeEvent; +import com.gmail.nossr50.mcMMO; import org.bukkit.OfflinePlayer; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Player; @@ -36,12 +36,13 @@ public final class PartyManager { private static List parties = new ArrayList(); private static File partyFile = new File(partiesFilePath); - private PartyManager() {} + private PartyManager() { + } /** * Check if a party with a given name already exists. * - * @param player The player to notify + * @param player The player to notify * @param partyName The name of the party to check * @return true if a party with that name exists, false otherwise */ @@ -56,19 +57,19 @@ public final class PartyManager { /** * Checks if the player can join a party, parties can have a size limit, although there is a permission to bypass this - * @param player player who is attempting to join the party + * + * @param player player who is attempting to join the party * @param targetParty the target party * @return true if party is full and cannot be joined */ - public static boolean isPartyFull(Player player, Party targetParty) - { + public static boolean isPartyFull(Player player, Party targetParty) { return !Permissions.partySizeBypass(player) && Config.getInstance().getPartyMaxSize() >= 1 && targetParty.getOnlineMembers().size() >= Config.getInstance().getPartyMaxSize(); } /** * Attempt to change parties or join a new party. * - * @param mcMMOPlayer The player changing or joining parties + * @param mcMMOPlayer The player changing or joining parties * @param newPartyName The name of the party being joined * @return true if the party was joined successfully, false otherwise */ @@ -83,8 +84,8 @@ public final class PartyManager { } removeFromParty(mcMMOPlayer); - } - else return handlePartyChangeEvent(player, null, newPartyName, McMMOPartyChangeEvent.EventReason.JOINED_PARTY); + } else + return handlePartyChangeEvent(player, null, newPartyName, McMMOPartyChangeEvent.EventReason.JOINED_PARTY); return true; } @@ -92,7 +93,7 @@ public final class PartyManager { /** * Check if two online players are in the same party. * - * @param firstPlayer The first player + * @param firstPlayer The first player * @param secondPlayer The second player * @return true if they are in the same party, false otherwise */ @@ -280,7 +281,7 @@ public final class PartyManager { * Remove a player from a party. * * @param player The player to remove - * @param party The party + * @param party The party */ public static void removeFromParty(OfflinePlayer player, Party party) { LinkedHashMap members = party.getMembers(); @@ -294,8 +295,7 @@ public final class PartyManager { if (members.isEmpty()) { parties.remove(party); - } - else { + } else { // If the leaving player was the party leader, appoint a new leader from the party members if (party.getLeader().getUniqueId().equals(player.getUniqueId())) { setPartyLeader(members.keySet().iterator().next(), party); @@ -337,8 +337,8 @@ public final class PartyManager { * Create a new party * * @param mcMMOPlayer The player to add to the party - * @param partyName The party to add the player to - * @param password The password for this party, null if there was no password + * @param partyName The party to add the player to + * @param password The password for this party, null if there was no password */ public static void createParty(McMMOPlayer mcMMOPlayer, String partyName, String password) { Player player = mcMMOPlayer.getPlayer(); @@ -358,8 +358,8 @@ public final class PartyManager { /** * Check if a player can join a party * - * @param player The player trying to join a party - * @param party The party + * @param player The player trying to join a party + * @param party The party * @param password The password provided by the player * @return true if the player can join the party */ @@ -403,8 +403,7 @@ public final class PartyManager { /* * Don't let players join a full party */ - if(Config.getInstance().getPartyMaxSize() > 0 && invite.getMembers().size() >= Config.getInstance().getPartyMaxSize()) - { + if (Config.getInstance().getPartyMaxSize() > 0 && invite.getMembers().size() >= Config.getInstance().getPartyMaxSize()) { NotificationManager.sendPlayerInformation(mcMMOPlayer.getPlayer(), NotificationType.PARTY_MESSAGE, "Commands.Party.PartyFull.InviteAccept", invite.getName(), String.valueOf(Config.getInstance().getPartyMaxSize())); return; } @@ -452,7 +451,7 @@ public final class PartyManager { } } - public static boolean disbandAlliance(Player player, Party firstParty, Party secondParty){ + public static boolean disbandAlliance(Player player, Party firstParty, Party secondParty) { if (!handlePartyChangeAllianceEvent(player, firstParty.getName(), secondParty.getName(), McMMOPartyAllianceChangeEvent.EventReason.DISBAND_ALLIANCE)) { return false; } @@ -478,7 +477,7 @@ public final class PartyManager { * Add a player to a party * * @param mcMMOPlayer The player to add to the party - * @param party The party + * @param party The party */ public static void addToParty(McMMOPlayer mcMMOPlayer, Party party) { Player player = mcMMOPlayer.getPlayer(); @@ -505,7 +504,7 @@ public final class PartyManager { /** * Set the leader of a party. * - * @param uuid The uuid of the player to set as leader + * @param uuid The uuid of the player to set as leader * @param party The party */ public static void setPartyLeader(UUID uuid, Party party) { @@ -517,11 +516,9 @@ public final class PartyManager { if (memberUniqueId.equals(player.getUniqueId())) { member.sendMessage(LocaleLoader.getString("Party.Owner.Player")); - } - else if (memberUniqueId.equals(leaderUniqueId)) { + } else if (memberUniqueId.equals(leaderUniqueId)) { member.sendMessage(LocaleLoader.getString("Party.Owner.NotLeader")); - } - else { + } else { member.sendMessage(LocaleLoader.getString("Party.Owner.New", player.getName())); } } @@ -641,8 +638,7 @@ public final class PartyManager { try { partiesFile.save(partyFile); - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); } } @@ -717,10 +713,10 @@ public final class PartyManager { /** * Handle party change event. * - * @param player The player changing parties + * @param player The player changing parties * @param oldPartyName The name of the old party * @param newPartyName The name of the new party - * @param reason The reason for changing parties + * @param reason The reason for changing parties * @return true if the change event was successful, false otherwise */ public static boolean handlePartyChangeEvent(Player player, String oldPartyName, String newPartyName, McMMOPartyChangeEvent.EventReason reason) { @@ -733,10 +729,10 @@ public final class PartyManager { /** * Handle party alliance change event. * - * @param player The player changing party alliances + * @param player The player changing party alliances * @param oldAllyName The name of the old ally * @param newAllyName The name of the new ally - * @param reason The reason for changing allies + * @param reason The reason for changing allies * @return true if the change event was successful, false otherwise */ public static boolean handlePartyChangeAllianceEvent(Player player, String oldAllyName, String newAllyName, McMMOPartyAllianceChangeEvent.EventReason reason) { @@ -760,9 +756,9 @@ public final class PartyManager { /** * Notify party members when the party levels up. * - * @param party The concerned party + * @param party The concerned party * @param levelsGained The amount of levels gained - * @param level The current party level + * @param level The current party level */ public static void informPartyMembersLevelUp(Party party, int levelsGained, int level) { boolean levelUpSoundsEnabled = Config.getInstance().getLevelUpSoundsEnabled(); @@ -778,7 +774,7 @@ public final class PartyManager { /** * Notify party members when a player joins. * - * @param party The concerned party + * @param party The concerned party * @param playerName The name of the player that joined */ private static void informPartyMembersJoin(Party party, String playerName) { @@ -790,7 +786,7 @@ public final class PartyManager { /** * Notify party members when a party member quits. * - * @param party The concerned party + * @param party The concerned party * @param playerName The name of the player that left */ private static void informPartyMembersQuit(Party party, String playerName) { diff --git a/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java b/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java index 01d20a276..251629827 100644 --- a/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java +++ b/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java @@ -1,7 +1,8 @@ package com.gmail.nossr50.core.party; -import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.party.ItemWeightConfig; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.party.ItemShareType; @@ -10,7 +11,6 @@ import com.gmail.nossr50.core.datatypes.party.ShareMode; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Misc; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -18,13 +18,14 @@ import org.bukkit.inventory.ItemStack; import java.util.List; public final class ShareHandler { - private ShareHandler() {} + private ShareHandler() { + } /** * Distribute Xp amongst party members. * - * @param xp Xp without party sharing - * @param mcMMOPlayer Player initiating the Xp gain + * @param xp Xp without party sharing + * @param mcMMOPlayer Player initiating the Xp gain * @param primarySkillType Skill being used * @return True is the xp has been shared */ @@ -57,7 +58,7 @@ public final class ShareHandler { /** * Distribute Items amongst party members. * - * @param drop Item that will get shared + * @param drop Item that will get shared * @param mcMMOPlayer Player who picked up the item * @return True if the item has been shared */ @@ -146,11 +147,9 @@ public final class ShareHandler { public static XPGainReason getSharedXpGainReason(XPGainReason xpGainReason) { if (xpGainReason == XPGainReason.PVE) { return XPGainReason.SHARED_PVE; - } - else if (xpGainReason == XPGainReason.PVP) { + } else if (xpGainReason == XPGainReason.PVP) { return XPGainReason.SHARED_PVP; - } - else { + } else { return xpGainReason; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java b/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java index 3822fc6e0..9d7bd360b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java +++ b/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java @@ -8,30 +8,35 @@ public interface Platform { /** * Gets the name of the Platform + * * @return name of this platform */ String getPlatformName(); /** * Gets the version of this platform + * * @return the current version of this platform */ String getPlatformVersion(); /** * Gets the target version of Minecraft for this platform + * * @return this platform's target minecraft version */ String getTargetMinecraftVersion(); /** * Whether or not this platform has been loaded + * * @return true if the platform is loaded */ Boolean isPlatformLoaded(); /** * Gets the PlatformSoftwareType for this platform + * * @return this PlatformSoftwareType */ PlatformSoftwareType getPlatformSoftwareType(); diff --git a/core/src/main/java/com/gmail/nossr50/core/platform/TargetMinecraftVersion.java b/core/src/main/java/com/gmail/nossr50/core/platform/TargetMinecraftVersion.java index 0452128dd..2a06d4da1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/platform/TargetMinecraftVersion.java +++ b/core/src/main/java/com/gmail/nossr50/core/platform/TargetMinecraftVersion.java @@ -2,10 +2,11 @@ package com.gmail.nossr50.core.platform; /** * Constants for targeted versions of MC + * * @see Platform#getTargetMinecraftVersion() */ public class TargetMinecraftVersion { - public static final String MC_VERSION_1_8_8 = "1_8_8"; - public static final String MC_VERSION_1_12_2 = "1_12_2"; - public static final String MC_VERSION_1_13_2 = "1_13_2"; + public static final String MC_VERSION_1_8_8 = "1_8_8"; + public static final String MC_VERSION_1_12_2 = "1_12_2"; + public static final String MC_VERSION_1_13_2 = "1_13_2"; } diff --git a/core/src/main/java/com/gmail/nossr50/core/platform/drivers/PlatformDriver.java b/core/src/main/java/com/gmail/nossr50/core/platform/drivers/PlatformDriver.java index 571b097d3..f90d3415f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/platform/drivers/PlatformDriver.java +++ b/core/src/main/java/com/gmail/nossr50/core/platform/drivers/PlatformDriver.java @@ -8,12 +8,14 @@ import com.gmail.nossr50.core.platform.Platform; public interface PlatformDriver { /** * Return the platform for this Driver + * * @return this platform */ Platform getPlatform(); /** * Gets the target MC Version for this driver + * * @return the target MC Version for this driver */ String getTargetMinecraftVersion(); diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/PistonTrackerTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/PistonTrackerTask.java index f9e4615d1..b137ebd96 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/PistonTrackerTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/PistonTrackerTask.java @@ -36,8 +36,7 @@ public class PistonTrackerTask extends BukkitRunnable { if (nextBlock.hasMetadata(mcMMO.blockMetadataKey)) { mcMMO.getPlaceStore().setTrue(nextBlock); nextBlock.removeMetadata(mcMMO.blockMetadataKey, mcMMO.p); - } - else if (mcMMO.getPlaceStore().isTrue(nextBlock)) { + } else if (mcMMO.getPlaceStore().isTrue(nextBlock)) { // Block doesn't have metadatakey but isTrue - set it to false mcMMO.getPlaceStore().setFalse(nextBlock); } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/SaveTimerTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/SaveTimerTask.java index 59bdc4357..8620f2520 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/SaveTimerTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/SaveTimerTask.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.core.runnables; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.runnables.player.PlayerProfileSaveTask; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.scheduler.BukkitRunnable; public class SaveTimerTask extends BukkitRunnable { diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java index d7dddac84..b24466463 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java @@ -51,13 +51,11 @@ public class CleanBackupsTask extends BukkitRunnable { if (isPast24Hours(date) && Config.getInstance().getKeepLast24Hours()) { // Keep all files from the last 24 hours continue; - } - else if (isLastWeek(date) && !savedDays.contains(dayOfWeek) && Config.getInstance().getKeepDailyLastWeek()) { + } else if (isLastWeek(date) && !savedDays.contains(dayOfWeek) && Config.getInstance().getKeepDailyLastWeek()) { // Keep daily backups of the past week savedDays.add(dayOfWeek); continue; - } - else { + } else { List savedWeeks = savedYearsWeeks.get(year); if (savedWeeks == null) { savedWeeks = new ArrayList(); @@ -92,7 +90,6 @@ public class CleanBackupsTask extends BukkitRunnable { * Check if date is within last 24 hours * * @param date date to check - * * @return true is date is within last 24 hours, false if otherwise */ private boolean isPast24Hours(Date date) { @@ -104,7 +101,6 @@ public class CleanBackupsTask extends BukkitRunnable { * Check if date is within the last week * * @param date date to check - * * @return true is date is within the last week, false if otherwise */ private boolean isLastWeek(Date date) { @@ -118,8 +114,7 @@ public class CleanBackupsTask extends BukkitRunnable { try { date = dateFormat.parse(fileName); - } - catch (ParseException e) { + } catch (ParseException e) { return null; } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java index f474c8f35..e0095ac37 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.core.runnables.commands; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import org.bukkit.command.CommandSender; @@ -63,8 +63,7 @@ public class McrankCommandDisplayTask extends BukkitRunnable { public void displayBoard() { if (sender.getName().equalsIgnoreCase(playerName)) { ScoreboardManager.showPlayerRankScoreboard((Player) sender, skills); - } - else { + } else { ScoreboardManager.showPlayerRankScoreboardOthers((Player) sender, playerName, skills); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java index b0d95823d..7c3c287df 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java @@ -2,8 +2,8 @@ package com.gmail.nossr50.core.runnables.commands; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.database.PlayerStat; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import org.bukkit.ChatColor; @@ -45,25 +45,22 @@ public class MctopCommandDisplayTask extends BukkitRunnable { if (sender instanceof Player) { ((Player) sender).removeMetadata(mcMMO.databaseCommandKey, mcMMO.p); } - if(sender instanceof Player) + if (sender instanceof Player) sender.sendMessage(LocaleLoader.getString("Commands.mctop.Tip")); } private void displayChat() { if (skill == null) { - if(sender instanceof Player) { + if (sender instanceof Player) { sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Leaderboard")); - } - else { + } else { sender.sendMessage(ChatColor.stripColor(LocaleLoader.getString("Commands.PowerLevel.Leaderboard"))); } - } - else { - if(sender instanceof Player) { + } else { + if (sender instanceof Player) { sender.sendMessage(LocaleLoader.getString("Commands.Skill.Leaderboard", skill.getName())); - } - else { + } else { sender.sendMessage(ChatColor.stripColor(LocaleLoader.getString("Commands.Skill.Leaderboard", skill.getName()))); } } @@ -74,13 +71,12 @@ public class MctopCommandDisplayTask extends BukkitRunnable { // Format: // 01. Playername - skill value // 12. Playername - skill value - if(sender instanceof Player) { + if (sender instanceof Player) { sender.sendMessage(String.format("%2d. %s%s - %s%s", place, ChatColor.GREEN, stat.name, ChatColor.WHITE, stat.statVal)); - } - else { + } else { sender.sendMessage(String.format("%2d. %s - %s", place, stat.name, stat.statVal)); } - + place++; } } @@ -88,8 +84,7 @@ public class MctopCommandDisplayTask extends BukkitRunnable { private void displayBoard() { if (skill == null) { ScoreboardManager.showTopPowerScoreboard((Player) sender, page, userStats); - } - else { + } else { ScoreboardManager.showTopScoreboard((Player) sender, skill, page, userStats); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/database/FormulaConversionTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/database/FormulaConversionTask.java index 87e11786f..0cc08b401 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/database/FormulaConversionTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/database/FormulaConversionTask.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.core.runnables.database; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.data.database.DatabaseManager; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.CommandSender; import org.bukkit.scheduler.BukkitRunnable; @@ -42,8 +42,7 @@ public class FormulaConversionTask extends BukkitRunnable { editValues(profile); // Since this is a temporary profile, we save it here. profile.scheduleAsyncSave(); - } - else { + } else { profile = mcMMOPlayer.getProfile(); editValues(profile); } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/database/UUIDUpdateAsyncTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UUIDUpdateAsyncTask.java index f13abc478..daee47db9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/database/UUIDUpdateAsyncTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UUIDUpdateAsyncTask.java @@ -15,12 +15,11 @@ import java.util.UUID; import java.util.logging.Level; public class UUIDUpdateAsyncTask extends BukkitRunnable { - private mcMMO plugin; private static final int MAX_LOOKUP = Math.max(HiddenConfig.getInstance().getUUIDConvertAmount(), 100); private static final int RATE_LIMIT = HiddenConfig.getInstance().getMojangRateLimit(); private static final long LIMIT_PERIOD = HiddenConfig.getInstance().getMojangLimitPeriod(); private static final int BATCH_SIZE = MAX_LOOKUP * 3; - + private mcMMO plugin; private List userNames; private int size; private int checkedUsers; @@ -57,16 +56,14 @@ public class UUIDUpdateAsyncTask extends BukkitRunnable { if (size > MAX_LOOKUP) { userNamesSection = userNames.subList(size - MAX_LOOKUP, size); size -= MAX_LOOKUP; - } - else { + } else { userNamesSection = userNames.subList(0, size); size = 0; } try { fetchedUUIDs.putAll(new UUIDFetcher(userNamesSection).call()); - } - catch (Exception e) { + } catch (Exception e) { // Handle 429 if (e.getMessage().contains("429")) { size += userNamesSection.size(); diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java index abecece74..01bf1d877 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java @@ -8,6 +8,7 @@ import java.util.concurrent.locks.ReentrantLock; public class UserPurgeTask extends BukkitRunnable { private ReentrantLock lock = new ReentrantLock(); + @Override public void run() { lock.lock(); diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/player/ClearRegisteredXPGainTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/player/ClearRegisteredXPGainTask.java index 3bd53222e..4e775e865 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/player/ClearRegisteredXPGainTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/player/ClearRegisteredXPGainTask.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.runnables.player; -import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import org.bukkit.scheduler.BukkitRunnable; public class ClearRegisteredXPGainTask extends BukkitRunnable { diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java index 733790134..e9a77e0be 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.core.runnables.player; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.runnables.commands.McScoreboardKeepTask; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import org.bukkit.Server; import org.bukkit.entity.Player; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewCheckTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewCheckTask.java index bcb0c712b..34fe29488 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewCheckTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewCheckTask.java @@ -31,8 +31,7 @@ public class AlchemyBrewCheckTask extends BukkitRunnable { if (oldInventory[Alchemy.INGREDIENT_SLOT] == null || newInventory[Alchemy.INGREDIENT_SLOT] == null || !oldInventory[Alchemy.INGREDIENT_SLOT].isSimilar(newInventory[Alchemy.INGREDIENT_SLOT]) || !validBrew) { Alchemy.brewingStandMap.get(location).cancelBrew(); } - } - else if (validBrew) { + } else if (validBrew) { Alchemy.brewingStandMap.put(location, new AlchemyBrewTask(brewingStand, player)); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewTask.java index 6b42e0f35..a378f4b7d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewTask.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.core.runnables.skills; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy; +import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyPotionBrewer; import com.gmail.nossr50.events.skills.alchemy.McMMOPlayerBrewEvent; import com.gmail.nossr50.events.skills.alchemy.McMMOPlayerCatalysisEvent; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy; -import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyPotionBrewer; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.BlockState; @@ -19,7 +19,7 @@ import org.bukkit.scheduler.BukkitRunnable; public class AlchemyBrewTask extends BukkitRunnable { private static double DEFAULT_BREW_SPEED = 1.0; - private static int DEFAULT_BREW_TICKS = 400; + private static int DEFAULT_BREW_TICKS = 400; private BlockState brewingStand; private Location location; @@ -84,8 +84,7 @@ public class AlchemyBrewTask extends BukkitRunnable { if (brewTimer < Math.max(brewSpeed, 2)) { this.cancel(); finish(); - } - else { + } else { ((BrewingStand) brewingStand).setBrewingTime((int) brewTimer); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedContainer.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedContainer.java index ac4567afb..671d918c8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedContainer.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedContainer.java @@ -8,11 +8,10 @@ public class BleedContainer { public LivingEntity target; public LivingEntity damageSource; - public BleedContainer(LivingEntity target, int bleedTicks, int bleedRank, LivingEntity damageSource) - { - this.target = target; - this.bleedTicks = bleedTicks; - this.bleedRank = bleedRank; - this.damageSource = damageSource; + public BleedContainer(LivingEntity target, int bleedTicks, int bleedRank, LivingEntity damageSource) { + this.target = target; + this.bleedTicks = bleedTicks; + this.bleedRank = bleedRank; + this.damageSource = damageSource; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedTimerTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedTimerTask.java index 83a8c2b48..ebd0286d4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedTimerTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedTimerTask.java @@ -21,6 +21,46 @@ import java.util.Map.Entry; public class BleedTimerTask extends BukkitRunnable { private static Map bleedList = new HashMap(); + public static BleedContainer copyContainer(BleedContainer container) { + LivingEntity target = container.target; + LivingEntity source = container.damageSource; + int bleedTicks = container.bleedTicks; + int bleedRank = container.bleedRank; + + BleedContainer newContainer = new BleedContainer(target, bleedTicks, bleedRank, source); + return newContainer; + } + + /** + * Instantly Bleed out a LivingEntity + * + * @param entity LivingEntity to bleed out + */ + public static void bleedOut(LivingEntity entity) { + /* + * Don't remove anything from the list outside of run() + */ + + if (bleedList.containsKey(entity)) { + CombatUtils.dealNoInvulnerabilityTickDamage(entity, bleedList.get(entity).bleedTicks * 2, bleedList.get(entity).damageSource); + } + } + + /** + * Add a LivingEntity to the bleedList if it is not in it. + * + * @param entity LivingEntity to add + * @param ticks Number of bleeding ticks + */ + public static void add(LivingEntity entity, LivingEntity attacker, int ticks, int bleedRank) { + BleedContainer newBleedContainer = new BleedContainer(entity, ticks, bleedRank, attacker); + bleedList.put(entity, newBleedContainer); + } + + public static boolean isBleeding(LivingEntity entity) { + return bleedList.containsKey(entity); + } + @Override public void run() { Iterator> bleedIterator = bleedList.entrySet().iterator(); @@ -75,45 +115,4 @@ public class BleedTimerTask extends BukkitRunnable { containerEntry.setValue(loweredBleedContainer); } } - - public static BleedContainer copyContainer(BleedContainer container) - { - LivingEntity target = container.target; - LivingEntity source = container.damageSource; - int bleedTicks = container.bleedTicks; - int bleedRank = container.bleedRank; - - BleedContainer newContainer = new BleedContainer(target, bleedTicks, bleedRank, source); - return newContainer; - } - - /** - * Instantly Bleed out a LivingEntity - * - * @param entity LivingEntity to bleed out - */ - public static void bleedOut(LivingEntity entity) { - /* - * Don't remove anything from the list outside of run() - */ - - if (bleedList.containsKey(entity)) { - CombatUtils.dealNoInvulnerabilityTickDamage(entity, bleedList.get(entity).bleedTicks * 2, bleedList.get(entity).damageSource); - } - } - - /** - * Add a LivingEntity to the bleedList if it is not in it. - * - * @param entity LivingEntity to add - * @param ticks Number of bleeding ticks - */ - public static void add(LivingEntity entity, LivingEntity attacker, int ticks, int bleedRank) { - BleedContainer newBleedContainer = new BleedContainer(entity, ticks, bleedRank, attacker); - bleedList.put(entity, newBleedContainer); - } - - public static boolean isBleeding(LivingEntity entity) { - return bleedList.containsKey(entity); - } } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ExperienceBarHideTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ExperienceBarHideTask.java index 383f3c725..d6ca141e2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ExperienceBarHideTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ExperienceBarHideTask.java @@ -10,8 +10,7 @@ public class ExperienceBarHideTask extends BukkitRunnable { public final PrimarySkillType primarySkillType; public final ExperienceBarManager experienceBarManagerRef; - public ExperienceBarHideTask(ExperienceBarManager experienceBarManagerRef, McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType) - { + public ExperienceBarHideTask(ExperienceBarManager experienceBarManagerRef, McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType) { this.experienceBarManagerRef = experienceBarManagerRef; this.mcMMOPlayer = mcMMOPlayer; this.primarySkillType = primarySkillType; @@ -30,7 +29,7 @@ public class ExperienceBarHideTask extends BukkitRunnable { */ @Override public void run() { - if(experienceBarManagerRef == null || mcMMOPlayer == null) + if (experienceBarManagerRef == null || mcMMOPlayer == null) return; experienceBarManagerRef.hideExperienceBar(primarySkillType); diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/SkillUnlockNotificationTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/SkillUnlockNotificationTask.java index 509eec752..e597ce833 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/SkillUnlockNotificationTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/SkillUnlockNotificationTask.java @@ -10,18 +10,20 @@ public class SkillUnlockNotificationTask extends BukkitRunnable { private McMMOPlayer mcMMOPlayer; private SubSkillType subSkillType; private int rank; + /** * Notify a player about a newly unlocked subskill - * @param mcMMOPlayer target player + * + * @param mcMMOPlayer target player * @param subSkillType the subskill that they just unlocked - * @param rank the rank of the subskill + * @param rank the rank of the subskill */ - public SkillUnlockNotificationTask(McMMOPlayer mcMMOPlayer, SubSkillType subSkillType, int rank) - { + public SkillUnlockNotificationTask(McMMOPlayer mcMMOPlayer, SubSkillType subSkillType, int rank) { this.mcMMOPlayer = mcMMOPlayer; this.subSkillType = subSkillType; this.rank = rank; } + /** * When an object implementing interface Runnable is used * to create a thread, starting the thread causes the object's diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/ModConfigType.java b/core/src/main/java/com/gmail/nossr50/core/skills/ModConfigType.java index 267b4be6f..5eef0bbc0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/ModConfigType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/ModConfigType.java @@ -9,11 +9,9 @@ public enum ModConfigType { public static ModConfigType getModConfigType(String materialName) { if (materialName.contains("HELM") || (materialName.contains("CHEST") && !materialName.contains("CHESTNUT")) || materialName.contains("LEGS") || materialName.contains("LEGGINGS") || materialName.contains("BOOT")) { return ARMOR; - } - else if (materialName.contains("PICKAXE") || materialName.contains("AXE") || (materialName.contains("BOW") && !materialName.contains("BOWL")) || materialName.contains("HOE") || materialName.contains("SHOVEL") || materialName.contains("SWORD")) { + } else if (materialName.contains("PICKAXE") || materialName.contains("AXE") || (materialName.contains("BOW") && !materialName.contains("BOWL")) || materialName.contains("HOE") || materialName.contains("SHOVEL") || materialName.contains("SWORD")) { return TOOLS; - } - else if (materialName.contains("LOG") || materialName.contains("LEAVES") || materialName.contains("FLOWER") || materialName.contains("PLANT") || materialName.contains("CROP") || materialName.contains("ORE") || materialName.contains("DIRT") || materialName.contains("SAND") || materialName.contains("GRASS")) { + } else if (materialName.contains("LOG") || materialName.contains("LEAVES") || materialName.contains("FLOWER") || materialName.contains("PLANT") || materialName.contains("CROP") || materialName.contains("ORE") || materialName.contains("DIRT") || materialName.contains("SAND") || materialName.contains("GRASS")) { return BLOCKS; } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/PotionStage.java b/core/src/main/java/com/gmail/nossr50/core/skills/PotionStage.java index acb3b31cd..33d21ea62 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/PotionStage.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/PotionStage.java @@ -21,10 +21,6 @@ public enum PotionStage { this.numerical = numerical; } - public int toNumerical() { - return numerical; - } - private static PotionStage getPotionStageNumerical(int numerical) { for (PotionStage potionStage : values()) { if (numerical >= potionStage.toNumerical()) { @@ -60,12 +56,12 @@ public enum PotionStage { } // Check if potion has a glowstone dust amplifier - // Else check if the potion has a custom effect with an amplifier added by mcMMO + // Else check if the potion has a custom effect with an amplifier added by mcMMO if (data.isUpgraded()) { stage++; - } else if(!effects.isEmpty()) { - for (PotionEffect effect : effects){ - if(effect.getAmplifier() > 0){ + } else if (!effects.isEmpty()) { + for (PotionEffect effect : effects) { + if (effect.getAmplifier() > 0) { stage++; break; } @@ -84,4 +80,8 @@ public enum PotionStage { return PotionStage.getPotionStageNumerical(stage); } + + public int toNumerical() { + return numerical; + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java b/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java index 91c2dfe26..f9d399059 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java @@ -1,10 +1,9 @@ package com.gmail.nossr50.core.skills; -import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.skills.acrobatics.AcrobaticsManager; import com.gmail.nossr50.skills.alchemy.AlchemyManager; import com.gmail.nossr50.skills.archery.ArcheryManager; @@ -51,18 +50,10 @@ public enum PrimarySkillType { UNARMED(UnarmedManager.class, Color.BLACK, SuperAbilityType.BERSERK, ToolType.FISTS, ImmutableList.of(SubSkillType.UNARMED_BERSERK, SubSkillType.UNARMED_BLOCK_CRACKER, SubSkillType.UNARMED_ARROW_DEFLECT, SubSkillType.UNARMED_DISARM, SubSkillType.UNARMED_IRON_ARM_STYLE, SubSkillType.UNARMED_IRON_GRIP)), WOODCUTTING(WoodcuttingManager.class, Color.OLIVE, SuperAbilityType.TREE_FELLER, ToolType.AXE, ImmutableList.of(SubSkillType.WOODCUTTING_LEAF_BLOWER, SubSkillType.WOODCUTTING_TREE_FELLER, SubSkillType.WOODCUTTING_HARVEST_LUMBER)); - private Class managerClass; - private Color runescapeColor; - private SuperAbilityType ability; - private ToolType tool; - private List subSkillTypes; - public static final List SKILL_NAMES; public static final List SUBSKILL_NAMES; - public static final List CHILD_SKILLS; public static final List NON_CHILD_SKILLS; - public static final List COMBAT_SKILLS = ImmutableList.of(ARCHERY, AXES, SWORDS, TAMING, UNARMED); public static final List GATHERING_SKILLS = ImmutableList.of(EXCAVATION, FISHING, HERBALISM, MINING, WOODCUTTING); public static final List MISC_SKILLS = ImmutableList.of(ACROBATICS, ALCHEMY, REPAIR, SALVAGE, SMELTING); @@ -76,13 +67,11 @@ public enum PrimarySkillType { for (PrimarySkillType skill : values()) { if (skill.isChildSkill()) { childSkills.add(skill); - } - else { + } else { nonChildSkills.add(skill); } - for(SubSkillType subSkillType : skill.subSkillTypes) - { + for (SubSkillType subSkillType : skill.subSkillTypes) { subSkillNames.add(subSkillType.getNiceNameNoSpaces(subSkillType)); } names.add(skill.getName()); @@ -96,6 +85,12 @@ public enum PrimarySkillType { NON_CHILD_SKILLS = ImmutableList.copyOf(nonChildSkills); } + private Class managerClass; + private Color runescapeColor; + private SuperAbilityType ability; + private ToolType tool; + private List subSkillTypes; + private PrimarySkillType(Class managerClass, Color runescapeColor, List subSkillTypes) { this(managerClass, runescapeColor, null, null, subSkillTypes); } @@ -108,6 +103,47 @@ public enum PrimarySkillType { this.subSkillTypes = subSkillTypes; } + public static PrimarySkillType getSkill(String skillName) { + if (!Config.getInstance().getLocale().equalsIgnoreCase("en_US")) { + for (PrimarySkillType type : values()) { + if (skillName.equalsIgnoreCase(LocaleLoader.getString(StringUtils.getCapitalized(type.name()) + ".SkillName"))) { + return type; + } + } + } + + for (PrimarySkillType type : values()) { + if (type.name().equalsIgnoreCase(skillName)) { + return type; + } + } + + if (!skillName.equalsIgnoreCase("all")) { + mcMMO.p.getLogger().warning("Invalid mcMMO skill (" + skillName + ")"); //TODO: Localize + } + + return null; + } + + public static PrimarySkillType bySecondaryAbility(SubSkillType subSkillType) { + for (PrimarySkillType type : values()) { + if (type.getSkillAbilities().contains(subSkillType)) { + return type; + } + } + return null; + } + + public static PrimarySkillType byAbility(SuperAbilityType ability) { + for (PrimarySkillType type : values()) { + if (type.getAbility() == ability) { + return type; + } + } + + return null; + } + public Class getManagerClass() { return managerClass; } @@ -125,7 +161,9 @@ public enum PrimarySkillType { return Config.getInstance().getLevelCap(this); } - public boolean isSuperAbilityUnlocked(Player player) { return RankUtils.getRank(player, getAbility().getSubSkillTypeDefinition()) >= 1; } + public boolean isSuperAbilityUnlocked(Player player) { + return RankUtils.getRank(player, getAbility().getSubSkillTypeDefinition()) >= 1; + } public boolean getPVPEnabled() { return Config.getInstance().getPVPEnabled(this); @@ -167,28 +205,6 @@ public enum PrimarySkillType { return ExperienceConfig.getInstance().getFormulaSkillModifier(this); } - public static PrimarySkillType getSkill(String skillName) { - if (!Config.getInstance().getLocale().equalsIgnoreCase("en_US")) { - for (PrimarySkillType type : values()) { - if (skillName.equalsIgnoreCase(LocaleLoader.getString(StringUtils.getCapitalized(type.name()) + ".SkillName"))) { - return type; - } - } - } - - for (PrimarySkillType type : values()) { - if (type.name().equalsIgnoreCase(skillName)) { - return type; - } - } - - if (!skillName.equalsIgnoreCase("all")) { - mcMMO.p.getLogger().warning("Invalid mcMMO skill (" + skillName + ")"); //TODO: Localize - } - - return null; - } - // TODO: This is a little "hacky", we probably need to add something to distinguish child skills in the enum, or to use another enum for them public boolean isChildSkill() { switch (this) { @@ -201,25 +217,6 @@ public enum PrimarySkillType { } } - public static PrimarySkillType bySecondaryAbility(SubSkillType subSkillType) { - for (PrimarySkillType type : values()) { - if (type.getSkillAbilities().contains(subSkillType)) { - return type; - } - } - return null; - } - - public static PrimarySkillType byAbility(SuperAbilityType ability) { - for (PrimarySkillType type : values()) { - if (type.getAbility() == ability) { - return type; - } - } - - return null; - } - public String getName() { return Config.getInstance().getLocale().equalsIgnoreCase("en_US") ? StringUtils.getCapitalized(this.toString()) : StringUtils.getCapitalized(LocaleLoader.getString(StringUtils.getCapitalized(this.toString()) + ".SkillName")); } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/SkillManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/SkillManager.java index c15dd3f90..3866baa0b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/SkillManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/SkillManager.java @@ -26,7 +26,8 @@ public abstract class SkillManager { /** * Applies XP to a player, provides SELF as an XpGainSource source - * @param xp amount of XP to apply + * + * @param xp amount of XP to apply * @param xpGainReason the reason for the XP gain * @deprecated use applyXpGain(float, XPGainReason, XPGainSource) */ @@ -37,7 +38,8 @@ public abstract class SkillManager { /** * Applies XP to a player - * @param xp amount of XP to apply + * + * @param xp amount of XP to apply * @param xpGainReason the reason for the XP gain * @param xpGainSource the source of the XP */ diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillFlags.java b/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillFlags.java index 96be040da..453d288e7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillFlags.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillFlags.java @@ -6,14 +6,14 @@ public class SubSkillFlags { * These are so I can flag properties for subskills * Flags are in the power of 2 because binary is a base-2 system */ - public static final int ACTIVE = 1; //Active subskills are ones that aren't passive - public static final int SUPERABILITY = 2; // Super abilities are redundantly active - public static final int RNG = 4; //If the subskill makes use of RNG - public static final int PVP = 8; //If the subskill has properties that change in PVP conditions - public static final int TIMED = 16; //If the subskill has a duration or time component - public static final int TARGET_COLLECTION = 32; //If the subskill has multiple target types - public static final int REWARD_COLLECTION = 64; //If the subskill has multiple reward types - public static final int CHARGES = 128; - public static final int LIMITED = 256; + public static final int ACTIVE = 1; //Active subskills are ones that aren't passive + public static final int SUPERABILITY = 2; // Super abilities are redundantly active + public static final int RNG = 4; //If the subskill makes use of RNG + public static final int PVP = 8; //If the subskill has properties that change in PVP conditions + public static final int TIMED = 16; //If the subskill has a duration or time component + public static final int TARGET_COLLECTION = 32; //If the subskill has multiple target types + public static final int REWARD_COLLECTION = 64; //If the subskill has multiple reward types + public static final int CHARGES = 128; + public static final int LIMITED = 256; //public static final int RANDOM_ACTIVATION = 128; //If the subskill has random activation } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillType.java b/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillType.java index 5d7120e4c..e4c5b5da2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillType.java @@ -94,11 +94,11 @@ public enum SubSkillType { UNARMED_IRON_GRIP(1), /* Woodcutting */ -/* WOODCUTTING_BARK_SURGEON(3),*/ + /* WOODCUTTING_BARK_SURGEON(3),*/ WOODCUTTING_HARVEST_LUMBER(1), WOODCUTTING_LEAF_BLOWER(1), -/* WOODCUTTING_NATURES_BOUNTY(3), - WOODCUTTING_SPLINTER(3),*/ + /* WOODCUTTING_NATURES_BOUNTY(3), + WOODCUTTING_SPLINTER(3),*/ WOODCUTTING_TREE_FELLER(1); private final int numRanks; @@ -106,32 +106,34 @@ public enum SubSkillType { /** * If our SubSkillType has more than 1 rank define it + * * @param numRanks The number of ranks our SubSkillType has */ - SubSkillType(int numRanks) - { + SubSkillType(int numRanks) { this.numRanks = numRanks; } - SubSkillType() - { + SubSkillType() { this.numRanks = 0; } - public int getNumRanks() - { + public int getNumRanks() { return numRanks; } /** * !!! This relies on the immutable lists in PrimarySkillType being populated !!! * If we add skills, those immutable lists need to be updated + * * @return */ - public PrimarySkillType getParentSkill() { return PrimarySkillType.bySecondaryAbility(this); } + public PrimarySkillType getParentSkill() { + return PrimarySkillType.bySecondaryAbility(this); + } /** * Returns the root address for this skill in the advanced.yml file + * * @return the root address for this skill in advanced.yml */ public String getAdvConfigAddress() { @@ -140,6 +142,7 @@ public enum SubSkillType { /** * Returns the root address for this skill in the rankskills.yml file + * * @return the root address for this skill in rankskills.yml */ public String getRankConfigAddress() { @@ -148,16 +151,17 @@ public enum SubSkillType { /** * Get the string representation of the permission node for this subskill + * * @return the permission node for this subskill */ - public String getPermissionNodeAddress() - { + public String getPermissionNodeAddress() { //TODO: This could be optimized return "mcmmo.ability." + getParentSkill().toString().toLowerCase() + "." + getConfigName(toString()).toLowerCase(); } /** * Returns the name of the skill as it is used in advanced.yml and other config files + * * @return the yaml identifier for this skill */ private String getConfigName(String subSkillName) { @@ -181,12 +185,10 @@ public enum SubSkillType { * Split the string up so we can capitalize each part */ String subskillNameWithoutPrefix = subSkillName.substring(subStringIndex); - if(subskillNameWithoutPrefix.contains("_")) - { + if (subskillNameWithoutPrefix.contains("_")) { String splitStrings[] = subskillNameWithoutPrefix.split("_"); - for(String string : splitStrings) - { + for (String string : splitStrings) { endResult += StringUtils.getCapitalized(string); } } else { @@ -207,14 +209,12 @@ public enum SubSkillType { * Split the string up so we can capitalize each part */ String subskillNameWithoutPrefix = subSkillName.substring(subStringIndex); - if(subskillNameWithoutPrefix.contains("_")) - { + if (subskillNameWithoutPrefix.contains("_")) { String splitStrings[] = subskillNameWithoutPrefix.split("_"); - for(int i = 0; i < splitStrings.length; i++) - { - if(i+1 >= splitStrings.length) - endResult+=StringUtils.getCapitalized(splitStrings[i]); + for (int i = 0; i < splitStrings.length; i++) { + if (i + 1 >= splitStrings.length) + endResult += StringUtils.getCapitalized(splitStrings[i]); else { endResult += StringUtils.getCapitalized(splitStrings[i]); endResult += "_"; @@ -229,25 +229,26 @@ public enum SubSkillType { /** * Returns the name of the parent skill from the Locale file + * * @return The parent skill as defined in the locale */ - public String getParentNiceNameLocale() - { - return LocaleLoader.getString(StringUtils.getCapitalized(getParentSkill().toString())+".SkillName"); + public String getParentNiceNameLocale() { + return LocaleLoader.getString(StringUtils.getCapitalized(getParentSkill().toString()) + ".SkillName"); } /** * Gets the "nice" name of the subskill without spaces + * * @param subSkillType target subskill * @return the "nice" name without spaces */ - public String getNiceNameNoSpaces(SubSkillType subSkillType) - { + public String getNiceNameNoSpaces(SubSkillType subSkillType) { return getConfigName(subSkillType.toString()); } /** * This finds the substring index for our SubSkillType's name after its parent name prefix + * * @param subSkillName The name to process * @return The value of the substring index after our parent's prefix */ @@ -266,35 +267,40 @@ public enum SubSkillType { return subStringIndex; } - public String getLocaleKeyRoot() - { - return StringUtils.getCapitalized(getParentSkill().toString())+".SubSkill."+getConfigName(toString()); + public String getLocaleKeyRoot() { + return StringUtils.getCapitalized(getParentSkill().toString()) + ".SubSkill." + getConfigName(toString()); } - public String getLocaleName() - { + public String getLocaleName() { return getFromLocaleSubAddress(".Name"); } - public String getLocaleDescription() - { + public String getLocaleDescription() { return getFromLocaleSubAddress(".Description"); } - public String getLocaleStatDescription() { return getFromLocaleSubAddress(".Stat"); } - public String getLocaleKeyStatDescription() { return getLocaleKeyFromSubAddress(".Stat"); } + public String getLocaleStatDescription() { + return getFromLocaleSubAddress(".Stat"); + } - public String getLocaleStatExtraDescription() { return getFromLocaleSubAddress(".Stat.Extra"); } - public String getLocaleKeyStatExtraDescription() { return getLocaleKeyFromSubAddress(".Stat.Extra"); } + public String getLocaleKeyStatDescription() { + return getLocaleKeyFromSubAddress(".Stat"); + } - public String getLocaleStat(String... vars) - { + public String getLocaleStatExtraDescription() { + return getFromLocaleSubAddress(".Stat.Extra"); + } + + public String getLocaleKeyStatExtraDescription() { + return getLocaleKeyFromSubAddress(".Stat.Extra"); + } + + public String getLocaleStat(String... vars) { String statMsg = LocaleLoader.getString("Ability.Generic.Template", (Object[]) vars); return statMsg; } - public String getCustomLocaleStat(String... vars) - { + public String getCustomLocaleStat(String... vars) { String statMsg = LocaleLoader.getString("Ability.Generic.Template.Custom", (Object[]) vars); return statMsg; } @@ -303,8 +309,7 @@ public enum SubSkillType { return LocaleLoader.getString(getLocaleKeyRoot() + s); } - private String getLocaleKeyFromSubAddress(String s) - { + private String getLocaleKeyFromSubAddress(String s) { return getLocaleKeyRoot() + s; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java b/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java index ee36532dd..2d3a8ca89 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java @@ -74,14 +74,14 @@ public enum SuperAbilityType { * This is a bit of a band-aid fix until the new skill system is in place */ static { - BERSERK.subSkillTypeDefinition = SubSkillType.UNARMED_BERSERK; - SUPER_BREAKER.subSkillTypeDefinition = SubSkillType.MINING_SUPER_BREAKER; - GIGA_DRILL_BREAKER.subSkillTypeDefinition = SubSkillType.EXCAVATION_GIGA_DRILL_BREAKER; - GREEN_TERRA.subSkillTypeDefinition = SubSkillType.HERBALISM_GREEN_TERRA; - SKULL_SPLITTER.subSkillTypeDefinition = SubSkillType.AXES_SKULL_SPLITTER; - TREE_FELLER.subSkillTypeDefinition = SubSkillType.WOODCUTTING_TREE_FELLER; - SERRATED_STRIKES.subSkillTypeDefinition = SubSkillType.SWORDS_SERRATED_STRIKES; - BLAST_MINING.subSkillTypeDefinition = SubSkillType.MINING_BLAST_MINING; + BERSERK.subSkillTypeDefinition = SubSkillType.UNARMED_BERSERK; + SUPER_BREAKER.subSkillTypeDefinition = SubSkillType.MINING_SUPER_BREAKER; + GIGA_DRILL_BREAKER.subSkillTypeDefinition = SubSkillType.EXCAVATION_GIGA_DRILL_BREAKER; + GREEN_TERRA.subSkillTypeDefinition = SubSkillType.HERBALISM_GREEN_TERRA; + SKULL_SPLITTER.subSkillTypeDefinition = SubSkillType.AXES_SKULL_SPLITTER; + TREE_FELLER.subSkillTypeDefinition = SubSkillType.WOODCUTTING_TREE_FELLER; + SERRATED_STRIKES.subSkillTypeDefinition = SubSkillType.SWORDS_SERRATED_STRIKES; + BLAST_MINING.subSkillTypeDefinition = SubSkillType.MINING_BLAST_MINING; } private String abilityOn; @@ -219,6 +219,7 @@ public enum SuperAbilityType { /** * Grabs the associated SubSkillType definition for this SuperAbilityType + * * @return the matching SubSkillType definition for this SuperAbilityType */ public SubSkillType getSubSkillTypeDefinition() { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/ChildConfig.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/ChildConfig.java index 5a3df0a37..5af3c9449 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/ChildConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/ChildConfig.java @@ -30,8 +30,7 @@ public class ChildConfig extends AutoUpdateConfigLoader { PrimarySkillType parentSkill = PrimarySkillType.valueOf(name.toUpperCase()); FamilyTree.enforceNotChildSkill(parentSkill); parentSkills.add(parentSkill); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { plugin.getLogger().warning(name + " is not a valid skill type, or is a child skill!"); useDefaults = true; break; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java index a288d12d7..9a58635f0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java @@ -12,7 +12,7 @@ public class Salvage { public static int advancedSalvageUnlockLevel = RankUtils.getRankUnlockLevel(SubSkillType.SALVAGE_ADVANCED_SALVAGE, 1);*/ - public static boolean arcaneSalvageDowngrades = AdvancedConfig.getInstance().getArcaneSalvageEnchantDowngradeEnabled(); + public static boolean arcaneSalvageDowngrades = AdvancedConfig.getInstance().getArcaneSalvageEnchantDowngradeEnabled(); public static boolean arcaneSalvageEnchantLoss = AdvancedConfig.getInstance().getArcaneSalvageEnchantLossEnabled(); protected static int calculateSalvageableAmount(short currentDurability, short maxDurability, int baseAmount) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java index c01ba6dc3..92aa8867d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java @@ -4,12 +4,12 @@ import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SkillManager; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.child.salvage.salvageables.Salvageable; +import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; @@ -33,7 +33,7 @@ import java.util.Map.Entry; public class SalvageManager extends SkillManager { private boolean placedAnvil; - private int lastClick; + private int lastClick; public SalvageManager(McMMOPlayer mcMMOPlayer) { super(mcMMOPlayer, PrimarySkillType.SALVAGE); @@ -207,34 +207,29 @@ public class SalvageManager extends SkillManager { if (!Salvage.arcaneSalvageEnchantLoss || RandomChanceUtil.checkRandomChanceExecutionSuccess(new RandomChanceSkillStatic(getExtractFullEnchantChance(), getPlayer(), SubSkillType.SALVAGE_ARCANE_SALVAGE))) { enchantMeta.addStoredEnchant(enchant.getKey(), enchant.getValue(), true); - } - else if (enchant.getValue() > 1 + } else if (enchant.getValue() > 1 && Salvage.arcaneSalvageDowngrades && RandomChanceUtil.checkRandomChanceExecutionSuccess(new RandomChanceSkillStatic(getExtractPartialEnchantChance(), getPlayer(), SubSkillType.SALVAGE_ARCANE_SALVAGE))) { enchantMeta.addStoredEnchant(enchant.getKey(), enchant.getValue() - 1, true); downgraded = true; - } - else { + } else { arcaneFailure = true; downgraded = true; } } - if(!arcaneFailure) - { + if (!arcaneFailure) { Map newEnchants = enchantMeta.getStoredEnchants(); if (downgraded || newEnchants.size() < enchants.size()) { NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Salvage.Skills.ArcanePartial"); - } - else { + } else { NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Salvage.Skills.ArcanePartial"); } book.setItemMeta(enchantMeta); } else { - if(enchantMeta.getStoredEnchants().size() > 0) - { + if (enchantMeta.getStoredEnchants().size() > 0) { NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Salvage.Skills.ArcaneFailed"); } return null; @@ -245,8 +240,8 @@ public class SalvageManager extends SkillManager { /** * Check if the player has tried to use an Anvil before. - * @param actualize * + * @param actualize * @return true if the player has confirmed using an Anvil */ public boolean checkConfirmation(boolean actualize) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/Salvageable.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/Salvageable.java index baf60b406..d15e4be72 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/Salvageable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/Salvageable.java @@ -42,7 +42,7 @@ public interface Salvageable { /** * Gets the maximum quantity of salvage materials ignoring all other salvage bonuses - * + *

* This is typically set to the number of items needed to create that item, for example 5 for helmets or 2 for swords * * @return the maximum number of items @@ -58,7 +58,7 @@ public interface Salvageable { /** * Gets the base salvage durability on which to calculate bonuses. - * + *

* This is actually the maximum durability divided by the minimum quantity * * @return the base salvage durability diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableManager.java index 9d50c68c4..5f962bc19 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableManager.java @@ -24,7 +24,6 @@ public interface SalvageableManager { * Checks if an item is salvageable * * @param type Material to check if salvageable - * * @return true if salvageable, false if not */ public boolean isSalvageable(Material type); @@ -33,7 +32,6 @@ public interface SalvageableManager { * Checks if an item is salvageable * * @param itemStack Item to check if salvageable - * * @return true if salvageable, false if not */ public boolean isSalvageable(ItemStack itemStack); @@ -42,7 +40,6 @@ public interface SalvageableManager { * Gets the salvageable with this type * * @param type Material of the salvageable to look for - * * @return the salvageable, can be null */ public Salvageable getSalvageable(Material type); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/Smelting.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/Smelting.java index 6ded74855..03cf4409b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/Smelting.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/Smelting.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.child.smelting; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.mcMMO; @@ -11,17 +11,15 @@ import org.bukkit.inventory.ItemStack; public class Smelting { - public static int getRank(Player player) - { + public static int burnModifierMaxLevel = AdvancedConfig.getInstance().getBurnModifierMaxLevel(); + public static double burnTimeMultiplier = AdvancedConfig.getInstance().getBurnTimeMultiplier(); + public static int fluxMiningUnlockLevel = RankUtils.getUnlockLevel(SubSkillType.SMELTING_FLUX_MINING); + public static double fluxMiningChance = AdvancedConfig.getInstance().getFluxMiningChance(); + + public static int getRank(Player player) { return RankUtils.getRank(player, SubSkillType.SMELTING_UNDERSTANDING_THE_ART); } - public static int burnModifierMaxLevel = AdvancedConfig.getInstance().getBurnModifierMaxLevel(); - public static double burnTimeMultiplier = AdvancedConfig.getInstance().getBurnTimeMultiplier(); - - public static int fluxMiningUnlockLevel = RankUtils.getUnlockLevel(SubSkillType.SMELTING_FLUX_MINING); - public static double fluxMiningChance = AdvancedConfig.getInstance().getFluxMiningChance(); - protected static int getResourceXp(ItemStack smelting) { return mcMMO.getModManager().isCustomOre(smelting.getType()) ? mcMMO.getModManager().getBlock(smelting.getType()).getSmeltingXpGain() : ExperienceConfig.getInstance().getXp(PrimarySkillType.SMELTING, smelting.getType()); } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java index 20626be12..dd4873061 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java @@ -5,8 +5,8 @@ import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SkillManager; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.primary.mining.Mining; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.BlockUtils; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/ChildSkill.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/ChildSkill.java index 504542177..e6df253c6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/ChildSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/ChildSkill.java @@ -5,6 +5,7 @@ import com.gmail.nossr50.core.skills.PrimarySkillType; public interface ChildSkill extends Skill { /** * Get's the other parent for this Skill + * * @return the other parent */ PrimarySkillType getSecondParent(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/CoreSkill.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/CoreSkill.java index df85989b0..909c10cb8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/CoreSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/CoreSkill.java @@ -11,6 +11,7 @@ import com.gmail.nossr50.core.skills.SubSkillType; public interface CoreSkill { /** * Gets the associated SubSkillType for this subskill + * * @return the associated SubSkillType ENUM definition */ SubSkillType getSubSkillType(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Localized.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Localized.java index a2758d46f..83a4726b2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Localized.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Localized.java @@ -7,12 +7,14 @@ package com.gmail.nossr50.core.skills.interfaces; public interface Localized { /** * The translated name for this locale + * * @return the translated name for this locale */ String getLocaleName(); /** * The translated name for this subskill description + * * @return */ String getLocaleDescription(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Progression.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Progression.java index cbdd3e51c..92cd66109 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Progression.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Progression.java @@ -6,6 +6,7 @@ import org.bukkit.event.Event; public interface Progression { /** * The interaction vector for gaining XP + * * @return the interaction vector for gaining XP */ InteractType getXpGainInteractType(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Skill.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Skill.java index f89e93c17..c4cd71866 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Skill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Skill.java @@ -5,12 +5,14 @@ import com.gmail.nossr50.core.skills.PrimarySkillType; public interface Skill { /** * The primary skill + * * @return this primary skill */ PrimarySkillType getPrimarySkill(); /** * Returns the key name used for this skill in conjunction with config files + * * @return config file key name */ String getPrimaryKeyName(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Toolable.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Toolable.java index 184c7a59d..8997fbce6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Toolable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Toolable.java @@ -8,12 +8,14 @@ public interface Toolable { /** * Whether or not this Skill requires a tool * Not all skills will require a tool + * * @return true if tool is required */ - boolean requiresTool(); + boolean requiresTool(); /** * The tools associated with this Skill + * * @return the tools */ Collection getTools(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java index 5ade031db..b175620ba 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java @@ -1,15 +1,16 @@ package com.gmail.nossr50.core.skills.primary.acrobatics; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.config.experience.ExperienceConfig; public final class Acrobatics { - public static double dodgeDamageModifier = AdvancedConfig.getInstance().getDodgeDamageModifier(); + public static double dodgeDamageModifier = AdvancedConfig.getInstance().getDodgeDamageModifier(); public static int dodgeXpModifier = ExperienceConfig.getInstance().getDodgeXPModifier(); public static boolean dodgeLightningDisabled = Config.getInstance().getDodgeLightningDisabled(); - private Acrobatics() {} + private Acrobatics() { + } protected static double calculateModifiedDodgeDamage(double damage, double damageModifier) { return Math.max(damage / damageModifier, 1.0); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/AcrobaticsManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/AcrobaticsManager.java index a483c29cf..2c7d8df3a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/AcrobaticsManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/AcrobaticsManager.java @@ -4,8 +4,8 @@ import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SkillManager; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; @@ -25,7 +25,7 @@ public class AcrobaticsManager extends SkillManager { } public boolean canDodge(Entity damager) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.ACROBATICS_DODGE)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.ACROBATICS_DODGE)) return false; if (Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.ACROBATICS_DODGE)) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/Alchemy.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/Alchemy.java index 30cd1b396..a700518d0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/Alchemy.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/Alchemy.java @@ -49,14 +49,15 @@ public final class Alchemy { public static final int INGREDIENT_SLOT = 3; - public static int catalysisUnlockLevel = RankUtils.getUnlockLevel(SubSkillType.ALCHEMY_CATALYSIS); - public static int catalysisMaxBonusLevel = AdvancedConfig.getInstance().getCatalysisMaxBonusLevel(); - public static double catalysisMinSpeed = AdvancedConfig.getInstance().getCatalysisMinSpeed(); - public static double catalysisMaxSpeed = AdvancedConfig.getInstance().getCatalysisMaxSpeed(); + public static int catalysisUnlockLevel = RankUtils.getUnlockLevel(SubSkillType.ALCHEMY_CATALYSIS); + public static int catalysisMaxBonusLevel = AdvancedConfig.getInstance().getCatalysisMaxBonusLevel(); + public static double catalysisMinSpeed = AdvancedConfig.getInstance().getCatalysisMinSpeed(); + public static double catalysisMaxSpeed = AdvancedConfig.getInstance().getCatalysisMaxSpeed(); public static Map brewingStandMap = new HashMap(); - private Alchemy() {} + private Alchemy() { + } /** * Finish all active brews. Used upon Disable to prevent vanilla potions from being brewed upon next Enable. diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyManager.java index 10f3d3f07..e7235ad70 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyManager.java @@ -5,10 +5,10 @@ import com.gmail.nossr50.config.skills.alchemy.PotionConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.PotionStage; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SkillManager; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.skills.RankUtils; import org.bukkit.inventory.ItemStack; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotion.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotion.java index 3efde46bd..1030a0c47 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotion.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotion.java @@ -54,7 +54,7 @@ public class AlchemyPotion { meta.addCustomEffect(effect, true); } } - + if (this.getColor() != null) { meta.setColor(this.getColor()); } @@ -106,11 +106,11 @@ public class AlchemyPotion { public Color getColor() { return color; } - + public void setColor(Color color) { this.color = color; } - + public Map getChildren() { return children; } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotionBrewer.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotionBrewer.java index 1daa82c22..89c617a0a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotionBrewer.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotionBrewer.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.core.skills.primary.alchemy; import com.gmail.nossr50.config.skills.alchemy.PotionConfig; -import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.skills.PotionStage; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.events.fake.FakeBrewEvent; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.player.PlayerUpdateInventoryTask; import com.gmail.nossr50.runnables.skills.AlchemyBrewCheckTask; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.Material; import org.bukkit.block.BlockState; import org.bukkit.block.BrewingStand; @@ -59,12 +59,10 @@ public final class AlchemyPotionBrewer { if (isEmpty(ingredient) || !isValidIngredient(player, ingredient)) { return; - } - else if (ingredient.getAmount() <= 1) { + } else if (ingredient.getAmount() <= 1) { inventory.setIngredient(null); return; - } - else { + } else { ingredient.setAmount(ingredient.getAmount() - 1); inventory.setIngredient(ingredient); return; @@ -157,8 +155,7 @@ public final class AlchemyPotionBrewer { if (click.isLeftClick()) { success = transferItems(view, fromSlot); - } - else if (click.isRightClick()) { + } else if (click.isRightClick()) { success = transferOneItem(view, fromSlot); } @@ -178,13 +175,11 @@ public final class AlchemyPotionBrewer { if (!emptyTo && fromAmount >= from.getType().getMaxStackSize()) { return false; - } - else if (emptyTo || from.isSimilar(to)) { + } else if (emptyTo || from.isSimilar(to)) { if (emptyTo) { to = from.clone(); to.setAmount(1); - } - else { + } else { to.setAmount(to.getAmount() + 1); } @@ -207,14 +202,12 @@ public final class AlchemyPotionBrewer { if (isEmpty(from)) { return false; - } - else if (isEmpty(to)) { + } else if (isEmpty(to)) { view.setItem(Alchemy.INGREDIENT_SLOT, from); view.setItem(fromSlot, null); return true; - } - else if (from.isSimilar(to)) { + } else if (from.isSimilar(to)) { int fromAmount = from.getAmount(); int toAmount = to.getAmount(); int maxSize = to.getType().getMaxStackSize(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/Archery.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/Archery.java index 7ec67ed0c..36f0c277c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/Archery.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/Archery.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.primary.archery; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.skills.RankUtils; @@ -15,13 +15,11 @@ import java.util.Iterator; import java.util.List; public class Archery { - private static List trackedEntities = new ArrayList(); - - public static double skillShotMaxBonusDamage = AdvancedConfig.getInstance().getSkillShotDamageMax(); + public static final double DISTANCE_XP_MULTIPLIER = ExperienceConfig.getInstance().getArcheryDistanceMultiplier(); + public static double skillShotMaxBonusDamage = AdvancedConfig.getInstance().getSkillShotDamageMax(); public static double dazeBonusDamage = AdvancedConfig.getInstance().getDazeBonusDamage(); - - public static final double DISTANCE_XP_MULTIPLIER = ExperienceConfig.getInstance().getArcheryDistanceMultiplier(); + private static List trackedEntities = new ArrayList(); protected static void incrementTrackerValue(LivingEntity livingEntity) { for (TrackedEntity trackedEntity : trackedEntities) { @@ -51,7 +49,7 @@ public class Archery { * @param livingEntity The entity hit by the arrows */ public static void arrowRetrievalCheck(LivingEntity livingEntity) { - for (Iterator entityIterator = trackedEntities.iterator(); entityIterator.hasNext();) { + for (Iterator entityIterator = trackedEntities.iterator(); entityIterator.hasNext(); ) { TrackedEntity trackedEntity = entityIterator.next(); if (trackedEntity.getID() == livingEntity.getUniqueId()) { @@ -62,8 +60,7 @@ public class Archery { } } - public static double getSkillShotBonusDamage(Player player, double oldDamage) - { + public static double getSkillShotBonusDamage(Player player, double oldDamage) { double damageBonusPercent = getDamageBonusPercent(player); double newDamage = oldDamage + (oldDamage * damageBonusPercent); return Math.min(newDamage, Archery.skillShotMaxBonusDamage); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/ArcheryManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/ArcheryManager.java index 17a998a58..53772546b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/ArcheryManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/ArcheryManager.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.core.skills.primary.archery; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SkillManager; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.SkillActivationType; @@ -26,21 +26,21 @@ public class ArcheryManager extends SkillManager { } public boolean canDaze(LivingEntity target) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.ARCHERY_DAZE)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.ARCHERY_DAZE)) return false; return target instanceof Player && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.ARCHERY_DAZE); } public boolean canSkillShot() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.ARCHERY_SKILL_SHOT)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.ARCHERY_SKILL_SHOT)) return false; return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.ARCHERY_SKILL_SHOT); } public boolean canRetrieveArrows() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.ARCHERY_ARROW_RETRIEVAL)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.ARCHERY_ARROW_RETRIEVAL)) return false; return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.ARCHERY_ARROW_RETRIEVAL); @@ -49,7 +49,7 @@ public class ArcheryManager extends SkillManager { /** * Calculate bonus XP awarded for Archery when hitting a far-away target. * - * @param target The {@link LivingEntity} damaged by the arrow + * @param target The {@link LivingEntity} damaged by the arrow * @param damager The {@link Entity} who shot the arrow */ public double distanceXpBonusMultiplier(LivingEntity target, Entity damager) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/Axes.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/Axes.java index da17bd6b6..bb6b9042c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/Axes.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/Axes.java @@ -11,15 +11,15 @@ import org.bukkit.inventory.ItemStack; public class Axes { public static double axeMasteryRankDamageMultiplier = AdvancedConfig.getInstance().getAxeMasteryRankDamageMultiplier(); - public static double criticalHitPVPModifier = AdvancedConfig.getInstance().getCriticalStrikesPVPModifier(); - public static double criticalHitPVEModifier = AdvancedConfig.getInstance().getCriticalStrikesPVEModifier(); + public static double criticalHitPVPModifier = AdvancedConfig.getInstance().getCriticalStrikesPVPModifier(); + public static double criticalHitPVEModifier = AdvancedConfig.getInstance().getCriticalStrikesPVEModifier(); - public static int impactIncreaseLevel = AdvancedConfig.getInstance().getArmorImpactIncreaseLevel(); - public static double impactChance = AdvancedConfig.getInstance().getImpactChance(); + public static int impactIncreaseLevel = AdvancedConfig.getInstance().getArmorImpactIncreaseLevel(); + public static double impactChance = AdvancedConfig.getInstance().getImpactChance(); public static double impactMaxDurabilityModifier = AdvancedConfig.getInstance().getArmorImpactMaxDurabilityDamage() / 100D; - public static double greaterImpactBonusDamage = AdvancedConfig.getInstance().getGreaterImpactBonusDamage(); - public static double greaterImpactChance = AdvancedConfig.getInstance().getGreaterImpactChance(); + public static double greaterImpactBonusDamage = AdvancedConfig.getInstance().getGreaterImpactBonusDamage(); + public static double greaterImpactChance = AdvancedConfig.getInstance().getGreaterImpactChance(); public static double greaterImpactKnockbackMultiplier = AdvancedConfig.getInstance().getGreaterImpactModifier(); public static double skullSplitterModifier = AdvancedConfig.getInstance().getSkullSplitterModifier(); @@ -36,11 +36,11 @@ public class Axes { /** * For every rank in Axe Mastery we add RankDamageMultiplier to get the total bonus damage from Axe Mastery + * * @param player The target player * @return The axe mastery bonus damage which will be added to their attack */ - public static double getAxeMasteryBonusDamage(Player player) - { + public static double getAxeMasteryBonusDamage(Player player) { return RankUtils.getRank(player, SubSkillType.AXES_AXE_MASTERY) * Axes.axeMasteryRankDamageMultiplier; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/AxesManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/AxesManager.java index acb40da77..10b168e70 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/AxesManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/AxesManager.java @@ -1,16 +1,12 @@ package com.gmail.nossr50.core.skills.primary.axes; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.skills.ToolType; -import com.gmail.nossr50.core.skills.SkillManager; +import com.gmail.nossr50.core.skills.*; import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceUtil; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -25,35 +21,35 @@ public class AxesManager extends SkillManager { } public boolean canUseAxeMastery() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_AXE_MASTERY)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_AXE_MASTERY)) return false; return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.AXES_AXE_MASTERY); } public boolean canCriticalHit(LivingEntity target) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_CRITICAL_STRIKES)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_CRITICAL_STRIKES)) return false; return target.isValid() && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.AXES_CRITICAL_STRIKES); } public boolean canImpact(LivingEntity target) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_ARMOR_IMPACT)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_ARMOR_IMPACT)) return false; return target.isValid() && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.AXES_ARMOR_IMPACT) && Axes.hasArmor(target); } public boolean canGreaterImpact(LivingEntity target) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_GREATER_IMPACT)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_GREATER_IMPACT)) return false; return target.isValid() && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.AXES_GREATER_IMPACT) && !Axes.hasArmor(target); } public boolean canUseSkullSplitter(LivingEntity target) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_SKULL_SPLITTER)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_SKULL_SPLITTER)) return false; return target.isValid() && mcMMOPlayer.getAbilityMode(SuperAbilityType.SKULL_SPLITTER) && Permissions.skullSplitter(getPlayer()); @@ -99,8 +95,7 @@ public class AxesManager extends SkillManager { } damage = (damage * Axes.criticalHitPVPModifier) - damage; - } - else { + } else { damage = (damage * Axes.criticalHitPVEModifier) - damage; } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java index 519723681..d1e715da6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java @@ -4,9 +4,9 @@ import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.treasure.ExcavationTreasure; -import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.random.RandomChanceUtil; @@ -50,18 +50,17 @@ public class ExcavationManager extends SkillManager { applyXpGain(xp, XPGainReason.PVE); } - public void printExcavationDebug(Player player, BlockState blockState) - { + public void printExcavationDebug(Player player, BlockState blockState) { if (Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.EXCAVATION_ARCHAEOLOGY)) { List treasures = Excavation.getTreasures(blockState); if (!treasures.isEmpty()) { for (ExcavationTreasure treasure : treasures) { player.sendMessage("|||||||||||||||||||||||||||||||||"); - player.sendMessage("[mcMMO DEBUG] Treasure found: ("+treasure.getDrop().getType().toString()+")"); - player.sendMessage("[mcMMO DEBUG] Drop Chance for Treasure: "+treasure.getDropChance()); - player.sendMessage("[mcMMO DEBUG] Skill Level Required: "+treasure.getDropLevel()); - player.sendMessage("[mcMMO DEBUG] XP for Treasure: "+treasure.getXp()); + player.sendMessage("[mcMMO DEBUG] Treasure found: (" + treasure.getDrop().getType().toString() + ")"); + player.sendMessage("[mcMMO DEBUG] Drop Chance for Treasure: " + treasure.getDropChance()); + player.sendMessage("[mcMMO DEBUG] Skill Level Required: " + treasure.getDropLevel()); + player.sendMessage("[mcMMO DEBUG] XP for Treasure: " + treasure.getXp()); } } else { player.sendMessage("[mcMMO DEBUG] No treasures found for this block."); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/Fishing.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/Fishing.java index 9ffc0c444..928cf60e9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/Fishing.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/Fishing.java @@ -21,18 +21,18 @@ public final class Fishing { public static int fishermansDietRankLevel1 = AdvancedConfig.getInstance().getFishermanDietRankChange(); public static int fishermansDietRankLevel2 = fishermansDietRankLevel1 * 2; - public static int fishermansDietMaxLevel = fishermansDietRankLevel1 * 5; + public static int fishermansDietMaxLevel = fishermansDietRankLevel1 * 5; public static Set masterAnglerBiomes = BiomeAdapter.WATER_BIOMES; - public static Set iceFishingBiomes = BiomeAdapter.ICE_BIOMES; + public static Set iceFishingBiomes = BiomeAdapter.ICE_BIOMES; - private Fishing() {} + private Fishing() { + } /** * Finds the possible drops of an entity * - * @param target - * Targeted entity + * @param target Targeted entity * @return possibleDrops List of ItemStack that can be dropped */ protected static List findPossibleDrops(LivingEntity target) { @@ -45,8 +45,7 @@ public final class Fishing { /** * Randomly chooses a drop among the list * - * @param possibleDrops - * List of ItemStack that can be dropped + * @param possibleDrops List of ItemStack that can be dropped * @return Chosen ItemStack */ protected static ItemStack chooseDrop(List possibleDrops) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java index 8a0dd5e3e..8b7eca90c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java @@ -1,19 +1,19 @@ package com.gmail.nossr50.core.skills.primary.fishing; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.treasure.TreasureConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.treasure.EnchantmentTreasure; import com.gmail.nossr50.core.skills.treasure.FishingTreasure; import com.gmail.nossr50.core.skills.treasure.Rarity; import com.gmail.nossr50.core.skills.treasure.ShakeTreasure; -import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.events.skills.fishing.McMMOPlayerFishingTreasureEvent; import com.gmail.nossr50.events.skills.fishing.McMMOPlayerShakeEvent; import com.gmail.nossr50.util.*; @@ -28,7 +28,8 @@ import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.*; +import org.bukkit.entity.Item; +import org.bukkit.entity.LivingEntity; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; @@ -68,7 +69,7 @@ public class FishingManager extends SkillManager { long currentTime = System.currentTimeMillis(); boolean hasFished = (currentTime < fishingTimestamp + (FISHING_COOLDOWN_SECONDS * 10)); - if(hasFished) + if (hasFished) fishingTimestamp = currentTime; boolean sameTarget = (lastFishingBoundingBox != null && lastFishingBoundingBox.overlaps(boundingBox)); @@ -136,7 +137,6 @@ public class FishingManager extends SkillManager { * * @param rankChange The # of levels to change rank for the food * @param eventFoodLevel The initial change in hunger from the event - * * @return the modified change in hunger for the event */ public int handleFishermanDiet(int rankChange, int eventFoodLevel) { @@ -179,8 +179,7 @@ public class FishingManager extends SkillManager { hook.setBiteChance(Math.min(biteChance, 1.0)); } - public boolean isMagicHunterEnabled() - { + public boolean isMagicHunterEnabled() { return RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.FISHING_MAGIC_HUNTER) && RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.FISHING_TREASURE_HUNTER) && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.FISHING_TREASURE_HUNTER); @@ -217,8 +216,7 @@ public class FishingManager extends SkillManager { if (!event.isCancelled()) { treasureDrop = event.getTreasure(); treasureXp = event.getXp(); - } - else { + } else { treasureDrop = null; treasureXp = 0; } @@ -251,7 +249,6 @@ public class FishingManager extends SkillManager { * Handle the vanilla XP boost for Fishing * * @param experience The amount of experience initially awarded by the event - * * @return the modified event damage */ public int handleVanillaXpBoost(int experience) { @@ -308,8 +305,7 @@ public class FishingManager extends SkillManager { if (TreasureConfig.getInstance().getInventoryStealStacks()) { inventory.setItem(slot, null); - } - else { + } else { inventory.setItem(slot, (drop.getAmount() > 1) ? new ItemStack(drop.getType(), drop.getAmount() - 1) : null); drop.setAmount(1); } @@ -362,8 +358,7 @@ public class FishingManager extends SkillManager { if (getPlayer().getInventory().getItemInMainHand().getType() == Material.FISHING_ROD) { luck = getPlayer().getInventory().getItemInMainHand().getEnchantmentLevel(Enchantment.LUCK); - } - else { + } else { // We know something was caught, so if the rod wasn't in the main hand it must be in the offhand luck = getPlayer().getInventory().getItemInOffHand().getEnchantmentLevel(Enchantment.LUCK); } @@ -419,7 +414,6 @@ public class FishingManager extends SkillManager { * Process the Magic Hunter ability * * @param treasureDrop The {@link ItemStack} to enchant - * * @return true if the item has been enchanted */ private Map handleMagicHunter(ItemStack treasureDrop) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/Herbalism.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/Herbalism.java index f055a07f1..3f1f62352 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/Herbalism.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/Herbalism.java @@ -14,8 +14,7 @@ public class Herbalism { /** * Convert blocks affected by the Green Thumb & Green Terra abilities. * - * @param blockState - * The {@link BlockState} to check ability activation for + * @param blockState The {@link BlockState} to check ability activation for * @return true if the ability was successful, false otherwise */ protected static boolean convertGreenTerraBlocks(BlockState blockState) { @@ -28,16 +27,16 @@ public class Herbalism { blockState.setType(Material.MOSSY_STONE_BRICKS); return true; - case Material.DIRT : - case Material.GRASS_PATH : + case Material.DIRT: + case Material.GRASS_PATH: blockState.setType(Material.GRASS_BLOCK); return true; - case Material.COBBLESTONE : + case Material.COBBLESTONE: blockState.setType(Material.MOSSY_COBBLESTONE); return true; - default : + default: return false; } } @@ -64,7 +63,7 @@ public class Herbalism { else dropAmount++; - for (BlockFace blockFace : new BlockFace[] { BlockFace.UP, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST ,BlockFace.WEST}) + for (BlockFace blockFace : new BlockFace[]{BlockFace.UP, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST, BlockFace.WEST}) dropAmount += calculateChorusPlantDropsRecursive(target.getRelative(blockFace, 1), traversed); return dropAmount; @@ -74,8 +73,7 @@ public class Herbalism { * Calculate the drop amounts for multi block plants based on the blocks * relative to them. * - * @param blockState - * The {@link BlockState} of the bottom block of the plant + * @param blockState The {@link BlockState} of the bottom block of the plant * @return the number of bonus drops to award from the blocks in this plant */ protected static int calculateMultiBlockPlantDrops(BlockState blockState) { @@ -112,19 +110,18 @@ public class Herbalism { /** * Convert blocks affected by the Green Thumb & Green Terra abilities. * - * @param blockState - * The {@link BlockState} to check ability activation for + * @param blockState The {@link BlockState} to check ability activation for * @return true if the ability was successful, false otherwise */ protected static boolean convertShroomThumb(BlockState blockState) { switch (blockState.getType()) { - case Material.DIRT : + case Material.DIRT: case Material.GRASS_BLOCK: - case Material.GRASS_PATH : + case Material.GRASS_PATH: blockState.setType(Material.MYCELIUM); return true; - default : + default: return false; } } @@ -132,8 +129,7 @@ public class Herbalism { /** * Check if the block has a recently grown crop from Green Thumb * - * @param blockState - * The {@link BlockState} to check green thumb regrown for + * @param blockState The {@link BlockState} to check green thumb regrown for * @return true if the block is recently regrown, false otherwise */ public static boolean isRecentlyRegrown(BlockState blockState) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java index fd84ca1cd..e4e25e018 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java @@ -1,18 +1,14 @@ package com.gmail.nossr50.core.skills.primary.herbalism; -import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.treasure.TreasureConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.mods.CustomBlock; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.skills.ToolType; +import com.gmail.nossr50.core.skills.*; import com.gmail.nossr50.core.skills.treasure.HylianTreasure; -import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.skills.HerbalismBlockUpdaterTask; import com.gmail.nossr50.util.*; @@ -44,7 +40,7 @@ public class HerbalismManager extends SkillManager { } public boolean canGreenThumbBlock(BlockState blockState) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.HERBALISM_GREEN_THUMB)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.HERBALISM_GREEN_THUMB)) return false; Player player = getPlayer(); @@ -54,7 +50,7 @@ public class HerbalismManager extends SkillManager { } public boolean canUseShroomThumb(BlockState blockState) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.HERBALISM_SHROOM_THUMB)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.HERBALISM_SHROOM_THUMB)) return false; Player player = getPlayer(); @@ -65,7 +61,7 @@ public class HerbalismManager extends SkillManager { } public boolean canUseHylianLuck() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.HERBALISM_HYLIAN_LUCK)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.HERBALISM_HYLIAN_LUCK)) return false; return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.HERBALISM_HYLIAN_LUCK); @@ -149,8 +145,7 @@ public class HerbalismManager extends SkillManager { if (Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_DOUBLE_DROPS) && customBlock.isDoubleDropEnabled()) { drops = blockState.getBlock().getDrops(); } - } - else { + } else { xp = ExperienceConfig.getInstance().getXp(skill, blockState.getBlockData()); if (Config.getInstance().getDoubleDropsEnabled(skill, material) && Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_DOUBLE_DROPS)) { @@ -161,7 +156,7 @@ public class HerbalismManager extends SkillManager { amount = Herbalism.calculateMultiBlockPlantDrops(blockState); xp *= amount; } - + if (Permissions.greenThumbPlant(player, material)) { processGreenThumbPlants(blockState, greenTerra); } @@ -245,7 +240,7 @@ public class HerbalismManager extends SkillManager { public boolean processShroomThumb(BlockState blockState) { Player player = getPlayer(); PlayerInventory playerInventory = player.getInventory(); - + if (!playerInventory.contains(Material.BROWN_MUSHROOM, 1)) { NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Skills.NeedMore", StringUtils.getPrettyItemString(Material.BROWN_MUSHROOM)); return false; @@ -344,8 +339,7 @@ public class HerbalismManager extends SkillManager { if (greenTerra) { crops.setAge(3); - } - else { + } else { crops.setAge(greenThumbStage); } break; @@ -355,21 +349,18 @@ public class HerbalismManager extends SkillManager { if (greenTerra || greenThumbStage > 2) { crops.setAge(2); - } - else if (greenThumbStage == 2) { + } else if (greenThumbStage == 2) { crops.setAge(1); - } - else { + } else { crops.setAge(0); } - break; + break; case Material.COCOA: if (greenTerra || getGreenThumbStage() > 1) { crops.setAge(1); - } - else { + } else { crops.setAge(0); } break; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java index e1be7e7a6..5cd81b7ce 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java @@ -2,9 +2,9 @@ package com.gmail.nossr50.core.skills.primary.mining; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.RankUtils; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -41,22 +41,19 @@ public class BlastMining { }*/ - public static Material detonator = Config.getInstance().getDetonatorItem(); - public final static int MAXIMUM_REMOTE_DETONATION_DISTANCE = 100; + public static Material detonator = Config.getInstance().getDetonatorItem(); public static double getBlastRadiusModifier(int rank) { return AdvancedConfig.getInstance().getBlastRadiusModifier(rank); } - public static double getBlastDamageDecrease(int rank) { return AdvancedConfig.getInstance().getBlastDamageDecrease(rank); } - public static int getDemolitionExpertUnlockLevel() { /*List tierList = Arrays.asList(Tier.values()); for (Tier tier : tierList) { @@ -67,10 +64,9 @@ public class BlastMining { return tier == Tier.EIGHT ? tier.getLevel() : tierList.get(tierList.indexOf(tier) - 1).getLevel(); }*/ - for(int i = 0; i < SubSkillType.MINING_BLAST_MINING.getNumRanks()-1; i++) - { - if(getBlastDamageDecrease(i+1) > 0) - return RankUtils.getRankUnlockLevel(SubSkillType.MINING_BLAST_MINING, i+1); + for (int i = 0; i < SubSkillType.MINING_BLAST_MINING.getNumRanks() - 1; i++) { + if (getBlastDamageDecrease(i + 1) > 0) + return RankUtils.getRankUnlockLevel(SubSkillType.MINING_BLAST_MINING, i + 1); } return 0; @@ -86,10 +82,9 @@ public class BlastMining { return tier == Tier.EIGHT ? tier.getLevel() : tierList.get(tierList.indexOf(tier) - 1).getLevel(); }*/ - for(int i = 0; i < SubSkillType.MINING_BLAST_MINING.getNumRanks()-1; i++) - { - if(getBlastRadiusModifier(i+1) > 0) - return RankUtils.getRankUnlockLevel(SubSkillType.MINING_BLAST_MINING, i+1); + for (int i = 0; i < SubSkillType.MINING_BLAST_MINING.getNumRanks() - 1; i++) { + if (getBlastRadiusModifier(i + 1) > 0) + return RankUtils.getRankUnlockLevel(SubSkillType.MINING_BLAST_MINING, i + 1); } return 0; @@ -107,7 +102,7 @@ public class BlastMining { return false; } - MiningManager miningManager = UserManager.getPlayer(defender).getMiningManager(); + MiningManager miningManager = UserManager.getPlayer(defender).getMiningManager(); if (!miningManager.canUseDemolitionsExpertise()) { return false; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java index 97dbe946e..130efcca3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java @@ -6,11 +6,11 @@ import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.skills.AbilityCooldownTask; -import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.util.BlockUtils; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Misc; @@ -36,8 +36,20 @@ public class MiningManager extends SkillManager { super(mcMMOPlayer, PrimarySkillType.MINING); } + public static double getOreBonus(int rank) { + return AdvancedConfig.getInstance().getOreBonus(rank); + } + + public static double getDebrisReduction(int rank) { + return AdvancedConfig.getInstance().getDebrisReduction(rank); + } + + public static int getDropMultiplier(int rank) { + return AdvancedConfig.getInstance().getDropMultiplier(rank); + } + public boolean canUseDemolitionsExpertise() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.MINING_DEMOLITIONS_EXPERTISE)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.MINING_DEMOLITIONS_EXPERTISE)) return false; return getSkillLevel() >= BlastMining.getDemolitionExpertUnlockLevel() && Permissions.demolitionsExpertise(getPlayer()); @@ -55,7 +67,7 @@ public class MiningManager extends SkillManager { } public boolean canUseBiggerBombs() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.MINING_BIGGER_BOMBS)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.MINING_BIGGER_BOMBS)) return false; return getSkillLevel() >= BlastMining.getBiggerBombsUnlockLevel() && Permissions.biggerBombs(getPlayer()); @@ -92,8 +104,7 @@ public class MiningManager extends SkillManager { if (RandomChanceUtil.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.MINING_DOUBLE_DROPS, player)) { if (silkTouch) { Mining.handleSilkTouchDrops(blockState); - } - else { + } else { Mining.handleMiningDrops(blockState); } } @@ -130,7 +141,7 @@ public class MiningManager extends SkillManager { /** * Handler for explosion drops and XP gain. * - * @param yield The % of blocks to drop + * @param yield The % of blocks to drop * @param blockList The list of blocks to drop */ public void blastMiningDropProcessing(float yield, List blockList) { @@ -149,8 +160,7 @@ public class MiningManager extends SkillManager { if (BlockUtils.isOre(blockState)) { ores.add(blockState); - } - else { + } else { debris.add(blockState); } } @@ -214,14 +224,6 @@ public class MiningManager extends SkillManager { return getOreBonus(getBlastMiningTier()); } - public static double getOreBonus(int rank) { - return AdvancedConfig.getInstance().getOreBonus(rank); - } - - public static double getDebrisReduction(int rank) { - return AdvancedConfig.getInstance().getDebrisReduction(rank); - } - /** * Gets the Blast Mining tier * @@ -231,10 +233,6 @@ public class MiningManager extends SkillManager { return getDebrisReduction(getBlastMiningTier()); } - public static int getDropMultiplier(int rank) { - return AdvancedConfig.getInstance().getDropMultiplier(rank); - } - /** * Gets the Blast Mining tier * diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/ArcaneForging.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/ArcaneForging.java index 1a15e6050..6acc378ea 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/ArcaneForging.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/ArcaneForging.java @@ -4,6 +4,6 @@ import com.gmail.nossr50.core.config.skills.AdvancedConfig; public class ArcaneForging { - public static boolean arcaneForgingDowngrades = AdvancedConfig.getInstance().getArcaneForgingDowngradeEnabled(); + public static boolean arcaneForgingDowngrades = AdvancedConfig.getInstance().getArcaneForgingDowngradeEnabled(); public static boolean arcaneForgingEnchantLoss = AdvancedConfig.getInstance().getArcaneForgingEnchantLossEnabled(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java index 145c96a5c..439e2886b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java @@ -5,8 +5,8 @@ import com.gmail.nossr50.core.config.skills.Config; import org.bukkit.Material; public class Repair { - public static int repairMasteryMaxBonusLevel = AdvancedConfig.getInstance().getRepairMasteryMaxLevel(); - public static double repairMasteryMaxBonus = AdvancedConfig.getInstance().getRepairMasteryMaxBonus(); + public static int repairMasteryMaxBonusLevel = AdvancedConfig.getInstance().getRepairMasteryMaxLevel(); + public static double repairMasteryMaxBonus = AdvancedConfig.getInstance().getRepairMasteryMaxBonus(); - public static Material anvilMaterial = Config.getInstance().getRepairAnvilMaterial(); + public static Material anvilMaterial = Config.getInstance().getRepairAnvilMaterial(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java index fc186ffba..d8c148224 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java @@ -1,17 +1,17 @@ package com.gmail.nossr50.core.skills.primary.repair; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SkillManager; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; @@ -35,7 +35,7 @@ import java.util.Map.Entry; public class RepairManager extends SkillManager { private boolean placedAnvil; - private int lastClick; + private int lastClick; public RepairManager(McMMOPlayer mcMMOPlayer) { super(mcMMOPlayer, PrimarySkillType.REPAIR); @@ -255,7 +255,7 @@ public class RepairManager extends SkillManager { /** * Computes repair bonuses. * - * @param durability The durability of the item being repaired + * @param durability The durability of the item being repaired * @param repairAmount The base amount of durability repaired to the item * @return The final amount of durability repaired to the item */ @@ -284,7 +284,7 @@ public class RepairManager extends SkillManager { * @return true if bonus granted, false otherwise */ private boolean checkPlayerProcRepair() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.REPAIR_SUPER_REPAIR)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.REPAIR_SUPER_REPAIR)) return false; if (RandomChanceUtil.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.REPAIR_SUPER_REPAIR, getPlayer())) { @@ -336,8 +336,7 @@ public class RepairManager extends SkillManager { item.addUnsafeEnchantment(enchantment, enchantLevel - 1); downgraded = true; } - } - else { + } else { item.removeEnchantment(enchantment); } } @@ -346,11 +345,9 @@ public class RepairManager extends SkillManager { if (newEnchants.isEmpty()) { NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE_FAILED, "Repair.Arcane.Fail"); - } - else if (downgraded || newEnchants.size() < enchants.size()) { + } else if (downgraded || newEnchants.size() < enchants.size()) { NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE_FAILED, "Repair.Arcane.Downgrade"); - } - else { + } else { NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Repair.Arcane.Perfect"); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/Repairable.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/Repairable.java index d954b161e..ca51d18b8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/Repairable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/Repairable.java @@ -50,7 +50,7 @@ public interface Repairable { /** * Gets the minimum quantity of repair materials ignoring all other repair bonuses - * + *

* This is typically set to the number of items needed to create that item, for example 5 for helmets or 2 for swords * * @return the minimum number of items @@ -66,7 +66,7 @@ public interface Repairable { /** * Gets the base repair durability on which to calculate bonuses. - * + *

* This is actually the maximum durability divided by the minimum quantity * * @return the base repair durability diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableManager.java index eb6e17d53..00a225ff7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableManager.java @@ -24,7 +24,6 @@ public interface RepairableManager { * Checks if an item is repairable * * @param type Material to check if repairable - * * @return true if repairable, false if not */ public boolean isRepairable(Material type); @@ -33,7 +32,6 @@ public interface RepairableManager { * Checks if an item is repairable * * @param itemStack Item to check if repairable - * * @return true if repairable, false if not */ public boolean isRepairable(ItemStack itemStack); @@ -42,7 +40,6 @@ public interface RepairableManager { * Gets the repairable with this type * * @param type Material of the repairable to look for - * * @return the repairable, can be null */ public Repairable getRepairable(Material type); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairable.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairable.java index c79eac8ec..bfe9efeac 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairable.java @@ -10,10 +10,10 @@ public class SimpleRepairable implements Repairable { private final int minimumQuantity, minimumLevel; private final short maximumDurability, baseRepairDurability; private final byte repairMetadata; - private String repairMaterialPrettyName; private final ItemType repairItemType; private final MaterialType repairMaterialType; private final double xpMultiplier; + private String repairMaterialPrettyName; protected SimpleRepairable(Material type, Material repairMaterial, byte repairMetadata, String repairMaterialPrettyName, int minimumLevel, int minimumQuantity, short maximumDurability, ItemType repairItemType, MaterialType repairMaterialType, double xpMultiplier) { this.itemMaterial = type; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/Swords.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/Swords.java index cb10d1377..11e3f9c7d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/Swords.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/Swords.java @@ -3,11 +3,11 @@ package com.gmail.nossr50.core.skills.primary.swords; import com.gmail.nossr50.core.config.skills.AdvancedConfig; public class Swords { - public static int bleedMaxTicks = AdvancedConfig.getInstance().getRuptureMaxTicks(); - public static int bleedBaseTicks = AdvancedConfig.getInstance().getRuptureBaseTicks(); + public static int bleedMaxTicks = AdvancedConfig.getInstance().getRuptureMaxTicks(); + public static int bleedBaseTicks = AdvancedConfig.getInstance().getRuptureBaseTicks(); - public static double counterAttackModifier = AdvancedConfig.getInstance().getCounterModifier(); + public static double counterAttackModifier = AdvancedConfig.getInstance().getCounterModifier(); - public static double serratedStrikesModifier = AdvancedConfig.getInstance().getSerratedStrikesModifier(); - public static int serratedStrikesBleedTicks = AdvancedConfig.getInstance().getSerratedStrikesTicks(); + public static double serratedStrikesModifier = AdvancedConfig.getInstance().getSerratedStrikesModifier(); + public static int serratedStrikesBleedTicks = AdvancedConfig.getInstance().getSerratedStrikesTicks(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/SwordsManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/SwordsManager.java index 2d6b8ae3e..6953dd462 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/SwordsManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/SwordsManager.java @@ -1,16 +1,12 @@ package com.gmail.nossr50.core.skills.primary.swords; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.skills.ToolType; +import com.gmail.nossr50.core.skills.*; import com.gmail.nossr50.runnables.skills.BleedTimerTask; -import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.CombatUtils; import com.gmail.nossr50.util.skills.RankUtils; @@ -36,14 +32,14 @@ public class SwordsManager extends SkillManager { } public boolean canUseCounterAttack(Entity target) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.SWORDS_COUNTER_ATTACK)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.SWORDS_COUNTER_ATTACK)) return false; return target instanceof LivingEntity && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.SWORDS_COUNTER_ATTACK); } public boolean canUseSerratedStrike() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.SWORDS_SERRATED_STRIKES)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.SWORDS_SERRATED_STRIKES)) return false; return mcMMOPlayer.getAbilityMode(SuperAbilityType.SERRATED_STRIKES); @@ -61,7 +57,7 @@ public class SwordsManager extends SkillManager { Player defender = (Player) target; if (UserManager.getPlayer(defender).useChatNotifications()) { - if(!BleedTimerTask.isBleeding(defender)) + if (!BleedTimerTask.isBleeding(defender)) NotificationManager.sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Bleeding.Started"); } } @@ -74,11 +70,10 @@ public class SwordsManager extends SkillManager { } } - public int getRuptureBleedTicks() - { + public int getRuptureBleedTicks() { int bleedTicks = 2 * RankUtils.getRank(getPlayer(), SubSkillType.SWORDS_RUPTURE); - if(bleedTicks > Swords.bleedMaxTicks) + if (bleedTicks > Swords.bleedMaxTicks) bleedTicks = Swords.bleedMaxTicks; return bleedTicks; @@ -88,7 +83,7 @@ public class SwordsManager extends SkillManager { * Handle the effects of the Counter Attack ability * * @param attacker The {@link LivingEntity} being affected by the ability - * @param damage The amount of damage initially dealt by the event + * @param damage The amount of damage initially dealt by the event */ public void counterAttackChecks(LivingEntity attacker, double damage) { if (RandomChanceUtil.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.SWORDS_COUNTER_ATTACK, getPlayer())) { @@ -97,7 +92,7 @@ public class SwordsManager extends SkillManager { NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Countered"); if (attacker instanceof Player) { - NotificationManager.sendPlayerInformation((Player)attacker, NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Counter.Hit"); + NotificationManager.sendPlayerInformation((Player) attacker, NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Counter.Hit"); } } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/Taming.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/Taming.java index 45a246752..7426d883f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/Taming.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/Taming.java @@ -2,19 +2,18 @@ package com.gmail.nossr50.core.skills.primary.taming; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import org.bukkit.EntityEffect; -import org.bukkit.entity.*; public class Taming { public static double fastFoodServiceActivationChance = AdvancedConfig.getInstance().getFastFoodChance(); - public static int goreBleedTicks = 2; //Equivalent to rank 1 in Rupture - public static double goreModifier = AdvancedConfig.getInstance().getGoreModifier(); + public static int goreBleedTicks = 2; //Equivalent to rank 1 in Rupture + public static double goreModifier = AdvancedConfig.getInstance().getGoreModifier(); public static double sharpenedClawsBonusDamage = AdvancedConfig.getInstance().getSharpenedClawsBonus(); - public static double shockProofModifier = AdvancedConfig.getInstance().getShockProofModifier(); + public static double shockProofModifier = AdvancedConfig.getInstance().getShockProofModifier(); - public static double thickFurModifier = AdvancedConfig.getInstance().getThickFurModifier(); + public static double thickFurModifier = AdvancedConfig.getInstance().getThickFurModifier(); public static boolean canPreventDamage(Tameable pet, AnimalTamer owner) { return pet.isTamed() && owner instanceof Player && pet instanceof Wolf; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java index 74c224b0d..75c72bfc5 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java @@ -1,23 +1,23 @@ package com.gmail.nossr50.core.skills.primary.taming; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.events.fake.FakeEntityTameEvent; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.skills.BleedTimerTask; -import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceSkillStatic; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.ParticleEffectUtils; @@ -25,7 +25,6 @@ import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.SkillActivationType; import org.bukkit.Location; import org.bukkit.Sound; -import org.bukkit.entity.*; import org.bukkit.inventory.ItemStack; import java.util.ArrayList; @@ -33,11 +32,29 @@ import java.util.HashMap; import java.util.List; public class TamingManager extends SkillManager { + private static HashMap> summonedEntities = new HashMap>(); + public TamingManager(McMMOPlayer mcMMOPlayer) { super(mcMMOPlayer, PrimarySkillType.TAMING); } - private static HashMap> summonedEntities = new HashMap>(); + protected static void addToTracker(LivingEntity livingEntity) { + TrackedTamingEntity trackedEntity = new TrackedTamingEntity(livingEntity); + + if (!summonedEntities.containsKey(livingEntity.getType())) { + summonedEntities.put(livingEntity.getType(), new ArrayList()); + } + + summonedEntities.get(livingEntity.getType()).add(trackedEntity); + } + + protected static List getTrackedEntities(EntityType entityType) { + return summonedEntities.get(entityType); + } + + protected static void removeFromTracker(TrackedTamingEntity trackedEntity) { + summonedEntities.get(trackedEntity.getLivingEntity().getType()).remove(trackedEntity); + } public boolean canUseThickFur() { return RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_THICK_FUR) @@ -70,14 +87,14 @@ public class TamingManager extends SkillManager { } public boolean canUseGore() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_GORE)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_GORE)) return false; return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_GORE); } public boolean canUseBeastLore() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_BEAST_LORE)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_BEAST_LORE)) return false; return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_BEAST_LORE); @@ -95,7 +112,7 @@ public class TamingManager extends SkillManager { /** * Apply the Fast Food Service ability. * - * @param wolf The wolf using the ability + * @param wolf The wolf using the ability * @param damage The damage being absorbed by the wolf */ public void fastFoodService(Wolf wolf, double damage) { @@ -127,7 +144,7 @@ public class TamingManager extends SkillManager { BleedTimerTask.add(target, getPlayer(), Taming.goreBleedTicks, 1); if (target instanceof Player) { - NotificationManager.sendPlayerInformation((Player)target, NotificationType.SUBSKILL_MESSAGE, "Combat.StruckByGore"); + NotificationManager.sendPlayerInformation((Player) target, NotificationType.SUBSKILL_MESSAGE, "Combat.StruckByGore"); } NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Combat.Gore"); @@ -144,7 +161,7 @@ public class TamingManager extends SkillManager { * Summon an ocelot to your side. */ public void summonOcelot() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD)) return; if (!Permissions.callOfTheWild(getPlayer(), EntityType.OCELOT)) { @@ -158,7 +175,7 @@ public class TamingManager extends SkillManager { * Summon a wolf to your side. */ public void summonWolf() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD)) return; if (!Permissions.callOfTheWild(getPlayer(), EntityType.WOLF)) { @@ -172,7 +189,7 @@ public class TamingManager extends SkillManager { * Summon a horse to your side. */ public void summonHorse() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD)) return; if (!Permissions.callOfTheWild(getPlayer(), EntityType.HORSE)) { @@ -213,10 +230,10 @@ public class TamingManager extends SkillManager { } public void pummel(LivingEntity target, Wolf wolf) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_PUMMEL)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_PUMMEL)) return; - if(!RandomChanceUtil.checkRandomChanceExecutionSuccess(new RandomChanceSkillStatic(AdvancedConfig.getInstance().getPummelChance(), getPlayer(), SubSkillType.TAMING_PUMMEL))) + if (!RandomChanceUtil.checkRandomChanceExecutionSuccess(new RandomChanceSkillStatic(AdvancedConfig.getInstance().getPummelChance(), getPlayer(), SubSkillType.TAMING_PUMMEL))) return; ParticleEffectUtils.playGreaterImpactEffect(target); @@ -253,7 +270,7 @@ public class TamingManager extends SkillManager { /** * Handle the Call of the Wild ability. * - * @param type The type of entity to summon. + * @param type The type of entity to summon. * @param summonAmount The amount of material needed to summon the entity */ private void callOfTheWild(EntityType type, int summonAmount) { @@ -379,22 +396,4 @@ public class TamingManager extends SkillManager { return true; } - - protected static void addToTracker(LivingEntity livingEntity) { - TrackedTamingEntity trackedEntity = new TrackedTamingEntity(livingEntity); - - if (!summonedEntities.containsKey(livingEntity.getType())) { - summonedEntities.put(livingEntity.getType(), new ArrayList()); - } - - summonedEntities.get(livingEntity.getType()).add(trackedEntity); - } - - protected static List getTrackedEntities(EntityType entityType) { - return summonedEntities.get(entityType); - } - - protected static void removeFromTracker(TrackedTamingEntity trackedEntity) { - summonedEntities.get(trackedEntity.getLivingEntity().getType()).remove(trackedEntity); - } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java index 448b4f8f8..397b07c82 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java @@ -21,27 +21,22 @@ public class Unarmed { int amount = itemDrop.getAmount(); boolean grabbedItem = false; - for(int i = 0; i <= storageContents.length-1; i++) - { - if(amount <= 0) + for (int i = 0; i <= storageContents.length - 1; i++) { + if (amount <= 0) break; - if(i == heldItemSlotID) + if (i == heldItemSlotID) continue; //EMPTY SLOT! - if(storageContents[i] == null) - { + if (storageContents[i] == null) { player.getInventory().setItem(i, itemDrop); amount = 0; grabbedItem = true; break; - } - else if(itemDrop.isSimilar(storageContents[i]) && storageContents[i].getAmount() < storageContents[i].getMaxStackSize()) - { + } else if (itemDrop.isSimilar(storageContents[i]) && storageContents[i].getAmount() < storageContents[i].getMaxStackSize()) { //If we can fit this whole itemstack into this item - if(amount + storageContents[i].getAmount() <= storageContents[i].getMaxStackSize()) - { + if (amount + storageContents[i].getAmount() <= storageContents[i].getMaxStackSize()) { ItemStack modifiedAmount = storageContents[i]; modifiedAmount.setAmount(amount + storageContents[i].getAmount()); @@ -63,15 +58,14 @@ public class Unarmed { } } - if(amount <= 0) + if (amount <= 0) event.getItem().remove(); //Cleanup Item else event.getItem().getItemStack().setAmount(amount); event.setCancelled(true); - if(grabbedItem) - { + if (grabbedItem) { SoundManager.sendSound(player, player.getLocation(), SoundType.POP); player.updateInventory(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/UnarmedManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/UnarmedManager.java index b927c49b1..d7ab72994 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/UnarmedManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/UnarmedManager.java @@ -1,20 +1,16 @@ package com.gmail.nossr50.core.skills.primary.unarmed; import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.skills.ToolType; -import com.gmail.nossr50.core.skills.SkillManager; +import com.gmail.nossr50.core.skills.*; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.SkillActivationType; @@ -36,7 +32,7 @@ public class UnarmedManager extends SkillManager { } public boolean canUseIronArm() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.UNARMED_IRON_ARM_STYLE)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.UNARMED_IRON_ARM_STYLE)) return false; return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.UNARMED_IRON_ARM_STYLE); @@ -47,14 +43,14 @@ public class UnarmedManager extends SkillManager { } public boolean canDisarm(LivingEntity target) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.UNARMED_DISARM)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.UNARMED_DISARM)) return false; return target instanceof Player && ((Player) target).getInventory().getItemInMainHand().getType() != Material.AIR && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.UNARMED_DISARM); } public boolean canDeflect() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.UNARMED_ARROW_DEFLECT)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.UNARMED_ARROW_DEFLECT)) return false; Player player = getPlayer(); @@ -63,7 +59,7 @@ public class UnarmedManager extends SkillManager { } public boolean canUseBlockCracker() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.UNARMED_BLOCK_CRACKER)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.UNARMED_BLOCK_CRACKER)) return false; return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.UNARMED_BLOCK_CRACKER); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java index 92c7bcbb5..6cebed974 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.primary.woodcutting; -import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.BlockUtils; @@ -17,22 +17,27 @@ import java.util.List; import java.util.Set; public final class Woodcutting { + /** + * The x/y differences to the blocks in a flat cylinder around the center + * block, which is excluded. + */ + private static final int[][] directions = { + new int[]{-2, -1}, new int[]{-2, 0}, new int[]{-2, 1}, + new int[]{-1, -2}, new int[]{-1, -1}, new int[]{-1, 0}, new int[]{-1, 1}, new int[]{-1, 2}, + new int[]{0, -2}, new int[]{0, -1}, new int[]{0, 1}, new int[]{0, 2}, + new int[]{1, -2}, new int[]{1, -1}, new int[]{1, 0}, new int[]{1, 1}, new int[]{1, 2}, + new int[]{2, -1}, new int[]{2, 0}, new int[]{2, 1}, + }; public static int treeFellerThreshold = Config.getInstance().getTreeFellerThreshold(); - - protected static boolean treeFellerReachedThreshold = false; - protected enum ExperienceGainMethod { - DEFAULT, - TREE_FELLER, + private Woodcutting() { } - private Woodcutting() {} - /** * Retrieves the experience reward from a log * - * @param blockState Log being broken + * @param blockState Log being broken * @param experienceGainMethod How the log is being broken * @return Amount of experience */ @@ -52,30 +57,17 @@ public final class Woodcutting { protected static void checkForDoubleDrop(BlockState blockState) { if (mcMMO.getModManager().isCustomLog(blockState) && mcMMO.getModManager().getBlock(blockState).isDoubleDropEnabled()) { Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops()); - } - else { + } else { if (Config.getInstance().getWoodcuttingDoubleDropsEnabled(blockState.getBlockData())) { Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops()); } } } - /** - * The x/y differences to the blocks in a flat cylinder around the center - * block, which is excluded. - */ - private static final int[][] directions = { - new int[] {-2, -1}, new int[] {-2, 0}, new int[] {-2, 1}, - new int[] {-1, -2}, new int[] {-1, -1}, new int[] {-1, 0}, new int[] {-1, 1}, new int[] {-1, 2}, - new int[] { 0, -2}, new int[] { 0, -1}, new int[] { 0, 1}, new int[] { 0, 2}, - new int[] { 1, -2}, new int[] { 1, -1}, new int[] { 1, 0}, new int[] { 1, 1}, new int[] { 1, 2}, - new int[] { 2, -1}, new int[] { 2, 0}, new int[] { 2, 1}, - }; - /** * Processes Tree Feller in a recursive manner * - * @param blockState Block being checked + * @param blockState Block being checked * @param treeFellerBlocks List of blocks to be removed */ /* @@ -113,8 +105,7 @@ public final class Woodcutting { return; } } - } - else { + } else { // Cover DOWN handleBlock(blockState.getBlock().getRelative(BlockFace.DOWN).getState(), futureCenterBlocks, treeFellerBlocks); // Search in a cube @@ -143,7 +134,7 @@ public final class Woodcutting { * Handles the durability loss * * @param treeFellerBlocks List of blocks to be removed - * @param inHand tool being used + * @param inHand tool being used * @return True if the tool can sustain the durability loss */ protected static boolean handleDurabilityLoss(Set treeFellerBlocks, ItemStack inHand) { @@ -165,12 +156,12 @@ public final class Woodcutting { * list of blocks used for future recursive calls of * 'processTree()' * - * @param blockState Block to be added + * @param blockState Block to be added * @param futureCenterBlocks List of blocks that will be used to call - * 'processTree()' - * @param treeFellerBlocks List of blocks to be removed + * 'processTree()' + * @param treeFellerBlocks List of blocks to be removed * @return true if and only if the given blockState was a Log not already - * in treeFellerBlocks. + * in treeFellerBlocks. */ private static boolean handleBlock(BlockState blockState, List futureCenterBlocks, Set treeFellerBlocks) { if (treeFellerBlocks.contains(blockState) || mcMMO.getPlaceStore().isTrue(blockState)) { @@ -186,11 +177,15 @@ public final class Woodcutting { treeFellerBlocks.add(blockState); futureCenterBlocks.add(blockState); return true; - } - else if (BlockUtils.isLeaves(blockState)) { + } else if (BlockUtils.isLeaves(blockState)) { treeFellerBlocks.add(blockState); return false; } return false; } + + protected enum ExperienceGainMethod { + DEFAULT, + TREE_FELLER, + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/WoodcuttingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/WoodcuttingManager.java index 1dff844f8..fe6359e3d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/WoodcuttingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/WoodcuttingManager.java @@ -5,11 +5,11 @@ import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.mods.CustomBlock; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.skills.SkillManager; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.skills.primary.woodcutting.Woodcutting.ExperienceGainMethod; +import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.*; import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.random.RandomChanceUtil; @@ -129,8 +129,7 @@ public class WoodcuttingManager extends SkillManager { if (material == Material.BROWN_MUSHROOM_BLOCK || material == Material.RED_MUSHROOM_BLOCK) { xp += Woodcutting.getExperienceFromLog(blockState, ExperienceGainMethod.TREE_FELLER); Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops()); - } - else if (mcMMO.getModManager().isCustomLog(blockState)) { + } else if (mcMMO.getModManager().isCustomLog(blockState)) { if (canGetDoubleDrops()) { Woodcutting.checkForDoubleDrop(blockState); } @@ -139,11 +138,9 @@ public class WoodcuttingManager extends SkillManager { xp = customBlock.getXpGain(); Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops()); - } - else if (mcMMO.getModManager().isCustomLeaf(blockState)) { + } else if (mcMMO.getModManager().isCustomLeaf(blockState)) { Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops()); - } - else { + } else { if (BlockUtils.isLog(blockState)) { if (canGetDoubleDrops()) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/AbstractSubSkill.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/AbstractSubSkill.java index b18f1d42c..7b9d3ae1d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/AbstractSubSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/AbstractSubSkill.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.core.skills.subskills; import com.gmail.nossr50.core.config.skills.CoreSkillsConfig; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.interfaces.Interaction; import com.gmail.nossr50.core.skills.subskills.interfaces.Rank; import com.gmail.nossr50.core.skills.subskills.interfaces.SubSkill; import com.gmail.nossr50.core.skills.subskills.interfaces.SubSkillProperties; -import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import org.bukkit.entity.Player; @@ -17,8 +17,7 @@ public abstract class AbstractSubSkill implements SubSkill, Interaction, Rank, S protected String configKeyPrimary; protected SubSkillType subSkillType; - public AbstractSubSkill(String configKeySubSkill, String configKeyPrimary, SubSkillType subSkillType) - { + public AbstractSubSkill(String configKeySubSkill, String configKeyPrimary, SubSkillType subSkillType) { this.configKeySubSkill = configKeySubSkill; this.configKeyPrimary = configKeyPrimary; this.subSkillType = subSkillType; @@ -31,7 +30,7 @@ public abstract class AbstractSubSkill implements SubSkill, Interaction, Rank, S */ @Override public String getDescription() { - return LocaleLoader.getString(getPrimaryKeyName()+".SubSkill."+getConfigKeyName()+".Description"); + return LocaleLoader.getString(getPrimaryKeyName() + ".SubSkill." + getConfigKeyName() + ".Description"); } /** @@ -39,7 +38,8 @@ public abstract class AbstractSubSkill implements SubSkill, Interaction, Rank, S * * @return true if enabled */ - @Override @Deprecated + @Override + @Deprecated public boolean isEnabled() { //TODO: This might be troublesome... return CoreSkillsConfig.getInstance().isSkillEnabled(this); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/AcrobaticsSubSkill.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/AcrobaticsSubSkill.java index da7428845..569f24f41 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/AcrobaticsSubSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/AcrobaticsSubSkill.java @@ -28,7 +28,7 @@ public abstract class AcrobaticsSubSkill extends AbstractSubSkill { */ @Override public String getNiceName() { - return LocaleLoader.getString(getPrimaryKeyName()+".SubSkill."+getConfigKeyName()+".Name"); + return LocaleLoader.getString(getPrimaryKeyName() + ".SubSkill." + getConfigKeyName() + ".Name"); } /** @@ -48,7 +48,7 @@ public abstract class AcrobaticsSubSkill extends AbstractSubSkill { */ @Override public String getTips() { - return LocaleLoader.getString("JSON."+ StringUtils.getCapitalized(getPrimarySkill().toString())+".SubSkill."+getConfigKeyName()+".Details.Tips"); + return LocaleLoader.getString("JSON." + StringUtils.getCapitalized(getPrimarySkill().toString()) + ".SubSkill." + getConfigKeyName() + ".Details.Tips"); } /** diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java index 51a3fe315..9c58b4e72 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java @@ -1,11 +1,12 @@ package com.gmail.nossr50.core.skills.subskills.acrobatics; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.datatypes.LimitedSizeList; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; -import com.gmail.nossr50.core.datatypes.LimitedSizeList; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import com.gmail.nossr50.core.skills.SubSkillType; @@ -14,7 +15,6 @@ import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceSkill; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.PerksUtils; @@ -44,6 +44,10 @@ public class Roll extends AcrobaticsSubSkill { fallLocationMap = new HashMap<>(); } + protected static double calculateModifiedRollDamage(double damage, double damageThreshold) { + return Math.max(damage - damageThreshold, 0.0); + } + /** * Executes the interaction between this subskill and Minecraft * @@ -64,7 +68,7 @@ public class Roll extends AcrobaticsSubSkill { EntityDamageEvent entityDamageEvent = (EntityDamageEvent) event; //Make sure a real player was damaged in this event - if(!EventUtils.isRealPlayerDamaged(entityDamageEvent)) + if (!EventUtils.isRealPlayerDamaged(entityDamageEvent)) return false; switch (entityDamageEvent.getCause()) { @@ -101,7 +105,7 @@ public class Roll extends AcrobaticsSubSkill { */ @Override public String getPermissionNode() { - return ("mcmmo.ability."+getPrimaryKeyName()+"."+getConfigKeyName()).toLowerCase(); + return ("mcmmo.ability." + getPrimaryKeyName() + "." + getConfigKeyName()).toLowerCase(); } /** @@ -119,7 +123,7 @@ public class Roll extends AcrobaticsSubSkill { * Adds detailed stats specific to this skill * * @param componentBuilder target component builder - * @param player target player + * @param player target player */ @Override public void addStats(ComponentBuilder componentBuilder, Player player) { @@ -159,8 +163,7 @@ public class Roll extends AcrobaticsSubSkill { //Advanced //Lucky Notice - if(isLucky) - { + if (isLucky) { componentBuilder.append(LocaleLoader.getString("JSON.JWrapper.Perks.Header")); componentBuilder.append("\n"); componentBuilder.append(LocaleLoader.getString("JSON.JWrapper.Perks.Lucky", "33")); @@ -210,16 +213,15 @@ public class Roll extends AcrobaticsSubSkill { //player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.Text")); //if (!SkillUtils.cooldownExpired((long) mcMMOPlayer.getTeleportATS(), Config.getInstance().getXPAfterTeleportCooldown())) { - if(!isExploiting(player)) + if (!isExploiting(player)) SkillUtils.applyXpGain(mcMMOPlayer, getPrimarySkill(), calculateRollXP(player, damage, true), XPGainReason.PVE); //} addFallLocation(player); return modifiedDamage; - } - else if (!isFatal(player, damage)) { + } else if (!isFatal(player, damage)) { //if (!SkillUtils.cooldownExpired((long) mcMMOPlayer.getTeleportATS(), Config.getInstance().getXPAfterTeleportCooldown())) { - if(!isExploiting(player)) + if (!isExploiting(player)) SkillUtils.applyXpGain(mcMMOPlayer, getPrimarySkill(), calculateRollXP(player, damage, false), XPGainReason.PVE); //} } @@ -245,20 +247,18 @@ public class Roll extends AcrobaticsSubSkill { rcs.setSkillLevel(rcs.getSkillLevel() * 2); //Double the effective odds if (!isFatal(player, modifiedDamage) - && RandomChanceUtil.checkRandomChanceExecutionSuccess(rcs)) - { + && RandomChanceUtil.checkRandomChanceExecutionSuccess(rcs)) { NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Acrobatics.Ability.Proc"); - SoundManager.sendCategorizedSound(player, player.getLocation(), SoundType.ROLL_ACTIVATED, SoundCategory.PLAYERS,0.5F); - if(!isExploiting(player)) + SoundManager.sendCategorizedSound(player, player.getLocation(), SoundType.ROLL_ACTIVATED, SoundCategory.PLAYERS, 0.5F); + if (!isExploiting(player)) SkillUtils.applyXpGain(mcMMOPlayer, getPrimarySkill(), calculateRollXP(player, damage, true), XPGainReason.PVE); addFallLocation(player); return modifiedDamage; - } - else if (!isFatal(player, damage)) { - if(!isExploiting(player)) + } else if (!isFatal(player, damage)) { + if (!isExploiting(player)) SkillUtils.applyXpGain(mcMMOPlayer, getPrimarySkill(), calculateRollXP(player, damage, false), XPGainReason.PVE); - + addFallLocation(player); } @@ -280,12 +280,12 @@ public class Roll extends AcrobaticsSubSkill { return true; } - if(fallLocationMap.get(player) == null) + if (fallLocationMap.get(player) == null) fallLocationMap.put(player, new LimitedSizeList(50)); LimitedSizeList fallLocations = fallLocationMap.get(player); - - if(fallLocations.contains(getBlockLocation(player))) + + if (fallLocations.contains(getBlockLocation(player))) return true; return false; //NOT EXPLOITING @@ -312,10 +312,6 @@ public class Roll extends AcrobaticsSubSkill { return xp; } - protected static double calculateModifiedRollDamage(double damage, double damageThreshold) { - return Math.max(damage - damageThreshold, 0.0); - } - private boolean isFatal(Player player, double damage) { return player.getHealth() - damage <= 0; } @@ -344,7 +340,7 @@ public class Roll extends AcrobaticsSubSkill { //player.sendMessage(getDescription()); //Player stats player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Stats", - LocaleLoader.getString("Acrobatics.SubSkill.Roll.Stats", getStats(player)[0], getStats(player)[1]))); + LocaleLoader.getString("Acrobatics.SubSkill.Roll.Stats", getStats(player)[0], getStats(player)[1]))); //Mechanics player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Mechanics")); @@ -389,13 +385,13 @@ public class Roll extends AcrobaticsSubSkill { rollGraceHalfMaxSkill.setSkillLevel(1); //Level 1 skill //Chance Stat Calculations - rollChanceHalfMax = RandomChanceUtil.getRandomChanceExecutionChance(rollHalfMaxSkill); - graceChanceHalfMax = RandomChanceUtil.getRandomChanceExecutionChance(rollGraceHalfMaxSkill); - damageThreshold = AdvancedConfig.getInstance().getRollDamageThreshold(); + rollChanceHalfMax = RandomChanceUtil.getRandomChanceExecutionChance(rollHalfMaxSkill); + graceChanceHalfMax = RandomChanceUtil.getRandomChanceExecutionChance(rollGraceHalfMaxSkill); + damageThreshold = AdvancedConfig.getInstance().getRollDamageThreshold(); - chancePerLevel = RandomChanceUtil.getRandomChanceExecutionChance(rollOneSkillLevel); + chancePerLevel = RandomChanceUtil.getRandomChanceExecutionChance(rollOneSkillLevel); - double maxLevel = AdvancedConfig.getInstance().getMaxBonusLevel(SubSkillType.ACROBATICS_ROLL); + double maxLevel = AdvancedConfig.getInstance().getMaxBonusLevel(SubSkillType.ACROBATICS_ROLL); return LocaleLoader.getString("Acrobatics.SubSkill.Roll.Mechanics", rollChanceHalfMax, graceChanceHalfMax, maxLevel, chancePerLevel, damageThreshold, damageThreshold * 2); } @@ -407,26 +403,24 @@ public class Roll extends AcrobaticsSubSkill { * @return stat array for target player for this skill */ @Override - public Double[] getStats(Player player) - { + public Double[] getStats(Player player) { double playerChanceRoll, playerChanceGrace; - RandomChanceSkill roll = new RandomChanceSkill(player, getSubSkillType()); - RandomChanceSkill graceful = new RandomChanceSkill(player, getSubSkillType()); + RandomChanceSkill roll = new RandomChanceSkill(player, getSubSkillType()); + RandomChanceSkill graceful = new RandomChanceSkill(player, getSubSkillType()); graceful.setSkillLevel(graceful.getSkillLevel() * 2); //Double odds //Calculate - playerChanceRoll = RandomChanceUtil.getRandomChanceExecutionChance(roll); - playerChanceGrace = RandomChanceUtil.getRandomChanceExecutionChance(graceful); + playerChanceRoll = RandomChanceUtil.getRandomChanceExecutionChance(roll); + playerChanceGrace = RandomChanceUtil.getRandomChanceExecutionChance(graceful); - Double[] stats = { playerChanceRoll, playerChanceGrace }; //DEBUG + Double[] stats = {playerChanceRoll, playerChanceGrace}; //DEBUG return stats; } - public void addFallLocation(Player player) - { - if(fallLocationMap.get(player) == null) + public void addFallLocation(Player player) { + if (fallLocationMap.get(player) == null) fallLocationMap.put(player, new LimitedSizeList(50)); LimitedSizeList fallLocations = fallLocationMap.get(player); @@ -435,8 +429,7 @@ public class Roll extends AcrobaticsSubSkill { fallLocations.add(loc); } - public Location getBlockLocation(Player player) - { + public Location getBlockLocation(Player player) { return player.getLocation().getBlock().getLocation(); } } \ No newline at end of file diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Interaction.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Interaction.java index 397526230..94723591c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Interaction.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Interaction.java @@ -7,13 +7,15 @@ import org.bukkit.event.EventPriority; public interface Interaction { /** * The type of interaction this subskill has with Minecraft + * * @return the interaction type */ InteractType getInteractType(); /** * Executes the interaction between this subskill and Minecraft - * @param event the vector of interaction + * + * @param event the vector of interaction * @param plugin the mcMMO plugin instance * @return true if interaction wasn't cancelled */ @@ -21,6 +23,7 @@ public interface Interaction { /** * The priority for this interaction + * * @return the priority for interaction */ EventPriority getEventPriority(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Rank.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Rank.java index 2ccf2c80e..309c359a0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Rank.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Rank.java @@ -3,12 +3,14 @@ package com.gmail.nossr50.core.skills.subskills.interfaces; public interface Rank { /** * Gets the number of ranks for this subskill, 0 for no ranks + * * @return the number of ranks for this subskill, 0 for no ranks */ int getNumRanks(); /** * Not all skills have ranks + * * @return true if the skill has ranks */ boolean hasRanks(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/SubSkill.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/SubSkill.java index 45ce88af6..712012194 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/SubSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/SubSkill.java @@ -7,18 +7,21 @@ import org.bukkit.entity.Player; public interface SubSkill extends Skill { /** * Grabs the permission node for this skill + * * @return permission node address */ String getPermissionNode(); /** * Returns a collection of strings about how a skill works + * * @return */ String getMechanics(); /** * Get an array of various stats for a player + * * @param player target player * @return stat array for target player for this skill */ @@ -26,6 +29,7 @@ public interface SubSkill extends Skill { /** * Checks if a player has permission to use this skill + * * @param player target player * @return true if player has permission */ @@ -34,43 +38,50 @@ public interface SubSkill extends Skill { /** * The name of this subskill * It's a good idea for this to return the localized name + * * @return the subskill name */ String getNiceName(); /** * This is the name that represents our subskill in the config + * * @return the config key name */ String getConfigKeyName(); /** * Returns the simple description of this subskill + * * @return the simple description of this subskill */ String getDescription(); /** * Grabs tips for the subskill + * * @return tips for the subskill */ String getTips(); /** * Adds detailed stats specific to this skill + * * @param componentBuilder target component builder - * @param player owner of this skill + * @param player owner of this skill */ void addStats(ComponentBuilder componentBuilder, Player player); /** * Whether or not this subskill is enabled + * * @return true if enabled */ boolean isEnabled(); /** * Prints detailed info about this subskill to the player + * * @param player the target player */ void printInfo(Player player); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ExcavationTreasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ExcavationTreasure.java index c69073284..92ba9c7c9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ExcavationTreasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ExcavationTreasure.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.core.skills.treasure; -import com.gmail.nossr50.core.skills.treasure.Treasure; import org.bukkit.inventory.ItemStack; public class ExcavationTreasure extends Treasure { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/FishingTreasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/FishingTreasure.java index 6e9b07ef8..bce93839e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/FishingTreasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/FishingTreasure.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.core.skills.treasure; -import com.gmail.nossr50.core.skills.treasure.Treasure; import org.bukkit.inventory.ItemStack; public class FishingTreasure extends Treasure { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/HylianTreasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/HylianTreasure.java index 61863a3b6..e5595f58f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/HylianTreasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/HylianTreasure.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.core.skills.treasure; -import com.gmail.nossr50.core.skills.treasure.Treasure; import org.bukkit.inventory.ItemStack; public class HylianTreasure extends Treasure { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Rarity.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Rarity.java index fe4eff482..a6f7dc37f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Rarity.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Rarity.java @@ -11,8 +11,7 @@ public enum Rarity { public static Rarity getRarity(String string) { try { return valueOf(string); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { return COMMON; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ShakeTreasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ShakeTreasure.java index 6c9755cd7..41bd533fe 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ShakeTreasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ShakeTreasure.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.core.skills.treasure; -import com.gmail.nossr50.core.skills.treasure.Treasure; import org.bukkit.inventory.ItemStack; public class ShakeTreasure extends Treasure { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java index 127b94540..6bbd50825 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java @@ -42,7 +42,7 @@ public abstract class Treasure { public int getDropLevel() { //If they are in retro mode all requirements are scaled up by 10 - if(Config.getInstance().getIsRetroMode()) + if (Config.getInstance().getIsRetroMode()) return dropLevel * 10; return dropLevel; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/BlockUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/BlockUtils.java index 5780eeb5b..0db94f6d5 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/BlockUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/BlockUtils.java @@ -2,9 +2,9 @@ package com.gmail.nossr50.core.util; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.skills.primary.repair.Repair; import com.gmail.nossr50.core.skills.child.salvage.Salvage; +import com.gmail.nossr50.core.skills.primary.repair.Repair; +import com.gmail.nossr50.mcMMO; import org.bukkit.Material; import org.bukkit.block.BlockState; import org.bukkit.block.data.Ageable; @@ -14,13 +14,13 @@ import java.util.HashSet; public final class BlockUtils { - private BlockUtils() {} + private BlockUtils() { + } /** * Checks to see if a given block awards XP. * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block awards XP, false otherwise */ public static boolean shouldBeWatched(BlockState blockState) { @@ -30,10 +30,9 @@ public final class BlockUtils { /** * Check if a given block should allow for the activation of abilities * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block should allow ability activation, false - * otherwise + * otherwise */ public static boolean canActivateAbilities(BlockState blockState) { switch (blockState.getType()) { @@ -53,24 +52,24 @@ public final class BlockUtils { case Material.RED_BED: case Material.WHITE_BED: case Material.YELLOW_BED: - case Material.BREWING_STAND : - case Material.BOOKSHELF : + case Material.BREWING_STAND: + case Material.BOOKSHELF: case Material.CAKE: - case Material.CHEST : - case Material.DISPENSER : + case Material.CHEST: + case Material.DISPENSER: case Material.ENCHANTING_TABLE: - case Material.ENDER_CHEST : + case Material.ENDER_CHEST: case Material.OAK_FENCE_GATE: - case Material.ACACIA_FENCE_GATE : - case Material.DARK_OAK_FENCE_GATE : - case Material.SPRUCE_FENCE_GATE : - case Material.BIRCH_FENCE_GATE : - case Material.JUNGLE_FENCE_GATE : - case Material.FURNACE : - case Material.JUKEBOX : - case Material.LEVER : - case Material.NOTE_BLOCK : - case Material.STONE_BUTTON : + case Material.ACACIA_FENCE_GATE: + case Material.DARK_OAK_FENCE_GATE: + case Material.SPRUCE_FENCE_GATE: + case Material.BIRCH_FENCE_GATE: + case Material.JUNGLE_FENCE_GATE: + case Material.FURNACE: + case Material.JUKEBOX: + case Material.LEVER: + case Material.NOTE_BLOCK: + case Material.STONE_BUTTON: case Material.OAK_BUTTON: case Material.BIRCH_BUTTON: case Material.ACACIA_BUTTON: @@ -83,47 +82,47 @@ public final class BlockUtils { case Material.JUNGLE_TRAPDOOR: case Material.OAK_TRAPDOOR: case Material.SPRUCE_TRAPDOOR: - case Material.WALL_SIGN : + case Material.WALL_SIGN: case Material.CRAFTING_TABLE: - case Material.BEACON : - case Material.ANVIL : - case Material.DROPPER : - case Material.HOPPER : - case Material.TRAPPED_CHEST : - case Material.IRON_DOOR : - case Material.IRON_TRAPDOOR : + case Material.BEACON: + case Material.ANVIL: + case Material.DROPPER: + case Material.HOPPER: + case Material.TRAPPED_CHEST: + case Material.IRON_DOOR: + case Material.IRON_TRAPDOOR: case Material.OAK_DOOR: - case Material.ACACIA_DOOR : - case Material.SPRUCE_DOOR : - case Material.BIRCH_DOOR : - case Material.JUNGLE_DOOR : - case Material.DARK_OAK_DOOR : + case Material.ACACIA_DOOR: + case Material.SPRUCE_DOOR: + case Material.BIRCH_DOOR: + case Material.JUNGLE_DOOR: + case Material.DARK_OAK_DOOR: case Material.OAK_FENCE: - case Material.ACACIA_FENCE : - case Material.DARK_OAK_FENCE : - case Material.BIRCH_FENCE : - case Material.JUNGLE_FENCE : - case Material.SPRUCE_FENCE : - case Material.ARMOR_STAND : - case Material.BLACK_SHULKER_BOX : - case Material.BLUE_SHULKER_BOX : - case Material.BROWN_SHULKER_BOX : - case Material.CYAN_SHULKER_BOX : - case Material.GRAY_SHULKER_BOX : - case Material.GREEN_SHULKER_BOX : - case Material.LIGHT_BLUE_SHULKER_BOX : - case Material.LIME_SHULKER_BOX : - case Material.MAGENTA_SHULKER_BOX : - case Material.ORANGE_SHULKER_BOX : - case Material.PINK_SHULKER_BOX : - case Material.PURPLE_SHULKER_BOX : - case Material.RED_SHULKER_BOX : + case Material.ACACIA_FENCE: + case Material.DARK_OAK_FENCE: + case Material.BIRCH_FENCE: + case Material.JUNGLE_FENCE: + case Material.SPRUCE_FENCE: + case Material.ARMOR_STAND: + case Material.BLACK_SHULKER_BOX: + case Material.BLUE_SHULKER_BOX: + case Material.BROWN_SHULKER_BOX: + case Material.CYAN_SHULKER_BOX: + case Material.GRAY_SHULKER_BOX: + case Material.GREEN_SHULKER_BOX: + case Material.LIGHT_BLUE_SHULKER_BOX: + case Material.LIME_SHULKER_BOX: + case Material.MAGENTA_SHULKER_BOX: + case Material.ORANGE_SHULKER_BOX: + case Material.PINK_SHULKER_BOX: + case Material.PURPLE_SHULKER_BOX: + case Material.RED_SHULKER_BOX: case Material.LIGHT_GRAY_SHULKER_BOX: - case Material.WHITE_SHULKER_BOX : - case Material.YELLOW_SHULKER_BOX : + case Material.WHITE_SHULKER_BOX: + case Material.YELLOW_SHULKER_BOX: return false; - default : + default: return !isMcMMOAnvil(blockState) && !mcMMO.getModManager().isCustomAbilityBlock(blockState); } } @@ -132,10 +131,9 @@ public final class BlockUtils { * Check if a given block should allow for the activation of tools * Activating a tool is step 1 of a 2 step process for super ability activation * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block should allow ability activation, false - * otherwise + * otherwise */ public static boolean canActivateTools(BlockState blockState) { switch (blockState.getType()) { @@ -155,24 +153,24 @@ public final class BlockUtils { case Material.RED_BED: case Material.WHITE_BED: case Material.YELLOW_BED: - case Material.BREWING_STAND : - case Material.BOOKSHELF : + case Material.BREWING_STAND: + case Material.BOOKSHELF: case Material.CAKE: - case Material.CHEST : - case Material.DISPENSER : + case Material.CHEST: + case Material.DISPENSER: case Material.ENCHANTING_TABLE: - case Material.ENDER_CHEST : + case Material.ENDER_CHEST: case Material.OAK_FENCE_GATE: - case Material.ACACIA_FENCE_GATE : - case Material.DARK_OAK_FENCE_GATE : - case Material.SPRUCE_FENCE_GATE : - case Material.BIRCH_FENCE_GATE : - case Material.JUNGLE_FENCE_GATE : - case Material.FURNACE : - case Material.JUKEBOX : - case Material.LEVER : - case Material.NOTE_BLOCK : - case Material.STONE_BUTTON : + case Material.ACACIA_FENCE_GATE: + case Material.DARK_OAK_FENCE_GATE: + case Material.SPRUCE_FENCE_GATE: + case Material.BIRCH_FENCE_GATE: + case Material.JUNGLE_FENCE_GATE: + case Material.FURNACE: + case Material.JUKEBOX: + case Material.LEVER: + case Material.NOTE_BLOCK: + case Material.STONE_BUTTON: case Material.OAK_BUTTON: case Material.BIRCH_BUTTON: case Material.ACACIA_BUTTON: @@ -185,44 +183,44 @@ public final class BlockUtils { case Material.JUNGLE_TRAPDOOR: case Material.OAK_TRAPDOOR: case Material.SPRUCE_TRAPDOOR: - case Material.WALL_SIGN : + case Material.WALL_SIGN: case Material.CRAFTING_TABLE: - case Material.BEACON : - case Material.ANVIL : - case Material.DROPPER : - case Material.HOPPER : - case Material.TRAPPED_CHEST : - case Material.IRON_DOOR : - case Material.IRON_TRAPDOOR : + case Material.BEACON: + case Material.ANVIL: + case Material.DROPPER: + case Material.HOPPER: + case Material.TRAPPED_CHEST: + case Material.IRON_DOOR: + case Material.IRON_TRAPDOOR: case Material.OAK_DOOR: - case Material.ACACIA_DOOR : - case Material.SPRUCE_DOOR : - case Material.BIRCH_DOOR : - case Material.JUNGLE_DOOR : - case Material.DARK_OAK_DOOR : + case Material.ACACIA_DOOR: + case Material.SPRUCE_DOOR: + case Material.BIRCH_DOOR: + case Material.JUNGLE_DOOR: + case Material.DARK_OAK_DOOR: case Material.OAK_FENCE: - case Material.ACACIA_FENCE : - case Material.DARK_OAK_FENCE : - case Material.BIRCH_FENCE : - case Material.JUNGLE_FENCE : - case Material.SPRUCE_FENCE : - case Material.ARMOR_STAND : - case Material.BLACK_SHULKER_BOX : - case Material.BLUE_SHULKER_BOX : - case Material.BROWN_SHULKER_BOX : - case Material.CYAN_SHULKER_BOX : - case Material.GRAY_SHULKER_BOX : - case Material.GREEN_SHULKER_BOX : - case Material.LIGHT_BLUE_SHULKER_BOX : - case Material.LIME_SHULKER_BOX : - case Material.MAGENTA_SHULKER_BOX : - case Material.ORANGE_SHULKER_BOX : - case Material.PINK_SHULKER_BOX : - case Material.PURPLE_SHULKER_BOX : - case Material.RED_SHULKER_BOX : + case Material.ACACIA_FENCE: + case Material.DARK_OAK_FENCE: + case Material.BIRCH_FENCE: + case Material.JUNGLE_FENCE: + case Material.SPRUCE_FENCE: + case Material.ARMOR_STAND: + case Material.BLACK_SHULKER_BOX: + case Material.BLUE_SHULKER_BOX: + case Material.BROWN_SHULKER_BOX: + case Material.CYAN_SHULKER_BOX: + case Material.GRAY_SHULKER_BOX: + case Material.GREEN_SHULKER_BOX: + case Material.LIGHT_BLUE_SHULKER_BOX: + case Material.LIME_SHULKER_BOX: + case Material.MAGENTA_SHULKER_BOX: + case Material.ORANGE_SHULKER_BOX: + case Material.PINK_SHULKER_BOX: + case Material.PURPLE_SHULKER_BOX: + case Material.RED_SHULKER_BOX: case Material.LIGHT_GRAY_SHULKER_BOX: - case Material.WHITE_SHULKER_BOX : - case Material.YELLOW_SHULKER_BOX : + case Material.WHITE_SHULKER_BOX: + case Material.YELLOW_SHULKER_BOX: case Material.STRIPPED_ACACIA_LOG: case Material.STRIPPED_ACACIA_WOOD: case Material.STRIPPED_BIRCH_LOG: @@ -249,7 +247,7 @@ public final class BlockUtils { case Material.SPRUCE_WOOD: return false; - default : + default: return !isMcMMOAnvil(blockState) && !mcMMO.getModManager().isCustomAbilityBlock(blockState); } } @@ -257,8 +255,7 @@ public final class BlockUtils { /** * Check if a given block is an ore * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block is an ore, false otherwise */ public static boolean isOre(BlockState blockState) { @@ -268,15 +265,14 @@ public final class BlockUtils { /** * Determine if a given block can be made mossy * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block can be made mossy, false otherwise */ public static boolean canMakeMossy(BlockState blockState) { switch (blockState.getType()) { - case Material.COBBLESTONE : - case Material.DIRT : - case Material.GRASS_PATH : + case Material.COBBLESTONE: + case Material.DIRT: + case Material.GRASS_PATH: return true; case Material.STONE_BRICKS: @@ -285,7 +281,7 @@ public final class BlockUtils { case Material.COBBLESTONE_WALL: return true; - default : + default: return false; } } @@ -293,8 +289,7 @@ public final class BlockUtils { /** * Determine if a given block should be affected by Green Terra * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block should affected by Green Terra, false otherwise */ public static boolean affectedByGreenTerra(BlockState blockState) { @@ -308,10 +303,9 @@ public final class BlockUtils { /** * Determine if a given block should be affected by Super Breaker * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block should affected by Super Breaker, false - * otherwise + * otherwise */ public static Boolean affectedBySuperBreaker(BlockState blockState) { if (ExperienceConfig.getInstance().doesBlockGiveSkillXP(PrimarySkillType.MINING, blockState.getBlockData())) @@ -323,10 +317,9 @@ public final class BlockUtils { /** * Determine if a given block should be affected by Giga Drill Breaker * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block should affected by Giga Drill Breaker, false - * otherwise + * otherwise */ public static boolean affectedByGigaDrillBreaker(BlockState blockState) { if (ExperienceConfig.getInstance().doesBlockGiveSkillXP(PrimarySkillType.EXCAVATION, blockState.getBlockData())) @@ -337,8 +330,7 @@ public final class BlockUtils { /** * Check if a given block is a log * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block is a log, false otherwise */ public static boolean isLog(BlockState blockState) { @@ -350,8 +342,7 @@ public final class BlockUtils { /** * Check if a given block is a leaf * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block is a leaf, false otherwise */ public static boolean isLeaves(BlockState blockState) { @@ -364,7 +355,7 @@ public final class BlockUtils { case Material.SPRUCE_LEAVES: return true; - default : + default: return mcMMO.getModManager().isCustomLeaf(blockState); } } @@ -372,17 +363,16 @@ public final class BlockUtils { /** * Determine if a given block should be affected by Flux Mining * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block should affected by Flux Mining, false otherwise */ public static boolean affectedByFluxMining(BlockState blockState) { switch (blockState.getType()) { - case Material.IRON_ORE : - case Material.GOLD_ORE : + case Material.IRON_ORE: + case Material.GOLD_ORE: return true; - default : + default: return false; } } @@ -390,20 +380,19 @@ public final class BlockUtils { /** * Determine if a given block can activate Herbalism abilities * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block can be activate Herbalism abilities, false - * otherwise + * otherwise */ public static boolean canActivateHerbalism(BlockState blockState) { switch (blockState.getType()) { - case Material.DIRT : - case Material.GRASS : - case Material.GRASS_PATH : + case Material.DIRT: + case Material.GRASS: + case Material.GRASS_PATH: case Material.FARMLAND: return false; - default : + default: return true; } } @@ -411,17 +400,16 @@ public final class BlockUtils { /** * Determine if a given block should be affected by Block Cracker * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block should affected by Block Cracker, false - * otherwise + * otherwise */ public static boolean affectedByBlockCracker(BlockState blockState) { switch (blockState.getType()) { case Material.STONE_BRICKS: return true; - default : + default: return false; } } @@ -429,18 +417,17 @@ public final class BlockUtils { /** * Determine if a given block can be made into Mycelium * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block can be made into Mycelium, false otherwise */ public static boolean canMakeShroomy(BlockState blockState) { switch (blockState.getType()) { - case Material.DIRT : - case Material.GRASS : - case Material.GRASS_PATH : + case Material.DIRT: + case Material.GRASS: + case Material.GRASS_PATH: return true; - default : + default: return false; } } @@ -448,8 +435,7 @@ public final class BlockUtils { /** * Determine if a given block is an mcMMO anvil * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block is an mcMMO anvil, false otherwise */ public static boolean isMcMMOAnvil(BlockState blockState) { @@ -485,8 +471,7 @@ public final class BlockUtils { BlockData data = blockState.getBlockData(); if (data.getMaterial() == Material.CACTUS || data.getMaterial() == Material.SUGAR_CANE) return true; - if (data instanceof Ageable) - { + if (data instanceof Ageable) { Ageable ageable = (Ageable) data; return ageable.getAge() == ageable.getMaximumAge(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java b/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java index 63e1832a1..6cb7fdeaa 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java @@ -1,17 +1,17 @@ package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.runnables.items.ChimaeraWingWarmup; import com.gmail.nossr50.core.util.player.NotificationManager; import com.gmail.nossr50.core.util.skills.CombatUtils; import com.gmail.nossr50.core.util.skills.SkillUtils; import com.gmail.nossr50.core.util.sounds.SoundManager; import com.gmail.nossr50.core.util.sounds.SoundType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.runnables.items.ChimaeraWingWarmup; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; @@ -29,7 +29,8 @@ public final class ChimaeraWing { private static McMMOPlayer mcMMOPlayer; private static Location location; - private ChimaeraWing() {} + private ChimaeraWing() { + } /** * Check for item usage. @@ -61,7 +62,7 @@ public final class ChimaeraWing { int amount = inHand.getAmount(); if (amount < Config.getInstance().getChimaeraUseCost()) { - NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Item.ChimaeraWing.NotEnough",String.valueOf(Config.getInstance().getChimaeraUseCost() - amount), "Item.ChimaeraWing.Name"); + NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Item.ChimaeraWing.NotEnough", String.valueOf(Config.getInstance().getChimaeraUseCost() - amount), "Item.ChimaeraWing.Name"); return; } @@ -110,8 +111,7 @@ public final class ChimaeraWing { if (warmup > 0) { NotificationManager.sendPlayerInformation(player, NotificationType.ITEM_MESSAGE, "Teleport.Commencing", String.valueOf(warmup)); new ChimaeraWingWarmup(mcMMOPlayer).runTaskLater(mcMMO.p, 20 * warmup); - } - else { + } else { chimaeraExecuteTeleport(); } } @@ -121,13 +121,11 @@ public final class ChimaeraWing { if (Config.getInstance().getChimaeraUseBedSpawn() && player.getBedSpawnLocation() != null) { player.teleport(player.getBedSpawnLocation()); - } - else { + } else { Location spawnLocation = player.getWorld().getSpawnLocation(); if (spawnLocation.getBlock().getType() == Material.AIR) { player.teleport(spawnLocation); - } - else { + } else { player.teleport(player.getWorld().getHighestBlockAt(spawnLocation).getLocation()); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/EnchantmentUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/EnchantmentUtils.java index 33d3e0a7b..1a65377d7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/EnchantmentUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/EnchantmentUtils.java @@ -40,7 +40,6 @@ public class EnchantmentUtils { * Method to get an {@link Enchantment} using it's Vanilla Minecraft name or Bukkit enum name * * @param enchantmentName Vanilla or Bukkit name of enchantment - * * @return Enchantment or null if no enchantment was found */ public static Enchantment getByName(String enchantmentName) { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/EventUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/EventUtils.java index 3b8c6f143..84b3a6837 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/EventUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/EventUtils.java @@ -1,19 +1,21 @@ package com.gmail.nossr50.core.util; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.util.skills.CombatUtils; import com.gmail.nossr50.events.experience.McMMOPlayerLevelChangeEvent; import com.gmail.nossr50.events.experience.McMMOPlayerLevelDownEvent; import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent; import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent; -import com.gmail.nossr50.events.fake.*; import com.gmail.nossr50.events.hardcore.McMMOPlayerPreDeathPenaltyEvent; import com.gmail.nossr50.events.hardcore.McMMOPlayerStatLossEvent; import com.gmail.nossr50.events.hardcore.McMMOPlayerVampirismEvent; @@ -28,10 +30,7 @@ import com.gmail.nossr50.events.skills.repair.McMMOPlayerRepairCheckEvent; import com.gmail.nossr50.events.skills.salvage.McMMOPlayerSalvageCheckEvent; import com.gmail.nossr50.events.skills.secondaryabilities.SubSkillEvent; import com.gmail.nossr50.events.skills.unarmed.McMMOPlayerDisarmEvent; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.core.util.skills.CombatUtils; import org.bukkit.block.Block; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Entity; @@ -54,6 +53,7 @@ public class EventUtils { /* * Quality of Life methods */ + /** * Checks to see if damage is from natural sources * This cannot be used to determine if damage is from vanilla MC, it just checks to see if the damage is from a complex behaviour in mcMMO such as bleed. @@ -70,19 +70,19 @@ public class EventUtils { /** * This little method is just to make the code more readable + * * @param entity target entity * @return the associated McMMOPlayer for this entity */ - public static McMMOPlayer getMcMMOPlayer(Entity entity) - { - return UserManager.getPlayer((Player)entity); + public static McMMOPlayer getMcMMOPlayer(Entity entity) { + return UserManager.getPlayer((Player) entity); } /** * Checks to see if a Player was damaged in this EntityDamageEvent - * + *

* This method checks for the following things and if they are all true it returns true - * + *

* 1) The player is real and not an NPC * 2) The player is not in god mode * 3) The damage dealt is above 0 @@ -91,8 +91,7 @@ public class EventUtils { * @param entityDamageEvent * @return */ - public static boolean isRealPlayerDamaged(EntityDamageEvent entityDamageEvent) - { + public static boolean isRealPlayerDamaged(EntityDamageEvent entityDamageEvent) { //Make sure the damage is above 0 double damage = entityDamageEvent.getFinalDamage(); @@ -103,7 +102,7 @@ public class EventUtils { Entity entity = entityDamageEvent.getEntity(); //Check to make sure the entity is not an NPC - if(Misc.isNPCEntity(entity)) + if (Misc.isNPCEntity(entity)) return false; if (!entity.isValid() || !(entity instanceof LivingEntity)) { @@ -150,7 +149,8 @@ public class EventUtils { /** * Calls a new SubSkillEvent for this SubSkill and then returns it - * @param player target player + * + * @param player target player * @param subSkillType target subskill * @return the event after it has been fired */ @@ -164,7 +164,8 @@ public class EventUtils { /** * Calls a new SubSkillEvent for this SubSkill and then returns it - * @param player target player + * + * @param player target player * @param abstractSubSkill target subskill * @return the event after it has been fired */ @@ -201,8 +202,8 @@ public class EventUtils { /** * Simulate a block break event. * - * @param block The block to break - * @param player The player breaking the block + * @param block The block to break + * @param player The player breaking the block * @param shouldArmSwing true if an armswing event should be fired, false otherwise * @return true if the event wasn't cancelled, false otherwise */ diff --git a/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java b/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java index 7ac15590a..a44aba75a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java @@ -1,17 +1,18 @@ package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import java.util.HashMap; public final class HardcoreManager { - private HardcoreManager() {} + private HardcoreManager() { + } public static void invokeStatPenalty(Player player) { double statLossPercentage = Config.getInstance().getHardcoreDeathStatPenaltyPercentage(); @@ -100,8 +101,7 @@ public final class HardcoreManager { if (totalLevelsStolen > 0) { NotificationManager.sendPlayerInformation(killer, NotificationType.HARDCORE_MODE, "Hardcore.Vampirism.Killer.Success", String.valueOf(totalLevelsStolen), victim.getName()); NotificationManager.sendPlayerInformation(victim, NotificationType.HARDCORE_MODE, "Hardcore.Vampirism.Victim.Success", killer.getName(), String.valueOf(totalLevelsStolen)); - } - else { + } else { NotificationManager.sendPlayerInformation(killer, NotificationType.HARDCORE_MODE, "Hardcore.Vampirism.Killer.Failure", victim.getName()); NotificationManager.sendPlayerInformation(victim, NotificationType.HARDCORE_MODE, "Hardcore.Vampirism.Victim.Failure", killer.getName()); } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/HolidayManager.java b/core/src/main/java/com/gmail/nossr50/core/util/HolidayManager.java index cec47e1a9..3eb4c341c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/HolidayManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/HolidayManager.java @@ -1,17 +1,16 @@ package com.gmail.nossr50.core.util; import com.gmail.nossr50.commands.skills.AprilCommand; -import com.gmail.nossr50.core.datatypes.interactions.NotificationType; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.util.player.NotificationManager; import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.util.player.NotificationManager; import com.gmail.nossr50.core.util.skills.ParticleEffectUtils; import com.gmail.nossr50.core.util.sounds.SoundManager; import com.gmail.nossr50.core.util.sounds.SoundType; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; -import org.bukkit.*; import org.bukkit.FireworkEffect.Type; import org.bukkit.command.CommandSender; import org.bukkit.command.PluginCommand; @@ -26,76 +25,11 @@ import java.util.*; import java.util.regex.Pattern; public final class HolidayManager { - private ArrayList hasCelebrated; - private int currentYear; private static final int START_YEAR = 2011; - private static final List ALL_COLORS; private static final List ALL_CHAT_COLORS; private static final List CHAT_FORMATS; - public enum FakeSkillType { - MACHO, - JUMPING, - THROWING, - WRECKING, - CRAFTING, - WALKING, - SWIMMING, - FALLING, - CLIMBING, - FLYING, - DIVING, - PIGGY, - UNKNOWN; - - public static FakeSkillType getByName(String skillName) { - for (FakeSkillType type : values()) { - if (type.name().equalsIgnoreCase(skillName)) { - return type; - } - } - return null; - } - - public static FakeSkillType getByStatistic(Statistic statistic) { - switch (statistic) { - case Statistic.DAMAGE_TAKEN: - return FakeSkillType.MACHO; - case Statistic.JUMP: - return FakeSkillType.JUMPING; - case Statistic.DROP: - return FakeSkillType.THROWING; - case Statistic.MINE_BLOCK: - case Statistic.BREAK_ITEM: - return FakeSkillType.WRECKING; - case Statistic.CRAFT_ITEM: - return FakeSkillType.CRAFTING; - case Statistic.WALK_ONE_CM: - return FakeSkillType.WALKING; - case Statistic.SWIM_ONE_CM: - return FakeSkillType.SWIMMING; - case Statistic.FALL_ONE_CM: - return FakeSkillType.FALLING; - case Statistic.CLIMB_ONE_CM: - return FakeSkillType.CLIMBING; - case Statistic.FLY_ONE_CM: - return FakeSkillType.FLYING; - case Statistic.WALK_UNDER_WATER_ONE_CM: - return FakeSkillType.DIVING; - case Statistic.PIG_ONE_CM: - return FakeSkillType.PIGGY; - default: - return FakeSkillType.UNKNOWN; - } - } - } - - public final Set movementStatistics = EnumSet.of( - Statistic.WALK_ONE_CM, Statistic.SWIM_ONE_CM, Statistic.FALL_ONE_CM, - Statistic.CLIMB_ONE_CM, Statistic.FLY_ONE_CM, Statistic.WALK_UNDER_WATER_ONE_CM, - Statistic.PIG_ONE_CM); - static { List colors = new ArrayList(); List chatColors = new ArrayList(); @@ -104,8 +38,7 @@ public final class HolidayManager { for (ChatColor color : ChatColor.values()) { if (color.isColor()) { chatColors.add(color); - } - else { + } else { chatFormats.add(color); } } @@ -123,6 +56,13 @@ public final class HolidayManager { CHAT_FORMATS = ImmutableList.copyOf(chatFormats); } + public final Set movementStatistics = EnumSet.of( + Statistic.WALK_ONE_CM, Statistic.SWIM_ONE_CM, Statistic.FALL_ONE_CM, + Statistic.CLIMB_ONE_CM, Statistic.FLY_ONE_CM, Statistic.WALK_UNDER_WATER_ONE_CM, + Statistic.PIG_ONE_CM); + private ArrayList hasCelebrated; + private int currentYear; + // This gets called onEnable public HolidayManager() { currentYear = Calendar.getInstance().get(Calendar.YEAR); @@ -132,8 +72,7 @@ public final class HolidayManager { if (!anniversaryFile.exists()) { try { anniversaryFile.createNewFile(); - } - catch (IOException ex) { + } catch (IOException ex) { mcMMO.p.getLogger().severe(ex.toString()); } } @@ -151,14 +90,29 @@ public final class HolidayManager { } reader.close(); - } - catch (Exception ex) { + } catch (Exception ex) { mcMMO.p.getLogger().severe(ex.toString()); } cleanupFiles(); } + private static List colorChoose() { + return ALL_COLORS.subList(0, Math.max(Misc.getRandom().nextInt(ALL_COLORS.size() + 1), 1)); + } + + private static String chatColorChoose() { + StringBuilder ret = new StringBuilder(ALL_CHAT_COLORS.get(Misc.getRandom().nextInt(ALL_CHAT_COLORS.size())).toString()); + + for (ChatColor chatFormat : CHAT_FORMATS) { + if (Misc.getRandom().nextInt(CHAT_FORMATS.size()) == 0) { + ret.append(chatFormat); + } + } + + return ret.toString(); + } + private void cleanupFiles() { File FlatFileDir = new File(mcMMO.getFlatFileDirectory()); File legacy = new File(FlatFileDir, "anniversary.yml"); @@ -203,8 +157,7 @@ public final class HolidayManager { writer.newLine(); } writer.close(); - } - catch (Exception ex) { + } catch (Exception ex) { mcMMO.p.getLogger().severe(ex.toString()); } } @@ -235,34 +188,33 @@ public final class HolidayManager { } }, delay); } - } - else { - /* - * Credit: http://www.geocities.com/spunk1111/ - * (good luck finding that in 3 years heh) - * .''. . *''* :_\/_: . - * :_\/_: _\(/_ .:.*_\/_* : /\ : .'.:.'. - * .''.: /\ : /)\ ':'* /\ * : '..'. -=:o:=- - * :_\/_:'.:::. ' *''* * '.\'/.'_\(/_ '.':'.' - * : /\ : ::::: *_\/_* -= o =- /)\ ' - * '..' ':::' * /\ * .'/.\'. ' * - * * *..* : * - * * * * - * * * * - */ + } else { + /* + * Credit: http://www.geocities.com/spunk1111/ + * (good luck finding that in 3 years heh) + * .''. . *''* :_\/_: . + * :_\/_: _\(/_ .:.*_\/_* : /\ : .'.:.'. + * .''.: /\ : /)\ ':'* /\ * : '..'. -=:o:=- + * :_\/_:'.:::. ' *''* * '.\'/.'_\(/_ '.':'.' + * : /\ : ::::: *_\/_* -= o =- /)\ ' + * '..' ':::' * /\ * .'/.\'. ' * + * * *..* : * + * * * * + * * * * + */ - /* - * Color map - * AAAA D GGGG JJJJJJ K - * AAAAAA DDDDD EEEGGGGGG JJJJJJ KKKKKKK - * BBBBAAAAAA DDD EEEGGGGGG I JJJJJ KKKKKKK - * BBBBBBACCCCC D FFFF G IIIIIIIHHHHH KKKKKKK - * BBBBBB CCCCC FFFFFF IIIIIII HHH K - * BBBB CCCCC FFFFFF IIIIIII H k - * b FFFF I k - * b i k - * b i k - */ + /* + * Color map + * AAAA D GGGG JJJJJJ K + * AAAAAA DDDDD EEEGGGGGG JJJJJJ KKKKKKK + * BBBBAAAAAA DDD EEEGGGGGG I JJJJJ KKKKKKK + * BBBBBBACCCCC D FFFF G IIIIIIIHHHHH KKKKKKK + * BBBBBB CCCCC FFFFFF IIIIIII HHH K + * BBBB CCCCC FFFFFF IIIIIII H k + * b FFFF I k + * b i k + * b i k + */ Object[] colorParams = new Object[]{chatColorChoose(), chatColorChoose(), chatColorChoose(), chatColorChoose(), chatColorChoose(), chatColorChoose(), chatColorChoose(), chatColorChoose(), chatColorChoose(), chatColorChoose(), chatColorChoose()}; sender.sendMessage(String.format(" %1$s.''. %4$s. %7$s*''* %10$s:_\\/_: %11$s.", colorParams)); sender.sendMessage(String.format(" %1$s:_\\/_: %4$s_\\(/_ %5$s.:.%7$s*_\\/_* %10$s: /\\ : %11$s.'.:.'.", colorParams)); @@ -296,22 +248,6 @@ public final class HolidayManager { fireworks.setFireworkMeta(fireworkmeta); } - private static List colorChoose() { - return ALL_COLORS.subList(0, Math.max(Misc.getRandom().nextInt(ALL_COLORS.size() + 1), 1)); - } - - private static String chatColorChoose() { - StringBuilder ret = new StringBuilder(ALL_CHAT_COLORS.get(Misc.getRandom().nextInt(ALL_CHAT_COLORS.size())).toString()); - - for (ChatColor chatFormat : CHAT_FORMATS) { - if (Misc.getRandom().nextInt(CHAT_FORMATS.size()) == 0) { - ret.append(chatFormat); - } - } - - return ret.toString(); - } - public boolean isAprilFirst() { GregorianCalendar aprilFirst = new GregorianCalendar(currentYear, Calendar.APRIL, 1); GregorianCalendar aprilSecond = new GregorianCalendar(currentYear, Calendar.APRIL, 2); @@ -370,4 +306,61 @@ public final class HolidayManager { PluginCommand command = mcMMO.p.getCommand("mcfools"); command.setExecutor(new AprilCommand()); } + + public enum FakeSkillType { + MACHO, + JUMPING, + THROWING, + WRECKING, + CRAFTING, + WALKING, + SWIMMING, + FALLING, + CLIMBING, + FLYING, + DIVING, + PIGGY, + UNKNOWN; + + public static FakeSkillType getByName(String skillName) { + for (FakeSkillType type : values()) { + if (type.name().equalsIgnoreCase(skillName)) { + return type; + } + } + return null; + } + + public static FakeSkillType getByStatistic(Statistic statistic) { + switch (statistic) { + case Statistic.DAMAGE_TAKEN: + return FakeSkillType.MACHO; + case Statistic.JUMP: + return FakeSkillType.JUMPING; + case Statistic.DROP: + return FakeSkillType.THROWING; + case Statistic.MINE_BLOCK: + case Statistic.BREAK_ITEM: + return FakeSkillType.WRECKING; + case Statistic.CRAFT_ITEM: + return FakeSkillType.CRAFTING; + case Statistic.WALK_ONE_CM: + return FakeSkillType.WALKING; + case Statistic.SWIM_ONE_CM: + return FakeSkillType.SWIMMING; + case Statistic.FALL_ONE_CM: + return FakeSkillType.FALLING; + case Statistic.CLIMB_ONE_CM: + return FakeSkillType.CLIMBING; + case Statistic.FLY_ONE_CM: + return FakeSkillType.FLYING; + case Statistic.WALK_UNDER_WATER_ONE_CM: + return FakeSkillType.DIVING; + case Statistic.PIG_ONE_CM: + return FakeSkillType.PIGGY; + default: + return FakeSkillType.UNKNOWN; + } + } + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java index 709bfa87e..85b2d1ff1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.party.ItemWeightConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import org.bukkit.ChatColor; @@ -12,7 +12,8 @@ import org.bukkit.inventory.Recipe; import org.bukkit.inventory.meta.ItemMeta; public final class ItemUtils { - private ItemUtils() {} + private ItemUtils() { + } /** * Checks if the item is a bow. diff --git a/core/src/main/java/com/gmail/nossr50/core/util/MaterialUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/MaterialUtils.java index 698936c1c..65b79d9b7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/MaterialUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/MaterialUtils.java @@ -4,7 +4,8 @@ import com.gmail.nossr50.mcMMO; import org.bukkit.Material; public final class MaterialUtils { - private MaterialUtils() {} + private MaterialUtils() { + } protected static boolean isOre(Material data) { switch (data) { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/Misc.java b/core/src/main/java/com/gmail/nossr50/core/util/Misc.java index 48ace8dab..9257e44f4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/Misc.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/Misc.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.core.util; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask; import com.gmail.nossr50.events.items.McMMOItemSpawnEvent; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask; -import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableSet; import org.bukkit.Location; import org.bukkit.Material; @@ -19,13 +19,11 @@ import java.util.Random; import java.util.Set; public final class Misc { - private static Random random = new Random(); - public static final int TIME_CONVERSION_FACTOR = 1000; public static final int TICK_CONVERSION_FACTOR = 20; - public static final int PLAYER_RESPAWN_COOLDOWN_SECONDS = 5; public static final double SKILL_MESSAGE_MAX_SENDING_DISTANCE = 10.0; + public static final Set modNames = ImmutableSet.of("LOTR", "BUILDCRAFT", "ENDERIO", "ENHANCEDBIOMES", "IC2", "METALLURGY", "FORESTRY", "GALACTICRAFT", "RAILCRAFT", "TWILIGHTFOREST", "THAUMCRAFT", "GRAVESTONEMOD", "GROWTHCRAFT", "ARCTICMOBS", "DEMONMOBS", "INFERNOMOBS", "SWAMPMOBS", "MARICULTURE", "MINESTRAPPOLATION"); // Sound Pitches & Volumes from CB /* public static final float ANVIL_USE_PITCH = 0.3F; // Not in CB directly, I went off the place sound values @@ -37,10 +35,12 @@ public final class Misc { public static final float GHAST_VOLUME = 1.0F * Config.getInstance().getMasterVolume(); public static final float LEVELUP_PITCH = 0.5F; // Reduced to differentiate between vanilla level-up public static final float LEVELUP_VOLUME = 0.75F * Config.getInstance().getMasterVolume(); // Use max volume always*/ + private static Random random = new Random(); - public static final Set modNames = ImmutableSet.of("LOTR", "BUILDCRAFT", "ENDERIO", "ENHANCEDBIOMES", "IC2", "METALLURGY", "FORESTRY", "GALACTICRAFT", "RAILCRAFT", "TWILIGHTFOREST", "THAUMCRAFT", "GRAVESTONEMOD", "GROWTHCRAFT", "ARCTICMOBS", "DEMONMOBS", "INFERNOMOBS", "SWAMPMOBS", "MARICULTURE", "MINESTRAPPOLATION"); + private Misc() { + } - private Misc() {}; + ; public static boolean isNPCEntity(Entity entity) { return (entity == null || entity.hasMetadata("NPC") || entity instanceof NPC || entity.getClass().getName().equalsIgnoreCase("cofh.entity.PlayerFake")); @@ -49,8 +49,8 @@ public final class Misc { /** * Determine if two locations are near each other. * - * @param first The first location - * @param second The second location + * @param first The first location + * @param second The second location * @param maxDistance The max distance apart * @return true if the distance between {@code first} and {@code second} is less than {@code maxDistance}, false otherwise */ @@ -60,7 +60,7 @@ public final class Misc { /** * Get the center of the given block. - * + * * @param blockState The {@link BlockState} of the block * @return A {@link Location} lying at the center of the block */ @@ -78,7 +78,7 @@ public final class Misc { * Drop items at a given location. * * @param location The location to drop the items at - * @param is The items to drop + * @param is The items to drop * @param quantity The amount of items to drop */ public static void dropItems(Location location, ItemStack is, int quantity) { @@ -90,7 +90,7 @@ public final class Misc { /** * Drop an item at a given location. * - * @param location The location to drop the item at + * @param location The location to drop the item at * @param itemStack The item to drop * @return Dropped Item entity or null if invalid or cancelled */ diff --git a/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java index 55826c168..2b69e64d5 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java @@ -2,10 +2,10 @@ package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.skills.MobHealthbarType; import com.gmail.nossr50.core.datatypes.meta.OldName; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.runnables.MobHealthDisplayUpdaterTask; +import com.gmail.nossr50.core.skills.MobHealthbarType; +import com.gmail.nossr50.mcMMO; import org.bukkit.ChatColor; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -14,13 +14,14 @@ import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.metadata.FixedMetadataValue; public final class MobHealthbarUtils { - private MobHealthbarUtils() {} + private MobHealthbarUtils() { + } /** * Fix issues with death messages caused by the mob healthbars. * * @param deathMessage The original death message - * @param player The player who died + * @param player The player who died * @return the fixed death message */ public static String fixDeathMessage(String deathMessage, Player player) { @@ -32,7 +33,8 @@ public final class MobHealthbarUtils { /** * Handle the creation of mob healthbars. - * @param target the targetted entity + * + * @param target the targetted entity * @param damage damage done by the attack triggering this */ public static void handleMobHealthbars(LivingEntity target, double damage, mcMMO plugin) { @@ -50,13 +52,12 @@ public final class MobHealthbarUtils { /* * Store the name in metadata */ - if(target.getMetadata("mcMMO_oldName").size() <= 0 && originalName != null) + if (target.getMetadata("mcMMO_oldName").size() <= 0 && originalName != null) target.setMetadata("mcMMO_oldName", new OldName(originalName, plugin)); if (oldName == null) { oldName = ""; - } - else if (oldName.equalsIgnoreCase(AdvancedConfig.getInstance().getKrakenName())) { + } else if (oldName.equalsIgnoreCase(AdvancedConfig.getInstance().getKrakenName())) { return; } @@ -74,8 +75,7 @@ public final class MobHealthbarUtils { if (updateName) { target.setMetadata(mcMMO.customNameKey, new FixedMetadataValue(mcMMO.p, oldName)); target.setMetadata(mcMMO.customVisibleKey, new FixedMetadataValue(mcMMO.p, oldNameVisible)); - } - else if (!target.hasMetadata(mcMMO.customNameKey)) { + } else if (!target.hasMetadata(mcMMO.customNameKey)) { target.setMetadata(mcMMO.customNameKey, new FixedMetadataValue(mcMMO.p, "")); target.setMetadata(mcMMO.customVisibleKey, new FixedMetadataValue(mcMMO.p, false)); } @@ -105,20 +105,15 @@ public final class MobHealthbarUtils { if (healthPercentage >= 85) { color = ChatColor.DARK_GREEN; - } - else if (healthPercentage >= 70) { + } else if (healthPercentage >= 70) { color = ChatColor.GREEN; - } - else if (healthPercentage >= 55) { + } else if (healthPercentage >= 55) { color = ChatColor.GOLD; - } - else if (healthPercentage >= 40) { + } else if (healthPercentage >= 40) { color = ChatColor.YELLOW; - } - else if (healthPercentage >= 25) { + } else if (healthPercentage >= 25) { color = ChatColor.RED; - } - else if (healthPercentage >= 0) { + } else if (healthPercentage >= 0) { color = ChatColor.DARK_RED; } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java b/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java index 0585613b4..7db1d74cf 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.mods.CustomArmorConfig; import com.gmail.nossr50.config.mods.CustomBlockConfig; import com.gmail.nossr50.config.mods.CustomEntityConfig; import com.gmail.nossr50.config.mods.CustomToolConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.mods.CustomBlock; import com.gmail.nossr50.core.datatypes.mods.CustomEntity; import com.gmail.nossr50.core.datatypes.mods.CustomTool; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; +import com.gmail.nossr50.mcMMO; import org.bukkit.Material; import org.bukkit.block.BlockState; import org.bukkit.configuration.file.YamlConfiguration; @@ -25,32 +25,32 @@ public class ModManager { private List repairables = new ArrayList(); // Armor Mods - private List customBoots = new ArrayList(); + private List customBoots = new ArrayList(); private List customChestplates = new ArrayList(); - private List customHelmets = new ArrayList(); - private List customLeggings = new ArrayList(); + private List customHelmets = new ArrayList(); + private List customLeggings = new ArrayList(); // Block Mods - private List customExcavationBlocks = new ArrayList(); - private List customHerbalismBlocks = new ArrayList(); - private List customMiningBlocks = new ArrayList(); - private List customOres = new ArrayList(); - private List customLogs = new ArrayList(); - private List customLeaves = new ArrayList(); - private List customAbilityBlocks = new ArrayList(); + private List customExcavationBlocks = new ArrayList(); + private List customHerbalismBlocks = new ArrayList(); + private List customMiningBlocks = new ArrayList(); + private List customOres = new ArrayList(); + private List customLogs = new ArrayList(); + private List customLeaves = new ArrayList(); + private List customAbilityBlocks = new ArrayList(); private HashMap customBlockMap = new HashMap<>(); // Entity Mods private HashMap customEntityClassMap = new HashMap(); - private HashMap customEntityTypeMap = new HashMap(); + private HashMap customEntityTypeMap = new HashMap(); // Tool Mods - private List customAxes = new ArrayList(); - private List customBows = new ArrayList(); - private List customHoes = new ArrayList(); + private List customAxes = new ArrayList(); + private List customBows = new ArrayList(); + private List customHoes = new ArrayList(); private List customPickaxes = new ArrayList(); - private List customShovels = new ArrayList(); - private List customSwords = new ArrayList(); + private List customShovels = new ArrayList(); + private List customSwords = new ArrayList(); private HashMap customToolMap = new HashMap(); public void registerCustomArmor(CustomArmorConfig config) { @@ -199,8 +199,7 @@ public class ModManager { try { return customEntityClassMap.containsKey(((Class) entity.getClass().getDeclaredField("entityClass").get(entity)).getName()); - } - catch (Exception e) { + } catch (Exception e) { if (e instanceof NoSuchFieldException || e instanceof IllegalArgumentException || e instanceof IllegalAccessException) { return customEntityClassMap.containsKey(entity.getClass().getName()); } @@ -216,12 +215,10 @@ public class ModManager { if (customEntity == null) { try { customEntity = customEntityClassMap.get(((Class) entity.getClass().getDeclaredField("entityClass").get(entity)).getName()); - } - catch (Exception e) { + } catch (Exception e) { if (e instanceof NoSuchFieldException || e instanceof IllegalArgumentException || e instanceof IllegalAccessException) { customEntity = customEntityClassMap.get(entity.getClass().getName()); - } - else { + } else { e.printStackTrace(); } } @@ -257,12 +254,10 @@ public class ModManager { try { className = ((Class) entity.getClass().getDeclaredField("entityClass").get(entity)).getName(); - } - catch (Exception e) { + } catch (Exception e) { if (e instanceof NoSuchFieldException || e instanceof IllegalArgumentException || e instanceof IllegalAccessException) { className = entity.getClass().getName(); - } - else { + } else { e.printStackTrace(); } } @@ -274,8 +269,7 @@ public class ModManager { try { entitiesFile.save(entityFile); mcMMO.p.debug(entity.getType().toString() + " was added to the custom entities file!"); - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/Motd.java b/core/src/main/java/com/gmail/nossr50/core/util/Motd.java index b675c539f..f625b54a3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/Motd.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/Motd.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.skills.PerksUtils; import com.gmail.nossr50.mcMMO; import org.bukkit.entity.Player; @@ -14,7 +14,8 @@ public final class Motd { public static final String PERK_PREFIX = LocaleLoader.getString("MOTD.PerksPrefix") + " "; private static final PluginDescriptionFile pluginDescription = mcMMO.p.getDescription(); - private Motd() {} + private Motd() { + } public static void displayAll(Player player) { displayVersion(player, pluginDescription.getVersion()); diff --git a/core/src/main/java/com/gmail/nossr50/core/util/Permissions.java b/core/src/main/java/com/gmail/nossr50/core/util/Permissions.java index aaea517dc..addbe21df 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/Permissions.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/Permissions.java @@ -17,200 +17,490 @@ import org.bukkit.permissions.PermissionDefault; import org.bukkit.plugin.PluginManager; public final class Permissions { - private Permissions() {} + private Permissions() { + } /* * GENERAL */ - public static boolean motd(Permissible permissible) { return permissible.hasPermission("mcmmo.motd"); } - public static boolean mobHealthDisplay(Permissible permissible) { return permissible.hasPermission("mcmmo.mobhealthdisplay"); } - public static boolean updateNotifications(Permissible permissible) {return permissible.hasPermission("mcmmo.tools.updatecheck"); } - public static boolean chimaeraWing(Permissible permissible) { return permissible.hasPermission("mcmmo.item.chimaerawing"); } - public static boolean showversion(Permissible permissible) { return permissible.hasPermission("mcmmo.showversion"); } + public static boolean motd(Permissible permissible) { + return permissible.hasPermission("mcmmo.motd"); + } + + public static boolean mobHealthDisplay(Permissible permissible) { + return permissible.hasPermission("mcmmo.mobhealthdisplay"); + } + + public static boolean updateNotifications(Permissible permissible) { + return permissible.hasPermission("mcmmo.tools.updatecheck"); + } + + public static boolean chimaeraWing(Permissible permissible) { + return permissible.hasPermission("mcmmo.item.chimaerawing"); + } + + public static boolean showversion(Permissible permissible) { + return permissible.hasPermission("mcmmo.showversion"); + } /* BYPASS */ - public static boolean hardcoreBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.hardcoremode"); } - public static boolean arcaneBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.arcanebypass"); } - public static boolean krakenBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.kraken"); } - public static boolean trapsBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.fishingtraps"); } + public static boolean hardcoreBypass(Permissible permissible) { + return permissible.hasPermission("mcmmo.bypass.hardcoremode"); + } + + public static boolean arcaneBypass(Permissible permissible) { + return permissible.hasPermission("mcmmo.bypass.arcanebypass"); + } + + public static boolean krakenBypass(Permissible permissible) { + return permissible.hasPermission("mcmmo.bypass.kraken"); + } + + public static boolean trapsBypass(Permissible permissible) { + return permissible.hasPermission("mcmmo.bypass.fishingtraps"); + } /* CHAT */ - public static boolean partyChat(Permissible permissible) { return permissible.hasPermission("mcmmo.chat.partychat"); } - public static boolean adminChat(Permissible permissible) { return permissible.hasPermission("mcmmo.chat.adminchat"); } + public static boolean partyChat(Permissible permissible) { + return permissible.hasPermission("mcmmo.chat.partychat"); + } + + public static boolean adminChat(Permissible permissible) { + return permissible.hasPermission("mcmmo.chat.adminchat"); + } /* * COMMANDS */ - public static boolean mmoinfo(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoinfo"); } - public static boolean addlevels(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.addlevels"); } - public static boolean addlevelsOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.addlevels.others"); } + public static boolean mmoinfo(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mmoinfo"); + } - public static boolean addxp(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.addxp"); } - public static boolean addxpOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.addxp.others"); } + public static boolean addlevels(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.addlevels"); + } - public static boolean hardcoreModify(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.hardcore.modify"); } - public static boolean hardcoreToggle(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.hardcore.toggle"); } + public static boolean addlevelsOthers(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.addlevels.others"); + } - public static boolean inspect(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect")); } - public static boolean inspectFar(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect.far")); } - public static boolean inspectHidden(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect.hidden")); } - public static boolean inspectOffline(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect.offline")); } + public static boolean addxp(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.addxp"); + } - public static boolean kraken(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.kraken"); } - public static boolean krakenOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.kraken.others"); } + public static boolean addxpOthers(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.addxp.others"); + } - public static boolean mcability(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcability")); } - public static boolean mcabilityOthers(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcability.others")); } + public static boolean hardcoreModify(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.hardcore.modify"); + } - public static boolean adminChatSpy(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcchatspy");} - public static boolean adminChatSpyOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcchatspy.others");} + public static boolean hardcoreToggle(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.hardcore.toggle"); + } - public static boolean mcgod(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcgod"); } - public static boolean mcgodOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcgod.others"); } + public static boolean inspect(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.inspect")); + } - public static boolean mcmmoDescription(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcmmo.description"); } - public static boolean mcmmoHelp(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcmmo.help"); } + public static boolean inspectFar(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.inspect.far")); + } - public static boolean mcrank(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrank")); } - public static boolean mcrankOthers(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrank.others")); } - public static boolean mcrankFar(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrank.others.far")); } - public static boolean mcrankOffline(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrank.others.offline")); } + public static boolean inspectHidden(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.inspect.hidden")); + } - public static boolean mcrefresh(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrefresh")); } - public static boolean mcrefreshOthers(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrefresh.others")); } + public static boolean inspectOffline(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.inspect.offline")); + } - public static boolean mctop(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.mctop." + skill.toString().toLowerCase()); } + public static boolean kraken(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.kraken"); + } - public static boolean mmoedit(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoedit"); } - public static boolean mmoeditOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoedit.others"); } + public static boolean krakenOthers(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.kraken.others"); + } - public static boolean skillreset(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.skillreset"); } - public static boolean skillreset(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.skillreset." + skill.toString().toLowerCase()); } - public static boolean skillresetOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.skillreset.others"); } - public static boolean skillresetOthers(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.skillreset.others." + skill.toString().toLowerCase()); } + public static boolean mcability(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.mcability")); + } - public static boolean xplock(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.xplock." + skill.toString().toLowerCase()); } + public static boolean mcabilityOthers(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.mcability.others")); + } - public static boolean xprateSet(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.xprate.set"); } - public static boolean xprateReset(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.xprate.reset"); } + public static boolean adminChatSpy(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mcchatspy"); + } - public static boolean vampirismModify(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.vampirism.modify"); } - public static boolean vampirismToggle(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.vampirism.toggle"); } + public static boolean adminChatSpyOthers(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mcchatspy.others"); + } - public static boolean mcpurge(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcpurge"); } - public static boolean mcremove(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcremove"); } - public static boolean mmoupdate(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoupdate"); } + public static boolean mcgod(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mcgod"); + } + + public static boolean mcgodOthers(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mcgod.others"); + } + + public static boolean mcmmoDescription(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mcmmo.description"); + } + + public static boolean mcmmoHelp(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mcmmo.help"); + } + + public static boolean mcrank(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.mcrank")); + } + + public static boolean mcrankOthers(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.mcrank.others")); + } + + public static boolean mcrankFar(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.mcrank.others.far")); + } + + public static boolean mcrankOffline(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.mcrank.others.offline")); + } + + public static boolean mcrefresh(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.mcrefresh")); + } + + public static boolean mcrefreshOthers(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.mcrefresh.others")); + } + + public static boolean mctop(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.commands.mctop." + skill.toString().toLowerCase()); + } + + public static boolean mmoedit(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mmoedit"); + } + + public static boolean mmoeditOthers(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mmoedit.others"); + } + + public static boolean skillreset(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.skillreset"); + } + + public static boolean skillreset(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.commands.skillreset." + skill.toString().toLowerCase()); + } + + public static boolean skillresetOthers(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.skillreset.others"); + } + + public static boolean skillresetOthers(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.commands.skillreset.others." + skill.toString().toLowerCase()); + } + + public static boolean xplock(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.commands.xplock." + skill.toString().toLowerCase()); + } + + public static boolean xprateSet(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.xprate.set"); + } + + public static boolean xprateReset(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.xprate.reset"); + } + + public static boolean vampirismModify(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.vampirism.modify"); + } + + public static boolean vampirismToggle(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.vampirism.toggle"); + } + + public static boolean mcpurge(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mcpurge"); + } + + public static boolean mcremove(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mcremove"); + } + + public static boolean mmoupdate(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mmoupdate"); + } /* * PERKS */ - public static boolean lucky(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.lucky." + skill.toString().toLowerCase()); } + public static boolean lucky(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.lucky." + skill.toString().toLowerCase()); + } /* XP PERKS */ - public static boolean quadrupleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.quadruple." + skill.toString().toLowerCase()); } - public static boolean tripleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.triple." + skill.toString().toLowerCase()); } - public static boolean doubleAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.150percentboost." + skill.toString().toLowerCase()); } - public static boolean doubleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.double." + skill.toString().toLowerCase()); } - public static boolean oneAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.50percentboost." + skill.toString().toLowerCase()); } - public static boolean oneAndOneTenthXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.10percentboost." + skill.toString().toLowerCase()); } - public static boolean customXpBoost(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.customboost." + skill.toString().toLowerCase()); } + public static boolean quadrupleXp(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.quadruple." + skill.toString().toLowerCase()); + } + + public static boolean tripleXp(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.triple." + skill.toString().toLowerCase()); + } + + public static boolean doubleAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.150percentboost." + skill.toString().toLowerCase()); + } + + public static boolean doubleXp(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.double." + skill.toString().toLowerCase()); + } + + public static boolean oneAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.50percentboost." + skill.toString().toLowerCase()); + } + + public static boolean oneAndOneTenthXp(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.10percentboost." + skill.toString().toLowerCase()); + } + + public static boolean customXpBoost(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.customboost." + skill.toString().toLowerCase()); + } /* ACTIVATION PERKS */ - public static boolean twelveSecondActivationBoost(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.activationtime.twelveseconds"); } - public static boolean eightSecondActivationBoost(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.activationtime.eightseconds"); } - public static boolean fourSecondActivationBoost(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.activationtime.fourseconds"); } + public static boolean twelveSecondActivationBoost(Permissible permissible) { + return permissible.hasPermission("mcmmo.perks.activationtime.twelveseconds"); + } + + public static boolean eightSecondActivationBoost(Permissible permissible) { + return permissible.hasPermission("mcmmo.perks.activationtime.eightseconds"); + } + + public static boolean fourSecondActivationBoost(Permissible permissible) { + return permissible.hasPermission("mcmmo.perks.activationtime.fourseconds"); + } /* COOLDOWN PERKS */ - public static boolean halvedCooldowns(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.cooldowns.halved"); } - public static boolean thirdedCooldowns(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.cooldowns.thirded"); } - public static boolean quarteredCooldowns(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.cooldowns.quartered"); } + public static boolean halvedCooldowns(Permissible permissible) { + return permissible.hasPermission("mcmmo.perks.cooldowns.halved"); + } + + public static boolean thirdedCooldowns(Permissible permissible) { + return permissible.hasPermission("mcmmo.perks.cooldowns.thirded"); + } + + public static boolean quarteredCooldowns(Permissible permissible) { + return permissible.hasPermission("mcmmo.perks.cooldowns.quartered"); + } /* * SKILLS */ - public static boolean skillEnabled(Permissible permissible, PrimarySkillType skill) {return permissible.hasPermission("mcmmo.skills." + skill.toString().toLowerCase()); } - public static boolean vanillaXpBoost(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase() + ".vanillaxpboost"); } - public static boolean isSubSkillEnabled(Permissible permissible, SubSkillType subSkillType) { return permissible.hasPermission(subSkillType.getPermissionNodeAddress()); } - public static boolean isSubSkillEnabled(Permissible permissible, AbstractSubSkill abstractSubSkill) { return permissible.hasPermission(abstractSubSkill.getPermissionNode()); } - public static boolean bonusDamage(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase() + ".bonusdamage"); } + public static boolean skillEnabled(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.skills." + skill.toString().toLowerCase()); + } + + public static boolean vanillaXpBoost(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase() + ".vanillaxpboost"); + } + + public static boolean isSubSkillEnabled(Permissible permissible, SubSkillType subSkillType) { + return permissible.hasPermission(subSkillType.getPermissionNodeAddress()); + } + + public static boolean isSubSkillEnabled(Permissible permissible, AbstractSubSkill abstractSubSkill) { + return permissible.hasPermission(abstractSubSkill.getPermissionNode()); + } + + public static boolean bonusDamage(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase() + ".bonusdamage"); + } /* ACROBATICS */ - public static boolean dodge(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.acrobatics.dodge"); } - public static boolean gracefulRoll(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.acrobatics.gracefulroll"); } - public static boolean roll(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.acrobatics.roll"); } + public static boolean dodge(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.acrobatics.dodge"); + } + + public static boolean gracefulRoll(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.acrobatics.gracefulroll"); + } + + public static boolean roll(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.acrobatics.roll"); + } /* ALCHEMY */ - public static boolean catalysis(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.alchemy.catalysis"); } - public static boolean concoctions(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.alchemy.concoctions"); } + public static boolean catalysis(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.alchemy.catalysis"); + } + + public static boolean concoctions(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.alchemy.concoctions"); + } /* ARCHERY */ - public static boolean arrowRetrieval(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.archery.trackarrows"); } - public static boolean daze(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.archery.daze"); } + public static boolean arrowRetrieval(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.archery.trackarrows"); + } + + public static boolean daze(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.archery.daze"); + } /* AXES */ - public static boolean skullSplitter(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.axes.skullsplitter"); } + public static boolean skullSplitter(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.axes.skullsplitter"); + } /* EXCAVATION */ - public static boolean gigaDrillBreaker(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.excavation.gigadrillbreaker"); } + public static boolean gigaDrillBreaker(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.excavation.gigadrillbreaker"); + } /* HERBALISM */ - public static boolean greenTerra(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.herbalism.greenterra"); } - public static boolean greenThumbBlock(Permissible permissible, Material material) { return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.blocks." + material.toString().replace("_", "").toLowerCase()); } - public static boolean greenThumbPlant(Permissible permissible, Material material) { return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.plants." + material.toString().replace("_", "").toLowerCase()); } + public static boolean greenTerra(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.herbalism.greenterra"); + } + + public static boolean greenThumbBlock(Permissible permissible, Material material) { + return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.blocks." + material.toString().replace("_", "").toLowerCase()); + } + + public static boolean greenThumbPlant(Permissible permissible, Material material) { + return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.plants." + material.toString().replace("_", "").toLowerCase()); + } /* MINING */ - public static boolean biggerBombs(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.blastmining.biggerbombs"); } - public static boolean demolitionsExpertise(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.blastmining.demolitionsexpertise"); } - public static boolean remoteDetonation(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.blastmining.detonate"); } - public static boolean superBreaker(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.superbreaker"); } + public static boolean biggerBombs(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.mining.blastmining.biggerbombs"); + } + + public static boolean demolitionsExpertise(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.mining.blastmining.demolitionsexpertise"); + } + + public static boolean remoteDetonation(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.mining.blastmining.detonate"); + } + + public static boolean superBreaker(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.mining.superbreaker"); + } /* REPAIR */ - public static boolean repairItemType(Permissible permissible, ItemType repairItemType) { return permissible.hasPermission("mcmmo.ability.repair." + repairItemType.toString().toLowerCase() + "repair"); } - public static boolean repairMaterialType(Permissible permissible, MaterialType repairMaterialType) { return permissible.hasPermission("mcmmo.ability.repair." + repairMaterialType.toString().toLowerCase() + "repair"); } + public static boolean repairItemType(Permissible permissible, ItemType repairItemType) { + return permissible.hasPermission("mcmmo.ability.repair." + repairItemType.toString().toLowerCase() + "repair"); + } + + public static boolean repairMaterialType(Permissible permissible, MaterialType repairMaterialType) { + return permissible.hasPermission("mcmmo.ability.repair." + repairMaterialType.toString().toLowerCase() + "repair"); + } /* SALVAGE */ - public static boolean advancedSalvage(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.salvage.advancedsalvage"); } - public static boolean arcaneSalvage(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.salvage.arcanesalvage"); } + public static boolean advancedSalvage(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.salvage.advancedsalvage"); + } - public static boolean salvageItemType(Permissible permissible, ItemType salvageItemType) { return permissible.hasPermission("mcmmo.ability.salvage." + salvageItemType.toString().toLowerCase() + "salvage"); } - public static boolean salvageMaterialType(Permissible permissible, MaterialType salvageMaterialType) { return permissible.hasPermission("mcmmo.ability.salvage." + salvageMaterialType.toString().toLowerCase() + "salvage"); } + public static boolean arcaneSalvage(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.salvage.arcanesalvage"); + } + + public static boolean salvageItemType(Permissible permissible, ItemType salvageItemType) { + return permissible.hasPermission("mcmmo.ability.salvage." + salvageItemType.toString().toLowerCase() + "salvage"); + } + + public static boolean salvageMaterialType(Permissible permissible, MaterialType salvageMaterialType) { + return permissible.hasPermission("mcmmo.ability.salvage." + salvageMaterialType.toString().toLowerCase() + "salvage"); + } /* SMELTING */ - public static boolean fluxMining(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.smelting.fluxmining"); } - public static boolean fuelEfficiency(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.smelting.fuelefficiency"); } + public static boolean fluxMining(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.smelting.fluxmining"); + } + + public static boolean fuelEfficiency(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.smelting.fuelefficiency"); + } /* SWORDS */ - public static boolean serratedStrikes(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.swords.serratedstrikes"); } + public static boolean serratedStrikes(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.swords.serratedstrikes"); + } /* TAMING */ - public static boolean callOfTheWild(Permissible permissible, EntityType type) { return permissible.hasPermission("mcmmo.ability.taming.callofthewild." + type.toString().toLowerCase()); } - public static boolean renamePets(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.callofthewild.renamepets"); } + public static boolean callOfTheWild(Permissible permissible, EntityType type) { + return permissible.hasPermission("mcmmo.ability.taming.callofthewild." + type.toString().toLowerCase()); + } + + public static boolean renamePets(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.taming.callofthewild.renamepets"); + } /* UNARMED */ - public static boolean berserk(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.unarmed.berserk"); } + public static boolean berserk(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.unarmed.berserk"); + } /* WOODCUTTING */ - public static boolean treeFeller(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.woodcutting.treefeller"); } + public static boolean treeFeller(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.woodcutting.treefeller"); + } /* * PARTY */ - public static boolean partySizeBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.partylimit" ); } - public static boolean party(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.party"); } - public static boolean partySubcommand(Permissible permissible, PartySubcommandType subcommand) { return permissible.hasPermission("mcmmo.commands.party." + subcommand.toString().toLowerCase()); } - public static boolean friendlyFire(Permissible permissible) { return permissible.hasPermission("mcmmo.party.friendlyfire"); } + public static boolean partySizeBypass(Permissible permissible) { + return permissible.hasPermission("mcmmo.bypass.partylimit"); + } + + public static boolean party(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.party"); + } + + public static boolean partySubcommand(Permissible permissible, PartySubcommandType subcommand) { + return permissible.hasPermission("mcmmo.commands.party." + subcommand.toString().toLowerCase()); + } + + public static boolean friendlyFire(Permissible permissible) { + return permissible.hasPermission("mcmmo.party.friendlyfire"); + } /* TELEPORT */ - public static boolean partyTeleportSend(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.send"); } - public static boolean partyTeleportAccept(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.accept"); } - public static boolean partyTeleportAcceptAll(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.acceptall"); } - public static boolean partyTeleportToggle(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.toggle"); } + public static boolean partyTeleportSend(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.ptp.send"); + } - public static boolean partyTeleportAllWorlds(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.world.all"); } - public static boolean partyTeleportWorld(Permissible permissible, World world) { return permissible.hasPermission("mcmmo.commands.ptp.world." + world.getName()); } + public static boolean partyTeleportAccept(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.ptp.accept"); + } + + public static boolean partyTeleportAcceptAll(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.ptp.acceptall"); + } + + public static boolean partyTeleportToggle(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.ptp.toggle"); + } + + public static boolean partyTeleportAllWorlds(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.ptp.world.all"); + } + + public static boolean partyTeleportWorld(Permissible permissible, World world) { + return permissible.hasPermission("mcmmo.commands.ptp.world." + world.getName()); + } public static void generateWorldTeleportPermissions() { Server server = mcMMO.p.getServer(); diff --git a/core/src/main/java/com/gmail/nossr50/core/util/StringUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/StringUtils.java index f744ffb37..e4234f181 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/StringUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/StringUtils.java @@ -12,8 +12,7 @@ public class StringUtils { /** * Gets a capitalized version of the target string. * - * @param target - * String to capitalize + * @param target String to capitalize * @return the capitalized string */ public static String getCapitalized(String target) { @@ -31,7 +30,7 @@ public class StringUtils { public static String getPrettyAbilityString(SuperAbilityType ability) { return createPrettyString(ability.toString()); } - + public static String getWildcardConfigBlockDataString(BlockData data) { return getWildcardConfigMaterialString(data.getMaterial()); } @@ -41,7 +40,7 @@ public class StringUtils { } public static String getFriendlyConfigBlockDataString(BlockData data) { - switch(data.getMaterial()){ + switch (data.getMaterial()) { case Material.CHORUS_FLOWER: case Material.COCOA: case Material.WHEAT: @@ -98,8 +97,7 @@ public class StringUtils { /** * Determine if a string represents an Integer * - * @param string - * String to check + * @param string String to check * @return true if the string is an Integer, false otherwise */ public static boolean isInt(String string) { @@ -114,8 +112,7 @@ public class StringUtils { /** * Determine if a string represents a Double * - * @param string - * String to check + * @param string String to check * @return true if the string is a Double, false otherwise */ public static boolean isDouble(String string) { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java b/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java index c27f78ee0..5c504dc8b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java @@ -5,15 +5,14 @@ import com.gmail.nossr50.core.config.skills.RankConfig; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.json.McMMOUrl; import com.gmail.nossr50.core.datatypes.json.McMMOWebLinks; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.core.util.skills.RankUtils; import com.gmail.nossr50.listeners.InteractionManager; -import com.gmail.nossr50.core.locale.LocaleLoader; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.ChatMessageType; -import net.md_5.bungee.api.chat.*; import org.bukkit.entity.Player; import java.util.ArrayList; @@ -26,38 +25,34 @@ public class TextComponentFactory { /** * Makes a text component using strings from a locale and supports passing an undefined number of variables to the LocaleLoader - * @param localeKey target locale string address + * + * @param localeKey target locale string address * @param notificationType type of notification - * @param values vars to be passed to the locale loader + * @param values vars to be passed to the locale loader * @return */ - public static TextComponent getNotificationMultipleValues(String localeKey, NotificationType notificationType, String... values) - { + public static TextComponent getNotificationMultipleValues(String localeKey, NotificationType notificationType, String... values) { String preColoredString = LocaleLoader.getString(localeKey, (Object[]) values); TextComponent msg = new TextComponent(preColoredString); return new TextComponent(msg); } - public static TextComponent getNotificationTextComponentFromLocale(String localeKey, NotificationType notificationType) - { + public static TextComponent getNotificationTextComponentFromLocale(String localeKey, NotificationType notificationType) { return getNotificationTextComponent(LocaleLoader.getString(localeKey)); } - public static TextComponent getNotificationLevelUpTextComponent(PrimarySkillType skill, int levelsGained, int currentLevel) - { - TextComponent textComponent = new TextComponent(LocaleLoader.getString("Overhaul.Levelup", LocaleLoader.getString("Overhaul.Name."+StringUtils.getCapitalized(skill.toString())), levelsGained, currentLevel)); + public static TextComponent getNotificationLevelUpTextComponent(PrimarySkillType skill, int levelsGained, int currentLevel) { + TextComponent textComponent = new TextComponent(LocaleLoader.getString("Overhaul.Levelup", LocaleLoader.getString("Overhaul.Name." + StringUtils.getCapitalized(skill.toString())), levelsGained, currentLevel)); return textComponent; } - private static TextComponent getNotificationTextComponent(String text) - { + private static TextComponent getNotificationTextComponent(String text) { //textComponent.setColor(getNotificationColor(notificationType)); return new TextComponent(text); } - public static void sendPlayerSubSkillWikiLink(Player player, String subskillformatted) - { - if(!Config.getInstance().getUrlLinksEnabled()) + public static void sendPlayerSubSkillWikiLink(Player player, String subskillformatted) { + if (!Config.getInstance().getUrlLinksEnabled()) return; Player.Spigot spigotPlayer = player.spigot(); @@ -65,7 +60,7 @@ public class TextComponentFactory { TextComponent wikiLinkComponent = new TextComponent(LocaleLoader.getString("Overhaul.mcMMO.MmoInfo.Wiki")); wikiLinkComponent.setUnderlined(true); - String wikiUrl = "https://mcmmo.org/wiki/"+subskillformatted; + String wikiUrl = "https://mcmmo.org/wiki/" + subskillformatted; wikiLinkComponent.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, wikiUrl)); @@ -81,7 +76,7 @@ public class TextComponentFactory { TextComponent prefix = new TextComponent(LocaleLoader.getString("Overhaul.mcMMO.Url.Wrap.Prefix") + " "); /*prefix.setColor(ChatColor.DARK_AQUA);*/ - TextComponent suffix = new TextComponent(" "+LocaleLoader.getString("Overhaul.mcMMO.Url.Wrap.Suffix")); + TextComponent suffix = new TextComponent(" " + LocaleLoader.getString("Overhaul.mcMMO.Url.Wrap.Suffix")); /*suffix.setColor(ChatColor.DARK_AQUA);*/ TextComponent emptySpace = new TextComponent(" "); @@ -103,8 +98,7 @@ public class TextComponentFactory { spigotPlayer.sendMessage(baseComponents); } - public static void sendPlayerSubSkillList(Player player, List textComponents) - { + public static void sendPlayerSubSkillList(Player player, List textComponents) { TextComponent emptySpace = new TextComponent(" "); ArrayList bulkMessage = new ArrayList<>(); @@ -112,8 +106,7 @@ public class TextComponentFactory { for (TextComponent textComponent : textComponents) { //Don't send more than 3 subskills per line to avoid MOST wordwrap problems - if(newLineCount > 2) - { + if (newLineCount > 2) { TextComponent[] bulkArray = new TextComponent[bulkMessage.size()]; bulkArray = bulkMessage.toArray(bulkArray); @@ -127,10 +120,10 @@ public class TextComponentFactory { TextComponent stylizedText = new TextComponent(LocaleLoader.getString("JSON.Hover.AtSymbolSkills")); addChild(stylizedText, originalTxt); - if(textComponent.getHoverEvent() != null) + if (textComponent.getHoverEvent() != null) stylizedText.setHoverEvent(textComponent.getHoverEvent()); - if(textComponent.getClickEvent() != null) + if (textComponent.getClickEvent() != null) stylizedText.setClickEvent(textComponent.getClickEvent()); bulkMessage.add(stylizedText); @@ -148,12 +141,10 @@ public class TextComponentFactory { player.spigot().sendMessage(bulkArray); } - private static TextComponent getWebLinkTextComponent(McMMOWebLinks webLinks) - { + private static TextComponent getWebLinkTextComponent(McMMOWebLinks webLinks) { TextComponent webTextComponent; - switch(webLinks) - { + switch (webLinks) { case WEBSITE: webTextComponent = new TextComponent(LocaleLoader.getString("JSON.Hover.AtSymbolURL")); addChild(webTextComponent, "Web"); @@ -200,12 +191,10 @@ public class TextComponentFactory { webTextComponent.addExtra(childComponent); } - private static BaseComponent[] getUrlHoverEvent(McMMOWebLinks webLinks) - { + private static BaseComponent[] getUrlHoverEvent(McMMOWebLinks webLinks) { ComponentBuilder componentBuilder = new ComponentBuilder(webLinks.getNiceTitle()); - switch(webLinks) - { + switch (webLinks) { case WEBSITE: addUrlHeaderHover(webLinks, componentBuilder); componentBuilder.append("\n\n").italic(false); @@ -254,13 +243,11 @@ public class TextComponentFactory { componentBuilder.append(webLinks.getUrl()).color(ChatColor.GRAY).italic(true); } - private static ClickEvent getUrlClickEvent(String url) - { + private static ClickEvent getUrlClickEvent(String url) { return new ClickEvent(ClickEvent.Action.OPEN_URL, url); } - private static TextComponent getSubSkillTextComponent(Player player, SubSkillType subSkillType) - { + private static TextComponent getSubSkillTextComponent(Player player, SubSkillType subSkillType) { //Get skill name String skillName = subSkillType.getLocaleName(); @@ -281,8 +268,7 @@ public class TextComponentFactory { textComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, baseComponent)); } - private static TextComponent getSubSkillTextComponent(Player player, AbstractSubSkill abstractSubSkill) - { + private static TextComponent getSubSkillTextComponent(Player player, AbstractSubSkill abstractSubSkill) { //String key = abstractSubSkill.getConfigKeyName(); String skillName = abstractSubSkill.getNiceName(); @@ -321,47 +307,44 @@ public class TextComponentFactory { return textComponent; } - private static BaseComponent[] getSubSkillHoverComponent(Player player, AbstractSubSkill abstractSubSkill) - { + private static BaseComponent[] getSubSkillHoverComponent(Player player, AbstractSubSkill abstractSubSkill) { return getSubSkillHoverEventJSON(abstractSubSkill, player); } - private static BaseComponent[] getSubSkillHoverComponent(Player player, SubSkillType subSkillType) - { + private static BaseComponent[] getSubSkillHoverComponent(Player player, SubSkillType subSkillType) { return getSubSkillHoverEventJSON(subSkillType, player); } /** * Used for the skill in the new skill system (Deriving from AbstractSubSkill) + * * @param abstractSubSkill this subskill - * @param player the player who owns this subskill + * @param player the player who owns this subskill * @return the hover basecomponent object for this subskill */ - private static BaseComponent[] getSubSkillHoverEventJSON(AbstractSubSkill abstractSubSkill, Player player) - { + private static BaseComponent[] getSubSkillHoverEventJSON(AbstractSubSkill abstractSubSkill, Player player) { String skillName = abstractSubSkill.getNiceName(); /* * Hover Event BaseComponent color table */ - ChatColor ccSubSkillHeader = ChatColor.GOLD; - ChatColor ccRank = ChatColor.BLUE; - ChatColor ccCurRank = ChatColor.GREEN; - ChatColor ccPossessive = ChatColor.WHITE; - ChatColor ccNumRanks = ccCurRank; + ChatColor ccSubSkillHeader = ChatColor.GOLD; + ChatColor ccRank = ChatColor.BLUE; + ChatColor ccCurRank = ChatColor.GREEN; + ChatColor ccPossessive = ChatColor.WHITE; + ChatColor ccNumRanks = ccCurRank; //ChatColor ccDescriptionHeader = ChatColor.DARK_PURPLE; //ChatColor ccDescription = ChatColor.WHITE; - ChatColor ccLocked = ChatColor.DARK_GRAY; - ChatColor ccLevelRequirement = ChatColor.BLUE; - ChatColor ccLevelRequired = ChatColor.RED; + ChatColor ccLocked = ChatColor.DARK_GRAY; + ChatColor ccLevelRequirement = ChatColor.BLUE; + ChatColor ccLevelRequired = ChatColor.RED; SubSkillType subSkillType = abstractSubSkill.getSubSkillType(); //SubSkillType Name ComponentBuilder componentBuilder = setupSkillComponentNameStyle(player, skillName, subSkillType, RankUtils.hasUnlockedSubskill(player, abstractSubSkill)); - if(!RankUtils.hasUnlockedSubskill(player, abstractSubSkill)) - { + if (!RankUtils.hasUnlockedSubskill(player, abstractSubSkill)) { //Skill is not unlocked yet addLocked(abstractSubSkill, ccLocked, ccLevelRequirement, ccLevelRequired, componentBuilder); } else { @@ -371,9 +354,8 @@ public class TextComponentFactory { int curRank = RankUtils.getRank(player, abstractSubSkill); int nextRank = 0; - if(curRank < abstractSubSkill.getNumRanks() && abstractSubSkill.getNumRanks() > 0) - { - nextRank = RankUtils.getRankUnlockLevel(abstractSubSkill, curRank+1); + if (curRank < abstractSubSkill.getNumRanks() && abstractSubSkill.getNumRanks() > 0) { + nextRank = RankUtils.getRankUnlockLevel(abstractSubSkill, curRank + 1); } addRanked(ccRank, ccCurRank, ccPossessive, ccNumRanks, componentBuilder, abstractSubSkill.getNumRanks(), RankUtils.getRank(player, abstractSubSkill), nextRank); @@ -418,7 +400,7 @@ public class TextComponentFactory { .bold(false).italic(false).strikethrough(false).underlined(false); //Next Rank: x - if(nextRank > rank) + if (nextRank > rank) componentBuilder.append(LocaleLoader.getString("JSON.Hover.NextRank", String.valueOf(nextRank))).append("\n") .bold(false).italic(false).strikethrough(false).underlined(false); @@ -446,43 +428,39 @@ public class TextComponentFactory { } @Deprecated - private static BaseComponent[] getSubSkillHoverEventJSON(SubSkillType subSkillType, Player player) - { + private static BaseComponent[] getSubSkillHoverEventJSON(SubSkillType subSkillType, Player player) { String skillName = subSkillType.getLocaleName(); /* * Hover Event BaseComponent color table */ - ChatColor ccSubSkillHeader = ChatColor.GOLD; - ChatColor ccRank = ChatColor.BLUE; - ChatColor ccCurRank = ChatColor.GREEN; - ChatColor ccPossessive = ChatColor.WHITE; - ChatColor ccNumRanks = ccCurRank; - ChatColor ccDescriptionHeader = ChatColor.DARK_PURPLE; - ChatColor ccDescription = ChatColor.DARK_GRAY; - ChatColor ccLocked = ChatColor.DARK_GRAY; - ChatColor ccLevelRequirement = ChatColor.BLUE; - ChatColor ccLevelRequired = ChatColor.RED; + ChatColor ccSubSkillHeader = ChatColor.GOLD; + ChatColor ccRank = ChatColor.BLUE; + ChatColor ccCurRank = ChatColor.GREEN; + ChatColor ccPossessive = ChatColor.WHITE; + ChatColor ccNumRanks = ccCurRank; + ChatColor ccDescriptionHeader = ChatColor.DARK_PURPLE; + ChatColor ccDescription = ChatColor.DARK_GRAY; + ChatColor ccLocked = ChatColor.DARK_GRAY; + ChatColor ccLevelRequirement = ChatColor.BLUE; + ChatColor ccLevelRequired = ChatColor.RED; //SubSkillType Name ComponentBuilder componentBuilder = setupSkillComponentNameStyle(player, skillName, subSkillType, RankUtils.hasUnlockedSubskill(player, subSkillType)); - if(!RankUtils.hasUnlockedSubskill(player, subSkillType)) - { + if (!RankUtils.hasUnlockedSubskill(player, subSkillType)) { //Skill is not unlocked yet addLocked(subSkillType, ccLocked, ccLevelRequirement, ccLevelRequired, componentBuilder); } else { //addSubSkillTypeToHoverEventJSON(subSkillType, componentBuilder); //RANK - if(subSkillType.getNumRanks() > 0) - { + if (subSkillType.getNumRanks() > 0) { int curRank = RankUtils.getRank(player, subSkillType); int nextRank = 0; - if(curRank < subSkillType.getNumRanks() && subSkillType.getNumRanks() > 0) - { - nextRank = RankUtils.getRankUnlockLevel(subSkillType, curRank+1); + if (curRank < subSkillType.getNumRanks() && subSkillType.getNumRanks() > 0) { + nextRank = RankUtils.getRankUnlockLevel(subSkillType, curRank + 1); } addRanked(ccRank, ccCurRank, ccPossessive, ccNumRanks, componentBuilder, subSkillType.getNumRanks(), RankUtils.getRank(player, subSkillType), nextRank); @@ -500,14 +478,11 @@ public class TextComponentFactory { return componentBuilder.create(); } - private static void addSubSkillTypeToHoverEventJSON(AbstractSubSkill abstractSubSkill, ComponentBuilder componentBuilder) - { - if(abstractSubSkill.isSuperAbility()) - { + private static void addSubSkillTypeToHoverEventJSON(AbstractSubSkill abstractSubSkill, ComponentBuilder componentBuilder) { + if (abstractSubSkill.isSuperAbility()) { componentBuilder.append(LocaleLoader.getString("JSON.Type.SuperAbility")).color(ChatColor.LIGHT_PURPLE); componentBuilder.bold(true); - } else if(abstractSubSkill.isActiveUse()) - { + } else if (abstractSubSkill.isActiveUse()) { componentBuilder.append(LocaleLoader.getString("JSON.Type.Active")).color(ChatColor.DARK_RED); componentBuilder.bold(true); } else { @@ -519,35 +494,29 @@ public class TextComponentFactory { } public static void getSubSkillTextComponents(Player player, List textComponents, PrimarySkillType parentSkill) { - for(SubSkillType subSkillType : SubSkillType.values()) - { - if(subSkillType.getParentSkill() == parentSkill) - { - if(Permissions.isSubSkillEnabled(player, subSkillType)) - { - if(!InteractionManager.hasSubSkill(subSkillType)) + for (SubSkillType subSkillType : SubSkillType.values()) { + if (subSkillType.getParentSkill() == parentSkill) { + if (Permissions.isSubSkillEnabled(player, subSkillType)) { + if (!InteractionManager.hasSubSkill(subSkillType)) textComponents.add(TextComponentFactory.getSubSkillTextComponent(player, subSkillType)); } } } /* NEW SKILL SYSTEM */ - for(AbstractSubSkill abstractSubSkill : InteractionManager.getSubSkillList()) - { - if(abstractSubSkill.getPrimarySkill() == parentSkill) - { - if(Permissions.isSubSkillEnabled(player, abstractSubSkill)) + for (AbstractSubSkill abstractSubSkill : InteractionManager.getSubSkillList()) { + if (abstractSubSkill.getPrimarySkill() == parentSkill) { + if (Permissions.isSubSkillEnabled(player, abstractSubSkill)) textComponents.add(TextComponentFactory.getSubSkillTextComponent(player, abstractSubSkill)); } } } - public static TextComponent getSubSkillUnlockedNotificationComponents(Player player, SubSkillType subSkillType) - { + public static TextComponent getSubSkillUnlockedNotificationComponents(Player player, SubSkillType subSkillType) { TextComponent unlockMessage = new TextComponent(""); unlockMessage.setText(LocaleLoader.getString("JSON.SkillUnlockMessage", subSkillType.getLocaleName(), RankUtils.getRank(player, subSkillType))); unlockMessage.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, getSubSkillHoverComponent(player, subSkillType))); - unlockMessage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/"+subSkillType.getParentSkill().toString().toLowerCase())); + unlockMessage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + subSkillType.getParentSkill().toString().toLowerCase())); return unlockMessage; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/adapter/BiomeAdapter.java b/core/src/main/java/com/gmail/nossr50/core/util/adapter/BiomeAdapter.java index 6070e7e42..f36fb1a69 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/adapter/BiomeAdapter.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/adapter/BiomeAdapter.java @@ -7,7 +7,7 @@ import java.util.*; public class BiomeAdapter { public static final Set WATER_BIOMES; public static final Set ICE_BIOMES; - + static { List allBiomes = Arrays.asList(Biome.values()); List waterBiomes = new ArrayList(); @@ -26,6 +26,7 @@ public class BiomeAdapter { private static boolean isWater(String name) { return name.contains("RIVER") || name.contains("OCEAN"); } + private static boolean isCold(String name) { return (name.contains("COLD") || name.contains("ICE") || name.contains("FROZEN") || name.contains("TAIGA")) && !(name.contains("WARM")); } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java index dc5401584..53cf6cb45 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.core.util.commands; -import com.gmail.nossr50.commands.*; import com.gmail.nossr50.commands.chat.AdminChatCommand; import com.gmail.nossr50.commands.chat.McChatSpy; import com.gmail.nossr50.commands.chat.PartyChatCommand; @@ -15,23 +14,24 @@ import com.gmail.nossr50.commands.hardcore.HardcoreCommand; import com.gmail.nossr50.commands.hardcore.VampirismCommand; import com.gmail.nossr50.commands.party.PartyCommand; import com.gmail.nossr50.commands.party.teleport.PtpCommand; -import com.gmail.nossr50.commands.player.*; -import com.gmail.nossr50.commands.skills.*; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.StringUtils; +import com.gmail.nossr50.mcMMO; import org.bukkit.command.PluginCommand; import java.util.ArrayList; import java.util.List; public final class CommandRegistrationManager { - private CommandRegistrationManager() {}; - private static String permissionsMessage = LocaleLoader.getString("mcMMO.NoPermission"); + ; + + private CommandRegistrationManager() { + } + private static void registerSkillCommands() { for (PrimarySkillType skill : PrimarySkillType.values()) { String commandName = skill.toString().toLowerCase(); @@ -326,9 +326,9 @@ public final class CommandRegistrationManager { PluginCommand command = mcMMO.p.getCommand("party"); command.setDescription(LocaleLoader.getString("Commands.Description.party")); command.setPermission("mcmmo.commands.party;mcmmo.commands.party.accept;mcmmo.commands.party.create;mcmmo.commands.party.disband;" + - "mcmmo.commands.party.xpshare;mcmmo.commands.party.invite;mcmmo.commands.party.itemshare;mcmmo.commands.party.join;" + - "mcmmo.commands.party.kick;mcmmo.commands.party.lock;mcmmo.commands.party.owner;mcmmo.commands.party.password;" + - "mcmmo.commands.party.quit;mcmmo.commands.party.rename;mcmmo.commands.party.unlock"); + "mcmmo.commands.party.xpshare;mcmmo.commands.party.invite;mcmmo.commands.party.itemshare;mcmmo.commands.party.join;" + + "mcmmo.commands.party.kick;mcmmo.commands.party.lock;mcmmo.commands.party.owner;mcmmo.commands.party.password;" + + "mcmmo.commands.party.quit;mcmmo.commands.party.rename;mcmmo.commands.party.unlock"); command.setPermissionMessage(permissionsMessage); command.setExecutor(new PartyCommand()); } @@ -371,7 +371,7 @@ public final class CommandRegistrationManager { command.setUsage(LocaleLoader.getString("Commands.Usage.0", "mcnotify")); command.setExecutor(new McnotifyCommand()); } - + private static void registerMHDCommand() { PluginCommand command = mcMMO.p.getCommand("mhd"); command.setDescription("Resets all mob health bar settings for all players to the default"); //TODO: Localize diff --git a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java index 7b923a893..e80487891 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.core.util.commands; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Misc; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.util.StringUtils; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.SkillUtils; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.OfflinePlayer; import org.bukkit.command.CommandSender; @@ -22,7 +22,8 @@ public final class CommandUtils { public static final List TRUE_FALSE_OPTIONS = ImmutableList.of("on", "off", "true", "false", "enabled", "disabled"); public static final List RESET_OPTIONS = ImmutableList.of("clear", "reset"); - private CommandUtils() {} + private CommandUtils() { + } public static boolean isChildSkill(CommandSender sender, PrimarySkillType skill) { if (skill == null || !skill.isChildSkill()) { @@ -80,10 +81,9 @@ public final class CommandUtils { /** * Checks if there is a valid mcMMOPlayer object. * - * @param sender CommandSender who used the command - * @param playerName name of the target player + * @param sender CommandSender who used the command + * @param playerName name of the target player * @param mcMMOPlayer mcMMOPlayer object of the target player - * * @return true if the player is online and a valid mcMMOPlayer object was found */ public static boolean checkPlayerExistence(CommandSender sender, String playerName, McMMOPlayer mcMMOPlayer) { @@ -258,7 +258,6 @@ public final class CommandUtils { * Get a matched player name if one was found in the database. * * @param partialName Name to match - * * @return Matched name or {@code partialName} if no match was found */ public static String getMatchedPlayerName(String partialName) { @@ -268,8 +267,7 @@ public final class CommandUtils { if (matches.size() == 1) { partialName = matches.get(0); } - } - else { + } else { Player player = mcMMO.p.getServer().getPlayer(partialName); if (player != null) { @@ -282,7 +280,7 @@ public final class CommandUtils { /** * Attempts to match any player names with the given name, and returns a list of all possibly matches. - * + *

* This list is not sorted in any particular order. * If an exact match is found, the returned list will only contain a single result. * @@ -294,10 +292,10 @@ public final class CommandUtils { for (OfflinePlayer offlinePlayer : mcMMO.p.getServer().getOfflinePlayers()) { String playerName = offlinePlayer.getName(); - + if (playerName == null) { //Do null checking here to detect corrupted data before sending it throuogh .equals - System.err.println("[McMMO] Player data file with UIID " + offlinePlayer.getUniqueId() + " is missing a player name. This may be a legacy file from before bukkit.lastKnownName. This should be okay to ignore."); - continue; //Don't let an error here interrupt the loop + System.err.println("[McMMO] Player data file with UIID " + offlinePlayer.getUniqueId() + " is missing a player name. This may be a legacy file from before bukkit.lastKnownName. This should be okay to ignore."); + continue; //Don't let an error here interrupt the loop } if (partialName.equalsIgnoreCase(playerName)) { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarManager.java b/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarManager.java index 86744195d..85cf33a46 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarManager.java @@ -2,8 +2,8 @@ package com.gmail.nossr50.core.util.experience; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.runnables.skills.ExperienceBarHideTask; +import com.gmail.nossr50.core.skills.PrimarySkillType; import org.bukkit.plugin.Plugin; import java.util.HashMap; @@ -13,13 +13,11 @@ import java.util.HashMap; * Each ExperienceBarManager only manages a single player */ public class ExperienceBarManager { - private McMMOPlayer mcMMOPlayer; - HashMap experienceBars; HashMap experienceBarHideTaskHashMap; + private McMMOPlayer mcMMOPlayer; - public ExperienceBarManager(McMMOPlayer mcMMOPlayer) - { + public ExperienceBarManager(McMMOPlayer mcMMOPlayer) { //Init map experienceBars = new HashMap<>(); experienceBarHideTaskHashMap = new HashMap<>(); @@ -27,13 +25,12 @@ public class ExperienceBarManager { this.mcMMOPlayer = mcMMOPlayer; } - public void updateExperienceBar(PrimarySkillType primarySkillType, Plugin plugin) - { - if(!ExperienceConfig.getInstance().isExperienceBarsEnabled() || !ExperienceConfig.getInstance().isExperienceBarEnabled(primarySkillType)) + public void updateExperienceBar(PrimarySkillType primarySkillType, Plugin plugin) { + if (!ExperienceConfig.getInstance().isExperienceBarsEnabled() || !ExperienceConfig.getInstance().isExperienceBarEnabled(primarySkillType)) return; //Init Bar - if(experienceBars.get(primarySkillType) == null) + if (experienceBars.get(primarySkillType) == null) experienceBars.put(primarySkillType, new ExperienceBarWrapper(primarySkillType, mcMMOPlayer)); //Get Bar @@ -46,8 +43,7 @@ public class ExperienceBarManager { experienceBarWrapper.showExperienceBar(); //Setup Hide Bar Task - if(experienceBarHideTaskHashMap.get(primarySkillType) != null) - { + if (experienceBarHideTaskHashMap.get(primarySkillType) != null) { experienceBarHideTaskHashMap.get(primarySkillType).cancel(); scheduleHideTask(primarySkillType, plugin); } else { @@ -57,17 +53,15 @@ public class ExperienceBarManager { private void scheduleHideTask(PrimarySkillType primarySkillType, Plugin plugin) { ExperienceBarHideTask experienceBarHideTask = new ExperienceBarHideTask(this, mcMMOPlayer, primarySkillType); - experienceBarHideTask.runTaskLater(plugin, 20*2); + experienceBarHideTask.runTaskLater(plugin, 20 * 2); experienceBarHideTaskHashMap.put(primarySkillType, experienceBarHideTask); } - public void hideExperienceBar(PrimarySkillType primarySkillType) - { + public void hideExperienceBar(PrimarySkillType primarySkillType) { experienceBars.get(primarySkillType).hideExperienceBar(); } - public void clearTask(PrimarySkillType primarySkillType) - { + public void clearTask(PrimarySkillType primarySkillType) { experienceBarHideTaskHashMap.remove(primarySkillType); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarWrapper.java b/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarWrapper.java index 24ae7d5d0..f3acec350 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarWrapper.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarWrapper.java @@ -2,8 +2,8 @@ package com.gmail.nossr50.core.util.experience; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.StringUtils; import org.bukkit.Server; import org.bukkit.boss.BarColor; @@ -18,20 +18,18 @@ import java.util.List; */ public class ExperienceBarWrapper { - private final PrimarySkillType primarySkillType; //Primary Skill - private BossBar bossBar; - private final Server server; protected final McMMOPlayer mcMMOPlayer; - private int lastLevelUpdated; - + private final PrimarySkillType primarySkillType; //Primary Skill + private final Server server; /* * This is stored to help optimize updating the title */ protected String niceSkillName; protected String title; + private BossBar bossBar; + private int lastLevelUpdated; - public ExperienceBarWrapper(PrimarySkillType primarySkillType, McMMOPlayer mcMMOPlayer) - { + public ExperienceBarWrapper(PrimarySkillType primarySkillType, McMMOPlayer mcMMOPlayer) { this.mcMMOPlayer = mcMMOPlayer; this.server = mcMMOPlayer.getPlayer().getServer(); //Might not be good for bungee to do this this.primarySkillType = primarySkillType; @@ -45,8 +43,7 @@ public class ExperienceBarWrapper { initBar(); } - private void initBar() - { + private void initBar() { title = getTitleTemplate(); createBossBar(); } @@ -58,19 +55,31 @@ public class ExperienceBarWrapper { private String getTitleTemplate() { //If they are using extra details - if(ExperienceConfig.getInstance().getAddExtraDetails()) - return LocaleLoader.getString("XPBar.Complex.Template", LocaleLoader.getString("XPBar."+niceSkillName, getLevel()), getCurrentXP(), getMaxXP(), getPowerLevel(), getPercentageOfLevel()); + if (ExperienceConfig.getInstance().getAddExtraDetails()) + return LocaleLoader.getString("XPBar.Complex.Template", LocaleLoader.getString("XPBar." + niceSkillName, getLevel()), getCurrentXP(), getMaxXP(), getPowerLevel(), getPercentageOfLevel()); - return LocaleLoader.getString("XPBar."+niceSkillName, getLevel(), getCurrentXP(), getMaxXP(), getPowerLevel(), getPercentageOfLevel()); + return LocaleLoader.getString("XPBar." + niceSkillName, getLevel(), getCurrentXP(), getMaxXP(), getPowerLevel(), getPercentageOfLevel()); } private int getLevel() { return mcMMOPlayer.getSkillLevel(primarySkillType); } - private int getCurrentXP() { return mcMMOPlayer.getSkillXpLevel(primarySkillType); } - private int getMaxXP() { return mcMMOPlayer.getXpToLevel(primarySkillType); } - private int getPowerLevel() { return mcMMOPlayer.getPowerLevel(); } - private int getPercentageOfLevel() { return (int) (mcMMOPlayer.getProgressInCurrentSkillLevel(primarySkillType) * 100); } + + private int getCurrentXP() { + return mcMMOPlayer.getSkillXpLevel(primarySkillType); + } + + private int getMaxXP() { + return mcMMOPlayer.getXpToLevel(primarySkillType); + } + + private int getPowerLevel() { + return mcMMOPlayer.getPowerLevel(); + } + + private int getPercentageOfLevel() { + return (int) (mcMMOPlayer.getProgressInCurrentSkillLevel(primarySkillType) * 100); + } public String getTitle() { return bossBar.getTitle(); @@ -96,28 +105,27 @@ public class ExperienceBarWrapper { bossBar.setStyle(barStyle); } + public double getProgress() { + return bossBar.getProgress(); + } + public void setProgress(double v) { //Clamp Values - if(v < 0) + if (v < 0) bossBar.setProgress(0.0D); - else if(v > 1) + else if (v > 1) bossBar.setProgress(1.0D); else bossBar.setProgress(v); //Every time progress updates we need to check for a title update - if(getLevel() != lastLevelUpdated || ExperienceConfig.getInstance().getDoExperienceBarsAlwaysUpdateTitle()) - { + if (getLevel() != lastLevelUpdated || ExperienceConfig.getInstance().getDoExperienceBarsAlwaysUpdateTitle()) { updateTitle(); lastLevelUpdated = getLevel(); } } - public double getProgress() { - return bossBar.getProgress(); - } - public List getPlayers() { return bossBar.getPlayers(); } @@ -126,13 +134,11 @@ public class ExperienceBarWrapper { return bossBar.isVisible(); } - public void hideExperienceBar() - { + public void hideExperienceBar() { bossBar.setVisible(false); } - public void showExperienceBar() - { + public void showExperienceBar() { bossBar.setVisible(true); } @@ -141,8 +147,7 @@ public class ExperienceBarWrapper { return bossBar }*/ - private void createBossBar() - { + private void createBossBar() { bossBar = mcMMOPlayer.getPlayer().getServer().createBossBar(title, ExperienceConfig.getInstance().getExperienceBarColor(primarySkillType), ExperienceConfig.getInstance().getExperienceBarStyle(primarySkillType)); bossBar.addPlayer(mcMMOPlayer.getPlayer()); } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java b/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java index 7e9f0c099..93ddec6d2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.util.experience; -import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; @@ -52,7 +52,7 @@ public class FormulaManager { * the amount of levels and experience, using the previously * used formula type. * - * @param skillLevel Amount of levels + * @param skillLevel Amount of levels * @param skillXPLevel Amount of experience * @return The total amount of experience */ @@ -73,8 +73,8 @@ public class FormulaManager { * the new formula type. * * @param primarySkillType skill where new levels and experience are calculated for - * @param experience total amount of experience - * @param formulaType The new {@link FormulaType} + * @param experience total amount of experience + * @param formulaType The new {@link FormulaType} * @return the amount of levels and experience */ public int[] calculateNewLevel(PrimarySkillType primarySkillType, int experience, FormulaType formulaType) { @@ -94,7 +94,7 @@ public class FormulaManager { experience -= experienceToNextLevel; } - return new int[]{ newLevel, remainder }; + return new int[]{newLevel, remainder}; } /** @@ -102,7 +102,7 @@ public class FormulaManager { * if cache doesn't contain the given value it is calculated and added * to the cached data. * - * @param level level to check + * @param level level to check * @param formulaType The {@link FormulaType} used * @return amount of experience needed to reach next level */ @@ -126,7 +126,7 @@ public class FormulaManager { switch (formulaType) { case LINEAR: if (!experienceNeededLinear.containsKey(level)) { - experience = (int) Math.floor( xpNeededMultiplier * (base + level * multiplier)); + experience = (int) Math.floor(xpNeededMultiplier * (base + level * multiplier)); experienceNeededLinear.put(level, experience); } @@ -134,7 +134,7 @@ public class FormulaManager { case EXPONENTIAL: if (!experienceNeededExponential.containsKey(level)) { - experience = (int) Math.floor( xpNeededMultiplier * (multiplier * Math.pow(level, exponent) + base)); + experience = (int) Math.floor(xpNeededMultiplier * (multiplier * Math.pow(level, exponent) + base)); experienceNeededExponential.put(level, experience); } @@ -167,8 +167,7 @@ public class FormulaManager { try { formulasFile.save(formulaFile); - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/player/NotificationManager.java b/core/src/main/java/com/gmail/nossr50/core/util/player/NotificationManager.java index 539e42805..21ba5142c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/player/NotificationManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/player/NotificationManager.java @@ -6,10 +6,10 @@ import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.util.sounds.SoundManager; import com.gmail.nossr50.core.util.sounds.SoundType; import com.gmail.nossr50.events.skills.McMMOPlayerNotificationEvent; -import com.gmail.nossr50.core.util.TextComponentFactory; import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.Bukkit; @@ -22,12 +22,12 @@ public class NotificationManager { /** * Sends players notifications from mcMMO * This does this by sending out an event so other plugins can cancel it - * @param player target player + * + * @param player target player * @param notificationType notifications defined type - * @param key the locale key for the notifications defined message + * @param key the locale key for the notifications defined message */ - public static void sendPlayerInformation(Player player, NotificationType notificationType, String key) - { + public static void sendPlayerInformation(Player player, NotificationType notificationType, String key) { ChatMessageType destination = AdvancedConfig.getInstance().doesNotificationUseActionBar(notificationType) ? ChatMessageType.ACTION_BAR : ChatMessageType.SYSTEM; TextComponent message = TextComponentFactory.getNotificationTextComponentFromLocale(key, notificationType); @@ -40,13 +40,13 @@ public class NotificationManager { * Sends players notifications from mcMMO * This does this by sending out an event so other plugins can cancel it * This event in particular is provided with a source player, and players near the source player are sent the information - * @param source the source player for this event + * + * @param source the source player for this event * @param notificationType type of notification - * @param key Locale Key for the string to use with this event - * @param values values to be injected into the locale string + * @param key Locale Key for the string to use with this event + * @param values values to be injected into the locale string */ - public static void sendNearbyPlayersInformation(Player source, NotificationType notificationType, String key, String... values) - { + public static void sendNearbyPlayersInformation(Player source, NotificationType notificationType, String key, String... values) { Location location = source.getLocation(); for (Player otherPlayer : source.getWorld().getPlayers()) { if (otherPlayer != source && Misc.isNear(location, otherPlayer.getLocation(), Misc.SKILL_MESSAGE_MAX_SENDING_DISTANCE)) { @@ -55,8 +55,7 @@ public class NotificationManager { } } - public static void sendPlayerInformation(Player player, NotificationType notificationType, String key, String... values) - { + public static void sendPlayerInformation(Player player, NotificationType notificationType, String key, String... values) { ChatMessageType destination = AdvancedConfig.getInstance().doesNotificationUseActionBar(notificationType) ? ChatMessageType.ACTION_BAR : ChatMessageType.SYSTEM; @@ -71,12 +70,10 @@ public class NotificationManager { return; //If the message is being sent to the action bar we need to check if the copy if a copy is sent to the chat system - if(customEvent.getChatMessageType() == ChatMessageType.ACTION_BAR) - { + if (customEvent.getChatMessageType() == ChatMessageType.ACTION_BAR) { player.spigot().sendMessage(customEvent.getChatMessageType(), customEvent.getNotificationTextComponent()); - if(customEvent.isMessageAlsoBeingSentToChat()) - { + if (customEvent.isMessageAlsoBeingSentToChat()) { //Send copy to chat system player.spigot().sendMessage(ChatMessageType.SYSTEM, customEvent.getNotificationTextComponent()); } @@ -97,12 +94,12 @@ public class NotificationManager { /** * Handles sending level up notifications to a mcMMOPlayer + * * @param mcMMOPlayer target mcMMOPlayer - * @param skillName skill that leveled up - * @param newLevel new level of that skill + * @param skillName skill that leveled up + * @param newLevel new level of that skill */ - public static void sendPlayerLevelUpNotification(McMMOPlayer mcMMOPlayer, PrimarySkillType skillName, int levelsGained, int newLevel) - { + public static void sendPlayerLevelUpNotification(McMMOPlayer mcMMOPlayer, PrimarySkillType skillName, int levelsGained, int newLevel) { ChatMessageType destination = AdvancedConfig.getInstance().doesNotificationUseActionBar(NotificationType.LEVEL_UP_MESSAGE) ? ChatMessageType.ACTION_BAR : ChatMessageType.SYSTEM; TextComponent levelUpTextComponent = TextComponentFactory.getNotificationLevelUpTextComponent(skillName, levelsGained, newLevel); @@ -111,16 +108,13 @@ public class NotificationManager { sendNotification(mcMMOPlayer.getPlayer(), customEvent); } - public static void broadcastTitle(Server server, String title, String subtitle, int i1, int i2, int i3) - { - for(Player player : server.getOnlinePlayers()) - { + public static void broadcastTitle(Server server, String title, String subtitle, int i1, int i2, int i3) { + for (Player player : server.getOnlinePlayers()) { player.sendTitle(title, subtitle, i1, i2, i3); } } - public static void sendPlayerUnlockNotification(McMMOPlayer mcMMOPlayer, SubSkillType subSkillType) - { + public static void sendPlayerUnlockNotification(McMMOPlayer mcMMOPlayer, SubSkillType subSkillType) { //CHAT MESSAGE mcMMOPlayer.getPlayer().spigot().sendMessage(TextComponentFactory.getSubSkillUnlockedNotificationComponents(mcMMOPlayer.getPlayer(), subSkillType)); diff --git a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceExecution.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceExecution.java index 2726bf02b..1aefc0055 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceExecution.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceExecution.java @@ -3,6 +3,7 @@ package com.gmail.nossr50.core.util.random; public interface RandomChanceExecution { /** * Gets the XPos used in the formula for success + * * @return value of x for our success probability graph */ double getXPos(); @@ -10,6 +11,7 @@ public interface RandomChanceExecution { /** * The maximum odds for this RandomChanceExecution * For example, if this value is 10, then 10% odds would be the maximum and would be achieved only when xPos equaled the LinearCurvePeak + * * @return maximum probability odds from 0.00 (no chance of ever happened) to 100.0 (probability can be guaranteed) */ double getProbabilityCap(); diff --git a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkill.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkill.java index fee48dc52..b317b0d0c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkill.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.core.util.random; import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; public class RandomChanceSkill implements RandomChanceExecution { @@ -15,26 +15,24 @@ public class RandomChanceSkill implements RandomChanceExecution { protected final boolean isLucky; private int skillLevel; - public RandomChanceSkill(Player player, SubSkillType subSkillType) - { + public RandomChanceSkill(Player player, SubSkillType subSkillType) { this.primarySkillType = subSkillType.getParentSkill(); this.subSkillType = subSkillType; this.probabilityCap = RandomChanceUtil.LINEAR_CURVE_VAR; - if(player != null) + if (player != null) this.skillLevel = UserManager.getPlayer(player).getSkillLevel(primarySkillType); else this.skillLevel = 0; - if(player != null) + if (player != null) isLucky = Permissions.lucky(player, primarySkillType); else isLucky = false; } - public RandomChanceSkill(Player player, SubSkillType subSkillType, boolean hasCap) - { - if(hasCap) + public RandomChanceSkill(Player player, SubSkillType subSkillType, boolean hasCap) { + if (hasCap) this.probabilityCap = AdvancedConfig.getInstance().getMaximumProbability(subSkillType); else this.probabilityCap = RandomChanceUtil.LINEAR_CURVE_VAR; @@ -42,12 +40,12 @@ public class RandomChanceSkill implements RandomChanceExecution { this.primarySkillType = subSkillType.getParentSkill(); this.subSkillType = subSkillType; - if(player != null) + if (player != null) this.skillLevel = UserManager.getPlayer(player).getSkillLevel(primarySkillType); else this.skillLevel = 0; - if(player != null) + if (player != null) isLucky = Permissions.lucky(player, primarySkillType); else isLucky = false; @@ -55,6 +53,7 @@ public class RandomChanceSkill implements RandomChanceExecution { /** * The subskill corresponding to this RandomChanceSkill + * * @return this subskill */ public SubSkillType getSubSkill() { @@ -63,15 +62,16 @@ public class RandomChanceSkill implements RandomChanceExecution { /** * Gets the skill level of the player who owns this RandomChanceSkill + * * @return the current skill level relating to this RandomChanceSkill */ - public int getSkillLevel() - { + public int getSkillLevel() { return skillLevel; } /** * Modify the skill level used for this skill's RNG calculations + * * @param newSkillLevel new skill level */ public void setSkillLevel(int newSkillLevel) { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkillStatic.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkillStatic.java index 97da973ac..8618cc0d1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkillStatic.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkillStatic.java @@ -6,8 +6,7 @@ import org.bukkit.entity.Player; public class RandomChanceSkillStatic extends RandomChanceSkill { private final double xPos; - public RandomChanceSkillStatic(double xPos, Player player, SubSkillType subSkillType) - { + public RandomChanceSkillStatic(double xPos, Player player, SubSkillType subSkillType) { super(player, subSkillType); this.xPos = xPos; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceStatic.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceStatic.java index 86ff0e059..92af8e823 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceStatic.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceStatic.java @@ -5,8 +5,7 @@ public class RandomChanceStatic implements RandomChanceExecution { private final double probabilityCap; private final boolean isLucky; - public RandomChanceStatic(double xPos, boolean isLucky) - { + public RandomChanceStatic(double xPos, boolean isLucky) { this.xPos = xPos; this.probabilityCap = xPos; this.isLucky = isLucky; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceUtil.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceUtil.java index d01b9ff39..bb34e91f8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceUtil.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceUtil.java @@ -14,8 +14,7 @@ import org.bukkit.entity.Player; import java.text.DecimalFormat; import java.util.Random; -public class RandomChanceUtil -{ +public class RandomChanceUtil { public static final DecimalFormat percent = new DecimalFormat("##0.00%"); //public static final DecimalFormat decimal = new DecimalFormat("##0.00"); public static final double LINEAR_CURVE_VAR = 100.0D; @@ -26,14 +25,12 @@ public class RandomChanceUtil * non-RNG skills just fire the cancellable event and succeed if they go uncancelled * * @param skillActivationType this value represents what kind of activation procedures this sub-skill uses - * @param subSkillType The identifier for this specific sub-skill - * @param player The owner of this sub-skill + * @param subSkillType The identifier for this specific sub-skill + * @param player The owner of this sub-skill * @return returns true if all conditions are met and they event is not cancelled */ - public static boolean isActivationSuccessful(SkillActivationType skillActivationType, SubSkillType subSkillType, Player player) - { - switch(skillActivationType) - { + public static boolean isActivationSuccessful(SkillActivationType skillActivationType, SubSkillType subSkillType, Player player) { + switch (skillActivationType) { case RANDOM_LINEAR_100_SCALE_WITH_CAP: return checkRandomChanceExecutionSuccess(player, subSkillType, true); case RANDOM_STATIC_CHANCE: @@ -46,10 +43,8 @@ public class RandomChanceUtil } } - public static double getActivationChance(SkillActivationType skillActivationType, SubSkillType subSkillType, Player player) - { - switch(skillActivationType) - { + public static double getActivationChance(SkillActivationType skillActivationType, SubSkillType subSkillType, Player player) { + switch (skillActivationType) { case RANDOM_LINEAR_100_SCALE_WITH_CAP: return getRandomChanceExecutionSuccess(player, subSkillType, true); case RANDOM_STATIC_CHANCE: @@ -61,10 +56,10 @@ public class RandomChanceUtil /** * Checks whether or not the random chance succeeds + * * @return true if the random chance succeeds */ - public static boolean checkRandomChanceExecutionSuccess(Player player, PrimarySkillType primarySkillType, double chance) - { + public static boolean checkRandomChanceExecutionSuccess(Player player, PrimarySkillType primarySkillType, double chance) { //Check the odds chance *= 100; @@ -88,19 +83,18 @@ public class RandomChanceUtil /** * Used for stuff like Excavation, Fishing, etc... + * * @param randomChance * @return */ - public static boolean checkRandomChanceExecutionSuccess(RandomChanceSkillStatic randomChance) - { + public static boolean checkRandomChanceExecutionSuccess(RandomChanceSkillStatic randomChance) { double chanceOfSuccess = calculateChanceOfSuccess(randomChance); //Check the odds return rollDice(chanceOfSuccess, 100); } - public static boolean checkRandomChanceExecutionSuccess(RandomChanceSkill randomChance) - { + public static boolean checkRandomChanceExecutionSuccess(RandomChanceSkill randomChance) { double chanceOfSuccess = calculateChanceOfSuccess(randomChance); Random random = new Random(); @@ -118,6 +112,7 @@ public class RandomChanceUtil /** * Gets the Static Chance for something to activate + * * @param randomChance * @return */ @@ -176,27 +171,23 @@ public class RandomChanceUtil * * @return the chance of success from 0-100 (100 = guaranteed) */ - private static int getChanceOfSuccess(double skillLevel, double maxProbability, double maxLevel) - { + private static int getChanceOfSuccess(double skillLevel, double maxProbability, double maxLevel) { //return (int) (x / (y / LINEAR_CURVE_VAR)); - return (int) (maxProbability * (skillLevel/maxLevel)); + return (int) (maxProbability * (skillLevel / maxLevel)); // max probability * (weight/maxlevel) = chance of success } - private static int getChanceOfSuccess(double x, double y) - { + private static int getChanceOfSuccess(double x, double y) { return (int) (x / (y / LINEAR_CURVE_VAR)); // max probability * (weight/maxlevel) = chance of success } - public static double getRandomChanceExecutionSuccess(Player player, SubSkillType subSkillType, boolean hasCap) - { + public static double getRandomChanceExecutionSuccess(Player player, SubSkillType subSkillType, boolean hasCap) { RandomChanceSkill rcs = new RandomChanceSkill(player, subSkillType, hasCap); return calculateChanceOfSuccess(rcs); } - public static double getRandomStaticChanceExecutionSuccess(Player player, SubSkillType subSkillType) - { + public static double getRandomStaticChanceExecutionSuccess(Player player, SubSkillType subSkillType) { try { return getRandomChanceExecutionChance(new RandomChanceSkillStatic(getStaticRandomChance(subSkillType), player, subSkillType)); } catch (InvalidStaticChance invalidStaticChance) { @@ -207,18 +198,15 @@ public class RandomChanceUtil return 0.1337; //Puts on shades } - public static boolean checkRandomChanceExecutionSuccess(Player player, SubSkillType subSkillType, boolean hasCap) - { + public static boolean checkRandomChanceExecutionSuccess(Player player, SubSkillType subSkillType, boolean hasCap) { return checkRandomChanceExecutionSuccess(new RandomChanceSkill(player, subSkillType, hasCap)); } - public static boolean checkRandomChanceExecutionSuccess(Player player, SubSkillType subSkillType) - { + public static boolean checkRandomChanceExecutionSuccess(Player player, SubSkillType subSkillType) { return checkRandomChanceExecutionSuccess(new RandomChanceSkill(player, subSkillType)); } - public static boolean checkRandomStaticChanceExecutionSuccess(Player player, SubSkillType subSkillType) - { + public static boolean checkRandomStaticChanceExecutionSuccess(Player player, SubSkillType subSkillType) { try { return checkRandomChanceExecutionSuccess(new RandomChanceSkillStatic(getStaticRandomChance(subSkillType), player, subSkillType)); } catch (InvalidStaticChance invalidStaticChance) { @@ -231,14 +219,13 @@ public class RandomChanceUtil /** * Grabs static activation rolls for Secondary Abilities + * * @param subSkillType The secondary ability to grab properties of - * @throws InvalidStaticChance if the skill has no defined static chance this exception will be thrown and you should know you're a naughty boy * @return The static activation roll involved in the RNG calculation + * @throws InvalidStaticChance if the skill has no defined static chance this exception will be thrown and you should know you're a naughty boy */ - public static double getStaticRandomChance(SubSkillType subSkillType) throws InvalidStaticChance - { - switch(subSkillType) - { + public static double getStaticRandomChance(SubSkillType subSkillType) throws InvalidStaticChance { + switch (subSkillType) { case AXES_ARMOR_IMPACT: return AdvancedConfig.getInstance().getImpactChance(); case AXES_GREATER_IMPACT: @@ -250,8 +237,7 @@ public class RandomChanceUtil } } - public static boolean sendSkillEvent(Player player, SubSkillType subSkillType, double activationChance) - { + public static boolean sendSkillEvent(Player player, SubSkillType subSkillType, double activationChance) { SubSkillRandomCheckEvent event = new SubSkillRandomCheckEvent(player, subSkillType, activationChance); return !event.isCancelled(); } @@ -262,8 +248,7 @@ public class RandomChanceUtil return (event.getChance() * activationChance) > (Misc.getRandom().nextDouble() * activationChance) && !event.isCancelled(); }*/ - public static boolean isActivationSuccessful(SkillActivationType skillActivationType, AbstractSubSkill abstractSubSkill, Player player) - { + public static boolean isActivationSuccessful(SkillActivationType skillActivationType, AbstractSubSkill abstractSubSkill, Player player) { return isActivationSuccessful(skillActivationType, abstractSubSkill.getSubSkillType(), player); } @@ -311,17 +296,15 @@ public class RandomChanceUtil return displayValues; } - public static double addLuck(Player player, PrimarySkillType primarySkillType, double chance) - { - if(Permissions.lucky(player, primarySkillType)) + public static double addLuck(Player player, PrimarySkillType primarySkillType, double chance) { + if (Permissions.lucky(player, primarySkillType)) return chance * 1.333D; else return chance; } - public static double addLuck(boolean isLucky, double chance) - { - if(isLucky) + public static double addLuck(boolean isLucky, double chance) { + if (isLucky) return chance * 1.333D; else return chance; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java index 54770160f..089b0631d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.core.util.scoreboards; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.database.PlayerStat; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; @@ -44,9 +44,10 @@ public class ScoreboardManager { static final String LABEL_ABILITY_COOLDOWN = LocaleLoader.getString("Scoreboard.Misc.Cooldown"); static final String LABEL_OVERALL = LocaleLoader.getString("Scoreboard.Misc.Overall"); - static final Map skillLabels; + static final Map skillLabels; static final Map abilityLabelsColored; static final Map abilityLabelsSkill; + private static List dirtyPowerLevels = new ArrayList(); /* * Initializes the static properties of this class @@ -129,17 +130,6 @@ public class ScoreboardManager { abilityLabelsSkill = abilityLabelSkillBuilder.build(); } - private static List dirtyPowerLevels = new ArrayList(); - - public enum SidebarType { - NONE, - SKILL_BOARD, - STATS_BOARD, - COOLDOWNS_BOARD, - RANK_BOARD, - TOP_BOARD; - } - private static String formatAbility(String abilityName) { return formatAbility(ChatColor.AQUA, abilityName); } @@ -147,8 +137,7 @@ public class ScoreboardManager { private static String formatAbility(ChatColor color, String abilityName) { if (Config.getInstance().getShowAbilityNames()) { return getShortenedName(color + abilityName); - } - else { + } else { return color + LocaleLoader.getString("Scoreboard.Misc.Ability"); } } @@ -165,14 +154,14 @@ public class ScoreboardManager { return name; } - // **** Listener call-ins **** // - // Called by PlayerJoinEvent listener public static void setupPlayer(Player player) { PLAYER_SCOREBOARDS.put(player.getName(), ScoreboardWrapper.create(player)); dirtyPowerLevels.add(player.getName()); } + // **** Listener call-ins **** // + // Called by PlayerQuitEvent listener public static void teardownPlayer(Player player) { ScoreboardWrapper wrapper = PLAYER_SCOREBOARDS.remove(player.getName()); @@ -247,8 +236,6 @@ public class ScoreboardManager { } } - // **** Setup methods **** // - public static void enablePlayerSkillScoreboard(Player player, PrimarySkillType skill) { ScoreboardWrapper wrapper = PLAYER_SCOREBOARDS.get(player.getName()); @@ -258,6 +245,8 @@ public class ScoreboardManager { changeScoreboard(wrapper, Config.getInstance().getSkillScoreboardTime()); } + // **** Setup methods **** // + public static void enablePlayerSkillLevelUpScoreboard(Player player, PrimarySkillType skill) { ScoreboardWrapper wrapper = PLAYER_SCOREBOARDS.get(player.getName()); @@ -339,8 +328,6 @@ public class ScoreboardManager { changeScoreboard(wrapper, Config.getInstance().getTopScoreboardTime()); } - // **** Helper methods **** // - /** * @return false if power levels are disabled */ @@ -372,6 +359,8 @@ public class ScoreboardManager { return true; } + // **** Helper methods **** // + /** * Gets or creates the power level objective on the main targetBoard. *

@@ -406,8 +395,7 @@ public class ScoreboardManager { private static void changeScoreboard(ScoreboardWrapper wrapper, int displayTime) { if (displayTime == -1) { wrapper.showBoardWithNoRevert(); - } - else { + } else { wrapper.showBoardAndScheduleRevert(displayTime * Misc.TICK_CONVERSION_FACTOR); } } @@ -427,4 +415,13 @@ public class ScoreboardManager { public static void setRevertTimer(String playerName, int seconds) { PLAYER_SCOREBOARDS.get(playerName).showBoardAndScheduleRevert(seconds * Misc.TICK_CONVERSION_FACTOR); } + + public enum SidebarType { + NONE, + SKILL_BOARD, + STATS_BOARD, + COOLDOWNS_BOARD, + RANK_BOARD, + TOP_BOARD; + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java index 34c5ae3c6..bf4b633d8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java @@ -1,18 +1,17 @@ package com.gmail.nossr50.core.util.scoreboards; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.database.PlayerStat; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.util.Misc; -import com.gmail.nossr50.events.scoreboard.*; -import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.skills.child.FamilyTree; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager.SidebarType; +import com.gmail.nossr50.mcMMO; import org.apache.commons.lang.Validate; import org.bukkit.ChatColor; import org.bukkit.entity.Player; @@ -31,20 +30,21 @@ public class ScoreboardWrapper { public final String playerName; public final Player player; private final Scoreboard scoreboard; + public String targetPlayer = null; + public PrimarySkillType targetSkill = null; + public int leaderboardPage = -1; + public BukkitTask updateTask = null; + public BukkitTask revertTask = null; + public BukkitTask cooldownTask = null; private boolean tippedKeep = false; private boolean tippedClear = false; - // Internal usage variables (should exist) private SidebarType sidebarType; private Objective sidebarObjective; private Objective powerObjective; - // Parameter variables (May be null / invalid) private Scoreboard oldBoard = null; - public String targetPlayer = null; - public PrimarySkillType targetSkill = null; private PlayerProfile targetProfile = null; - public int leaderboardPage = -1; private ScoreboardWrapper(Player player, Scoreboard scoreboard) { this.player = player; @@ -72,42 +72,6 @@ public class ScoreboardWrapper { return new ScoreboardWrapper(event.getTargetPlayer(), event.getTargetBoard()); } - public BukkitTask updateTask = null; - - private class ScoreboardQuickUpdate extends BukkitRunnable { - @Override - public void run() { - updateSidebar(); - updateTask = null; - } - } - - public BukkitTask revertTask = null; - - private class ScoreboardChangeTask extends BukkitRunnable { - @Override - public void run() { - tryRevertBoard(); - revertTask = null; - } - } - - public BukkitTask cooldownTask = null; - - private class ScoreboardCooldownTask extends BukkitRunnable { - @Override - public void run() { - // Stop updating if it's no longer something displaying cooldowns - if (isBoardShown() && (isSkillScoreboard() || isCooldownScoreboard())) { - doSidebarUpdateSoon(); - } - else { - stopCooldownUpdating(); - } - } - } - - public void doSidebarUpdateSoon() { if (updateTask == null) { // To avoid spamming the scheduler, store the instance and run 2 ticks later @@ -127,8 +91,7 @@ public class ScoreboardWrapper { if (cooldownTask != null) { try { cooldownTask.cancel(); - } - catch (Throwable ignored) { + } catch (Throwable ignored) { } cooldownTask = null; @@ -165,8 +128,7 @@ public class ScoreboardWrapper { // (Shouldn't happen) Use failsafe value - we're already displaying our board, but we don't have the one we should revert to this.oldBoard = mcMMO.p.getServer().getScoreboardManager().getMainScoreboard(); } - } - else { + } else { this.oldBoard = oldBoard; } } @@ -214,8 +176,7 @@ public class ScoreboardWrapper { if (!tippedKeep) { tippedKeep = true; player.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Tip.Keep")); - } - else if (!tippedClear) { + } else if (!tippedClear) { tippedClear = true; player.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Tip.Clear")); profile.increaseTipsShown(); @@ -240,8 +201,7 @@ public class ScoreboardWrapper { //Modify the player based on the event event.getTargetPlayer().setScoreboard(event.getTargetBoard()); oldBoard = null; - } - else { + } else { mcMMO.p.debug("Not reverting targetBoard for " + playerName + " - targetBoard was changed by another plugin (Consider disabling the mcMMO scoreboards if you don't want them!)"); } } @@ -275,8 +235,6 @@ public class ScoreboardWrapper { revertTask = null; } - // Board Type Changing 'API' methods - public void setTypeNone() { this.sidebarType = SidebarType.NONE; @@ -310,6 +268,8 @@ public class ScoreboardWrapper { loadObjective(ScoreboardManager.HEADER_STATS); } + // Board Type Changing 'API' methods + public void setTypeInspectStats(PlayerProfile profile) { this.sidebarType = SidebarType.STATS_BOARD; targetPlayer = profile.getPlayerName(); @@ -384,13 +344,13 @@ public class ScoreboardWrapper { protected void loadObjective(String displayName) { //Unregister objective McMMOScoreboardObjectiveEvent unregisterEvent = callObjectiveEvent(ScoreboardObjectiveEventReason.UNREGISTER_THIS_OBJECTIVE); - if(!unregisterEvent.isCancelled()) { + if (!unregisterEvent.isCancelled()) { sidebarObjective.unregister(); } //Register objective McMMOScoreboardObjectiveEvent registerEvent = callObjectiveEvent(ScoreboardObjectiveEventReason.REGISTER_NEW_OBJECTIVE); - if(!registerEvent.isCancelled()) + if (!registerEvent.isCancelled()) sidebarObjective = registerEvent.getTargetBoard().registerNewObjective(ScoreboardManager.SIDEBAR_OBJECTIVE, "dummy"); if (displayName.length() > 32) { @@ -416,8 +376,7 @@ public class ScoreboardWrapper { private void updateSidebar() { try { updateTask.cancel(); - } - catch (Throwable ignored) { + } catch (Throwable ignored) { } // catch NullPointerException and IllegalStateException and any Error; don't care updateTask = null; @@ -447,8 +406,7 @@ public class ScoreboardWrapper { sidebarObjective.getScore(ScoreboardManager.LABEL_CURRENT_XP).setScore(currentXP); sidebarObjective.getScore(ScoreboardManager.LABEL_REMAINING_XP).setScore(mcMMOPlayer.getXpToLevel(targetSkill) - currentXP); - } - else { + } else { for (PrimarySkillType parentSkill : FamilyTree.getParents(targetSkill)) { sidebarObjective.getScore(ScoreboardManager.skillLabels.get(parentSkill)).setScore(mcMMOPlayer.getSkillLevel(parentSkill)); } @@ -470,8 +428,7 @@ public class ScoreboardWrapper { cooldownBM.setScore(secondsBM); stopUpdating = (secondsSB == 0 && secondsBM == 0); - } - else { + } else { SuperAbilityType ability = targetSkill.getAbility(); Score cooldown = sidebarObjective.getScore(ScoreboardManager.abilityLabelsSkill.get(ability)); int seconds = Math.max(mcMMOPlayer.calculateTimeRemaining(ability), 0); @@ -483,8 +440,7 @@ public class ScoreboardWrapper { if (stopUpdating) { stopCooldownUpdating(); - } - else { + } else { startCooldownUpdating(); } } @@ -505,8 +461,7 @@ public class ScoreboardWrapper { if (anyCooldownsActive) { startCooldownUpdating(); - } - else { + } else { stopCooldownUpdating(); } break; @@ -517,11 +472,9 @@ public class ScoreboardWrapper { if (targetProfile != null) { newProfile = targetProfile; // offline - } - else if (targetPlayer == null) { + } else if (targetPlayer == null) { newProfile = mcMMOPlayer.getProfile(); // self - } - else { + } else { newProfile = UserManager.getPlayer(targetPlayer).getProfile(); // online } @@ -545,10 +498,10 @@ public class ScoreboardWrapper { case RANK_BOARD: case TOP_BOARD: - /* - * @see #acceptRankData(Map rank) - * @see #acceptLeaderboardData(List stats) - */ + /* + * @see #acceptRankData(Map rank) + * @see #acceptLeaderboardData(List stats) + */ break; default: @@ -594,4 +547,32 @@ public class ScoreboardWrapper { public void updatePowerLevel(Player player, int newPowerLevel) { powerObjective.getScore(player.getName()).setScore(newPowerLevel); } + + private class ScoreboardQuickUpdate extends BukkitRunnable { + @Override + public void run() { + updateSidebar(); + updateTask = null; + } + } + + private class ScoreboardChangeTask extends BukkitRunnable { + @Override + public void run() { + tryRevertBoard(); + revertTask = null; + } + } + + private class ScoreboardCooldownTask extends BukkitRunnable { + @Override + public void run() { + // Stop updating if it's no longer something displaying cooldowns + if (isBoardShown() && (isSkillScoreboard() || isCooldownScoreboard())) { + doSidebarUpdateSoon(); + } else { + stopCooldownUpdating(); + } + } + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/CombatUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/CombatUtils.java index 0a9422b68..2aa3ed355 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/CombatUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/CombatUtils.java @@ -1,18 +1,14 @@ package com.gmail.nossr50.core.util.skills; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.util.*; -import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent; -import com.gmail.nossr50.events.fake.FakeEntityDamageEvent; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.core.runnables.skills.AwardCombatXpTask; import com.gmail.nossr50.core.runnables.skills.BleedTimerTask; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.primary.acrobatics.AcrobaticsManager; import com.gmail.nossr50.core.skills.primary.archery.ArcheryManager; import com.gmail.nossr50.core.skills.primary.axes.AxesManager; @@ -20,13 +16,17 @@ import com.gmail.nossr50.core.skills.primary.swords.SwordsManager; import com.gmail.nossr50.core.skills.primary.taming.TamingManager; import com.gmail.nossr50.core.skills.primary.unarmed.Unarmed; import com.gmail.nossr50.core.skills.primary.unarmed.UnarmedManager; -import com.gmail.nossr50.util.*; +import com.gmail.nossr50.core.util.*; import com.gmail.nossr50.core.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent; +import com.gmail.nossr50.events.fake.FakeEntityDamageEvent; +import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.party.PartyManager; +import com.gmail.nossr50.util.*; import com.google.common.collect.ImmutableMap; import org.bukkit.GameMode; import org.bukkit.Material; -import org.bukkit.entity.*; +import org.bukkit.entity.LivingEntity; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; @@ -39,13 +39,14 @@ import java.util.HashMap; import java.util.Map; public final class CombatUtils { - private CombatUtils() {} + private CombatUtils() { + } private static void processSwordCombat(LivingEntity target, Player player, EntityDamageByEntityEvent event) { if (event.getCause() == DamageCause.THORNS) { return; } - + McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); SwordsManager swordsManager = mcMMOPlayer.getSwordsManager(); double initialDamage = event.getDamage(); @@ -56,8 +57,7 @@ public final class CombatUtils { mcMMOPlayer.checkAbilityActivation(PrimarySkillType.SWORDS); } - if(target.getHealth() - event.getFinalDamage() >= 1) - { + if (target.getHealth() - event.getFinalDamage() >= 1) { if (swordsManager.canUseRupture()) { swordsManager.ruptureCheck(target); } @@ -74,7 +74,7 @@ public final class CombatUtils { if (event.getCause() == DamageCause.THORNS) { return; } - + double initialDamage = event.getDamage(); double finalDamage = initialDamage; Map modifiers = getModifiers(event); @@ -96,8 +96,7 @@ public final class CombatUtils { if (axesManager.canImpact(target)) { axesManager.impactCheck(target); - } - else if (axesManager.canGreaterImpact(target)) { + } else if (axesManager.canGreaterImpact(target)) { finalDamage += axesManager.greaterImpact(target); } @@ -113,7 +112,7 @@ public final class CombatUtils { if (event.getCause() == DamageCause.THORNS) { return; } - + double initialDamage = event.getDamage(); double finalDamage = initialDamage; @@ -125,8 +124,7 @@ public final class CombatUtils { } //Only execute bonuses if the player is not spamming - if(unarmedManager.isPunchingCooldownOver()) - { + if (unarmedManager.isPunchingCooldownOver()) { if (unarmedManager.canUseIronArm()) { finalDamage += unarmedManager.ironArm(); } @@ -250,8 +248,7 @@ public final class CombatUtils { if (PrimarySkillType.SWORDS.getPermissions(player)) { processSwordCombat(target, player, event); } - } - else if (ItemUtils.isAxe(heldItem)) { + } else if (ItemUtils.isAxe(heldItem)) { if (!PrimarySkillType.AXES.shouldProcess(target)) { return; } @@ -259,8 +256,7 @@ public final class CombatUtils { if (PrimarySkillType.AXES.getPermissions(player)) { processAxeCombat(target, player, event); } - } - else if (ItemUtils.isUnarmed(heldItem)) { + } else if (ItemUtils.isUnarmed(heldItem)) { if (!PrimarySkillType.UNARMED.shouldProcess(target)) { return; } @@ -269,9 +265,7 @@ public final class CombatUtils { processUnarmedCombat(target, player, event); } } - } - - else if (entityType == EntityType.WOLF) { + } else if (entityType == EntityType.WOLF) { Wolf wolf = (Wolf) damager; AnimalTamer tamer = wolf.getOwner(); @@ -282,8 +276,7 @@ public final class CombatUtils { processTamingCombat(target, master, wolf, event); } } - } - else if (entityType == EntityType.ARROW) { + } else if (entityType == EntityType.ARROW) { Arrow arrow = (Arrow) damager; ProjectileSource projectileSource = arrow.getShooter(); @@ -346,8 +339,8 @@ public final class CombatUtils { /** * Attempt to damage target for value dmg with reason ENTITY_ATTACK with damager attacker * - * @param target LivingEntity which to attempt to damage - * @param damage Amount of damage to attempt to do + * @param target LivingEntity which to attempt to damage + * @param damage Amount of damage to attempt to do * @param attacker Player to pass to event as damager */ @Deprecated @@ -358,8 +351,8 @@ public final class CombatUtils { /** * Attempt to damage target for value dmg with reason ENTITY_ATTACK with damager attacker * - * @param target LivingEntity which to attempt to damage - * @param damage Amount of damage to attempt to do + * @param target LivingEntity which to attempt to damage + * @param damage Amount of damage to attempt to do * @param attacker Player to pass to event as damager */ public static void dealDamage(LivingEntity target, double damage, Map modifiers, LivingEntity attacker) { @@ -374,8 +367,8 @@ public final class CombatUtils { /** * Attempt to damage target for value dmg with reason ENTITY_ATTACK with damager attacker * - * @param target LivingEntity which to attempt to damage - * @param damage Amount of damage to attempt to do + * @param target LivingEntity which to attempt to damage + * @param damage Amount of damage to attempt to do * @param attacker Player to pass to event as damager */ @Deprecated @@ -402,9 +395,9 @@ public final class CombatUtils { * Apply Area-of-Effect ability actions. * * @param attacker The attacking player - * @param target The defending entity - * @param damage The initial damage amount - * @param type The type of skill being used + * @param target The defending entity + * @param damage The initial damage amount + * @param type The type of skill being used */ public static void applyAbilityAoE(Player attacker, LivingEntity target, double damage, Map modifiers, PrimarySkillType type) { int numberOfTargets = getTier(attacker.getInventory().getItemInMainHand()); // The higher the weapon tier, the more targets you hit @@ -425,7 +418,7 @@ public final class CombatUtils { switch (type) { case SWORDS: if (entity instanceof Player) { - NotificationManager.sendPlayerInformation((Player)entity, NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.SS.Struck"); + NotificationManager.sendPlayerInformation((Player) entity, NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.SS.Struck"); } BleedTimerTask.add(livingEntity, attacker, UserManager.getPlayer(attacker).getSwordsManager().getRuptureBleedTicks(), RankUtils.getRank(attacker, SubSkillType.SWORDS_RUPTURE)); @@ -433,7 +426,7 @@ public final class CombatUtils { case AXES: if (entity instanceof Player) { - NotificationManager.sendPlayerInformation((Player)entity, NotificationType.SUBSKILL_MESSAGE, "Axes.Combat.SS.Struck"); + NotificationManager.sendPlayerInformation((Player) entity, NotificationType.SUBSKILL_MESSAGE, "Axes.Combat.SS.Struck"); } break; @@ -454,8 +447,8 @@ public final class CombatUtils { /** * Start the task that gives combat XP. * - * @param mcMMOPlayer The attacking player - * @param target The defending entity + * @param mcMMOPlayer The attacking player + * @param target The defending entity * @param primarySkillType The skill being used */ private static void startGainXp(McMMOPlayer mcMMOPlayer, LivingEntity target, PrimarySkillType primarySkillType, double multiplier) { @@ -473,37 +466,27 @@ public final class CombatUtils { if (defender.isOnline() && SkillUtils.cooldownExpired(mcMMOPlayer.getRespawnATS(), Misc.PLAYER_RESPAWN_COOLDOWN_SECONDS)) { baseXP = 20 * ExperienceConfig.getInstance().getPlayerVersusPlayerXP(); } - } - else { + } else { if (mcMMO.getModManager().isCustomEntity(target)) { baseXP = mcMMO.getModManager().getEntity(target).getXpMultiplier(); - } - else if (target instanceof Animals) { + } else if (target instanceof Animals) { EntityType type = target.getType(); baseXP = ExperienceConfig.getInstance().getAnimalsXP(type); - } - else if (target instanceof Monster) - { + } else if (target instanceof Monster) { EntityType type = target.getType(); baseXP = ExperienceConfig.getInstance().getCombatXP(type); - } - else { + } else { EntityType type = target.getType(); if (ExperienceConfig.getInstance().hasCombatXP(type)) { - if (type == EntityType.IRON_GOLEM) - { + if (type == EntityType.IRON_GOLEM) { if (!((IronGolem) target).isPlayerCreated()) { baseXP = ExperienceConfig.getInstance().getCombatXP(type); } - } - else - { + } else { baseXP = ExperienceConfig.getInstance().getCombatXP(type); } - } - else - { + } else { baseXP = 1.0; mcMMO.getModManager().addCustomEntity(target); } @@ -552,7 +535,7 @@ public final class CombatUtils { if (!player.canSee(defender)) { return false; } - + // Spectators should not be affected if (defender.getGameMode() == GameMode.SPECTATOR) { return false; @@ -562,8 +545,7 @@ public final class CombatUtils { if (callFakeDamageEvent(player, entity, 1.0) == 0) { return false; } - } - else if (entity instanceof Tameable) { + } else if (entity instanceof Tameable) { if (isFriendlyPet(player, (Tameable) entity)) { // isFriendlyPet ensures that the Tameable is: Tamed, owned by a player, and the owner is in the same party // So we can make some assumptions here, about our casting and our check @@ -580,7 +562,7 @@ public final class CombatUtils { /** * Checks to see if an entity is currently invincible. * - * @param entity The {@link LivingEntity} to check + * @param entity The {@link LivingEntity} to check * @param eventDamage The damage from the event the entity is involved in * @return true if the entity is invincible, false otherwise */ @@ -596,7 +578,7 @@ public final class CombatUtils { * Checks to see if an entity is currently friendly toward a given player. * * @param attacker The player to check. - * @param pet The entity to check. + * @param pet The entity to check. * @return true if the entity is friendly, false otherwise */ public static boolean isFriendlyPet(Player attacker, Tameable pet) { @@ -706,20 +688,15 @@ public final class CombatUtils { if (ItemUtils.isWoodTool(inHand)) { tier = 1; - } - else if (ItemUtils.isStoneTool(inHand)) { + } else if (ItemUtils.isStoneTool(inHand)) { tier = 2; - } - else if (ItemUtils.isIronTool(inHand)) { + } else if (ItemUtils.isIronTool(inHand)) { tier = 3; - } - else if (ItemUtils.isGoldTool(inHand)) { + } else if (ItemUtils.isGoldTool(inHand)) { tier = 1; - } - else if (ItemUtils.isDiamondTool(inHand)) { + } else if (ItemUtils.isDiamondTool(inHand)) { tier = 4; - } - else if (mcMMO.getModManager().isCustomTool(inHand)) { + } else if (mcMMO.getModManager().isCustomTool(inHand)) { tier = mcMMO.getModManager().getTool(inHand).getTier(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java index 22257ee20..0a26e40a9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.core.util.skills; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.mcMMO; -import org.bukkit.*; import org.bukkit.FireworkEffect.Type; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; @@ -15,7 +14,10 @@ import org.bukkit.metadata.FixedMetadataValue; public final class ParticleEffectUtils { - private ParticleEffectUtils() {}; + private ParticleEffectUtils() { + } + + ; public static void playBleedEffect(LivingEntity livingEntity) { if (!Config.getInstance().getBleedEffectEnabled()) { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/PerksUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/PerksUtils.java index b3000d9f9..9c8f068b1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/PerksUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/PerksUtils.java @@ -9,16 +9,17 @@ public final class PerksUtils { private static final int LUCKY_SKILL_ACTIVATION_CHANCE = 75; private static final int NORMAL_SKILL_ACTIVATION_CHANCE = 100; - private PerksUtils() {}; + private PerksUtils() { + } + + ; public static int handleCooldownPerks(Player player, int cooldown) { if (Permissions.halvedCooldowns(player)) { cooldown *= 0.5; - } - else if (Permissions.thirdedCooldowns(player)) { + } else if (Permissions.thirdedCooldowns(player)) { cooldown *= (2.0 / 3.0); - } - else if (Permissions.quarteredCooldowns(player)) { + } else if (Permissions.quarteredCooldowns(player)) { cooldown *= 0.75; } @@ -32,11 +33,9 @@ public final class PerksUtils { if (Permissions.twelveSecondActivationBoost(player)) { ticks += 12; - } - else if (Permissions.eightSecondActivationBoost(player)) { + } else if (Permissions.eightSecondActivationBoost(player)) { ticks += 8; - } - else if (Permissions.fourSecondActivationBoost(player)) { + } else if (Permissions.fourSecondActivationBoost(player)) { ticks += 4; } @@ -46,23 +45,17 @@ public final class PerksUtils { public static float handleXpPerks(Player player, float xp, PrimarySkillType skill) { if (Permissions.customXpBoost(player, skill)) { xp *= ExperienceConfig.getInstance().getCustomXpPerkBoost(); - } - else if (Permissions.quadrupleXp(player, skill)) { + } else if (Permissions.quadrupleXp(player, skill)) { xp *= 4; - } - else if (Permissions.tripleXp(player, skill)) { + } else if (Permissions.tripleXp(player, skill)) { xp *= 3; - } - else if (Permissions.doubleAndOneHalfXp(player, skill)) { + } else if (Permissions.doubleAndOneHalfXp(player, skill)) { xp *= 2.5; - } - else if (Permissions.doubleXp(player, skill)) { + } else if (Permissions.doubleXp(player, skill)) { xp *= 2; - } - else if (Permissions.oneAndOneHalfXp(player, skill)) { + } else if (Permissions.oneAndOneHalfXp(player, skill)) { xp *= 1.5; - } - else if (Permissions.oneAndOneTenthXp(player, skill)) { + } else if (Permissions.oneAndOneTenthXp(player, skill)) { xp *= 1.1; } @@ -73,7 +66,7 @@ public final class PerksUtils { * Calculate activation chance for a skill. * * @param player Player to check the activation chance for - * @param skill PrimarySkillType to check the activation chance of + * @param skill PrimarySkillType to check the activation chance of * @return the activation chance with "lucky perk" accounted for */ public static int handleLuckyPerks(Player player, PrimarySkillType skill) { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/RankUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/RankUtils.java index c82f05ee4..ae5535f11 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/RankUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/RankUtils.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.core.util.skills; import com.gmail.nossr50.core.config.skills.RankConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.runnables.skills.SkillUnlockNotificationTask; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.listeners.InteractionManager; -import com.gmail.nossr50.core.runnables.skills.SkillUnlockNotificationTask; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; @@ -18,29 +18,25 @@ public class RankUtils { private static HashMap> subSkillRanks; /** - * - * @param plugin plugin instance ref - * @param mcMMOPlayer target player + * @param plugin plugin instance ref + * @param mcMMOPlayer target player * @param primarySkillType - * @param newLevel the new level of this skill + * @param newLevel the new level of this skill */ - public static void executeSkillUnlockNotifications(Plugin plugin, McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType, int newLevel) - { + public static void executeSkillUnlockNotifications(Plugin plugin, McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType, int newLevel) { int count = 0; - for(SubSkillType subSkillType : primarySkillType.getSkillAbilities()) - { + for (SubSkillType subSkillType : primarySkillType.getSkillAbilities()) { int playerRankInSkill = getRank(mcMMOPlayer.getPlayer(), subSkillType); HashMap innerMap = subSkillRanks.get(subSkillType.toString()); //If the skill doesn't have registered ranks gtfo - if(innerMap == null || innerMap.get(playerRankInSkill) == null) + if (innerMap == null || innerMap.get(playerRankInSkill) == null) return; //The players level is the exact level requirement for this skill - if(newLevel == innerMap.get(playerRankInSkill)) - { + if (newLevel == innerMap.get(playerRankInSkill)) { SkillUnlockNotificationTask skillUnlockNotificationTask = new SkillUnlockNotificationTask(mcMMOPlayer, subSkillType, newLevel); skillUnlockNotificationTask.runTaskLater(plugin, ((count * 4) + 1) * 20); @@ -51,26 +47,22 @@ public class RankUtils { } /* NEW SYSTEM */ - private static void addRanks(AbstractSubSkill abstractSubSkill) - { + private static void addRanks(AbstractSubSkill abstractSubSkill) { //Fill out the rank array - for(int i = 0; i < abstractSubSkill.getNumRanks(); i++) - { + for (int i = 0; i < abstractSubSkill.getNumRanks(); i++) { //This adds the highest ranks first - addRank(abstractSubSkill, abstractSubSkill.getNumRanks()-i); + addRank(abstractSubSkill, abstractSubSkill.getNumRanks() - i); //TODO: Remove debug code /*System.out.println("DEBUG: Adding rank "+(numRanks-i)+" to "+subSkillType.toString());*/ } } - private static void addRanks(SubSkillType subSkillType) - { + private static void addRanks(SubSkillType subSkillType) { //Fill out the rank array - for(int i = 0; i < subSkillType.getNumRanks(); i++) - { + for (int i = 0; i < subSkillType.getNumRanks(); i++) { //This adds the highest ranks first - addRank(subSkillType, subSkillType.getNumRanks()-i); + addRank(subSkillType, subSkillType.getNumRanks() - i); //TODO: Remove debug code /*System.out.println("DEBUG: Adding rank "+(numRanks-i)+" to "+subSkillType.toString());*/ @@ -80,27 +72,24 @@ public class RankUtils { /** * Populates the ranks for every skill we know about */ - public static void populateRanks() - { - for(SubSkillType subSkillType : SubSkillType.values()) - { + public static void populateRanks() { + for (SubSkillType subSkillType : SubSkillType.values()) { addRanks(subSkillType); } - for(AbstractSubSkill abstractSubSkill : InteractionManager.getSubSkillList()) - { + for (AbstractSubSkill abstractSubSkill : InteractionManager.getSubSkillList()) { addRanks(abstractSubSkill); } } /** * Returns whether or not the player has unlocked the first rank in target subskill - * @param player the player + * + * @param player the player * @param subSkillType the target subskill * @return true if the player has at least one rank in the skill */ - public static boolean hasUnlockedSubskill(Player player, SubSkillType subSkillType) - { + public static boolean hasUnlockedSubskill(Player player, SubSkillType subSkillType) { int curRank = getRank(player, subSkillType); //-1 means the skill has no unlockable levels and is therefor unlocked @@ -109,12 +98,12 @@ public class RankUtils { /** * Returns whether or not the player has unlocked the first rank in target subskill - * @param player the player + * + * @param player the player * @param abstractSubSkill the target subskill * @return true if the player has at least one rank in the skill */ - public static boolean hasUnlockedSubskill(Player player, AbstractSubSkill abstractSubSkill) - { + public static boolean hasUnlockedSubskill(Player player, AbstractSubSkill abstractSubSkill) { int curRank = getRank(player, abstractSubSkill); //-1 means the skill has no unlockable levels and is therefor unlocked @@ -123,46 +112,46 @@ public class RankUtils { /** * Returns whether or not the player has reached the specified rank in target subskill - * @param rank the target rank - * @param player the player + * + * @param rank the target rank + * @param player the player * @param subSkillType the target subskill * @return true if the player is at least that rank in this subskill */ - public static boolean hasReachedRank(int rank, Player player, SubSkillType subSkillType) - { + public static boolean hasReachedRank(int rank, Player player, SubSkillType subSkillType) { return getRank(player, subSkillType) >= rank; } /** * Returns whether or not the player has reached the specified rank in target subskill - * @param rank the target rank - * @param player the player + * + * @param rank the target rank + * @param player the player * @param abstractSubSkill the target subskill * @return true if the player is at least that rank in this subskill */ - public static boolean hasReachedRank(int rank, Player player, AbstractSubSkill abstractSubSkill) - { + public static boolean hasReachedRank(int rank, Player player, AbstractSubSkill abstractSubSkill) { return getRank(player, abstractSubSkill) >= rank; } /** * Gets the current rank of the subskill for the player - * @param player The player in question + * + * @param player The player in question * @param subSkillType Target subskill * @return The rank the player currently has achieved in this skill. -1 for skills without ranks. */ - public static int getRank(Player player, SubSkillType subSkillType) - { + public static int getRank(Player player, SubSkillType subSkillType) { String skillName = subSkillType.toString(); int numRanks = subSkillType.getNumRanks(); - if(subSkillRanks == null) + if (subSkillRanks == null) subSkillRanks = new HashMap<>(); - if(numRanks == 0) + if (numRanks == 0) return -1; //-1 Means the skill doesn't have ranks - if(subSkillRanks.get(skillName) == null && numRanks > 0) + if (subSkillRanks.get(skillName) == null && numRanks > 0) addRanks(subSkillType); //Get our rank map @@ -171,18 +160,17 @@ public class RankUtils { //Skill level of parent skill int currentSkillLevel = UserManager.getPlayer(player).getSkillLevel(subSkillType.getParentSkill()); - for(int i = 0; i < numRanks; i++) - { + for (int i = 0; i < numRanks; i++) { //Compare against the highest to lowest rank in that order - int rank = numRanks-i; + int rank = numRanks - i; int unlockLevel = getRankUnlockLevel(subSkillType, rank); //If we check all ranks and still cannot unlock the skill, we return rank 0 - if(rank == 0) + if (rank == 0) return 0; //True if our skill level can unlock the current rank - if(currentSkillLevel >= unlockLevel) + if (currentSkillLevel >= unlockLevel) return rank; } @@ -191,22 +179,22 @@ public class RankUtils { /** * Gets the current rank of the subskill for the player - * @param player The player in question + * + * @param player The player in question * @param abstractSubSkill Target subskill * @return The rank the player currently has achieved in this skill. -1 for skills without ranks. */ - public static int getRank(Player player, AbstractSubSkill abstractSubSkill) - { + public static int getRank(Player player, AbstractSubSkill abstractSubSkill) { String skillName = abstractSubSkill.getConfigKeyName(); int numRanks = abstractSubSkill.getNumRanks(); - if(subSkillRanks == null) + if (subSkillRanks == null) subSkillRanks = new HashMap<>(); - if(numRanks == 0) + if (numRanks == 0) return -1; //-1 Means the skill doesn't have ranks - if(subSkillRanks.get(skillName) == null && numRanks > 0) + if (subSkillRanks.get(skillName) == null && numRanks > 0) addRanks(abstractSubSkill); //Get our rank map @@ -215,18 +203,17 @@ public class RankUtils { //Skill level of parent skill int currentSkillLevel = UserManager.getPlayer(player).getSkillLevel(abstractSubSkill.getPrimarySkill()); - for(int i = 0; i < numRanks; i++) - { + for (int i = 0; i < numRanks; i++) { //Compare against the highest to lowest rank in that order - int rank = numRanks-i; + int rank = numRanks - i; int unlockLevel = getRankUnlockLevel(abstractSubSkill, rank); //If we check all ranks and still cannot unlock the skill, we return rank 0 - if(rank == 0) + if (rank == 0) return 0; //True if our skill level can unlock the current rank - if(currentSkillLevel >= unlockLevel) + if (currentSkillLevel >= unlockLevel) return rank; } @@ -235,11 +222,11 @@ public class RankUtils { /** * Adds ranks to our map + * * @param abstractSubSkill The subskill to add ranks for - * @param rank The rank to add + * @param rank The rank to add */ - private static void addRank(AbstractSubSkill abstractSubSkill, int rank) - { + private static void addRank(AbstractSubSkill abstractSubSkill, int rank) { initMaps(abstractSubSkill.getConfigKeyName()); HashMap rankMap = subSkillRanks.get(abstractSubSkill.getConfigKeyName()); @@ -248,8 +235,7 @@ public class RankUtils { } @Deprecated - private static void addRank(SubSkillType subSkillType, int rank) - { + private static void addRank(SubSkillType subSkillType, int rank) { initMaps(subSkillType.toString()); HashMap rankMap = subSkillRanks.get(subSkillType.toString()); @@ -284,68 +270,65 @@ public class RankUtils { /** * Gets the unlock level for a specific rank in a subskill + * * @param subSkillType The target subskill - * @param rank The target rank + * @param rank The target rank * @return The level at which this rank unlocks */ @Deprecated - public static int getRankUnlockLevel(SubSkillType subSkillType, int rank) - { + public static int getRankUnlockLevel(SubSkillType subSkillType, int rank) { return RankConfig.getInstance().getSubSkillUnlockLevel(subSkillType, rank); } - public static int getRankUnlockLevel(AbstractSubSkill abstractSubSkill, int rank) - { + public static int getRankUnlockLevel(AbstractSubSkill abstractSubSkill, int rank) { return RankConfig.getInstance().getSubSkillUnlockLevel(abstractSubSkill, rank); } /** * Get the level at which a skill is unlocked for a player (this is the first rank of a skill) + * * @param subSkillType target subskill * @return The unlock requirements for rank 1 in this skill */ - public static int getUnlockLevel(SubSkillType subSkillType) - { + public static int getUnlockLevel(SubSkillType subSkillType) { return RankConfig.getInstance().getSubSkillUnlockLevel(subSkillType, 1); } /** * Get the level at which a skill is unlocked for a player (this is the first rank of a skill) + * * @param abstractSubSkill target subskill * @return The unlock requirements for rank 1 in this skill */ - public static int getUnlockLevel(AbstractSubSkill abstractSubSkill) - { + public static int getUnlockLevel(AbstractSubSkill abstractSubSkill) { return RankConfig.getInstance().getSubSkillUnlockLevel(abstractSubSkill, 1); } /** * Get the highest rank of a subskill + * * @param subSkillType target subskill * @return the last rank of a subskill */ - public static int getHighestRank(SubSkillType subSkillType) - { + public static int getHighestRank(SubSkillType subSkillType) { return subSkillType.getNumRanks(); } - public static String getHighestRankStr(SubSkillType subSkillType) - { + public static String getHighestRankStr(SubSkillType subSkillType) { return String.valueOf(subSkillType.getNumRanks()); } /** * Get the highest rank of a subskill + * * @param abstractSubSkill target subskill * @return the last rank of a subskill */ - public static int getHighestRank(AbstractSubSkill abstractSubSkill) - { + public static int getHighestRank(AbstractSubSkill abstractSubSkill) { return abstractSubSkill.getNumRanks(); } - public static int getSuperAbilityUnlockRequirement(SuperAbilityType superAbilityType) - { + public static int getSuperAbilityUnlockRequirement(SuperAbilityType superAbilityType) { return getRankUnlockLevel(superAbilityType.getSubSkillTypeDefinition(), 1); } } \ No newline at end of file diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java index bb28f14c0..28892a5f4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java @@ -3,20 +3,20 @@ package com.gmail.nossr50.core.util.skills; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.skills.HiddenConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.core.util.Misc; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.util.ItemUtils; +import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.core.util.StringUtils; import com.gmail.nossr50.core.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.mcMMO; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; @@ -53,9 +53,8 @@ public class SkillUtils { int length; - if(abilityLengthCap > 0) - { - length = (int) Math.min(abilityLengthCap, 2 + (skillValue / abilityLengthVar)); + if (abilityLengthCap > 0) { + length = (int) Math.min(abilityLengthCap, 2 + (skillValue / abilityLengthVar)); } else { length = 2 + (int) (skillValue / abilityLengthVar); } @@ -66,7 +65,7 @@ public class SkillUtils { length = Math.min(length, maxLength); } - return new String[] { String.valueOf(length), String.valueOf(enduranceLength) }; + return new String[]{String.valueOf(length), String.valueOf(enduranceLength)}; } /* @@ -79,7 +78,7 @@ public class SkillUtils { int currentFoodLevel = player.getFoodLevel(); int foodChange = eventFoodLevel - currentFoodLevel; - foodChange+=curRank; + foodChange += curRank; return currentFoodLevel + foodChange; } @@ -88,9 +87,8 @@ public class SkillUtils { * Calculate the time remaining until the cooldown expires. * * @param deactivatedTimeStamp Time of deactivation - * @param cooldown The length of the cooldown - * @param player The Player to check for cooldown perks - * + * @param cooldown The length of the cooldown + * @param player The Player to check for cooldown perks * @return the number of seconds remaining before the cooldown expires */ public static int calculateTimeLeft(long deactivatedTimeStamp, int cooldown, Player player) { @@ -102,8 +100,7 @@ public class SkillUtils { * This does NOT account for cooldown perks! * * @param deactivatedTimeStamp Time of deactivation in seconds - * @param cooldown The length of the cooldown in seconds - * + * @param cooldown The length of the cooldown in seconds * @return true if the cooldown is expired */ public static boolean cooldownExpired(long deactivatedTimeStamp, int cooldown) { @@ -151,8 +148,7 @@ public class SkillUtils { itemMeta.setLore(itemLore); heldItem.setItemMeta(itemMeta); - } - else { + } else { int duration = 0; int amplifier = 0; @@ -174,9 +170,8 @@ public class SkillUtils { int ticks; - if(abilityLengthCap > 0) - { - ticks = PerksUtils.handleActivationPerks(player, Math.min(abilityLengthCap, 2 + (mcMMOPlayer.getSkillLevel(skill) / abilityLengthVar)), + if (abilityLengthCap > 0) { + ticks = PerksUtils.handleActivationPerks(player, Math.min(abilityLengthCap, 2 + (mcMMOPlayer.getSkillLevel(skill) / abilityLengthVar)), skill.getAbility().getMaxLength()) * Misc.TICK_CONVERSION_FACTOR; } else { ticks = PerksUtils.handleActivationPerks(player, 2 + ((mcMMOPlayer.getSkillLevel(skill)) / abilityLengthVar), @@ -213,8 +208,7 @@ public class SkillUtils { if (efficiencyLevel <= AdvancedConfig.getInstance().getEnchantBuff()) { itemMeta.removeEnchant(Enchantment.DIG_SPEED); - } - else { + } else { itemMeta.addEnchant(Enchantment.DIG_SPEED, efficiencyLevel - AdvancedConfig.getInstance().getEnchantBuff(), true); } @@ -231,9 +225,9 @@ public class SkillUtils { /** * Modify the durability of an ItemStack. * - * @param itemStack The ItemStack which durability should be modified + * @param itemStack The ItemStack which durability should be modified * @param durabilityModifier the amount to modify the durability by - * @param maxDamageModifier the amount to adjust the max damage by + * @param maxDamageModifier the amount to adjust the max damage by */ public static void handleDurabilityChange(ItemStack itemStack, int durabilityModifier, double maxDamageModifier) { if (itemStack.hasItemMeta() && itemStack.getItemMeta().isUnbreakable()) { @@ -260,26 +254,19 @@ public class SkillUtils { protected static Material getRepairAndSalvageItem(ItemStack inHand) { if (ItemUtils.isDiamondTool(inHand) || ItemUtils.isDiamondArmor(inHand)) { return Material.DIAMOND; - } - else if (ItemUtils.isGoldTool(inHand) || ItemUtils.isGoldArmor(inHand)) { + } else if (ItemUtils.isGoldTool(inHand) || ItemUtils.isGoldArmor(inHand)) { return Material.GOLD_INGOT; - } - else if (ItemUtils.isIronTool(inHand) || ItemUtils.isIronArmor(inHand)) { + } else if (ItemUtils.isIronTool(inHand) || ItemUtils.isIronArmor(inHand)) { return Material.IRON_INGOT; - } - else if (ItemUtils.isStoneTool(inHand)) { + } else if (ItemUtils.isStoneTool(inHand)) { return Material.COBBLESTONE; - } - else if (ItemUtils.isWoodTool(inHand)) { + } else if (ItemUtils.isWoodTool(inHand)) { return Material.OAK_WOOD; - } - else if (ItemUtils.isLeatherArmor(inHand)) { + } else if (ItemUtils.isLeatherArmor(inHand)) { return Material.LEATHER; - } - else if (ItemUtils.isStringTool(inHand)) { + } else if (ItemUtils.isStringTool(inHand)) { return Material.STRING; - } - else { + } else { return null; } } @@ -308,8 +295,7 @@ public class SkillUtils { quantity += ingredient.getAmount(); } } - } - else if (recipe instanceof ShapedRecipe) { + } else if (recipe instanceof ShapedRecipe) { for (ItemStack ingredient : ((ShapedRecipe) recipe).getIngredientMap().values()) { if (ingredient != null && (repairMaterial == null || ingredient.getType() == repairMaterial) && (repairMetadata == -1 || ingredient.getType().equals(repairMaterial))) { quantity += ingredient.getAmount(); diff --git a/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundManager.java b/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundManager.java index e361d1dff..14984334c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundManager.java @@ -11,47 +11,43 @@ import org.bukkit.entity.Player; public class SoundManager { /** * Sends a sound to the player + * * @param soundType the type of sound */ - public static void sendSound(Player player, Location location, SoundType soundType) - { - if(SoundConfig.getInstance().getIsEnabled(soundType)) + public static void sendSound(Player player, Location location, SoundType soundType) { + if (SoundConfig.getInstance().getIsEnabled(soundType)) player.playSound(location, getSound(soundType), SoundCategory.MASTER, getVolume(soundType), getPitch(soundType)); } - public static void sendCategorizedSound(Player player, Location location, SoundType soundType, SoundCategory soundCategory) - { - if(SoundConfig.getInstance().getIsEnabled(soundType)) + public static void sendCategorizedSound(Player player, Location location, SoundType soundType, SoundCategory soundCategory) { + if (SoundConfig.getInstance().getIsEnabled(soundType)) player.playSound(location, getSound(soundType), soundCategory, getVolume(soundType), getPitch(soundType)); } - public static void sendCategorizedSound(Player player, Location location, SoundType soundType, SoundCategory soundCategory, float pitchModifier) - { + public static void sendCategorizedSound(Player player, Location location, SoundType soundType, SoundCategory soundCategory, float pitchModifier) { float totalPitch = Math.min(2.0F, (getPitch(soundType) + pitchModifier)); - if(SoundConfig.getInstance().getIsEnabled(soundType)) + if (SoundConfig.getInstance().getIsEnabled(soundType)) player.playSound(location, getSound(soundType), soundCategory, getVolume(soundType), totalPitch); } - public static void worldSendSound(World world, Location location, SoundType soundType) - { - if(SoundConfig.getInstance().getIsEnabled(soundType)) + public static void worldSendSound(World world, Location location, SoundType soundType) { + if (SoundConfig.getInstance().getIsEnabled(soundType)) world.playSound(location, getSound(soundType), getVolume(soundType), getPitch(soundType)); } /** * All volume is multiplied by the master volume to get its final value + * * @param soundType target soundtype * @return the volume for this soundtype */ - private static float getVolume(SoundType soundType) - { + private static float getVolume(SoundType soundType) { return SoundConfig.getInstance().getVolume(soundType) * SoundConfig.getInstance().getMasterVolume(); } - private static float getPitch(SoundType soundType) - { - if(soundType == SoundType.FIZZ) + private static float getPitch(SoundType soundType) { + if (soundType == SoundType.FIZZ) return getFizzPitch(); else if (soundType == SoundType.POP) return getPopPitch(); @@ -59,10 +55,8 @@ public class SoundManager { return SoundConfig.getInstance().getPitch(soundType); } - private static Sound getSound(SoundType soundType) - { - switch(soundType) - { + private static Sound getSound(SoundType soundType) { + switch (soundType) { case ANVIL: return Sound.BLOCK_ANVIL_PLACE; case ITEM_BREAK: diff --git a/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundType.java b/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundType.java index ddffdcd08..99ee7ef07 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundType.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundType.java @@ -16,9 +16,8 @@ public enum SoundType { BLEED, TIRED; - public boolean usesCustomPitch() - { - switch(this){ + public boolean usesCustomPitch() { + switch (this) { case POP: case FIZZ: return true; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/upgrade/UpgradeManager.java b/core/src/main/java/com/gmail/nossr50/core/util/upgrade/UpgradeManager.java index 52af72fa0..2a4a0e70a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/upgrade/UpgradeManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/upgrade/UpgradeManager.java @@ -22,7 +22,6 @@ public class UpgradeManager extends ConfigLoader { * Check if the given {@link UpgradeType} is necessary. * * @param type Upgrade type to check - * * @return true if plugin data needs to have the given upgrade */ public boolean shouldUpgrade(final UpgradeType type) { @@ -46,8 +45,7 @@ public class UpgradeManager extends ConfigLoader { try { config.save(getFile()); - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/uuid/UUIDFetcher.java b/core/src/main/java/com/gmail/nossr50/core/util/uuid/UUIDFetcher.java index 0da94b63a..5fa9e7452 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/uuid/UUIDFetcher.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/uuid/UUIDFetcher.java @@ -30,28 +30,6 @@ public class UUIDFetcher implements Callable> { this(names, true); } - public Map call() throws Exception { - Map uuidMap = new HashMap(); - int requests = (int) Math.ceil(names.size() / PROFILES_PER_REQUEST); - for (int i = 0; i < requests; i++) { - HttpURLConnection connection = createConnection(); - String body = JSONArray.toJSONString(names.subList(i * PROFILES_PER_REQUEST, Math.min((i + 1) * PROFILES_PER_REQUEST, names.size()))); - writeBody(connection, body); - JSONArray array = (JSONArray) jsonParser.parse(new InputStreamReader(connection.getInputStream())); - for (Object profile : array) { - JSONObject jsonProfile = (JSONObject) profile; - String id = (String) jsonProfile.get("id"); - String name = (String) jsonProfile.get("name"); - UUID uuid = UUIDFetcher.getUUID(id); - uuidMap.put(name, uuid); - } - if (rateLimiting && i != requests - 1) { - Thread.sleep(RATE_LIMIT); - } - } - return uuidMap; - } - private static void writeBody(HttpURLConnection connection, String body) throws Exception { OutputStream stream = connection.getOutputStream(); stream.write(body.getBytes()); @@ -94,4 +72,26 @@ public class UUIDFetcher implements Callable> { public static UUID getUUIDOf(String name) throws Exception { return new UUIDFetcher(Arrays.asList(name)).call().get(name); } + + public Map call() throws Exception { + Map uuidMap = new HashMap(); + int requests = (int) Math.ceil(names.size() / PROFILES_PER_REQUEST); + for (int i = 0; i < requests; i++) { + HttpURLConnection connection = createConnection(); + String body = JSONArray.toJSONString(names.subList(i * PROFILES_PER_REQUEST, Math.min((i + 1) * PROFILES_PER_REQUEST, names.size()))); + writeBody(connection, body); + JSONArray array = (JSONArray) jsonParser.parse(new InputStreamReader(connection.getInputStream())); + for (Object profile : array) { + JSONObject jsonProfile = (JSONObject) profile; + String id = (String) jsonProfile.get("id"); + String name = (String) jsonProfile.get("name"); + UUID uuid = UUIDFetcher.getUUID(id); + uuidMap.put(name, uuid); + } + if (rateLimiting && i != requests - 1) { + Thread.sleep(RATE_LIMIT); + } + } + return uuidMap; + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardManager.java b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardManager.java index 9cd12f58d..41d0de8ea 100644 --- a/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardManager.java @@ -16,21 +16,19 @@ public class WorldGuardManager { private static WorldGuardManager instance; private WorldGuardPlugin worldGuardPluginRef; + public WorldGuardManager() { + + } + public static WorldGuardManager getInstance() { - if(instance == null) + if (instance == null) instance = new WorldGuardManager(); return instance; } - public WorldGuardManager() - { - - } - - public boolean hasMainFlag(Player player) - { - if(player == null) + public boolean hasMainFlag(Player player) { + if (player == null) return false; BukkitPlayer localPlayer = BukkitAdapter.adapt(player); @@ -46,9 +44,8 @@ public class WorldGuardManager { return query.testState(loc, WorldGuardPlugin.inst().wrapPlayer(player), WorldGuardFlags.MCMMO_ENABLE_WG_FLAG); } - public boolean hasXPFlag(Player player) - { - if(player == null) + public boolean hasXPFlag(Player player) { + if (player == null) return false; BukkitPlayer localPlayer = BukkitAdapter.adapt(player); @@ -75,9 +72,8 @@ public class WorldGuardManager { return worldGuardPluginRef; } - public void registerFlags() - { - if(getWorldGuard() == null) + public void registerFlags() { + if (getWorldGuard() == null) return; FlagRegistry registry = WorldGuard.getInstance().getFlagRegistry(); diff --git a/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardUtils.java b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardUtils.java index 6b19963a0..6aae57a0f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardUtils.java @@ -10,8 +10,7 @@ public class WorldGuardUtils { private static boolean isLoaded = false; private static boolean hasWarned = false; - public static boolean isWorldGuardLoaded() - { + public static boolean isWorldGuardLoaded() { WorldGuardPlugin plugin = getWorldGuard(); try { @@ -30,25 +29,21 @@ public class WorldGuardUtils { return true; } - private static WorldGuardPlugin getWorldGuard() - { - if(isLoaded) + private static WorldGuardPlugin getWorldGuard() { + if (isLoaded) return worldGuardPluginRef; Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin("WorldGuard"); - if(plugin instanceof WorldGuardPlugin) - { - if(plugin.getDescription().getVersion().startsWith("7")) - { + if (plugin instanceof WorldGuardPlugin) { + if (plugin.getDescription().getVersion().startsWith("7")) { worldGuardPluginRef = (WorldGuardPlugin) plugin; - if(worldGuardPluginRef != null) + if (worldGuardPluginRef != null) isLoaded = true; } else { - if(!hasWarned) - { + if (!hasWarned) { mcMMO.p.getLogger().severe("mcMMO only supports WorldGuard version 7! Make sure you have WG 7! This warning will not appear again."); hasWarned = true; } diff --git a/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java b/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java index 5e1e942de..bf4abe5f1 100644 --- a/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java +++ b/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java @@ -36,8 +36,7 @@ public class ZipLibrary { if (BACKUP_DIR.mkdir()) { mcMMO.p.debug("Created Backup Directory."); } - } - catch (Exception e) { + } catch (Exception e) { mcMMO.p.getLogger().severe(e.toString()); } @@ -73,8 +72,7 @@ public class ZipLibrary { for (File source : sources) { if (source.isDirectory()) { zipDir(zipOut, "", source); - } - else { + } else { zipFile(zipOut, "", source); } } @@ -104,8 +102,7 @@ public class ZipLibrary { for (File source : files) { if (source.isDirectory()) { zipDir(zos, path, source); - } - else { + } else { zipFile(zos, path, source); } } From 83c1dab96345149e3bcb6e380999198b15f22b8f Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sun, 10 Feb 2019 00:31:35 -0800 Subject: [PATCH 07/28] Adding Configurable lib --- core/build.gradle.kts | 9 +++++++++ .../nossr50/core/config/{skills => }/AdvancedConfig.java | 0 .../core/config/{skills => }/AutoUpdateConfigLoader.java | 0 .../gmail/nossr50/core/config/{skills => }/Config.java | 2 +- .../nossr50/core/config/{skills => }/ConfigLoader.java | 0 .../core/config/{skills => }/CoreSkillsConfig.java | 0 .../nossr50/core/config/{skills => }/HiddenConfig.java | 0 .../nossr50/core/config/{skills => }/RankConfig.java | 0 .../nossr50/core/config/{skills => }/SoundConfig.java | 0 .../nossr50/core/config/{skills => }/WorldBlacklist.java | 0 10 files changed, 10 insertions(+), 1 deletion(-) rename core/src/main/java/com/gmail/nossr50/core/config/{skills => }/AdvancedConfig.java (100%) rename core/src/main/java/com/gmail/nossr50/core/config/{skills => }/AutoUpdateConfigLoader.java (100%) rename core/src/main/java/com/gmail/nossr50/core/config/{skills => }/Config.java (99%) rename core/src/main/java/com/gmail/nossr50/core/config/{skills => }/ConfigLoader.java (100%) rename core/src/main/java/com/gmail/nossr50/core/config/{skills => }/CoreSkillsConfig.java (100%) rename core/src/main/java/com/gmail/nossr50/core/config/{skills => }/HiddenConfig.java (100%) rename core/src/main/java/com/gmail/nossr50/core/config/{skills => }/RankConfig.java (100%) rename core/src/main/java/com/gmail/nossr50/core/config/{skills => }/SoundConfig.java (100%) rename core/src/main/java/com/gmail/nossr50/core/config/{skills => }/WorldBlacklist.java (100%) diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 3b371f30b..a1611f543 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -1,3 +1,12 @@ +repositories { + // Repo containing the Configurable library + maven("https://repo.spongepowered.org/maven") +} + +dependencies { + compile("org.spongepowered", "configurate-hocon", "3.6") // Configurable (config library from Sponge) +} + plugins { java } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/AdvancedConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java similarity index 100% rename from core/src/main/java/com/gmail/nossr50/core/config/skills/AdvancedConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/AutoUpdateConfigLoader.java b/core/src/main/java/com/gmail/nossr50/core/config/AutoUpdateConfigLoader.java similarity index 100% rename from core/src/main/java/com/gmail/nossr50/core/config/skills/AutoUpdateConfigLoader.java rename to core/src/main/java/com/gmail/nossr50/core/config/AutoUpdateConfigLoader.java diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/Config.java b/core/src/main/java/com/gmail/nossr50/core/config/Config.java similarity index 99% rename from core/src/main/java/com/gmail/nossr50/core/config/skills/Config.java rename to core/src/main/java/com/gmail/nossr50/core/config/Config.java index 50aeb0b10..5735557fe 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/Config.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/Config.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.config.skills; +package com.gmail.nossr50.core.config; import com.gmail.nossr50.core.data.database.SQLDatabaseManager; import com.gmail.nossr50.core.mcmmo.MobHealthbarType; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/ConfigLoader.java b/core/src/main/java/com/gmail/nossr50/core/config/ConfigLoader.java similarity index 100% rename from core/src/main/java/com/gmail/nossr50/core/config/skills/ConfigLoader.java rename to core/src/main/java/com/gmail/nossr50/core/config/ConfigLoader.java diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/CoreSkillsConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/CoreSkillsConfig.java similarity index 100% rename from core/src/main/java/com/gmail/nossr50/core/config/skills/CoreSkillsConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/CoreSkillsConfig.java diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/HiddenConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/HiddenConfig.java similarity index 100% rename from core/src/main/java/com/gmail/nossr50/core/config/skills/HiddenConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/HiddenConfig.java diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/RankConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/RankConfig.java similarity index 100% rename from core/src/main/java/com/gmail/nossr50/core/config/skills/RankConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/RankConfig.java diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/SoundConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/SoundConfig.java similarity index 100% rename from core/src/main/java/com/gmail/nossr50/core/config/skills/SoundConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/SoundConfig.java diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/WorldBlacklist.java b/core/src/main/java/com/gmail/nossr50/core/config/WorldBlacklist.java similarity index 100% rename from core/src/main/java/com/gmail/nossr50/core/config/skills/WorldBlacklist.java rename to core/src/main/java/com/gmail/nossr50/core/config/WorldBlacklist.java From d45aac713f2fd76b012460b91c91bbc6f2e2b08d Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sun, 10 Feb 2019 00:31:53 -0800 Subject: [PATCH 08/28] Moving Stuff Around Pt 3 --- .../gmail/nossr50/commands/MHDCommand.java | 2 +- .../gmail/nossr50/commands/McmmoCommand.java | 2 +- .../nossr50/commands/McscoreboardCommand.java | 2 +- .../gmail/nossr50/commands/XprateCommand.java | 2 +- .../nossr50/commands/chat/ChatCommand.java | 2 +- .../commands/chat/PartyChatCommand.java | 2 +- .../commands/database/McpurgeCommand.java | 2 +- .../commands/database/MmoshowdbCommand.java | 2 +- .../commands/hardcore/HardcoreCommand.java | 2 +- .../commands/hardcore/VampirismCommand.java | 2 +- .../commands/party/PartyInfoCommand.java | 2 +- .../commands/party/PartyInviteCommand.java | 2 +- .../commands/party/PartyItemShareCommand.java | 2 +- .../commands/party/PartyXpShareCommand.java | 2 +- .../party/alliance/PartyAllianceCommand.java | 2 +- .../party/teleport/PtpAcceptCommand.java | 2 +- .../commands/party/teleport/PtpCommand.java | 4 +- .../commands/player/InspectCommand.java | 2 +- .../commands/player/MccooldownCommand.java | 2 +- .../commands/player/McrankCommand.java | 2 +- .../commands/player/McstatsCommand.java | 2 +- .../nossr50/commands/player/MctopCommand.java | 2 +- .../commands/skills/FishingCommand.java | 2 +- .../nossr50/commands/skills/SkillCommand.java | 4 +- .../commands/skills/SwordsCommand.java | 2 +- .../nossr50/listeners/BlockListener.java | 6 +-- .../nossr50/listeners/EntityListener.java | 6 +-- .../nossr50/listeners/InventoryListener.java | 4 +- .../nossr50/listeners/PlayerListener.java | 4 +- .../gmail/nossr50/listeners/SelfListener.java | 2 +- .../nossr50/listeners/WorldListener.java | 2 +- .../main/java/com/gmail/nossr50/mcMMO.java | 2 +- .../gmail/nossr50/core/api/AbilityAPI.java | 8 ++-- .../com/gmail/nossr50/core/api/ChatAPI.java | 11 ++--- .../gmail/nossr50/core/api/ExperienceAPI.java | 12 ++--- .../com/gmail/nossr50/core/api/PartyAPI.java | 2 +- .../McMMOPlayerNotFoundException.java | 4 +- .../nossr50/core/chat/AdminChatManager.java | 2 +- .../nossr50/core/chat/PartyChatManager.java | 2 +- .../nossr50/core/config/AdvancedConfig.java | 2 +- .../core/config/AutoUpdateConfigLoader.java | 2 +- .../com/gmail/nossr50/core/config/Config.java | 14 ++---- .../nossr50/core/config/ConfigLoader.java | 2 +- .../nossr50/core/config/CoreSkillsConfig.java | 2 +- .../nossr50/core/config/HiddenConfig.java | 2 +- .../gmail/nossr50/core/config/RankConfig.java | 2 +- .../nossr50/core/config/SoundConfig.java | 2 +- .../nossr50/core/config/WorldBlacklist.java | 2 +- .../config/experience/ExperienceConfig.java | 2 +- .../core/config/mods/CustomArmorConfig.java | 2 +- .../core/config/mods/CustomBlockConfig.java | 2 +- .../core/config/mods/CustomEntityConfig.java | 2 +- .../core/config/mods/CustomToolConfig.java | 2 +- .../core/config/party/ItemWeightConfig.java | 2 +- .../core/config/treasure/TreasureConfig.java | 2 +- .../gmail/nossr50/core/data/UserManager.java | 8 +--- .../blockmeta/ChunkletManagerFactory.java | 2 +- .../chunkmeta/ChunkManagerFactory.java | 2 +- .../conversion/BlockStoreConversionMain.java | 2 +- .../BlockStoreConversionXDirectory.java | 2 +- .../nossr50/core/datatypes/party/Party.java | 2 +- .../core/datatypes/party/PartyFeature.java | 2 +- .../datatypes/party/PartyTeleportRecord.java | 2 +- .../core/datatypes/player/McMMOPlayer.java | 6 +-- .../core/datatypes/player/PlayerProfile.java | 4 +- .../nossr50/core/locale/LocaleLoader.java | 2 +- .../nossr50/core/mcmmo/entity/Living.java | 8 +++- .../nossr50/core/mcmmo/entity/Player.java | 2 + .../nossr50/core/party/PartyManager.java | 2 +- .../nossr50/core/party/ShareHandler.java | 2 +- .../runnables/backups/CleanBackupsTask.java | 2 +- .../commands/McrankCommandDisplayTask.java | 2 +- .../commands/MctopCommandDisplayTask.java | 2 +- .../database/UUIDUpdateAsyncTask.java | 2 +- .../runnables/database/UserPurgeTask.java | 2 +- .../runnables/items/ChimaeraWingWarmup.java | 2 +- .../runnables/items/TeleportationWarmup.java | 2 +- .../runnables/party/PartyAutoKickTask.java | 2 +- .../core/runnables/party/PartyChatTask.java | 2 +- .../player/PlayerProfileLoadingTask.java | 2 +- .../runnables/skills/AbilityDisableTask.java | 2 +- .../core/runnables/skills/BleedContainer.java | 9 ++-- .../core/runnables/skills/BleedTimerTask.java | 47 +++++++++---------- .../core/runnables/skills/ToolLowerTask.java | 2 +- .../nossr50/core/skills/PrimarySkillType.java | 2 +- .../nossr50/core/skills/SuperAbilityType.java | 2 +- .../core/skills/child/ChildConfig.java | 2 +- .../core/skills/child/salvage/Salvage.java | 4 +- .../skills/child/salvage/SalvageManager.java | 4 +- .../core/skills/child/smelting/Smelting.java | 2 +- .../child/smelting/SmeltingManager.java | 2 +- .../skills/primary/acrobatics/Acrobatics.java | 4 +- .../core/skills/primary/alchemy/Alchemy.java | 2 +- .../core/skills/primary/archery/Archery.java | 2 +- .../core/skills/primary/axes/Axes.java | 2 +- .../primary/excavation/ExcavationManager.java | 2 +- .../core/skills/primary/fishing/Fishing.java | 2 +- .../primary/fishing/FishingManager.java | 4 +- .../primary/herbalism/HerbalismManager.java | 2 +- .../skills/primary/mining/BlastMining.java | 4 +- .../skills/primary/mining/MiningManager.java | 4 +- .../skills/primary/repair/ArcaneForging.java | 2 +- .../core/skills/primary/repair/Repair.java | 4 +- .../skills/primary/repair/RepairManager.java | 4 +- .../core/skills/primary/swords/Swords.java | 2 +- .../core/skills/primary/taming/Taming.java | 2 +- .../skills/primary/taming/TamingManager.java | 4 +- .../primary/taming/TrackedTamingEntity.java | 2 +- .../core/skills/primary/unarmed/Unarmed.java | 2 +- .../primary/unarmed/UnarmedManager.java | 2 +- .../primary/woodcutting/Woodcutting.java | 2 +- .../skills/subskills/AbstractSubSkill.java | 2 +- .../skills/subskills/acrobatics/Roll.java | 4 +- .../core/skills/treasure/Treasure.java | 2 +- .../gmail/nossr50/core/util/ChimaeraWing.java | 2 +- .../nossr50/core/util/HardcoreManager.java | 2 +- .../gmail/nossr50/core/util/ItemUtils.java | 2 +- .../nossr50/core/util/MobHealthbarUtils.java | 4 +- .../gmail/nossr50/core/util/ModManager.java | 2 +- .../com/gmail/nossr50/core/util/Motd.java | 2 +- .../core/util/TextComponentFactory.java | 4 +- .../commands/CommandRegistrationManager.java | 2 +- .../core/util/commands/CommandUtils.java | 2 +- .../core/util/experience/FormulaManager.java | 2 +- .../core/util/player/NotificationManager.java | 2 +- .../core/util/random/RandomChanceSkill.java | 2 +- .../core/util/random/RandomChanceUtil.java | 2 +- .../util/scoreboards/ScoreboardManager.java | 2 +- .../util/scoreboards/ScoreboardWrapper.java | 2 +- .../core/util/skills/ParticleEffectUtils.java | 2 +- .../nossr50/core/util/skills/RankUtils.java | 2 +- .../nossr50/core/util/skills/SkillUtils.java | 6 +-- .../core/util/sounds/SoundManager.java | 2 +- .../core/util/upgrade/UpgradeManager.java | 2 +- .../shatt/backup/ZipLibrary.java | 2 +- 135 files changed, 210 insertions(+), 213 deletions(-) diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java index 5dfc12ac2..81b005aea 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.data.database.FlatfileDatabaseManager; import com.gmail.nossr50.core.data.database.SQLDatabaseManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java index 104fb5e01..af98e6c95 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.commands.party.PartySubcommandType; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.mcMMO; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McscoreboardCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McscoreboardCommand.java index 47f30be5c..b8f7ea2d0 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McscoreboardCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McscoreboardCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java index d655df001..d9d266b6a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.StringUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java index 4c1c883e8..5b99c27f7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.commands.chat; import com.gmail.nossr50.core.chat.ChatManager; import com.gmail.nossr50.core.chat.ChatManagerFactory; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.party.PartyFeature; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java index 4cd76d299..d29509b90 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands.chat; import com.gmail.nossr50.core.chat.PartyChatManager; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.party.Party; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java index 17d8cca79..a7c676d1a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.database; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/database/MmoshowdbCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/database/MmoshowdbCommand.java index 9b0566825..4023068bf 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/database/MmoshowdbCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/database/MmoshowdbCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.database; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.database.DatabaseManagerFactory; import com.gmail.nossr50.core.locale.LocaleLoader; import com.google.common.collect.ImmutableList; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java index 9d816402f..407d132ca 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.hardcore; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Permissions; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java index b3a19a48c..e29c0cf97 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.hardcore; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Permissions; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java index 944bae118..b2d6b5ffc 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java index facdd9fad..7cf5e4c5a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java index 473d4f637..6ec809a28 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.ItemShareType; import com.gmail.nossr50.core.datatypes.party.Party; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java index 2290132cf..ed5c00dfb 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java index d7f7e07ee..d74643bf8 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.party.alliance; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java index 824d5e7c9..64ff0919d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.party.teleport; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.core.locale.LocaleLoader; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java index 625cc8257..d89166723 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands.party.teleport; -import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.config.skills.WorldBlacklist; +import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.WorldBlacklist; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java index 5bb5384bd..e73fb7e76 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.player; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java index 6a3c06715..36fb59fe8 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.player; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java index 419606632..d1b90bc41 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.player; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java index 64b2fc11d..10e97ca9f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.player; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.commands.CommandUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java index bbefd239a..6fb742aeb 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.player; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java index 4e60a73b7..dc3d711f8 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.config.treasure.TreasureConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.locale.LocaleLoader; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java index 95c21b0ac..6df353563 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java index a202d2f3b..430e31f68 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index e5205b7d7..515dcdf64 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.listeners; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.config.skills.HiddenConfig; -import com.gmail.nossr50.core.config.skills.WorldBlacklist; +import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.HiddenConfig; +import com.gmail.nossr50.core.config.WorldBlacklist; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 59742142c..20e14784c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.listeners; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.config.skills.WorldBlacklist; +import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.WorldBlacklist; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.meta.OldName; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java index c4e071c16..0be341eef 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.listeners; -import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.config.skills.WorldBlacklist; +import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.WorldBlacklist; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.runnables.player.PlayerUpdateInventoryTask; import com.gmail.nossr50.core.skills.PrimarySkillType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 7fc4135d4..0677bfb44 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -4,8 +4,8 @@ import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.chat.ChatManager; import com.gmail.nossr50.core.chat.ChatManagerFactory; import com.gmail.nossr50.core.chat.PartyChatManager; -import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.config.skills.WorldBlacklist; +import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.WorldBlacklist; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.party.Party; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java index f936898a3..74d2d1939 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.listeners; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/WorldListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/WorldListener.java index a533f0238..ffe58ae87 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/WorldListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/WorldListener.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.listeners; -import com.gmail.nossr50.core.config.skills.WorldBlacklist; +import com.gmail.nossr50.core.config.WorldBlacklist; import com.gmail.nossr50.core.data.blockmeta.conversion.BlockStoreConversionMain; import com.gmail.nossr50.mcMMO; import org.bukkit.Chunk; diff --git a/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java b/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java index 836198c74..5b1a998d6 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java @@ -8,7 +8,7 @@ import com.gmail.nossr50.config.mods.ToolConfigManager; import com.gmail.nossr50.config.skills.alchemy.PotionConfig; import com.gmail.nossr50.config.skills.repair.RepairConfigManager; import com.gmail.nossr50.config.skills.salvage.SalvageConfigManager; -import com.gmail.nossr50.core.config.skills.*; +import com.gmail.nossr50.core.config.*; import com.gmail.nossr50.core.config.treasure.TreasureConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.data.blockmeta.chunkmeta.ChunkManager; diff --git a/core/src/main/java/com/gmail/nossr50/core/api/AbilityAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/AbilityAPI.java index ed84f56f3..b2e90ce65 100644 --- a/core/src/main/java/com/gmail/nossr50/core/api/AbilityAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/AbilityAPI.java @@ -2,10 +2,10 @@ package com.gmail.nossr50.core.api; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.mcmmo.entity.Living; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.runnables.skills.BleedTimerTask; import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.runnables.skills.BleedTimerTask; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; public final class AbilityAPI { private AbilityAPI() { @@ -83,7 +83,7 @@ public final class AbilityAPI { UserManager.getPlayer(player).setAbilityDATS(SuperAbilityType.TREE_FELLER, cooldown); } - public static boolean isBleeding(LivingEntity entity) { + public static boolean isBleeding(Living entity) { return BleedTimerTask.isBleeding(entity); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/api/ChatAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/ChatAPI.java index bcdb7b498..2b7ac3ee6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/api/ChatAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/ChatAPI.java @@ -1,13 +1,12 @@ package com.gmail.nossr50.core.api; -import com.gmail.nossr50.chat.ChatManager; -import com.gmail.nossr50.chat.ChatManagerFactory; -import com.gmail.nossr50.chat.PartyChatManager; +import com.gmail.nossr50.core.chat.ChatManager; +import com.gmail.nossr50.core.chat.ChatManagerFactory; +import com.gmail.nossr50.core.chat.PartyChatManager; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; -import com.gmail.nossr50.party.PartyManager; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.party.PartyManager; public final class ChatAPI { private ChatAPI() { diff --git a/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java index d37cb51ac..61617ca00 100644 --- a/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java @@ -1,20 +1,18 @@ package com.gmail.nossr50.core.api; -import com.gmail.nossr50.api.exceptions.*; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.api.exceptions.*; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.mcmmo.block.BlockState; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.child.FamilyTree; -import org.bukkit.block.BlockState; -import org.bukkit.entity.Player; +import com.gmail.nossr50.core.skills.child.FamilyTree; import java.util.ArrayList; import java.util.Set; diff --git a/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java index 99c98ddc9..5149bbe86 100644 --- a/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.api; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.party.Party; diff --git a/core/src/main/java/com/gmail/nossr50/core/api/exceptions/McMMOPlayerNotFoundException.java b/core/src/main/java/com/gmail/nossr50/core/api/exceptions/McMMOPlayerNotFoundException.java index cff599a11..0a89678cc 100644 --- a/core/src/main/java/com/gmail/nossr50/core/api/exceptions/McMMOPlayerNotFoundException.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/exceptions/McMMOPlayerNotFoundException.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.core.api.exceptions; -import org.bukkit.entity.Player; +import com.gmail.nossr50.core.mcmmo.entity.Player; public class McMMOPlayerNotFoundException extends RuntimeException { private static final long serialVersionUID = 761917904993202836L; public McMMOPlayerNotFoundException(Player player) { - super("McMMOPlayer object was not found for: " + player.getName() + " " + player.getUniqueId()); + super("McMMOPlayer object was not found for: " + player.getName() + " " + player.getUUID()); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/chat/AdminChatManager.java b/core/src/main/java/com/gmail/nossr50/core/chat/AdminChatManager.java index 3f85f66b8..bc8e3a5c0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/chat/AdminChatManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/chat/AdminChatManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.chat; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.events.chat.McMMOAdminChatEvent; import org.bukkit.plugin.Plugin; diff --git a/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java b/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java index da8410b73..0c82e9128 100644 --- a/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.chat; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.runnables.party.PartyChatTask; import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java index 6e4dd5155..6424e6725 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.config.skills; +package com.gmail.nossr50.core.config; import com.gmail.nossr50.core.mcmmo.interactions.NotificationType; import com.gmail.nossr50.core.mcmmo.skills.SubSkillType; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/AutoUpdateConfigLoader.java b/core/src/main/java/com/gmail/nossr50/core/config/AutoUpdateConfigLoader.java index da46aa542..16dd833c4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/AutoUpdateConfigLoader.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/AutoUpdateConfigLoader.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.config.skills; +package com.gmail.nossr50.core.config; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/Config.java b/core/src/main/java/com/gmail/nossr50/core/config/Config.java index 5735557fe..921fb362f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/Config.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/Config.java @@ -1,15 +1,11 @@ package com.gmail.nossr50.core.config; import com.gmail.nossr50.core.data.database.SQLDatabaseManager; -import com.gmail.nossr50.core.mcmmo.MobHealthbarType; -import com.gmail.nossr50.core.mcmmo.party.PartyFeature; -import com.gmail.nossr50.core.mcmmo.skills.PrimarySkillType; -import com.gmail.nossr50.core.mcmmo.skills.SuperAbilityType; -import com.gmail.nossr50.util.StringUtils; -import org.bukkit.Material; -import org.bukkit.block.data.BlockData; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.entity.EntityType; +import com.gmail.nossr50.core.datatypes.party.PartyFeature; +import com.gmail.nossr50.core.skills.MobHealthbarType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SuperAbilityType; +import com.gmail.nossr50.core.util.StringUtils; import java.util.ArrayList; import java.util.List; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/ConfigLoader.java b/core/src/main/java/com/gmail/nossr50/core/config/ConfigLoader.java index 56196ab17..dbe24ef73 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/ConfigLoader.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/ConfigLoader.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.config.skills; +package com.gmail.nossr50.core.config; import com.gmail.nossr50.mcMMO; import org.bukkit.configuration.file.FileConfiguration; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/CoreSkillsConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/CoreSkillsConfig.java index 7283bc759..613000373 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/CoreSkillsConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/CoreSkillsConfig.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.config.skills; +package com.gmail.nossr50.core.config; import com.gmail.nossr50.core.mcmmo.skills.PrimarySkillType; import com.gmail.nossr50.core.mcmmo.skills.subskills.AbstractSubSkill; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/HiddenConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/HiddenConfig.java index 497bcfc44..978097b72 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/HiddenConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/HiddenConfig.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.config.skills; +package com.gmail.nossr50.core.config; import com.gmail.nossr50.mcMMO; import org.bukkit.configuration.file.YamlConfiguration; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/RankConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/RankConfig.java index 3bb05e439..131e32acf 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/RankConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/RankConfig.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.config.skills; +package com.gmail.nossr50.core.config; import com.gmail.nossr50.core.mcmmo.skills.SubSkillType; import com.gmail.nossr50.core.mcmmo.skills.subskills.AbstractSubSkill; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/SoundConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/SoundConfig.java index ec771303a..9b395a422 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/SoundConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/SoundConfig.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.config.skills; +package com.gmail.nossr50.core.config; import com.gmail.nossr50.util.sounds.SoundType; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/WorldBlacklist.java b/core/src/main/java/com/gmail/nossr50/core/config/WorldBlacklist.java index b1c449221..5d01f848b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/WorldBlacklist.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/WorldBlacklist.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.config.skills; +package com.gmail.nossr50.core.config; import com.gmail.nossr50.mcMMO; import org.bukkit.World; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java index 0d4b3ad23..fd5e85e24 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.config.experience; -import com.gmail.nossr50.core.config.skills.AutoUpdateConfigLoader; +import com.gmail.nossr50.core.config.AutoUpdateConfigLoader; import com.gmail.nossr50.core.mcmmo.experience.FormulaType; import com.gmail.nossr50.core.mcmmo.skills.MaterialType; import com.gmail.nossr50.core.mcmmo.skills.PrimarySkillType; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java index c5bbfa04e..214438936 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.config.mods; -import com.gmail.nossr50.core.config.skills.ConfigLoader; +import com.gmail.nossr50.core.config.ConfigLoader; import com.gmail.nossr50.core.mcmmo.skills.ItemType; import com.gmail.nossr50.core.mcmmo.skills.MaterialType; import com.gmail.nossr50.skills.repair.repairables.Repairable; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java index 73bf3d0bb..b60b1e652 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.config.mods; -import com.gmail.nossr50.core.config.skills.ConfigLoader; +import com.gmail.nossr50.core.config.ConfigLoader; import com.gmail.nossr50.core.mcmmo.mods.CustomBlock; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java index e4ad18bde..7852b8cb8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.config.mods; -import com.gmail.nossr50.core.config.skills.ConfigLoader; +import com.gmail.nossr50.core.config.ConfigLoader; import com.gmail.nossr50.core.mcmmo.mods.CustomEntity; import org.apache.commons.lang.ClassUtils; import org.bukkit.Material; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java index 5f859ae85..550256a2b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.config.mods; -import com.gmail.nossr50.core.config.skills.ConfigLoader; +import com.gmail.nossr50.core.config.ConfigLoader; import com.gmail.nossr50.core.mcmmo.mods.CustomTool; import com.gmail.nossr50.core.mcmmo.skills.ItemType; import com.gmail.nossr50.core.mcmmo.skills.MaterialType; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java index 793ea2434..1558c1495 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.config.party; -import com.gmail.nossr50.core.config.skills.ConfigLoader; +import com.gmail.nossr50.core.config.ConfigLoader; import com.gmail.nossr50.util.StringUtils; import org.bukkit.Material; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java index aec76a097..23647ac9a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.config.treasure; -import com.gmail.nossr50.core.config.skills.ConfigLoader; +import com.gmail.nossr50.core.config.ConfigLoader; import com.gmail.nossr50.util.EnchantmentUtils; import com.gmail.nossr50.util.StringUtils; import org.bukkit.ChatColor; diff --git a/core/src/main/java/com/gmail/nossr50/core/data/UserManager.java b/core/src/main/java/com/gmail/nossr50/core/data/UserManager.java index 62f36fbe2..e602c4e94 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/UserManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/UserManager.java @@ -1,12 +1,8 @@ package com.gmail.nossr50.core.data; -import com.gmail.nossr50.core.mcmmo.player.McMMOPlayer; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.google.common.collect.ImmutableList; -import org.bukkit.OfflinePlayer; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Player; -import org.bukkit.metadata.FixedMetadataValue; import java.util.ArrayList; import java.util.Collection; diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManagerFactory.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManagerFactory.java index 33367e204..7530ad13d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManagerFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManagerFactory.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.data.blockmeta; -import com.gmail.nossr50.core.config.skills.HiddenConfig; +import com.gmail.nossr50.core.config.HiddenConfig; public class ChunkletManagerFactory { public static ChunkletManager getChunkletManager() { diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManagerFactory.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManagerFactory.java index 20c249afd..624ec51dc 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManagerFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManagerFactory.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.data.blockmeta.chunkmeta; -import com.gmail.nossr50.core.config.skills.HiddenConfig; +import com.gmail.nossr50.core.config.HiddenConfig; public class ChunkManagerFactory { public static ChunkManager getChunkManager() { diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java index 433172a51..336356fd9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.data.blockmeta.conversion; -import com.gmail.nossr50.core.config.skills.HiddenConfig; +import com.gmail.nossr50.core.config.HiddenConfig; import com.gmail.nossr50.mcMMO; import org.bukkit.scheduler.BukkitScheduler; diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionXDirectory.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionXDirectory.java index d20741f5a..baf10145d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionXDirectory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionXDirectory.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.data.blockmeta.conversion; -import com.gmail.nossr50.core.config.skills.HiddenConfig; +import com.gmail.nossr50.core.config.HiddenConfig; import com.gmail.nossr50.mcMMO; import org.bukkit.scheduler.BukkitScheduler; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java index fee25e3e2..0f2d722eb 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.datatypes.party; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java index 222593b4b..971310e44 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.datatypes.party; import com.gmail.nossr50.commands.party.PartySubcommandType; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java index ba9ec1bd9..ddc0b8ab6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.datatypes.party; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.util.Misc; import org.bukkit.entity.Player; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java index d4312e6a2..e516ba1e9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.core.datatypes.player; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.config.skills.WorldBlacklist; +import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.WorldBlacklist; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java index 0240f8c77..642c52a9e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.core.datatypes.player; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.datatypes.experience.SkillXpGain; diff --git a/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java b/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java index ce1629b5a..034b8827d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java +++ b/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.locale; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.mcMMO; import org.bukkit.ChatColor; diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Living.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Living.java index 23be2deb7..5ee1606c1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Living.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Living.java @@ -3,7 +3,7 @@ package com.gmail.nossr50.core.mcmmo.entity; /** * Living means you can die, you have health, and you can be damaged */ -public interface Living { +public interface Living extends Entity { /** * Whether or not this entity is still alive * @@ -34,4 +34,10 @@ public interface Living { * @param damage the damage to deal to this entity */ void damage(Entity source, int damage); + + /** + * Whether or not this entity still exists + * @return true if valid + */ + Boolean isValid(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java index cd7b23493..99f5e399d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java @@ -3,6 +3,8 @@ package com.gmail.nossr50.core.mcmmo.entity; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.mcmmo.Nameable; +import java.util.UUID; + /** * Players */ diff --git a/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java b/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java index 45bcbba10..f99689c18 100644 --- a/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.party; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.database.UpgradeType; diff --git a/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java b/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java index 251629827..d42e4d42d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java +++ b/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.party; import com.gmail.nossr50.config.party.ItemWeightConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java index b24466463..9b784eb32 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.backups; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.mcMMO; import org.bukkit.scheduler.BukkitRunnable; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java index e0095ac37..dd0139053 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.commands; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java index 7c3c287df..2ed03772a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.commands; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.datatypes.database.PlayerStat; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/database/UUIDUpdateAsyncTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UUIDUpdateAsyncTask.java index daee47db9..361f53aed 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/database/UUIDUpdateAsyncTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UUIDUpdateAsyncTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.database; -import com.gmail.nossr50.core.config.skills.HiddenConfig; +import com.gmail.nossr50.core.config.HiddenConfig; import com.gmail.nossr50.core.data.database.DatabaseManager; import com.gmail.nossr50.core.datatypes.database.UpgradeType; import com.gmail.nossr50.mcMMO; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java index 01bf1d877..377082b10 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.database; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.mcMMO; import org.bukkit.scheduler.BukkitRunnable; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/items/ChimaeraWingWarmup.java b/core/src/main/java/com/gmail/nossr50/core/runnables/items/ChimaeraWingWarmup.java index ca72fa38a..f3a8209e3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/items/ChimaeraWingWarmup.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/items/ChimaeraWingWarmup.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.items; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.util.ChimaeraWing; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/items/TeleportationWarmup.java b/core/src/main/java/com/gmail/nossr50/core/runnables/items/TeleportationWarmup.java index 9bd97f027..6da79ba2f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/items/TeleportationWarmup.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/items/TeleportationWarmup.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.items; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.party.PartyManager; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyAutoKickTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyAutoKickTask.java index 4bdc5439e..991ca3714 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyAutoKickTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyAutoKickTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.party; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.party.PartyManager; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyChatTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyChatTask.java index 4bbd9c5f9..795d59baa 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyChatTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyChatTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.party; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.locale.LocaleLoader; import org.bukkit.ChatColor; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java index e9a77e0be..123b9b401 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.player; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityDisableTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityDisableTask.java index fcd02db7f..10f45890f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityDisableTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityDisableTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.skills; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.SuperAbilityType; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedContainer.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedContainer.java index 671d918c8..c75d17e30 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedContainer.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedContainer.java @@ -1,14 +1,15 @@ package com.gmail.nossr50.core.runnables.skills; -import org.bukkit.entity.LivingEntity; + +import com.gmail.nossr50.core.mcmmo.entity.Living; public class BleedContainer { public int bleedTicks; public int bleedRank; - public LivingEntity target; - public LivingEntity damageSource; + public Living target; + public Living damageSource; - public BleedContainer(LivingEntity target, int bleedTicks, int bleedRank, LivingEntity damageSource) { + public BleedContainer(Living target, int bleedTicks, int bleedRank, Living damageSource) { this.target = target; this.bleedTicks = bleedTicks; this.bleedRank = bleedRank; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedTimerTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedTimerTask.java index ebd0286d4..02d95be85 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedTimerTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedTimerTask.java @@ -1,29 +1,28 @@ package com.gmail.nossr50.core.runnables.skills; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.MobHealthbarUtils; -import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.skills.CombatUtils; -import com.gmail.nossr50.util.skills.ParticleEffectUtils; -import com.gmail.nossr50.util.sounds.SoundManager; -import com.gmail.nossr50.util.sounds.SoundType; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.mcmmo.entity.Living; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.util.MobHealthbarUtils; +import com.gmail.nossr50.core.util.player.NotificationManager; +import com.gmail.nossr50.core.util.skills.CombatUtils; +import com.gmail.nossr50.core.util.skills.ParticleEffectUtils; +import com.gmail.nossr50.core.util.sounds.SoundManager; +import com.gmail.nossr50.core.util.sounds.SoundType; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; +import java.util.UUID; public class BleedTimerTask extends BukkitRunnable { - private static Map bleedList = new HashMap(); + private static Map bleedList = new HashMap(); public static BleedContainer copyContainer(BleedContainer container) { - LivingEntity target = container.target; - LivingEntity source = container.damageSource; + Living target = container.target; + Living source = container.damageSource; int bleedTicks = container.bleedTicks; int bleedRank = container.bleedRank; @@ -32,11 +31,11 @@ public class BleedTimerTask extends BukkitRunnable { } /** - * Instantly Bleed out a LivingEntity + * Instantly Bleed out a Living * - * @param entity LivingEntity to bleed out + * @param entity Living to bleed out */ - public static void bleedOut(LivingEntity entity) { + public static void bleedOut(Living entity) { /* * Don't remove anything from the list outside of run() */ @@ -47,27 +46,27 @@ public class BleedTimerTask extends BukkitRunnable { } /** - * Add a LivingEntity to the bleedList if it is not in it. + * Add a Living to the bleedList if it is not in it. * - * @param entity LivingEntity to add + * @param entity Living to add * @param ticks Number of bleeding ticks */ - public static void add(LivingEntity entity, LivingEntity attacker, int ticks, int bleedRank) { + public static void add(Living entity, Living attacker, int ticks, int bleedRank) { BleedContainer newBleedContainer = new BleedContainer(entity, ticks, bleedRank, attacker); bleedList.put(entity, newBleedContainer); } - public static boolean isBleeding(LivingEntity entity) { + public static boolean isBleeding(Living entity) { return bleedList.containsKey(entity); } @Override public void run() { - Iterator> bleedIterator = bleedList.entrySet().iterator(); + Iterator> bleedIterator = bleedList.entrySet().iterator(); while (bleedIterator.hasNext()) { - Entry containerEntry = bleedIterator.next(); - LivingEntity target = containerEntry.getKey(); + Entry containerEntry = bleedIterator.next(); + Living target = containerEntry.getKey(); int bleedTicks = containerEntry.getValue().bleedTicks; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ToolLowerTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ToolLowerTask.java index 71344bdef..28af327dd 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ToolLowerTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ToolLowerTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.skills; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.ToolType; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java b/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java index f9d399059..582e8f6fe 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.acrobatics.AcrobaticsManager; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java b/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java index 2d3a8ca89..817127ddd 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.util.BlockUtils; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/ChildConfig.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/ChildConfig.java index 5af3c9449..f32e698b9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/ChildConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/ChildConfig.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.child; -import com.gmail.nossr50.core.config.skills.AutoUpdateConfigLoader; +import com.gmail.nossr50.core.config.AutoUpdateConfigLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.util.StringUtils; import org.bukkit.configuration.file.YamlConfiguration; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java index 9a58635f0..30f9a473e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.child.salvage; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.config.Config; import org.bukkit.Material; public class Salvage { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java index 92aa8867d..86ba31888 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.child.salvage; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/Smelting.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/Smelting.java index 03cf4409b..f844cff47 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/Smelting.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/Smelting.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.child.smelting; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.mcMMO; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java index dd4873061..2b1cbdd02 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.child.smelting; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java index b175620ba..f0b145326 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.core.skills.primary.acrobatics; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.config.Config; public final class Acrobatics { public static double dodgeDamageModifier = AdvancedConfig.getInstance().getDodgeDamageModifier(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/Alchemy.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/Alchemy.java index a700518d0..1a36d4434 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/Alchemy.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/Alchemy.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.primary.alchemy; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.skills.AlchemyBrewTask; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/Archery.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/Archery.java index 36f0c277c..870405a80 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/Archery.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/Archery.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.primary.archery; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.skills.RankUtils; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/Axes.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/Axes.java index bb6b9042c..f26de6ed8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/Axes.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/Axes.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.primary.axes; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.skills.RankUtils; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java index d1e715da6..db7afc5d3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.primary.excavation; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/Fishing.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/Fishing.java index 928cf60e9..31ba7f82c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/Fishing.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/Fishing.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.primary.fishing; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.config.treasure.TreasureConfig; import com.gmail.nossr50.core.skills.treasure.ShakeTreasure; import com.gmail.nossr50.util.Misc; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java index 8b7eca90c..102e43e5a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.core.skills.primary.fishing; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.config.treasure.TreasureConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java index e4e25e018..7b183ed22 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.primary.herbalism; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.config.treasure.TreasureConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java index 5cd81b7ce..008f44cdf 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.primary.mining; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.mcMMO; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java index 130efcca3..1bf1a25ee 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.primary.mining; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/ArcaneForging.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/ArcaneForging.java index 6acc378ea..b26287927 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/ArcaneForging.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/ArcaneForging.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.primary.repair; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.AdvancedConfig; public class ArcaneForging { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java index 439e2886b..69f092bef 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.primary.repair; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.config.Config; import org.bukkit.Material; public class Repair { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java index d8c148224..6edcf28c7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.core.skills.primary.repair; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/Swords.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/Swords.java index 11e3f9c7d..ded5643fe 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/Swords.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/Swords.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.primary.swords; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.AdvancedConfig; public class Swords { public static int bleedMaxTicks = AdvancedConfig.getInstance().getRuptureMaxTicks(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/Taming.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/Taming.java index 7426d883f..a2824734c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/Taming.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/Taming.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.primary.taming; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.AdvancedConfig; import org.bukkit.EntityEffect; public class Taming { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java index 75c72bfc5..b69bcf6d6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.core.skills.primary.taming; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TrackedTamingEntity.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TrackedTamingEntity.java index e158b8a13..daaacd00b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TrackedTamingEntity.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TrackedTamingEntity.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.primary.taming; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.skills.CombatUtils; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java index 397b07c82..da2056813 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.primary.unarmed; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.util.sounds.SoundManager; import com.gmail.nossr50.util.sounds.SoundType; import org.bukkit.entity.Player; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/UnarmedManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/UnarmedManager.java index d7ab72994..57936d574 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/UnarmedManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/UnarmedManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.primary.unarmed; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java index 6cebed974..68a0fe3fc 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.primary.woodcutting; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.BlockUtils; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/AbstractSubSkill.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/AbstractSubSkill.java index 7b9d3ae1d..bfb0e7d60 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/AbstractSubSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/AbstractSubSkill.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.subskills; -import com.gmail.nossr50.core.config.skills.CoreSkillsConfig; +import com.gmail.nossr50.core.config.CoreSkillsConfig; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.interfaces.Interaction; import com.gmail.nossr50.core.skills.subskills.interfaces.Rank; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java index 9c58b4e72..b85e604fd 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.core.skills.subskills.acrobatics; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.LimitedSizeList; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java index 6bbd50825..14b4ab33f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.treasure; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import org.bukkit.inventory.ItemStack; public abstract class Treasure { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java b/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java index 6cb7fdeaa..48180fc81 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java b/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java index a44aba75a..504d28abb 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java index 85b2d1ff1..2649fe765 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.util; import com.gmail.nossr50.config.party.ItemWeightConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import org.bukkit.ChatColor; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java index 2b69e64d5..c72e04a49 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.datatypes.meta.OldName; import com.gmail.nossr50.core.runnables.MobHealthDisplayUpdaterTask; import com.gmail.nossr50.core.skills.MobHealthbarType; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java b/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java index 7db1d74cf..b28329f50 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java @@ -4,7 +4,7 @@ import com.gmail.nossr50.config.mods.CustomArmorConfig; import com.gmail.nossr50.config.mods.CustomBlockConfig; import com.gmail.nossr50.config.mods.CustomEntityConfig; import com.gmail.nossr50.config.mods.CustomToolConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.datatypes.mods.CustomBlock; import com.gmail.nossr50.core.datatypes.mods.CustomEntity; import com.gmail.nossr50.core.datatypes.mods.CustomTool; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/Motd.java b/core/src/main/java/com/gmail/nossr50/core/util/Motd.java index f625b54a3..8f758af45 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/Motd.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/Motd.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.skills.PerksUtils; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java b/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java index 5c504dc8b..107ca7d92 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.config.skills.RankConfig; +import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.RankConfig; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.json.McMMOUrl; import com.gmail.nossr50.core.datatypes.json.McMMOWebLinks; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java index 53cf6cb45..280aa0c4d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java @@ -14,7 +14,7 @@ import com.gmail.nossr50.commands.hardcore.HardcoreCommand; import com.gmail.nossr50.commands.hardcore.VampirismCommand; import com.gmail.nossr50.commands.party.PartyCommand; import com.gmail.nossr50.commands.party.teleport.PtpCommand; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.StringUtils; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java index e80487891..04b164638 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util.commands; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java b/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java index 93ddec6d2..f239e8144 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.util.experience; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/player/NotificationManager.java b/core/src/main/java/com/gmail/nossr50/core/util/player/NotificationManager.java index 21ba5142c..c8bea6c92 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/player/NotificationManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/player/NotificationManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util.player; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkill.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkill.java index b317b0d0c..64770955e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkill.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util.random; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceUtil.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceUtil.java index bb34e91f8..c5b988c7c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceUtil.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceUtil.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util.random; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java index 089b0631d..d55723a1c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util.scoreboards; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.database.PlayerStat; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java index bf4b633d8..bec7faf8c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util.scoreboards; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.database.PlayerStat; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java index 0a26e40a9..8544db699 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util.skills; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.mcMMO; import org.bukkit.FireworkEffect.Type; import org.bukkit.block.Block; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/RankUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/RankUtils.java index ae5535f11..8db36fea9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/RankUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/RankUtils.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util.skills; -import com.gmail.nossr50.core.config.skills.RankConfig; +import com.gmail.nossr50.core.config.RankConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.runnables.skills.SkillUnlockNotificationTask; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java index 28892a5f4..22594fb89 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.core.util.skills; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; -import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.config.skills.HiddenConfig; +import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.HiddenConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundManager.java b/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundManager.java index 14984334c..3ffeab4b1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util.sounds; -import com.gmail.nossr50.core.config.skills.SoundConfig; +import com.gmail.nossr50.core.config.SoundConfig; import com.gmail.nossr50.core.util.Misc; import org.bukkit.Location; import org.bukkit.Sound; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/upgrade/UpgradeManager.java b/core/src/main/java/com/gmail/nossr50/core/util/upgrade/UpgradeManager.java index 2a4a0e70a..d3c05ca12 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/upgrade/UpgradeManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/upgrade/UpgradeManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util.upgrade; -import com.gmail.nossr50.core.config.skills.ConfigLoader; +import com.gmail.nossr50.core.config.ConfigLoader; import com.gmail.nossr50.core.datatypes.database.UpgradeType; import java.util.Arrays; diff --git a/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java b/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java index bf4abe5f1..81415d88d 100644 --- a/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java +++ b/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java @@ -1,6 +1,6 @@ package net.shatteredlands.shatt.backup; -import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.mcMMO; import java.io.File; From 401cc3e35b5d1db96dfaa9b2a0364d8561bb14af Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sun, 10 Feb 2019 00:34:08 -0800 Subject: [PATCH 09/28] Repo & Depends below the plugin block --- core/build.gradle.kts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/build.gradle.kts b/core/build.gradle.kts index a1611f543..dfd1e75d6 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -1,3 +1,7 @@ +plugins { + java +} + repositories { // Repo containing the Configurable library maven("https://repo.spongepowered.org/maven") @@ -6,7 +10,3 @@ repositories { dependencies { compile("org.spongepowered", "configurate-hocon", "3.6") // Configurable (config library from Sponge) } - -plugins { - java -} From 67cc162e070a625f6140cf087c58a60677ca71d8 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sun, 10 Feb 2019 00:35:25 -0800 Subject: [PATCH 10/28] Configurate should be set for YAML --- core/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/build.gradle.kts b/core/build.gradle.kts index dfd1e75d6..71f50ad47 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -8,5 +8,5 @@ repositories { } dependencies { - compile("org.spongepowered", "configurate-hocon", "3.6") // Configurable (config library from Sponge) + compile("org.spongepowered", "configurate-yaml", "3.6") // Configurable (config library from Sponge) } From b6a56d686529018eb9d75aa35159676d8cbb6f8e Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sun, 10 Feb 2019 00:46:31 -0800 Subject: [PATCH 11/28] Configurable WIP --- .../com/gmail/nossr50/core/config/ConfigurableLoader.java | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 core/src/main/java/com/gmail/nossr50/core/config/ConfigurableLoader.java diff --git a/core/src/main/java/com/gmail/nossr50/core/config/ConfigurableLoader.java b/core/src/main/java/com/gmail/nossr50/core/config/ConfigurableLoader.java new file mode 100644 index 000000000..5e75d96ea --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/config/ConfigurableLoader.java @@ -0,0 +1,4 @@ +package com.gmail.nossr50.core.config; + +public class ConfigurableLoader { +} From 1ab46452235613abc69764d9e3d432dab4b4c755 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 12 Feb 2019 06:54:32 -0800 Subject: [PATCH 12/28] Fleshing out the abstraction --- core/build.gradle.kts | 3 +++ .../chunkmeta/PrimitiveChunkStore.java | 2 +- .../core/datatypes/LimitedSizeList.java | 2 +- .../gmail/nossr50/core/mcmmo/Nameable.java | 2 ++ .../com/gmail/nossr50/core/mcmmo/Unique.java | 11 ++++++++ .../com/gmail/nossr50/core/mcmmo/World.java | 10 -------- .../gmail/nossr50/core/mcmmo/block/Block.java | 2 -- .../nossr50/core/mcmmo/block/BlockState.java | 1 - .../core/mcmmo/{ => block}/Property.java | 2 +- .../nossr50/core/mcmmo/entity/Entity.java | 14 +++-------- .../nossr50/core/mcmmo/entity/Player.java | 2 -- .../nossr50/core/mcmmo/meta/Metadata.java | 25 +++++++++++++++++++ .../core/mcmmo/meta/MetadataHolder.java | 20 +++++++++++++++ .../core/mcmmo/{ => world}/AbstractWorld.java | 2 +- .../core/mcmmo/{ => world}/Location.java | 17 ++++++++++--- .../gmail/nossr50/core/mcmmo/world/World.java | 15 +++++++++++ 16 files changed, 97 insertions(+), 33 deletions(-) create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/Unique.java delete mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/World.java rename core/src/main/java/com/gmail/nossr50/core/mcmmo/{ => block}/Property.java (95%) create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/meta/Metadata.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/meta/MetadataHolder.java rename core/src/main/java/com/gmail/nossr50/core/mcmmo/{ => world}/AbstractWorld.java (96%) rename core/src/main/java/com/gmail/nossr50/core/mcmmo/{ => world}/Location.java (66%) create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/world/World.java diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 71f50ad47..2c9311b60 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -5,8 +5,11 @@ plugins { repositories { // Repo containing the Configurable library maven("https://repo.spongepowered.org/maven") + // Flow Math + maven("https://oss.sonatype.org/content/groups/public/") } dependencies { + compile("com.flowpowered", "flow-math", "1.0.4-SNAPSHOT") compile("org.spongepowered", "configurate-yaml", "3.6") // Configurable (config library from Sponge) } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java index d0acb78ab..16fb7d21c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.data.blockmeta.chunkmeta; import com.gmail.nossr50.core.data.blockmeta.ChunkletStore; -import com.gmail.nossr50.core.mcmmo.World; +import com.gmail.nossr50.core.mcmmo.world.World; import java.io.IOException; import java.io.ObjectInputStream; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java index 8f3efa7ff..7983a20de 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.datatypes; -import com.gmail.nossr50.core.mcmmo.Location; +import com.gmail.nossr50.core.mcmmo.world.Location; public class LimitedSizeList { private final int size; diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java index a69a5ca45..435acbfbd 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java @@ -1,5 +1,7 @@ package com.gmail.nossr50.core.mcmmo; +import com.gmail.nossr50.core.mcmmo.Named; + public interface Nameable extends Named { /** * Change the name for this entity diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Unique.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Unique.java new file mode 100644 index 000000000..d0f1a6395 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Unique.java @@ -0,0 +1,11 @@ +package com.gmail.nossr50.core.mcmmo; + +import java.util.UUID; + +/** + * Many things in MC use UUID to be uniquely identified + * + */ +public interface Unique { + UUID getUUID(); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/World.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/World.java deleted file mode 100644 index a14760be2..000000000 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/World.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.gmail.nossr50.core.mcmmo; - -public interface World { - /** - * Gets the name of this World - * - * @return the name of this world - */ - String getName(); -} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Block.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Block.java index 9dcfdd847..7aced11ed 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Block.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Block.java @@ -1,7 +1,5 @@ package com.gmail.nossr50.core.mcmmo.block; -import com.gmail.nossr50.core.mcmmo.Property; - /** * Represents a container of properties and values for a Block * diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/BlockState.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/BlockState.java index 574137060..cd99581d1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/BlockState.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/BlockState.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.core.mcmmo.block; -import com.gmail.nossr50.core.mcmmo.Property; import com.google.common.collect.ImmutableMap; import java.util.Collection; diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Property.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Property.java similarity index 95% rename from core/src/main/java/com/gmail/nossr50/core/mcmmo/Property.java rename to core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Property.java index 1261ad085..da967a1af 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Property.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Property.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.mcmmo; +package com.gmail.nossr50.core.mcmmo.block; import java.util.Collection; diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Entity.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Entity.java index f6c6d9ed7..60921d830 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Entity.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Entity.java @@ -1,21 +1,15 @@ package com.gmail.nossr50.core.mcmmo.entity; -import com.gmail.nossr50.core.mcmmo.Location; +import com.gmail.nossr50.core.mcmmo.world.Location; import com.gmail.nossr50.core.mcmmo.Named; - -import java.util.UUID; +import com.gmail.nossr50.core.mcmmo.Unique; +import com.gmail.nossr50.core.mcmmo.meta.MetadataHolder; /** * Entities can be a lot of things in MC * Entities can be monsters, animals, players, etc... */ -public interface Entity extends Location, Named { - /** - * The UUID for this entity - * - * @return this entity's UUID - */ - UUID getUUID(); +public interface Entity extends Location, Named, Unique, MetadataHolder { /** * The Location for this entity diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java index 99f5e399d..cd7b23493 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java @@ -3,8 +3,6 @@ package com.gmail.nossr50.core.mcmmo.entity; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.mcmmo.Nameable; -import java.util.UUID; - /** * Players */ diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/meta/Metadata.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/meta/Metadata.java new file mode 100644 index 000000000..ccc775083 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/meta/Metadata.java @@ -0,0 +1,25 @@ +package com.gmail.nossr50.core.mcmmo.meta; + +/** + * Represents custom state in the API + * Mostly provided by plugins + */ +public interface Metadata { + /** + * The metadata key for this metadata + * @return the metadata key + */ + String getKey(); + + /** + * The value for this metadata key + * @return the value of this metadata + */ + Object getValue(); + + /** + * Replace the value in this metadata + * @param newValue the replacement metadata value + */ + void setValue(Object newValue); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/meta/MetadataHolder.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/meta/MetadataHolder.java new file mode 100644 index 000000000..ce2c7e646 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/meta/MetadataHolder.java @@ -0,0 +1,20 @@ +package com.gmail.nossr50.core.mcmmo.meta; + +/** + * A metadataHolder is something that can hold metadata + * Both Bukkit and Sponge provide metadata APIs + */ +public interface MetadataHolder { + /** + * Gets the metadata for the appropriate key + * @param key the key for the metadata + * @return the metadata for this key + */ + Metadata getMetadata(String key); + + /** + * Sets the metadata, will replace metadata with an existing key or add metadata if there was none + * @param metadata metadata to add + */ + void setMetadata(Metadata metadata); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/AbstractWorld.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/world/AbstractWorld.java similarity index 96% rename from core/src/main/java/com/gmail/nossr50/core/mcmmo/AbstractWorld.java rename to core/src/main/java/com/gmail/nossr50/core/mcmmo/world/AbstractWorld.java index 2c587ba5f..4e874d053 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/AbstractWorld.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/world/AbstractWorld.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.core.mcmmo; +package com.gmail.nossr50.core.mcmmo.world; import java.util.Objects; diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Location.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/world/Location.java similarity index 66% rename from core/src/main/java/com/gmail/nossr50/core/mcmmo/Location.java rename to core/src/main/java/com/gmail/nossr50/core/mcmmo/world/Location.java index 31377eac9..2ee1343f2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Location.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/world/Location.java @@ -1,4 +1,7 @@ -package com.gmail.nossr50.core.mcmmo; +package com.gmail.nossr50.core.mcmmo.world; + +import com.flowpowered.math.vector.Vector3d; +import com.gmail.nossr50.core.mcmmo.world.World; /** * This class represents a Location in MC @@ -6,26 +9,32 @@ package com.gmail.nossr50.core.mcmmo; */ public interface Location { + /** + * The Vector3d of this location + * @return this vector + */ + Vector3d getVector(); + /** * Returns the position of this location on the x-axis * * @return x-axis position */ - double getX(); + //double getX(); /** * Returns the position of this location on the y-axis * * @return y-axis position */ - double getY(); + //double getY(); /** * Returns the position of this location on the z-axis * * @return z-axis position */ - double getZ(); + //double getZ(); /** * The world for this Location diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/world/World.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/world/World.java new file mode 100644 index 000000000..fd59afdce --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/world/World.java @@ -0,0 +1,15 @@ +package com.gmail.nossr50.core.mcmmo.world; + +import com.gmail.nossr50.core.mcmmo.Unique; + +/** + * Represents a world in MC + */ +public interface World extends Unique { + /** + * Gets the name of this World + * + * @return the name of this world + */ + String getName(); +} From 84353de71d430a078f674eabad0464dd9d4eefc9 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 12 Feb 2019 07:17:27 -0800 Subject: [PATCH 13/28] More abstraction --- Changelog.txt | 1 + .../com/gmail/nossr50/core/McmmoCore.java | 4 +- .../gmail/nossr50/core/api/ExperienceAPI.java | 2 +- .../core/datatypes/player/McMMOPlayer.java | 94 +++++++++---------- .../gmail/nossr50/core/mcmmo/Nameable.java | 2 - .../nossr50/core/mcmmo/entity/Entity.java | 2 +- .../core/mcmmo/meta/MetadataDefinitions.java | 5 + .../core/mcmmo/meta/MetadataHolder.java | 11 ++- .../nossr50/core/mcmmo/plugin/Plugin.java | 13 +++ .../nossr50/core/mcmmo/tasks/ASyncTask.java | 8 ++ .../nossr50/core/mcmmo/tasks/PluginTask.java | 23 +++++ .../nossr50/core/mcmmo/tasks/SyncTask.java | 9 ++ .../nossr50/core/mcmmo/world/Location.java | 1 - 13 files changed, 120 insertions(+), 55 deletions(-) create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/meta/MetadataDefinitions.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/plugin/Plugin.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/ASyncTask.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/PluginTask.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/SyncTask.java diff --git a/Changelog.txt b/Changelog.txt index e79cd9cc2..8845f00c7 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -8,6 +8,7 @@ Key: - Removal Version 2.2.0 + mcMMO is now abstracted from the Bukkit API in order to support more platforms (WIP) Salvage config entries are no longer case sensitive mcMMO has changed from using maven to gradle! mcMMO is now a gradle project (this makes it much easier for us to support older versions of MC and other APIs) diff --git a/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java b/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java index f2b27a659..2c76fad73 100644 --- a/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java +++ b/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java @@ -1,5 +1,7 @@ package com.gmail.nossr50.core; -public class McmmoCore { +import com.gmail.nossr50.core.mcmmo.plugin.Plugin; +public class McmmoCore { + public static Plugin p; } diff --git a/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java index 61617ca00..17aab077e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.core.api; import com.gmail.nossr50.core.api.exceptions.*; -import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java index e516ba1e9..222db87a7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java @@ -1,9 +1,10 @@ package com.gmail.nossr50.core.datatypes.player; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.config.WorldBlacklist; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; @@ -12,52 +13,48 @@ import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.mods.CustomTool; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.meta.Metadata; +import com.gmail.nossr50.core.mcmmo.meta.MetadataDefinitions; +import com.gmail.nossr50.core.mcmmo.world.Location; +import com.gmail.nossr50.core.party.PartyManager; +import com.gmail.nossr50.core.party.ShareHandler; +import com.gmail.nossr50.core.runnables.skills.AbilityDisableTask; +import com.gmail.nossr50.core.runnables.skills.BleedTimerTask; +import com.gmail.nossr50.core.runnables.skills.ToolLowerTask; import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.core.skills.ToolType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.party.ShareHandler; -import com.gmail.nossr50.runnables.skills.AbilityDisableTask; -import com.gmail.nossr50.runnables.skills.BleedTimerTask; -import com.gmail.nossr50.runnables.skills.ToolLowerTask; -import com.gmail.nossr50.skills.SkillManager; -import com.gmail.nossr50.skills.acrobatics.AcrobaticsManager; -import com.gmail.nossr50.skills.alchemy.AlchemyManager; -import com.gmail.nossr50.skills.archery.ArcheryManager; -import com.gmail.nossr50.skills.axes.AxesManager; -import com.gmail.nossr50.skills.child.FamilyTree; -import com.gmail.nossr50.skills.excavation.ExcavationManager; -import com.gmail.nossr50.skills.fishing.FishingManager; -import com.gmail.nossr50.skills.herbalism.HerbalismManager; -import com.gmail.nossr50.skills.mining.MiningManager; -import com.gmail.nossr50.skills.repair.RepairManager; -import com.gmail.nossr50.skills.salvage.SalvageManager; -import com.gmail.nossr50.skills.smelting.SmeltingManager; -import com.gmail.nossr50.skills.swords.SwordsManager; -import com.gmail.nossr50.skills.taming.TamingManager; -import com.gmail.nossr50.skills.unarmed.UnarmedManager; -import com.gmail.nossr50.skills.woodcutting.WoodcuttingManager; -import com.gmail.nossr50.util.EventUtils; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.experience.ExperienceBarManager; -import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.scoreboards.ScoreboardManager; -import com.gmail.nossr50.util.skills.ParticleEffectUtils; -import com.gmail.nossr50.util.skills.PerksUtils; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillUtils; -import com.gmail.nossr50.util.sounds.SoundManager; -import com.gmail.nossr50.util.sounds.SoundType; -import org.apache.commons.lang.Validate; -import org.bukkit.GameMode; -import org.bukkit.Location; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.metadata.FixedMetadataValue; -import org.bukkit.plugin.Plugin; +import com.gmail.nossr50.core.skills.child.FamilyTree; +import com.gmail.nossr50.core.skills.child.salvage.SalvageManager; +import com.gmail.nossr50.core.skills.child.smelting.SmeltingManager; +import com.gmail.nossr50.core.skills.primary.acrobatics.AcrobaticsManager; +import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyManager; +import com.gmail.nossr50.core.skills.primary.archery.ArcheryManager; +import com.gmail.nossr50.core.skills.primary.axes.AxesManager; +import com.gmail.nossr50.core.skills.primary.excavation.ExcavationManager; +import com.gmail.nossr50.core.skills.primary.fishing.FishingManager; +import com.gmail.nossr50.core.skills.primary.herbalism.HerbalismManager; +import com.gmail.nossr50.core.skills.primary.mining.MiningManager; +import com.gmail.nossr50.core.skills.primary.repair.RepairManager; +import com.gmail.nossr50.core.skills.primary.swords.SwordsManager; +import com.gmail.nossr50.core.skills.primary.taming.TamingManager; +import com.gmail.nossr50.core.skills.primary.unarmed.UnarmedManager; +import com.gmail.nossr50.core.skills.primary.woodcutting.WoodcuttingManager; +import com.gmail.nossr50.core.util.EventUtils; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.experience.ExperienceBarManager; +import com.gmail.nossr50.core.util.player.NotificationManager; +import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; +import com.gmail.nossr50.core.util.skills.ParticleEffectUtils; +import com.gmail.nossr50.core.util.skills.PerksUtils; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillUtils; +import com.gmail.nossr50.core.util.sounds.SoundManager; +import com.gmail.nossr50.core.util.sounds.SoundType; import java.util.HashMap; import java.util.Map; @@ -69,7 +66,7 @@ public class McMMOPlayer { private final Map abilityMode = new HashMap(); private final Map abilityInformed = new HashMap(); private final Map toolMode = new HashMap(); - private final FixedMetadataValue playerMetadata; + private final Metadata playerMetadata; private Player player; private PlayerProfile profile; private ExperienceBarManager experienceBarManager; @@ -94,10 +91,10 @@ public class McMMOPlayer { public McMMOPlayer(Player player, PlayerProfile profile) { String playerName = player.getName(); - UUID uuid = player.getUniqueId(); + UUID uuid = player.getUUID(); this.player = player; - playerMetadata = new FixedMetadataValue(mcMMO.p, playerName); + playerMetadata = player.setMetadata(MetadataDefinitions.MCMMO_METADATA_PLAYERDATA_KEY, playerName); //new FixedMetadataValue(mcMMO.p, playerName); this.profile = profile; if (profile.getUniqueId() == null) { @@ -115,7 +112,8 @@ public class McMMOPlayer { } } catch (Exception e) { e.printStackTrace(); - mcMMO.p.getPluginLoader().disablePlugin(mcMMO.p); + McmmoCore.p.disablePlugin(); //Disable Plugin + //mcMMO.p.getPluginLoader().disablePlugin(mcMMO.p); } for (SuperAbilityType superAbilityType : SuperAbilityType.values()) { diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java index 435acbfbd..a69a5ca45 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java @@ -1,7 +1,5 @@ package com.gmail.nossr50.core.mcmmo; -import com.gmail.nossr50.core.mcmmo.Named; - public interface Nameable extends Named { /** * Change the name for this entity diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Entity.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Entity.java index 60921d830..b92430411 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Entity.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Entity.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.core.mcmmo.entity; -import com.gmail.nossr50.core.mcmmo.world.Location; import com.gmail.nossr50.core.mcmmo.Named; import com.gmail.nossr50.core.mcmmo.Unique; import com.gmail.nossr50.core.mcmmo.meta.MetadataHolder; +import com.gmail.nossr50.core.mcmmo.world.Location; /** * Entities can be a lot of things in MC diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/meta/MetadataDefinitions.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/meta/MetadataDefinitions.java new file mode 100644 index 000000000..1ac325724 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/meta/MetadataDefinitions.java @@ -0,0 +1,5 @@ +package com.gmail.nossr50.core.mcmmo.meta; + +public class MetadataDefinitions { + public static final String MCMMO_METADATA_PLAYERDATA_KEY = "mcMMO_PlayerDataKey"; +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/meta/MetadataHolder.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/meta/MetadataHolder.java index ce2c7e646..129b11349 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/meta/MetadataHolder.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/meta/MetadataHolder.java @@ -15,6 +15,15 @@ public interface MetadataHolder { /** * Sets the metadata, will replace metadata with an existing key or add metadata if there was none * @param metadata metadata to add + * @return a copy of the metadata */ - void setMetadata(Metadata metadata); + Metadata setMetadata(Metadata metadata); + + /** + * Sets the metadata, will replace metadata with a matching key or add metadata if there was none + * @param key metadata key + * @param value metadata value + * @return a copy of the metadata + */ + Metadata setMetadata(String key, Object value); } diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/plugin/Plugin.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/plugin/Plugin.java new file mode 100644 index 000000000..d719c9bc1 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/plugin/Plugin.java @@ -0,0 +1,13 @@ +package com.gmail.nossr50.core.mcmmo.plugin; + +/** + * Represents mcMMO as it is seen by various APIs + * In Bukkit, its useful to have a Plugin reference to schedule tasks etc, that is why this abstraction exists + * I'm actually not sure I need this though + */ +public interface Plugin { + /** + * In the event of some critical failure in mcMMO shut down the plugin + */ + void disablePlugin(); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/ASyncTask.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/ASyncTask.java new file mode 100644 index 000000000..63ffb4c22 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/ASyncTask.java @@ -0,0 +1,8 @@ +package com.gmail.nossr50.core.mcmmo.tasks; + +/** + * An ASync Task + * You have to be careful where you use these, a lot of things are not thread safe + */ +public interface ASyncTask extends PluginTask { +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/PluginTask.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/PluginTask.java new file mode 100644 index 000000000..444f03d33 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/PluginTask.java @@ -0,0 +1,23 @@ +package com.gmail.nossr50.core.mcmmo.tasks; + +/** + * Represents a schedules task + * Bukkit and Sponge both have systems for this + */ +public interface PluginTask { + /** + * Kills the current task + */ + void killTask(); + + /** + * Schedule a delayed task in n ticks + * @param ticks ticks until the task should start + */ + void scheduleTask(int ticks); + + /** + * Schedule this task (begins ASAP) + */ + void scheduleTask(); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/SyncTask.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/SyncTask.java new file mode 100644 index 000000000..495a7f3b2 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/SyncTask.java @@ -0,0 +1,9 @@ +package com.gmail.nossr50.core.mcmmo.tasks; + +/** + * Represents a SyncTask + * SyncTasks run on the main thread + */ +public interface SyncTask extends PluginTask { + +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/world/Location.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/world/Location.java index 2ee1343f2..a16305f6f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/world/Location.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/world/Location.java @@ -1,7 +1,6 @@ package com.gmail.nossr50.core.mcmmo.world; import com.flowpowered.math.vector.Vector3d; -import com.gmail.nossr50.core.mcmmo.world.World; /** * This class represents a Location in MC From 4461cfacd21f9c307d044ac4a78a5f02cf94c4ae Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 13 Feb 2019 08:40:13 -0800 Subject: [PATCH 14/28] Fleshing out the abstraction --- .../commands/skills/FishingCommand.java | 2 +- bukkit/src/main/resources/itemweights.yml | 4 +- .../com/gmail/nossr50/core/McmmoCore.java | 11 ++++ .../src/main/java/com/gmail/nossr50/core/TODO | 7 ++ .../config/skills/repair/RepairConfig.java | 4 +- .../config/skills/salvage/SalvageConfig.java | 4 +- .../core/datatypes/player/McMMOPlayer.java | 13 ++-- .../nossr50/core/mcmmo/colors/ChatColor.java | 33 ++++++++++ .../nossr50/core/mcmmo/colors/Color.java | 30 +++++++++ .../nossr50/core/mcmmo/entity/Player.java | 10 ++- .../nossr50/core/mcmmo/entity/Tameable.java | 8 +++ .../core/mcmmo/inventory/Inventory.java | 17 +++++ .../core/mcmmo/inventory/InventoryHolder.java | 12 ++++ .../core/mcmmo/inventory/ItemType.java | 10 +++ .../nossr50/core/mcmmo/item/ItemStack.java | 59 +++++++++++++++++ .../com/gmail/nossr50/core/mcmmo/nbt/NBT.java | 7 ++ .../nossr50/core/party/ShareHandler.java | 2 +- .../nossr50/core/skills/PrimarySkillType.java | 47 +++++++------- .../nossr50/core/skills/SkillManager.java | 8 +-- .../salvageables/SalvageableManager.java | 2 +- .../skills/primary/mining/MiningManager.java | 33 ++++------ .../skills/primary/repair/RepairManager.java | 2 +- .../repair/repairables/RepairableManager.java | 2 +- .../core/skills/primary/unarmed/Unarmed.java | 2 +- .../gmail/nossr50/core/util/ItemUtils.java | 64 +++++++++---------- .../com/gmail/nossr50/core/util/Misc.java | 2 +- .../gmail/nossr50/core/util/ModManager.java | 2 +- .../util/experience/ExperienceBarManager.java | 10 +-- .../nossr50/core/util/skills/RankUtils.java | 9 +-- 29 files changed, 306 insertions(+), 110 deletions(-) create mode 100644 core/src/main/java/com/gmail/nossr50/core/TODO create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/colors/ChatColor.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/colors/Color.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Tameable.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/inventory/Inventory.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/inventory/InventoryHolder.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/inventory/ItemType.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/item/ItemStack.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/nbt/NBT.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java index dc3d711f8..9c73c7759 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java @@ -57,7 +57,7 @@ public class FishingCommand extends SkillCommand { if (canTreasureHunt) { lootTier = fishingManager.getLootTier(); - // Item drop rates + // ItemStack drop rates commonTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.COMMON) / 100.0); uncommonTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.UNCOMMON) / 100.0); rareTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.RARE) / 100.0); diff --git a/bukkit/src/main/resources/itemweights.yml b/bukkit/src/main/resources/itemweights.yml index 55072c556..05a982e47 100644 --- a/bukkit/src/main/resources/itemweights.yml +++ b/bukkit/src/main/resources/itemweights.yml @@ -1,5 +1,5 @@ # -# Item Weights configuration +# ItemStack Weights configuration # # This file is used to determine the value of an item. This will only # happen when users are sharing items in a party using the EQUAL item share mode. @@ -27,7 +27,7 @@ Item_Weights: Coal: 10 Coal_Ore: 10 - # Item weights for armor and tools + # ItemStack weights for armor and tools Diamond_Sword: 150 Diamond_Shovel: 150 Diamond_Pickaxe: 150 diff --git a/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java b/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java index 2c76fad73..885aa7db2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java +++ b/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java @@ -2,6 +2,17 @@ package com.gmail.nossr50.core; import com.gmail.nossr50.core.mcmmo.plugin.Plugin; +import java.util.logging.Logger; + public class McmmoCore { public static Plugin p; + + /** + * Returns our Logger + * @return the logger + */ + public static Logger getLogger() + { + + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/TODO b/core/src/main/java/com/gmail/nossr50/core/TODO new file mode 100644 index 000000000..dd96411b5 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/TODO @@ -0,0 +1,7 @@ +This file is just going to take note of all the caveats of mcMMO code as I abstract out bukkit + +1) In several places mcMMO is disabling itself, pretty sure this is not a good idea and this should be changed + eg: in McMMOPlayer, and when loading configs and finding bad vlaues + +2) mcMMO uses a a global reference of its Plugin class for Bukkit in order to schedule tasks + diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java index af5d4c18d..685ea4515 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java @@ -39,7 +39,7 @@ public class RepairConfig extends ConfigLoader { // Validate all the things! List reason = new ArrayList(); - // Item Material + // ItemStack Material Material itemMaterial = Material.matchMaterial(key); if (itemMaterial == null) { @@ -95,7 +95,7 @@ public class RepairConfig extends ConfigLoader { reason.add("Maximum durability of " + key + " must be greater than 0!"); } - // Item Type + // ItemStack Type ItemType repairItemType = ItemType.OTHER; String repairItemTypeString = config.getString("Repairables." + key + ".ItemType", "OTHER"); diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java index 30a3e7a58..08d63f924 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java @@ -34,7 +34,7 @@ public class SalvageConfig extends ConfigLoader { // Validate all the things! List reason = new ArrayList(); - // Item Material + // ItemStack Material Material itemMaterial = Material.matchMaterial(key); if (itemMaterial == null) { @@ -82,7 +82,7 @@ public class SalvageConfig extends ConfigLoader { // Maximum Durability short maximumDurability = (itemMaterial != null ? itemMaterial.getMaxDurability() : (short) config.getInt("Salvageables." + key + ".MaximumDurability")); - // Item Type + // ItemStack Type ItemType salvageItemType = ItemType.OTHER; String salvageItemTypeString = config.getString("Salvageables." + key + ".ItemType", "OTHER"); diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java index 222db87a7..16de62109 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java @@ -15,6 +15,7 @@ import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.mcmmo.meta.Metadata; import com.gmail.nossr50.core.mcmmo.meta.MetadataDefinitions; import com.gmail.nossr50.core.mcmmo.world.Location; @@ -133,7 +134,7 @@ public class McMMOPlayer { experienceBarManager.hideExperienceBar(primarySkillType); }*/ - public void processPostXpEvent(XPGainReason xpGainReason, PrimarySkillType primarySkillType, Plugin plugin, XPGainSource xpGainSource) { + public void processPostXpEvent(XPGainReason xpGainReason, PrimarySkillType primarySkillType, XPGainSource xpGainSource) { //Updates from Party sources if (xpGainSource == XPGainSource.PARTY_MEMBERS && !ExperienceConfig.getInstance().isPartyExperienceBarsEnabled()) return; @@ -142,21 +143,21 @@ public class McMMOPlayer { if (xpGainSource == XPGainSource.PASSIVE && !ExperienceConfig.getInstance().isPassiveGainsExperienceBarsEnabled()) return; - updateXPBar(primarySkillType, plugin); + updateXPBar(primarySkillType); } - public void processUnlockNotifications(mcMMO plugin, PrimarySkillType primarySkillType, int skillLevel) { - RankUtils.executeSkillUnlockNotifications(plugin, this, primarySkillType, skillLevel); + public void processUnlockNotifications(PrimarySkillType primarySkillType, int skillLevel) { + RankUtils.executeSkillUnlockNotifications(primarySkillType, skillLevel); } - public void updateXPBar(PrimarySkillType primarySkillType, Plugin plugin) { + public void updateXPBar(PrimarySkillType primarySkillType) { //Skill Unlock Notifications if (primarySkillType.isChildSkill()) return; //XP BAR UPDATES - experienceBarManager.updateExperienceBar(primarySkillType, plugin); + experienceBarManager.updateExperienceBar(primarySkillType); } public double getProgressInCurrentSkillLevel(PrimarySkillType primarySkillType) { diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/colors/ChatColor.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/colors/ChatColor.java new file mode 100644 index 000000000..8b034b734 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/colors/ChatColor.java @@ -0,0 +1,33 @@ +package com.gmail.nossr50.core.mcmmo.colors; + +/** + * Represents special formatting codes in Minecraft + * + * Some of them apply colors, some of them apply stylized effects to the text. + */ +public enum ChatColor { + BLACK, + DARK_BLUE, + DARK_GREEN, + DARK_AQUA, + DARK_RED, + DARK_PURPLE, + GOLD, + GRAY, + DARK_GRAY, + BLUE, + GREEN, + AQUA, + RED, + LIGHT_PURPLE, + YELLOW, + WHITE, + OBFUSCATED, + BOLD, + STRIKETHROUGH, + UNDERLINE, + ITALIC, + RESET; + + static final String formattingCharacter = "§"; +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/colors/Color.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/colors/Color.java new file mode 100644 index 000000000..e7b045a3f --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/colors/Color.java @@ -0,0 +1,30 @@ +package com.gmail.nossr50.core.mcmmo.colors; + +/** + * Colors used by MC for non-chat purposes + */ +public enum Color { + AQUA, + BLACK, + BLUE, + FUCHSIA, + GRAY, + GREEN, + LIME, + MAROON, + NAVY, + OLIVE, + ORANGE, + PURPLE, + RED, + SILVER, + TEAL, + WHITE, + YELLOW; + + + Color fromRGB(int r, int g, int b) + { + + } +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java index cd7b23493..2e8cf8edd 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java @@ -2,11 +2,13 @@ package com.gmail.nossr50.core.mcmmo.entity; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.mcmmo.Nameable; +import com.gmail.nossr50.core.mcmmo.inventory.InventoryHolder; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; /** * Players */ -public interface Player extends Living, Nameable { +public interface Player extends Living, Nameable, InventoryHolder { /** * Players are not always online @@ -21,4 +23,10 @@ public interface Player extends Living, Nameable { * @return the associated McMMOPlayer, can be null */ McMMOPlayer getMcMMOPlayer(); + + /** + * Gets the item in the main hand of this player + * @return the item in the main hand + */ + ItemStack getItemInMainHand(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Tameable.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Tameable.java new file mode 100644 index 000000000..63e008789 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Tameable.java @@ -0,0 +1,8 @@ +package com.gmail.nossr50.core.mcmmo.entity; + +/** + * Represents an entity that can be tamed + */ +public interface Tameable extends Living { + +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/inventory/Inventory.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/inventory/Inventory.java new file mode 100644 index 000000000..38ca7e38a --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/inventory/Inventory.java @@ -0,0 +1,17 @@ +package com.gmail.nossr50.core.mcmmo.inventory; + +import com.gmail.nossr50.core.mcmmo.item.ItemStack; + +public interface Inventory { + /** + * Grab the entire Inventory + * @return this inventory + */ + ItemStack[] getInventory(); + + /** + * Sets the inventory + * @param inventory new inventory + */ + void setInventory(ItemStack[] inventory); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/inventory/InventoryHolder.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/inventory/InventoryHolder.java new file mode 100644 index 000000000..92f12e484 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/inventory/InventoryHolder.java @@ -0,0 +1,12 @@ +package com.gmail.nossr50.core.mcmmo.inventory; + +/** + * Represents something that has an inventory + */ +public interface InventoryHolder { + /** + * Gets the inventory for this entity + * @return this inventory + */ + Inventory getInventory(); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/inventory/ItemType.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/inventory/ItemType.java new file mode 100644 index 000000000..0f485aecf --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/inventory/ItemType.java @@ -0,0 +1,10 @@ +package com.gmail.nossr50.core.mcmmo.inventory; + +/** + * Definitions for item types + * + * items prefixed with LEGACY are items that are removed from current versions of the game + */ +public enum ItemType { + AIR, +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/item/ItemStack.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/item/ItemStack.java new file mode 100644 index 000000000..4a7ee3c38 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/item/ItemStack.java @@ -0,0 +1,59 @@ +package com.gmail.nossr50.core.mcmmo.item; + +import com.gmail.nossr50.core.mcmmo.nbt.NBT; + +import java.util.ArrayList; + +/** + * Represents an ItemStack in Minecraft + */ +public interface ItemStack { + + /** + * The maximum amount of this item allowed in a stack + * @return the maximum stack size of the item + */ + int getMaxStackSize(); + + /** + * The current amount of items in this stack + * @return the amount of items + */ + int getAmount(); + + /** + * Replaces the lore on an item stack + * @param replacementLore the new lore for this item + */ + void setItemLore(ArrayList replacementLore); + + /** + * Unlocalized name of this item + * @return the unlocalized name of this item (english) + */ + String getUnlocalizedName(); + + /** + * The maximum amount of damage this item can take before it breaks + * @return the maximum damage allowed on this item + */ + int getMaxDamage(); + + /** + * The id of this item + * @return this item's id + */ + int getItemId(); + + /** + * Returns the cooldown for an item + * @return this item's cooldown + */ + int getCoolDown(); + + /** + * Returns the compound NBT data for this item + * @return this item's NBT data + */ + NBT getNBT(); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/nbt/NBT.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/nbt/NBT.java new file mode 100644 index 000000000..346d4309b --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/nbt/NBT.java @@ -0,0 +1,7 @@ +package com.gmail.nossr50.core.mcmmo.nbt; + +/** + * Represents compound NBT Data + */ +public interface NBT { +} diff --git a/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java b/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java index d42e4d42d..57509a36c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java +++ b/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java @@ -58,7 +58,7 @@ public final class ShareHandler { /** * Distribute Items amongst party members. * - * @param drop Item that will get shared + * @param drop ItemStack that will get shared * @param mcMMOPlayer Player who picked up the item * @return True if the item has been shared */ diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java b/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java index 582e8f6fe..5fc7b1dfe 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java @@ -1,30 +1,31 @@ package com.gmail.nossr50.core.skills; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.Config; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.acrobatics.AcrobaticsManager; -import com.gmail.nossr50.skills.alchemy.AlchemyManager; -import com.gmail.nossr50.skills.archery.ArcheryManager; -import com.gmail.nossr50.skills.axes.AxesManager; -import com.gmail.nossr50.skills.excavation.ExcavationManager; -import com.gmail.nossr50.skills.fishing.FishingManager; -import com.gmail.nossr50.skills.herbalism.HerbalismManager; -import com.gmail.nossr50.skills.mining.MiningManager; -import com.gmail.nossr50.skills.repair.RepairManager; -import com.gmail.nossr50.skills.salvage.SalvageManager; -import com.gmail.nossr50.skills.smelting.SmeltingManager; -import com.gmail.nossr50.skills.swords.SwordsManager; -import com.gmail.nossr50.skills.taming.TamingManager; -import com.gmail.nossr50.skills.unarmed.UnarmedManager; -import com.gmail.nossr50.skills.woodcutting.WoodcuttingManager; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.StringUtils; -import com.gmail.nossr50.util.skills.ParticleEffectUtils; -import com.gmail.nossr50.util.skills.RankUtils; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.colors.Color; +import com.gmail.nossr50.core.mcmmo.entity.Entity; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.skills.child.salvage.SalvageManager; +import com.gmail.nossr50.core.skills.child.smelting.SmeltingManager; +import com.gmail.nossr50.core.skills.primary.acrobatics.AcrobaticsManager; +import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyManager; +import com.gmail.nossr50.core.skills.primary.archery.ArcheryManager; +import com.gmail.nossr50.core.skills.primary.axes.AxesManager; +import com.gmail.nossr50.core.skills.primary.excavation.ExcavationManager; +import com.gmail.nossr50.core.skills.primary.fishing.FishingManager; +import com.gmail.nossr50.core.skills.primary.herbalism.HerbalismManager; +import com.gmail.nossr50.core.skills.primary.mining.MiningManager; +import com.gmail.nossr50.core.skills.primary.repair.RepairManager; +import com.gmail.nossr50.core.skills.primary.swords.SwordsManager; +import com.gmail.nossr50.core.skills.primary.taming.TamingManager; +import com.gmail.nossr50.core.skills.primary.unarmed.UnarmedManager; +import com.gmail.nossr50.core.skills.primary.woodcutting.WoodcuttingManager; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.StringUtils; +import com.gmail.nossr50.core.util.skills.ParticleEffectUtils; +import com.gmail.nossr50.core.util.skills.RankUtils; import com.google.common.collect.ImmutableList; -import org.bukkit.Color; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.entity.Tameable; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/SkillManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/SkillManager.java index 3866baa0b..48c01b587 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/SkillManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/SkillManager.java @@ -3,9 +3,9 @@ package com.gmail.nossr50.core.skills; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import org.bukkit.entity.Entity; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; +import com.gmail.nossr50.core.mcmmo.entity.Entity; +import com.gmail.nossr50.core.mcmmo.entity.Living; +import com.gmail.nossr50.core.mcmmo.entity.Player; public abstract class SkillManager { protected McMMOPlayer mcMMOPlayer; @@ -47,7 +47,7 @@ public abstract class SkillManager { mcMMOPlayer.beginXpGain(skill, xp, xpGainReason, xpGainSource); } - public XPGainReason getXPGainReason(LivingEntity target, Entity damager) { + public XPGainReason getXPGainReason(Living target, Entity damager) { return (damager instanceof Player && target instanceof Player) ? XPGainReason.PVP : XPGainReason.PVE; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableManager.java index 5f962bc19..53d93e7d5 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableManager.java @@ -31,7 +31,7 @@ public interface SalvageableManager { /** * Checks if an item is salvageable * - * @param itemStack Item to check if salvageable + * @param itemStack ItemStack to check if salvageable * @return true if salvageable, false if not */ public boolean isSalvageable(ItemStack itemStack); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java index 1bf1a25ee..158d5d65f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java @@ -5,28 +5,23 @@ import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.mcmmo.block.BlockState; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; +import com.gmail.nossr50.core.runnables.skills.AbilityCooldownTask; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.runnables.skills.AbilityCooldownTask; -import com.gmail.nossr50.util.BlockUtils; -import com.gmail.nossr50.util.EventUtils; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.random.RandomChanceUtil; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; -import com.gmail.nossr50.util.skills.SkillUtils; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.BlockState; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.entity.TNTPrimed; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.util.BlockUtils; +import com.gmail.nossr50.core.util.EventUtils; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.player.NotificationManager; +import com.gmail.nossr50.core.util.random.RandomChanceUtil; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; +import com.gmail.nossr50.core.util.skills.SkillUtils; import java.util.ArrayList; import java.util.List; @@ -58,7 +53,7 @@ public class MiningManager extends SkillManager { public boolean canDetonate() { Player player = getPlayer(); - return canUseBlastMining() && player.isSneaking() && player.getInventory().getItemInMainHand().getType() == BlastMining.detonator && Permissions.remoteDetonation(player); + return canUseBlastMining() && player.isSneaking() && player.getItemInMainHand().getType() == BlastMining.detonator && Permissions.remoteDetonation(player); } public boolean canUseBlastMining() { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java index 6edcf28c7..3ba382af0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java @@ -298,7 +298,7 @@ public class RepairManager extends SkillManager { /** * Handles removing & downgrading enchants. * - * @param item Item being repaired + * @param item ItemStack being repaired */ private void addEnchants(ItemStack item) { Player player = getPlayer(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableManager.java index 00a225ff7..96bbc537e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableManager.java @@ -31,7 +31,7 @@ public interface RepairableManager { /** * Checks if an item is repairable * - * @param itemStack Item to check if repairable + * @param itemStack ItemStack to check if repairable * @return true if repairable, false if not */ public boolean isRepairable(ItemStack itemStack); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java index da2056813..dd8e3c247 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java @@ -59,7 +59,7 @@ public class Unarmed { } if (amount <= 0) - event.getItem().remove(); //Cleanup Item + event.getItem().remove(); //Cleanup ItemStack else event.getItem().getItemStack().setAmount(amount); diff --git a/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java index 2649fe765..9e045adff 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java @@ -18,7 +18,7 @@ public final class ItemUtils { /** * Checks if the item is a bow. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a bow, false otherwise */ public static boolean isBow(ItemStack item) { @@ -36,7 +36,7 @@ public final class ItemUtils { /** * Checks if the item is a sword. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a sword, false otherwise */ public static boolean isSword(ItemStack item) { @@ -58,7 +58,7 @@ public final class ItemUtils { /** * Checks if the item is a hoe. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a hoe, false otherwise */ public static boolean isHoe(ItemStack item) { @@ -80,7 +80,7 @@ public final class ItemUtils { /** * Checks if the item is a shovel. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a shovel, false otherwise */ public static boolean isShovel(ItemStack item) { @@ -102,7 +102,7 @@ public final class ItemUtils { /** * Checks if the item is an axe. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is an axe, false otherwise */ public static boolean isAxe(ItemStack item) { @@ -124,7 +124,7 @@ public final class ItemUtils { /** * Checks if the item is a pickaxe. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a pickaxe, false otherwise */ public static boolean isPickaxe(ItemStack item) { @@ -146,7 +146,7 @@ public final class ItemUtils { /** * Checks if the item counts as unarmed. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item counts as unarmed, false otherwise */ public static boolean isUnarmed(ItemStack item) { @@ -160,7 +160,7 @@ public final class ItemUtils { /** * Checks if the item is a helmet. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a helmet, false otherwise */ public static boolean isHelmet(ItemStack item) { @@ -182,7 +182,7 @@ public final class ItemUtils { /** * Checks if the item is a chestplate. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a chestplate, false otherwise */ public static boolean isChestplate(ItemStack item) { @@ -204,7 +204,7 @@ public final class ItemUtils { /** * Checks if the item is a pair of pants. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a pair of pants, false otherwise */ public static boolean isLeggings(ItemStack item) { @@ -226,7 +226,7 @@ public final class ItemUtils { /** * Checks if the item is a pair of boots. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a pair of boots, false otherwise */ public static boolean isBoots(ItemStack item) { @@ -248,7 +248,7 @@ public final class ItemUtils { /** * Checks to see if an item is a wearable armor piece. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is armor, false otherwise */ public static boolean isArmor(ItemStack item) { @@ -258,7 +258,7 @@ public final class ItemUtils { /** * Checks to see if an item is a wearable *vanilla* armor piece. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is armor, false otherwise */ public static boolean isMinecraftArmor(ItemStack item) { @@ -268,7 +268,7 @@ public final class ItemUtils { /** * Checks to see if an item is a leather armor piece. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is leather armor, false otherwise */ public static boolean isLeatherArmor(ItemStack item) { @@ -287,7 +287,7 @@ public final class ItemUtils { /** * Checks to see if an item is a gold armor piece. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is gold armor, false otherwise */ public static boolean isGoldArmor(ItemStack item) { @@ -306,7 +306,7 @@ public final class ItemUtils { /** * Checks to see if an item is an iron armor piece. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is iron armor, false otherwise */ public static boolean isIronArmor(ItemStack item) { @@ -325,7 +325,7 @@ public final class ItemUtils { /** * Checks to see if an item is a diamond armor piece. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is diamond armor, false otherwise */ public static boolean isDiamondArmor(ItemStack item) { @@ -344,7 +344,7 @@ public final class ItemUtils { /** * Checks to see if an item is a chainmail armor piece. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is chainmail armor, false otherwise */ public static boolean isChainmailArmor(ItemStack item) { @@ -363,7 +363,7 @@ public final class ItemUtils { /** * Checks to see if an item is a *vanilla* tool. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a tool, false otherwise */ public static boolean isMinecraftTool(ItemStack item) { @@ -373,7 +373,7 @@ public final class ItemUtils { /** * Checks to see if an item is a stone tool. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a stone tool, false otherwise */ public static boolean isStoneTool(ItemStack item) { @@ -393,7 +393,7 @@ public final class ItemUtils { /** * Checks to see if an item is a wooden tool. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a wooden tool, false otherwise */ public static boolean isWoodTool(ItemStack item) { @@ -413,7 +413,7 @@ public final class ItemUtils { /** * Checks to see if an item is a string tool. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a string tool, false otherwise */ public static boolean isStringTool(ItemStack item) { @@ -431,7 +431,7 @@ public final class ItemUtils { /** * Checks to see if an item is a gold tool. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a stone tool, false otherwise */ public static boolean isGoldTool(ItemStack item) { @@ -451,7 +451,7 @@ public final class ItemUtils { /** * Checks to see if an item is an iron tool. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is an iron tool, false otherwise */ public static boolean isIronTool(ItemStack item) { @@ -474,7 +474,7 @@ public final class ItemUtils { /** * Checks to see if an item is a diamond tool. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a diamond tool, false otherwise */ public static boolean isDiamondTool(ItemStack item) { @@ -494,7 +494,7 @@ public final class ItemUtils { /** * Checks to see if an item is enchantable. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is enchantable, false otherwise */ public static boolean isEnchantable(ItemStack item) { @@ -535,7 +535,7 @@ public final class ItemUtils { /** * Check if an item is sharable. * - * @param item Item that will get shared + * @param item ItemStack that will get shared * @return True if the item can be shared. */ public static boolean isSharable(ItemStack item) { @@ -549,7 +549,7 @@ public final class ItemUtils { /** * Checks to see if an item is a mining drop. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a mining drop, false otherwise */ public static boolean isMiningDrop(ItemStack item) { @@ -579,7 +579,7 @@ public final class ItemUtils { /** * Checks to see if an item is a herbalism drop. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a herbalism drop, false otherwise */ public static boolean isHerbalismDrop(ItemStack item) { @@ -617,7 +617,7 @@ public final class ItemUtils { /** * Checks to see if an item is a mob drop. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a mob drop, false otherwise */ public static boolean isMobDrop(ItemStack item) { @@ -674,7 +674,7 @@ public final class ItemUtils { /** * Checks to see if an item is a woodcutting drop. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a woodcutting drop, false otherwise */ public static boolean isWoodcuttingDrop(ItemStack item) { @@ -714,7 +714,7 @@ public final class ItemUtils { /** * Checks to see if an item is a miscellaneous drop. These items are read from the config file * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a miscellaneous drop, false otherwise */ public static boolean isMiscDrop(ItemStack item) { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/Misc.java b/core/src/main/java/com/gmail/nossr50/core/util/Misc.java index 9257e44f4..96e3e7237 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/Misc.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/Misc.java @@ -92,7 +92,7 @@ public final class Misc { * * @param location The location to drop the item at * @param itemStack The item to drop - * @return Dropped Item entity or null if invalid or cancelled + * @return Dropped ItemStack entity or null if invalid or cancelled */ public static Item dropItem(Location location, ItemStack itemStack) { if (itemStack.getType() == Material.AIR) { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java b/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java index b28329f50..e8c2af8ac 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java @@ -167,7 +167,7 @@ public class ModManager { /** * Checks to see if an item is a custom tool. * - * @param item Item to check + * @param item ItemStack to check * @return true if the item is a custom tool, false otherwise */ public boolean isCustomTool(ItemStack item) { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarManager.java b/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarManager.java index 85cf33a46..240bf7251 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarManager.java @@ -25,7 +25,7 @@ public class ExperienceBarManager { this.mcMMOPlayer = mcMMOPlayer; } - public void updateExperienceBar(PrimarySkillType primarySkillType, Plugin plugin) { + public void updateExperienceBar(PrimarySkillType primarySkillType) { if (!ExperienceConfig.getInstance().isExperienceBarsEnabled() || !ExperienceConfig.getInstance().isExperienceBarEnabled(primarySkillType)) return; @@ -45,15 +45,15 @@ public class ExperienceBarManager { //Setup Hide Bar Task if (experienceBarHideTaskHashMap.get(primarySkillType) != null) { experienceBarHideTaskHashMap.get(primarySkillType).cancel(); - scheduleHideTask(primarySkillType, plugin); + scheduleHideTask(primarySkillType); } else { - scheduleHideTask(primarySkillType, plugin); + scheduleHideTask(primarySkillType); } } - private void scheduleHideTask(PrimarySkillType primarySkillType, Plugin plugin) { + private void scheduleHideTask(PrimarySkillType primarySkillType) { ExperienceBarHideTask experienceBarHideTask = new ExperienceBarHideTask(this, mcMMOPlayer, primarySkillType); - experienceBarHideTask.runTaskLater(plugin, 20 * 2); + experienceBarHideTask.runTaskLater(20 * 2); experienceBarHideTaskHashMap.put(primarySkillType, experienceBarHideTask); } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/RankUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/RankUtils.java index 8db36fea9..d6cc3a763 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/RankUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/RankUtils.java @@ -3,14 +3,12 @@ package com.gmail.nossr50.core.util.skills; import com.gmail.nossr50.core.config.RankConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.runnables.skills.SkillUnlockNotificationTask; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; -import com.gmail.nossr50.listeners.InteractionManager; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; import java.util.HashMap; @@ -18,12 +16,11 @@ public class RankUtils { private static HashMap> subSkillRanks; /** - * @param plugin plugin instance ref * @param mcMMOPlayer target player * @param primarySkillType * @param newLevel the new level of this skill */ - public static void executeSkillUnlockNotifications(Plugin plugin, McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType, int newLevel) { + public static void executeSkillUnlockNotifications(McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType, int newLevel) { int count = 0; for (SubSkillType subSkillType : primarySkillType.getSkillAbilities()) { @@ -39,7 +36,7 @@ public class RankUtils { if (newLevel == innerMap.get(playerRankInSkill)) { SkillUnlockNotificationTask skillUnlockNotificationTask = new SkillUnlockNotificationTask(mcMMOPlayer, subSkillType, newLevel); - skillUnlockNotificationTask.runTaskLater(plugin, ((count * 4) + 1) * 20); + skillUnlockNotificationTask.runTaskLater(((count * 4) + 1) * 20); count++; } From 261d571be17643aa6830c777ad866134f02f0e50 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 13 Feb 2019 09:02:30 -0800 Subject: [PATCH 15/28] expanding the abstraction (this is going to happen a lot) --- .../commands/party/PartyDisbandCommand.java | 2 +- .../commands/party/PartyKickCommand.java | 2 +- .../commands/party/PartyQuitCommand.java | 2 +- .../commands/party/PartyRenameCommand.java | 2 +- .../nossr50/listeners/BlockListener.java | 4 +-- .../nossr50/listeners/EntityListener.java | 6 ++--- .../nossr50/listeners/InventoryListener.java | 2 +- .../gmail/nossr50/listeners/SelfListener.java | 6 ++--- .../com/gmail/nossr50/core/McmmoCore.java | 14 ++++++++++ .../nossr50/core/chat/AdminChatManager.java | 9 +++---- .../gmail/nossr50/core/chat/ChatManager.java | 14 +++++----- .../core/datatypes/player/McMMOPlayer.java | 2 +- .../events/chat/McMMOAdminChatEvent.java | 2 +- .../core}/events/chat/McMMOChatEvent.java | 2 +- .../events/chat/McMMOPartyChatEvent.java | 2 +- .../McMMOPlayerExperienceEvent.java | 2 +- .../McMMOPlayerLevelChangeEvent.java | 2 +- .../experience/McMMOPlayerLevelDownEvent.java | 2 +- .../experience/McMMOPlayerLevelUpEvent.java | 2 +- .../experience/McMMOPlayerXpGainEvent.java | 2 +- .../events/fake/FakeBlockBreakEvent.java | 2 +- .../events/fake/FakeBlockDamageEvent.java | 2 +- .../core}/events/fake/FakeBrewEvent.java | 2 +- .../fake/FakeEntityDamageByEntityEvent.java | 2 +- .../events/fake/FakeEntityDamageEvent.java | 2 +- .../events/fake/FakeEntityTameEvent.java | 2 +- .../events/fake/FakePlayerAnimationEvent.java | 2 +- .../events/fake/FakePlayerFishEvent.java | 2 +- .../McMMOPlayerDeathPenaltyEvent.java | 2 +- .../McMMOPlayerPreDeathPenaltyEvent.java | 2 +- .../hardcore/McMMOPlayerStatLossEvent.java | 2 +- .../hardcore/McMMOPlayerVampirismEvent.java | 2 +- .../events/items/McMMOItemSpawnEvent.java | 2 +- .../party/McMMOPartyAllianceChangeEvent.java | 2 +- .../events/party/McMMOPartyChangeEvent.java | 2 +- .../events/party/McMMOPartyLevelUpEvent.java | 2 +- .../events/party/McMMOPartyTeleportEvent.java | 2 +- .../events/party/McMMOPartyXpGainEvent.java | 2 +- .../scoreboard/McMMOScoreboardEvent.java | 2 +- .../McMMOScoreboardMakeboardEvent.java | 2 +- .../McMMOScoreboardObjectiveEvent.java | 2 +- .../McMMOScoreboardRevertEvent.java | 2 +- .../scoreboard/ScoreboardEventReason.java | 2 +- .../ScoreboardObjectiveEventReason.java | 2 +- .../skills/McMMOPlayerNotificationEvent.java | 2 +- .../events/skills/McMMOPlayerSkillEvent.java | 2 +- .../McMMOPlayerAbilityActivateEvent.java | 2 +- .../McMMOPlayerAbilityDeactivateEvent.java | 2 +- .../abilities/McMMOPlayerAbilityEvent.java | 4 +-- .../skills/alchemy/McMMOPlayerBrewEvent.java | 4 +-- .../alchemy/McMMOPlayerCatalysisEvent.java | 4 +-- .../fishing/McMMOPlayerFishingEvent.java | 4 +-- .../McMMOPlayerFishingTreasureEvent.java | 2 +- .../fishing/McMMOPlayerMagicHunterEvent.java | 2 +- .../skills/fishing/McMMOPlayerShakeEvent.java | 2 +- .../repair/McMMOPlayerRepairCheckEvent.java | 4 +-- .../salvage/McMMOPlayerSalvageCheckEvent.java | 4 +-- .../secondaryabilities/SubSkillEvent.java | 4 +-- .../SubSkillRandomCheckEvent.java | 2 +- .../unarmed/McMMOPlayerDisarmEvent.java | 4 +-- .../nossr50/core/mcmmo/colors/Color.java | 2 +- .../nossr50/core/mcmmo/entity/Player.java | 3 ++- .../nossr50/core/mcmmo/entity/Tameable.java | 2 +- .../core/mcmmo/event/EventCommander.java | 10 +++++++ .../core/mcmmo/permissions/Permissible.java | 13 +++++++++ .../nossr50/core/mcmmo/server/Server.java | 27 +++++++++++++++++++ .../nossr50/core/skills/PrimarySkillType.java | 7 +++-- .../nossr50/core/skills/SuperAbilityType.java | 11 ++++---- .../gmail/nossr50/core/util/Permissions.java | 12 ++------- 69 files changed, 158 insertions(+), 106 deletions(-) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/chat/McMMOAdminChatEvent.java (91%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/chat/McMMOChatEvent.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/chat/McMMOPartyChatEvent.java (94%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/experience/McMMOPlayerExperienceEvent.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/experience/McMMOPlayerLevelChangeEvent.java (92%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/experience/McMMOPlayerLevelDownEvent.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/experience/McMMOPlayerLevelUpEvent.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/experience/McMMOPlayerXpGainEvent.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/fake/FakeBlockBreakEvent.java (88%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/fake/FakeBlockDamageEvent.java (91%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/fake/FakeBrewEvent.java (87%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/fake/FakeEntityDamageByEntityEvent.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/fake/FakeEntityDamageEvent.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/fake/FakeEntityTameEvent.java (89%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/fake/FakePlayerAnimationEvent.java (87%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/fake/FakePlayerFishEvent.java (89%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/hardcore/McMMOPlayerDeathPenaltyEvent.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/hardcore/McMMOPlayerPreDeathPenaltyEvent.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/hardcore/McMMOPlayerStatLossEvent.java (87%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/hardcore/McMMOPlayerVampirismEvent.java (91%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/items/McMMOItemSpawnEvent.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/party/McMMOPartyAllianceChangeEvent.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/party/McMMOPartyChangeEvent.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/party/McMMOPartyLevelUpEvent.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/party/McMMOPartyTeleportEvent.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/party/McMMOPartyXpGainEvent.java (97%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/scoreboard/McMMOScoreboardEvent.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/scoreboard/McMMOScoreboardMakeboardEvent.java (93%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/scoreboard/McMMOScoreboardObjectiveEvent.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/scoreboard/McMMOScoreboardRevertEvent.java (93%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/scoreboard/ScoreboardEventReason.java (67%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/scoreboard/ScoreboardObjectiveEventReason.java (68%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/skills/McMMOPlayerNotificationEvent.java (98%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/skills/McMMOPlayerSkillEvent.java (96%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/skills/abilities/McMMOPlayerAbilityActivateEvent.java (90%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/skills/abilities/McMMOPlayerAbilityDeactivateEvent.java (84%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/skills/abilities/McMMOPlayerAbilityEvent.java (79%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/skills/alchemy/McMMOPlayerBrewEvent.java (88%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/skills/alchemy/McMMOPlayerCatalysisEvent.java (86%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/skills/fishing/McMMOPlayerFishingEvent.java (81%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/skills/fishing/McMMOPlayerFishingTreasureEvent.java (92%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/skills/fishing/McMMOPlayerMagicHunterEvent.java (91%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/skills/fishing/McMMOPlayerShakeEvent.java (88%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/skills/repair/McMMOPlayerRepairCheckEvent.java (92%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java (92%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/skills/secondaryabilities/SubSkillEvent.java (91%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java (95%) rename {bukkit/src/main/java/com/gmail/nossr50 => core/src/main/java/com/gmail/nossr50/core}/events/skills/unarmed/McMMOPlayerDisarmEvent.java (85%) create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/event/EventCommander.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/permissions/Permissible.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/server/Server.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java index 6001a512e..0a740f02e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java @@ -4,7 +4,7 @@ import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; +import com.gmail.nossr50.core.events.party.McMMOPartyChangeEvent.EventReason; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java index 7b969845d..51115f9f5 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java @@ -5,7 +5,7 @@ import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; +import com.gmail.nossr50.core.events.party.McMMOPartyChangeEvent.EventReason; import com.gmail.nossr50.mcMMO; import org.bukkit.OfflinePlayer; import org.bukkit.command.Command; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java index 2097451c4..dfd6afe19 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java @@ -5,7 +5,7 @@ import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; +import com.gmail.nossr50.core.events.party.McMMOPartyChangeEvent.EventReason; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java index 802f1797e..1db6a2fec 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java @@ -5,7 +5,7 @@ import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; +import com.gmail.nossr50.core.events.party.McMMOPartyChangeEvent.EventReason; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index 515dcdf64..f21e36b17 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -26,8 +26,8 @@ import com.gmail.nossr50.core.util.sounds.SoundManager; import com.gmail.nossr50.core.util.sounds.SoundType; import com.gmail.nossr50.core.worldguard.WorldGuardManager; import com.gmail.nossr50.core.worldguard.WorldGuardUtils; -import com.gmail.nossr50.events.fake.FakeBlockBreakEvent; -import com.gmail.nossr50.events.fake.FakeBlockDamageEvent; +import com.gmail.nossr50.core.events.fake.FakeBlockBreakEvent; +import com.gmail.nossr50.core.events.fake.FakeBlockDamageEvent; import com.gmail.nossr50.mcMMO; import org.bukkit.GameMode; import org.bukkit.Location; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 20e14784c..9e4bb2e14 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -22,9 +22,9 @@ import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.skills.CombatUtils; import com.gmail.nossr50.core.worldguard.WorldGuardManager; import com.gmail.nossr50.core.worldguard.WorldGuardUtils; -import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent; -import com.gmail.nossr50.events.fake.FakeEntityDamageEvent; -import com.gmail.nossr50.events.fake.FakeEntityTameEvent; +import com.gmail.nossr50.core.events.fake.FakeEntityDamageByEntityEvent; +import com.gmail.nossr50.core.events.fake.FakeEntityDamageEvent; +import com.gmail.nossr50.core.events.fake.FakeEntityTameEvent; import com.gmail.nossr50.mcMMO; import org.bukkit.Material; import org.bukkit.OfflinePlayer; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java index 0be341eef..02069c47a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java @@ -13,7 +13,7 @@ import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.skills.SkillUtils; import com.gmail.nossr50.core.worldguard.WorldGuardManager; import com.gmail.nossr50.core.worldguard.WorldGuardUtils; -import com.gmail.nossr50.events.fake.FakeBrewEvent; +import com.gmail.nossr50.core.events.fake.FakeBrewEvent; import com.gmail.nossr50.mcMMO; import org.bukkit.Location; import org.bukkit.Material; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java index 74d2d1939..bb83c1340 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java @@ -9,9 +9,9 @@ import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.core.worldguard.WorldGuardManager; import com.gmail.nossr50.core.worldguard.WorldGuardUtils; -import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent; -import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent; -import com.gmail.nossr50.events.skills.abilities.McMMOPlayerAbilityActivateEvent; +import com.gmail.nossr50.core.events.experience.McMMOPlayerLevelUpEvent; +import com.gmail.nossr50.core.events.experience.McMMOPlayerXpGainEvent; +import com.gmail.nossr50.core.events.skills.abilities.McMMOPlayerAbilityActivateEvent; import com.gmail.nossr50.mcMMO; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; diff --git a/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java b/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java index 885aa7db2..09aaa8389 100644 --- a/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java +++ b/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java @@ -1,11 +1,17 @@ package com.gmail.nossr50.core; +import com.gmail.nossr50.core.mcmmo.event.EventCommander; import com.gmail.nossr50.core.mcmmo.plugin.Plugin; +import com.gmail.nossr50.core.mcmmo.server.Server; import java.util.logging.Logger; public class McmmoCore { + //TODO: Wire all this stuff public static Plugin p; + private static EventCommander eventCommander; + private static Server server; + private static Logger logger; /** * Returns our Logger @@ -13,6 +19,14 @@ public class McmmoCore { */ public static Logger getLogger() { + return logger; + } + public static EventCommander getEventCommander() { + return eventCommander; + } + + public static Server getServer() { + return server; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/chat/AdminChatManager.java b/core/src/main/java/com/gmail/nossr50/core/chat/AdminChatManager.java index bc8e3a5c0..d016c622c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/chat/AdminChatManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/chat/AdminChatManager.java @@ -1,17 +1,16 @@ package com.gmail.nossr50.core.chat; import com.gmail.nossr50.core.config.Config; -import com.gmail.nossr50.events.chat.McMMOAdminChatEvent; -import org.bukkit.plugin.Plugin; +import com.gmail.nossr50.core.events.chat.McMMOAdminChatEvent; public class AdminChatManager extends ChatManager { - protected AdminChatManager(Plugin plugin) { - super(plugin, Config.getInstance().getAdminDisplayNames(), Config.getInstance().getAdminChatPrefix()); + protected AdminChatManager() { + super(Config.getInstance().getAdminDisplayNames(), Config.getInstance().getAdminChatPrefix()); } @Override public void handleChat(String senderName, String displayName, String message, boolean isAsync) { - handleChat(new McMMOAdminChatEvent(plugin, senderName, displayName, message, isAsync)); + handleChat(new McMMOAdminChatEvent(senderName, displayName, message, isAsync)); } @Override diff --git a/core/src/main/java/com/gmail/nossr50/core/chat/ChatManager.java b/core/src/main/java/com/gmail/nossr50/core/chat/ChatManager.java index 92bfc7067..373a96c5a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/chat/ChatManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/chat/ChatManager.java @@ -1,15 +1,14 @@ package com.gmail.nossr50.core.chat; +import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.events.chat.McMMOChatEvent; +import com.gmail.nossr50.core.events.chat.McMMOPartyChatEvent; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.events.chat.McMMOChatEvent; -import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; +import com.gmail.nossr50.core.mcmmo.entity.Player; public abstract class ChatManager { - protected Plugin plugin; protected boolean useDisplayNames; protected String chatPrefix; @@ -17,14 +16,13 @@ public abstract class ChatManager { protected String displayName; protected String message; - protected ChatManager(Plugin plugin, boolean useDisplayNames, String chatPrefix) { - this.plugin = plugin; + protected ChatManager(boolean useDisplayNames, String chatPrefix) { this.useDisplayNames = useDisplayNames; this.chatPrefix = chatPrefix; } protected void handleChat(McMMOChatEvent event) { - plugin.getServer().getPluginManager().callEvent(event); + McmmoCore.getEventCommander().callEvent(event); if (event.isCancelled()) { return; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java index 16de62109..47cf36dd1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java @@ -147,7 +147,7 @@ public class McMMOPlayer { } public void processUnlockNotifications(PrimarySkillType primarySkillType, int skillLevel) { - RankUtils.executeSkillUnlockNotifications(primarySkillType, skillLevel); + RankUtils.executeSkillUnlockNotifications(this, primarySkillType, skillLevel); } public void updateXPBar(PrimarySkillType primarySkillType) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/chat/McMMOAdminChatEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOAdminChatEvent.java similarity index 91% rename from bukkit/src/main/java/com/gmail/nossr50/events/chat/McMMOAdminChatEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOAdminChatEvent.java index 089a5917f..b307904b1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/chat/McMMOAdminChatEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOAdminChatEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.chat; +package com.gmail.nossr50.core.events.chat; import org.bukkit.plugin.Plugin; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/chat/McMMOChatEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOChatEvent.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/events/chat/McMMOChatEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOChatEvent.java index ce13caf12..7708d2a47 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/chat/McMMOChatEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOChatEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.chat; +package com.gmail.nossr50.core.events.chat; import org.bukkit.event.Cancellable; import org.bukkit.event.Event; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/chat/McMMOPartyChatEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOPartyChatEvent.java similarity index 94% rename from bukkit/src/main/java/com/gmail/nossr50/events/chat/McMMOPartyChatEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOPartyChatEvent.java index ffa54f815..970ce811e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/chat/McMMOPartyChatEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOPartyChatEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.chat; +package com.gmail.nossr50.core.events.chat; import org.bukkit.plugin.Plugin; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerExperienceEvent.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerExperienceEvent.java index a19cc810d..247f8d3c4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerExperienceEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.experience; +package com.gmail.nossr50.core.events.experience; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelChangeEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelChangeEvent.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelChangeEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelChangeEvent.java index 316c1c6d4..3c769a19c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelChangeEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelChangeEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.experience; +package com.gmail.nossr50.core.events.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.skills.PrimarySkillType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelDownEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelDownEvent.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelDownEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelDownEvent.java index 183cced08..b153d2c1f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelDownEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelDownEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.experience; +package com.gmail.nossr50.core.events.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.skills.PrimarySkillType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelUpEvent.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelUpEvent.java index 1dd843d7e..342c5479a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelUpEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.experience; +package com.gmail.nossr50.core.events.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.skills.PrimarySkillType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerXpGainEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerXpGainEvent.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerXpGainEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerXpGainEvent.java index c3290569d..3c5febfb2 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerXpGainEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerXpGainEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.experience; +package com.gmail.nossr50.core.events.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.skills.PrimarySkillType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/fake/FakeBlockBreakEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBlockBreakEvent.java similarity index 88% rename from bukkit/src/main/java/com/gmail/nossr50/events/fake/FakeBlockBreakEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBlockBreakEvent.java index 7a2f7ab08..11892986c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/fake/FakeBlockBreakEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBlockBreakEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.fake; +package com.gmail.nossr50.core.events.fake; import org.bukkit.block.Block; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/fake/FakeBlockDamageEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBlockDamageEvent.java similarity index 91% rename from bukkit/src/main/java/com/gmail/nossr50/events/fake/FakeBlockDamageEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBlockDamageEvent.java index 31dbb7a53..06442f1c8 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/fake/FakeBlockDamageEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBlockDamageEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.fake; +package com.gmail.nossr50.core.events.fake; import org.bukkit.block.Block; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/fake/FakeBrewEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBrewEvent.java similarity index 87% rename from bukkit/src/main/java/com/gmail/nossr50/events/fake/FakeBrewEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBrewEvent.java index e7ef73c3e..f50ef5574 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/fake/FakeBrewEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBrewEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.fake; +package com.gmail.nossr50.core.events.fake; import org.bukkit.block.Block; import org.bukkit.event.inventory.BrewEvent; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/fake/FakeEntityDamageByEntityEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityDamageByEntityEvent.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/events/fake/FakeEntityDamageByEntityEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityDamageByEntityEvent.java index 840f039f6..5776eee32 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/fake/FakeEntityDamageByEntityEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityDamageByEntityEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.fake; +package com.gmail.nossr50.core.events.fake; import com.google.common.base.Function; import com.google.common.base.Functions; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/fake/FakeEntityDamageEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityDamageEvent.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/events/fake/FakeEntityDamageEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityDamageEvent.java index 0ec008672..ff0b2fd58 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/fake/FakeEntityDamageEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityDamageEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.fake; +package com.gmail.nossr50.core.events.fake; import com.google.common.base.Function; import com.google.common.base.Functions; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/fake/FakeEntityTameEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityTameEvent.java similarity index 89% rename from bukkit/src/main/java/com/gmail/nossr50/events/fake/FakeEntityTameEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityTameEvent.java index 46adfe737..078a866fc 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/fake/FakeEntityTameEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityTameEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.fake; +package com.gmail.nossr50.core.events.fake; import org.bukkit.entity.AnimalTamer; import org.bukkit.entity.LivingEntity; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/fake/FakePlayerAnimationEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakePlayerAnimationEvent.java similarity index 87% rename from bukkit/src/main/java/com/gmail/nossr50/events/fake/FakePlayerAnimationEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/fake/FakePlayerAnimationEvent.java index c6e2cbaab..61263c64f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/fake/FakePlayerAnimationEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakePlayerAnimationEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.fake; +package com.gmail.nossr50.core.events.fake; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerAnimationEvent; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/fake/FakePlayerFishEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakePlayerFishEvent.java similarity index 89% rename from bukkit/src/main/java/com/gmail/nossr50/events/fake/FakePlayerFishEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/fake/FakePlayerFishEvent.java index 235af9934..746c03abc 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/fake/FakePlayerFishEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakePlayerFishEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.fake; +package com.gmail.nossr50.core.events.fake; import org.bukkit.entity.Entity; import org.bukkit.entity.FishHook; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerDeathPenaltyEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerDeathPenaltyEvent.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerDeathPenaltyEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerDeathPenaltyEvent.java index a6035351c..212b21b63 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerDeathPenaltyEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerDeathPenaltyEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.hardcore; +package com.gmail.nossr50.core.events.hardcore; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerPreDeathPenaltyEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerPreDeathPenaltyEvent.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerPreDeathPenaltyEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerPreDeathPenaltyEvent.java index 7e8b8fb22..6093ecf3f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerPreDeathPenaltyEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerPreDeathPenaltyEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.hardcore; +package com.gmail.nossr50.core.events.hardcore; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerStatLossEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerStatLossEvent.java similarity index 87% rename from bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerStatLossEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerStatLossEvent.java index 414ffdac5..158390b13 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerStatLossEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerStatLossEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.hardcore; +package com.gmail.nossr50.core.events.hardcore; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerVampirismEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerVampirismEvent.java similarity index 91% rename from bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerVampirismEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerVampirismEvent.java index 735094f67..f7162b8fb 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerVampirismEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerVampirismEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.hardcore; +package com.gmail.nossr50.core.events.hardcore; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/items/McMMOItemSpawnEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/items/McMMOItemSpawnEvent.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/events/items/McMMOItemSpawnEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/items/McMMOItemSpawnEvent.java index 5756fe5fe..d4790bb89 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/items/McMMOItemSpawnEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/items/McMMOItemSpawnEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.items; +package com.gmail.nossr50.core.events.items; import org.bukkit.Location; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyAllianceChangeEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyAllianceChangeEvent.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyAllianceChangeEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyAllianceChangeEvent.java index 4a57ca955..6d3f7a419 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyAllianceChangeEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyAllianceChangeEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.party; +package com.gmail.nossr50.core.events.party; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyChangeEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyChangeEvent.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyChangeEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyChangeEvent.java index 00fea8f2c..24b200218 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyChangeEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyChangeEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.party; +package com.gmail.nossr50.core.events.party; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyLevelUpEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyLevelUpEvent.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyLevelUpEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyLevelUpEvent.java index 78ade045c..4e70108fa 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyLevelUpEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyLevelUpEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.party; +package com.gmail.nossr50.core.events.party; import com.gmail.nossr50.core.datatypes.party.Party; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyTeleportEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyTeleportEvent.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyTeleportEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyTeleportEvent.java index 7139e3264..9be1111ad 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyTeleportEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyTeleportEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.party; +package com.gmail.nossr50.core.events.party; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyXpGainEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyXpGainEvent.java similarity index 97% rename from bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyXpGainEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyXpGainEvent.java index 2854ac512..234721ffe 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyXpGainEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyXpGainEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.party; +package com.gmail.nossr50.core.events.party; import com.gmail.nossr50.core.datatypes.party.Party; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardEvent.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardEvent.java index b7b608716..2246c8b2e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.scoreboard; +package com.gmail.nossr50.core.events.scoreboard; import org.bukkit.entity.Player; import org.bukkit.event.Event; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardMakeboardEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardMakeboardEvent.java similarity index 93% rename from bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardMakeboardEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardMakeboardEvent.java index 8418e0ad8..4d8ffec8d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardMakeboardEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardMakeboardEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.scoreboard; +package com.gmail.nossr50.core.events.scoreboard; import org.bukkit.entity.Player; import org.bukkit.scoreboard.Scoreboard; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardObjectiveEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardObjectiveEvent.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardObjectiveEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardObjectiveEvent.java index 41ffb01a2..fe471604a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardObjectiveEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardObjectiveEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.scoreboard; +package com.gmail.nossr50.core.events.scoreboard; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardRevertEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardRevertEvent.java similarity index 93% rename from bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardRevertEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardRevertEvent.java index 000a19a54..dbe261e91 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardRevertEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardRevertEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.scoreboard; +package com.gmail.nossr50.core.events.scoreboard; import org.bukkit.entity.Player; import org.bukkit.scoreboard.Scoreboard; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/ScoreboardEventReason.java b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/ScoreboardEventReason.java similarity index 67% rename from bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/ScoreboardEventReason.java rename to core/src/main/java/com/gmail/nossr50/core/events/scoreboard/ScoreboardEventReason.java index 6fe31c898..7097e0f8c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/ScoreboardEventReason.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/ScoreboardEventReason.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.scoreboard; +package com.gmail.nossr50.core.events.scoreboard; public enum ScoreboardEventReason { CREATING_NEW_SCOREBOARD, diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/ScoreboardObjectiveEventReason.java b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/ScoreboardObjectiveEventReason.java similarity index 68% rename from bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/ScoreboardObjectiveEventReason.java rename to core/src/main/java/com/gmail/nossr50/core/events/scoreboard/ScoreboardObjectiveEventReason.java index 0f0cda63c..eb11d3b8a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/ScoreboardObjectiveEventReason.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/ScoreboardObjectiveEventReason.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.scoreboard; +package com.gmail.nossr50.core.events.scoreboard; public enum ScoreboardObjectiveEventReason { UNREGISTER_THIS_OBJECTIVE, diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/McMMOPlayerNotificationEvent.java similarity index 98% rename from bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/skills/McMMOPlayerNotificationEvent.java index 046eb65d8..02564d84a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/McMMOPlayerNotificationEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.skills; +package com.gmail.nossr50.core.events.skills; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import net.md_5.bungee.api.ChatMessageType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/McMMOPlayerSkillEvent.java similarity index 96% rename from bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/skills/McMMOPlayerSkillEvent.java index 0bcafac90..4ddc9ffb1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/McMMOPlayerSkillEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.skills; +package com.gmail.nossr50.core.events.skills; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.skills.PrimarySkillType; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityActivateEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityActivateEvent.java similarity index 90% rename from bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityActivateEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityActivateEvent.java index baf52c70f..241b669ee 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityActivateEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityActivateEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.skills.abilities; +package com.gmail.nossr50.core.events.skills.abilities; import com.gmail.nossr50.core.skills.PrimarySkillType; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityDeactivateEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityDeactivateEvent.java similarity index 84% rename from bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityDeactivateEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityDeactivateEvent.java index b2f85065e..e1c6a2d64 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityDeactivateEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityDeactivateEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.skills.abilities; +package com.gmail.nossr50.core.events.skills.abilities; import com.gmail.nossr50.core.skills.PrimarySkillType; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityEvent.java similarity index 79% rename from bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityEvent.java index b082af019..1ff35b90a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/abilities/McMMOPlayerAbilityEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityEvent.java @@ -1,8 +1,8 @@ -package com.gmail.nossr50.events.skills.abilities; +package com.gmail.nossr50.core.events.skills.abilities; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; +import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; public class McMMOPlayerAbilityEvent extends McMMOPlayerSkillEvent { diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerBrewEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/alchemy/McMMOPlayerBrewEvent.java similarity index 88% rename from bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerBrewEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/skills/alchemy/McMMOPlayerBrewEvent.java index f240b10e6..1a1ec0d19 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerBrewEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/alchemy/McMMOPlayerBrewEvent.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.events.skills.alchemy; +package com.gmail.nossr50.core.events.skills.alchemy; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; +import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent; import org.bukkit.block.Block; import org.bukkit.block.BlockState; import org.bukkit.block.BrewingStand; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerCatalysisEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/alchemy/McMMOPlayerCatalysisEvent.java similarity index 86% rename from bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerCatalysisEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/skills/alchemy/McMMOPlayerCatalysisEvent.java index 0afe839bb..499b9fc7f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/alchemy/McMMOPlayerCatalysisEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/alchemy/McMMOPlayerCatalysisEvent.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.events.skills.alchemy; +package com.gmail.nossr50.core.events.skills.alchemy; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; +import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerFishingEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerFishingEvent.java similarity index 81% rename from bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerFishingEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerFishingEvent.java index 215627eb5..981573842 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerFishingEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerFishingEvent.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.events.skills.fishing; +package com.gmail.nossr50.core.events.skills.fishing; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; +import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerFishingTreasureEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerFishingTreasureEvent.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerFishingTreasureEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerFishingTreasureEvent.java index dba01b751..a5c0d5dd3 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerFishingTreasureEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerFishingTreasureEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.skills.fishing; +package com.gmail.nossr50.core.events.skills.fishing; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerMagicHunterEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerMagicHunterEvent.java similarity index 91% rename from bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerMagicHunterEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerMagicHunterEvent.java index 8c993b5a4..017fc0d41 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerMagicHunterEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerMagicHunterEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.skills.fishing; +package com.gmail.nossr50.core.events.skills.fishing; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerShakeEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerShakeEvent.java similarity index 88% rename from bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerShakeEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerShakeEvent.java index 0953569e4..74ba47e16 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/fishing/McMMOPlayerShakeEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerShakeEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.skills.fishing; +package com.gmail.nossr50.core.events.skills.fishing; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/repair/McMMOPlayerRepairCheckEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/repair/McMMOPlayerRepairCheckEvent.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/events/skills/repair/McMMOPlayerRepairCheckEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/skills/repair/McMMOPlayerRepairCheckEvent.java index 1ce52a60c..651a1b18b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/repair/McMMOPlayerRepairCheckEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/repair/McMMOPlayerRepairCheckEvent.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.events.skills.repair; +package com.gmail.nossr50.core.events.skills.repair; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; +import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; import org.bukkit.inventory.ItemStack; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java similarity index 92% rename from bukkit/src/main/java/com/gmail/nossr50/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java index 7a379de9d..c988212ad 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.events.skills.salvage; +package com.gmail.nossr50.core.events.skills.salvage; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; +import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; import org.bukkit.inventory.ItemStack; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/secondaryabilities/SubSkillEvent.java similarity index 91% rename from bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/skills/secondaryabilities/SubSkillEvent.java index 3cbb74d4b..507b9cefd 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/secondaryabilities/SubSkillEvent.java @@ -1,9 +1,9 @@ -package com.gmail.nossr50.events.skills.secondaryabilities; +package com.gmail.nossr50.core.events.skills.secondaryabilities; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; -import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; +import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java similarity index 95% rename from bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java index 2815cbfa4..6e463eafc 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.events.skills.secondaryabilities; +package com.gmail.nossr50.core.events.skills.secondaryabilities; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/unarmed/McMMOPlayerDisarmEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/unarmed/McMMOPlayerDisarmEvent.java similarity index 85% rename from bukkit/src/main/java/com/gmail/nossr50/events/skills/unarmed/McMMOPlayerDisarmEvent.java rename to core/src/main/java/com/gmail/nossr50/core/events/skills/unarmed/McMMOPlayerDisarmEvent.java index e401c1382..0c492684d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/unarmed/McMMOPlayerDisarmEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/unarmed/McMMOPlayerDisarmEvent.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.events.skills.unarmed; +package com.gmail.nossr50.core.events.skills.unarmed; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent; +import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/colors/Color.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/colors/Color.java index e7b045a3f..b44a0b812 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/colors/Color.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/colors/Color.java @@ -25,6 +25,6 @@ public enum Color { Color fromRGB(int r, int g, int b) { - + //TODO: Figure this out later } } diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java index 2e8cf8edd..8ecb7bafd 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java @@ -4,11 +4,12 @@ import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.mcmmo.Nameable; import com.gmail.nossr50.core.mcmmo.inventory.InventoryHolder; import com.gmail.nossr50.core.mcmmo.item.ItemStack; +import com.gmail.nossr50.core.mcmmo.permissions.Permissible; /** * Players */ -public interface Player extends Living, Nameable, InventoryHolder { +public interface Player extends Living, Nameable, InventoryHolder, Permissible { /** * Players are not always online diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Tameable.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Tameable.java index 63e008789..168784877 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Tameable.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Tameable.java @@ -4,5 +4,5 @@ package com.gmail.nossr50.core.mcmmo.entity; * Represents an entity that can be tamed */ public interface Tameable extends Living { - + } diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/EventCommander.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/EventCommander.java new file mode 100644 index 000000000..959da1499 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/EventCommander.java @@ -0,0 +1,10 @@ +package com.gmail.nossr50.core.mcmmo.event; + +public interface EventCommander { + /** + * Calls an event + * @param event the event to call + * @return the event after it has been passed around + */ + Event callEvent(Event event); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/permissions/Permissible.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/permissions/Permissible.java new file mode 100644 index 000000000..6c8a32a80 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/permissions/Permissible.java @@ -0,0 +1,13 @@ +package com.gmail.nossr50.core.mcmmo.permissions; + +/** + * A thing that can have Permissions is a Permissible + */ +public interface Permissible { + /** + * Returns whether or not this Permissible has this permission + * @param path the permission nodes full path + * @return true if the permissible has this permission + */ + boolean hasPermission(String path); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/server/Server.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/server/Server.java new file mode 100644 index 000000000..fd6a4a43e --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/server/Server.java @@ -0,0 +1,27 @@ +package com.gmail.nossr50.core.mcmmo.server; + +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.world.World; + +/** + * Represents the server and its state + */ +public interface Server { + /** + * Broadcasts a msg to every player on the server + * @param msg the message to broadcast + */ + void broadcast(String msg); + + /** + * Gets the online players for this server + * @return the online players for this server + */ + Player[] getOnlinePlayers(); + + /** + * Gets the worlds for this server + * @return the worlds for this server + */ + World[] getWorlds(); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java b/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java index 5fc7b1dfe..94968880f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java @@ -1,11 +1,13 @@ package com.gmail.nossr50.core.skills; +import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.mcmmo.colors.Color; import com.gmail.nossr50.core.mcmmo.entity.Entity; import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.entity.Tameable; import com.gmail.nossr50.core.skills.child.salvage.SalvageManager; import com.gmail.nossr50.core.skills.child.smelting.SmeltingManager; import com.gmail.nossr50.core.skills.primary.acrobatics.AcrobaticsManager; @@ -26,9 +28,6 @@ import com.gmail.nossr50.core.util.StringUtils; import com.gmail.nossr50.core.util.skills.ParticleEffectUtils; import com.gmail.nossr50.core.util.skills.RankUtils; import com.google.common.collect.ImmutableList; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Player; -import org.bukkit.entity.Tameable; import java.util.ArrayList; import java.util.Collections; @@ -120,7 +119,7 @@ public enum PrimarySkillType { } if (!skillName.equalsIgnoreCase("all")) { - mcMMO.p.getLogger().warning("Invalid mcMMO skill (" + skillName + ")"); //TODO: Localize + McmmoCore.getLogger().warning("Invalid mcMMO skill (" + skillName + ")"); //TODO: Localize } return null; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java b/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java index 817127ddd..9f84d67fd 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java @@ -1,12 +1,11 @@ package com.gmail.nossr50.core.skills; import com.gmail.nossr50.core.config.Config; -import com.gmail.nossr50.util.BlockUtils; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.StringUtils; -import org.bukkit.Material; -import org.bukkit.block.BlockState; -import org.bukkit.entity.Player; +import com.gmail.nossr50.core.mcmmo.block.BlockState; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.util.BlockUtils; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.StringUtils; public enum SuperAbilityType { BERSERK( diff --git a/core/src/main/java/com/gmail/nossr50/core/util/Permissions.java b/core/src/main/java/com/gmail/nossr50/core/util/Permissions.java index addbe21df..0055051bb 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/Permissions.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/Permissions.java @@ -1,20 +1,12 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.commands.party.PartySubcommandType; +import com.gmail.nossr50.core.mcmmo.permissions.Permissible; +import com.gmail.nossr50.core.mcmmo.world.World; import com.gmail.nossr50.core.skills.ItemType; import com.gmail.nossr50.core.skills.MaterialType; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; -import com.gmail.nossr50.mcMMO; -import org.bukkit.Material; -import org.bukkit.Server; -import org.bukkit.World; -import org.bukkit.entity.EntityType; -import org.bukkit.permissions.Permissible; -import org.bukkit.permissions.Permission; -import org.bukkit.permissions.PermissionDefault; -import org.bukkit.plugin.PluginManager; public final class Permissions { private Permissions() { From 9383b1c65cb7e3d757a1a54bfc2d8d455e55f178 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 13 Feb 2019 09:12:53 -0800 Subject: [PATCH 16/28] expanding the abstraction again... --- .../nossr50/core/chat/AdminChatManager.java | 3 ++- .../gmail/nossr50/core/chat/ChatManager.java | 2 +- .../core/events/chat/McMMOAdminChatEvent.java | 9 ++++----- .../core/events/chat/McMMOChatEvent.java | 20 +++++++++---------- .../gmail/nossr50/core/mcmmo/Nameable.java | 6 ++++++ .../nossr50/core/mcmmo/entity/Player.java | 6 ++++++ .../nossr50/core/mcmmo/event/Cancellable.java | 2 +- .../nossr50/core/mcmmo/server/Server.java | 7 +++++++ 8 files changed, 36 insertions(+), 19 deletions(-) diff --git a/core/src/main/java/com/gmail/nossr50/core/chat/AdminChatManager.java b/core/src/main/java/com/gmail/nossr50/core/chat/AdminChatManager.java index d016c622c..a206363e8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/chat/AdminChatManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/chat/AdminChatManager.java @@ -1,5 +1,6 @@ package com.gmail.nossr50.core.chat; +import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.events.chat.McMMOAdminChatEvent; @@ -15,6 +16,6 @@ public class AdminChatManager extends ChatManager { @Override protected void sendMessage() { - plugin.getServer().broadcast(message, "mcmmo.chat.adminchat"); + McmmoCore.getServer().broadcast(message, "mcmmo.chat.adminchat"); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/chat/ChatManager.java b/core/src/main/java/com/gmail/nossr50/core/chat/ChatManager.java index 373a96c5a..d9a50846c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/chat/ChatManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/chat/ChatManager.java @@ -43,7 +43,7 @@ public abstract class ChatManager { McMMOPartyChatEvent partyChatEvent = (McMMOPartyChatEvent) event; //Find the people with permissions - for (Player player : event.getPlugin().getServer().getOnlinePlayers()) { + for (Player player : McmmoCore.getServer().getOnlinePlayers()) { //Check for toggled players if (UserManager.getPlayer(player).isPartyChatSpying()) { Party adminParty = UserManager.getPlayer(player).getParty(); diff --git a/core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOAdminChatEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOAdminChatEvent.java index b307904b1..4c0764b4a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOAdminChatEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOAdminChatEvent.java @@ -1,16 +1,15 @@ package com.gmail.nossr50.core.events.chat; -import org.bukkit.plugin.Plugin; /** * Called when a chat is sent to the admin chat channel */ public class McMMOAdminChatEvent extends McMMOChatEvent { - public McMMOAdminChatEvent(Plugin plugin, String sender, String displayName, String message) { - super(plugin, sender, displayName, message); + public McMMOAdminChatEvent(String sender, String displayName, String message) { + super(sender, displayName, message); } - public McMMOAdminChatEvent(Plugin plugin, String sender, String displayName, String message, boolean isAsync) { - super(plugin, sender, displayName, message, isAsync); + public McMMOAdminChatEvent(String sender, String displayName, String message, boolean isAsync) { + super(sender, displayName, message, isAsync); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOChatEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOChatEvent.java index 7708d2a47..c642181b3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOChatEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOChatEvent.java @@ -1,9 +1,7 @@ package com.gmail.nossr50.core.events.chat; -import org.bukkit.event.Cancellable; -import org.bukkit.event.Event; -import org.bukkit.event.HandlerList; -import org.bukkit.plugin.Plugin; +import com.gmail.nossr50.core.mcmmo.event.Cancellable; +import com.gmail.nossr50.core.mcmmo.event.Event; public abstract class McMMOChatEvent extends Event implements Cancellable { /** @@ -11,36 +9,36 @@ public abstract class McMMOChatEvent extends Event implements Cancellable { **/ private static final HandlerList handlers = new HandlerList(); private boolean cancelled; - private Plugin plugin; private String sender; private String displayName; private String message; - protected McMMOChatEvent(Plugin plugin, String sender, String displayName, String message) { - this.plugin = plugin; + protected McMMOChatEvent(String sender, String displayName, String message) { this.sender = sender; this.displayName = displayName; this.message = message; } - protected McMMOChatEvent(Plugin plugin, String sender, String displayName, String message, boolean isAsync) { + protected McMMOChatEvent(String sender, String displayName, String message, boolean isAsync) { super(isAsync); - this.plugin = plugin; this.sender = sender; this.displayName = displayName; this.message = message; } + /* public static HandlerList getHandlerList() { return handlers; } + */ /** * @return The plugin responsible for this event, note this can be null */ - public Plugin getPlugin() { + //TODO: Why do we even need this? + /*public Plugin getPlugin() { return plugin; - } + }*/ /** * @return String name of the player who sent the chat, or "Console" diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java index a69a5ca45..e3d5e1486 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java @@ -14,4 +14,10 @@ public interface Nameable extends Named { * @return the original name of this entity */ String getOriginalName(); + + /** + * This is the name used for chat messages and other things + * @return the display name of this entity + */ + String getDisplayName(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java index 8ecb7bafd..27f1c4df5 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java @@ -30,4 +30,10 @@ public interface Player extends Living, Nameable, InventoryHolder, Permissible { * @return the item in the main hand */ ItemStack getItemInMainHand(); + + /** + * Sends a message to this player + * @param msg the message to send + */ + void sendMessage(String msg); } diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/Cancellable.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/Cancellable.java index 22e71324c..5ea19cc05 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/Cancellable.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/Cancellable.java @@ -10,7 +10,7 @@ public interface Cancellable { * * @return true if cancelled */ - Boolean isCancelled(); + boolean isCancelled(); /** * Sets an events cancellation to b diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/server/Server.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/server/Server.java index fd6a4a43e..6eb74c623 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/server/Server.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/server/Server.java @@ -13,6 +13,13 @@ public interface Server { */ void broadcast(String msg); + /** + * Broadcasts a message only to players with the appropriate permission node + * @param msg the message to broadcast + * @param permission the permission node required to hear the message + */ + void broadcast(String msg, String permission); + /** * Gets the online players for this server * @return the online players for this server From 3a7b6fef7dfc88d1e1d5a2108119c62fd938f8a7 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 13 Feb 2019 10:22:58 -0800 Subject: [PATCH 17/28] tweak blockpos abstraction --- .../blockmeta/chunkmeta/ChunkManager.java | 8 ++--- .../chunkmeta/ChunkStoreFactory.java | 2 +- .../blockmeta/chunkmeta/HashChunkManager.java | 26 ++++++++--------- .../blockmeta/chunkmeta/NullChunkManager.java | 8 ++--- .../chunkmeta/PrimitiveChunkStore.java | 2 +- .../gmail/nossr50/core/mcmmo/block/Block.java | 29 +++---------------- .../nossr50/core/mcmmo/block/BlockPos.java | 21 ++++++++++++++ .../nossr50/core/mcmmo/world/Location.java | 6 ++-- .../gmail/nossr50/core/mcmmo/world/World.java | 15 ++++++++++ .../gmail/nossr50/core/platform/Platform.java | 2 +- 10 files changed, 67 insertions(+), 52 deletions(-) create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/block/BlockPos.java diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManager.java index fbe6dc900..7dd410bd4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManager.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.core.data.blockmeta.chunkmeta; -import org.bukkit.World; -import org.bukkit.block.Block; -import org.bukkit.block.BlockState; -import org.bukkit.entity.Entity; +import com.gmail.nossr50.core.mcmmo.block.Block; +import com.gmail.nossr50.core.mcmmo.block.BlockState; +import com.gmail.nossr50.core.mcmmo.entity.Entity; +import com.gmail.nossr50.core.mcmmo.world.World; import java.io.IOException; diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkStoreFactory.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkStoreFactory.java index 6bbd9c3ed..dee91ae69 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkStoreFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkStoreFactory.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.data.blockmeta.chunkmeta; -import org.bukkit.World; +import com.gmail.nossr50.core.mcmmo.world.World; public class ChunkStoreFactory { protected static ChunkStore getChunkStore(World world, int x, int z) { diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/HashChunkManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/HashChunkManager.java index 60d971d79..1cb641151 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/HashChunkManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/HashChunkManager.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.core.data.blockmeta.chunkmeta; -import com.gmail.nossr50.core.data.blockmeta.blockmeta.conversion.BlockStoreConversionZDirectory; -import com.gmail.nossr50.mcMMO; -import org.bukkit.World; -import org.bukkit.block.Block; -import org.bukkit.block.BlockState; -import org.bukkit.entity.Entity; +import com.gmail.nossr50.core.McmmoCore; +import com.gmail.nossr50.core.data.blockmeta.conversion.BlockStoreConversionZDirectory; +import com.gmail.nossr50.core.mcmmo.block.Block; +import com.gmail.nossr50.core.mcmmo.block.BlockState; +import com.gmail.nossr50.core.mcmmo.entity.Entity; +import com.gmail.nossr50.core.mcmmo.world.World; import java.io.*; import java.util.*; @@ -90,7 +90,7 @@ public class HashChunkManager implements ChunkManager { directory.mkdirs(); - UUID key = world.getUID(); + UUID key = world.getUUID(); HashMap worldRegions = regionFiles.get(key); @@ -131,7 +131,7 @@ public class HashChunkManager implements ChunkManager { return; } - UUID key = world.getUID(); + UUID key = world.getUUID(); if (!oldData.containsKey(key)) { oldData.put(key, (new File(world.getWorldFolder(), "mcmmo_data")).exists()); @@ -260,7 +260,7 @@ public class HashChunkManager implements ChunkManager { public synchronized void saveAll() { closeAll(); - for (World world : mcMMO.p.getServer().getWorlds()) { + for (World world : McmmoCore.getServer().getWorlds()) { saveWorld(world); } } @@ -269,7 +269,7 @@ public class HashChunkManager implements ChunkManager { public synchronized void unloadAll() { closeAll(); - for (World world : mcMMO.p.getServer().getWorlds()) { + for (World world : McmmoCore.getServer().getWorlds()) { unloadWorld(world); } } @@ -315,7 +315,7 @@ public class HashChunkManager implements ChunkManager { return false; } - return isTrue(blockState.getX(), blockState.getY(), blockState.getZ(), blockState.getWorld()); + return isTrue(blockState.getBlock().getX(), blockState.getBlock().getY(), blockState.getBlock().getZ(), blockState.getBlock().getWorld()); } @Override @@ -361,7 +361,7 @@ public class HashChunkManager implements ChunkManager { return; } - setTrue(blockState.getX(), blockState.getY(), blockState.getZ(), blockState.getWorld()); + setTrue(blockState.getBlock().getX(), blockState.getBlock().getY(), blockState.getBlock().getZ(), blockState.getBlock().getWorld()); } @Override @@ -406,7 +406,7 @@ public class HashChunkManager implements ChunkManager { return; } - setFalse(blockState.getX(), blockState.getY(), blockState.getZ(), blockState.getWorld()); + setFalse(blockState.getBlock().getX(), blockState.getBlock().getY(), blockState.getBlock().getZ(), blockState.getBlock().getWorld()); } @Override diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/NullChunkManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/NullChunkManager.java index 2ea6c9d10..b8c403425 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/NullChunkManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/NullChunkManager.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.core.data.blockmeta.chunkmeta; -import org.bukkit.World; -import org.bukkit.block.Block; -import org.bukkit.block.BlockState; -import org.bukkit.entity.Entity; +import com.gmail.nossr50.core.mcmmo.block.Block; +import com.gmail.nossr50.core.mcmmo.block.BlockState; +import com.gmail.nossr50.core.mcmmo.entity.Entity; +import com.gmail.nossr50.core.mcmmo.world.World; import java.io.IOException; diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java index 16fb7d21c..34b17a8a3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java @@ -24,7 +24,7 @@ public class PrimitiveChunkStore implements ChunkStore { public PrimitiveChunkStore(World world, int cx, int cz) { this.cx = cx; this.cz = cz; - this.worldUid = world.getUID(); + this.worldUid = world.getUUID(); this.store = new boolean[16][16][world.getMaxHeight()]; } diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Block.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Block.java index 7aced11ed..98d39cfc8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Block.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Block.java @@ -6,31 +6,10 @@ package com.gmail.nossr50.core.mcmmo.block; * @see Property * @see BlockState */ -public class Block { - - private final String unlocalizedName; //The name before it is localized (english) - private BlockState blockState; - - public Block(String unlocalizedName, BlockState blockState) { - this.unlocalizedName = unlocalizedName; - this.blockState = blockState; - } - +public interface Block extends BlockPos { /** - * Gets the name of this block in English - * - * @return name of this block in English + * Get the state for this block + * @return the block state */ - public String getUnlocalizedName() { - return unlocalizedName; - } - - /** - * Gets the state of this block - * - * @return the state of this block - */ - public BlockState getBlockState() { - return blockState; - } + BlockState getBlockState(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/BlockPos.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/BlockPos.java new file mode 100644 index 000000000..bd01873a4 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/BlockPos.java @@ -0,0 +1,21 @@ +package com.gmail.nossr50.core.mcmmo.block; + +import com.gmail.nossr50.core.mcmmo.world.World; + +/** + * Block positions are handled a bit differently than other locations + */ +public interface BlockPos { + + int getX(); + + int getY(); + + int getZ(); + + /** + * Gets the world for this block + * @return this block's world + */ + World getWorld(); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/world/Location.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/world/Location.java index a16305f6f..49f843705 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/world/Location.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/world/Location.java @@ -19,21 +19,21 @@ public interface Location { * * @return x-axis position */ - //double getX(); + default double getX() { return getVector().getX(); } /** * Returns the position of this location on the y-axis * * @return y-axis position */ - //double getY(); + default double getY() { return getVector().getY(); } /** * Returns the position of this location on the z-axis * * @return z-axis position */ - //double getZ(); + default double getZ() { return getVector().getZ(); } /** * The world for this Location diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/world/World.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/world/World.java index fd59afdce..5c5f24642 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/world/World.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/world/World.java @@ -2,6 +2,8 @@ package com.gmail.nossr50.core.mcmmo.world; import com.gmail.nossr50.core.mcmmo.Unique; +import java.io.File; + /** * Represents a world in MC */ @@ -12,4 +14,17 @@ public interface World extends Unique { * @return the name of this world */ String getName(); + + /** + * Gets the folder on disk for this world + * + * @return the folder on disk for this world + */ + File getWorldFolder(); + + /** + * Gets the max height for this world + * @return the max height + */ + int getMaxHeight(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java b/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java index 9d7bd360b..3e3161b6f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java +++ b/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java @@ -32,7 +32,7 @@ public interface Platform { * * @return true if the platform is loaded */ - Boolean isPlatformLoaded(); + boolean isPlatformLoaded(); /** * Gets the PlatformSoftwareType for this platform From 9a91daf910055ef75daa57be56e35baa964cd13c Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 13 Feb 2019 22:08:20 -0800 Subject: [PATCH 18/28] new config system pt 1 --- .../nossr50/listeners/BlockListener.java | 4 +- .../main/java/com/gmail/nossr50/mcMMO.java | 2 +- .../com/gmail/nossr50/core/McmmoCore.java | 36 +- .../src/main/java/com/gmail/nossr50/core/TODO | 1 + .../nossr50/core/config/AdvancedConfig.java | 1015 ++++------------- .../core/config/AutoUpdateConfigLoader.java | 132 --- .../core/config/ChunkConversionOptions.java | 38 + .../com/gmail/nossr50/core/config/Config.java | 5 +- .../nossr50/core/config/ConfigLoader.java | 86 -- .../core/config/ConfigurableLoader.java | 310 ++++- .../nossr50/core/config/CoreSkillsConfig.java | 11 +- .../nossr50/core/config/DefaultKeys.java | 10 + .../nossr50/core/config/HiddenConfig.java | 68 -- .../nossr50/core/config/VersionedConfig.java | 12 + .../config/skills/alchemy/PotionConfig.java | 12 +- .../blockmeta/ChunkletManagerFactory.java | 4 +- .../chunkmeta/ChunkManagerFactory.java | 4 +- .../conversion/BlockStoreConversionMain.java | 6 +- .../BlockStoreConversionXDirectory.java | 6 +- .../BlockStoreConversionZDirectory.java | 17 +- .../core/data/database/DatabaseManager.java | 10 +- .../gmail/nossr50/core/mcmmo/BlockTypes.java | 11 + .../core/mcmmo/commands/CommandSender.java | 13 + .../nossr50/core/mcmmo/tasks/PluginTask.java | 6 + .../core/mcmmo/tasks/TaskScheduler.java | 25 + .../gmail/nossr50/core/platform/Platform.java | 31 + .../database/FormulaConversionTask.java | 31 +- .../database/UUIDUpdateAsyncTask.java | 33 +- .../runnables/database/UserPurgeTask.java | 9 +- .../nossr50/core/util/skills/SkillUtils.java | 6 +- 30 files changed, 809 insertions(+), 1145 deletions(-) delete mode 100644 core/src/main/java/com/gmail/nossr50/core/config/AutoUpdateConfigLoader.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/config/ChunkConversionOptions.java delete mode 100644 core/src/main/java/com/gmail/nossr50/core/config/ConfigLoader.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/config/DefaultKeys.java delete mode 100644 core/src/main/java/com/gmail/nossr50/core/config/HiddenConfig.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/config/VersionedConfig.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/BlockTypes.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/commands/CommandSender.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/TaskScheduler.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index f21e36b17..fef7c1c28 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.listeners; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.Config; -import com.gmail.nossr50.core.config.HiddenConfig; +import com.gmail.nossr50.core.config.ChunkConversionOptions; import com.gmail.nossr50.core.config.WorldBlacklist; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; @@ -552,7 +552,7 @@ public class BlockListener implements Listener { } public void cleanupAbilityTools(Player player, McMMOPlayer mcMMOPlayer, BlockState blockState, ItemStack heldItem) { - if (HiddenConfig.getInstance().useEnchantmentBuffs()) { + if (ChunkConversionOptions.getInstance().useEnchantmentBuffs()) { if ((ItemUtils.isPickaxe(heldItem) && !mcMMOPlayer.getAbilityMode(SuperAbilityType.SUPER_BREAKER)) || (ItemUtils.isShovel(heldItem) && !mcMMOPlayer.getAbilityMode(SuperAbilityType.GIGA_DRILL_BREAKER))) { SkillUtils.removeAbilityBuff(heldItem); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java b/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java index 5b1a998d6..f54d33698 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java @@ -413,7 +413,7 @@ public class mcMMO extends JavaPlugin { private void loadConfigFiles() { // Force the loading of config files TreasureConfig.getInstance(); - HiddenConfig.getInstance(); + ChunkConversionOptions.getInstance(); AdvancedConfig.getInstance(); PotionConfig.getInstance(); CoreSkillsConfig.getInstance(); diff --git a/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java b/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java index 09aaa8389..56d16772c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java +++ b/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java @@ -1,17 +1,28 @@ package com.gmail.nossr50.core; +import com.gmail.nossr50.core.data.database.DatabaseManager; import com.gmail.nossr50.core.mcmmo.event.EventCommander; import com.gmail.nossr50.core.mcmmo.plugin.Plugin; import com.gmail.nossr50.core.mcmmo.server.Server; +import com.gmail.nossr50.core.mcmmo.tasks.TaskScheduler; +import com.gmail.nossr50.core.platform.Platform; +import com.gmail.nossr50.core.util.experience.FormulaManager; +import com.gmail.nossr50.core.util.upgrade.UpgradeManager; +import java.io.File; import java.util.logging.Logger; public class McmmoCore { //TODO: Wire all this stuff public static Plugin p; private static EventCommander eventCommander; - private static Server server; private static Logger logger; + private static Platform platform; + + //Why do all these things need to be here? Sigh... + private static DatabaseManager databaseManager; + private static UpgradeManager upgradeManager; + private static FormulaManager formulaManager; /** * Returns our Logger @@ -27,6 +38,27 @@ public class McmmoCore { } public static Server getServer() { - return server; + return platform.getServer(); } + + public static TaskScheduler getTaskScheduler() + { + return platform.getScheduler(); + } + + public static java.io.InputStream getResource(String path) + { + return platform.getResource(path); + } + + public static File getDataFolderPath() + { + return platform.getDataFolderPath(); + } + + public static DatabaseManager getDatabaseManager() { return databaseManager; } + + public static UpgradeManager getUpgradeManager() { return upgradeManager; } + + public static FormulaManager getFormulaManager() { return formulaManager; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/TODO b/core/src/main/java/com/gmail/nossr50/core/TODO index dd96411b5..d3a51edb4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/TODO +++ b/core/src/main/java/com/gmail/nossr50/core/TODO @@ -5,3 +5,4 @@ This file is just going to take note of all the caveats of mcMMO code as I abstr 2) mcMMO uses a a global reference of its Plugin class for Bukkit in order to schedule tasks +3) Need to configure the logger diff --git a/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java index 6424e6725..e1741c63a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java @@ -1,20 +1,64 @@ package com.gmail.nossr50.core.config; -import com.gmail.nossr50.core.mcmmo.interactions.NotificationType; -import com.gmail.nossr50.core.mcmmo.skills.SubSkillType; -import com.gmail.nossr50.core.mcmmo.skills.subskills.AbstractSubSkill; -import com.gmail.nossr50.mcMMO; -import net.md_5.bungee.api.ChatColor; +import com.gmail.nossr50.core.McmmoCore; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.mcmmo.colors.ChatColor; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; +import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; import java.util.ArrayList; import java.util.List; -public class AdvancedConfig extends AutoUpdateConfigLoader { +@ConfigSerializable +public class AdvancedConfig extends ConfigurableLoader { + public static final String SKILLS = "Skills"; + public static final String GENERAL = "General"; + public static final String ABILITY = "Ability"; + public static final String LENGTH = "Length"; + public static final String INCREASE_LEVEL = "IncreaseLevel"; + public static final String ENCHANT_BUFF = "EnchantBuff"; + public static final String ACROBATICS = "Acrobatics"; + public static final String DODGE = "Dodge"; + public static final String CHANCE = "Chance"; + public static final String CHANCE_MAX = CHANCE + "Max"; + public static final String MAX_BONUS_LEVEL = "MaxBonusLevel"; + public static final String MODIFIER = "Modifier"; + public static final String DAMAGE_MODIFIER = "Damage" + MODIFIER; + public static final String DAMAGE_THRESHOLD = "DamageThreshold"; + public static final String ALCHEMY = "Alchemy"; + public static final String CATALYSIS = "Catalysis"; + public static final String MIN_SPEED = "MinSpeed"; + public static final String MAX_SPEED = "MaxSpeed"; + public static final String ARCHERY = "Archery"; + public static final String SKILL_SHOT = "SkillShot"; + public static final String RANK_DAMAGE_MULTIPLIER = "RankDamageMultiplier"; + public static final String BONUS_DAMAGE = "BonusDamage"; + public static final String FORCE_MULTIPLIER = "ForceMultiplier"; + public static final String AXES = "Axes"; + public static final String STANDARD = "Standard"; + public static final String RETRO_MODE = "RetroMode"; + public static final String CAP_LEVEL = "CapLevel"; + public static final String KNOCKBACK_MODIFIER = "Knockback" + MODIFIER; + public static final String PVP_MODIFIER = "PVP_" + MODIFIER; + public static final String PVE_MODIFIER = "PVE_" + MODIFIER; + public static final String FISHING = "Fishing"; + public static final String MASTER_ANGLER = "MasterAngler"; + public static final String BOAT_MODIFIER = "Boat" + MODIFIER; + public static final String BIOME_MODIFIER = "Biome" + MODIFIER; + public static final String VANILLA_XPMULTIPLIER = "VanillaXPMultiplier"; + public static final String RANK = "Rank_"; + public static final String TAMING = "Taming"; + public static final String CALL_OF_THE_WILD = "CallOfTheWild"; + public static final String MIN_HORSE_JUMP_STRENGTH = "MinHorseJumpStrength"; + public static final String MAX_HORSE_JUMP_STRENGTH = "MaxHorseJumpStrength"; + public static final String SHOCK_PROOF = "ShockProof"; + public static final String UNARMED = "Unarmed"; + public static final String STARTING_LEVEL = "StartingLevel"; private static AdvancedConfig instance; private AdvancedConfig() { - super("advanced.yml"); - validate(); + super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "advanced.yml"); } public static AdvancedConfig getInstance() { @@ -25,588 +69,345 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { return instance; } + /** + * The version of this config + * + * @return + */ @Override - protected boolean validateKeys() { + public double getConfigVersion() { + return 1; + } + + @Override + public List validateKeys() { // Validate all the settings! List reason = new ArrayList(); /* GENERAL */ if (getAbilityLength() < 1) { - reason.add("Skills.General.Ability.Length..IncreaseLevel should be at least 1!"); + reason.add(SKILLS + "." + GENERAL + "." + ABILITY + "." + LENGTH + ".." + INCREASE_LEVEL + " should be at least 1!"); } if (getEnchantBuff() < 1) { - reason.add("Skills.General.Ability.EnchantBuff should be at least 1!"); + reason.add(SKILLS + "." + GENERAL + "." + ABILITY + "." + ENCHANT_BUFF + " should be at least 1!"); } /* ACROBATICS */ if (getMaximumProbability(SubSkillType.ACROBATICS_DODGE) < 1) { - reason.add("Skills.Acrobatics.Dodge.ChanceMax should be at least 1!"); + reason.add(SKILLS + "." + ACROBATICS + "." + DODGE + "." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.ACROBATICS_DODGE) < 1) { - reason.add("Skills.Acrobatics.Dodge.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + "." + ACROBATICS + "." + DODGE + "." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getDodgeDamageModifier() <= 1) { - reason.add("Skills.Acrobatics.Dodge.DamageModifier should be greater than 1!"); + reason.add(SKILLS + "." + ACROBATICS + "." + DODGE + "." + DAMAGE_MODIFIER + " should be greater than 1!"); } if (getMaximumProbability(SubSkillType.ACROBATICS_ROLL) < 1) { - reason.add("Skills.Acrobatics.Roll.ChanceMax should be at least 1!"); + reason.add(SKILLS + "." + ACROBATICS + ".Roll." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.ACROBATICS_ROLL) < 1) { - reason.add("Skills.Acrobatics.Roll.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + "." + ACROBATICS + ".Roll." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getRollDamageThreshold() < 0) { - reason.add("Skills.Acrobatics.Roll.DamageThreshold should be at least 0!"); + reason.add(SKILLS + "." + ACROBATICS + ".Roll." + DAMAGE_THRESHOLD + " should be at least 0!"); } if (getGracefulRollDamageThreshold() < 0) { - reason.add("Skills.Acrobatics.GracefulRoll.DamageThreshold should be at least 0!"); + reason.add(SKILLS + "." + ACROBATICS + ".GracefulRoll." + DAMAGE_THRESHOLD + " should be at least 0!"); } - /* ALCHEMY */ - /*if (getCatalysisUnlockLevel() < 0) { - reason.add("Skills.Alchemy.Catalysis.UnlockLevel should be at least 0!"); - } - - if (getCatalysisMaxBonusLevel() <= getCatalysisUnlockLevel()) { - reason.add("Skills.Alchemy.Catalysis.MaxBonusLevel should be greater than Skills.Alchemy.Catalysis.UnlockLevel!"); - }*/ - if (getCatalysisMinSpeed() <= 0) { - reason.add("Skills.Alchemy.Catalysis.MinSpeed must be greater than 0!"); + reason.add(SKILLS + "." + ALCHEMY + "." + CATALYSIS + "." + MIN_SPEED + " must be greater than 0!"); } if (getCatalysisMaxSpeed() < getCatalysisMinSpeed()) { - reason.add("Skills.Alchemy.Catalysis.MaxSpeed should be at least Skills.Alchemy.Catalysis.MinSpeed!"); + reason.add(SKILLS + "." + ALCHEMY + "." + CATALYSIS + "." + MAX_SPEED + " should be at least Skills.Alchemy.Catalysis." + MIN_SPEED + "!"); } - /*List alchemyTierList = Arrays.asList(Alchemy.Tier.values()); - for (Alchemy.Tier tier : alchemyTierList) { - if (getConcoctionsTierLevel(tier) < 0) { - reason.add("Skills.Alchemy.Rank_Levels.Rank_" + rank + " should be at least 0!"); - } - - if (tier != Alchemy.Tier.fromNumerical(Alchemy.Tier.values().length)) { - Alchemy.Tier nextTier = alchemyTierList.get(alchemyTierList.indexOf(tier) - 1); - - if (getConcoctionsTierLevel(tier) > getConcoctionsTierLevel(nextTier)) { - reason.add("Skills.Alchemy.Rank_Levels.Rank_" + rank + " should be less than or equal to Skills.Alchemy.Rank_Levels.Rank_" + nextrank + "!"); - } - } - }*/ - /* ARCHERY */ if (getSkillShotRankDamageMultiplier() <= 0) { - reason.add("Skills.Archery.SkillShot.RankDamageMultiplier should be greater than 0!"); + reason.add(SKILLS + "." + ARCHERY + "." + SKILL_SHOT + "." + RANK_DAMAGE_MULTIPLIER + " should be greater than 0!"); } if (getMaximumProbability(SubSkillType.ARCHERY_DAZE) < 1) { - reason.add("Skills.Archery.Daze.ChanceMax should be at least 1!"); + reason.add(SKILLS + "." + ARCHERY + ".Daze." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.ARCHERY_DAZE) < 1) { - reason.add("Skills.Archery.Daze.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + "." + ARCHERY + ".Daze." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getDazeBonusDamage() < 0) { - reason.add("Skills.Archery.Daze.BonusDamage should be at least 0!"); + reason.add(SKILLS + "." + ARCHERY + ".Daze." + BONUS_DAMAGE + " should be at least 0!"); } if (getMaximumProbability(SubSkillType.ARCHERY_ARROW_RETRIEVAL) < 1) { - reason.add("Skills.Archery.Retrieve.ChanceMax should be at least 1!"); + reason.add(SKILLS + "." + ARCHERY + ".Retrieve." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.ARCHERY_ARROW_RETRIEVAL) < 1) { - reason.add("Skills.Archery.Retrieve.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + "." + ARCHERY + ".Retrieve." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getForceMultiplier() < 0) { - reason.add("Skills.Archery.ForceMultiplier should be at least 0!"); + reason.add(SKILLS + "." + ARCHERY + "." + FORCE_MULTIPLIER + " should be at least 0!"); } /* AXES */ - if (getAxeMasteryRankDamageMultiplier() < 0) { - reason.add("Skills.Axes.AxeMastery.RankDamageMultiplier should be at least 0!"); + if(getAxeMasteryRankDamageMultiplier() < 0) + { + reason.add(SKILLS + "." + AXES + ".AxeMastery." + RANK_DAMAGE_MULTIPLIER + " should be at least 0!"); } if (getMaximumProbability(SubSkillType.AXES_CRITICAL_STRIKES) < 1) { - reason.add("Skills.Axes.CriticalHit.ChanceMax should be at least 1!"); + reason.add(SKILLS + "." + AXES + ".CriticalHit." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.AXES_CRITICAL_STRIKES) < 1) { - reason.add("Skills.Axes.CriticalHit.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + "." + AXES + ".CriticalHit." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getCriticalStrikesPVPModifier() < 1) { - reason.add("Skills.Axes.CriticalStrikes.PVP_Modifier should be at least 1!"); + reason.add(SKILLS + "." + AXES + ".CriticalStrikes." + PVP_MODIFIER + " should be at least 1!"); } if (getCriticalStrikesPVPModifier() < 1) { - reason.add("Skills.Axes.CriticalStrikes.PVE_Modifier should be at least 1!"); + reason.add(SKILLS + "." + AXES + ".CriticalStrikes." + PVE_MODIFIER + " should be at least 1!"); } if (getGreaterImpactChance() < 1) { - reason.add("Skills.Axes.GreaterImpact.Chance should be at least 1!"); + reason.add(SKILLS + "." + AXES + ".GreaterImpact." + CHANCE + " should be at least 1!"); } if (getGreaterImpactModifier() < 1) { - reason.add("Skills.Axes.GreaterImpact.KnockbackModifier should be at least 1!"); + reason.add(SKILLS + "." + AXES + ".GreaterImpact." + KNOCKBACK_MODIFIER + " should be at least 1!"); } if (getGreaterImpactBonusDamage() < 1) { - reason.add("Skills.Axes.GreaterImpact.BonusDamage should be at least 1!"); + reason.add(SKILLS + "." + AXES + ".GreaterImpact." + BONUS_DAMAGE + " should be at least 1!"); } if (getArmorImpactIncreaseLevel() < 1) { - reason.add("Skills.Axes.ArmorImpact.IncreaseLevel should be at least 1!"); + reason.add(SKILLS + "." + AXES + ".ArmorImpact." + INCREASE_LEVEL + " should be at least 1!"); } if (getImpactChance() < 1) { - reason.add("Skills.Axes.ArmorImpact.Chance should be at least 1!"); + reason.add(SKILLS + "." + AXES + ".ArmorImpact." + CHANCE + " should be at least 1!"); } if (getArmorImpactMaxDurabilityDamage() < 1) { - reason.add("Skills.Axes.ArmorImpact.MaxPercentageDurabilityDamage should be at least 1!"); + reason.add(SKILLS + "." + AXES + ".ArmorImpact.MaxPercentageDurabilityDamage should be at least 1!"); } if (getSkullSplitterModifier() < 1) { - reason.add("Skills.Axes.SkullSplitter.DamageModifier should be at least 1!"); + reason.add(SKILLS + "." + AXES + ".SkullSplitter." + DAMAGE_MODIFIER + " should be at least 1!"); } - /* FISHING */ - /*List fishingTierList = Arrays.asList(Fishing.Tier.values()); - - for (int rank : fishingTierList) { - if (getFishingTierLevel(tier) < 0) { - reason.add("Skills.Fishing.Rank_Levels.Rank_" + rank + " should be at least 0!"); - } - - if (getShakeChance(tier) < 0) { - reason.add("Skills.Fishing.Shake_Chance.Rank_" + rank + " should be at least 0!"); - } - - if (getFishingVanillaXPModifier(tier) < 0) { - reason.add("Skills.Fishing.VanillaXPMultiplier.Rank_" + rank + " should be at least 0!"); - } - - if (tier != Fishing.Tier.EIGHT) { - Fishing.Tier nextTier = fishingTierList.get(fishingTierList.indexOf(tier) - 1); - - if (getFishingTierLevel(tier) > getFishingTierLevel(nextTier)) { - reason.add("Skills.Fishing.Rank_Levels.Rank_" + rank + " should be less than or equal to Skills.Fishing.Rank_Levels.Rank_" + nextrank + "!"); - } - - if (getShakeChance(tier) > getShakeChance(nextTier)) { - reason.add("Skills.Fishing.Shake_Chance.Rank_" + rank + " should be less than or equal to Skills.Fishing.Shake_Chance.Rank_" + nextrank + "!"); - } - - if (getFishingVanillaXPModifier(tier) > getFishingVanillaXPModifier(nextTier)) { - reason.add("Skills.Fishing.VanillaXPMultiplier.Rank_" + rank + " should be less than or equal to Skills.Fishing.VanillaXPMultiplier.Rank_" + nextrank + "!"); - } - } - }*/ - - if (getFishermanDietRankChange() < 1) { - reason.add("Skills.Fishing.FishermansDiet.RankChange should be at least 1!"); - } - - /*if (getIceFishingUnlockLevel() < 0) { - reason.add("Skills.Fishing.IceFishing.UnlockLevel should be at least 0!"); - } - - if (getMasterAnglerUnlockLevel() < 0) { - reason.add("Skills.Fishing.MasterAngler.UnlockLevel should be at least 0!"); + /*if (getFishermanDietRankChange() < 1) { + reason.add(SKILLS + "." + FISHING + ".FishermansDiet.RankChange should be at least 1!"); }*/ if (getMasterAnglerBoatModifier() < 1) { - reason.add("Skills.Fishing.MasterAngler.BoatModifier should be at least 1!"); + reason.add(SKILLS + "." + FISHING + "." + MASTER_ANGLER + "." + BOAT_MODIFIER + " should be at least 1!"); } if (getMasterAnglerBiomeModifier() < 1) { - reason.add("Skills.Fishing.MasterAngler.BiomeModifier should be at least 1!"); + reason.add(SKILLS + "." + FISHING + "." + MASTER_ANGLER + "." + BIOME_MODIFIER + " should be at least 1!"); } /* HERBALISM */ - if (getFarmerDietRankChange() < 1) { - reason.add("Skills.Herbalism.FarmersDiet.RankChange should be at least 1!"); + /*if (getFarmerDietRankChange() < 1) { + reason.add(SKILLS + ".Herbalism.FarmersDiet.RankChange should be at least 1!"); } if (getGreenThumbStageChange() < 1) { - reason.add("Skills.Herbalism.GreenThumb.StageChange should be at least 1!"); - } + reason.add(SKILLS + ".Herbalism.GreenThumb.StageChange should be at least 1!"); + }*/ if (getMaximumProbability(SubSkillType.HERBALISM_GREEN_THUMB) < 1) { - reason.add("Skills.Herbalism.GreenThumb.ChanceMax should be at least 1!"); + reason.add(SKILLS + ".Herbalism.GreenThumb." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.HERBALISM_GREEN_THUMB) < 1) { - reason.add("Skills.Herbalism.GreenThumb.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + ".Herbalism.GreenThumb." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getMaximumProbability(SubSkillType.HERBALISM_DOUBLE_DROPS) < 1) { - reason.add("Skills.Herbalism.DoubleDrops.ChanceMax should be at least 1!"); + reason.add(SKILLS + ".Herbalism.DoubleDrops." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.HERBALISM_DOUBLE_DROPS) < 1) { - reason.add("Skills.Herbalism.DoubleDrops.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + ".Herbalism.DoubleDrops." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getMaximumProbability(SubSkillType.HERBALISM_HYLIAN_LUCK) < 1) { - reason.add("Skills.Herbalism.HylianLuck.ChanceMax should be at least 1!"); + reason.add(SKILLS + ".Herbalism.HylianLuck." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.HERBALISM_HYLIAN_LUCK) < 1) { - reason.add("Skills.Herbalism.HylianLuck.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + ".Herbalism.HylianLuck." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getMaximumProbability(SubSkillType.HERBALISM_SHROOM_THUMB) < 1) { - reason.add("Skills.Herbalism.ShroomThumb.ChanceMax should be at least 1!"); + reason.add(SKILLS + ".Herbalism.ShroomThumb." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.HERBALISM_SHROOM_THUMB) < 1) { - reason.add("Skills.Herbalism.ShroomThumb.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + ".Herbalism.ShroomThumb." + MAX_BONUS_LEVEL + " should be at least 1!"); } /* MINING */ if (getMaximumProbability(SubSkillType.MINING_DOUBLE_DROPS) < 1) { - reason.add("Skills.Mining.DoubleDrops.ChanceMax should be at least 1!"); + reason.add(SKILLS + ".Mining.DoubleDrops." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.MINING_DOUBLE_DROPS) < 1) { - reason.add("Skills.Mining.DoubleDrops.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + ".Mining.DoubleDrops." + MAX_BONUS_LEVEL + " should be at least 1!"); } - /*List blastMiningTierList = Arrays.asList(BlastMining.Tier.values()); - - for (int rank : blastMiningTierList) { - if (getBlastMiningRankLevel(tier) < 0) { - reason.add("Skills.Mining.BlastMining.Rank_Levels.Rank_" + rank + " should be at least 0!"); - } - - if (getBlastDamageDecrease(tier) < 0) { - reason.add("Skills.Mining.BlastMining.BlastDamageDecrease.Rank_" + rank + " should be at least 0!"); - } - - if (getOreBonus(tier) < 0) { - reason.add("Skills.Mining.BlastMining.OreBonus.Rank_" + rank + " should be at least 0!"); - } - - if (getDebrisReduction(tier) < 0) { - reason.add("Skills.Mining.BlastMining.DebrisReduction.Rank_" + rank + " should be at least 0!"); - } - - if (getDropMultiplier(tier) < 0) { - reason.add("Skills.Mining.BlastMining.DropMultiplier.Rank_" + rank + " should be at least 0!"); - } - - if (getBlastRadiusModifier(tier) < 0) { - reason.add("Skills.Mining.BlastMining.BlastRadiusModifier.Rank_" + rank + " should be at least 0!"); - } - - if (tier != BlastMining.Tier.EIGHT) { - BlastMining.Tier nextTier = blastMiningTierList.get(blastMiningTierList.indexOf(tier) - 1); - - if (getBlastMiningRankLevel(tier) > getBlastMiningRankLevel(nextTier)) { - reason.add("Skills.Mining.BlastMining.Rank_Levels.Rank_" + rank + " should be less than or equal to Skills.Mining.BlastMining.Rank_Levels.Rank_" + nextrank + "!"); - } - - if (getBlastDamageDecrease(tier) > getBlastDamageDecrease(nextTier)) { - reason.add("Skills.Mining.BlastMining.BlastDamageDecrease.Rank_" + rank + " should be less than or equal to Skills.Mining.BlastMining.BlastDamageDecrease.Rank_" + nextrank + "!"); - } - - if (getOreBonus(tier) > getOreBonus(nextTier)) { - reason.add("Skills.Mining.BlastMining.OreBonus.Rank_" + rank + " should be less than or equal to Skills.Mining.BlastMining.OreBonus.Rank_" + nextrank + "!"); - } - - if (getDebrisReduction(tier) > getDebrisReduction(nextTier)) { - reason.add("Skills.Mining.BlastMining.DebrisReduction.Rank_" + rank + " should be less than or equal to Skills.Mining.BlastMining.DebrisReduction.Rank_" + nextrank + "!"); - } - - if (getDropMultiplier(tier) > getDropMultiplier(nextTier)) { - reason.add("Skills.Mining.BlastMining.DropMultiplier.Rank_" + rank + " should be less than or equal to Skills.Mining.BlastMining.DropMultiplier.Rank_" + nextrank + "!"); - } - - if (getBlastRadiusModifier(tier) > getBlastRadiusModifier(nextTier)) { - reason.add("Skills.Mining.BlastMining.BlastRadiusModifier.Rank_" + rank + " should be less than or equal to Skills.Mining.BlastMining.BlastRadiusModifier.Rank_" + nextrank + "!"); - } - } - }*/ - /* REPAIR */ if (getRepairMasteryMaxBonus() < 1) { - reason.add("Skills.Repair.RepairMastery.MaxBonusPercentage should be at least 1!"); + reason.add(SKILLS + ".Repair.RepairMastery.MaxBonusPercentage should be at least 1!"); } if (getRepairMasteryMaxLevel() < 1) { - reason.add("Skills.Repair.RepairMastery.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + ".Repair.RepairMastery." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getMaximumProbability(SubSkillType.REPAIR_SUPER_REPAIR) < 1) { - reason.add("Skills.Repair.SuperRepair.ChanceMax should be at least 1!"); + reason.add(SKILLS + ".Repair.SuperRepair." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.REPAIR_SUPER_REPAIR) < 1) { - reason.add("Skills.Repair.SuperRepair.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + ".Repair.SuperRepair." + MAX_BONUS_LEVEL + " should be at least 1!"); } - /*List arcaneForgingTierList = Arrays.asList(ArcaneForging.Tier.values()); - - for (ArcaneForging.Tier tier : arcaneForgingTierList) { - if (getArcaneForgingRankLevel(tier) < 0) { - reason.add("Skills.Repair.ArcaneForging.Rank_Levels.Rank_" + rank + " should be at least 0!"); - } - - if (getArcaneForgingDowngradeChance(tier) < 0 || getArcaneForgingDowngradeChance(tier) > 100) { - reason.add("Skills.Repair.ArcaneForging.Downgrades.Chance.Rank_" + rank + " only accepts values from 0 to 100!"); - } - - if (getArcaneForgingKeepEnchantsChance(tier) < 0 || getArcaneForgingKeepEnchantsChance(tier) > 100) { - reason.add("Skills.Repair.ArcaneForging.Keep_Enchants.Chance.Rank_" + rank + " only accepts values from 0 to 100!"); - } - - if (tier != ArcaneForging.Tier.EIGHT) { - ArcaneForging.Tier nextTier = arcaneForgingTierList.get(arcaneForgingTierList.indexOf(tier) - 1); - - if (getArcaneForgingRankLevel(tier) > getArcaneForgingRankLevel(nextTier)) { - reason.add("Skills.Repair.ArcaneForging.Rank_Levels.Rank_" + rank + " should be less than or equal to Skills.Repair.ArcaneForging.Rank_Levels.Rank_" + nextrank + "!"); - } - - if (getArcaneForgingDowngradeChance(nextTier) > getArcaneForgingDowngradeChance(tier)) { - reason.add("Skills.Repair.ArcaneForging.Downgrades.Chance.Rank_" + nextrank + " should be less than or equal to Skills.Repair.ArcaneForging.Downgrades.Chance.Rank_" + rank + "!"); - } - - if (getArcaneForgingKeepEnchantsChance(tier) > getArcaneForgingKeepEnchantsChance(nextTier)) { - reason.add("Skills.Repair.ArcaneForging.Keep_Enchants.Chance.Rank_" + rank + " should be less than or equal to Skills.Repair.ArcaneForging.Keep_Enchants.Chance.Rank_" + nextrank + "!"); - } - } - }*/ - - /* SALVAGE */ - /*if (getSalvageMaxPercentage() < 1) { - reason.add("Skills.Salvage.MaxPercentage should be at least 1!"); - } - - if (getSalvageMaxPercentageLevel() < 1) { - reason.add("Skills.Salvage.MaxPercentageLevel should be at least 1!"); - }*/ - - /*if (getAdvancedSalvageUnlockLevel() < 0) { - reason.add("Skills.Salvage.AdvancedSalvage.UnlockLevel should be at least 0!"); - }*/ - - /*List salvageTierList = Arrays.asList(Salvage.Tier.values()); - - for (Salvage.Tier tier : salvageTierList) { - if (getArcaneSalvageRankLevel(tier) < 0) { - reason.add("Skills.Salvage.ArcaneSalvage.Rank_Levels.Rank_" + rank + " should be at least 0!"); - } - - if (getArcaneSalvageExtractFullEnchantsChance(tier) < 0 || getArcaneSalvageExtractFullEnchantsChance(tier) > 100) { - reason.add("Skills.Salvage.ArcaneSalvage.ExtractFullEnchant.Rank_" + rank + " only accepts values from 0 to 100!"); - } - - if (getArcaneSalvageExtractPartialEnchantsChance(tier) < 0 || getArcaneSalvageExtractPartialEnchantsChance(tier) > 100) { - reason.add("Skills.Salvage.ArcaneSalvage.ExtractPartialEnchant.Rank_" + rank + " only accepts values from 0 to 100!"); - } - - if (tier != Salvage.Tier.EIGHT) { - Salvage.Tier nextTier = salvageTierList.get(salvageTierList.indexOf(tier) - 1); - - if (getArcaneSalvageRankLevel(tier) > getArcaneSalvageRankLevel(nextTier)) { - reason.add("Skills.Salvage.ArcaneSalvage.Rank_Levels.Rank_" + rank + " should be less than or equal to Skills.Salvage.ArcaneSalvage.Rank_Levels.Rank_" + nextrank + "!"); - } - - if (getArcaneSalvageExtractFullEnchantsChance(tier) > getArcaneSalvageExtractFullEnchantsChance(nextTier)) { - reason.add("Skills.Salvage.ArcaneSalvage.ExtractFullEnchant.Rank_" + rank + " should be less than or equal to Skills.Salvage.ArcaneSalvage.ExtractFullEnchant.Rank_" + nextrank + "!"); - } - - if (getArcaneSalvageExtractPartialEnchantsChance(tier) > getArcaneSalvageExtractPartialEnchantsChance(nextTier)) { - reason.add("Skills.Salvage.ArcaneSalvage.ExtractPartialEnchant.Rank_" + rank + " should be less than or equal to Skills.Salvage.ArcaneSalvage.ExtractPartialEnchant.Rank_" + nextrank + "!"); - } - } - }*/ - /* SMELTING */ if (getBurnModifierMaxLevel() < 1) { - reason.add("Skills.Smelting.FuelEfficiency.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + ".Smelting.FuelEfficiency." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getBurnTimeMultiplier() < 1) { - reason.add("Skills.Smelting.FuelEfficiency.Multiplier should be at least 1!"); + reason.add(SKILLS + ".Smelting.FuelEfficiency.Multiplier should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.SMELTING_SECOND_SMELT) < 1) { - reason.add("Skills.Smelting.SecondSmelt.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + ".Smelting.SecondSmelt." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getMaximumProbability(SubSkillType.SMELTING_SECOND_SMELT) < 1) { - reason.add("Skills.Smelting.SecondSmelt.ChanceMax should be at least 1!"); + reason.add(SKILLS + ".Smelting.SecondSmelt." + CHANCE_MAX + " should be at least 1!"); } - /*if (getFluxMiningUnlockLevel() < 0) { - reason.add("Skills.Smelting.FluxMining.UnlockLevel should be at least 0!"); - }*/ - if (getFluxMiningChance() < 1) { - reason.add("Skills.Smelting.FluxMining.Chance should be at least 1!"); + reason.add(SKILLS + ".Smelting.FluxMining." + CHANCE + " should be at least 1!"); } - /*List smeltingTierList = Arrays.asList(Smelting.Tier.values()); - - for (int rank : smeltingTierList) { - if (getSmeltingRankLevel(tier) < 0) { - reason.add("Skills.Smelting.Rank_Levels.Rank_" + rank + " should be at least 0!"); - } - - if (getSmeltingVanillaXPBoostMultiplier(tier) < 1) { - reason.add("Skills.Smelting.VanillaXPMultiplier.Rank_" + rank + " should be at least 1!"); - } - - if (tier != Smelting.Tier.EIGHT) { - Smelting.Tier nextTier = smeltingTierList.get(smeltingTierList.indexOf(tier) - 1); - - if (getSmeltingRankLevel(tier) > getSmeltingRankLevel(nextTier)) { - reason.add("Skills.Smelting.Rank_Levels.Rank_" + rank + " should be less than or equal to Skills.Smelting.Rank_Levels.Rank_" + nextrank + "!"); - } - - if (getSmeltingVanillaXPBoostMultiplier(tier) > getSmeltingVanillaXPBoostMultiplier(nextTier)) { - reason.add("Skills.Smelting.VanillaXPMultiplier.Rank_" + rank + " should be less than or equal to Skills.Smelting.VanillaXPMultiplier.Rank_" + nextrank + "!"); - } - } - }*/ - /* SWORDS */ if (getMaximumProbability(SubSkillType.SWORDS_RUPTURE) < 1) { - reason.add("Skills.Swords.Rupture.ChanceMax should be at least 1!"); + reason.add(SKILLS + ".Swords.Rupture." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.SWORDS_RUPTURE) < 1) { - reason.add("Skills.Swords.Rupture.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + ".Swords.Rupture." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getRuptureMaxTicks() < 1) { - reason.add("Skills.Swords.Rupture.MaxTicks should be at least 1!"); + reason.add(SKILLS + ".Swords.Rupture.MaxTicks should be at least 1!"); } if (getRuptureMaxTicks() < getRuptureBaseTicks()) { - reason.add("Skills.Swords.Rupture.MaxTicks should be at least Skills.Swords.Rupture.BaseTicks!"); + reason.add(SKILLS + ".Swords.Rupture.MaxTicks should be at least Skills.Swords.Rupture.BaseTicks!"); } if (getRuptureBaseTicks() < 1) { - reason.add("Skills.Swords.Rupture.BaseTicks should be at least 1!"); + reason.add(SKILLS + ".Swords.Rupture.BaseTicks should be at least 1!"); } if (getMaximumProbability(SubSkillType.SWORDS_COUNTER_ATTACK) < 1) { - reason.add("Skills.Swords.CounterAttack.ChanceMax should be at least 1!"); + reason.add(SKILLS + ".Swords.CounterAttack." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.SWORDS_COUNTER_ATTACK) < 1) { - reason.add("Skills.Swords.CounterAttack.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + ".Swords.CounterAttack." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getCounterModifier() < 1) { - reason.add("Skills.Swords.CounterAttack.DamageModifier should be at least 1!"); + reason.add(SKILLS + ".Swords.CounterAttack." + DAMAGE_MODIFIER + " should be at least 1!"); } if (getSerratedStrikesModifier() < 1) { - reason.add("Skills.Swords.SerratedStrikes.DamageModifier should be at least 1!"); + reason.add(SKILLS + ".Swords.SerratedStrikes." + DAMAGE_MODIFIER + " should be at least 1!"); } if (getSerratedStrikesTicks() < 1) { - reason.add("Skills.Swords.SerratedStrikes.RuptureTicks should be at least 1!"); + reason.add(SKILLS + ".Swords.SerratedStrikes.RuptureTicks should be at least 1!"); } /* TAMING */ if (getMaximumProbability(SubSkillType.TAMING_GORE) < 1) { - reason.add("Skills.Taming.Gore.ChanceMax should be at least 1!"); + reason.add(SKILLS + "." + TAMING + ".Gore." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.TAMING_GORE) < 1) { - reason.add("Skills.Taming.Gore.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + "." + TAMING + ".Gore." + MAX_BONUS_LEVEL + " should be at least 1!"); } - /*if (getGoreRuptureTicks() < 1) { - reason.add("Skills.Taming.Gore.RuptureTicks should be at least 1!"); - }*/ - if (getGoreModifier() < 1) { - reason.add("Skills.Taming.Gore.Modifier should be at least 1!"); + reason.add(SKILLS + "." + TAMING + ".Gore." + MODIFIER + " should be at least 1!"); } - /*if (getFastFoodUnlock() < 0) { - reason.add("Skills.Taming.FastFood.UnlockLevel should be at least 0!"); - }*/ - if (getFastFoodChance() < 1) { - reason.add("Skills.Taming.FastFood.Chance should be at least 1!"); + reason.add(SKILLS + "." + TAMING + ".FastFood." + CHANCE + " should be at least 1!"); } - /*if (getEnviromentallyAwareUnlock() < 0) { - reason.add("Skills.Taming.EnvironmentallyAware.UnlockLevel should be at least 0!"); - }*/ - - /*if (getThickFurUnlock() < 0) { - reason.add("Skills.Taming.ThickFur.UnlockLevel should be at least 0!"); - }*/ - if (getThickFurModifier() < 1) { - reason.add("Skills.Taming.ThickFur.Modifier should be at least 1!"); + reason.add(SKILLS + "." + TAMING + ".ThickFur." + MODIFIER + " should be at least 1!"); } - /*if (getHolyHoundUnlock() < 0) { - reason.add("Skills.Taming.HolyHound.UnlockLevel should be at least 0!"); - } - - if (getShockProofUnlock() < 0) { - reason.add("Skills.Taming.ShockProof.UnlockLevel should be at least 0!"); - }*/ - if (getShockProofModifier() < 1) { - reason.add("Skills.Taming.ShockProof.Modifier should be at least 1!"); + reason.add(SKILLS + "." + TAMING + "." + SHOCK_PROOF + "." + MODIFIER + " should be at least 1!"); } - /*if (getSharpenedClawsUnlock() < 0) { - reason.add("Skills.Taming.SharpenedClaws.UnlockLevel should be at least 0!"); - }*/ - if (getSharpenedClawsBonus() < 1) { - reason.add("Skills.Taming.SharpenedClaws.Bonus should be at least 1!"); + reason.add(SKILLS + "." + TAMING + ".SharpenedClaws.Bonus should be at least 1!"); } if (getMaxHorseJumpStrength() < 0 || getMaxHorseJumpStrength() > 2) { - reason.add("Skills.Taming.CallOfTheWild.MaxHorseJumpStrength should be between 0 and 2!"); + reason.add(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD + "." + MAX_HORSE_JUMP_STRENGTH + " should be between 0 and 2!"); } /* UNARMED */ if (getMaximumProbability(SubSkillType.UNARMED_DISARM) < 1) { - reason.add("Skills.Unarmed.Disarm.ChanceMax should be at least 1!"); + reason.add(SKILLS + "." + UNARMED + ".Disarm." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.UNARMED_DISARM) < 1) { - reason.add("Skills.Unarmed.Disarm.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + "." + UNARMED + ".Disarm." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getMaximumProbability(SubSkillType.UNARMED_ARROW_DEFLECT) < 1) { - reason.add("Skills.Unarmed.ArrowDeflect.ChanceMax should be at least 1!"); + reason.add(SKILLS + "." + UNARMED + ".ArrowDeflect." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.UNARMED_ARROW_DEFLECT) < 1) { - reason.add("Skills.Unarmed.ArrowDeflect.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + "." + UNARMED + ".ArrowDeflect." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getMaximumProbability(SubSkillType.UNARMED_IRON_GRIP) < 1) { - reason.add("Skills.Unarmed.IronGrip.ChanceMax should be at least 1!"); + reason.add(SKILLS + "." + UNARMED + ".IronGrip." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.UNARMED_IRON_GRIP) < 1) { - reason.add("Skills.Unarmed.IronGrip.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + "." + UNARMED + ".IronGrip." + MAX_BONUS_LEVEL + " should be at least 1!"); } /* WOODCUTTING */ @@ -616,83 +417,57 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { }*/ if (getMaximumProbability(SubSkillType.WOODCUTTING_HARVEST_LUMBER) < 1) { - reason.add("Skills.Woodcutting.HarvestLumber.ChanceMax should be at least 1!"); + reason.add(SKILLS + ".Woodcutting.HarvestLumber." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.WOODCUTTING_HARVEST_LUMBER) < 1) { - reason.add("Skills.Woodcutting.HarvestLumber.MaxBonusLevel should be at least 1!"); + reason.add(SKILLS + ".Woodcutting.HarvestLumber." + MAX_BONUS_LEVEL + " should be at least 1!"); } - /* KRAKEN */ - if (getKrakenTriesBeforeRelease() < 1) { - reason.add("Kraken.Tries_Before_Release should be at least 1!"); - } - - if (getKrakenHealth() < 1) { - reason.add("Kraken.Health should be at least 1!"); - } - - if (getKrakenAttackInterval() < 1) { - reason.add("Kraken.Attack_Interval_Seconds should be at least 1!"); - } - - if (getKrakenAttackDamage() < 1) { - reason.add("Kraken.Attack_Damage should be at least 1!"); - } - - return noErrorsInConfig(reason); - } - - @Override - protected void loadKeys() { + return reason; } /* GENERAL */ - public int getStartingLevel() { - return config.getInt("Skills.General.StartingLevel", 1); - } + public int getStartingLevel() { return getIntValue(SKILLS, GENERAL, STARTING_LEVEL); } /** * This returns the maximum level at which superabilities will stop lengthening from scaling alongside skill level. * It returns a different value depending on whether or not the server is in retro mode - * * @return the level at which abilities stop increasing in length */ public int getAbilityLengthCap() { - if (!mcMMO.isRetroModeEnabled()) - return config.getInt("Skills.General.Ability.Length.Standard.CapLevel", 50); + if(!mcMMO.isRetroModeEnabled()) + return getIntValue(SKILLS, GENERAL, ABILITY, LENGTH, STANDARD, CAP_LEVEL); else - return config.getInt("Skills.General.Ability.Length.RetroMode.CapLevel", 500); + return getIntValue(SKILLS, GENERAL, ABILITY, LENGTH, RETRO_MODE, CAP_LEVEL); } /** * This returns the frequency at which abilities will increase in length * It returns a different value depending on whether or not the server is in retro mode - * * @return the number of levels required per ability length increase */ public int getAbilityLength() { - if (!mcMMO.isRetroModeEnabled()) - return config.getInt("Skills.General.Ability.Length.Standard.IncreaseLevel", 5); + if(!mcMMO.isRetroModeEnabled()) + return getIntValue(SKILLS, GENERAL, ABILITY, LENGTH, STANDARD, INCREASE_LEVEL); else - return config.getInt("Skills.General.Ability.Length.RetroMode.IncreaseLevel", 50); + return getIntValue(SKILLS, GENERAL, ABILITY, LENGTH, RETRO_MODE, INCREASE_LEVEL); } - public int getEnchantBuff() { - return config.getInt("Skills.General.Ability.EnchantBuff", 5); - } + public int getEnchantBuff() { return getIntValue(SKILLS, GENERAL, ABILITY, ENCHANT_BUFF); } /** * Grabs the max bonus level for a skill used in RNG calculations * All max level values in the config are multiplied by 10 if the server is in retro mode as the values in the config are based around the new 1-100 skill system scaling * A value of 10 in the file will be returned as 100 for retro mode servers to accommodate the change in scaling - * * @param subSkillType target subskill * @return the level at which this skills max benefits will be reached on the curve */ public int getMaxBonusLevel(SubSkillType subSkillType) { - String keyPath = subSkillType.getAdvConfigAddress() + ".MaxBonusLevel."; - return mcMMO.isRetroModeEnabled() ? config.getInt(keyPath + "RetroMode", 1000) : config.getInt(keyPath + "Standard", 100); + if(!mcMMO.isRetroModeEnabled()) + + String[] keyPath = {subSkillType.getAdvConfigAddress(), MAX_BONUS_LEVEL}; + return mcMMO.isRetroModeEnabled() ? getIntValue(keyPath+ RETRO_MODE) : getIntValue(keyPath+ STANDARD); } public int getMaxBonusLevel(AbstractSubSkill abstractSubSkill) { @@ -700,99 +475,40 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { } public double getMaximumProbability(SubSkillType subSkillType) { - double maximumProbability = config.getDouble(subSkillType.getAdvConfigAddress() + ".ChanceMax", 100.0D); + double maximumProbability = getDoubleValue(subSkillType.getAdvConfigAddress(), CHANCE_MAX); return maximumProbability; } - public double getMaximumProbability(AbstractSubSkill abstractSubSkill) { + public double getMaximumProbability(AbstractSubSkill abstractSubSkill) + { return getMaximumProbability(abstractSubSkill.getSubSkillType()); } /* Notification Settings */ - public boolean doesSkillCommandSendBlankLines() { - return config.getBoolean("Feedback.SkillCommand.BlankLinesAboveHeader", true); - } - - public boolean doesNotificationUseActionBar(NotificationType notificationType) { - return config.getBoolean("Feedback.ActionBarNotifications." + notificationType.toString() + ".Enabled", true); - } - - public boolean doesNotificationSendCopyToChat(NotificationType notificationType) { - return config.getBoolean("Feedback.ActionBarNotifications." + notificationType.toString() + ".SendCopyOfMessageToChat", false); - } - - public boolean useTitlesForXPEvent() { - return config.getBoolean("Feedback.Events.XP.SendTitles", true); - } - - /* - * JSON Style Settings - */ - - - /*public ChatColor getJSONStatHoverElementColor(StatType statType, boolean isPrefix) + public boolean doesSkillCommandSendBlankLines() { - String keyAddress = isPrefix ? "Prefix" : "Value"; - String keyLocation = "Style.JSON.Hover.Details." + StringUtils.getCapitalized(statType.toString()) +"."+keyAddress+".Color"; - - return getChatColorFromKey(keyLocation); - }*/ - - /** - * Used to color our details header in our JSON Hover Object tooltips - * - * @return the ChatColor for this element - */ - /*public ChatColor getJSONStatHoverDetailsColor() - { - String keyLocation = "Style.JSON.Hover.Details.Header.Color"; - return getChatColorFromKey(keyLocation); + return getBooleanValue("Feedback.SkillCommand.BlankLinesAboveHeader"); } - public boolean isJSONDetailsHeaderBold() + public boolean doesNotificationUseActionBar(NotificationType notificationType) { - return config.getBoolean("Style.JSON.Hover.Details.Header.Bold"); + return getBooleanValue("Feedback.ActionBarNotifications."+notificationType.toString()+".Enabled"); } - public boolean isJSONDetailsHeaderItalic() + public boolean doesNotificationSendCopyToChat(NotificationType notificationType) { - return config.getBoolean("Style.JSON.Hover.Details.Header.Italics"); + return getBooleanValue("Feedback.ActionBarNotifications."+notificationType.toString()+".SendCopyOfMessageToChat"); } - public boolean isJSONDetailsHeaderUnderlined() + public boolean useTitlesForXPEvent() { - return config.getBoolean("Style.JSON.Hover.Details.Header.Underlined"); + return getBooleanValue("Feedback.Events.XP.SendTitles"); } - public ChatColor getJSONStatHoverDescriptionColor() - { - String keyLocation = "Style.JSON.Hover.Details.Description.Color"; - return getChatColorFromKey(keyLocation); - } - - public boolean isJSONDetailsDescriptionBold() - { - return config.getBoolean("Style.JSON.Hover.Details.Description.Bold"); - } - - public boolean isJSONDetailsDescriptionItalic() - { - return config.getBoolean("Style.JSON.Hover.Details.Description.Italics"); - } - - public boolean isJSONDetailsDescriptionUnderlined() - { - return config.getBoolean("Style.JSON.Hover.Details.Description.Underlined"); - } - - public ChatColor getJSONActionBarColor(NotificationType notificationType) - { - return getChatColor(config.getString("Style.JSON.Notification."+notificationType.toString()+".Color")); - }*/ private ChatColor getChatColorFromKey(String keyLocation) { - String colorName = config.getString(keyLocation); + String colorName = getStringValue(keyLocation); return getChatColor(colorName); } @@ -808,388 +524,139 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { return ChatColor.WHITE; } - /*public boolean isJSONStatHoverElementBold(StatType statType, boolean isPrefix) - { - String keyAddress = isPrefix ? "Prefix" : "Value"; - String keyLocation = "Style.JSON.Hover.Details." + StringUtils.getCapitalized(statType.toString()) +"."+keyAddress+".Bold"; - return config.getBoolean(keyLocation); - } - - public boolean isJSONStatHoverElementItalic(StatType statType, boolean isPrefix) - { - String keyAddress = isPrefix ? "Prefix" : "Value"; - String keyLocation = "Style.JSON.Hover.Details." + StringUtils.getCapitalized(statType.toString()) +"."+keyAddress+".Italics"; - return config.getBoolean(keyLocation); - } - - public boolean isJSONStatHoverElementUnderlined(StatType statType, boolean isPrefix) - { - String keyAddress = isPrefix ? "Prefix" : "Value"; - String keyLocation = "Style.JSON.Hover.Details." + StringUtils.getCapitalized(statType.toString()) +"."+keyAddress+".Underline"; - return config.getBoolean(keyLocation); - }*/ - /** * Some SubSkills have the ability to retain classic functionality - * * @param subSkillType SubSkillType with classic functionality * @return true if the subskill is in classic mode */ - public boolean isSubSkillClassic(SubSkillType subSkillType) { - return config.getBoolean(subSkillType.getAdvConfigAddress() + ".Classic"); + public boolean isSubSkillClassic(SubSkillType subSkillType) + { + return getBooleanValue(subSkillType.getAdvConfigAddress()+".Classic"); } /* ACROBATICS */ - public double getDodgeDamageModifier() { - return config.getDouble("Skills.Acrobatics.Dodge.DamageModifier", 2.0D); - } + public double getDodgeDamageModifier() { return getDoubleValue(SKILLS, ACROBATICS, DODGE, DAMAGE_MODIFIER); } - public double getRollDamageThreshold() { - return config.getDouble("Skills.Acrobatics.Roll.DamageThreshold", 7.0D); - } + public double getRollDamageThreshold() { return getDoubleValue(SKILLS, ACROBATICS + ".Roll." + DAMAGE_THRESHOLD); } - public double getGracefulRollDamageThreshold() { - return config.getDouble("Skills.Acrobatics.GracefulRoll.DamageThreshold", 14.0D); - } + public double getGracefulRollDamageThreshold() { return getDoubleValue(SKILLS, ACROBATICS + ".GracefulRoll." + DAMAGE_THRESHOLD); } /* ALCHEMY */ - /*public int getCatalysisUnlockLevel() { return config.getInt("Skills.Alchemy.Catalysis.UnlockLevel", 100); }*/ - public int getCatalysisMaxBonusLevel() { - return config.getInt("Skills.Alchemy.Catalysis.MaxBonusLevel", 1000); - } + public int getCatalysisMaxBonusLevel() { return getIntValue(SKILLS, ALCHEMY, CATALYSIS, MAX_BONUS_LEVEL); } - public double getCatalysisMinSpeed() { - return config.getDouble("Skills.Alchemy.Catalysis.MinSpeed", 1.0D); - } - - public double getCatalysisMaxSpeed() { - return config.getDouble("Skills.Alchemy.Catalysis.MaxSpeed", 4.0D); - } - - //public int getConcoctionsTierLevel(Alchemy.Tier tier) { return config.getInt("Skills.Alchemy.Rank_Levels.Rank_" + rank); } + public double getCatalysisMinSpeed() { return getDoubleValue(SKILLS, ALCHEMY, CATALYSIS, MIN_SPEED); } + public double getCatalysisMaxSpeed() { return getDoubleValue(SKILLS, ALCHEMY, CATALYSIS, MAX_SPEED); } /* ARCHERY */ - public double getSkillShotRankDamageMultiplier() { - return config.getDouble("Skills.Archery.SkillShot.RankDamageMultiplier", 10.0D); - } + public double getSkillShotRankDamageMultiplier() { return getDoubleValue(SKILLS, ARCHERY, SKILL_SHOT, RANK_DAMAGE_MULTIPLIER); } + public double getSkillShotDamageMax() { return getDoubleValue(SKILLS, ARCHERY, SKILL_SHOT + ".MaxDamage"); } - public double getSkillShotDamageMax() { - return config.getDouble("Skills.Archery.SkillShot.MaxDamage", 9.0D); - } + public double getDazeBonusDamage() { return getDoubleValue(SKILLS, ARCHERY + ".Daze." + BONUS_DAMAGE); } - public double getDazeBonusDamage() { - return config.getDouble("Skills.Archery.Daze.BonusDamage", 4.0D); - } - - public double getForceMultiplier() { - return config.getDouble("Skills.Archery.ForceMultiplier", 2.0D); - } + public double getForceMultiplier() { return getDoubleValue(SKILLS, ARCHERY, FORCE_MULTIPLIER); } /* AXES */ - public double getAxeMasteryRankDamageMultiplier() { - return config.getDouble("Skills.Axes.AxeMastery.RankDamageMultiplier", 1.0D); - } + public double getAxeMasteryRankDamageMultiplier() { return getDoubleValue(SKILLS, AXES + ".AxeMastery." + RANK_DAMAGE_MULTIPLIER); } - public double getCriticalStrikesPVPModifier() { - return config.getDouble("Skills.Axes.CriticalStrikes.PVP_Modifier", 1.5D); - } + public double getCriticalStrikesPVPModifier() { return getDoubleValue(SKILLS, AXES + ".CriticalStrikes." + PVP_MODIFIER); } + public double getCriticalStrikesPVEModifier() { return getDoubleValue(SKILLS, AXES + ".CriticalStrikes." + PVE_MODIFIER); } - public double getCriticalStrikesPVEModifier() { - return config.getDouble("Skills.Axes.CriticalStrikes.PVE_Modifier", 2.0D); - } - - public double getGreaterImpactChance() { - return config.getDouble("Skills.Axes.GreaterImpact.Chance", 25.0D); - } - - public double getGreaterImpactModifier() { - return config.getDouble("Skills.Axes.GreaterImpact.KnockbackModifier", 1.5D); - } - - public double getGreaterImpactBonusDamage() { - return config.getDouble("Skills.Axes.GreaterImpact.BonusDamage", 2.0D); - } + public double getGreaterImpactChance() { return getDoubleValue(SKILLS, AXES + ".GreaterImpact." + CHANCE); } + public double getGreaterImpactModifier() { return getDoubleValue(SKILLS, AXES + ".GreaterImpact." + KNOCKBACK_MODIFIER); } + public double getGreaterImpactBonusDamage() { return getDoubleValue(SKILLS, AXES + ".GreaterImpact." + BONUS_DAMAGE); } public int getArmorImpactIncreaseLevel() { - int increaseLevel = config.getInt("Skills.Axes.ArmorImpact.IncreaseLevel", 5); + int increaseLevel = getIntValue(SKILLS, AXES + ".ArmorImpact." + INCREASE_LEVEL); - if (mcMMO.isRetroModeEnabled()) + if(mcMMO.isRetroModeEnabled()) return increaseLevel * 10; return increaseLevel; } - public double getImpactChance() { - return config.getDouble("Skills.Axes.ArmorImpact.Chance", 25.0D); - } + public double getImpactChance() { return getDoubleValue(SKILLS, AXES + ".ArmorImpact." + CHANCE); } + public double getArmorImpactMaxDurabilityDamage() { return getDoubleValue(SKILLS, AXES + ".ArmorImpact.MaxPercentageDurabilityDamage"); } - public double getArmorImpactMaxDurabilityDamage() { - return config.getDouble("Skills.Axes.ArmorImpact.MaxPercentageDurabilityDamage", 20.0D); - } - - public double getSkullSplitterModifier() { - return config.getDouble("Skills.Axes.SkullSplitter.DamageModifier", 2.0D); - } + public double getSkullSplitterModifier() { return getDoubleValue(SKILLS, AXES + ".SkullSplitter." + DAMAGE_MODIFIER); } /* EXCAVATION */ //Nothing to configure, everything is already configurable in config.yml /* FISHING */ - //public int getFishingTierLevel(int rank) { return config.getInt("Skills.Fishing.Rank_Levels.Rank_" + rank); } - public double getShakeChance(int rank) { - return config.getDouble("Skills.Fishing.ShakeChance.Rank_" + rank); - } - - public int getFishingVanillaXPModifier(int rank) { - return config.getInt("Skills.Fishing.VanillaXPMultiplier.Rank_" + rank); - } - - public int getFishermanDietRankChange() { - return config.getInt("Skills.Fishing.FishermansDiet.RankChange", 200); - } - - /*public int getIceFishingUnlockLevel() { return config.getInt("Skills.Fishing.IceFishing.UnlockLevel", 50); } - - public int getMasterAnglerUnlockLevel() {return config.getInt("Skills.Fishing.MasterAngler.UnlockLevel", 125); }*/ - public double getMasterAnglerBoatModifier() { - return config.getDouble("Skills.Fishing.MasterAngler.BoatModifier", 2.0); - } - - public double getMasterAnglerBiomeModifier() { - return config.getDouble("Skills.Fishing.MasterAngler.BiomeModifier", 2.0); - } + public double getShakeChance(int rank) { return getDoubleValue(SKILLS + "." + FISHING + ".Shake" + CHANCE + "." + RANK + rank); } + public int getFishingVanillaXPModifier(int rank) { return getIntValue(SKILLS + "." + FISHING + "." + VANILLA_XPMULTIPLIER + "." + RANK + rank); } + //public int getFishermanDietRankChange() { return getIntValue(SKILLS + "." + FISHING + ".FishermansDiet.RankChange"); } + public double getMasterAnglerBoatModifier() {return getDoubleValue(SKILLS + "." + FISHING + "." + MASTER_ANGLER + "." + BOAT_MODIFIER); } + public double getMasterAnglerBiomeModifier() {return getDoubleValue(SKILLS + "." + FISHING + "." + MASTER_ANGLER + "." + BIOME_MODIFIER); } /* HERBALISM */ - public int getFarmerDietRankChange() { - return config.getInt("Skills.Herbalism.FarmersDiet.RankChange", 200); - } + //public int getFarmerDietRankChange() { return getIntValue(SKILLS + ".Herbalism.FarmersDiet.RankChange"); } - public int getGreenThumbStageChange() { - return config.getInt("Skills.Herbalism.GreenThumb.StageChange", 200); - } + //public int getGreenThumbStageChange() { return getIntValue(SKILLS + ".Herbalism.GreenThumb.StageChange"); } /* MINING */ - public int getBlastMiningRankLevel(int rank) { - return config.getInt("Skills.Mining.BlastMining.Rank_Levels.Rank_" + rank); - } - - public double getBlastDamageDecrease(int rank) { - return config.getDouble("Skills.Mining.BlastMining.BlastDamageDecrease.Rank_" + rank); - } - - public double getOreBonus(int rank) { - return config.getDouble("Skills.Mining.BlastMining.OreBonus.Rank_" + rank); - } - - public double getDebrisReduction(int rank) { - return config.getDouble("Skills.Mining.BlastMining.DebrisReduction.Rank_" + rank); - } - - public int getDropMultiplier(int rank) { - return config.getInt("Skills.Mining.BlastMining.DropMultiplier.Rank_" + rank); - } - - public double getBlastRadiusModifier(int rank) { - return config.getDouble("Skills.Mining.BlastMining.BlastRadiusModifier.Rank_" + rank); - } + public int getBlastMiningRankLevel(int rank) { return getIntValue(SKILLS + ".Mining.BlastMining." + RANK + "Levels.Rank_" + rank); } + public double getBlastDamageDecrease(int rank) { return getDoubleValue(SKILLS + ".Mining.BlastMining.BlastDamageDecrease." + RANK + rank); } + public double getOreBonus(int rank) { return getDoubleValue(SKILLS + ".Mining.BlastMining.OreBonus." + RANK + rank); } + public double getDebrisReduction(int rank) { return getDoubleValue(SKILLS + ".Mining.BlastMining.DebrisReduction." + RANK + rank); } + public int getDropMultiplier(int rank) { return getIntValue(SKILLS + ".Mining.BlastMining.DropMultiplier." + RANK + rank); } + public double getBlastRadiusModifier(int rank) { return getDoubleValue(SKILLS + ".Mining.BlastMining.BlastRadius" + MODIFIER + "." + RANK + rank); } /* REPAIR */ - public double getRepairMasteryMaxBonus() { - return config.getDouble("Skills.Repair.RepairMastery.MaxBonusPercentage", 200.0D); - } - - public int getRepairMasteryMaxLevel() { - return config.getInt("Skills.Repair.RepairMastery.MaxBonusLevel", 100); - } + public double getRepairMasteryMaxBonus() { return getDoubleValue(SKILLS + ".Repair.RepairMastery.MaxBonusPercentage"); } + public int getRepairMasteryMaxLevel() { return getIntValue(SKILLS + ".Repair.RepairMastery." + MAX_BONUS_LEVEL); } /* Arcane Forging */ - //public int getArcaneForgingRankLevel(int rank) { return config.getInt("Skills.Repair.ArcaneForging.Rank_Levels.Rank_" + rank); } + public boolean getArcaneForgingEnchantLossEnabled() { return getBooleanValue(SKILLS + ".Repair.ArcaneForging.May_Lose_Enchants"); } + public double getArcaneForgingKeepEnchantsChance(int rank) { return getDoubleValue(SKILLS + ".Repair.ArcaneForging.Keep_Enchants_" + CHANCE + "." + RANK + rank); } - public boolean getArcaneForgingEnchantLossEnabled() { - return config.getBoolean("Skills.Repair.ArcaneForging.May_Lose_Enchants", true); - } - - public double getArcaneForgingKeepEnchantsChance(int rank) { - return config.getDouble("Skills.Repair.ArcaneForging.Keep_Enchants_Chance.Rank_" + rank); - } - - public boolean getArcaneForgingDowngradeEnabled() { - return config.getBoolean("Skills.Repair.ArcaneForging.Downgrades_Enabled", true); - } - - public double getArcaneForgingDowngradeChance(int rank) { - return config.getDouble("Skills.Repair.ArcaneForging.Downgrades_Chance.Rank_" + rank); - } + public boolean getArcaneForgingDowngradeEnabled() { return getBooleanValue(SKILLS + ".Repair.ArcaneForging.Downgrades_Enabled"); } + public double getArcaneForgingDowngradeChance(int rank) { return getDoubleValue(SKILLS + ".Repair.ArcaneForging.Downgrades_" + CHANCE + "." + RANK + rank); } /* SALVAGE */ - //public double getSalvageMaxPercentage() { return config.getDouble("Skills.Salvage.MaxPercentage", 100.0D); } - //public int getSalvageMaxPercentageLevel() { return config.getInt("Skills.Salvage.MaxPercentageLevel", 1000); } - public boolean getArcaneSalvageEnchantDowngradeEnabled() { - return config.getBoolean("Skills.Salvage.ArcaneSalvage.EnchantDowngradeEnabled", true); - } + public boolean getArcaneSalvageEnchantDowngradeEnabled() { return getBooleanValue(SKILLS + ".Salvage.ArcaneSalvage.EnchantDowngradeEnabled"); } + public boolean getArcaneSalvageEnchantLossEnabled() { return getBooleanValue(SKILLS + ".Salvage.ArcaneSalvage.EnchantLossEnabled"); } - public boolean getArcaneSalvageEnchantLossEnabled() { - return config.getBoolean("Skills.Salvage.ArcaneSalvage.EnchantLossEnabled", true); - } - - //public int getArcaneSalvageRankLevel(int rank) { return config.getInt("Skills.Salvage.ArcaneSalvage.Rank_Levels.Rank_" + rank); } - public double getArcaneSalvageExtractFullEnchantsChance(int rank) { - return config.getDouble("Skills.Salvage.ArcaneSalvage.ExtractFullEnchant.Rank_" + rank); - } - - public double getArcaneSalvageExtractPartialEnchantsChance(int rank) { - return config.getDouble("Skills.Salvage.ArcaneSalvage.ExtractPartialEnchant.Rank_" + rank); - } + public double getArcaneSalvageExtractFullEnchantsChance(int rank) { return getDoubleValue(SKILLS + ".Salvage.ArcaneSalvage.ExtractFullEnchant." + RANK + rank); } + public double getArcaneSalvageExtractPartialEnchantsChance(int rank) { return getDoubleValue(SKILLS + ".Salvage.ArcaneSalvage.ExtractPartialEnchant." + RANK + rank); } /* SMELTING */ - public int getBurnModifierMaxLevel() { - return config.getInt("Skills.Smelting.FuelEfficiency.MaxBonusLevel", 100); - } + public int getBurnModifierMaxLevel() { return getIntValue(SKILLS + ".Smelting.FuelEfficiency." + MAX_BONUS_LEVEL); } + public double getBurnTimeMultiplier() { return getDoubleValue(SKILLS + ".Smelting.FuelEfficiency.Multiplier"); } - public double getBurnTimeMultiplier() { - return config.getDouble("Skills.Smelting.FuelEfficiency.Multiplier", 3.0D); - } + public double getFluxMiningChance() { return getDoubleValue(SKILLS + ".Smelting.FluxMining." + CHANCE); } - /*public int getFluxMiningUnlockLevel() { return config.getInt("Skills.Smelting.FluxMining.UnlockLevel", 250); }*/ - public double getFluxMiningChance() { - return config.getDouble("Skills.Smelting.FluxMining.Chance", 33.0D); - } + public int getSmeltingRankLevel(int rank) { return getIntValue(SKILLS + ".Smelting." + RANK + "Levels.Rank_" + rank); } - public int getSmeltingRankLevel(int rank) { - return config.getInt("Skills.Smelting.Rank_Levels.Rank_" + rank); - } - - public int getSmeltingVanillaXPBoostMultiplier(int rank) { - return config.getInt("Skills.Smelting.VanillaXPMultiplier.Rank_" + rank); - } + public int getSmeltingVanillaXPBoostMultiplier(int rank) { return getIntValue(SKILLS + ".Smelting." + VANILLA_XPMULTIPLIER + "." + RANK + rank); } /* SWORDS */ - public double getRuptureDamagePlayer() { - return config.getDouble("Skills.Swords.Rupture.DamagePlayer", 1.0); - } + public double getRuptureDamagePlayer() { return getDoubleValue(SKILLS + ".Swords.Rupture.DamagePlayer"); } + public double getRuptureDamageMobs() { return getDoubleValue(SKILLS + ".Swords.Rupture.DamageMobs"); } - public double getRuptureDamageMobs() { - return config.getDouble("Skills.Swords.Rupture.DamageMobs", 2.0); - } + public int getRuptureMaxTicks() { return getIntValue(SKILLS + ".Swords.Rupture.MaxTicks"); } + public int getRuptureBaseTicks() { return getIntValue(SKILLS + ".Swords.Rupture.BaseTicks"); } - public int getRuptureMaxTicks() { - return config.getInt("Skills.Swords.Rupture.MaxTicks", 8); - } + public double getCounterModifier() { return getDoubleValue(SKILLS + ".Swords.CounterAttack." + DAMAGE_MODIFIER); } - public int getRuptureBaseTicks() { - return config.getInt("Skills.Swords.Rupture.BaseTicks", 2); - } - - public double getCounterModifier() { - return config.getDouble("Skills.Swords.CounterAttack.DamageModifier", 2.0D); - } - - public double getSerratedStrikesModifier() { - return config.getDouble("Skills.Swords.SerratedStrikes.DamageModifier", 4.0D); - } - - public int getSerratedStrikesTicks() { - return config.getInt("Skills.Swords.SerratedStrikes.RuptureTicks", 5); - } + public double getSerratedStrikesModifier() { return getDoubleValue(SKILLS + ".Swords.SerratedStrikes." + DAMAGE_MODIFIER); } + public int getSerratedStrikesTicks() { return getIntValue(SKILLS + ".Swords.SerratedStrikes.RuptureTicks"); } /* TAMING */ - //public int getGoreRuptureTicks() { return config.getInt("Skills.Taming.Gore.RuptureTicks", 2); } - public double getGoreModifier() { - return config.getDouble("Skills.Taming.Gore.Modifier", 2.0D); - } + public double getGoreModifier() { return getDoubleValue(SKILLS + "." + TAMING + ".Gore." + MODIFIER); } + public double getFastFoodChance() { return getDoubleValue(SKILLS + "." + TAMING + ".FastFoodService." + CHANCE); } + public double getPummelChance() { return getDoubleValue(SKILLS + "." + TAMING + ".Pummel." + CHANCE); } + public double getThickFurModifier() { return getDoubleValue(SKILLS + "." + TAMING + ".ThickFur." + MODIFIER); } + public double getShockProofModifier() { return getDoubleValue(SKILLS + "." + TAMING + "." + SHOCK_PROOF + "." + MODIFIER); } - /*public int getFastFoodUnlock() { return config.getInt("Skills.Taming.FastFood.UnlockLevel", 50); }*/ - public double getFastFoodChance() { - return config.getDouble("Skills.Taming.FastFoodService.Chance", 50.0D); - } + public double getSharpenedClawsBonus() { return getDoubleValue(SKILLS + "." + TAMING + ".SharpenedClaws.Bonus"); } - public double getPummelChance() { - return config.getDouble("Skills.Taming.Pummel.Chance", 10.0D); - } - - //public int getEnviromentallyAwareUnlock() { return config.getInt("Skills.Taming.EnvironmentallyAware.UnlockLevel", 100); } - - /*public int getThickFurUnlock() { return config.getInt("Skills.Taming.ThickFur.UnlockLevel", 250); }*/ - public double getThickFurModifier() { - return config.getDouble("Skills.Taming.ThickFur.Modifier", 2.0D); - } - - /*public int getHolyHoundUnlock() {return config.getInt("Skills.Taming.HolyHound.UnlockLevel", 375); }*/ - - /*public int getShockProofUnlock() { return config.getInt("Skills.Taming.ShockProof.UnlockLevel", 500); }*/ - public double getShockProofModifier() { - return config.getDouble("Skills.Taming.ShockProof.Modifier", 6.0D); - } - - /*public int getSharpenedClawsUnlock() { return config.getInt("Skills.Taming.SharpenedClaws.UnlockLevel", 750); }*/ - public double getSharpenedClawsBonus() { - return config.getDouble("Skills.Taming.SharpenedClaws.Bonus", 2.0D); - } - - public double getMinHorseJumpStrength() { - return config.getDouble("Skills.Taming.CallOfTheWild.MinHorseJumpStrength", 0.7D); - } - - public double getMaxHorseJumpStrength() { - return config.getDouble("Skills.Taming.CallOfTheWild.MaxHorseJumpStrength", 2.0D); - } + public double getMinHorseJumpStrength() { return getDoubleValue(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD + "." + MIN_HORSE_JUMP_STRENGTH); } + public double getMaxHorseJumpStrength() { return getDoubleValue(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD + "." + MAX_HORSE_JUMP_STRENGTH); } /* UNARMED */ - - public boolean getDisarmProtected() { - return config.getBoolean("Skills.Unarmed.Disarm.AntiTheft", false); - } + public boolean getDisarmProtected() { return getBooleanValue(SKILLS + "." + UNARMED + ".Disarm.AntiTheft"); } /* WOODCUTTING */ - /*public int getLeafBlowUnlockLevel() { return config.getInt("Skills.Woodcutting.LeafBlower.UnlockLevel", 100); }*/ - - /* KRAKEN STUFF */ - public boolean getKrakenEnabled() { - return config.getBoolean("Kraken.Enabled", true); - } - - public int getKrakenTriesBeforeRelease() { - return config.getInt("Kraken.Tries_Before_Release", 50); - } - - public double getKrakenHealth() { - return config.getDouble("Kraken.Health", 50.0D); - } - - public String getKrakenName() { - return config.getString("Kraken.Name", "The Kraken"); - } - - public int getKrakenAttackInterval() { - return config.getInt("Kraken.Attack_Interval_Seconds", 1); - } - - public double getKrakenAttackDamage() { - return config.getDouble("Kraken.Attack_Damage", 1.0D); - } - - public boolean getKrakenGlobalEffectsEnabled() { - return config.getBoolean("Kraken.Global_Effects", false); - } - - public boolean getKrakenEscapeAllowed() { - return config.getBoolean("Kraken.Allow_Escaping", false); - } - - public String getServerUnleashMessage() { - return config.getString("Kraken.Unleashed_Message.Server", ""); - } - - public String getPlayerUnleashMessage() { - return config.getString("Kraken.Unleashed_Message.Player", ""); - } - - public String getPlayerDefeatMessage() { - return config.getString("Kraken.Defeated_Message.Killed", ""); - } - - public String getPlayerEscapeMessage() { - return config.getString("Kraken.Defeated_Message.Escape", ""); - } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/AutoUpdateConfigLoader.java b/core/src/main/java/com/gmail/nossr50/core/config/AutoUpdateConfigLoader.java deleted file mode 100644 index 16dd833c4..000000000 --- a/core/src/main/java/com/gmail/nossr50/core/config/AutoUpdateConfigLoader.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.gmail.nossr50.core.config; - -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.configuration.file.YamlConfiguration; - -import java.io.*; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.Set; - -public abstract class AutoUpdateConfigLoader extends ConfigLoader { - public AutoUpdateConfigLoader(String relativePath, String fileName) { - super(relativePath, fileName); - } - - public AutoUpdateConfigLoader(String fileName) { - super(fileName); - } - - @Override - protected void loadFile() { - super.loadFile(); - FileConfiguration internalConfig = YamlConfiguration.loadConfiguration(plugin.getResourceAsReader(fileName)); - - Set configKeys = config.getKeys(true); - Set internalConfigKeys = internalConfig.getKeys(true); - - boolean needSave = false; - - Set oldKeys = new HashSet(configKeys); - oldKeys.removeAll(internalConfigKeys); - - Set newKeys = new HashSet(internalConfigKeys); - newKeys.removeAll(configKeys); - - // Don't need a re-save if we have old keys sticking around? - // Would be less saving, but less... correct? - if (!newKeys.isEmpty() || !oldKeys.isEmpty()) { - needSave = true; - } - - for (String key : oldKeys) { - plugin.debug("Detected potentially unused key: " + key); - //config.set(key, null); - } - - for (String key : newKeys) { - plugin.debug("Adding new key: " + key + " = " + internalConfig.get(key)); - config.set(key, internalConfig.get(key)); - } - - if (needSave) { - // Get Bukkit's version of an acceptable config with new keys, and no old keys - String output = config.saveToString(); - - // Convert to the superior 4 space indentation - output = output.replace(" ", " "); - - // Rip out Bukkit's attempt to save comments at the top of the file - while (output.replaceAll("[//s]", "").startsWith("#")) { - output = output.substring(output.indexOf('\n', output.indexOf('#')) + 1); - } - - // Read the internal config to get comments, then put them in the new one - try { - // Read internal - BufferedReader reader = new BufferedReader(new InputStreamReader(plugin.getResource(fileName))); - LinkedHashMap comments = new LinkedHashMap(); - String temp = ""; - - String line; - while ((line = reader.readLine()) != null) { - if (line.contains("#")) { - temp += line + "\n"; - } else if (line.contains(":")) { - line = line.substring(0, line.indexOf(":") + 1); - if (!temp.isEmpty()) { - if (comments.containsKey(line)) { - int index = 0; - while (comments.containsKey(line + index)) { - index++; - } - - line = line + index; - } - - comments.put(line, temp); - temp = ""; - } - } - } - - // Dump to the new one - HashMap indexed = new HashMap(); - for (String key : comments.keySet()) { - String actualkey = key.substring(0, key.indexOf(":") + 1); - - int index = 0; - if (indexed.containsKey(actualkey)) { - index = indexed.get(actualkey); - } - boolean isAtTop = !output.contains("\n" + actualkey); - index = output.indexOf((isAtTop ? "" : "\n") + actualkey, index); - - if (index >= 0) { - output = output.substring(0, index) + "\n" + comments.get(key) + output.substring(isAtTop ? index : index + 1); - indexed.put(actualkey, index + comments.get(key).length() + actualkey.length() + 1); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - - // Save it - try { - String saveName = fileName; - // At this stage we cannot guarantee that Config has been loaded, so we do the check directly here - if (!plugin.getConfig().getBoolean("General.Config_Update_Overwrite", true)) { - saveName += ".new"; - } - - BufferedWriter writer = new BufferedWriter(new FileWriter(new File(plugin.getDataFolder(), saveName))); - writer.write(output); - writer.flush(); - writer.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - } -} diff --git a/core/src/main/java/com/gmail/nossr50/core/config/ChunkConversionOptions.java b/core/src/main/java/com/gmail/nossr50/core/config/ChunkConversionOptions.java new file mode 100644 index 000000000..8e860e1da --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/config/ChunkConversionOptions.java @@ -0,0 +1,38 @@ +package com.gmail.nossr50.core.config; + +/** + * This class is used to define settings for upgrading EXTREMELY OLD versions of mcMMO to newer versions + * It could probably be deleted + */ +public class ChunkConversionOptions { + private static final boolean chunkletsEnabled = true; + private static final int conversionRate = 1; + private static final boolean useEnchantmentBuffs = true; + private static final int uuidConvertAmount = 5; + private static final int mojangRateLimit = 50000; + private static final long mojangLimitPeriod = 600000; + + public static boolean getChunkletsEnabled() { + return chunkletsEnabled; + } + + public static int getConversionRate() { + return conversionRate; + } + + public static boolean useEnchantmentBuffs() { + return useEnchantmentBuffs; + } + + public static int getUUIDConvertAmount() { + return uuidConvertAmount; + } + + public static int getMojangRateLimit() { + return mojangRateLimit; + } + + public static long getMojangLimitPeriod() { + return mojangLimitPeriod; + } +} diff --git a/core/src/main/java/com/gmail/nossr50/core/config/Config.java b/core/src/main/java/com/gmail/nossr50/core/config/Config.java index 921fb362f..dc507b270 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/Config.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/Config.java @@ -1,5 +1,6 @@ package com.gmail.nossr50.core.config; +import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.data.database.SQLDatabaseManager; import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.core.skills.MobHealthbarType; @@ -11,11 +12,11 @@ import java.util.ArrayList; import java.util.List; import java.util.Set; -public class Config extends AutoUpdateConfigLoader { +public class Config extends ConfigurableLoader { private static Config instance; private Config() { - super("config.yml"); + super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "config.yml"); validate(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/ConfigLoader.java b/core/src/main/java/com/gmail/nossr50/core/config/ConfigLoader.java deleted file mode 100644 index dbe24ef73..000000000 --- a/core/src/main/java/com/gmail/nossr50/core/config/ConfigLoader.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.gmail.nossr50.core.config; - -import com.gmail.nossr50.mcMMO; -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.configuration.file.YamlConfiguration; - -import java.io.File; -import java.util.List; - -public abstract class ConfigLoader { - protected static final mcMMO plugin = mcMMO.p; - protected String fileName; - protected FileConfiguration config; - private File configFile; - - public ConfigLoader(String relativePath, String fileName) { - this.fileName = fileName; - configFile = new File(plugin.getDataFolder(), relativePath + File.separator + fileName); - loadFile(); - } - - public ConfigLoader(String fileName) { - this.fileName = fileName; - configFile = new File(plugin.getDataFolder(), fileName); - loadFile(); - } - - protected void loadFile() { - if (!configFile.exists()) { - plugin.debug("Creating mcMMO " + fileName + " File..."); - - try { - plugin.saveResource(fileName, false); // Normal files - } catch (IllegalArgumentException ex) { - plugin.saveResource(configFile.getParentFile().getName() + File.separator + fileName, false); // Mod files - } - } else { - plugin.debug("Loading mcMMO " + fileName + " File..."); - } - - config = YamlConfiguration.loadConfiguration(configFile); - } - - protected abstract void loadKeys(); - - protected boolean validateKeys() { - return true; - } - - protected boolean noErrorsInConfig(List issues) { - for (String issue : issues) { - plugin.getLogger().warning(issue); - } - - return issues.isEmpty(); - } - - protected void validate() { - if (validateKeys()) { - plugin.debug("No errors found in " + fileName + "!"); - } else { - plugin.getLogger().warning("Errors were found in " + fileName + "! mcMMO was disabled!"); - plugin.getServer().getPluginManager().disablePlugin(plugin); - plugin.noErrorsInConfigFiles = false; - } - } - - public File getFile() { - return configFile; - } - - public void backup() { - plugin.getLogger().warning("You are using an old version of the " + fileName + " file."); - plugin.getLogger().warning("Your old file has been renamed to " + fileName + ".old and has been replaced by an updated version."); - - configFile.renameTo(new File(configFile.getPath() + ".old")); - - if (plugin.getResource(fileName) != null) { - plugin.saveResource(fileName, true); - } - - plugin.getLogger().warning("Reloading " + fileName + " with new values..."); - loadFile(); - loadKeys(); - } -} diff --git a/core/src/main/java/com/gmail/nossr50/core/config/ConfigurableLoader.java b/core/src/main/java/com/gmail/nossr50/core/config/ConfigurableLoader.java index 5e75d96ea..31ee0b558 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/ConfigurableLoader.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/ConfigurableLoader.java @@ -1,4 +1,312 @@ package com.gmail.nossr50.core.config; -public class ConfigurableLoader { +import com.gmail.nossr50.core.McmmoCore; +import com.google.common.io.Files; +import ninja.leaping.configurate.ConfigurationNode; +import ninja.leaping.configurate.commented.CommentedConfigurationNode; +import ninja.leaping.configurate.loader.ConfigurationLoader; +import ninja.leaping.configurate.yaml.YAMLConfigurationLoader; +import org.yaml.snakeyaml.DumperOptions; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; + +/** + * Handles loading and cacheing configuration settings from a configurable compatible config file + */ +//@ConfigSerializable +public abstract class ConfigurableLoader implements DefaultKeys, VersionedConfig { + + /* PATH VARS */ + + public final File DIRECTORY_DATA_FOLDER; //Directory that the file is in + public final String FILE_RELATIVE_PATH; //Relative Path to the file + protected final String DIRECTORY_DEFAULTS = "defaults"; + + /* LOADERS */ + + private YAMLConfigurationLoader defaultCopyLoader; + private YAMLConfigurationLoader userCopyLoader; + + /* CONFIG FILES */ + + private File resourceConfigCopy; //Copy of the default config from the JAR (file is copied so that admins can easily compare to defaults) + private File resourceUserCopy; //File in the /$MCMMO_ROOT/mcMMO/ directory that may contain user edited settings + + /* ROOT NODES */ + + private ConfigurationNode userRootNode = null; + private ConfigurationNode defaultRootNode = null; + + /* CONFIG MANAGER */ + private ConfigurationLoader configManager; + + //TODO: Needed? + //private ConfigurationLoader configManager; + + public ConfigurableLoader(File pathToDataFolder, String relativePath) { + /* + * These must be at the top + */ + mkdirDefaults(); // Make our default config dir + DIRECTORY_DATA_FOLDER = pathToDataFolder; //Data Folder for our plugin + FILE_RELATIVE_PATH = relativePath; //Relative path to config from a parent folder + + //Attempt IO Operations + try { + //Makes sure we have valid Files corresponding to this config + initConfigFiles(); + + //Init Config Loaders + initConfigLoaders(); + + //Load Config Nodes + loadConfig(); + + //Attempt to update user file, and then load it into memory + readConfig(); + } catch (IOException e) { + e.printStackTrace(); + } + + /* + * Print Errors about Keys + */ + + List validKeyErrors = validateKeys(); // Validate Keys + + if(validKeyErrors != null && validKeyErrors.size() > 0) + { + for(String error : validKeyErrors) + { + McmmoCore.getLogger().severe(error); + } + } + } + + /** + * Initializes the default copy File and the user config File + * @throws IOException + */ + private void initConfigFiles() throws IOException { + //Init our config copy + resourceConfigCopy = initDefaultConfig(); + + //Init the user file + resourceUserCopy = initUserConfig(); + } + + /** + * Loads the root node for the default config File and user config File + */ + private void loadConfig() + { + try { + final ConfigurationNode defaultConfig = this.defaultCopyLoader.load(); + defaultRootNode = defaultConfig; + + final ConfigurationNode userConfig = this.userCopyLoader.load(); + userRootNode = userConfig; + + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * Initializes the YAMLConfigurationLoaders for this config + */ + private void initConfigLoaders() + { + this.defaultCopyLoader = YAMLConfigurationLoader.builder().setPath(resourceConfigCopy.toPath()).setFlowStyle(DumperOptions.FlowStyle.BLOCK).build(); + this.userCopyLoader = YAMLConfigurationLoader.builder().setPath(resourceUserCopy.toPath()).setFlowStyle(DumperOptions.FlowStyle.FLOW).build(); + } + + /** + * Copies a new file from the JAR to the defaults directory and uses that new file to initialize our resourceConfigCopy + * @see ConfigurableLoader#resourceConfigCopy + * @throws IOException + */ + private File initDefaultConfig() throws IOException { + return copyDefaultFromJar(getDefaultConfigCopyRelativePath(), true); + } + + /** + * Attemps to load the config file if it exists, if it doesn't it copies a new one from within the JAR + * @return user config File + * @see ConfigurableLoader#resourceUserCopy + * @throws IOException + */ + private File initUserConfig() throws IOException { + File userCopy = new File(DIRECTORY_DATA_FOLDER, FILE_RELATIVE_PATH); //Load the user file; + + if(userCopy.exists()) + { + // Yay + return userCopy; + } + else + { + //If it's gone we copy default files + //Note that we don't copy the values from the default copy put in /defaults/ that file exists only as a reference to admins and is unreliable + return copyDefaultFromJar(FILE_RELATIVE_PATH, false); + } + } + + /** + * Used to make a new config file at a specified relative output path inside the data directory by copying the matching file found in that same relative path within the JAR + * @param relativeOutputPath the path to the output file + * @param deleteOld whether or not to delete the existing output file on disk + * @return a copy of the default config within the JAR + * @throws IOException + */ + private File copyDefaultFromJar(String relativeOutputPath, boolean deleteOld) throws IOException + { + /* + * Gen a Default config from inside the JAR + */ + McmmoCore.getLogger().info("Preparing to copy internal resource file (in JAR) - "+FILE_RELATIVE_PATH); + InputStream inputStream = McmmoCore.getResource(FILE_RELATIVE_PATH); + + byte[] buffer = new byte[inputStream.available()]; + inputStream.read(buffer); + + //This is a copy of the default file, which we will overwrite every time mcMMO loads + File targetFile = new File(DIRECTORY_DATA_FOLDER, relativeOutputPath); + + //Wipe old default file on disk + if (targetFile.exists() && deleteOld) + { + McmmoCore.getLogger().info("Updating file " + relativeOutputPath); + targetFile.delete(); //Necessary? + } + + if(!targetFile.exists()) + { + targetFile.getParentFile().mkdirs(); + targetFile.createNewFile(); //New File Boys + } + + Files.write(buffer, targetFile); + McmmoCore.getLogger().info("Created config file - " + relativeOutputPath); + + inputStream.close(); //Close the input stream + + return targetFile; + } + + /** + * The path to the defaults directory + * @return the path to the defaults directory + */ + private String getDefaultConfigCopyRelativePath() { + return DIRECTORY_DEFAULTS + File.separator + FILE_RELATIVE_PATH; + } + + /** + * Creates the defaults directory + */ + private void mkdirDefaults() { + //Make Default Subdirectory + File defaultsDir = new File (DIRECTORY_DATA_FOLDER, "defaults"); + + if(!defaultsDir.exists()) + defaultsDir.mkdir(); + } + + /** + * Configs are versioned based on when they had significant changes to keys + * @return current Config Version String + */ + public String getVersion() + { + return String.valueOf(getConfigVersion()); + } + + /** + * Attempts to read the loaded config file + * Config will have any necessary updates applied + * Config will be compared to the default config to see if it is missing any nodes + * Config will have any missing nodes inserted with their default value + */ + public void readConfig() { + McmmoCore.getLogger().info("Attempting to read " + FILE_RELATIVE_PATH + "."); + + int version = this.userRootNode.getNode("ConfigVersion").getInt(); + McmmoCore.getLogger().info(FILE_RELATIVE_PATH + " version is " + version); + + //Update our config + updateConfig(); + } + + /** + * Compares the users config file to the default and adds any missing nodes and applies any necessary updates + */ + private void updateConfig() + { + McmmoCore.getLogger().info(defaultRootNode.getChildrenMap().size() +" items in default children map"); + McmmoCore.getLogger().info(userRootNode.getChildrenMap().size() +" items in default root map"); + + // Merge Values from default + userRootNode = userRootNode.mergeValuesFrom(defaultRootNode); + + // Update config version + updateConfigVersion(); + + //Attempt to save + try { + saveUserCopy(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * Saves the current state information of the config to the users copy (which they may edit) + * @throws IOException + */ + private void saveUserCopy() throws IOException + { + McmmoCore.getLogger().info("Saving new node"); + userCopyLoader.save(userRootNode); + } + + /** + * Performs any necessary operations to update this config + */ + private void updateConfigVersion() { + // Set a version for our config + this.userRootNode.getNode("ConfigVersion").setValue(getConfigVersion()); + McmmoCore.getLogger().info("Updated config to ["+getConfigVersion()+"] - " + FILE_RELATIVE_PATH); + } + + /** + * Returns the root node of this config + * @return the root node of this config + */ + protected ConfigurationNode getUserRootNode() { + return userRootNode; + } + + int getIntValue(String... path) + { + return userRootNode.getNode(path).getInt(); + } + + double getDoubleValue(String... path) + { + return userRootNode.getNode(path).getDouble(); + } + + boolean getBooleanValue(String... path) + { + return userRootNode.getNode(path).getBoolean(); + } + + String getStringValue(String... path) + { + return userRootNode.getNode(path).getString(); + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/CoreSkillsConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/CoreSkillsConfig.java index 613000373..a176532de 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/CoreSkillsConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/CoreSkillsConfig.java @@ -1,14 +1,15 @@ package com.gmail.nossr50.core.config; -import com.gmail.nossr50.core.mcmmo.skills.PrimarySkillType; -import com.gmail.nossr50.core.mcmmo.skills.subskills.AbstractSubSkill; -import com.gmail.nossr50.util.StringUtils; +import com.gmail.nossr50.core.McmmoCore; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.util.StringUtils; -public class CoreSkillsConfig extends AutoUpdateConfigLoader { +public class CoreSkillsConfig extends ConfigurableLoader { private static CoreSkillsConfig instance; public CoreSkillsConfig() { - super("coreskills.yml"); + super(McmmoCore.getDataFolderPath().getAbsoluteFile(),"coreskills.yml"); validate(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/DefaultKeys.java b/core/src/main/java/com/gmail/nossr50/core/config/DefaultKeys.java new file mode 100644 index 000000000..cea996f50 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/config/DefaultKeys.java @@ -0,0 +1,10 @@ +package com.gmail.nossr50.core.config; + +import java.util.List; + +/** + * This is for config validation + */ +public interface DefaultKeys { + List validateKeys(); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/config/HiddenConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/HiddenConfig.java deleted file mode 100644 index 978097b72..000000000 --- a/core/src/main/java/com/gmail/nossr50/core/config/HiddenConfig.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.gmail.nossr50.core.config; - -import com.gmail.nossr50.mcMMO; -import org.bukkit.configuration.file.YamlConfiguration; - -import java.io.InputStreamReader; - -public class HiddenConfig { - private static HiddenConfig instance; - private String fileName; - private YamlConfiguration config; - private boolean chunkletsEnabled; - private int conversionRate; - private boolean useEnchantmentBuffs; - private int uuidConvertAmount; - private int mojangRateLimit; - private long mojangLimitPeriod; - - public HiddenConfig(String fileName) { - this.fileName = fileName; - load(); - } - - public static HiddenConfig getInstance() { - if (instance == null) { - instance = new HiddenConfig("hidden.yml"); - } - - return instance; - } - - public void load() { - InputStreamReader reader = mcMMO.p.getResourceAsReader(fileName); - if (reader != null) { - config = YamlConfiguration.loadConfiguration(reader); - chunkletsEnabled = config.getBoolean("Options.Chunklets", true); - conversionRate = config.getInt("Options.ConversionRate", 1); - useEnchantmentBuffs = config.getBoolean("Options.EnchantmentBuffs", true); - uuidConvertAmount = config.getInt("Options.UUIDConvertAmount", 5); - mojangRateLimit = config.getInt("Options.MojangRateLimit", 50000); - mojangLimitPeriod = config.getLong("Options.MojangLimitPeriod", 600000); - } - } - - public boolean getChunkletsEnabled() { - return chunkletsEnabled; - } - - public int getConversionRate() { - return conversionRate; - } - - public boolean useEnchantmentBuffs() { - return useEnchantmentBuffs; - } - - public int getUUIDConvertAmount() { - return uuidConvertAmount; - } - - public int getMojangRateLimit() { - return mojangRateLimit; - } - - public long getMojangLimitPeriod() { - return mojangLimitPeriod; - } -} diff --git a/core/src/main/java/com/gmail/nossr50/core/config/VersionedConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/VersionedConfig.java new file mode 100644 index 000000000..1cfa522d1 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/config/VersionedConfig.java @@ -0,0 +1,12 @@ +package com.gmail.nossr50.core.config; + +/** + * Represents a config that is version checked + */ +public interface VersionedConfig { + /** + * The version of this config + * @return + */ + double getConfigVersion(); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java index 4703ecb2e..accdbedbd 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java @@ -1,13 +1,9 @@ -package com.gmail.nossr50.config.skills.alchemy; +package com.gmail.nossr50.core.config.skills.alchemy; -import com.gmail.nossr50.config.ConfigLoader; -import com.gmail.nossr50.core.mcmmo.skills.alchemy.AlchemyPotion; -import com.gmail.nossr50.mcMMO; -import org.bukkit.ChatColor; -import org.bukkit.Color; -import org.bukkit.Material; +import com.gmail.nossr50.core.mcmmo.colors.ChatColor; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; +import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyPotion; import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.inventory.ItemStack; import java.util.ArrayList; import java.util.HashMap; diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManagerFactory.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManagerFactory.java index 7530ad13d..0084b558c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManagerFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManagerFactory.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.core.data.blockmeta; -import com.gmail.nossr50.core.config.HiddenConfig; +import com.gmail.nossr50.core.config.ChunkConversionOptions; public class ChunkletManagerFactory { public static ChunkletManager getChunkletManager() { - HiddenConfig hConfig = HiddenConfig.getInstance(); + ChunkConversionOptions hConfig = ChunkConversionOptions.getInstance(); if (hConfig.getChunkletsEnabled()) { return new HashChunkletManager(); diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManagerFactory.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManagerFactory.java index 624ec51dc..cd93972f1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManagerFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManagerFactory.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.core.data.blockmeta.chunkmeta; -import com.gmail.nossr50.core.config.HiddenConfig; +import com.gmail.nossr50.core.config.ChunkConversionOptions; public class ChunkManagerFactory { public static ChunkManager getChunkManager() { - HiddenConfig hConfig = HiddenConfig.getInstance(); + ChunkConversionOptions hConfig = ChunkConversionOptions.getInstance(); if (hConfig.getChunkletsEnabled()) { return new HashChunkManager(); diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java index 336356fd9..6938eb767 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.data.blockmeta.conversion; -import com.gmail.nossr50.core.config.HiddenConfig; +import com.gmail.nossr50.core.config.ChunkConversionOptions; import com.gmail.nossr50.mcMMO; import org.bukkit.scheduler.BukkitScheduler; @@ -19,7 +19,7 @@ public class BlockStoreConversionMain implements Runnable { this.world = world; this.scheduler = mcMMO.p.getServer().getScheduler(); this.dataDir = new File(this.world.getWorldFolder(), "mcmmo_data"); - this.converters = new BlockStoreConversionXDirectory[HiddenConfig.getInstance().getConversionRate()]; + this.converters = new BlockStoreConversionXDirectory[ChunkConversionOptions.getInstance().getConversionRate()]; } public void start() { @@ -52,7 +52,7 @@ public class BlockStoreConversionMain implements Runnable { this.xDirs = this.dataDir.listFiles(); - for (this.i = 0; (this.i < HiddenConfig.getInstance().getConversionRate()) && (this.i < this.xDirs.length); this.i++) { + for (this.i = 0; (this.i < ChunkConversionOptions.getInstance().getConversionRate()) && (this.i < this.xDirs.length); this.i++) { if (this.converters[this.i] == null) { this.converters[this.i] = new BlockStoreConversionXDirectory(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionXDirectory.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionXDirectory.java index baf10145d..af74f7d6b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionXDirectory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionXDirectory.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.data.blockmeta.conversion; -import com.gmail.nossr50.core.config.HiddenConfig; +import com.gmail.nossr50.core.config.ChunkConversionOptions; import com.gmail.nossr50.mcMMO; import org.bukkit.scheduler.BukkitScheduler; @@ -21,7 +21,7 @@ public class BlockStoreConversionXDirectory implements Runnable { public void start(org.bukkit.World world, File dataDir) { this.world = world; this.scheduler = mcMMO.p.getServer().getScheduler(); - this.converters = new BlockStoreConversionZDirectory[HiddenConfig.getInstance().getConversionRate()]; + this.converters = new BlockStoreConversionZDirectory[ChunkConversionOptions.getInstance().getConversionRate()]; this.dataDir = dataDir; if (this.taskID >= 0) { @@ -53,7 +53,7 @@ public class BlockStoreConversionXDirectory implements Runnable { this.zDirs = this.dataDir.listFiles(); - for (this.i = 0; (this.i < HiddenConfig.getInstance().getConversionRate()) && (this.i < this.zDirs.length); this.i++) { + for (this.i = 0; (this.i < ChunkConversionOptions.getInstance().getConversionRate()) && (this.i < this.zDirs.length); this.i++) { if (this.converters[this.i] == null) { this.converters[this.i] = new BlockStoreConversionZDirectory(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionZDirectory.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionZDirectory.java index af843c23d..5b3638655 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionZDirectory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionZDirectory.java @@ -1,21 +1,23 @@ package com.gmail.nossr50.core.data.blockmeta.conversion; +import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.data.blockmeta.ChunkletStore; import com.gmail.nossr50.core.data.blockmeta.HashChunkletManager; import com.gmail.nossr50.core.data.blockmeta.PrimitiveChunkletStore; import com.gmail.nossr50.core.data.blockmeta.PrimitiveExChunkletStore; import com.gmail.nossr50.core.data.blockmeta.chunkmeta.HashChunkManager; import com.gmail.nossr50.core.data.blockmeta.chunkmeta.PrimitiveChunkStore; -import com.gmail.nossr50.mcMMO; -import org.bukkit.scheduler.BukkitScheduler; +import com.gmail.nossr50.core.mcmmo.tasks.TaskScheduler; +import com.gmail.nossr50.core.mcmmo.world.World; import java.io.File; public class BlockStoreConversionZDirectory implements Runnable { public int taskID, cx, cz, x, y, z, y2, xPos, zPos, cxPos, czPos; private String cxs, czs, chunkletName, chunkName; - private org.bukkit.World world; - private BukkitScheduler scheduler; + private World world; + //private BukkitScheduler scheduler; + private TaskScheduler scheduler; private File xDir, dataDir; private HashChunkletManager manager; private HashChunkManager newManager; @@ -29,9 +31,9 @@ public class BlockStoreConversionZDirectory implements Runnable { this.taskID = -1; } - public void start(org.bukkit.World world, File xDir, File dataDir) { + public void start(World world, File xDir, File dataDir) { this.world = world; - this.scheduler = mcMMO.p.getServer().getScheduler(); + this.scheduler = McmmoCore.getTaskScheduler(); this.manager = new HashChunkletManager(); this.newManager = (HashChunkManager) mcMMO.getPlaceStore(); this.dataDir = dataDir; @@ -41,7 +43,8 @@ public class BlockStoreConversionZDirectory implements Runnable { return; } - this.taskID = this.scheduler.runTaskLater(mcMMO.p, this, 1).getTaskId(); + // Bukkit - this.taskID = this.scheduler.runTaskLater(mcMMO.p, this, 1).getTaskId(); + this.taskID = scheduler.scheduleTask(this, 1).getTaskId(); return; } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java index 69ac60e22..638f3729d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.core.data.database; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.core.mcmmo.database.DatabaseType; -import com.gmail.nossr50.core.mcmmo.database.PlayerStat; -import com.gmail.nossr50.core.mcmmo.player.PlayerProfile; -import com.gmail.nossr50.core.mcmmo.skills.PrimarySkillType; +import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.datatypes.database.DatabaseType; +import com.gmail.nossr50.core.datatypes.database.PlayerStat; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.skills.PrimarySkillType; import java.util.List; import java.util.Map; diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/BlockTypes.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/BlockTypes.java new file mode 100644 index 000000000..9ac7b8d73 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/BlockTypes.java @@ -0,0 +1,11 @@ +package com.gmail.nossr50.core.mcmmo; + +/** + * Custom Definitions for Block's Type + * Unlike Bukkit's Material system, this matches a block by its state information + * For example, an Oak Log in older versions of MC was simply a block with state information of being variant oak + * To account for all the differences between version we have our own custom constants that will match based on platform + */ +public enum BlockTypes { + +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/commands/CommandSender.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/commands/CommandSender.java new file mode 100644 index 000000000..afb31cd9e --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/commands/CommandSender.java @@ -0,0 +1,13 @@ +package com.gmail.nossr50.core.mcmmo.commands; + +/** + * Command senders are either Players or the CLI + */ +public interface CommandSender { + + /** + * Send a message to the CommandSender + * @param msg the message to send + */ + void sendMessage(String msg); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/PluginTask.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/PluginTask.java index 444f03d33..b8776e932 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/PluginTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/PluginTask.java @@ -20,4 +20,10 @@ public interface PluginTask { * Schedule this task (begins ASAP) */ void scheduleTask(); + + /** + * Get the ID of this task + * @return the id of this task + */ + int getTaskId(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/TaskScheduler.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/TaskScheduler.java new file mode 100644 index 000000000..14d4c7a1f --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/tasks/TaskScheduler.java @@ -0,0 +1,25 @@ +package com.gmail.nossr50.core.mcmmo.tasks; + +/** + * Schedules tasks for a platform + */ +public interface TaskScheduler { + /** + * Schedules the specified task + * @param pluginTask the task to schedule + */ + PluginTask scheduleTask(PluginTask pluginTask); + + /** + * Schedules the specified task + * @param runnable the runnable to schedule + */ + PluginTask scheduleTask(Runnable runnable); + + /** + * Schedules the specified task + * @param runnable the runnable to schedule + * @param tickDelay the delay for this task in ticks + */ + PluginTask scheduleTask(Runnable runnable, int tickDelay); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java b/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java index 3e3161b6f..19f65c3e4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java +++ b/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java @@ -1,11 +1,22 @@ package com.gmail.nossr50.core.platform; +import com.gmail.nossr50.core.mcmmo.server.Server; +import com.gmail.nossr50.core.mcmmo.tasks.TaskScheduler; + +import java.io.File; + /** * Represents the current API Platform * mcMMO supports multiple platforms, so that abstraction is handled through this interface */ public interface Platform { + /** + * Gets the MC Server implementation for this Platform + * @return the MC server object + */ + Server getServer(); + /** * Gets the name of the Platform * @@ -40,4 +51,24 @@ public interface Platform { * @return this PlatformSoftwareType */ PlatformSoftwareType getPlatformSoftwareType(); + + /** + * Gets the task Scheduler + * @return the task scheduler + */ + TaskScheduler getScheduler(); + + + /** + * Gets a resource stream from inside the JAR at a specified path + * @param path the path inside the JAR where the resource stream is found + * @return the resource stream + */ + java.io.InputStream getResource(String path); + + /** + * Gets the path of the Data folder for this platform + * @return this platform's data folder + */ + File getDataFolderPath(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/database/FormulaConversionTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/database/FormulaConversionTask.java index 0cc08b401..ca3ae64fe 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/database/FormulaConversionTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/database/FormulaConversionTask.java @@ -1,19 +1,18 @@ package com.gmail.nossr50.core.runnables.database; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.McmmoCore; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.data.database.DatabaseManager; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.commands.CommandSender; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Misc; -import org.bukkit.command.CommandSender; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.util.Misc; -public class FormulaConversionTask extends BukkitRunnable { +public class FormulaConversionTask implements Runnable { private CommandSender sender; private FormulaType formulaType; @@ -26,16 +25,16 @@ public class FormulaConversionTask extends BukkitRunnable { public void run() { int convertedUsers = 0; long startMillis = System.currentTimeMillis(); - for (String playerName : mcMMO.getDatabaseManager().getStoredUsers()) { + for (String playerName : McmmoCore.getDatabaseManager().getStoredUsers()) { McMMOPlayer mcMMOPlayer = UserManager.getOfflinePlayer(playerName); PlayerProfile profile; // If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process. if (mcMMOPlayer == null) { - profile = mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false); + profile = McmmoCore.getDatabaseManager().loadPlayerProfile(playerName, false); if (!profile.isLoaded()) { - mcMMO.p.debug("Profile not loaded."); + McmmoCore.getLogger().severe("Profile not loaded."); continue; } @@ -49,28 +48,28 @@ public class FormulaConversionTask extends BukkitRunnable { convertedUsers++; Misc.printProgress(convertedUsers, DatabaseManager.progressInterval, startMillis); } - mcMMO.getFormulaManager().setPreviousFormulaType(formulaType); + McmmoCore.getFormulaManager().setPreviousFormulaType(formulaType); sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Experience.Finish", formulaType.toString())); } private void editValues(PlayerProfile profile) { - mcMMO.p.debug("========================================================================"); - mcMMO.p.debug("Conversion report for " + profile.getPlayerName() + ":"); + McmmoCore.getLogger().info("========================================================================"); + McmmoCore.getLogger().info("Conversion report for " + profile.getPlayerName() + ":"); for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) { int oldLevel = profile.getSkillLevel(primarySkillType); int oldXPLevel = profile.getSkillXpLevel(primarySkillType); - int totalOldXP = mcMMO.getFormulaManager().calculateTotalExperience(oldLevel, oldXPLevel); + int totalOldXP = McmmoCore.getFormulaManager().calculateTotalExperience(oldLevel, oldXPLevel); if (totalOldXP == 0) { continue; } - int[] newExperienceValues = mcMMO.getFormulaManager().calculateNewLevel(primarySkillType, (int) Math.floor(totalOldXP / ExperienceConfig.getInstance().getExpModifier()), formulaType); + int[] newExperienceValues = McmmoCore.getFormulaManager().calculateNewLevel(primarySkillType, (int) Math.floor(totalOldXP / ExperienceConfig.getInstance().getExpModifier()), formulaType); int newLevel = newExperienceValues[0]; int newXPlevel = newExperienceValues[1]; - mcMMO.p.debug(" Skill: " + primarySkillType.toString()); + /*McmmoCore.getLogger().info(" Skill: " + primarySkillType.toString()); mcMMO.p.debug(" OLD:"); mcMMO.p.debug(" Level: " + oldLevel); @@ -80,7 +79,7 @@ public class FormulaConversionTask extends BukkitRunnable { mcMMO.p.debug(" NEW:"); mcMMO.p.debug(" Level " + newLevel); mcMMO.p.debug(" XP " + newXPlevel); - mcMMO.p.debug("------------------------------------------------------------------------"); + mcMMO.p.debug("------------------------------------------------------------------------");*/ profile.modifySkill(primarySkillType, newLevel); profile.setSkillXpLevel(primarySkillType, newXPlevel); diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/database/UUIDUpdateAsyncTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UUIDUpdateAsyncTask.java index 361f53aed..d0539fa3b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/database/UUIDUpdateAsyncTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UUIDUpdateAsyncTask.java @@ -1,12 +1,11 @@ package com.gmail.nossr50.core.runnables.database; -import com.gmail.nossr50.core.config.HiddenConfig; +import com.gmail.nossr50.core.McmmoCore; +import com.gmail.nossr50.core.config.ChunkConversionOptions; import com.gmail.nossr50.core.data.database.DatabaseManager; import com.gmail.nossr50.core.datatypes.database.UpgradeType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.uuid.UUIDFetcher; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.uuid.UUIDFetcher; import java.util.HashMap; import java.util.List; @@ -14,19 +13,17 @@ import java.util.Map; import java.util.UUID; import java.util.logging.Level; -public class UUIDUpdateAsyncTask extends BukkitRunnable { - private static final int MAX_LOOKUP = Math.max(HiddenConfig.getInstance().getUUIDConvertAmount(), 100); - private static final int RATE_LIMIT = HiddenConfig.getInstance().getMojangRateLimit(); - private static final long LIMIT_PERIOD = HiddenConfig.getInstance().getMojangLimitPeriod(); +public class UUIDUpdateAsyncTask implements Runnable { + private static final int MAX_LOOKUP = Math.max(ChunkConversionOptions.getUUIDConvertAmount(), 100); + private static final int RATE_LIMIT = ChunkConversionOptions.getMojangRateLimit(); + private static final long LIMIT_PERIOD = ChunkConversionOptions.getMojangLimitPeriod(); private static final int BATCH_SIZE = MAX_LOOKUP * 3; - private mcMMO plugin; private List userNames; private int size; private int checkedUsers; private long startMillis; - public UUIDUpdateAsyncTask(mcMMO plugin, List userNames) { - this.plugin = plugin; + public UUIDUpdateAsyncTask(List userNames) { this.userNames = userNames; this.checkedUsers = 0; @@ -37,7 +34,7 @@ public class UUIDUpdateAsyncTask extends BukkitRunnable { public void run() { size = userNames.size(); - plugin.getLogger().info("Starting to check and update UUIDs, total amount of users: " + size); + McmmoCore.getLogger().info("Starting to check and update UUIDs, total amount of users: " + size); List userNamesSection; Map fetchedUUIDs = new HashMap(); @@ -76,7 +73,7 @@ public class UUIDUpdateAsyncTask extends BukkitRunnable { continue; } - plugin.getLogger().log(Level.SEVERE, "Unable to fetch UUIDs!", e); + McmmoCore.getLogger().log(Level.SEVERE, "Unable to fetch UUIDs!", e); return; } @@ -86,14 +83,14 @@ public class UUIDUpdateAsyncTask extends BukkitRunnable { Misc.printProgress(checkedUsers, DatabaseManager.progressInterval, startMillis); if (fetchedUUIDs.size() >= BATCH_SIZE) { - mcMMO.getDatabaseManager().saveUserUUIDs(fetchedUUIDs); + McmmoCore.getDatabaseManager().saveUserUUIDs(fetchedUUIDs); fetchedUUIDs = new HashMap(); } } - if (fetchedUUIDs.size() == 0 || mcMMO.getDatabaseManager().saveUserUUIDs(fetchedUUIDs)) { - mcMMO.getUpgradeManager().setUpgradeCompleted(UpgradeType.ADD_UUIDS); - plugin.getLogger().info("UUID upgrade completed!"); + if (fetchedUUIDs.size() == 0 || McmmoCore.getDatabaseManager().saveUserUUIDs(fetchedUUIDs)) { + McmmoCore.getUpgradeManager().setUpgradeCompleted(UpgradeType.ADD_UUIDS); + McmmoCore.getLogger().info("UUID upgrade completed!"); } } } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java index 377082b10..51f402316 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java @@ -1,21 +1,20 @@ package com.gmail.nossr50.core.runnables.database; +import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.config.Config; -import com.gmail.nossr50.mcMMO; -import org.bukkit.scheduler.BukkitRunnable; import java.util.concurrent.locks.ReentrantLock; -public class UserPurgeTask extends BukkitRunnable { +public class UserPurgeTask implements Runnable { private ReentrantLock lock = new ReentrantLock(); @Override public void run() { lock.lock(); - mcMMO.getDatabaseManager().purgePowerlessUsers(); + McmmoCore.getDatabaseManager().purgePowerlessUsers(); if (Config.getInstance().getOldUsersCutoff() != -1) { - mcMMO.getDatabaseManager().purgeOldUsers(); + McmmoCore.getDatabaseManager().purgeOldUsers(); } lock.unlock(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java index 22594fb89..4c8e4c6f9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.core.util.skills; import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.config.Config; -import com.gmail.nossr50.core.config.HiddenConfig; +import com.gmail.nossr50.core.config.ChunkConversionOptions; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; @@ -128,7 +128,7 @@ public class SkillUtils { } public static void handleAbilitySpeedIncrease(Player player) { - if (HiddenConfig.getInstance().useEnchantmentBuffs()) { + if (ChunkConversionOptions.getInstance().useEnchantmentBuffs()) { ItemStack heldItem = player.getInventory().getItemInMainHand(); if (heldItem == null || heldItem.getType() == Material.AIR) { @@ -184,7 +184,7 @@ public class SkillUtils { } public static void handleAbilitySpeedDecrease(Player player) { - if (!HiddenConfig.getInstance().useEnchantmentBuffs()) { + if (!ChunkConversionOptions.getInstance().useEnchantmentBuffs()) { return; } From 9a65621f684792f94f902e1eea461bad0551337a Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 13 Feb 2019 22:43:34 -0800 Subject: [PATCH 19/28] new config system pt 2 --- .../main/java/com/gmail/nossr50/core/McmmoCore.java | 3 +++ .../gmail/nossr50/core/config/AdvancedConfig.java | 12 ++++++------ .../com/gmail/nossr50/core/skills/SubSkillType.java | 10 +++++----- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java b/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java index 56d16772c..0acce0851 100644 --- a/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java +++ b/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java @@ -18,6 +18,7 @@ public class McmmoCore { private static EventCommander eventCommander; private static Logger logger; private static Platform platform; + private static boolean retroModeEnabled; //Why do all these things need to be here? Sigh... private static DatabaseManager databaseManager; @@ -61,4 +62,6 @@ public class McmmoCore { public static UpgradeManager getUpgradeManager() { return upgradeManager; } public static FormulaManager getFormulaManager() { return formulaManager; } + + public static boolean isRetroModeEnabled() { return retroModeEnabled; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java index e1741c63a..43c3d46a5 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java @@ -436,7 +436,7 @@ public class AdvancedConfig extends ConfigurableLoader { * @return the level at which abilities stop increasing in length */ public int getAbilityLengthCap() { - if(!mcMMO.isRetroModeEnabled()) + if(!McmmoCore.isRetroModeEnabled()) return getIntValue(SKILLS, GENERAL, ABILITY, LENGTH, STANDARD, CAP_LEVEL); else return getIntValue(SKILLS, GENERAL, ABILITY, LENGTH, RETRO_MODE, CAP_LEVEL); @@ -448,7 +448,7 @@ public class AdvancedConfig extends ConfigurableLoader { * @return the number of levels required per ability length increase */ public int getAbilityLength() { - if(!mcMMO.isRetroModeEnabled()) + if(!McmmoCore.isRetroModeEnabled()) return getIntValue(SKILLS, GENERAL, ABILITY, LENGTH, STANDARD, INCREASE_LEVEL); else return getIntValue(SKILLS, GENERAL, ABILITY, LENGTH, RETRO_MODE, INCREASE_LEVEL); @@ -464,10 +464,10 @@ public class AdvancedConfig extends ConfigurableLoader { * @return the level at which this skills max benefits will be reached on the curve */ public int getMaxBonusLevel(SubSkillType subSkillType) { - if(!mcMMO.isRetroModeEnabled()) - - String[] keyPath = {subSkillType.getAdvConfigAddress(), MAX_BONUS_LEVEL}; - return mcMMO.isRetroModeEnabled() ? getIntValue(keyPath+ RETRO_MODE) : getIntValue(keyPath+ STANDARD); + if(!McmmoCore.isRetroModeEnabled()) + return getIntValue(subSkillType.getAdvConfigAddress(), MAX_BONUS_LEVEL, STANDARD); + else + return getIntValue(subSkillType.getAdvConfigAddress(), MAX_BONUS_LEVEL, RETRO_MODE); } public int getMaxBonusLevel(AbstractSubSkill abstractSubSkill) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillType.java b/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillType.java index e4c5b5da2..d9ee1f3a0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillType.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.StringUtils; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.StringUtils; public enum SubSkillType { /* !! Warning -- Do not let subskills share a name with any existing PrimarySkillType as it will clash with the static import !! */ @@ -136,8 +136,8 @@ public enum SubSkillType { * * @return the root address for this skill in advanced.yml */ - public String getAdvConfigAddress() { - return "Skills." + StringUtils.getCapitalized(getParentSkill().toString()) + "." + getConfigName(toString()); + public String[] getAdvConfigAddress() { + return new String[] {"Skills", StringUtils.getCapitalized(getParentSkill().toString()), getConfigName(toString())}; } /** @@ -146,7 +146,7 @@ public enum SubSkillType { * @return the root address for this skill in rankskills.yml */ public String getRankConfigAddress() { - return StringUtils.getCapitalized(getParentSkill().toString()) + "." + getConfigName(toString()); + //return StringUtils.getCapitalized(getParentSkill().toString()) + "." + getConfigName(toString()); } /** From df101e54b1b2616e5b231951ac97d5bd75f4d0a2 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 14 Feb 2019 13:07:12 -0800 Subject: [PATCH 20/28] new config system pt 3 --- .../nossr50/core/config/AdvancedConfig.java | 330 +++++++++++------- .../nossr50/core/skills/SubSkillType.java | 4 +- 2 files changed, 198 insertions(+), 136 deletions(-) diff --git a/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java index 43c3d46a5..b446e3ef8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java @@ -12,6 +12,7 @@ import java.util.List; @ConfigSerializable public class AdvancedConfig extends ConfigurableLoader { + public static final String SKILLS = "Skills"; public static final String GENERAL = "General"; public static final String ABILITY = "Ability"; @@ -22,7 +23,8 @@ public class AdvancedConfig extends ConfigurableLoader { public static final String DODGE = "Dodge"; public static final String CHANCE = "Chance"; public static final String CHANCE_MAX = CHANCE + "Max"; - public static final String MAX_BONUS_LEVEL = "MaxBonusLevel"; + public static final String BONUS = "Bonus"; + public static final String MAX_BONUS_LEVEL = "Max" + BONUS + "Level"; public static final String MODIFIER = "Modifier"; public static final String DAMAGE_MODIFIER = "Damage" + MODIFIER; public static final String DAMAGE_THRESHOLD = "DamageThreshold"; @@ -32,9 +34,10 @@ public class AdvancedConfig extends ConfigurableLoader { public static final String MAX_SPEED = "MaxSpeed"; public static final String ARCHERY = "Archery"; public static final String SKILL_SHOT = "SkillShot"; - public static final String RANK_DAMAGE_MULTIPLIER = "RankDamageMultiplier"; - public static final String BONUS_DAMAGE = "BonusDamage"; - public static final String FORCE_MULTIPLIER = "ForceMultiplier"; + public static final String MULTIPLIER = "Multiplier"; + public static final String RANK_DAMAGE_MULTIPLIER = "RankDamage" + MULTIPLIER; + public static final String BONUS_DAMAGE = BONUS + "Damage"; + public static final String FORCE_MULTIPLIER = "Force" + MULTIPLIER; public static final String AXES = "Axes"; public static final String STANDARD = "Standard"; public static final String RETRO_MODE = "RetroMode"; @@ -46,7 +49,8 @@ public class AdvancedConfig extends ConfigurableLoader { public static final String MASTER_ANGLER = "MasterAngler"; public static final String BOAT_MODIFIER = "Boat" + MODIFIER; public static final String BIOME_MODIFIER = "Biome" + MODIFIER; - public static final String VANILLA_XPMULTIPLIER = "VanillaXPMultiplier"; + public static final String XP = "XP"; + public static final String VANILLA_XPMULTIPLIER = "Vanilla" + XP + MULTIPLIER; public static final String RANK = "Rank_"; public static final String TAMING = "Taming"; public static final String CALL_OF_THE_WILD = "CallOfTheWild"; @@ -55,6 +59,71 @@ public class AdvancedConfig extends ConfigurableLoader { public static final String SHOCK_PROOF = "ShockProof"; public static final String UNARMED = "Unarmed"; public static final String STARTING_LEVEL = "StartingLevel"; + public static final String AXE_MASTERY = "AxeMastery"; + public static final String CRITICAL_STRIKES = "CriticalStrikes"; + public static final String GREATER_IMPACT = "GreaterImpact"; + public static final String ARMOR_IMPACT = "ArmorImpact"; + public static final String SKULL_SPLITTER = "SkullSplitter."; + public static final String MAX_PERCENTAGE_DURABILITY_DAMAGE = "MaxPercentageDurabilityDamage"; + public static final String SHAKE = "Shake"; + public static final String MINING = "Mining"; + public static final String BLAST_MINING = "BlastMining"; + public static final String LEVELS = "Levels"; + public static final String BLAST_DAMAGE_DECREASE = "BlastDamageDecrease"; + public static final String ORE_BONUS = "Ore" + BONUS; + public static final String DEBRIS_REDUCTION = "DebrisReduction"; + public static final String DROP_MULTIPLIER = "Drop" + MULTIPLIER; + public static final String BLAST_RADIUS = "BlastRadius"; + public static final String REPAIR = "Repair"; + public static final String REPAIR_MASTERY = "RepairMastery"; + public static final String MAX_BONUS_PERCENTAGE = "Max" + BONUS + "Percentage"; + public static final String ARCANE_FORGING = "ArcaneForging"; + public static final String MAY_LOSE_ENCHANTS = "May_Lose_Enchants"; + public static final String KEEP_ENCHANTS = "Keep_Enchants_"; + public static final String DOWNGRADES = "Downgrades_"; + public static final String ENABLED = "Enabled"; + public static final String DOWNGRADES_ENABLED = DOWNGRADES + ENABLED; + public static final String SALVAGE = "Salvage"; + public static final String ARCANE_SALVAGE = "ArcaneSalvage"; + public static final String ENCHANT_DOWNGRADE_ENABLED = "EnchantDowngrade" + ENABLED; + public static final String ENCHANT_LOSS_ENABLED = "EnchantLoss" + ENABLED; + public static final String EXTRACT_FULL_ENCHANT = "ExtractFullEnchant"; + public static final String EXTRACT_PARTIAL_ENCHANT = "ExtractPartialEnchant"; + public static final String SMELTING = "Smelting"; + public static final String FUEL_EFFICIENCY = "FuelEfficiency"; + public static final String FLUX = "Flux"; + public static final String SWORDS = "Swords"; + public static final String RUPTURE = "Rupture"; + public static final String DAMAGE_PLAYER = "DamagePlayer"; + public static final String DAMAGE_MOBS = "DamageMobs"; + public static final String MAX_TICKS = "MaxTicks"; + public static final String BASE_TICKS = "BaseTicks"; + public static final String COUNTER_ATTACK = "CounterAttack"; + public static final String SERRATED_STRIKES = "SerratedStrikes"; + public static final String TICKS = "Ticks"; + public static final String GORE = "Gore"; + public static final String FAST_FOOD = "FastFood"; + public static final String FAST_FOOD_SERVICE = FAST_FOOD + "Service"; + public static final String PUMMEL = "Pummel"; + public static final String THICK_FUR = "ThickFur"; + public static final String SHARPENED_CLAWS = "SharpenedClaws"; + public static final String DISARM = "Disarm"; + public static final String ANTI_THEFT = "AntiTheft"; + public static final String DAZE = "Daze"; + public static final String MAX_DAMAGE = "MaxDamage"; + public static final String ROLL = "Roll"; + public static final String GRACEFUL_ROLL = "Graceful" + ROLL; + public static final String ARROW_DEFLECT = "ArrowDeflect"; + public static final String IRON_GRIP = "IronGrip"; + public static final String WOODCUTTING = "Woodcutting"; + public static final String HARVEST_LUMBER = "HarvestLumber"; + public static final String FEEDBACK = "Feedback"; + public static final String SKILL_COMMAND = "SkillCommand"; + public static final String BLANK_LINES_ABOVE_HEADER = "BlankLinesAboveHeader"; + public static final String ACTION_BAR_NOTIFICATIONS = "ActionBarNotifications"; + public static final String SEND_COPY_OF_MESSAGE_TO_CHAT = "SendCopyOfMessageToChat"; + public static final String EVENTS = "Events"; + public static final String SEND_TITLES = "SendTitles"; private static AdvancedConfig instance; private AdvancedConfig() { @@ -107,19 +176,19 @@ public class AdvancedConfig extends ConfigurableLoader { } if (getMaximumProbability(SubSkillType.ACROBATICS_ROLL) < 1) { - reason.add(SKILLS + "." + ACROBATICS + ".Roll." + CHANCE_MAX + " should be at least 1!"); + reason.add(SKILLS + "." + ACROBATICS + "." + ROLL + "." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.ACROBATICS_ROLL) < 1) { - reason.add(SKILLS + "." + ACROBATICS + ".Roll." + MAX_BONUS_LEVEL + " should be at least 1!"); + reason.add(SKILLS + "." + ACROBATICS + "." + ROLL + "." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getRollDamageThreshold() < 0) { - reason.add(SKILLS + "." + ACROBATICS + ".Roll." + DAMAGE_THRESHOLD + " should be at least 0!"); + reason.add(SKILLS + "." + ACROBATICS + "." + ROLL + "." + DAMAGE_THRESHOLD + " should be at least 0!"); } if (getGracefulRollDamageThreshold() < 0) { - reason.add(SKILLS + "." + ACROBATICS + ".GracefulRoll." + DAMAGE_THRESHOLD + " should be at least 0!"); + reason.add(SKILLS + "." + ACROBATICS + "." + GRACEFUL_ROLL + "." + DAMAGE_THRESHOLD + " should be at least 0!"); } if (getCatalysisMinSpeed() <= 0) { @@ -137,15 +206,15 @@ public class AdvancedConfig extends ConfigurableLoader { } if (getMaximumProbability(SubSkillType.ARCHERY_DAZE) < 1) { - reason.add(SKILLS + "." + ARCHERY + ".Daze." + CHANCE_MAX + " should be at least 1!"); + reason.add(SKILLS + "." + ARCHERY + "." + DAZE + "." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.ARCHERY_DAZE) < 1) { - reason.add(SKILLS + "." + ARCHERY + ".Daze." + MAX_BONUS_LEVEL + " should be at least 1!"); + reason.add(SKILLS + "." + ARCHERY + "." + DAZE + "." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getDazeBonusDamage() < 0) { - reason.add(SKILLS + "." + ARCHERY + ".Daze." + BONUS_DAMAGE + " should be at least 0!"); + reason.add(SKILLS + "." + ARCHERY + "." + DAZE + "." + BONUS_DAMAGE + " should be at least 0!"); } if (getMaximumProbability(SubSkillType.ARCHERY_ARROW_RETRIEVAL) < 1) { @@ -163,7 +232,7 @@ public class AdvancedConfig extends ConfigurableLoader { /* AXES */ if(getAxeMasteryRankDamageMultiplier() < 0) { - reason.add(SKILLS + "." + AXES + ".AxeMastery." + RANK_DAMAGE_MULTIPLIER + " should be at least 0!"); + reason.add(SKILLS + "." + AXES + "." + AXE_MASTERY + "." + RANK_DAMAGE_MULTIPLIER + " should be at least 0!"); } if (getMaximumProbability(SubSkillType.AXES_CRITICAL_STRIKES) < 1) { @@ -175,39 +244,39 @@ public class AdvancedConfig extends ConfigurableLoader { } if (getCriticalStrikesPVPModifier() < 1) { - reason.add(SKILLS + "." + AXES + ".CriticalStrikes." + PVP_MODIFIER + " should be at least 1!"); + reason.add(SKILLS + "." + AXES + "." + CRITICAL_STRIKES + "." + PVP_MODIFIER + " should be at least 1!"); } if (getCriticalStrikesPVPModifier() < 1) { - reason.add(SKILLS + "." + AXES + ".CriticalStrikes." + PVE_MODIFIER + " should be at least 1!"); + reason.add(SKILLS + "." + AXES + "." + CRITICAL_STRIKES + "." + PVE_MODIFIER + " should be at least 1!"); } if (getGreaterImpactChance() < 1) { - reason.add(SKILLS + "." + AXES + ".GreaterImpact." + CHANCE + " should be at least 1!"); + reason.add(SKILLS + "." + AXES + "." + GREATER_IMPACT + "." + CHANCE + " should be at least 1!"); } if (getGreaterImpactModifier() < 1) { - reason.add(SKILLS + "." + AXES + ".GreaterImpact." + KNOCKBACK_MODIFIER + " should be at least 1!"); + reason.add(SKILLS + "." + AXES + "." + GREATER_IMPACT + "." + KNOCKBACK_MODIFIER + " should be at least 1!"); } if (getGreaterImpactBonusDamage() < 1) { - reason.add(SKILLS + "." + AXES + ".GreaterImpact." + BONUS_DAMAGE + " should be at least 1!"); + reason.add(SKILLS + "." + AXES + "." + GREATER_IMPACT + "." + BONUS_DAMAGE + " should be at least 1!"); } if (getArmorImpactIncreaseLevel() < 1) { - reason.add(SKILLS + "." + AXES + ".ArmorImpact." + INCREASE_LEVEL + " should be at least 1!"); + reason.add(SKILLS + "." + AXES + "." + ARMOR_IMPACT + "." + INCREASE_LEVEL + " should be at least 1!"); } if (getImpactChance() < 1) { - reason.add(SKILLS + "." + AXES + ".ArmorImpact." + CHANCE + " should be at least 1!"); + reason.add(SKILLS + "." + AXES + "." + ARMOR_IMPACT + "." + CHANCE + " should be at least 1!"); } if (getArmorImpactMaxDurabilityDamage() < 1) { - reason.add(SKILLS + "." + AXES + ".ArmorImpact.MaxPercentageDurabilityDamage should be at least 1!"); + reason.add(SKILLS + "." + AXES + "." + ARMOR_IMPACT + "." + MAX_PERCENTAGE_DURABILITY_DAMAGE + " should be at least 1!"); } if (getSkullSplitterModifier() < 1) { - reason.add(SKILLS + "." + AXES + ".SkullSplitter." + DAMAGE_MODIFIER + " should be at least 1!"); + reason.add(SKILLS + "." + AXES + "." + SKULL_SPLITTER + DAMAGE_MODIFIER + " should be at least 1!"); } /*if (getFishermanDietRankChange() < 1) { @@ -265,112 +334,112 @@ public class AdvancedConfig extends ConfigurableLoader { /* MINING */ if (getMaximumProbability(SubSkillType.MINING_DOUBLE_DROPS) < 1) { - reason.add(SKILLS + ".Mining.DoubleDrops." + CHANCE_MAX + " should be at least 1!"); + reason.add(SKILLS + "." + MINING + ".DoubleDrops." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.MINING_DOUBLE_DROPS) < 1) { - reason.add(SKILLS + ".Mining.DoubleDrops." + MAX_BONUS_LEVEL + " should be at least 1!"); + reason.add(SKILLS + "." + MINING + ".DoubleDrops." + MAX_BONUS_LEVEL + " should be at least 1!"); } /* REPAIR */ if (getRepairMasteryMaxBonus() < 1) { - reason.add(SKILLS + ".Repair.RepairMastery.MaxBonusPercentage should be at least 1!"); + reason.add(SKILLS + "." + REPAIR + "." + REPAIR_MASTERY + "." + MAX_BONUS_PERCENTAGE + " should be at least 1!"); } if (getRepairMasteryMaxLevel() < 1) { - reason.add(SKILLS + ".Repair.RepairMastery." + MAX_BONUS_LEVEL + " should be at least 1!"); + reason.add(SKILLS + "." + REPAIR + "." + REPAIR_MASTERY + "." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getMaximumProbability(SubSkillType.REPAIR_SUPER_REPAIR) < 1) { - reason.add(SKILLS + ".Repair.SuperRepair." + CHANCE_MAX + " should be at least 1!"); + reason.add(SKILLS + "." + REPAIR + ".SuperRepair." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.REPAIR_SUPER_REPAIR) < 1) { - reason.add(SKILLS + ".Repair.SuperRepair." + MAX_BONUS_LEVEL + " should be at least 1!"); + reason.add(SKILLS + "." + REPAIR + ".SuperRepair." + MAX_BONUS_LEVEL + " should be at least 1!"); } /* SMELTING */ if (getBurnModifierMaxLevel() < 1) { - reason.add(SKILLS + ".Smelting.FuelEfficiency." + MAX_BONUS_LEVEL + " should be at least 1!"); + reason.add(SKILLS + "." + SMELTING + "." + FUEL_EFFICIENCY + "." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getBurnTimeMultiplier() < 1) { - reason.add(SKILLS + ".Smelting.FuelEfficiency.Multiplier should be at least 1!"); + reason.add(SKILLS + "." + SMELTING + "." + FUEL_EFFICIENCY + "." + MULTIPLIER + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.SMELTING_SECOND_SMELT) < 1) { - reason.add(SKILLS + ".Smelting.SecondSmelt." + MAX_BONUS_LEVEL + " should be at least 1!"); + reason.add(SKILLS + "." + SMELTING + ".SecondSmelt." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getMaximumProbability(SubSkillType.SMELTING_SECOND_SMELT) < 1) { - reason.add(SKILLS + ".Smelting.SecondSmelt." + CHANCE_MAX + " should be at least 1!"); + reason.add(SKILLS + "." + SMELTING + ".SecondSmelt." + CHANCE_MAX + " should be at least 1!"); } if (getFluxMiningChance() < 1) { - reason.add(SKILLS + ".Smelting.FluxMining." + CHANCE + " should be at least 1!"); + reason.add(SKILLS + "." + SMELTING + "." + FLUX + MINING + "." + CHANCE + " should be at least 1!"); } /* SWORDS */ if (getMaximumProbability(SubSkillType.SWORDS_RUPTURE) < 1) { - reason.add(SKILLS + ".Swords.Rupture." + CHANCE_MAX + " should be at least 1!"); + reason.add(SKILLS + "." + SWORDS + "." + RUPTURE + "." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.SWORDS_RUPTURE) < 1) { - reason.add(SKILLS + ".Swords.Rupture." + MAX_BONUS_LEVEL + " should be at least 1!"); + reason.add(SKILLS + "." + SWORDS + "." + RUPTURE + "." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getRuptureMaxTicks() < 1) { - reason.add(SKILLS + ".Swords.Rupture.MaxTicks should be at least 1!"); + reason.add(SKILLS + "." + SWORDS + "." + RUPTURE + "." + MAX_TICKS + " should be at least 1!"); } if (getRuptureMaxTicks() < getRuptureBaseTicks()) { - reason.add(SKILLS + ".Swords.Rupture.MaxTicks should be at least Skills.Swords.Rupture.BaseTicks!"); + reason.add(SKILLS + "." + SWORDS + "." + RUPTURE + "." + MAX_TICKS + " should be at least Skills.Swords.Rupture." + BASE_TICKS + "!"); } if (getRuptureBaseTicks() < 1) { - reason.add(SKILLS + ".Swords.Rupture.BaseTicks should be at least 1!"); + reason.add(SKILLS + "." + SWORDS + "." + RUPTURE + "." + BASE_TICKS + " should be at least 1!"); } if (getMaximumProbability(SubSkillType.SWORDS_COUNTER_ATTACK) < 1) { - reason.add(SKILLS + ".Swords.CounterAttack." + CHANCE_MAX + " should be at least 1!"); + reason.add(SKILLS + "." + SWORDS + "." + COUNTER_ATTACK + "." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.SWORDS_COUNTER_ATTACK) < 1) { - reason.add(SKILLS + ".Swords.CounterAttack." + MAX_BONUS_LEVEL + " should be at least 1!"); + reason.add(SKILLS + "." + SWORDS + "." + COUNTER_ATTACK + "." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getCounterModifier() < 1) { - reason.add(SKILLS + ".Swords.CounterAttack." + DAMAGE_MODIFIER + " should be at least 1!"); + reason.add(SKILLS + "." + SWORDS + "." + COUNTER_ATTACK + "." + DAMAGE_MODIFIER + " should be at least 1!"); } if (getSerratedStrikesModifier() < 1) { - reason.add(SKILLS + ".Swords.SerratedStrikes." + DAMAGE_MODIFIER + " should be at least 1!"); + reason.add(SKILLS + "." + SWORDS + "." + SERRATED_STRIKES + "." + DAMAGE_MODIFIER + " should be at least 1!"); } if (getSerratedStrikesTicks() < 1) { - reason.add(SKILLS + ".Swords.SerratedStrikes.RuptureTicks should be at least 1!"); + reason.add(SKILLS + "." + SWORDS + "." + SERRATED_STRIKES + "." + RUPTURE + "Ticks should be at least 1!"); } /* TAMING */ if (getMaximumProbability(SubSkillType.TAMING_GORE) < 1) { - reason.add(SKILLS + "." + TAMING + ".Gore." + CHANCE_MAX + " should be at least 1!"); + reason.add(SKILLS + "." + TAMING + "." + GORE + "." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.TAMING_GORE) < 1) { - reason.add(SKILLS + "." + TAMING + ".Gore." + MAX_BONUS_LEVEL + " should be at least 1!"); + reason.add(SKILLS + "." + TAMING + "." + GORE + "." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getGoreModifier() < 1) { - reason.add(SKILLS + "." + TAMING + ".Gore." + MODIFIER + " should be at least 1!"); + reason.add(SKILLS + "." + TAMING + "." + GORE + "." + MODIFIER + " should be at least 1!"); } if (getFastFoodChance() < 1) { - reason.add(SKILLS + "." + TAMING + ".FastFood." + CHANCE + " should be at least 1!"); + reason.add(SKILLS + "." + TAMING + "." + FAST_FOOD + "." + CHANCE + " should be at least 1!"); } if (getThickFurModifier() < 1) { - reason.add(SKILLS + "." + TAMING + ".ThickFur." + MODIFIER + " should be at least 1!"); + reason.add(SKILLS + "." + TAMING + "." + THICK_FUR + "." + MODIFIER + " should be at least 1!"); } if (getShockProofModifier() < 1) { @@ -378,7 +447,7 @@ public class AdvancedConfig extends ConfigurableLoader { } if (getSharpenedClawsBonus() < 1) { - reason.add(SKILLS + "." + TAMING + ".SharpenedClaws.Bonus should be at least 1!"); + reason.add(SKILLS + "." + TAMING + "." + SHARPENED_CLAWS + "." + BONUS + " should be at least 1!"); } if (getMaxHorseJumpStrength() < 0 || getMaxHorseJumpStrength() > 2) { @@ -387,27 +456,27 @@ public class AdvancedConfig extends ConfigurableLoader { /* UNARMED */ if (getMaximumProbability(SubSkillType.UNARMED_DISARM) < 1) { - reason.add(SKILLS + "." + UNARMED + ".Disarm." + CHANCE_MAX + " should be at least 1!"); + reason.add(SKILLS + "." + UNARMED + "." + DISARM + "." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.UNARMED_DISARM) < 1) { - reason.add(SKILLS + "." + UNARMED + ".Disarm." + MAX_BONUS_LEVEL + " should be at least 1!"); + reason.add(SKILLS + "." + UNARMED + "." + DISARM + "." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getMaximumProbability(SubSkillType.UNARMED_ARROW_DEFLECT) < 1) { - reason.add(SKILLS + "." + UNARMED + ".ArrowDeflect." + CHANCE_MAX + " should be at least 1!"); + reason.add(SKILLS + "." + UNARMED + "." + ARROW_DEFLECT + "." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.UNARMED_ARROW_DEFLECT) < 1) { - reason.add(SKILLS + "." + UNARMED + ".ArrowDeflect." + MAX_BONUS_LEVEL + " should be at least 1!"); + reason.add(SKILLS + "." + UNARMED + "." + ARROW_DEFLECT + "." + MAX_BONUS_LEVEL + " should be at least 1!"); } if (getMaximumProbability(SubSkillType.UNARMED_IRON_GRIP) < 1) { - reason.add(SKILLS + "." + UNARMED + ".IronGrip." + CHANCE_MAX + " should be at least 1!"); + reason.add(SKILLS + "." + UNARMED + "." + IRON_GRIP + "." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.UNARMED_IRON_GRIP) < 1) { - reason.add(SKILLS + "." + UNARMED + ".IronGrip." + MAX_BONUS_LEVEL + " should be at least 1!"); + reason.add(SKILLS + "." + UNARMED + "." + IRON_GRIP + "." + MAX_BONUS_LEVEL + " should be at least 1!"); } /* WOODCUTTING */ @@ -417,11 +486,11 @@ public class AdvancedConfig extends ConfigurableLoader { }*/ if (getMaximumProbability(SubSkillType.WOODCUTTING_HARVEST_LUMBER) < 1) { - reason.add(SKILLS + ".Woodcutting.HarvestLumber." + CHANCE_MAX + " should be at least 1!"); + reason.add(SKILLS + "." + WOODCUTTING + "." + HARVEST_LUMBER + "." + CHANCE_MAX + " should be at least 1!"); } if (getMaxBonusLevel(SubSkillType.WOODCUTTING_HARVEST_LUMBER) < 1) { - reason.add(SKILLS + ".Woodcutting.HarvestLumber." + MAX_BONUS_LEVEL + " should be at least 1!"); + reason.add(SKILLS + "." + WOODCUTTING + "." + HARVEST_LUMBER + "." + MAX_BONUS_LEVEL + " should be at least 1!"); } return reason; @@ -464,10 +533,12 @@ public class AdvancedConfig extends ConfigurableLoader { * @return the level at which this skills max benefits will be reached on the curve */ public int getMaxBonusLevel(SubSkillType subSkillType) { + String[] category = subSkillType.getAdvConfigAddress(); + if(!McmmoCore.isRetroModeEnabled()) - return getIntValue(subSkillType.getAdvConfigAddress(), MAX_BONUS_LEVEL, STANDARD); + return getIntValue(category[0], category[1], category[2], MAX_BONUS_LEVEL, STANDARD); else - return getIntValue(subSkillType.getAdvConfigAddress(), MAX_BONUS_LEVEL, RETRO_MODE); + return getIntValue(category[0], category[1], category[2], MAX_BONUS_LEVEL, RETRO_MODE); } public int getMaxBonusLevel(AbstractSubSkill abstractSubSkill) { @@ -475,7 +546,9 @@ public class AdvancedConfig extends ConfigurableLoader { } public double getMaximumProbability(SubSkillType subSkillType) { - double maximumProbability = getDoubleValue(subSkillType.getAdvConfigAddress(), CHANCE_MAX); + String[] category = subSkillType.getAdvConfigAddress(); + + double maximumProbability = getDoubleValue(category[0], category[1], category[2], CHANCE_MAX); return maximumProbability; } @@ -489,22 +562,22 @@ public class AdvancedConfig extends ConfigurableLoader { public boolean doesSkillCommandSendBlankLines() { - return getBooleanValue("Feedback.SkillCommand.BlankLinesAboveHeader"); + return getBooleanValue(FEEDBACK, SKILL_COMMAND, BLANK_LINES_ABOVE_HEADER); } public boolean doesNotificationUseActionBar(NotificationType notificationType) { - return getBooleanValue("Feedback.ActionBarNotifications."+notificationType.toString()+".Enabled"); + return getBooleanValue(FEEDBACK, ACTION_BAR_NOTIFICATIONS, notificationType.toString(), ENABLED); } public boolean doesNotificationSendCopyToChat(NotificationType notificationType) { - return getBooleanValue("Feedback.ActionBarNotifications."+notificationType.toString()+".SendCopyOfMessageToChat"); + return getBooleanValue(FEEDBACK, ACTION_BAR_NOTIFICATIONS, notificationType.toString(), SEND_COPY_OF_MESSAGE_TO_CHAT); } public boolean useTitlesForXPEvent() { - return getBooleanValue("Feedback.Events.XP.SendTitles"); + return getBooleanValue(FEEDBACK, EVENTS, XP, SEND_TITLES); } private ChatColor getChatColorFromKey(String keyLocation) { @@ -515,7 +588,7 @@ public class AdvancedConfig extends ConfigurableLoader { private ChatColor getChatColor(String configColor) { for (ChatColor chatColor : ChatColor.values()) { - if (configColor.equalsIgnoreCase(chatColor.getName())) + if (configColor.equalsIgnoreCase(chatColor.toString())) return chatColor; } @@ -524,22 +597,12 @@ public class AdvancedConfig extends ConfigurableLoader { return ChatColor.WHITE; } - /** - * Some SubSkills have the ability to retain classic functionality - * @param subSkillType SubSkillType with classic functionality - * @return true if the subskill is in classic mode - */ - public boolean isSubSkillClassic(SubSkillType subSkillType) - { - return getBooleanValue(subSkillType.getAdvConfigAddress()+".Classic"); - } - /* ACROBATICS */ public double getDodgeDamageModifier() { return getDoubleValue(SKILLS, ACROBATICS, DODGE, DAMAGE_MODIFIER); } - public double getRollDamageThreshold() { return getDoubleValue(SKILLS, ACROBATICS + ".Roll." + DAMAGE_THRESHOLD); } + public double getRollDamageThreshold() { return getDoubleValue(SKILLS, ACROBATICS, ROLL, DAMAGE_THRESHOLD); } - public double getGracefulRollDamageThreshold() { return getDoubleValue(SKILLS, ACROBATICS + ".GracefulRoll." + DAMAGE_THRESHOLD); } + public double getGracefulRollDamageThreshold() { return getDoubleValue(SKILLS, ACROBATICS, GRACEFUL_ROLL, DAMAGE_THRESHOLD); } /* ALCHEMY */ public int getCatalysisMaxBonusLevel() { return getIntValue(SKILLS, ALCHEMY, CATALYSIS, MAX_BONUS_LEVEL); } @@ -549,114 +612,113 @@ public class AdvancedConfig extends ConfigurableLoader { /* ARCHERY */ public double getSkillShotRankDamageMultiplier() { return getDoubleValue(SKILLS, ARCHERY, SKILL_SHOT, RANK_DAMAGE_MULTIPLIER); } - public double getSkillShotDamageMax() { return getDoubleValue(SKILLS, ARCHERY, SKILL_SHOT + ".MaxDamage"); } + public double getSkillShotDamageMax() { return getDoubleValue(SKILLS, ARCHERY, SKILL_SHOT, MAX_DAMAGE); } - public double getDazeBonusDamage() { return getDoubleValue(SKILLS, ARCHERY + ".Daze." + BONUS_DAMAGE); } + public double getDazeBonusDamage() { return getDoubleValue(SKILLS, ARCHERY, DAZE, BONUS_DAMAGE); } public double getForceMultiplier() { return getDoubleValue(SKILLS, ARCHERY, FORCE_MULTIPLIER); } /* AXES */ - public double getAxeMasteryRankDamageMultiplier() { return getDoubleValue(SKILLS, AXES + ".AxeMastery." + RANK_DAMAGE_MULTIPLIER); } + public double getAxeMasteryRankDamageMultiplier() { return getDoubleValue(SKILLS, AXES, AXE_MASTERY, RANK_DAMAGE_MULTIPLIER); } - public double getCriticalStrikesPVPModifier() { return getDoubleValue(SKILLS, AXES + ".CriticalStrikes." + PVP_MODIFIER); } - public double getCriticalStrikesPVEModifier() { return getDoubleValue(SKILLS, AXES + ".CriticalStrikes." + PVE_MODIFIER); } + public double getCriticalStrikesPVPModifier() { return getDoubleValue(SKILLS, AXES, CRITICAL_STRIKES, PVP_MODIFIER); } + public double getCriticalStrikesPVEModifier() { return getDoubleValue(SKILLS, AXES, CRITICAL_STRIKES, PVE_MODIFIER); } - public double getGreaterImpactChance() { return getDoubleValue(SKILLS, AXES + ".GreaterImpact." + CHANCE); } - public double getGreaterImpactModifier() { return getDoubleValue(SKILLS, AXES + ".GreaterImpact." + KNOCKBACK_MODIFIER); } - public double getGreaterImpactBonusDamage() { return getDoubleValue(SKILLS, AXES + ".GreaterImpact." + BONUS_DAMAGE); } + public double getGreaterImpactChance() { return getDoubleValue(SKILLS, AXES, GREATER_IMPACT, CHANCE); } + public double getGreaterImpactModifier() { return getDoubleValue(SKILLS, AXES, GREATER_IMPACT, KNOCKBACK_MODIFIER); } + public double getGreaterImpactBonusDamage() { return getDoubleValue(SKILLS, AXES, GREATER_IMPACT, BONUS_DAMAGE); } public int getArmorImpactIncreaseLevel() { - int increaseLevel = getIntValue(SKILLS, AXES + ".ArmorImpact." + INCREASE_LEVEL); + int increaseLevel = getIntValue(SKILLS, AXES, ARMOR_IMPACT, INCREASE_LEVEL); - if(mcMMO.isRetroModeEnabled()) + if(McmmoCore.isRetroModeEnabled()) return increaseLevel * 10; return increaseLevel; } - public double getImpactChance() { return getDoubleValue(SKILLS, AXES + ".ArmorImpact." + CHANCE); } - public double getArmorImpactMaxDurabilityDamage() { return getDoubleValue(SKILLS, AXES + ".ArmorImpact.MaxPercentageDurabilityDamage"); } + public double getImpactChance() { return getDoubleValue(SKILLS, AXES, ARMOR_IMPACT, CHANCE); } + public double getArmorImpactMaxDurabilityDamage() { return getDoubleValue(SKILLS, AXES, ARMOR_IMPACT, MAX_PERCENTAGE_DURABILITY_DAMAGE); } - public double getSkullSplitterModifier() { return getDoubleValue(SKILLS, AXES + ".SkullSplitter." + DAMAGE_MODIFIER); } + public double getSkullSplitterModifier() { return getDoubleValue(SKILLS, AXES, SKULL_SPLITTER, DAMAGE_MODIFIER); } /* EXCAVATION */ //Nothing to configure, everything is already configurable in config.yml /* FISHING */ - public double getShakeChance(int rank) { return getDoubleValue(SKILLS + "." + FISHING + ".Shake" + CHANCE + "." + RANK + rank); } - public int getFishingVanillaXPModifier(int rank) { return getIntValue(SKILLS + "." + FISHING + "." + VANILLA_XPMULTIPLIER + "." + RANK + rank); } - //public int getFishermanDietRankChange() { return getIntValue(SKILLS + "." + FISHING + ".FishermansDiet.RankChange"); } - public double getMasterAnglerBoatModifier() {return getDoubleValue(SKILLS + "." + FISHING + "." + MASTER_ANGLER + "." + BOAT_MODIFIER); } - public double getMasterAnglerBiomeModifier() {return getDoubleValue(SKILLS + "." + FISHING + "." + MASTER_ANGLER + "." + BIOME_MODIFIER); } + public double getShakeChance(int rank) { return getDoubleValue(SKILLS, FISHING, SHAKE, CHANCE, RANK, String.valueOf(rank)); } + public int getFishingVanillaXPModifier(int rank) { return getIntValue(SKILLS, FISHING, VANILLA_XPMULTIPLIER, RANK, String.valueOf(rank)); } + public double getMasterAnglerBoatModifier() {return getDoubleValue(SKILLS, FISHING, MASTER_ANGLER, BOAT_MODIFIER); } + public double getMasterAnglerBiomeModifier() {return getDoubleValue(SKILLS, FISHING, MASTER_ANGLER, BIOME_MODIFIER); } /* HERBALISM */ - //public int getFarmerDietRankChange() { return getIntValue(SKILLS + ".Herbalism.FarmersDiet.RankChange"); } + //public int getFarmerDietRankChange() { return getIntValue(SKILLS, ".Herbalism.FarmersDiet.RankChange"); } - //public int getGreenThumbStageChange() { return getIntValue(SKILLS + ".Herbalism.GreenThumb.StageChange"); } + //public int getGreenThumbStageChange() { return getIntValue(SKILLS, ".Herbalism.GreenThumb.StageChange"); } /* MINING */ - public int getBlastMiningRankLevel(int rank) { return getIntValue(SKILLS + ".Mining.BlastMining." + RANK + "Levels.Rank_" + rank); } - public double getBlastDamageDecrease(int rank) { return getDoubleValue(SKILLS + ".Mining.BlastMining.BlastDamageDecrease." + RANK + rank); } - public double getOreBonus(int rank) { return getDoubleValue(SKILLS + ".Mining.BlastMining.OreBonus." + RANK + rank); } - public double getDebrisReduction(int rank) { return getDoubleValue(SKILLS + ".Mining.BlastMining.DebrisReduction." + RANK + rank); } - public int getDropMultiplier(int rank) { return getIntValue(SKILLS + ".Mining.BlastMining.DropMultiplier." + RANK + rank); } - public double getBlastRadiusModifier(int rank) { return getDoubleValue(SKILLS + ".Mining.BlastMining.BlastRadius" + MODIFIER + "." + RANK + rank); } + public int getBlastMiningRankLevel(int rank) { return getIntValue(SKILLS, MINING, BLAST_MINING, RANK, LEVELS, RANK, String.valueOf(rank)); } + public double getBlastDamageDecrease(int rank) { return getDoubleValue(SKILLS, MINING, BLAST_MINING, BLAST_DAMAGE_DECREASE, RANK, String.valueOf(rank)); } + public double getOreBonus(int rank) { return getDoubleValue(SKILLS, MINING, BLAST_MINING, ORE_BONUS, RANK, String.valueOf(rank)); } + public double getDebrisReduction(int rank) { return getDoubleValue(SKILLS, MINING, BLAST_MINING, DEBRIS_REDUCTION, RANK, String.valueOf(rank)); } + public int getDropMultiplier(int rank) { return getIntValue(SKILLS, MINING, BLAST_MINING, DROP_MULTIPLIER, RANK, String.valueOf(rank)); } + public double getBlastRadiusModifier(int rank) { return getDoubleValue(SKILLS, MINING, BLAST_MINING, BLAST_RADIUS, MODIFIER, RANK, String.valueOf(rank)); } /* REPAIR */ - public double getRepairMasteryMaxBonus() { return getDoubleValue(SKILLS + ".Repair.RepairMastery.MaxBonusPercentage"); } - public int getRepairMasteryMaxLevel() { return getIntValue(SKILLS + ".Repair.RepairMastery." + MAX_BONUS_LEVEL); } + public double getRepairMasteryMaxBonus() { return getDoubleValue(SKILLS, REPAIR, REPAIR_MASTERY, MAX_BONUS_PERCENTAGE); } + public int getRepairMasteryMaxLevel() { return getIntValue(SKILLS, REPAIR, REPAIR_MASTERY, MAX_BONUS_LEVEL); } /* Arcane Forging */ - public boolean getArcaneForgingEnchantLossEnabled() { return getBooleanValue(SKILLS + ".Repair.ArcaneForging.May_Lose_Enchants"); } - public double getArcaneForgingKeepEnchantsChance(int rank) { return getDoubleValue(SKILLS + ".Repair.ArcaneForging.Keep_Enchants_" + CHANCE + "." + RANK + rank); } + public boolean getArcaneForgingEnchantLossEnabled() { return getBooleanValue(SKILLS, REPAIR, ARCANE_FORGING, MAY_LOSE_ENCHANTS); } + public double getArcaneForgingKeepEnchantsChance(int rank) { return getDoubleValue(SKILLS, REPAIR, ARCANE_FORGING, KEEP_ENCHANTS, CHANCE, RANK, String.valueOf(rank)); } - public boolean getArcaneForgingDowngradeEnabled() { return getBooleanValue(SKILLS + ".Repair.ArcaneForging.Downgrades_Enabled"); } - public double getArcaneForgingDowngradeChance(int rank) { return getDoubleValue(SKILLS + ".Repair.ArcaneForging.Downgrades_" + CHANCE + "." + RANK + rank); } + public boolean getArcaneForgingDowngradeEnabled() { return getBooleanValue(SKILLS, REPAIR, ARCANE_FORGING, DOWNGRADES_ENABLED); } + public double getArcaneForgingDowngradeChance(int rank) { return getDoubleValue(SKILLS, REPAIR, ARCANE_FORGING, DOWNGRADES, CHANCE, RANK, String.valueOf(rank)); } /* SALVAGE */ - public boolean getArcaneSalvageEnchantDowngradeEnabled() { return getBooleanValue(SKILLS + ".Salvage.ArcaneSalvage.EnchantDowngradeEnabled"); } - public boolean getArcaneSalvageEnchantLossEnabled() { return getBooleanValue(SKILLS + ".Salvage.ArcaneSalvage.EnchantLossEnabled"); } + public boolean getArcaneSalvageEnchantDowngradeEnabled() { return getBooleanValue(SKILLS, SALVAGE, ARCANE_SALVAGE, ENCHANT_DOWNGRADE_ENABLED); } + public boolean getArcaneSalvageEnchantLossEnabled() { return getBooleanValue(SKILLS, SALVAGE, ARCANE_SALVAGE, ENCHANT_LOSS_ENABLED); } - public double getArcaneSalvageExtractFullEnchantsChance(int rank) { return getDoubleValue(SKILLS + ".Salvage.ArcaneSalvage.ExtractFullEnchant." + RANK + rank); } - public double getArcaneSalvageExtractPartialEnchantsChance(int rank) { return getDoubleValue(SKILLS + ".Salvage.ArcaneSalvage.ExtractPartialEnchant." + RANK + rank); } + public double getArcaneSalvageExtractFullEnchantsChance(int rank) { return getDoubleValue(SKILLS, SALVAGE, ARCANE_SALVAGE, EXTRACT_FULL_ENCHANT, RANK, String.valueOf(rank)); } + public double getArcaneSalvageExtractPartialEnchantsChance(int rank) { return getDoubleValue(SKILLS, SALVAGE, ARCANE_SALVAGE, EXTRACT_PARTIAL_ENCHANT, RANK, String.valueOf(rank)); } /* SMELTING */ - public int getBurnModifierMaxLevel() { return getIntValue(SKILLS + ".Smelting.FuelEfficiency." + MAX_BONUS_LEVEL); } - public double getBurnTimeMultiplier() { return getDoubleValue(SKILLS + ".Smelting.FuelEfficiency.Multiplier"); } + public int getBurnModifierMaxLevel() { return getIntValue(SKILLS, SMELTING, FUEL_EFFICIENCY, MAX_BONUS_LEVEL); } + public double getBurnTimeMultiplier() { return getDoubleValue(SKILLS, SMELTING, FUEL_EFFICIENCY, MULTIPLIER); } - public double getFluxMiningChance() { return getDoubleValue(SKILLS + ".Smelting.FluxMining." + CHANCE); } + public double getFluxMiningChance() { return getDoubleValue(SKILLS, SMELTING, FLUX, MINING, CHANCE); } - public int getSmeltingRankLevel(int rank) { return getIntValue(SKILLS + ".Smelting." + RANK + "Levels.Rank_" + rank); } + public int getSmeltingRankLevel(int rank) { return getIntValue(SKILLS, SMELTING, RANK, LEVELS, RANK, String.valueOf(rank)); } - public int getSmeltingVanillaXPBoostMultiplier(int rank) { return getIntValue(SKILLS + ".Smelting." + VANILLA_XPMULTIPLIER + "." + RANK + rank); } + public int getSmeltingVanillaXPBoostMultiplier(int rank) { return getIntValue(SKILLS, SMELTING, VANILLA_XPMULTIPLIER, RANK, String.valueOf(rank)); } /* SWORDS */ - public double getRuptureDamagePlayer() { return getDoubleValue(SKILLS + ".Swords.Rupture.DamagePlayer"); } - public double getRuptureDamageMobs() { return getDoubleValue(SKILLS + ".Swords.Rupture.DamageMobs"); } + public double getRuptureDamagePlayer() { return getDoubleValue(SKILLS, SWORDS, RUPTURE, DAMAGE_PLAYER); } + public double getRuptureDamageMobs() { return getDoubleValue(SKILLS, SWORDS, RUPTURE, DAMAGE_MOBS); } - public int getRuptureMaxTicks() { return getIntValue(SKILLS + ".Swords.Rupture.MaxTicks"); } - public int getRuptureBaseTicks() { return getIntValue(SKILLS + ".Swords.Rupture.BaseTicks"); } + public int getRuptureMaxTicks() { return getIntValue(SKILLS, SWORDS, RUPTURE, MAX_TICKS); } + public int getRuptureBaseTicks() { return getIntValue(SKILLS, SWORDS, RUPTURE, BASE_TICKS); } - public double getCounterModifier() { return getDoubleValue(SKILLS + ".Swords.CounterAttack." + DAMAGE_MODIFIER); } + public double getCounterModifier() { return getDoubleValue(SKILLS, SWORDS, COUNTER_ATTACK, DAMAGE_MODIFIER); } - public double getSerratedStrikesModifier() { return getDoubleValue(SKILLS + ".Swords.SerratedStrikes." + DAMAGE_MODIFIER); } - public int getSerratedStrikesTicks() { return getIntValue(SKILLS + ".Swords.SerratedStrikes.RuptureTicks"); } + public double getSerratedStrikesModifier() { return getDoubleValue(SKILLS, SWORDS, SERRATED_STRIKES, DAMAGE_MODIFIER); } + public int getSerratedStrikesTicks() { return getIntValue(SKILLS, SWORDS, SERRATED_STRIKES, RUPTURE, TICKS); } /* TAMING */ - public double getGoreModifier() { return getDoubleValue(SKILLS + "." + TAMING + ".Gore." + MODIFIER); } - public double getFastFoodChance() { return getDoubleValue(SKILLS + "." + TAMING + ".FastFoodService." + CHANCE); } - public double getPummelChance() { return getDoubleValue(SKILLS + "." + TAMING + ".Pummel." + CHANCE); } - public double getThickFurModifier() { return getDoubleValue(SKILLS + "." + TAMING + ".ThickFur." + MODIFIER); } - public double getShockProofModifier() { return getDoubleValue(SKILLS + "." + TAMING + "." + SHOCK_PROOF + "." + MODIFIER); } + public double getGoreModifier() { return getDoubleValue(SKILLS, TAMING, GORE, MODIFIER); } + public double getFastFoodChance() { return getDoubleValue(SKILLS, TAMING, FAST_FOOD_SERVICE, CHANCE); } + public double getPummelChance() { return getDoubleValue(SKILLS, TAMING, PUMMEL, CHANCE); } + public double getThickFurModifier() { return getDoubleValue(SKILLS, TAMING, THICK_FUR, MODIFIER); } + public double getShockProofModifier() { return getDoubleValue(SKILLS, TAMING, SHOCK_PROOF, MODIFIER); } - public double getSharpenedClawsBonus() { return getDoubleValue(SKILLS + "." + TAMING + ".SharpenedClaws.Bonus"); } + public double getSharpenedClawsBonus() { return getDoubleValue(SKILLS, TAMING, SHARPENED_CLAWS, BONUS); } - public double getMinHorseJumpStrength() { return getDoubleValue(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD + "." + MIN_HORSE_JUMP_STRENGTH); } - public double getMaxHorseJumpStrength() { return getDoubleValue(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD + "." + MAX_HORSE_JUMP_STRENGTH); } + public double getMinHorseJumpStrength() { return getDoubleValue(SKILLS, TAMING, CALL_OF_THE_WILD, MIN_HORSE_JUMP_STRENGTH); } + public double getMaxHorseJumpStrength() { return getDoubleValue(SKILLS, TAMING, CALL_OF_THE_WILD, MAX_HORSE_JUMP_STRENGTH); } /* UNARMED */ - public boolean getDisarmProtected() { return getBooleanValue(SKILLS + "." + UNARMED + ".Disarm.AntiTheft"); } + public boolean getDisarmProtected() { return getBooleanValue(SKILLS, UNARMED, DISARM, ANTI_THEFT); } /* WOODCUTTING */ } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillType.java b/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillType.java index d9ee1f3a0..7fad7eb83 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillType.java @@ -145,8 +145,8 @@ public enum SubSkillType { * * @return the root address for this skill in rankskills.yml */ - public String getRankConfigAddress() { - //return StringUtils.getCapitalized(getParentSkill().toString()) + "." + getConfigName(toString()); + public String[] getRankConfigAddress() { + return new String[] {StringUtils.getCapitalized(getParentSkill().toString()), getConfigName(toString()) }; } /** From 41b484b1c376da52dd8c30a80bea4492ec1228f0 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 14 Feb 2019 13:21:43 -0800 Subject: [PATCH 21/28] new config system pt 4 --- .../src/main/java/com/gmail/nossr50/core/TODO | 4 +++ .../nossr50/core/config/AdvancedConfig.java | 2 +- .../core/config/ConfigurableLoader.java | 11 +++++--- .../gmail/nossr50/core/config/RankConfig.java | 9 ++++--- .../nossr50/core/config/SoundConfig.java | 7 +++--- .../nossr50/core/config/WorldBlacklist.java | 13 +++++----- .../config/experience/ExperienceConfig.java | 22 +++++++--------- .../core/config/mods/ArmorConfigManager.java | 3 +-- .../core/config/mods/CustomArmorConfig.java | 6 +++-- .../core/config/mods/CustomBlockConfig.java | 6 +++-- .../core/config/mods/CustomEntityConfig.java | 6 +++-- .../core/config/mods/CustomToolConfig.java | 6 +++-- .../core/config/party/ItemWeightConfig.java | 6 +++-- .../config/skills/alchemy/PotionConfig.java | 6 +++-- .../config/skills/repair/RepairConfig.java | 3 ++- .../config/skills/salvage/SalvageConfig.java | 6 +++-- .../skills/salvage/SalvageConfigManager.java | 8 +++--- .../core/config/treasure/TreasureConfig.java | 25 +++++++------------ .../core/util/random/RandomChanceSkill.java | 2 +- 19 files changed, 81 insertions(+), 70 deletions(-) diff --git a/core/src/main/java/com/gmail/nossr50/core/TODO b/core/src/main/java/com/gmail/nossr50/core/TODO index d3a51edb4..bd54d3d0d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/TODO +++ b/core/src/main/java/com/gmail/nossr50/core/TODO @@ -6,3 +6,7 @@ This file is just going to take note of all the caveats of mcMMO code as I abstr 2) mcMMO uses a a global reference of its Plugin class for Bukkit in order to schedule tasks 3) Need to configure the logger + +4) Safety check the hardcore/vampirism commands + +5) Tweak configs to not do any string operations \ No newline at end of file diff --git a/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java index b446e3ef8..0b9f4023c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java @@ -10,7 +10,7 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; import java.util.ArrayList; import java.util.List; -@ConfigSerializable +//@ConfigSerializable public class AdvancedConfig extends ConfigurableLoader { public static final String SKILLS = "Skills"; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/ConfigurableLoader.java b/core/src/main/java/com/gmail/nossr50/core/config/ConfigurableLoader.java index 31ee0b558..de9d874f4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/ConfigurableLoader.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/ConfigurableLoader.java @@ -43,15 +43,18 @@ public abstract class ConfigurableLoader implements DefaultKeys, VersionedConfig /* CONFIG MANAGER */ private ConfigurationLoader configManager; - //TODO: Needed? - //private ConfigurationLoader configManager; + public ConfigurableLoader(String pathToParentFolder, String relativePath) { + //TODO: Check if this works... + this(new File(pathToParentFolder), relativePath); + System.out.println("mcMMO Debug: Don't forget to check if loading config file by string instead of File works..."); + } - public ConfigurableLoader(File pathToDataFolder, String relativePath) { + public ConfigurableLoader(File pathToParentFolder, String relativePath) { /* * These must be at the top */ mkdirDefaults(); // Make our default config dir - DIRECTORY_DATA_FOLDER = pathToDataFolder; //Data Folder for our plugin + DIRECTORY_DATA_FOLDER = pathToParentFolder; //Data Folder for our plugin FILE_RELATIVE_PATH = relativePath; //Relative path to config from a parent folder //Attempt IO Operations diff --git a/core/src/main/java/com/gmail/nossr50/core/config/RankConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/RankConfig.java index 131e32acf..5d2ad8f34 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/RankConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/RankConfig.java @@ -1,16 +1,17 @@ package com.gmail.nossr50.core.config; -import com.gmail.nossr50.core.mcmmo.skills.SubSkillType; -import com.gmail.nossr50.core.mcmmo.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.McmmoCore; +import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; import java.util.ArrayList; import java.util.List; -public class RankConfig extends AutoUpdateConfigLoader { +public class RankConfig extends ConfigurableLoader { private static RankConfig instance; public RankConfig() { - super("skillranks.yml"); + super(McmmoCore.getDataFolderPath().getAbsoluteFile(),"skillranks.yml"); validate(); this.instance = this; } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/SoundConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/SoundConfig.java index 9b395a422..aabae1077 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/SoundConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/SoundConfig.java @@ -1,12 +1,13 @@ package com.gmail.nossr50.core.config; -import com.gmail.nossr50.util.sounds.SoundType; +import com.gmail.nossr50.core.McmmoCore; +import com.gmail.nossr50.core.util.sounds.SoundType; -public class SoundConfig extends AutoUpdateConfigLoader { +public class SoundConfig extends ConfigurableLoader { private static SoundConfig instance; public SoundConfig() { - super("sounds.yml"); + super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "sounds.yml"); validate(); this.instance = this; } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/WorldBlacklist.java b/core/src/main/java/com/gmail/nossr50/core/config/WorldBlacklist.java index 5d01f848b..11e76b382 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/WorldBlacklist.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/WorldBlacklist.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.config; -import com.gmail.nossr50.mcMMO; -import org.bukkit.World; +import com.gmail.nossr50.core.McmmoCore; +import com.gmail.nossr50.core.mcmmo.world.World; import java.io.*; import java.util.ArrayList; @@ -12,10 +12,8 @@ import java.util.ArrayList; public class WorldBlacklist { private static ArrayList blacklist; private final String blackListFileName = "world_blacklist.txt"; - private mcMMO plugin; - public WorldBlacklist(mcMMO plugin) { - this.plugin = plugin; + public WorldBlacklist() { blacklist = new ArrayList<>(); init(); } @@ -32,7 +30,8 @@ public class WorldBlacklist { public void init() { //Make the blacklist file if it doesn't exist - File blackListFile = new File(plugin.getDataFolder() + File.separator + blackListFileName); + //TODO: Check if this works + File blackListFile = new File(McmmoCore.getDataFolderPath().getAbsoluteFile() + File.separator + blackListFileName); try { if (!blackListFile.exists()) @@ -70,6 +69,6 @@ public class WorldBlacklist { e.printStackTrace(); } - plugin.getLogger().info(blacklist.size() + " entries in mcMMO World Blacklist"); + McmmoCore.getLogger().info(blacklist.size() + " entries in mcMMO World Blacklist"); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java index fd5e85e24..6a5621bb2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java @@ -1,25 +1,21 @@ package com.gmail.nossr50.core.config.experience; -import com.gmail.nossr50.core.config.AutoUpdateConfigLoader; -import com.gmail.nossr50.core.mcmmo.experience.FormulaType; -import com.gmail.nossr50.core.mcmmo.skills.MaterialType; -import com.gmail.nossr50.core.mcmmo.skills.PrimarySkillType; -import com.gmail.nossr50.core.mcmmo.skills.alchemy.PotionStage; -import com.gmail.nossr50.util.StringUtils; -import org.bukkit.Material; -import org.bukkit.block.data.BlockData; -import org.bukkit.boss.BarColor; -import org.bukkit.boss.BarStyle; -import org.bukkit.entity.EntityType; +import com.gmail.nossr50.core.McmmoCore; +import com.gmail.nossr50.core.config.ConfigurableLoader; +import com.gmail.nossr50.core.datatypes.experience.FormulaType; +import com.gmail.nossr50.core.skills.MaterialType; +import com.gmail.nossr50.core.skills.PotionStage; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.util.StringUtils; import java.util.ArrayList; import java.util.List; -public class ExperienceConfig extends AutoUpdateConfigLoader { +public class ExperienceConfig extends ConfigurableLoader { private static ExperienceConfig instance; private ExperienceConfig() { - super("experience.yml"); + super(McmmoCore.getDataFolderPath().getAbsoluteFile(),"experience.yml"); validate(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/ArmorConfigManager.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/ArmorConfigManager.java index 991294864..2bb39b343 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/ArmorConfigManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/ArmorConfigManager.java @@ -1,7 +1,6 @@ package com.gmail.nossr50.core.config.mods; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.ModManager; +import com.gmail.nossr50.core.util.ModManager; import java.io.File; import java.util.regex.Pattern; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java index 214438936..dc119ef6d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java @@ -1,6 +1,8 @@ package com.gmail.nossr50.core.config.mods; +import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.config.ConfigLoader; +import com.gmail.nossr50.core.config.ConfigurableLoader; import com.gmail.nossr50.core.mcmmo.skills.ItemType; import com.gmail.nossr50.core.mcmmo.skills.MaterialType; import com.gmail.nossr50.skills.repair.repairables.Repairable; @@ -14,7 +16,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Set; -public class CustomArmorConfig extends ConfigLoader { +public class CustomArmorConfig extends ConfigurableLoader { public List customBoots = new ArrayList(); public List customChestplates = new ArrayList(); public List customHelmets = new ArrayList(); @@ -23,7 +25,7 @@ public class CustomArmorConfig extends ConfigLoader { private boolean needsUpdate = false; protected CustomArmorConfig(String fileName) { - super("mods", fileName); + super(McmmoCore.getDataFolderPath().getPath() + "mods", fileName); loadKeys(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java index b60b1e652..6d995a367 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java @@ -1,6 +1,8 @@ package com.gmail.nossr50.core.config.mods; +import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.config.ConfigLoader; +import com.gmail.nossr50.core.config.ConfigurableLoader; import com.gmail.nossr50.core.mcmmo.mods.CustomBlock; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; @@ -10,7 +12,7 @@ import java.util.HashMap; import java.util.List; import java.util.Set; -public class CustomBlockConfig extends ConfigLoader { +public class CustomBlockConfig extends ConfigurableLoader { public List customExcavationBlocks = new ArrayList<>(); public List customHerbalismBlocks = new ArrayList<>(); public List customMiningBlocks = new ArrayList<>(); @@ -22,7 +24,7 @@ public class CustomBlockConfig extends ConfigLoader { private boolean needsUpdate = false; protected CustomBlockConfig(String fileName) { - super("mods", fileName); + super(McmmoCore.getDataFolderPath().getPath() + "mods", fileName); loadKeys(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java index 7852b8cb8..95293cade 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java @@ -1,6 +1,8 @@ package com.gmail.nossr50.core.config.mods; +import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.config.ConfigLoader; +import com.gmail.nossr50.core.config.ConfigurableLoader; import com.gmail.nossr50.core.mcmmo.mods.CustomEntity; import org.apache.commons.lang.ClassUtils; import org.bukkit.Material; @@ -8,12 +10,12 @@ import org.bukkit.inventory.ItemStack; import java.util.HashMap; -public class CustomEntityConfig extends ConfigLoader { +public class CustomEntityConfig extends ConfigurableLoader { public HashMap customEntityClassMap = new HashMap(); public HashMap customEntityTypeMap = new HashMap(); protected CustomEntityConfig(String fileName) { - super("mods", fileName); + super(McmmoCore.getDataFolderPath().getPath() + "mods", fileName); loadKeys(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java index 550256a2b..4a8ba56c2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java @@ -1,6 +1,8 @@ package com.gmail.nossr50.core.config.mods; +import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.config.ConfigLoader; +import com.gmail.nossr50.core.config.ConfigurableLoader; import com.gmail.nossr50.core.mcmmo.mods.CustomTool; import com.gmail.nossr50.core.mcmmo.skills.ItemType; import com.gmail.nossr50.core.mcmmo.skills.MaterialType; @@ -16,7 +18,7 @@ import java.util.HashMap; import java.util.List; import java.util.Set; -public class CustomToolConfig extends ConfigLoader { +public class CustomToolConfig extends ConfigurableLoader { public List customAxes = new ArrayList(); public List customBows = new ArrayList(); public List customHoes = new ArrayList(); @@ -28,7 +30,7 @@ public class CustomToolConfig extends ConfigLoader { private boolean needsUpdate = false; protected CustomToolConfig(String fileName) { - super("mods", fileName); + super(McmmoCore.getDataFolderPath().getPath() + "mods", fileName); loadKeys(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java index 1558c1495..64cde7761 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java @@ -1,16 +1,18 @@ package com.gmail.nossr50.core.config.party; +import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.config.ConfigLoader; +import com.gmail.nossr50.core.config.ConfigurableLoader; import com.gmail.nossr50.util.StringUtils; import org.bukkit.Material; import java.util.HashSet; -public class ItemWeightConfig extends ConfigLoader { +public class ItemWeightConfig extends ConfigurableLoader { private static ItemWeightConfig instance; private ItemWeightConfig() { - super("itemweights.yml"); + super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "itemweights.yml"); } public static ItemWeightConfig getInstance() { diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java index accdbedbd..9e434116e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java @@ -1,5 +1,7 @@ package com.gmail.nossr50.core.config.skills.alchemy; +import com.gmail.nossr50.core.McmmoCore; +import com.gmail.nossr50.core.config.ConfigurableLoader; import com.gmail.nossr50.core.mcmmo.colors.ChatColor; import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyPotion; @@ -10,7 +12,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -public class PotionConfig extends ConfigLoader { +public class PotionConfig extends ConfigurableLoader { private static PotionConfig instance; private List concoctionsIngredientsTierOne = new ArrayList(); @@ -25,7 +27,7 @@ public class PotionConfig extends ConfigLoader { private Map potionMap = new HashMap(); private PotionConfig() { - super("potions.yml"); + super(McmmoCore.getDataFolderPath().getAbsoluteFile(),"potions.yml"); loadKeys(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java index 685ea4515..f0238a5e4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.config.skills.repair; import com.gmail.nossr50.config.ConfigLoader; +import com.gmail.nossr50.core.config.ConfigurableLoader; import com.gmail.nossr50.core.mcmmo.skills.ItemType; import com.gmail.nossr50.core.mcmmo.skills.MaterialType; import com.gmail.nossr50.skills.repair.repairables.Repairable; @@ -15,7 +16,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Set; -public class RepairConfig extends ConfigLoader { +public class RepairConfig extends ConfigurableLoader { private List repairables; public RepairConfig(String fileName) { diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java index 08d63f924..5a4ad4d79 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java @@ -1,6 +1,8 @@ package com.gmail.nossr50.config.skills.salvage; import com.gmail.nossr50.config.ConfigLoader; +import com.gmail.nossr50.core.McmmoCore; +import com.gmail.nossr50.core.config.ConfigurableLoader; import com.gmail.nossr50.core.mcmmo.skills.ItemType; import com.gmail.nossr50.core.mcmmo.skills.MaterialType; import com.gmail.nossr50.skills.salvage.salvageables.Salvageable; @@ -15,11 +17,11 @@ import java.util.ArrayList; import java.util.List; import java.util.Set; -public class SalvageConfig extends ConfigLoader { +public class SalvageConfig extends ConfigurableLoader { private List salvageables; public SalvageConfig(String fileName) { - super(fileName); + super(McmmoCore.getDataFolderPath().getAbsoluteFile(), fileName); loadKeys(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfigManager.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfigManager.java index 3fdca28d6..3324a0ce2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfigManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfigManager.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.config.skills.salvage; +package com.gmail.nossr50.core.config.skills.salvage; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.salvage.salvageables.Salvageable; + +import com.gmail.nossr50.core.skills.child.salvage.salvageables.Salvageable; import java.io.File; import java.util.ArrayList; @@ -31,7 +31,7 @@ public class SalvageConfigManager { continue; } - SalvageConfig salvageConfig = new SalvageConfig(fileName); + com.gmail.nossr50.config.skills.salvage.SalvageConfig salvageConfig = new com.gmail.nossr50.config.skills.salvage.SalvageConfig(fileName); salvageables.addAll(salvageConfig.getLoadedSalvageables()); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java index 23647ac9a..3feff02f4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java @@ -1,25 +1,18 @@ package com.gmail.nossr50.core.config.treasure; -import com.gmail.nossr50.core.config.ConfigLoader; -import com.gmail.nossr50.util.EnchantmentUtils; -import com.gmail.nossr50.util.StringUtils; -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.Tag; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.EntityType; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.inventory.meta.PotionMeta; -import org.bukkit.potion.PotionData; -import org.bukkit.potion.PotionType; +import com.gmail.nossr50.core.McmmoCore; +import com.gmail.nossr50.core.config.ConfigurableLoader; +import com.gmail.nossr50.core.mcmmo.colors.ChatColor; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; +import com.gmail.nossr50.core.skills.treasure.*; +import com.gmail.nossr50.core.util.EnchantmentUtils; +import com.gmail.nossr50.core.util.StringUtils; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -public class TreasureConfig extends ConfigLoader { +public class TreasureConfig extends ConfigurableLoader { private static TreasureConfig instance; @@ -32,7 +25,7 @@ public class TreasureConfig extends ConfigLoader { public HashMap> fishingEnchantments = new HashMap>(); private TreasureConfig() { - super("treasures.yml"); + super(McmmoCore.getDataFolderPath().getAbsoluteFile(),"treasures.yml"); loadKeys(); validate(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkill.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkill.java index 64770955e..eea8a2bda 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkill.java @@ -2,10 +2,10 @@ package com.gmail.nossr50.core.util.random; import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.util.Permissions; -import org.bukkit.entity.Player; public class RandomChanceSkill implements RandomChanceExecution { From f6a3084a47b77882768b4a64ce8f5b94024b0576 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 14 Feb 2019 13:59:27 -0800 Subject: [PATCH 22/28] new config system pt 5 --- .../gmail/nossr50/commands/MHDCommand.java | 6 +- .../gmail/nossr50/commands/McmmoCommand.java | 4 +- .../nossr50/commands/McscoreboardCommand.java | 4 +- .../nossr50/commands/chat/ChatCommand.java | 4 +- .../commands/chat/PartyChatCommand.java | 4 +- .../commands/database/McpurgeCommand.java | 4 +- .../commands/database/MmoshowdbCommand.java | 4 +- .../commands/hardcore/HardcoreCommand.java | 4 +- .../commands/hardcore/VampirismCommand.java | 4 +- .../commands/party/PartyInfoCommand.java | 4 +- .../commands/party/PartyInviteCommand.java | 4 +- .../commands/party/PartyItemShareCommand.java | 4 +- .../commands/party/PartyXpShareCommand.java | 4 +- .../party/alliance/PartyAllianceCommand.java | 6 +- .../party/teleport/PtpAcceptCommand.java | 6 +- .../commands/party/teleport/PtpCommand.java | 12 +- .../commands/player/InspectCommand.java | 10 +- .../commands/player/MccooldownCommand.java | 6 +- .../commands/player/McrankCommand.java | 8 +- .../commands/player/McstatsCommand.java | 8 +- .../nossr50/commands/player/MctopCommand.java | 8 +- .../nossr50/commands/skills/SkillCommand.java | 6 +- .../nossr50/listeners/BlockListener.java | 4 +- .../nossr50/listeners/EntityListener.java | 6 +- .../nossr50/listeners/InventoryListener.java | 8 +- .../nossr50/listeners/PlayerListener.java | 26 +- .../gmail/nossr50/listeners/SelfListener.java | 12 +- .../main/java/com/gmail/nossr50/mcMMO.java | 38 +- .../com/gmail/nossr50/core/McmmoCore.java | 8 +- .../gmail/nossr50/core/api/ExperienceAPI.java | 6 +- .../com/gmail/nossr50/core/api/PartyAPI.java | 4 +- .../nossr50/core/chat/AdminChatManager.java | 4 +- .../nossr50/core/chat/PartyChatManager.java | 4 +- .../nossr50/core/config/AdvancedConfig.java | 3 +- .../com/gmail/nossr50/core/config/Config.java | 1230 ++++------------- .../core/config/ConfigKeyRegister.java | 19 + .../nossr50/core/config/ConfigValidated.java | 44 + .../core/config/ConfigurableLoader.java | 315 ----- .../nossr50/core/config/CoreSkillsConfig.java | 21 +- .../gmail/nossr50/core/config/MainConfig.java | 1041 ++++++++++++++ .../gmail/nossr50/core/config/RankConfig.java | 23 +- .../nossr50/core/config/RegistersKeys.java | 11 + .../nossr50/core/config/SoundConfig.java | 43 +- .../com/gmail/nossr50/core/config/Unload.java | 8 + .../config/experience/ExperienceConfig.java | 114 +- .../core/config/mods/ArmorConfigManager.java | 5 +- .../core/config/mods/BlockConfigManager.java | 10 +- .../core/config/mods/CustomArmorConfig.java | 47 +- .../core/config/mods/CustomBlockConfig.java | 14 +- .../core/config/mods/CustomEntityConfig.java | 20 +- .../core/config/mods/CustomToolConfig.java | 26 +- .../core/config/party/ItemWeightConfig.java | 14 +- .../config/skills/alchemy/PotionConfig.java | 4 +- .../config/skills/repair/RepairConfig.java | 43 +- .../config/skills/salvage/SalvageConfig.java | 24 +- .../core/config/treasure/TreasureConfig.java | 52 +- .../core/data/database/DatabaseManager.java | 4 +- .../nossr50/core/datatypes/party/Party.java | 10 +- .../core/datatypes/party/PartyFeature.java | 4 +- .../datatypes/party/PartyTeleportRecord.java | 4 +- .../core/datatypes/player/McMMOPlayer.java | 18 +- .../core/datatypes/player/PlayerProfile.java | 4 +- .../nossr50/core/locale/LocaleLoader.java | 4 +- .../nossr50/core/party/PartyManager.java | 14 +- .../nossr50/core/party/ShareHandler.java | 4 +- .../gmail/nossr50/core/platform/Platform.java | 6 + .../runnables/backups/CleanBackupsTask.java | 8 +- .../commands/McrankCommandDisplayTask.java | 4 +- .../commands/MctopCommandDisplayTask.java | 4 +- .../runnables/database/UserPurgeTask.java | 4 +- .../runnables/items/ChimaeraWingWarmup.java | 6 +- .../runnables/items/TeleportationWarmup.java | 4 +- .../runnables/party/PartyAutoKickTask.java | 4 +- .../core/runnables/party/PartyChatTask.java | 6 +- .../player/PlayerProfileLoadingTask.java | 8 +- .../runnables/skills/AbilityDisableTask.java | 4 +- .../core/runnables/skills/ToolLowerTask.java | 4 +- .../nossr50/core/skills/PrimarySkillType.java | 22 +- .../nossr50/core/skills/SuperAbilityType.java | 6 +- .../core/skills/child/salvage/Salvage.java | 4 +- .../skills/child/salvage/SalvageManager.java | 10 +- .../child/smelting/SmeltingManager.java | 6 +- .../skills/primary/acrobatics/Acrobatics.java | 4 +- .../primary/excavation/ExcavationManager.java | 4 +- .../primary/fishing/FishingManager.java | 8 +- .../primary/herbalism/HerbalismManager.java | 6 +- .../skills/primary/mining/BlastMining.java | 4 +- .../skills/primary/mining/MiningManager.java | 6 +- .../core/skills/primary/repair/Repair.java | 4 +- .../skills/primary/repair/RepairManager.java | 10 +- .../skills/primary/taming/TamingManager.java | 16 +- .../primary/taming/TrackedTamingEntity.java | 4 +- .../core/skills/primary/unarmed/Unarmed.java | 4 +- .../primary/woodcutting/Woodcutting.java | 8 +- .../skills/subskills/acrobatics/Roll.java | 10 +- .../core/skills/treasure/Treasure.java | 4 +- .../gmail/nossr50/core/util/ChimaeraWing.java | 30 +- .../nossr50/core/util/HardcoreManager.java | 10 +- .../gmail/nossr50/core/util/ItemUtils.java | 4 +- .../com/gmail/nossr50/core/util/Misc.java | 12 +- .../nossr50/core/util/MobHealthbarUtils.java | 8 +- .../gmail/nossr50/core/util/ModManager.java | 42 +- .../com/gmail/nossr50/core/util/Motd.java | 6 +- .../core/util/TextComponentFactory.java | 4 +- .../commands/CommandRegistrationManager.java | 4 +- .../core/util/commands/CommandUtils.java | 6 +- .../core/util/experience/FormulaManager.java | 6 +- .../util/scoreboards/ScoreboardManager.java | 30 +- .../util/scoreboards/ScoreboardWrapper.java | 6 +- .../core/util/skills/ParticleEffectUtils.java | 18 +- .../nossr50/core/util/skills/SkillUtils.java | 4 +- .../shatt/backup/ZipLibrary.java | 4 +- 112 files changed, 1981 insertions(+), 1856 deletions(-) create mode 100644 core/src/main/java/com/gmail/nossr50/core/config/ConfigKeyRegister.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/config/ConfigValidated.java delete mode 100644 core/src/main/java/com/gmail/nossr50/core/config/ConfigurableLoader.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/config/MainConfig.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/config/RegistersKeys.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/config/Unload.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java index 81b005aea..96d2f7546 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.data.database.FlatfileDatabaseManager; import com.gmail.nossr50.core.data.database.SQLDatabaseManager; @@ -21,7 +21,7 @@ public class MHDCommand implements TabExecutor { SQLDatabaseManager m = (SQLDatabaseManager) mcMMO.getDatabaseManager(); m.resetMobHealthSettings(); for (McMMOPlayer player : UserManager.getPlayers()) { - player.getProfile().setMobHealthbarType(Config.getInstance().getMobHealthbarDefault()); + player.getProfile().setMobHealthbarType(MainConfig.getInstance().getMobHealthbarDefault()); } sender.sendMessage("Mob health reset"); return true; @@ -30,7 +30,7 @@ public class MHDCommand implements TabExecutor { FlatfileDatabaseManager m = (FlatfileDatabaseManager) mcMMO.getDatabaseManager(); m.resetMobHealthSettings(); for (McMMOPlayer player : UserManager.getPlayers()) { - player.getProfile().setMobHealthbarType(Config.getInstance().getMobHealthbarDefault()); + player.getProfile().setMobHealthbarType(MainConfig.getInstance().getMobHealthbarDefault()); } sender.sendMessage("Mob health reset"); return true; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java index af98e6c95..ec2b3960e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.commands.party.PartySubcommandType; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.mcMMO; @@ -24,7 +24,7 @@ public class McmmoCommand implements CommandExecutor { String[] mcSplit = description.split(","); sender.sendMessage(mcSplit); - if (Config.getInstance().getDonateMessageEnabled()) { + if (MainConfig.getInstance().getDonateMessageEnabled()) { sender.sendMessage(LocaleLoader.getString("MOTD.Donate")); sender.sendMessage(ChatColor.GOLD + " - " + ChatColor.GREEN + "com.gmail.nossr50@com.gmail.com" + ChatColor.GOLD + " Paypal"); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McscoreboardCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McscoreboardCommand.java index b8f7ea2d0..91a55939b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McscoreboardCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McscoreboardCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; @@ -31,7 +31,7 @@ public class McscoreboardCommand implements TabExecutor { } if (args[0].equalsIgnoreCase("keep")) { - if (!Config.getInstance().getAllowKeepBoard() || !Config.getInstance().getScoreboardsEnabled()) { + if (!MainConfig.getInstance().getAllowKeepBoard() || !MainConfig.getInstance().getScoreboardsEnabled()) { sender.sendMessage(LocaleLoader.getString("Commands.Disabled")); return true; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java index 5b99c27f7..240efd6b8 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.commands.chat; import com.gmail.nossr50.core.chat.ChatManager; import com.gmail.nossr50.core.chat.ChatManagerFactory; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.party.PartyFeature; @@ -118,7 +118,7 @@ public abstract class ChatCommand implements TabExecutor { return; } - if (chatMode == ChatMode.PARTY && (mcMMOPlayer.getParty().getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.CHAT))) { + if (chatMode == ChatMode.PARTY && (mcMMOPlayer.getParty().getLevel() < MainConfig.getInstance().getPartyFeatureUnlockLevel(PartyFeature.CHAT))) { sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.1")); return; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java index d29509b90..aa04b5777 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands.chat; import com.gmail.nossr50.core.chat.PartyChatManager; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.party.Party; @@ -29,7 +29,7 @@ public class PartyChatCommand extends ChatCommand { return; } - if (party.getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.CHAT)) { + if (party.getLevel() < MainConfig.getInstance().getPartyFeatureUnlockLevel(PartyFeature.CHAT)) { sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.1")); return; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java index a7c676d1a..ac8927aac 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.database; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; @@ -17,7 +17,7 @@ public class McpurgeCommand implements TabExecutor { case 0: mcMMO.getDatabaseManager().purgePowerlessUsers(); - if (Config.getInstance().getOldUsersCutoff() != -1) { + if (MainConfig.getInstance().getOldUsersCutoff() != -1) { mcMMO.getDatabaseManager().purgeOldUsers(); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/database/MmoshowdbCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/database/MmoshowdbCommand.java index 4023068bf..edea349d9 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/database/MmoshowdbCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/database/MmoshowdbCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.database; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.database.DatabaseManagerFactory; import com.gmail.nossr50.core.locale.LocaleLoader; import com.google.common.collect.ImmutableList; @@ -22,7 +22,7 @@ public class MmoshowdbCommand implements TabExecutor { return true; } - sender.sendMessage(LocaleLoader.getString("Commands.mmoshowdb", (Config.getInstance().getUseMySQL() ? "sql" : "flatfile"))); + sender.sendMessage(LocaleLoader.getString("Commands.mmoshowdb", (MainConfig.getInstance().getUseMySQL() ? "sql" : "flatfile"))); return true; default: diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java index 407d132ca..07b829772 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.hardcore; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Permissions; @@ -45,7 +45,7 @@ public class HardcoreCommand extends HardcoreModeCommand { @Override protected void modify(CommandSender sender, double newPercentage) { - Config.getInstance().setHardcoreDeathStatPenaltyPercentage(newPercentage); + MainConfig.getInstance().setHardcoreDeathStatPenaltyPercentage(newPercentage); sender.sendMessage(LocaleLoader.getString("Hardcore.DeathStatLoss.PercentageChanged", percent.format(newPercentage / 100.0D))); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java index e29c0cf97..3064d7d6b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.hardcore; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Permissions; @@ -45,7 +45,7 @@ public class VampirismCommand extends HardcoreModeCommand { @Override protected void modify(CommandSender sender, double newPercentage) { - Config.getInstance().setHardcoreVampirismStatLeechPercentage(newPercentage); + MainConfig.getInstance().setHardcoreVampirismStatLeechPercentage(newPercentage); sender.sendMessage(LocaleLoader.getString("Hardcore.Vampirism.PercentageChanged", percent.format(newPercentage / 100.0D))); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java index b2d6b5ffc..56d5561ef 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; @@ -78,7 +78,7 @@ public class PartyInfoCommand implements CommandExecutor { } private boolean isUnlockedFeature(Party party, PartyFeature partyFeature) { - return party.getLevel() >= Config.getInstance().getPartyFeatureUnlockLevel(partyFeature); + return party.getLevel() >= MainConfig.getInstance().getPartyFeatureUnlockLevel(partyFeature); } private void displayShareModeInfo(Player player, Party party) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java index 7cf5e4c5a..2ae8fe350 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; @@ -47,7 +47,7 @@ public class PartyInviteCommand implements CommandExecutor { Party playerParty = mcMMOPlayer.getParty(); if (PartyManager.isPartyFull(target, playerParty)) { - player.sendMessage(LocaleLoader.getString("Commands.Party.PartyFull.Invite", target.getName(), playerParty.toString(), Config.getInstance().getPartyMaxSize())); + player.sendMessage(LocaleLoader.getString("Commands.Party.PartyFull.Invite", target.getName(), playerParty.toString(), MainConfig.getInstance().getPartyMaxSize())); return true; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java index 6ec809a28..690971014 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.ItemShareType; import com.gmail.nossr50.core.datatypes.party.Party; @@ -19,7 +19,7 @@ public class PartyItemShareCommand implements CommandExecutor { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { Party party = UserManager.getPlayer((Player) sender).getParty(); - if (party.getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.ITEM_SHARE)) { + if (party.getLevel() < MainConfig.getInstance().getPartyFeatureUnlockLevel(PartyFeature.ITEM_SHARE)) { sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.4")); return true; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java index ed5c00dfb..3cec9d805 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.party; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; @@ -18,7 +18,7 @@ public class PartyXpShareCommand implements CommandExecutor { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { Party party = UserManager.getPlayer((Player) sender).getParty(); - if (party.getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.XP_SHARE)) { + if (party.getLevel() < MainConfig.getInstance().getPartyFeatureUnlockLevel(PartyFeature.XP_SHARE)) { sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.5")); return true; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java index d74643bf8..f503f8ed1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.party.alliance; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; @@ -42,7 +42,7 @@ public class PartyAllianceCommand implements TabExecutor { switch (args.length) { case 1: - if (playerParty.getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.ALLIANCE)) { + if (playerParty.getLevel() < MainConfig.getInstance().getPartyFeatureUnlockLevel(PartyFeature.ALLIANCE)) { sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.3")); return true; } @@ -60,7 +60,7 @@ public class PartyAllianceCommand implements TabExecutor { case 2: case 3: - if (playerParty.getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.ALLIANCE)) { + if (playerParty.getLevel() < MainConfig.getInstance().getPartyFeatureUnlockLevel(PartyFeature.ALLIANCE)) { sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.3")); return true; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java index 64ff0919d..b04b40bd0 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.party.teleport; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.core.locale.LocaleLoader; @@ -28,7 +28,7 @@ public class PtpAcceptCommand implements CommandExecutor { return true; } - if (SkillUtils.cooldownExpired(ptpRecord.getTimeout(), Config.getInstance().getPTPCommandTimeout())) { + if (SkillUtils.cooldownExpired(ptpRecord.getTimeout(), MainConfig.getInstance().getPTPCommandTimeout())) { ptpRecord.removeRequest(); player.sendMessage(LocaleLoader.getString("Commands.ptp.RequestExpired")); return true; @@ -41,7 +41,7 @@ public class PtpAcceptCommand implements CommandExecutor { return true; } - if (Config.getInstance().getPTPCommandWorldPermissions()) { + if (MainConfig.getInstance().getPTPCommandWorldPermissions()) { World targetWorld = target.getWorld(); World playerWorld = player.getWorld(); diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java index d89166723..e8bb40f9f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.party.teleport; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.config.WorldBlacklist; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; @@ -72,7 +72,7 @@ public class PtpCommand implements TabExecutor { McMMOPlayer mcMMOPlayer = UserManager.getPlayer(teleportingPlayer); McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetPlayer); - long warmup = Config.getInstance().getPTPCommandWarmup(); + long warmup = MainConfig.getInstance().getPTPCommandWarmup(); mcMMOPlayer.actualizeTeleportCommenceLocation(teleportingPlayer); @@ -115,7 +115,7 @@ public class PtpCommand implements TabExecutor { Party party = mcMMOPlayer.getParty(); - if (party.getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.TELEPORT)) { + if (party.getLevel() < MainConfig.getInstance().getPartyFeatureUnlockLevel(PartyFeature.TELEPORT)) { sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.2")); return true; } @@ -131,7 +131,7 @@ public class PtpCommand implements TabExecutor { } long recentlyHurt = mcMMOPlayer.getRecentlyHurt(); - int hurtCooldown = Config.getInstance().getPTPCommandRecentlyHurtCooldown(); + int hurtCooldown = MainConfig.getInstance().getPTPCommandRecentlyHurtCooldown(); if (hurtCooldown > 0) { int timeRemaining = SkillUtils.calculateTimeLeft(recentlyHurt * Misc.TIME_CONVERSION_FACTOR, hurtCooldown, player); @@ -151,7 +151,7 @@ public class PtpCommand implements TabExecutor { return true; } - int ptpCooldown = Config.getInstance().getPTPCommandCooldown(); + int ptpCooldown = MainConfig.getInstance().getPTPCommandCooldown(); long ptpLastUse = mcMMOPlayer.getPartyTeleportRecord().getLastUse(); if (ptpCooldown > 0) { @@ -216,6 +216,6 @@ public class PtpCommand implements TabExecutor { player.sendMessage(LocaleLoader.getString("Commands.Invite.Success")); target.sendMessage(LocaleLoader.getString("Commands.ptp.Request1", player.getName())); - target.sendMessage(LocaleLoader.getString("Commands.ptp.Request2", Config.getInstance().getPTPCommandTimeout())); + target.sendMessage(LocaleLoader.getString("Commands.ptp.Request2", MainConfig.getInstance().getPTPCommandTimeout())); } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java index e73fb7e76..0b5b19c67 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.player; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; @@ -40,10 +40,10 @@ public class InspectCommand implements TabExecutor { return true; } - if (Config.getInstance().getScoreboardsEnabled() && sender instanceof Player && Config.getInstance().getInspectUseBoard()) { + if (MainConfig.getInstance().getScoreboardsEnabled() && sender instanceof Player && MainConfig.getInstance().getInspectUseBoard()) { ScoreboardManager.enablePlayerInspectScoreboard((Player) sender, profile); - if (!Config.getInstance().getInspectUseChat()) { + if (!MainConfig.getInstance().getInspectUseChat()) { return true; } } @@ -77,10 +77,10 @@ public class InspectCommand implements TabExecutor { return true; } - if (Config.getInstance().getScoreboardsEnabled() && sender instanceof Player && Config.getInstance().getInspectUseBoard()) { + if (MainConfig.getInstance().getScoreboardsEnabled() && sender instanceof Player && MainConfig.getInstance().getInspectUseBoard()) { ScoreboardManager.enablePlayerInspectScoreboard((Player) sender, mcMMOPlayer.getProfile()); - if (!Config.getInstance().getInspectUseChat()) { + if (!MainConfig.getInstance().getInspectUseChat()) { return true; } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java index 36fb59fe8..1a0a40c28 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.player; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; @@ -30,10 +30,10 @@ public class MccooldownCommand implements TabExecutor { case 0: Player player = (Player) sender; - if (Config.getInstance().getScoreboardsEnabled() && Config.getInstance().getCooldownUseBoard()) { + if (MainConfig.getInstance().getScoreboardsEnabled() && MainConfig.getInstance().getCooldownUseBoard()) { ScoreboardManager.enablePlayerCooldownScoreboard(player); - if (!Config.getInstance().getCooldownUseChat()) { + if (!MainConfig.getInstance().getCooldownUseChat()) { return true; } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java index d1b90bc41..6ea8190cc 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.player; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; @@ -87,7 +87,7 @@ public class McrankCommand implements TabExecutor { private void display(CommandSender sender, String playerName) { if (sender instanceof Player) { McMMOPlayer mcMMOPlayer = UserManager.getPlayer(sender.getName()); - long cooldownMillis = Math.max(Config.getInstance().getDatabasePlayerCooldown(), 1750); + long cooldownMillis = Math.max(MainConfig.getInstance().getDatabasePlayerCooldown(), 1750); if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) { sender.sendMessage(LocaleLoader.getString("Commands.Database.Cooldown")); @@ -104,8 +104,8 @@ public class McrankCommand implements TabExecutor { mcMMOPlayer.actualizeDatabaseATS(); } - boolean useBoard = Config.getInstance().getScoreboardsEnabled() && (sender instanceof Player) && (Config.getInstance().getRankUseBoard()); - boolean useChat = !useBoard || Config.getInstance().getRankUseChat(); + boolean useBoard = MainConfig.getInstance().getScoreboardsEnabled() && (sender instanceof Player) && (MainConfig.getInstance().getRankUseBoard()); + boolean useChat = !useBoard || MainConfig.getInstance().getRankUseChat(); new McrankCommandAsyncTask(playerName, sender, useBoard, useChat).runTaskAsynchronously(mcMMO.p); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java index 10e97ca9f..7c328f6f5 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.player; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.commands.CommandUtils; @@ -28,10 +28,10 @@ public class McstatsCommand implements TabExecutor { case 0: Player player = (Player) sender; - if (Config.getInstance().getStatsUseBoard() && Config.getInstance().getScoreboardsEnabled()) { + if (MainConfig.getInstance().getStatsUseBoard() && MainConfig.getInstance().getScoreboardsEnabled()) { ScoreboardManager.enablePlayerStatsScoreboard(player); - if (!Config.getInstance().getStatsUseChat()) { + if (!MainConfig.getInstance().getStatsUseChat()) { return true; } } @@ -43,7 +43,7 @@ public class McstatsCommand implements TabExecutor { CommandUtils.printCombatSkills(player); CommandUtils.printMiscSkills(player); - int powerLevelCap = Config.getInstance().getPowerLevelCap(); + int powerLevelCap = MainConfig.getInstance().getPowerLevelCap(); if (powerLevelCap != Integer.MAX_VALUE) { player.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Capped", UserManager.getPlayer(player).getPowerLevel(), powerLevelCap)); diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java index 6fb742aeb..ee472a34d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.player; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; @@ -87,7 +87,7 @@ public class MctopCommand implements TabExecutor { } McMMOPlayer mcMMOPlayer = UserManager.getPlayer(sender.getName()); - long cooldownMillis = Math.max(Config.getInstance().getDatabasePlayerCooldown(), 1750); + long cooldownMillis = Math.max(MainConfig.getInstance().getDatabasePlayerCooldown(), 1750); if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) { double seconds = ((mcMMOPlayer.getDatabaseATS() + cooldownMillis) - System.currentTimeMillis()) / 1000; @@ -113,8 +113,8 @@ public class MctopCommand implements TabExecutor { } private void display(int page, PrimarySkillType skill, CommandSender sender) { - boolean useBoard = (sender instanceof Player) && (Config.getInstance().getTopUseBoard()); - boolean useChat = !useBoard || Config.getInstance().getTopUseChat(); + boolean useBoard = (sender instanceof Player) && (MainConfig.getInstance().getTopUseBoard()); + boolean useChat = !useBoard || MainConfig.getInstance().getTopUseChat(); new MctopCommandAsyncTask(page, skill, sender, useBoard, useChat).runTaskAsynchronously(mcMMO.p); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java index 6df353563..d403f745d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands.skills; import com.gmail.nossr50.core.config.AdvancedConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; @@ -105,13 +105,13 @@ public abstract class SkillCommand implements TabExecutor { //Link Header - if (Config.getInstance().getUrlLinksEnabled()) { + if (MainConfig.getInstance().getUrlLinksEnabled()) { player.sendMessage(LocaleLoader.getString("Overhaul.mcMMO.Header")); TextComponentFactory.sendPlayerUrlHeader(player); } - if (Config.getInstance().getScoreboardsEnabled() && Config.getInstance().getSkillUseBoard()) { + if (MainConfig.getInstance().getScoreboardsEnabled() && MainConfig.getInstance().getSkillUseBoard()) { ScoreboardManager.enablePlayerSkillScoreboard(player, skill); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index fef7c1c28..034893984 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.listeners; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.config.ChunkConversionOptions; import com.gmail.nossr50.core.config.WorldBlacklist; import com.gmail.nossr50.core.data.UserManager; @@ -429,7 +429,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. */ - if (mcMMOPlayer.getAbilityMode(SuperAbilityType.TREE_FELLER) && BlockUtils.isLog(blockState) && Config.getInstance().getTreeFellerSoundsEnabled()) { + if (mcMMOPlayer.getAbilityMode(SuperAbilityType.TREE_FELLER) && BlockUtils.isLog(blockState) && MainConfig.getInstance().getTreeFellerSoundsEnabled()) { SoundManager.sendSound(player, blockState.getLocation(), SoundType.FIZZ); } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 9e4bb2e14..74890e59d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.listeners; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.AdvancedConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.config.WorldBlacklist; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.meta.OldName; @@ -208,7 +208,7 @@ public class EntityListener implements Listener { Player attackingPlayer = (Player) attacker; if (event.getDamage(DamageModifier.ABSORPTION) > 0) { //If friendly fire is off don't allow players to hurt one another - if (!Config.getInstance().getPartyFriendlyFire()) + if (!MainConfig.getInstance().getPartyFriendlyFire()) if ((PartyManager.inSameParty(defendingPlayer, attackingPlayer) || PartyManager.areAllies(defendingPlayer, attackingPlayer)) && !(Permissions.friendlyFire(attackingPlayer) && Permissions.friendlyFire(defendingPlayer))) { event.setCancelled(true); return; @@ -276,7 +276,7 @@ public class EntityListener implements Listener { } //Party Friendly Fire - if (!Config.getInstance().getPartyFriendlyFire()) + if (!MainConfig.getInstance().getPartyFriendlyFire()) if ((PartyManager.inSameParty(defendingPlayer, attackingPlayer) || PartyManager.areAllies(defendingPlayer, attackingPlayer)) && !(Permissions.friendlyFire(attackingPlayer) && Permissions.friendlyFire(defendingPlayer))) { event.setCancelled(true); return; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java index 02069c47a..8107b58b9 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.listeners; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.config.WorldBlacklist; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.runnables.player.PlayerUpdateInventoryTask; @@ -373,17 +373,17 @@ public class InventoryListener implements Listener { ItemStack item = event.getItem(); - if (Config.getInstance().getPreventHopperTransferIngredients() && item.getType() != Material.POTION && item.getType() != Material.SPLASH_POTION && item.getType() != Material.LINGERING_POTION) { + if (MainConfig.getInstance().getPreventHopperTransferIngredients() && item.getType() != Material.POTION && item.getType() != Material.SPLASH_POTION && item.getType() != Material.LINGERING_POTION) { event.setCancelled(true); return; } - if (Config.getInstance().getPreventHopperTransferBottles() && (item.getType() == Material.POTION || item.getType() == Material.SPLASH_POTION || item.getType() == Material.LINGERING_POTION)) { + if (MainConfig.getInstance().getPreventHopperTransferBottles() && (item.getType() == Material.POTION || item.getType() == Material.SPLASH_POTION || item.getType() == Material.LINGERING_POTION)) { event.setCancelled(true); return; } - if (Config.getInstance().getEnabledForHoppers() && AlchemyPotionBrewer.isValidIngredient(null, item)) { + if (MainConfig.getInstance().getEnabledForHoppers() && AlchemyPotionBrewer.isValidIngredient(null, item)) { AlchemyPotionBrewer.scheduleCheck(null, (BrewingStand) holder); } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 0677bfb44..78193bc40 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -4,7 +4,7 @@ import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.chat.ChatManager; import com.gmail.nossr50.core.chat.ChatManagerFactory; import com.gmail.nossr50.core.chat.PartyChatManager; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.config.WorldBlacklist; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; @@ -74,7 +74,7 @@ public class PlayerListener implements Listener { return; } - if (!UserManager.hasPlayerDataKey(player) || Config.getInstance().getXPAfterTeleportCooldown() <= 0 || event.getFrom().equals(event.getTo())) { + if (!UserManager.hasPlayerDataKey(player) || MainConfig.getInstance().getXPAfterTeleportCooldown() <= 0 || event.getFrom().equals(event.getTo())) { return; } @@ -251,7 +251,7 @@ public class PlayerListener implements Listener { //TODO Update to new API once available! Waiting for case CAUGHT_TREASURE: Item fishingCatch = (Item) event.getCaught(); - if (Config.getInstance().getFishingOverrideTreasures() && + if (MainConfig.getInstance().getFishingOverrideTreasures() && fishingCatch.getItemStack().getType() != Material.SALMON && fishingCatch.getItemStack().getType() != Material.COD && fishingCatch.getItemStack().getType() != Material.TROPICAL_FISH && @@ -397,7 +397,7 @@ public class PlayerListener implements Listener { /*if (player.getInventory().getItemInMainHand().getType() == Material.AIR) { Unarmed.handleItemPickup(player, event); - *//*boolean cancel = Config.getInstance().getUnarmedItemPickupDisabled() || pickupSuccess; + *//*boolean cancel = MainConfig.getInstance().getUnarmedItemPickupDisabled() || pickupSuccess; event.setCancelled(cancel); if (pickupSuccess) { @@ -448,7 +448,7 @@ public class PlayerListener implements Listener { new PlayerProfileLoadingTask(player).runTaskLaterAsynchronously(mcMMO.p, 1); // 1 Tick delay to ensure the player is marked as online before we begin loading - if (Config.getInstance().getMOTDEnabled() && Permissions.motd(player)) { + if (MainConfig.getInstance().getMOTDEnabled() && Permissions.motd(player)) { Motd.displayAll(player); } @@ -509,7 +509,7 @@ public class PlayerListener implements Listener { case RIGHT_CLICK_BLOCK: Material type = block.getType(); - if (!Config.getInstance().getAbilitiesOnlyActivateWhenSneaking() || player.isSneaking()) { + if (!MainConfig.getInstance().getAbilitiesOnlyActivateWhenSneaking() || player.isSneaking()) { /* REPAIR CHECKS */ if (type == Repair.anvilMaterial && PrimarySkillType.REPAIR.getPermissions(player) && mcMMO.getRepairableManager().isRepairable(heldItem)) { RepairManager repairManager = mcMMOPlayer.getRepairManager(); @@ -548,7 +548,7 @@ public class PlayerListener implements Listener { case LEFT_CLICK_BLOCK: type = block.getType(); - if (!Config.getInstance().getAbilitiesOnlyActivateWhenSneaking() || player.isSneaking()) { + if (!MainConfig.getInstance().getAbilitiesOnlyActivateWhenSneaking() || player.isSneaking()) { /* REPAIR CHECKS */ if (type == Repair.anvilMaterial && PrimarySkillType.REPAIR.getPermissions(player) && mcMMO.getRepairableManager().isRepairable(heldItem)) { RepairManager repairManager = mcMMOPlayer.getRepairManager(); @@ -615,7 +615,7 @@ public class PlayerListener implements Listener { /* ACTIVATION & ITEM CHECKS */ if (BlockUtils.canActivateTools(blockState)) { - if (Config.getInstance().getAbilitiesEnabled()) { + if (MainConfig.getInstance().getAbilitiesEnabled()) { if (BlockUtils.canActivateHerbalism(blockState)) { mcMMOPlayer.processAbilityActivation(PrimarySkillType.HERBALISM); } @@ -669,7 +669,7 @@ public class PlayerListener implements Listener { } /* ACTIVATION CHECKS */ - if (Config.getInstance().getAbilitiesEnabled()) { + if (MainConfig.getInstance().getAbilitiesEnabled()) { mcMMOPlayer.processAbilityActivation(PrimarySkillType.AXES); mcMMOPlayer.processAbilityActivation(PrimarySkillType.EXCAVATION); mcMMOPlayer.processAbilityActivation(PrimarySkillType.HERBALISM); @@ -701,11 +701,11 @@ public class PlayerListener implements Listener { Material type = heldItem.getType(); TamingManager tamingManager = mcMMOPlayer.getTamingManager(); - if (type == Config.getInstance().getTamingCOTWMaterial(EntityType.WOLF)) { + if (type == MainConfig.getInstance().getTamingCOTWMaterial(EntityType.WOLF)) { tamingManager.summonWolf(); - } else if (type == Config.getInstance().getTamingCOTWMaterial(EntityType.OCELOT)) { + } else if (type == MainConfig.getInstance().getTamingCOTWMaterial(EntityType.OCELOT)) { tamingManager.summonOcelot(); - } else if (type == Config.getInstance().getTamingCOTWMaterial(EntityType.HORSE)) { + } else if (type == MainConfig.getInstance().getTamingCOTWMaterial(EntityType.HORSE)) { tamingManager.summonHorse(); } @@ -767,7 +767,7 @@ public class PlayerListener implements Listener { */ @EventHandler(priority = EventPriority.LOWEST) public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) { - if (!Config.getInstance().getLocale().equalsIgnoreCase("en_US")) { + if (!MainConfig.getInstance().getLocale().equalsIgnoreCase("en_US")) { String message = event.getMessage(); String command = message.substring(1).split(" ")[0]; String lowerCaseCommand = command.toLowerCase(); diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java index bb83c1340..3552b0f19 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.listeners; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; @@ -38,27 +38,27 @@ public class SelfListener implements Listener { UserManager.getPlayer(player).processUnlockNotifications(plugin, event.getSkill(), previousLevelGained); } - if (Config.getInstance().getScoreboardsEnabled()) + if (MainConfig.getInstance().getScoreboardsEnabled()) ScoreboardManager.handleLevelUp(player, skill); - if (!Config.getInstance().getLevelUpEffectsEnabled()) { + if (!MainConfig.getInstance().getLevelUpEffectsEnabled()) { return; } - if ((event.getSkillLevel() % Config.getInstance().getLevelUpEffectsTier()) == 0) { + if ((event.getSkillLevel() % MainConfig.getInstance().getLevelUpEffectsTier()) == 0) { skill.celebrateLevelUp(player); } } @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerXp(McMMOPlayerXpGainEvent event) { - if (Config.getInstance().getScoreboardsEnabled()) + if (MainConfig.getInstance().getScoreboardsEnabled()) ScoreboardManager.handleXp(event.getPlayer(), event.getSkill()); } @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onAbility(McMMOPlayerAbilityActivateEvent event) { - if (Config.getInstance().getScoreboardsEnabled()) + if (MainConfig.getInstance().getScoreboardsEnabled()) ScoreboardManager.cooldownUpdate(event.getPlayer(), event.getSkill()); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java b/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java index f54d33698..256fad2b8 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java @@ -103,7 +103,7 @@ public class mcMMO extends JavaPlugin { /* Plugin Checks */ private static boolean healthBarPluginEnabled; private static boolean isRetroModeEnabled; - // Config Validation Check + // MainConfig Validation Check public boolean noErrorsInConfigFiles = true; // XP Event Check private boolean xpEventEnabled; @@ -206,7 +206,7 @@ public class mcMMO extends JavaPlugin { } //Store this value so other plugins can check it - isRetroModeEnabled = Config.getInstance().getIsRetroMode(); + isRetroModeEnabled = MainConfig.getInstance().getIsRetroMode(); if (getServer().getName().equals("Cauldron") || getServer().getName().equals("MCPC+")) { checkModConfigs(); @@ -243,7 +243,7 @@ public class mcMMO extends JavaPlugin { placeStore = ChunkManagerFactory.getChunkManager(); // Get our ChunkletManager - if (Config.getInstance().getPTPCommandWorldPermissions()) { + if (MainConfig.getInstance().getPTPCommandWorldPermissions()) { Permissions.generateWorldTeleportPermissions(); } @@ -254,11 +254,11 @@ public class mcMMO extends JavaPlugin { Metrics metrics; - if (Config.getInstance().getIsMetricsEnabled()) { + if (MainConfig.getInstance().getIsMetricsEnabled()) { metrics = new Metrics(this); metrics.addCustomChart(new Metrics.SimplePie("version", () -> getDescription().getVersion())); - if (Config.getInstance().getIsRetroMode()) + if (MainConfig.getInstance().getIsRetroMode()) metrics.addCustomChart(new Metrics.SimplePie("scaling", () -> "Standard")); else metrics.addCustomChart(new Metrics.SimplePie("scaling", () -> "Retro")); @@ -297,7 +297,7 @@ public class mcMMO extends JavaPlugin { PartyManager.saveParties(); // Save our parties //TODO: Needed? - if (Config.getInstance().getScoreboardsEnabled()) + if (MainConfig.getInstance().getScoreboardsEnabled()) ScoreboardManager.teardownAll(); formulaManager.saveFormula(); @@ -313,7 +313,7 @@ public class mcMMO extends JavaPlugin { debug("Unregister all events..."); HandlerList.unregisterAll(this); // Cancel event registrations - if (Config.getInstance().getBackupsEnabled()) { + if (MainConfig.getInstance().getBackupsEnabled()) { // Remove other tasks BEFORE starting the Backup, or we just cancel it straight away. try { ZipLibrary.mcMMOBackup(); @@ -425,19 +425,19 @@ public class mcMMO extends JavaPlugin { List repairables = new ArrayList(); List salvageables = new ArrayList(); - if (Config.getInstance().getToolModsEnabled()) { + if (MainConfig.getInstance().getToolModsEnabled()) { new ToolConfigManager(this); } - if (Config.getInstance().getArmorModsEnabled()) { + if (MainConfig.getInstance().getArmorModsEnabled()) { new ArmorConfigManager(this); } - if (Config.getInstance().getBlockModsEnabled()) { + if (MainConfig.getInstance().getBlockModsEnabled()) { new BlockConfigManager(this); } - if (Config.getInstance().getEntityModsEnabled()) { + if (MainConfig.getInstance().getEntityModsEnabled()) { new EntityConfigManager(this); } @@ -487,7 +487,7 @@ public class mcMMO extends JavaPlugin { private void registerCustomRecipes() { getServer().getScheduler().scheduleSyncDelayedTask(this, () -> { - if (Config.getInstance().getChimaeraEnabled()) { + if (MainConfig.getInstance().getChimaeraEnabled()) { getServer().addRecipe(ChimaeraWing.getChimaeraWingRecipe()); } }, 40); @@ -495,7 +495,7 @@ public class mcMMO extends JavaPlugin { private void scheduleTasks() { // Periodic save timer (Saves every 10 minutes by default) - long saveIntervalTicks = Config.getInstance().getSaveInterval() * 1200; + long saveIntervalTicks = MainConfig.getInstance().getSaveInterval() * 1200; new SaveTimerTask().runTaskTimer(this, saveIntervalTicks, saveIntervalTicks); // Cleanup the backups folder @@ -505,7 +505,7 @@ public class mcMMO extends JavaPlugin { new BleedTimerTask().runTaskTimer(this, 1 * Misc.TICK_CONVERSION_FACTOR, 1 * (Misc.TICK_CONVERSION_FACTOR / 2)); // Old & Powerless User remover - long purgeIntervalTicks = Config.getInstance().getPurgeInterval() * 60L * 60L * Misc.TICK_CONVERSION_FACTOR; + long purgeIntervalTicks = MainConfig.getInstance().getPurgeInterval() * 60L * 60L * Misc.TICK_CONVERSION_FACTOR; if (purgeIntervalTicks == 0) { new UserPurgeTask().runTaskLaterAsynchronously(this, 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup. @@ -514,7 +514,7 @@ public class mcMMO extends JavaPlugin { } // Automatically remove old members from parties - long kickIntervalTicks = Config.getInstance().getAutoPartyKickInterval() * 60L * 60L * Misc.TICK_CONVERSION_FACTOR; + long kickIntervalTicks = MainConfig.getInstance().getAutoPartyKickInterval() * 60L * 60L * Misc.TICK_CONVERSION_FACTOR; if (kickIntervalTicks == 0) { new PartyAutoKickTask().runTaskLater(this, 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup. @@ -536,22 +536,22 @@ public class mcMMO extends JavaPlugin { } private void checkModConfigs() { - if (!Config.getInstance().getToolModsEnabled()) { + if (!MainConfig.getInstance().getToolModsEnabled()) { getLogger().warning("Cauldron implementation found, but the custom tool config for mcMMO is disabled!"); getLogger().info("To enable, set Mods.Tool_Mods_Enabled to TRUE in config.yml."); } - if (!Config.getInstance().getArmorModsEnabled()) { + if (!MainConfig.getInstance().getArmorModsEnabled()) { getLogger().warning("Cauldron implementation found, but the custom armor config for mcMMO is disabled!"); getLogger().info("To enable, set Mods.Armor_Mods_Enabled to TRUE in config.yml."); } - if (!Config.getInstance().getBlockModsEnabled()) { + if (!MainConfig.getInstance().getBlockModsEnabled()) { getLogger().warning("Cauldron implementation found, but the custom block config for mcMMO is disabled!"); getLogger().info("To enable, set Mods.Block_Mods_Enabled to TRUE in config.yml."); } - if (!Config.getInstance().getEntityModsEnabled()) { + if (!MainConfig.getInstance().getEntityModsEnabled()) { getLogger().warning("Cauldron implementation found, but the custom entity config for mcMMO is disabled!"); getLogger().info("To enable, set Mods.Entity_Mods_Enabled to TRUE in config.yml."); } diff --git a/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java b/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java index 0acce0851..6bbef0b37 100644 --- a/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java +++ b/core/src/main/java/com/gmail/nossr50/core/McmmoCore.java @@ -6,6 +6,7 @@ import com.gmail.nossr50.core.mcmmo.plugin.Plugin; import com.gmail.nossr50.core.mcmmo.server.Server; import com.gmail.nossr50.core.mcmmo.tasks.TaskScheduler; import com.gmail.nossr50.core.platform.Platform; +import com.gmail.nossr50.core.util.ModManager; import com.gmail.nossr50.core.util.experience.FormulaManager; import com.gmail.nossr50.core.util.upgrade.UpgradeManager; @@ -22,8 +23,9 @@ public class McmmoCore { //Why do all these things need to be here? Sigh... private static DatabaseManager databaseManager; - private static UpgradeManager upgradeManager; + private static UpgradeManager upgradeManager; //TODO: I can't even remember what this one did private static FormulaManager formulaManager; + private static ModManager modManager; //TODO: Probably need to rewrite this /** * Returns our Logger @@ -64,4 +66,8 @@ public class McmmoCore { public static FormulaManager getFormulaManager() { return formulaManager; } public static boolean isRetroModeEnabled() { return retroModeEnabled; } + + public static ModManager getModManager() { return modManager; } + + public static String getModDataFolderPath() { return platform.getModDataFolderPath(); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java index 17aab077e..096bd4031 100644 --- a/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.api; import com.gmail.nossr50.core.api.exceptions.*; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.FormulaType; @@ -716,7 +716,7 @@ public final class ExperienceAPI { * @throws InvalidSkillException if the given skill is not valid */ public static int getLevelCap(String skillType) { - return Config.getInstance().getLevelCap(getSkillType(skillType)); + return MainConfig.getInstance().getLevelCap(getSkillType(skillType)); } /** @@ -727,7 +727,7 @@ public final class ExperienceAPI { * @return the overall power level cap */ public static int getPowerLevelCap() { - return Config.getInstance().getPowerLevelCap(); + return MainConfig.getInstance().getPowerLevelCap(); } /** diff --git a/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java index 5149bbe86..64d60d3d7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.api; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.party.Party; @@ -101,7 +101,7 @@ public final class PartyAPI { * @return the max party size on this server */ public static int getMaxPartySize() { - return Config.getInstance().getPartyMaxSize(); + return MainConfig.getInstance().getPartyMaxSize(); } /** diff --git a/core/src/main/java/com/gmail/nossr50/core/chat/AdminChatManager.java b/core/src/main/java/com/gmail/nossr50/core/chat/AdminChatManager.java index a206363e8..928a5a906 100644 --- a/core/src/main/java/com/gmail/nossr50/core/chat/AdminChatManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/chat/AdminChatManager.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.core.chat; import com.gmail.nossr50.core.McmmoCore; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.events.chat.McMMOAdminChatEvent; public class AdminChatManager extends ChatManager { protected AdminChatManager() { - super(Config.getInstance().getAdminDisplayNames(), Config.getInstance().getAdminChatPrefix()); + super(MainConfig.getInstance().getAdminDisplayNames(), MainConfig.getInstance().getAdminChatPrefix()); } @Override diff --git a/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java b/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java index 0c82e9128..4e85dab1c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.chat; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.runnables.party.PartyChatTask; import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; @@ -10,7 +10,7 @@ public class PartyChatManager extends ChatManager { private Party party; protected PartyChatManager(Plugin plugin) { - super(plugin, Config.getInstance().getPartyDisplayNames(), Config.getInstance().getPartyChatPrefix()); + super(plugin, MainConfig.getInstance().getPartyDisplayNames(), MainConfig.getInstance().getPartyChatPrefix()); } public void setParty(Party party) { diff --git a/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java index 0b9f4023c..c6cc31424 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java @@ -5,13 +5,12 @@ import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.mcmmo.colors.ChatColor; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; -import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; import java.util.ArrayList; import java.util.List; //@ConfigSerializable -public class AdvancedConfig extends ConfigurableLoader { +public class AdvancedConfig extends ConfigValidated { public static final String SKILLS = "Skills"; public static final String GENERAL = "General"; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/Config.java b/core/src/main/java/com/gmail/nossr50/core/config/Config.java index dc507b270..54f61a067 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/Config.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/Config.java @@ -1,1032 +1,302 @@ package com.gmail.nossr50.core.config; import com.gmail.nossr50.core.McmmoCore; -import com.gmail.nossr50.core.data.database.SQLDatabaseManager; -import com.gmail.nossr50.core.datatypes.party.PartyFeature; -import com.gmail.nossr50.core.skills.MobHealthbarType; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.util.StringUtils; +import com.google.common.io.Files; +import ninja.leaping.configurate.ConfigurationNode; +import ninja.leaping.configurate.commented.CommentedConfigurationNode; +import ninja.leaping.configurate.loader.ConfigurationLoader; +import ninja.leaping.configurate.yaml.YAMLConfigurationLoader; +import org.yaml.snakeyaml.DumperOptions; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; -public class Config extends ConfigurableLoader { - private static Config instance; +/** + * Handles loading and cacheing configuration settings from a configurable compatible config file + */ +//@ConfigSerializable +public abstract class Config implements VersionedConfig, Unload { - private Config() { - super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "config.yml"); - validate(); + /* PATH VARS */ + + public final File DIRECTORY_DATA_FOLDER; //Directory that the file is in + public final String FILE_RELATIVE_PATH; //Relative Path to the file + protected final String DIRECTORY_DEFAULTS = "defaults"; + + /* LOADERS */ + + private YAMLConfigurationLoader defaultCopyLoader; + private YAMLConfigurationLoader userCopyLoader; + + /* CONFIG FILES */ + + private File resourceConfigCopy; //Copy of the default config from the JAR (file is copied so that admins can easily compare to defaults) + private File resourceUserCopy; //File in the /$MCMMO_ROOT/mcMMO/ directory that may contain user edited settings + + /* ROOT NODES */ + + private ConfigurationNode userRootNode = null; + private ConfigurationNode defaultRootNode = null; + + /* CONFIG MANAGER */ + private ConfigurationLoader configManager; + + public Config(String pathToParentFolder, String relativePath) { + //TODO: Check if this works... + this(new File(pathToParentFolder), relativePath); + System.out.println("mcMMO Debug: Don't forget to check if loading config file by string instead of File works..."); } - public static Config getInstance() { - if (instance == null) { - instance = new Config(); - } - - return instance; - } - - @Override - protected void loadKeys() { - - } - - @Override - protected boolean validateKeys() { - // Validate all the settings! - List reason = new ArrayList(); - - /* General Settings */ - if (getSaveInterval() <= 0) { - reason.add("General.Save_Interval should be greater than 0!"); - } - - /* MySQL Settings */ - for (SQLDatabaseManager.PoolIdentifier identifier : SQLDatabaseManager.PoolIdentifier.values()) { - if (getMySQLMaxConnections(identifier) <= 0) { - reason.add("MySQL.Database.MaxConnections." + StringUtils.getCapitalized(identifier.toString()) + " should be greater than 0!"); - } - if (getMySQLMaxPoolSize(identifier) <= 0) { - reason.add("MySQL.Database.MaxPoolSize." + StringUtils.getCapitalized(identifier.toString()) + " should be greater than 0!"); - } - } - - /* Mob Healthbar */ - if (getMobHealthbarTime() == 0) { - reason.add("Mob_Healthbar.Display_Time cannot be 0! Set to -1 to disable or set a valid value."); - } - - /* Scoreboards */ - /*if (getRankScoreboardTime() != -1 && getRankScoreboardTime() <= 0) { - reason.add("Scoreboard.Types.Rank.Display_Time should be greater than 0, or -1!"); - } - - if (getStatsScoreboardTime() != -1 && getStatsScoreboardTime() <= 0) { - reason.add("Scoreboard.Types.Stats.Display_Time should be greater than 0, or -1!"); - } - - if (getTopScoreboardTime() != -1 && getTopScoreboardTime() <= 0) { - reason.add("Scoreboard.Types.Top.Display_Time should be greater than 0, or -1!"); - } - - if (getInspectScoreboardTime() != -1 && getInspectScoreboardTime() <= 0) { - reason.add("Scoreboard.Types.Inspect.Display_Time should be greater than 0, or -1!"); - } - - if (getSkillScoreboardTime() != -1 && getSkillScoreboardTime() <= 0) { - reason.add("Scoreboard.Types.Skill.Display_Time should be greater than 0, or -1!"); - } - - if (getSkillLevelUpTime() != -1 && getSkillScoreboardTime() <= 0) { - reason.add("Scoreboard.Types.Skill.Display_Time should be greater than 0, or -1!"); - } - - if (!(getRankUseChat() || getRankUseBoard())) { - reason.add("Either Board or Print in Scoreboard.Types.Rank must be true!"); - } - - if (!(getTopUseChat() || getTopUseBoard())) { - reason.add("Either Board or Print in Scoreboard.Types.Top must be true!"); - } - - if (!(getStatsUseChat() || getStatsUseBoard())) { - reason.add("Either Board or Print in Scoreboard.Types.Stats must be true!"); - } - - if (!(getInspectUseChat() || getInspectUseBoard())) { - reason.add("Either Board or Print in Scoreboard.Types.Inspect must be true!"); - }*/ - - /* Database Purging */ - if (getPurgeInterval() < -1) { - reason.add("Database_Purging.Purge_Interval should be greater than, or equal to -1!"); - } - - if (getOldUsersCutoff() != -1 && getOldUsersCutoff() <= 0) { - reason.add("Database_Purging.Old_User_Cutoff should be greater than 0 or -1!"); - } - - /* Hardcore Mode */ - if (getHardcoreDeathStatPenaltyPercentage() < 0.01 || getHardcoreDeathStatPenaltyPercentage() > 100) { - reason.add("Hardcore.Death_Stat_Loss.Penalty_Percentage only accepts values from 0.01 to 100!"); - } - - if (getHardcoreVampirismStatLeechPercentage() < 0.01 || getHardcoreVampirismStatLeechPercentage() > 100) { - reason.add("Hardcore.Vampirism.Leech_Percentage only accepts values from 0.01 to 100!"); - } - - /* Items */ - if (getChimaeraUseCost() < 1 || getChimaeraUseCost() > 64) { - reason.add("Items.Chimaera_Wing.Use_Cost only accepts values from 1 to 64!"); - } - - if (getChimaeraRecipeCost() < 1 || getChimaeraRecipeCost() > 9) { - reason.add("Items.Chimaera_Wing.Recipe_Cost only accepts values from 1 to 9!"); - } - - if (getChimaeraItem() == null) { - reason.add("Items.Chimaera_Wing.Item_Name is invalid!"); - } - - /* Particles */ - if (getLevelUpEffectsTier() < 1) { - reason.add("Particles.LevelUp_Tier should be at least 1!"); - } - - /* PARTY SETTINGS */ - if (getAutoPartyKickInterval() < -1) { - reason.add("Party.AutoKick_Interval should be at least -1!"); - } - - if (getAutoPartyKickTime() < 0) { - reason.add("Party.Old_Party_Member_Cutoff should be at least 0!"); - } - - if (getPartyShareBonusBase() <= 0) { - reason.add("Party.Sharing.ExpShare_bonus_base should be greater than 0!"); - } - - if (getPartyShareBonusIncrease() < 0) { - reason.add("Party.Sharing.ExpShare_bonus_increase should be at least 0!"); - } - - if (getPartyShareBonusCap() <= 0) { - reason.add("Party.Sharing.ExpShare_bonus_cap should be greater than 0!"); - } - - if (getPartyShareRange() <= 0) { - reason.add("Party.Sharing.Range should be greater than 0!"); - } - - if (getPartyXpCurveMultiplier() < 1) { - reason.add("Party.Leveling.Xp_Curve_Modifier should be at least 1!"); - } - - for (PartyFeature partyFeature : PartyFeature.values()) { - if (getPartyFeatureUnlockLevel(partyFeature) < 0) { - reason.add("Party.Leveling." + StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + "_UnlockLevel should be at least 0!"); - } - } - - /* Inspect command distance */ - if (getInspectDistance() <= 0) { - reason.add("Commands.inspect.Max_Distance should be greater than 0!"); - } - - if (getTreeFellerThreshold() <= 0) { - reason.add("Abilities.Limits.Tree_Feller_Threshold should be greater than 0!"); - } - - if (getFishingLureModifier() < 0) { - reason.add("Abilities.Fishing.Lure_Modifier should be at least 0!"); - } - - if (getDetonatorItem() == null) { - reason.add("Skills.Mining.Detonator_Item is invalid!"); - } - - if (getRepairAnvilMaterial() == null) { - reason.add("Skills.Repair.Anvil_Type is invalid!!"); - } - - if (getSalvageAnvilMaterial() == null) { - reason.add("Skills.Repair.Salvage_Anvil_Type is invalid!"); - } - - if (getRepairAnvilMaterial() == getSalvageAnvilMaterial()) { - reason.add("Cannot use the same item for Repair and Salvage anvils!"); - } - - if (getTamingCOTWMaterial(EntityType.WOLF) == null) { - reason.add("Skills.Taming.Call_Of_The_Wild.Wolf.Item_Material is invalid!!"); - } - - if (getTamingCOTWMaterial(EntityType.OCELOT) == null) { - reason.add("Skills.Taming.Call_Of_The_Wild.Ocelot.Item_Material is invalid!!"); - } - - if (getTamingCOTWMaterial(EntityType.HORSE) == null) { - reason.add("Skills.Taming.Call_Of_The_Wild.Horse.Item_Material is invalid!!"); - } - - if (getTamingCOTWCost(EntityType.WOLF) <= 0) { - reason.add("Skills.Taming.Call_Of_The_Wild.Wolf.Item_Amount should be greater than 0!"); - } - - if (getTamingCOTWCost(EntityType.OCELOT) <= 0) { - reason.add("Skills.Taming.Call_Of_The_Wild.Ocelot.Item_Amount should be greater than 0!"); - } - - if (getTamingCOTWCost(EntityType.HORSE) <= 0) { - reason.add("Skills.Taming.Call_Of_The_Wild.Horse.Item_Amount should be greater than 0!"); - } - - if (getTamingCOTWAmount(EntityType.WOLF) <= 0) { - reason.add("Skills.Taming.Call_Of_The_Wild.Wolf.Summon_Amount should be greater than 0!"); - } - - if (getTamingCOTWAmount(EntityType.OCELOT) <= 0) { - reason.add("Skills.Taming.Call_Of_The_Wild.Ocelot.Summon_Amount should be greater than 0!"); - } - - if (getTamingCOTWAmount(EntityType.HORSE) <= 0) { - reason.add("Skills.Taming.Call_Of_The_Wild.Horse.Summon_Amount should be greater than 0!"); - } - - return noErrorsInConfig(reason); - } - - /* - * GENERAL SETTINGS - */ - - /* General Settings */ - public boolean getIsMetricsEnabled() { - return config.getBoolean("Metrics.bstats", true); - } - - //Retro mode will default the value to true if the config file doesn't contain the entry (server is from a previous mcMMO install) - public boolean getIsRetroMode() { - return config.getBoolean("General.RetroMode.Enabled", true); - } - - public String getLocale() { - return config.getString("General.Locale", "en_us"); - } - - public boolean getMOTDEnabled() { - return config.getBoolean("General.MOTD_Enabled", true); - } - - public boolean getShowProfileLoadedMessage() { - return config.getBoolean("General.Show_Profile_Loaded", true); - } - - public boolean getDonateMessageEnabled() { - return config.getBoolean("Commands.mcmmo.Donate_Message", true); - } - - public int getSaveInterval() { - return config.getInt("General.Save_Interval", 10); - } - - public boolean getStatsTrackingEnabled() { - return config.getBoolean("General.Stats_Tracking", true); - } - - public boolean getUpdateCheckEnabled() { - return config.getBoolean("General.Update_Check", true); - } - - public boolean getPreferBeta() { - return config.getBoolean("General.Prefer_Beta", false); - } - - public boolean getVerboseLoggingEnabled() { - return config.getBoolean("General.Verbose_Logging", false); - } - - public String getPartyChatPrefix() { - return config.getString("Commands.partychat.Chat_Prefix_Format", "[[GREEN]]([[WHITE]]{0}[[GREEN]])"); - } - - public boolean getPartyChatColorLeaderName() { - return config.getBoolean("Commands.partychat.Gold_Leader_Name", true); - } - - public boolean getPartyDisplayNames() { - return config.getBoolean("Commands.partychat.Use_Display_Names", true); - } - - public String getPartyChatPrefixAlly() { - return config.getString("Commands.partychat.Chat_Prefix_Format_Ally", "[[GREEN]](A)[[RESET]]"); - } - - public String getAdminChatPrefix() { - return config.getString("Commands.adminchat.Chat_Prefix_Format", "[[AQUA]][[[WHITE]]{0}[[AQUA]]]"); - } - - public boolean getAdminDisplayNames() { - return config.getBoolean("Commands.adminchat.Use_Display_Names", true); - } - - public boolean getMatchOfflinePlayers() { - return config.getBoolean("Commands.Generic.Match_OfflinePlayers", false); - } - - public long getDatabasePlayerCooldown() { - return config.getLong("Commands.Database.Player_Cooldown", 1750); - } - - public boolean getLevelUpSoundsEnabled() { - return config.getBoolean("General.LevelUp_Sounds", true); - } - - public boolean getRefreshChunksEnabled() { - return config.getBoolean("General.Refresh_Chunks", false); - } - - public boolean getMobHealthbarEnabled() { - return config.getBoolean("Mob_Healthbar.Enabled", true); - } - - /* Mob Healthbar */ - public MobHealthbarType getMobHealthbarDefault() { + public Config(File pathToParentFolder, String relativePath) { + /* + * These must be at the top + */ + mkdirDefaults(); // Make our default config dir + DIRECTORY_DATA_FOLDER = pathToParentFolder; //Data Folder for our plugin + FILE_RELATIVE_PATH = relativePath; //Relative path to config from a parent folder + + //Attempt IO Operations try { - return MobHealthbarType.valueOf(config.getString("Mob_Healthbar.Display_Type", "HEARTS").toUpperCase().trim()); - } catch (IllegalArgumentException ex) { - return MobHealthbarType.HEARTS; - } - } + //Makes sure we have valid Files corresponding to this config + initConfigFiles(); - public int getMobHealthbarTime() { - return config.getInt("Mob_Healthbar.Display_Time", 3); - } + //Init MainConfig Loaders + initConfigLoaders(); - /* Scoreboards */ - public boolean getScoreboardsEnabled() { - return config.getBoolean("Scoreboard.UseScoreboards", true); - } + //Load MainConfig Nodes + loadConfig(); - public boolean getPowerLevelTagsEnabled() { - return config.getBoolean("Scoreboard.Power_Level_Tags", false); - } - - public boolean getAllowKeepBoard() { - return config.getBoolean("Scoreboard.Allow_Keep", true); - } - - public int getTipsAmount() { - return config.getInt("Scoreboard.Tips_Amount", 5); - } - - public boolean getShowStatsAfterLogin() { - return config.getBoolean("Scoreboard.Show_Stats_After_Login", false); - } - - public boolean getScoreboardRainbows() { - return config.getBoolean("Scoreboard.Rainbows", false); - } - - public boolean getShowAbilityNames() { - return config.getBoolean("Scoreboard.Ability_Names", true); - } - - public boolean getRankUseChat() { - return config.getBoolean("Scoreboard.Types.Rank.Print", false); - } - - public boolean getRankUseBoard() { - return config.getBoolean("Scoreboard.Types.Rank.Board", true); - } - - public int getRankScoreboardTime() { - return config.getInt("Scoreboard.Types.Rank.Display_Time", 10); - } - - public boolean getTopUseChat() { - return config.getBoolean("Scoreboard.Types.Top.Print", true); - } - - public boolean getTopUseBoard() { - return config.getBoolean("Scoreboard.Types.Top.Board", true); - } - - public int getTopScoreboardTime() { - return config.getInt("Scoreboard.Types.Top.Display_Time", 15); - } - - public boolean getStatsUseChat() { - return config.getBoolean("Scoreboard.Types.Stats.Print", true); - } - - public boolean getStatsUseBoard() { - return config.getBoolean("Scoreboard.Types.Stats.Board", true); - } - - public int getStatsScoreboardTime() { - return config.getInt("Scoreboard.Types.Stats.Display_Time", 10); - } - - public boolean getInspectUseChat() { - return config.getBoolean("Scoreboard.Types.Inspect.Print", true); - } - - public boolean getInspectUseBoard() { - return config.getBoolean("Scoreboard.Types.Inspect.Board", true); - } - - public int getInspectScoreboardTime() { - return config.getInt("Scoreboard.Types.Inspect.Display_Time", 25); - } - - public boolean getCooldownUseChat() { - return config.getBoolean("Scoreboard.Types.Cooldown.Print", false); - } - - public boolean getCooldownUseBoard() { - return config.getBoolean("Scoreboard.Types.Cooldown.Board", true); - } - - public int getCooldownScoreboardTime() { - return config.getInt("Scoreboard.Types.Cooldown.Display_Time", 41); - } - - public boolean getSkillUseBoard() { - return config.getBoolean("Scoreboard.Types.Skill.Board", true); - } - - public int getSkillScoreboardTime() { - return config.getInt("Scoreboard.Types.Skill.Display_Time", 30); - } - - public boolean getSkillLevelUpBoard() { - return config.getBoolean("Scoreboard.Types.Skill.LevelUp_Board", true); - } - - public int getSkillLevelUpTime() { - return config.getInt("Scoreboard.Types.Skill.LevelUp_Time", 5); - } - - /* Database Purging */ - public int getPurgeInterval() { - return config.getInt("Database_Purging.Purge_Interval", -1); - } - - public int getOldUsersCutoff() { - return config.getInt("Database_Purging.Old_User_Cutoff", 6); - } - - /* Backups */ - public boolean getBackupsEnabled() { - return config.getBoolean("Backups.Enabled", true); - } - - public boolean getKeepLast24Hours() { - return config.getBoolean("Backups.Keep.Last_24_Hours", true); - } - - public boolean getKeepDailyLastWeek() { - return config.getBoolean("Backups.Keep.Daily_Last_Week", true); - } - - public boolean getKeepWeeklyPastMonth() { - return config.getBoolean("Backups.Keep.Weekly_Past_Months", true); - } - - /* mySQL */ - public boolean getUseMySQL() { - return config.getBoolean("MySQL.Enabled", false); - } - - public String getMySQLTablePrefix() { - return config.getString("MySQL.Database.TablePrefix", "mcmmo_"); - } - - public String getMySQLDatabaseName() { - return getStringIncludingInts("MySQL.Database.Name"); - } - - public String getMySQLUserName() { - return getStringIncludingInts("MySQL.Database.User_Name"); - } - - public int getMySQLServerPort() { - return config.getInt("MySQL.Server.Port", 3306); - } - - public String getMySQLServerName() { - return config.getString("MySQL.Server.Address", "localhost"); - } - - public String getMySQLUserPassword() { - return getStringIncludingInts("MySQL.Database.User_Password"); - } - - public int getMySQLMaxConnections(SQLDatabaseManager.PoolIdentifier identifier) { - return config.getInt("MySQL.Database.MaxConnections." + StringUtils.getCapitalized(identifier.toString()), 30); - } - - public int getMySQLMaxPoolSize(SQLDatabaseManager.PoolIdentifier identifier) { - return config.getInt("MySQL.Database.MaxPoolSize." + StringUtils.getCapitalized(identifier.toString()), 10); - } - - public boolean getMySQLSSL() { - return config.getBoolean("MySQL.Server.SSL", true); - } - - private String getStringIncludingInts(String key) { - String str = config.getString(key); - - if (str == null) { - str = String.valueOf(config.getInt(key)); + //Attempt to update user file, and then load it into memory + readConfig(); + } catch (IOException e) { + e.printStackTrace(); } - if (str.equals("0")) { - str = "No value set for '" + key + "'"; - } - return str; + } - /* Hardcore Mode */ - public boolean getHardcoreStatLossEnabled(PrimarySkillType primarySkillType) { - return config.getBoolean("Hardcore.Death_Stat_Loss.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), false); - } - - public void setHardcoreStatLossEnabled(PrimarySkillType primarySkillType, boolean enabled) { - config.set("Hardcore.Death_Stat_Loss.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), enabled); - } - - public double getHardcoreDeathStatPenaltyPercentage() { - return config.getDouble("Hardcore.Death_Stat_Loss.Penalty_Percentage", 75.0D); - } - - public void setHardcoreDeathStatPenaltyPercentage(double value) { - config.set("Hardcore.Death_Stat_Loss.Penalty_Percentage", value); - } - - public int getHardcoreDeathStatPenaltyLevelThreshold() { - return config.getInt("Hardcore.Death_Stat_Loss.Level_Threshold", 0); - } - - public boolean getHardcoreVampirismEnabled(PrimarySkillType primarySkillType) { - return config.getBoolean("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), false); - } - - public void setHardcoreVampirismEnabled(PrimarySkillType primarySkillType, boolean enabled) { - config.set("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), enabled); - } - - public double getHardcoreVampirismStatLeechPercentage() { - return config.getDouble("Hardcore.Vampirism.Leech_Percentage", 5.0D); - } - - public void setHardcoreVampirismStatLeechPercentage(double value) { - config.set("Hardcore.Vampirism.Leech_Percentage", value); - } - - public int getHardcoreVampirismLevelThreshold() { - return config.getInt("Hardcore.Vampirism.Level_Threshold", 0); - } - - /* SMP Mods */ - public boolean getToolModsEnabled() { - return config.getBoolean("Mods.Tool_Mods_Enabled", false); - } - - public boolean getArmorModsEnabled() { - return config.getBoolean("Mods.Armor_Mods_Enabled", false); - } - - public boolean getBlockModsEnabled() { - return config.getBoolean("Mods.Block_Mods_Enabled", false); - } - - public boolean getEntityModsEnabled() { - return config.getBoolean("Mods.Entity_Mods_Enabled", false); - } - - /* Items */ - public int getChimaeraUseCost() { - return config.getInt("Items.Chimaera_Wing.Use_Cost", 1); - } - - public int getChimaeraRecipeCost() { - return config.getInt("Items.Chimaera_Wing.Recipe_Cost", 5); - } - - public Material getChimaeraItem() { - return Material.matchMaterial(config.getString("Items.Chimaera_Wing.Item_Name", "Feather")); - } - - public boolean getChimaeraEnabled() { - return config.getBoolean("Items.Chimaera_Wing.Enabled", true); - } - - public boolean getChimaeraPreventUseUnderground() { - return config.getBoolean("Items.Chimaera_Wing.Prevent_Use_Underground", true); - } - - public boolean getChimaeraUseBedSpawn() { - return config.getBoolean("Items.Chimaera_Wing.Use_Bed_Spawn", true); - } - - public int getChimaeraCooldown() { - return config.getInt("Items.Chimaera_Wing.Cooldown", 240); - } - - public int getChimaeraWarmup() { - return config.getInt("Items.Chimaera_Wing.Warmup", 5); - } - - public int getChimaeraRecentlyHurtCooldown() { - return config.getInt("Items.Chimaera_Wing.RecentlyHurt_Cooldown", 60); - } - - public boolean getChimaeraSoundEnabled() { - return config.getBoolean("Items.Chimaera_Wing.Sound_Enabled", true); - } - - public boolean getFluxPickaxeSoundEnabled() { - return config.getBoolean("Items.Flux_Pickaxe.Sound_Enabled", true); - } - - /* Particles */ - public boolean getAbilityActivationEffectEnabled() { - return config.getBoolean("Particles.Ability_Activation", true); - } - - public boolean getAbilityDeactivationEffectEnabled() { - return config.getBoolean("Particles.Ability_Deactivation", true); - } - - public boolean getBleedEffectEnabled() { - return config.getBoolean("Particles.Bleed", true); - } - - public boolean getDodgeEffectEnabled() { - return config.getBoolean("Particles.Dodge", true); - } - - public boolean getFluxEffectEnabled() { - return config.getBoolean("Particles.Flux", true); - } - - public boolean getGreaterImpactEffectEnabled() { - return config.getBoolean("Particles.Greater_Impact", true); - } - - public boolean getCallOfTheWildEffectEnabled() { - return config.getBoolean("Particles.Call_of_the_Wild", true); - } - - public boolean getLevelUpEffectsEnabled() { - return config.getBoolean("Particles.LevelUp_Enabled", true); - } - - public int getLevelUpEffectsTier() { - return config.getInt("Particles.LevelUp_Tier", 100); - } - - public boolean getLargeFireworks() { - return config.getBoolean("Particles.LargeFireworks", true); - } - - /* PARTY SETTINGS */ - public boolean getPartyFriendlyFire() { - return config.getBoolean("Party.FriendlyFire", false); - } - - public int getPartyMaxSize() { - return config.getInt("Party.MaxSize", -1); - } - - public int getAutoPartyKickInterval() { - return config.getInt("Party.AutoKick_Interval", 12); - } - - public int getAutoPartyKickTime() { - return config.getInt("Party.Old_Party_Member_Cutoff", 7); - } - - public double getPartyShareBonusBase() { - return config.getDouble("Party.Sharing.ExpShare_bonus_base", 1.1D); - } - - public double getPartyShareBonusIncrease() { - return config.getDouble("Party.Sharing.ExpShare_bonus_increase", 0.05D); - } - - public double getPartyShareBonusCap() { - return config.getDouble("Party.Sharing.ExpShare_bonus_cap", 1.5D); - } - - public double getPartyShareRange() { - return config.getDouble("Party.Sharing.Range", 75.0D); - } - - public int getPartyLevelCap() { - int cap = config.getInt("Party.Leveling.Level_Cap", 10); - return (cap <= 0) ? Integer.MAX_VALUE : cap; - } - - public int getPartyXpCurveMultiplier() { - return config.getInt("Party.Leveling.Xp_Curve_Modifier", 3); - } - - public boolean getPartyXpNearMembersNeeded() { - return config.getBoolean("Party.Leveling.Near_Members_Needed", false); - } - - public boolean getPartyInformAllMembers() { - return config.getBoolean("Party.Leveling.Inform_All_Party_Members_On_LevelUp", false); - } - - public int getPartyFeatureUnlockLevel(PartyFeature partyFeature) { - return config.getInt("Party.Leveling." + StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + "_UnlockLevel", 0); - } - - /* Party Teleport Settings */ - public int getPTPCommandCooldown() { - return config.getInt("Commands.ptp.Cooldown", 120); - } - - public int getPTPCommandWarmup() { - return config.getInt("Commands.ptp.Warmup", 5); - } - - public int getPTPCommandRecentlyHurtCooldown() { - return config.getInt("Commands.ptp.RecentlyHurt_Cooldown", 60); - } - - public int getPTPCommandTimeout() { - return config.getInt("Commands.ptp.Request_Timeout", 300); - } - - public boolean getPTPCommandConfirmRequired() { - return config.getBoolean("Commands.ptp.Accept_Required", true); - } - - public boolean getPTPCommandWorldPermissions() { - return config.getBoolean("Commands.ptp.World_Based_Permissions", false); - } - - /* Inspect command distance */ - public double getInspectDistance() { - return config.getDouble("Commands.inspect.Max_Distance", 30.0D); - } - - /* - * ABILITY SETTINGS + /** + * Initializes the default copy File and the user config File + * @throws IOException */ + private void initConfigFiles() throws IOException { + //Init our config copy + resourceConfigCopy = initDefaultConfig(); - /* General Settings */ - public boolean getUrlLinksEnabled() { - return config.getBoolean("Commands.Skills.URL_Links"); + //Init the user file + resourceUserCopy = initUserConfig(); } - public boolean getAbilityMessagesEnabled() { - return config.getBoolean("Abilities.Messages", true); - } - - public boolean getAbilitiesEnabled() { - return config.getBoolean("Abilities.Enabled", true); - } - - public boolean getAbilitiesOnlyActivateWhenSneaking() { - return config.getBoolean("Abilities.Activation.Only_Activate_When_Sneaking", false); - } - - public boolean getAbilitiesGateEnabled() { - return config.getBoolean("Abilities.Activation.Level_Gate_Abilities"); - } - - public int getCooldown(SuperAbilityType ability) { - return config.getInt("Abilities.Cooldowns." + ability.toString()); - } - - public int getMaxLength(SuperAbilityType ability) { - return config.getInt("Abilities.Max_Seconds." + ability.toString()); - } - - /* Durability Settings */ - public int getAbilityToolDamage() { - return config.getInt("Abilities.Tools.Durability_Loss", 1); - } - - /* Thresholds */ - public int getTreeFellerThreshold() { - return config.getInt("Abilities.Limits.Tree_Feller_Threshold", 500); - } - - /* - * SKILL SETTINGS + /** + * Loads the root node for the default config File and user config File */ - public boolean getDoubleDropsEnabled(PrimarySkillType skill, Material material) { - return config.getBoolean("Double_Drops." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); + private void loadConfig() + { + try { + final ConfigurationNode defaultConfig = this.defaultCopyLoader.load(); + defaultRootNode = defaultConfig; + + final ConfigurationNode userConfig = this.userCopyLoader.load(); + userRootNode = userConfig; + + } catch (IOException e) { + e.printStackTrace(); + } } - public boolean getDoubleDropsDisabled(PrimarySkillType skill) { - String skillName = StringUtils.getCapitalized(skill.toString()); - ConfigurationSection section = config.getConfigurationSection("Double_Drops." + skillName); - if (section == null) - return false; - Set keys = section.getKeys(false); - boolean disabled = true; + /** + * Initializes the YAMLConfigurationLoaders for this config + */ + private void initConfigLoaders() + { + this.defaultCopyLoader = YAMLConfigurationLoader.builder().setPath(resourceConfigCopy.toPath()).setFlowStyle(DumperOptions.FlowStyle.BLOCK).build(); + this.userCopyLoader = YAMLConfigurationLoader.builder().setPath(resourceUserCopy.toPath()).setFlowStyle(DumperOptions.FlowStyle.FLOW).build(); + } - for (String key : keys) { - if (config.getBoolean("Double_Drops." + skillName + "." + key)) { - disabled = false; - break; - } + /** + * Copies a new file from the JAR to the defaults directory and uses that new file to initialize our resourceConfigCopy + * @see Config#resourceConfigCopy + * @throws IOException + */ + private File initDefaultConfig() throws IOException { + return copyDefaultFromJar(getDefaultConfigCopyRelativePath(), true); + } + + /** + * Attemps to load the config file if it exists, if it doesn't it copies a new one from within the JAR + * @return user config File + * @see Config#resourceUserCopy + * @throws IOException + */ + private File initUserConfig() throws IOException { + File userCopy = new File(DIRECTORY_DATA_FOLDER, FILE_RELATIVE_PATH); //Load the user file; + + if(userCopy.exists()) + { + // Yay + return userCopy; + } + else + { + //If it's gone we copy default files + //Note that we don't copy the values from the default copy put in /defaults/ that file exists only as a reference to admins and is unreliable + return copyDefaultFromJar(FILE_RELATIVE_PATH, false); + } + } + + /** + * Used to make a new config file at a specified relative output path inside the data directory by copying the matching file found in that same relative path within the JAR + * @param relativeOutputPath the path to the output file + * @param deleteOld whether or not to delete the existing output file on disk + * @return a copy of the default config within the JAR + * @throws IOException + */ + private File copyDefaultFromJar(String relativeOutputPath, boolean deleteOld) throws IOException + { + /* + * Gen a Default config from inside the JAR + */ + McmmoCore.getLogger().info("Preparing to copy internal resource file (in JAR) - "+FILE_RELATIVE_PATH); + InputStream inputStream = McmmoCore.getResource(FILE_RELATIVE_PATH); + + byte[] buffer = new byte[inputStream.available()]; + inputStream.read(buffer); + + //This is a copy of the default file, which we will overwrite every time mcMMO loads + File targetFile = new File(DIRECTORY_DATA_FOLDER, relativeOutputPath); + + //Wipe old default file on disk + if (targetFile.exists() && deleteOld) + { + McmmoCore.getLogger().info("Updating file " + relativeOutputPath); + targetFile.delete(); //Necessary? } - return disabled; + if(!targetFile.exists()) + { + targetFile.getParentFile().mkdirs(); + targetFile.createNewFile(); //New File Boys + } + + Files.write(buffer, targetFile); + McmmoCore.getLogger().info("Created config file - " + relativeOutputPath); + + inputStream.close(); //Close the input stream + + return targetFile; } - /* Axes */ - public int getAxesGate() { - return config.getInt("Skills.Axes.Ability_Activation_Level_Gate", 10); + /** + * The path to the defaults directory + * @return the path to the defaults directory + */ + private String getDefaultConfigCopyRelativePath() { + return DIRECTORY_DEFAULTS + File.separator + FILE_RELATIVE_PATH; } - /* Acrobatics */ - public boolean getDodgeLightningDisabled() { - return config.getBoolean("Skills.Acrobatics.Prevent_Dodge_Lightning", false); + /** + * Creates the defaults directory + */ + private void mkdirDefaults() { + //Make Default Subdirectory + File defaultsDir = new File (DIRECTORY_DATA_FOLDER, "defaults"); + + if(!defaultsDir.exists()) + defaultsDir.mkdir(); } - public int getXPAfterTeleportCooldown() { - return config.getInt("Skills.Acrobatics.XP_After_Teleport_Cooldown", 5); + /** + * Configs are versioned based on when they had significant changes to keys + * @return current MainConfig Version String + */ + public String getVersion() + { + return String.valueOf(getConfigVersion()); } - /* Alchemy */ - public boolean getEnabledForHoppers() { - return config.getBoolean("Skills.Alchemy.Enabled_for_Hoppers", true); + /** + * Attempts to read the loaded config file + * MainConfig will have any necessary updates applied + * MainConfig will be compared to the default config to see if it is missing any nodes + * MainConfig will have any missing nodes inserted with their default value + */ + public void readConfig() { + McmmoCore.getLogger().info("Attempting to read " + FILE_RELATIVE_PATH + "."); + + int version = this.userRootNode.getNode("ConfigVersion").getInt(); + McmmoCore.getLogger().info(FILE_RELATIVE_PATH + " version is " + version); + + //Update our config + updateConfig(); } - public boolean getPreventHopperTransferIngredients() { - return config.getBoolean("Skills.Alchemy.Prevent_Hopper_Transfer_Ingredients", false); + /** + * Compares the users config file to the default and adds any missing nodes and applies any necessary updates + */ + private void updateConfig() + { + McmmoCore.getLogger().info(defaultRootNode.getChildrenMap().size() +" items in default children map"); + McmmoCore.getLogger().info(userRootNode.getChildrenMap().size() +" items in default root map"); + + // Merge Values from default + userRootNode = userRootNode.mergeValuesFrom(defaultRootNode); + + // Update config version + updateConfigVersion(); + + //Attempt to save + try { + saveUserCopy(); + } catch (IOException e) { + e.printStackTrace(); + } } - public boolean getPreventHopperTransferBottles() { - return config.getBoolean("Skills.Alchemy.Prevent_Hopper_Transfer_Bottles", false); + /** + * Saves the current state information of the config to the users copy (which they may edit) + * @throws IOException + */ + private void saveUserCopy() throws IOException + { + McmmoCore.getLogger().info("Saving new node"); + userCopyLoader.save(userRootNode); } - /* Fishing */ - public boolean getFishingDropsEnabled() { - return config.getBoolean("Skills.Fishing.Drops_Enabled", true); + /** + * Performs any necessary operations to update this config + */ + private void updateConfigVersion() { + // Set a version for our config + this.userRootNode.getNode("ConfigVersion").setValue(getConfigVersion()); + McmmoCore.getLogger().info("Updated config to ["+getConfigVersion()+"] - " + FILE_RELATIVE_PATH); } - public boolean getFishingOverrideTreasures() { - return config.getBoolean("Skills.Fishing.Override_Vanilla_Treasures", true); + /** + * Returns the root node of this config + * @return the root node of this config + */ + protected ConfigurationNode getUserRootNode() { + return userRootNode; } - public boolean getFishingExtraFish() { - return config.getBoolean("Skills.Fishing.Extra_Fish", true); + int getIntValue(String... path) + { + return userRootNode.getNode(path).getInt(); } - public double getFishingLureModifier() { - return config.getDouble("Skills.Fishing.Lure_Modifier", 4.0D); + double getDoubleValue(String... path) + { + return userRootNode.getNode(path).getDouble(); } - /* Mining */ - public Material getDetonatorItem() { - return Material.matchMaterial(config.getString("Skills.Mining.Detonator_Name", "FLINT_AND_STEEL")); + boolean getBooleanValue(String... path) + { + return userRootNode.getNode(path).getBoolean(); } - public int getMiningGate() { - return config.getInt("Skills.Mining.Ability_Activation_Level_Gate", 10); + String getStringValue(String... path) + { + return userRootNode.getNode(path).getString(); } - - /* Excavation */ - public int getExcavationGate() { - return config.getInt("Skills.Excavation.Ability_Activation_Level_Gate", 10); - } - - /* Repair */ - public boolean getRepairAnvilMessagesEnabled() { - return config.getBoolean("Skills.Repair.Anvil_Messages", true); - } - - public boolean getRepairAnvilPlaceSoundsEnabled() { - return config.getBoolean("Skills.Repair.Anvil_Placed_Sounds", true); - } - - public boolean getRepairAnvilUseSoundsEnabled() { - return config.getBoolean("Skills.Repair.Anvil_Use_Sounds", true); - } - - public Material getRepairAnvilMaterial() { - return Material.matchMaterial(config.getString("Skills.Repair.Anvil_Material", "IRON_BLOCK")); - } - - public boolean getRepairConfirmRequired() { - return config.getBoolean("Skills.Repair.Confirm_Required", true); - } - - /* Salvage */ - public boolean getSalvageAnvilMessagesEnabled() { - return config.getBoolean("Skills.Salvage.Anvil_Messages", true); - } - - public boolean getSalvageAnvilPlaceSoundsEnabled() { - return config.getBoolean("Skills.Salvage.Anvil_Placed_Sounds", true); - } - - public boolean getSalvageAnvilUseSoundsEnabled() { - return config.getBoolean("Skills.Salvage.Anvil_Use_Sounds", true); - } - - public Material getSalvageAnvilMaterial() { - return Material.matchMaterial(config.getString("Skills.Salvage.Anvil_Material", "GOLD_BLOCK")); - } - - public boolean getSalvageConfirmRequired() { - return config.getBoolean("Skills.Salvage.Confirm_Required", true); - } - - /* Unarmed */ - public boolean getUnarmedBlockCrackerSmoothbrickToCracked() { - return config.getBoolean("Skills.Unarmed.Block_Cracker.SmoothBrick_To_CrackedBrick", true); - } - - public boolean getUnarmedItemPickupDisabled() { - return config.getBoolean("Skills.Unarmed.Item_Pickup_Disabled_Full_Inventory", true); - } - - public boolean getUnarmedItemsAsUnarmed() { - return config.getBoolean("Skills.Unarmed.Items_As_Unarmed", false); - } - - public int getUnarmedGate() { - return config.getInt("Skills.Unarmed.Ability_Activation_Level_Gate", 10); - } - - /* Swords */ - public int getSwordsGate() { - return config.getInt("Skills.Swords.Ability_Activation_Level_Gate", 10); - } - - /* Taming */ - public Material getTamingCOTWMaterial(EntityType type) { - return Material.matchMaterial(config.getString("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Material")); - } - - public int getTamingCOTWCost(EntityType type) { - return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Amount"); - } - - public int getTamingCOTWAmount(EntityType type) { - return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Summon_Amount"); - } - - public int getTamingCOTWLength(EntityType type) { - return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Summon_Length"); - } - - public int getTamingCOTWMaxAmount(EntityType type) { - return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Summon_Max_Amount"); - } - - public double getTamingCOTWRange() { - return config.getDouble("Skills.Taming.Call_Of_The_Wild.Range", 40.0D); - } - - /* Woodcutting */ - public boolean getWoodcuttingDoubleDropsEnabled(BlockData material) { - return config.getBoolean("Double_Drops.Woodcutting." + StringUtils.getFriendlyConfigBlockDataString(material)); - } - - public boolean getTreeFellerSoundsEnabled() { - return config.getBoolean("Skills.Woodcutting.Tree_Feller_Sounds", true); - } - - public int getWoodcuttingGate() { - return config.getInt("Skills.Woodcutting.Ability_Activation_Level_Gate", 10); - } - - /* AFK Leveling */ - public boolean getAcrobaticsPreventAFK() { - return config.getBoolean("Skills.Acrobatics.Prevent_AFK_Leveling", true); - } - - public int getAcrobaticsAFKMaxTries() { - return config.getInt("Skills.Acrobatics.Max_Tries_At_Same_Location", 3); - } - - public boolean getHerbalismPreventAFK() { - return config.getBoolean("Skills.Herbalism.Prevent_AFK_Leveling", true); - } - - /* Level Caps */ - public int getPowerLevelCap() { - int cap = config.getInt("General.Power_Level_Cap", 0); - return (cap <= 0) ? Integer.MAX_VALUE : cap; - } - - public int getLevelCap(PrimarySkillType skill) { - int cap = config.getInt("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Level_Cap"); - return (cap <= 0) ? Integer.MAX_VALUE : cap; - } - - - /*public int isSuperAbilityUnlocked(PrimarySkillType skill) { - return config.getInt("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Ability_Activation_Level_Gate"); - }*/ - - public boolean getTruncateSkills() { - return config.getBoolean("General.TruncateSkills", false); - } - - /* PVP & PVE Settings */ - public boolean getPVPEnabled(PrimarySkillType skill) { - return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVP", true); - } - - public boolean getPVEEnabled(PrimarySkillType skill) { - return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVE", true); - } - - //public float getMasterVolume() { return (float) config.getDouble("Sounds.MasterVolume", 1.0); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/ConfigKeyRegister.java b/core/src/main/java/com/gmail/nossr50/core/config/ConfigKeyRegister.java new file mode 100644 index 000000000..666dcc5cd --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/config/ConfigKeyRegister.java @@ -0,0 +1,19 @@ +package com.gmail.nossr50.core.config; + +import java.io.File; + +/** + * Represents a config file that registers keys after its initialized + */ +public abstract class ConfigKeyRegister extends Config implements RegistersKeys { + + public ConfigKeyRegister(String pathToParentFolder, String relativePath) { + super(pathToParentFolder, relativePath); + loadKeys(); + } + + public ConfigKeyRegister(File pathToParentFolder, String relativePath) { + super(pathToParentFolder, relativePath); + loadKeys(); + } +} diff --git a/core/src/main/java/com/gmail/nossr50/core/config/ConfigValidated.java b/core/src/main/java/com/gmail/nossr50/core/config/ConfigValidated.java new file mode 100644 index 000000000..0e0d1e979 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/config/ConfigValidated.java @@ -0,0 +1,44 @@ +package com.gmail.nossr50.core.config; + +import com.gmail.nossr50.core.McmmoCore; + +import java.io.File; +import java.util.List; + +/** + * This class is used for config files that validate their entries + */ +public abstract class ConfigValidated extends Config implements DefaultKeys { + public ConfigValidated(String parentFolderPath, String relativePath) + { + super(parentFolderPath, relativePath); + validateEntries(); + } + + public ConfigValidated(File parentFolderFile, String relativePath) + { + super(parentFolderFile, relativePath); + validateEntries(); + } + + /** + * Prints all errors found when validating the config + */ + private void validateEntries() + { + /* + * Print Errors about Keys + */ + + List validKeyErrors = validateKeys(); // Validate Keys + + if(validKeyErrors != null && validKeyErrors.size() > 0) + { + for(String error : validKeyErrors) + { + McmmoCore.getLogger().severe(error); + } + } + } + +} diff --git a/core/src/main/java/com/gmail/nossr50/core/config/ConfigurableLoader.java b/core/src/main/java/com/gmail/nossr50/core/config/ConfigurableLoader.java deleted file mode 100644 index de9d874f4..000000000 --- a/core/src/main/java/com/gmail/nossr50/core/config/ConfigurableLoader.java +++ /dev/null @@ -1,315 +0,0 @@ -package com.gmail.nossr50.core.config; - -import com.gmail.nossr50.core.McmmoCore; -import com.google.common.io.Files; -import ninja.leaping.configurate.ConfigurationNode; -import ninja.leaping.configurate.commented.CommentedConfigurationNode; -import ninja.leaping.configurate.loader.ConfigurationLoader; -import ninja.leaping.configurate.yaml.YAMLConfigurationLoader; -import org.yaml.snakeyaml.DumperOptions; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.List; - -/** - * Handles loading and cacheing configuration settings from a configurable compatible config file - */ -//@ConfigSerializable -public abstract class ConfigurableLoader implements DefaultKeys, VersionedConfig { - - /* PATH VARS */ - - public final File DIRECTORY_DATA_FOLDER; //Directory that the file is in - public final String FILE_RELATIVE_PATH; //Relative Path to the file - protected final String DIRECTORY_DEFAULTS = "defaults"; - - /* LOADERS */ - - private YAMLConfigurationLoader defaultCopyLoader; - private YAMLConfigurationLoader userCopyLoader; - - /* CONFIG FILES */ - - private File resourceConfigCopy; //Copy of the default config from the JAR (file is copied so that admins can easily compare to defaults) - private File resourceUserCopy; //File in the /$MCMMO_ROOT/mcMMO/ directory that may contain user edited settings - - /* ROOT NODES */ - - private ConfigurationNode userRootNode = null; - private ConfigurationNode defaultRootNode = null; - - /* CONFIG MANAGER */ - private ConfigurationLoader configManager; - - public ConfigurableLoader(String pathToParentFolder, String relativePath) { - //TODO: Check if this works... - this(new File(pathToParentFolder), relativePath); - System.out.println("mcMMO Debug: Don't forget to check if loading config file by string instead of File works..."); - } - - public ConfigurableLoader(File pathToParentFolder, String relativePath) { - /* - * These must be at the top - */ - mkdirDefaults(); // Make our default config dir - DIRECTORY_DATA_FOLDER = pathToParentFolder; //Data Folder for our plugin - FILE_RELATIVE_PATH = relativePath; //Relative path to config from a parent folder - - //Attempt IO Operations - try { - //Makes sure we have valid Files corresponding to this config - initConfigFiles(); - - //Init Config Loaders - initConfigLoaders(); - - //Load Config Nodes - loadConfig(); - - //Attempt to update user file, and then load it into memory - readConfig(); - } catch (IOException e) { - e.printStackTrace(); - } - - /* - * Print Errors about Keys - */ - - List validKeyErrors = validateKeys(); // Validate Keys - - if(validKeyErrors != null && validKeyErrors.size() > 0) - { - for(String error : validKeyErrors) - { - McmmoCore.getLogger().severe(error); - } - } - } - - /** - * Initializes the default copy File and the user config File - * @throws IOException - */ - private void initConfigFiles() throws IOException { - //Init our config copy - resourceConfigCopy = initDefaultConfig(); - - //Init the user file - resourceUserCopy = initUserConfig(); - } - - /** - * Loads the root node for the default config File and user config File - */ - private void loadConfig() - { - try { - final ConfigurationNode defaultConfig = this.defaultCopyLoader.load(); - defaultRootNode = defaultConfig; - - final ConfigurationNode userConfig = this.userCopyLoader.load(); - userRootNode = userConfig; - - } catch (IOException e) { - e.printStackTrace(); - } - } - - /** - * Initializes the YAMLConfigurationLoaders for this config - */ - private void initConfigLoaders() - { - this.defaultCopyLoader = YAMLConfigurationLoader.builder().setPath(resourceConfigCopy.toPath()).setFlowStyle(DumperOptions.FlowStyle.BLOCK).build(); - this.userCopyLoader = YAMLConfigurationLoader.builder().setPath(resourceUserCopy.toPath()).setFlowStyle(DumperOptions.FlowStyle.FLOW).build(); - } - - /** - * Copies a new file from the JAR to the defaults directory and uses that new file to initialize our resourceConfigCopy - * @see ConfigurableLoader#resourceConfigCopy - * @throws IOException - */ - private File initDefaultConfig() throws IOException { - return copyDefaultFromJar(getDefaultConfigCopyRelativePath(), true); - } - - /** - * Attemps to load the config file if it exists, if it doesn't it copies a new one from within the JAR - * @return user config File - * @see ConfigurableLoader#resourceUserCopy - * @throws IOException - */ - private File initUserConfig() throws IOException { - File userCopy = new File(DIRECTORY_DATA_FOLDER, FILE_RELATIVE_PATH); //Load the user file; - - if(userCopy.exists()) - { - // Yay - return userCopy; - } - else - { - //If it's gone we copy default files - //Note that we don't copy the values from the default copy put in /defaults/ that file exists only as a reference to admins and is unreliable - return copyDefaultFromJar(FILE_RELATIVE_PATH, false); - } - } - - /** - * Used to make a new config file at a specified relative output path inside the data directory by copying the matching file found in that same relative path within the JAR - * @param relativeOutputPath the path to the output file - * @param deleteOld whether or not to delete the existing output file on disk - * @return a copy of the default config within the JAR - * @throws IOException - */ - private File copyDefaultFromJar(String relativeOutputPath, boolean deleteOld) throws IOException - { - /* - * Gen a Default config from inside the JAR - */ - McmmoCore.getLogger().info("Preparing to copy internal resource file (in JAR) - "+FILE_RELATIVE_PATH); - InputStream inputStream = McmmoCore.getResource(FILE_RELATIVE_PATH); - - byte[] buffer = new byte[inputStream.available()]; - inputStream.read(buffer); - - //This is a copy of the default file, which we will overwrite every time mcMMO loads - File targetFile = new File(DIRECTORY_DATA_FOLDER, relativeOutputPath); - - //Wipe old default file on disk - if (targetFile.exists() && deleteOld) - { - McmmoCore.getLogger().info("Updating file " + relativeOutputPath); - targetFile.delete(); //Necessary? - } - - if(!targetFile.exists()) - { - targetFile.getParentFile().mkdirs(); - targetFile.createNewFile(); //New File Boys - } - - Files.write(buffer, targetFile); - McmmoCore.getLogger().info("Created config file - " + relativeOutputPath); - - inputStream.close(); //Close the input stream - - return targetFile; - } - - /** - * The path to the defaults directory - * @return the path to the defaults directory - */ - private String getDefaultConfigCopyRelativePath() { - return DIRECTORY_DEFAULTS + File.separator + FILE_RELATIVE_PATH; - } - - /** - * Creates the defaults directory - */ - private void mkdirDefaults() { - //Make Default Subdirectory - File defaultsDir = new File (DIRECTORY_DATA_FOLDER, "defaults"); - - if(!defaultsDir.exists()) - defaultsDir.mkdir(); - } - - /** - * Configs are versioned based on when they had significant changes to keys - * @return current Config Version String - */ - public String getVersion() - { - return String.valueOf(getConfigVersion()); - } - - /** - * Attempts to read the loaded config file - * Config will have any necessary updates applied - * Config will be compared to the default config to see if it is missing any nodes - * Config will have any missing nodes inserted with their default value - */ - public void readConfig() { - McmmoCore.getLogger().info("Attempting to read " + FILE_RELATIVE_PATH + "."); - - int version = this.userRootNode.getNode("ConfigVersion").getInt(); - McmmoCore.getLogger().info(FILE_RELATIVE_PATH + " version is " + version); - - //Update our config - updateConfig(); - } - - /** - * Compares the users config file to the default and adds any missing nodes and applies any necessary updates - */ - private void updateConfig() - { - McmmoCore.getLogger().info(defaultRootNode.getChildrenMap().size() +" items in default children map"); - McmmoCore.getLogger().info(userRootNode.getChildrenMap().size() +" items in default root map"); - - // Merge Values from default - userRootNode = userRootNode.mergeValuesFrom(defaultRootNode); - - // Update config version - updateConfigVersion(); - - //Attempt to save - try { - saveUserCopy(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - /** - * Saves the current state information of the config to the users copy (which they may edit) - * @throws IOException - */ - private void saveUserCopy() throws IOException - { - McmmoCore.getLogger().info("Saving new node"); - userCopyLoader.save(userRootNode); - } - - /** - * Performs any necessary operations to update this config - */ - private void updateConfigVersion() { - // Set a version for our config - this.userRootNode.getNode("ConfigVersion").setValue(getConfigVersion()); - McmmoCore.getLogger().info("Updated config to ["+getConfigVersion()+"] - " + FILE_RELATIVE_PATH); - } - - /** - * Returns the root node of this config - * @return the root node of this config - */ - protected ConfigurationNode getUserRootNode() { - return userRootNode; - } - - int getIntValue(String... path) - { - return userRootNode.getNode(path).getInt(); - } - - double getDoubleValue(String... path) - { - return userRootNode.getNode(path).getDouble(); - } - - boolean getBooleanValue(String... path) - { - return userRootNode.getNode(path).getBoolean(); - } - - String getStringValue(String... path) - { - return userRootNode.getNode(path).getString(); - } -} diff --git a/core/src/main/java/com/gmail/nossr50/core/config/CoreSkillsConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/CoreSkillsConfig.java index a176532de..17a8b2baa 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/CoreSkillsConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/CoreSkillsConfig.java @@ -5,12 +5,11 @@ import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.core.util.StringUtils; -public class CoreSkillsConfig extends ConfigurableLoader { +public class CoreSkillsConfig extends Config { private static CoreSkillsConfig instance; public CoreSkillsConfig() { super(McmmoCore.getDataFolderPath().getAbsoluteFile(),"coreskills.yml"); - validate(); } public static CoreSkillsConfig getInstance() { @@ -20,15 +19,19 @@ public class CoreSkillsConfig extends ConfigurableLoader { return instance; } + /** + * The version of this config + * + * @return + */ @Override - protected void loadKeys() { - + public double getConfigVersion() { + return 1; } @Override - protected boolean validateKeys() { - - return true; + public void unload() { + instance = null; } /* @@ -43,7 +46,7 @@ public class CoreSkillsConfig extends ConfigurableLoader { * @return true if subskill is enabled */ public boolean isSkillEnabled(AbstractSubSkill abstractSubSkill) { - return config.getBoolean(StringUtils.getCapitalized(abstractSubSkill.getPrimarySkill().toString()) + "." + abstractSubSkill.getConfigKeyName() + ".Enabled", true); + return getBooleanValue(StringUtils.getCapitalized(abstractSubSkill.getPrimarySkill().toString()) + "." + abstractSubSkill.getConfigKeyName() + ".Enabled", true); } /** @@ -53,6 +56,6 @@ public class CoreSkillsConfig extends ConfigurableLoader { * @return true if enabled */ public boolean isPrimarySkillEnabled(PrimarySkillType primarySkillType) { - return config.getBoolean(StringUtils.getCapitalized(primarySkillType.toString()) + ".Enabled", true); + return getBooleanValue(StringUtils.getCapitalized(primarySkillType.toString()) + ".Enabled", true); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/MainConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/MainConfig.java new file mode 100644 index 000000000..a399a3347 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/config/MainConfig.java @@ -0,0 +1,1041 @@ +package com.gmail.nossr50.core.config; + +import com.gmail.nossr50.core.McmmoCore; +import com.gmail.nossr50.core.data.database.SQLDatabaseManager; +import com.gmail.nossr50.core.datatypes.party.PartyFeature; +import com.gmail.nossr50.core.skills.MobHealthbarType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SuperAbilityType; +import com.gmail.nossr50.core.util.StringUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +public class MainConfig extends ConfigValidated { + private static MainConfig instance; + + private MainConfig() { + super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "config.yml"); + } + + public static MainConfig getInstance() { + if (instance == null) { + instance = new MainConfig(); + } + + return instance; + } + + @Override + public void unload() { + instance = null; + } + + /** + * The version of this config + * + * @return + */ + @Override + public double getConfigVersion() { + return 1; + } + + @Override + public List validateKeys() { + // Validate all the settings! + List reason = new ArrayList(); + + /* General Settings */ + if (getSaveInterval() <= 0) { + reason.add("General.Save_Interval should be greater than 0!"); + } + + /* MySQL Settings */ + for (SQLDatabaseManager.PoolIdentifier identifier : SQLDatabaseManager.PoolIdentifier.values()) { + if (getMySQLMaxConnections(identifier) <= 0) { + reason.add("MySQL.Database.MaxConnections." + StringUtils.getCapitalized(identifier.toString()) + " should be greater than 0!"); + } + if (getMySQLMaxPoolSize(identifier) <= 0) { + reason.add("MySQL.Database.MaxPoolSize." + StringUtils.getCapitalized(identifier.toString()) + " should be greater than 0!"); + } + } + + /* Mob Healthbar */ + if (getMobHealthbarTime() == 0) { + reason.add("Mob_Healthbar.Display_Time cannot be 0! Set to -1 to disable or set a valid value."); + } + + /* Scoreboards */ + /*if (getRankScoreboardTime() != -1 && getRankScoreboardTime() <= 0) { + reason.add("Scoreboard.Types.Rank.Display_Time should be greater than 0, or -1!"); + } + + if (getStatsScoreboardTime() != -1 && getStatsScoreboardTime() <= 0) { + reason.add("Scoreboard.Types.Stats.Display_Time should be greater than 0, or -1!"); + } + + if (getTopScoreboardTime() != -1 && getTopScoreboardTime() <= 0) { + reason.add("Scoreboard.Types.Top.Display_Time should be greater than 0, or -1!"); + } + + if (getInspectScoreboardTime() != -1 && getInspectScoreboardTime() <= 0) { + reason.add("Scoreboard.Types.Inspect.Display_Time should be greater than 0, or -1!"); + } + + if (getSkillScoreboardTime() != -1 && getSkillScoreboardTime() <= 0) { + reason.add("Scoreboard.Types.Skill.Display_Time should be greater than 0, or -1!"); + } + + if (getSkillLevelUpTime() != -1 && getSkillScoreboardTime() <= 0) { + reason.add("Scoreboard.Types.Skill.Display_Time should be greater than 0, or -1!"); + } + + if (!(getRankUseChat() || getRankUseBoard())) { + reason.add("Either Board or Print in Scoreboard.Types.Rank must be true!"); + } + + if (!(getTopUseChat() || getTopUseBoard())) { + reason.add("Either Board or Print in Scoreboard.Types.Top must be true!"); + } + + if (!(getStatsUseChat() || getStatsUseBoard())) { + reason.add("Either Board or Print in Scoreboard.Types.Stats must be true!"); + } + + if (!(getInspectUseChat() || getInspectUseBoard())) { + reason.add("Either Board or Print in Scoreboard.Types.Inspect must be true!"); + }*/ + + /* Database Purging */ + if (getPurgeInterval() < -1) { + reason.add("Database_Purging.Purge_Interval should be greater than, or equal to -1!"); + } + + if (getOldUsersCutoff() != -1 && getOldUsersCutoff() <= 0) { + reason.add("Database_Purging.Old_User_Cutoff should be greater than 0 or -1!"); + } + + /* Hardcore Mode */ + if (getHardcoreDeathStatPenaltyPercentage() < 0.01 || getHardcoreDeathStatPenaltyPercentage() > 100) { + reason.add("Hardcore.Death_Stat_Loss.Penalty_Percentage only accepts values from 0.01 to 100!"); + } + + if (getHardcoreVampirismStatLeechPercentage() < 0.01 || getHardcoreVampirismStatLeechPercentage() > 100) { + reason.add("Hardcore.Vampirism.Leech_Percentage only accepts values from 0.01 to 100!"); + } + + /* Items */ + if (getChimaeraUseCost() < 1 || getChimaeraUseCost() > 64) { + reason.add("Items.Chimaera_Wing.Use_Cost only accepts values from 1 to 64!"); + } + + if (getChimaeraRecipeCost() < 1 || getChimaeraRecipeCost() > 9) { + reason.add("Items.Chimaera_Wing.Recipe_Cost only accepts values from 1 to 9!"); + } + + if (getChimaeraItem() == null) { + reason.add("Items.Chimaera_Wing.Item_Name is invalid!"); + } + + /* Particles */ + if (getLevelUpEffectsTier() < 1) { + reason.add("Particles.LevelUp_Tier should be at least 1!"); + } + + /* PARTY SETTINGS */ + if (getAutoPartyKickInterval() < -1) { + reason.add("Party.AutoKick_Interval should be at least -1!"); + } + + if (getAutoPartyKickTime() < 0) { + reason.add("Party.Old_Party_Member_Cutoff should be at least 0!"); + } + + if (getPartyShareBonusBase() <= 0) { + reason.add("Party.Sharing.ExpShare_bonus_base should be greater than 0!"); + } + + if (getPartyShareBonusIncrease() < 0) { + reason.add("Party.Sharing.ExpShare_bonus_increase should be at least 0!"); + } + + if (getPartyShareBonusCap() <= 0) { + reason.add("Party.Sharing.ExpShare_bonus_cap should be greater than 0!"); + } + + if (getPartyShareRange() <= 0) { + reason.add("Party.Sharing.Range should be greater than 0!"); + } + + if (getPartyXpCurveMultiplier() < 1) { + reason.add("Party.Leveling.Xp_Curve_Modifier should be at least 1!"); + } + + for (PartyFeature partyFeature : PartyFeature.values()) { + if (getPartyFeatureUnlockLevel(partyFeature) < 0) { + reason.add("Party.Leveling." + StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + "_UnlockLevel should be at least 0!"); + } + } + + /* Inspect command distance */ + if (getInspectDistance() <= 0) { + reason.add("Commands.inspect.Max_Distance should be greater than 0!"); + } + + if (getTreeFellerThreshold() <= 0) { + reason.add("Abilities.Limits.Tree_Feller_Threshold should be greater than 0!"); + } + + if (getFishingLureModifier() < 0) { + reason.add("Abilities.Fishing.Lure_Modifier should be at least 0!"); + } + + if (getDetonatorItem() == null) { + reason.add("Skills.Mining.Detonator_Item is invalid!"); + } + + if (getRepairAnvilMaterial() == null) { + reason.add("Skills.Repair.Anvil_Type is invalid!!"); + } + + if (getSalvageAnvilMaterial() == null) { + reason.add("Skills.Repair.Salvage_Anvil_Type is invalid!"); + } + + if (getRepairAnvilMaterial() == getSalvageAnvilMaterial()) { + reason.add("Cannot use the same item for Repair and Salvage anvils!"); + } + + if (getTamingCOTWMaterial(EntityType.WOLF) == null) { + reason.add("Skills.Taming.Call_Of_The_Wild.Wolf.Item_Material is invalid!!"); + } + + if (getTamingCOTWMaterial(EntityType.OCELOT) == null) { + reason.add("Skills.Taming.Call_Of_The_Wild.Ocelot.Item_Material is invalid!!"); + } + + if (getTamingCOTWMaterial(EntityType.HORSE) == null) { + reason.add("Skills.Taming.Call_Of_The_Wild.Horse.Item_Material is invalid!!"); + } + + if (getTamingCOTWCost(EntityType.WOLF) <= 0) { + reason.add("Skills.Taming.Call_Of_The_Wild.Wolf.Item_Amount should be greater than 0!"); + } + + if (getTamingCOTWCost(EntityType.OCELOT) <= 0) { + reason.add("Skills.Taming.Call_Of_The_Wild.Ocelot.Item_Amount should be greater than 0!"); + } + + if (getTamingCOTWCost(EntityType.HORSE) <= 0) { + reason.add("Skills.Taming.Call_Of_The_Wild.Horse.Item_Amount should be greater than 0!"); + } + + if (getTamingCOTWAmount(EntityType.WOLF) <= 0) { + reason.add("Skills.Taming.Call_Of_The_Wild.Wolf.Summon_Amount should be greater than 0!"); + } + + if (getTamingCOTWAmount(EntityType.OCELOT) <= 0) { + reason.add("Skills.Taming.Call_Of_The_Wild.Ocelot.Summon_Amount should be greater than 0!"); + } + + if (getTamingCOTWAmount(EntityType.HORSE) <= 0) { + reason.add("Skills.Taming.Call_Of_The_Wild.Horse.Summon_Amount should be greater than 0!"); + } + + return reason; + } + + /* + * GENERAL SETTINGS + */ + + /* General Settings */ + public boolean getIsMetricsEnabled() { + return getBooleanValue("Metrics.bstats", true); + } + + //Retro mode will default the value to true if the config file doesn't contain the entry (server is from a previous mcMMO install) + public boolean getIsRetroMode() { + return getBooleanValue("General.RetroMode.Enabled", true); + } + + public String getLocale() { + return getStringValue("General.Locale", "en_us"); + } + + public boolean getMOTDEnabled() { + return getBooleanValue("General.MOTD_Enabled", true); + } + + public boolean getShowProfileLoadedMessage() { + return getBooleanValue("General.Show_Profile_Loaded", true); + } + + public boolean getDonateMessageEnabled() { + return getBooleanValue("Commands.mcmmo.Donate_Message", true); + } + + public int getSaveInterval() { + return getIntValue("General.Save_Interval", 10); + } + + public boolean getStatsTrackingEnabled() { + return getBooleanValue("General.Stats_Tracking", true); + } + + public boolean getUpdateCheckEnabled() { + return getBooleanValue("General.Update_Check", true); + } + + public boolean getPreferBeta() { + return getBooleanValue("General.Prefer_Beta", false); + } + + public boolean getVerboseLoggingEnabled() { + return getBooleanValue("General.Verbose_Logging", false); + } + + public String getPartyChatPrefix() { + return getStringValue("Commands.partychat.Chat_Prefix_Format", "[[GREEN]]([[WHITE]]{0}[[GREEN]])"); + } + + public boolean getPartyChatColorLeaderName() { + return getBooleanValue("Commands.partychat.Gold_Leader_Name", true); + } + + public boolean getPartyDisplayNames() { + return getBooleanValue("Commands.partychat.Use_Display_Names", true); + } + + public String getPartyChatPrefixAlly() { + return getStringValue("Commands.partychat.Chat_Prefix_Format_Ally", "[[GREEN]](A)[[RESET]]"); + } + + public String getAdminChatPrefix() { + return getStringValue("Commands.adminchat.Chat_Prefix_Format", "[[AQUA]][[[WHITE]]{0}[[AQUA]]]"); + } + + public boolean getAdminDisplayNames() { + return getBooleanValue("Commands.adminchat.Use_Display_Names", true); + } + + public boolean getMatchOfflinePlayers() { + return getBooleanValue("Commands.Generic.Match_OfflinePlayers", false); + } + + public long getDatabasePlayerCooldown() { + return config.getLong("Commands.Database.Player_Cooldown", 1750); + } + + public boolean getLevelUpSoundsEnabled() { + return getBooleanValue("General.LevelUp_Sounds", true); + } + + public boolean getRefreshChunksEnabled() { + return getBooleanValue("General.Refresh_Chunks", false); + } + + public boolean getMobHealthbarEnabled() { + return getBooleanValue("Mob_Healthbar.Enabled", true); + } + + /* Mob Healthbar */ + public MobHealthbarType getMobHealthbarDefault() { + try { + return MobHealthbarType.valueOf(getStringValue("Mob_Healthbar.Display_Type", "HEARTS").toUpperCase().trim()); + } catch (IllegalArgumentException ex) { + return MobHealthbarType.HEARTS; + } + } + + public int getMobHealthbarTime() { + return getIntValue("Mob_Healthbar.Display_Time", 3); + } + + /* Scoreboards */ + public boolean getScoreboardsEnabled() { + return getBooleanValue("Scoreboard.UseScoreboards", true); + } + + public boolean getPowerLevelTagsEnabled() { + return getBooleanValue("Scoreboard.Power_Level_Tags", false); + } + + public boolean getAllowKeepBoard() { + return getBooleanValue("Scoreboard.Allow_Keep", true); + } + + public int getTipsAmount() { + return getIntValue("Scoreboard.Tips_Amount", 5); + } + + public boolean getShowStatsAfterLogin() { + return getBooleanValue("Scoreboard.Show_Stats_After_Login", false); + } + + public boolean getScoreboardRainbows() { + return getBooleanValue("Scoreboard.Rainbows", false); + } + + public boolean getShowAbilityNames() { + return getBooleanValue("Scoreboard.Ability_Names", true); + } + + public boolean getRankUseChat() { + return getBooleanValue("Scoreboard.Types.Rank.Print", false); + } + + public boolean getRankUseBoard() { + return getBooleanValue("Scoreboard.Types.Rank.Board", true); + } + + public int getRankScoreboardTime() { + return getIntValue("Scoreboard.Types.Rank.Display_Time", 10); + } + + public boolean getTopUseChat() { + return getBooleanValue("Scoreboard.Types.Top.Print", true); + } + + public boolean getTopUseBoard() { + return getBooleanValue("Scoreboard.Types.Top.Board", true); + } + + public int getTopScoreboardTime() { + return getIntValue("Scoreboard.Types.Top.Display_Time", 15); + } + + public boolean getStatsUseChat() { + return getBooleanValue("Scoreboard.Types.Stats.Print", true); + } + + public boolean getStatsUseBoard() { + return getBooleanValue("Scoreboard.Types.Stats.Board", true); + } + + public int getStatsScoreboardTime() { + return getIntValue("Scoreboard.Types.Stats.Display_Time", 10); + } + + public boolean getInspectUseChat() { + return getBooleanValue("Scoreboard.Types.Inspect.Print", true); + } + + public boolean getInspectUseBoard() { + return getBooleanValue("Scoreboard.Types.Inspect.Board", true); + } + + public int getInspectScoreboardTime() { + return getIntValue("Scoreboard.Types.Inspect.Display_Time", 25); + } + + public boolean getCooldownUseChat() { + return getBooleanValue("Scoreboard.Types.Cooldown.Print", false); + } + + public boolean getCooldownUseBoard() { + return getBooleanValue("Scoreboard.Types.Cooldown.Board", true); + } + + public int getCooldownScoreboardTime() { + return getIntValue("Scoreboard.Types.Cooldown.Display_Time", 41); + } + + public boolean getSkillUseBoard() { + return getBooleanValue("Scoreboard.Types.Skill.Board", true); + } + + public int getSkillScoreboardTime() { + return getIntValue("Scoreboard.Types.Skill.Display_Time", 30); + } + + public boolean getSkillLevelUpBoard() { + return getBooleanValue("Scoreboard.Types.Skill.LevelUp_Board", true); + } + + public int getSkillLevelUpTime() { + return getIntValue("Scoreboard.Types.Skill.LevelUp_Time", 5); + } + + /* Database Purging */ + public int getPurgeInterval() { + return getIntValue("Database_Purging.Purge_Interval", -1); + } + + public int getOldUsersCutoff() { + return getIntValue("Database_Purging.Old_User_Cutoff", 6); + } + + /* Backups */ + public boolean getBackupsEnabled() { + return getBooleanValue("Backups.Enabled", true); + } + + public boolean getKeepLast24Hours() { + return getBooleanValue("Backups.Keep.Last_24_Hours", true); + } + + public boolean getKeepDailyLastWeek() { + return getBooleanValue("Backups.Keep.Daily_Last_Week", true); + } + + public boolean getKeepWeeklyPastMonth() { + return getBooleanValue("Backups.Keep.Weekly_Past_Months", true); + } + + /* mySQL */ + public boolean getUseMySQL() { + return getBooleanValue("MySQL.Enabled", false); + } + + public String getMySQLTablePrefix() { + return getStringValue("MySQL.Database.TablePrefix", "mcmmo_"); + } + + public String getMySQLDatabaseName() { + return getStringIncludingInts("MySQL.Database.Name"); + } + + public String getMySQLUserName() { + return getStringIncludingInts("MySQL.Database.User_Name"); + } + + public int getMySQLServerPort() { + return getIntValue("MySQL.Server.Port", 3306); + } + + public String getMySQLServerName() { + return getStringValue("MySQL.Server.Address", "localhost"); + } + + public String getMySQLUserPassword() { + return getStringIncludingInts("MySQL.Database.User_Password"); + } + + public int getMySQLMaxConnections(SQLDatabaseManager.PoolIdentifier identifier) { + return getIntValue("MySQL.Database.MaxConnections." + StringUtils.getCapitalized(identifier.toString()), 30); + } + + public int getMySQLMaxPoolSize(SQLDatabaseManager.PoolIdentifier identifier) { + return getIntValue("MySQL.Database.MaxPoolSize." + StringUtils.getCapitalized(identifier.toString()), 10); + } + + public boolean getMySQLSSL() { + return getBooleanValue("MySQL.Server.SSL", true); + } + + private String getStringIncludingInts(String key) { + String str = getStringValue(key); + + if (str == null) { + str = String.valueOf(getIntValue(key)); + } + + if (str.equals("0")) { + str = "No value set for '" + key + "'"; + } + return str; + } + + /* Hardcore Mode */ + public boolean getHardcoreStatLossEnabled(PrimarySkillType primarySkillType) { + return getBooleanValue("Hardcore.Death_Stat_Loss.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), false); + } + + public void setHardcoreStatLossEnabled(PrimarySkillType primarySkillType, boolean enabled) { + config.set("Hardcore.Death_Stat_Loss.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), enabled); + } + + public double getHardcoreDeathStatPenaltyPercentage() { + return getDoubleValue("Hardcore.Death_Stat_Loss.Penalty_Percentage", 75.0D); + } + + public void setHardcoreDeathStatPenaltyPercentage(double value) { + config.set("Hardcore.Death_Stat_Loss.Penalty_Percentage", value); + } + + public int getHardcoreDeathStatPenaltyLevelThreshold() { + return getIntValue("Hardcore.Death_Stat_Loss.Level_Threshold", 0); + } + + public boolean getHardcoreVampirismEnabled(PrimarySkillType primarySkillType) { + return getBooleanValue("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), false); + } + + public void setHardcoreVampirismEnabled(PrimarySkillType primarySkillType, boolean enabled) { + config.set("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), enabled); + } + + public double getHardcoreVampirismStatLeechPercentage() { + return getDoubleValue("Hardcore.Vampirism.Leech_Percentage", 5.0D); + } + + public void setHardcoreVampirismStatLeechPercentage(double value) { + config.set("Hardcore.Vampirism.Leech_Percentage", value); + } + + public int getHardcoreVampirismLevelThreshold() { + return getIntValue("Hardcore.Vampirism.Level_Threshold", 0); + } + + /* SMP Mods */ + public boolean getToolModsEnabled() { + return getBooleanValue("Mods.Tool_Mods_Enabled", false); + } + + public boolean getArmorModsEnabled() { + return getBooleanValue("Mods.Armor_Mods_Enabled", false); + } + + public boolean getBlockModsEnabled() { + return getBooleanValue("Mods.Block_Mods_Enabled", false); + } + + public boolean getEntityModsEnabled() { + return getBooleanValue("Mods.Entity_Mods_Enabled", false); + } + + /* Items */ + public int getChimaeraUseCost() { + return getIntValue("Items.Chimaera_Wing.Use_Cost", 1); + } + + public int getChimaeraRecipeCost() { + return getIntValue("Items.Chimaera_Wing.Recipe_Cost", 5); + } + + public Material getChimaeraItem() { + return Material.matchMaterial(getStringValue("Items.Chimaera_Wing.Item_Name", "Feather")); + } + + public boolean getChimaeraEnabled() { + return getBooleanValue("Items.Chimaera_Wing.Enabled", true); + } + + public boolean getChimaeraPreventUseUnderground() { + return getBooleanValue("Items.Chimaera_Wing.Prevent_Use_Underground", true); + } + + public boolean getChimaeraUseBedSpawn() { + return getBooleanValue("Items.Chimaera_Wing.Use_Bed_Spawn", true); + } + + public int getChimaeraCooldown() { + return getIntValue("Items.Chimaera_Wing.Cooldown", 240); + } + + public int getChimaeraWarmup() { + return getIntValue("Items.Chimaera_Wing.Warmup", 5); + } + + public int getChimaeraRecentlyHurtCooldown() { + return getIntValue("Items.Chimaera_Wing.RecentlyHurt_Cooldown", 60); + } + + public boolean getChimaeraSoundEnabled() { + return getBooleanValue("Items.Chimaera_Wing.Sound_Enabled", true); + } + + public boolean getFluxPickaxeSoundEnabled() { + return getBooleanValue("Items.Flux_Pickaxe.Sound_Enabled", true); + } + + /* Particles */ + public boolean getAbilityActivationEffectEnabled() { + return getBooleanValue("Particles.Ability_Activation", true); + } + + public boolean getAbilityDeactivationEffectEnabled() { + return getBooleanValue("Particles.Ability_Deactivation", true); + } + + public boolean getBleedEffectEnabled() { + return getBooleanValue("Particles.Bleed", true); + } + + public boolean getDodgeEffectEnabled() { + return getBooleanValue("Particles.Dodge", true); + } + + public boolean getFluxEffectEnabled() { + return getBooleanValue("Particles.Flux", true); + } + + public boolean getGreaterImpactEffectEnabled() { + return getBooleanValue("Particles.Greater_Impact", true); + } + + public boolean getCallOfTheWildEffectEnabled() { + return getBooleanValue("Particles.Call_of_the_Wild", true); + } + + public boolean getLevelUpEffectsEnabled() { + return getBooleanValue("Particles.LevelUp_Enabled", true); + } + + public int getLevelUpEffectsTier() { + return getIntValue("Particles.LevelUp_Tier", 100); + } + + public boolean getLargeFireworks() { + return getBooleanValue("Particles.LargeFireworks", true); + } + + /* PARTY SETTINGS */ + public boolean getPartyFriendlyFire() { + return getBooleanValue("Party.FriendlyFire", false); + } + + public int getPartyMaxSize() { + return getIntValue("Party.MaxSize", -1); + } + + public int getAutoPartyKickInterval() { + return getIntValue("Party.AutoKick_Interval", 12); + } + + public int getAutoPartyKickTime() { + return getIntValue("Party.Old_Party_Member_Cutoff", 7); + } + + public double getPartyShareBonusBase() { + return getDoubleValue("Party.Sharing.ExpShare_bonus_base", 1.1D); + } + + public double getPartyShareBonusIncrease() { + return getDoubleValue("Party.Sharing.ExpShare_bonus_increase", 0.05D); + } + + public double getPartyShareBonusCap() { + return getDoubleValue("Party.Sharing.ExpShare_bonus_cap", 1.5D); + } + + public double getPartyShareRange() { + return getDoubleValue("Party.Sharing.Range", 75.0D); + } + + public int getPartyLevelCap() { + int cap = getIntValue("Party.Leveling.Level_Cap", 10); + return (cap <= 0) ? Integer.MAX_VALUE : cap; + } + + public int getPartyXpCurveMultiplier() { + return getIntValue("Party.Leveling.Xp_Curve_Modifier", 3); + } + + public boolean getPartyXpNearMembersNeeded() { + return getBooleanValue("Party.Leveling.Near_Members_Needed", false); + } + + public boolean getPartyInformAllMembers() { + return getBooleanValue("Party.Leveling.Inform_All_Party_Members_On_LevelUp", false); + } + + public int getPartyFeatureUnlockLevel(PartyFeature partyFeature) { + return getIntValue("Party.Leveling." + StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + "_UnlockLevel", 0); + } + + /* Party Teleport Settings */ + public int getPTPCommandCooldown() { + return getIntValue("Commands.ptp.Cooldown", 120); + } + + public int getPTPCommandWarmup() { + return getIntValue("Commands.ptp.Warmup", 5); + } + + public int getPTPCommandRecentlyHurtCooldown() { + return getIntValue("Commands.ptp.RecentlyHurt_Cooldown", 60); + } + + public int getPTPCommandTimeout() { + return getIntValue("Commands.ptp.Request_Timeout", 300); + } + + public boolean getPTPCommandConfirmRequired() { + return getBooleanValue("Commands.ptp.Accept_Required", true); + } + + public boolean getPTPCommandWorldPermissions() { + return getBooleanValue("Commands.ptp.World_Based_Permissions", false); + } + + /* Inspect command distance */ + public double getInspectDistance() { + return getDoubleValue("Commands.inspect.Max_Distance", 30.0D); + } + + /* + * ABILITY SETTINGS + */ + + /* General Settings */ + public boolean getUrlLinksEnabled() { + return getBooleanValue("Commands.Skills.URL_Links"); + } + + public boolean getAbilityMessagesEnabled() { + return getBooleanValue("Abilities.Messages", true); + } + + public boolean getAbilitiesEnabled() { + return getBooleanValue("Abilities.Enabled", true); + } + + public boolean getAbilitiesOnlyActivateWhenSneaking() { + return getBooleanValue("Abilities.Activation.Only_Activate_When_Sneaking", false); + } + + public boolean getAbilitiesGateEnabled() { + return getBooleanValue("Abilities.Activation.Level_Gate_Abilities"); + } + + public int getCooldown(SuperAbilityType ability) { + return getIntValue("Abilities.Cooldowns." + ability.toString()); + } + + public int getMaxLength(SuperAbilityType ability) { + return getIntValue("Abilities.Max_Seconds." + ability.toString()); + } + + /* Durability Settings */ + public int getAbilityToolDamage() { + return getIntValue("Abilities.Tools.Durability_Loss", 1); + } + + /* Thresholds */ + public int getTreeFellerThreshold() { + return getIntValue("Abilities.Limits.Tree_Feller_Threshold", 500); + } + + /* + * SKILL SETTINGS + */ + public boolean getDoubleDropsEnabled(PrimarySkillType skill, Material material) { + return getBooleanValue("Double_Drops." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); + } + + public boolean getDoubleDropsDisabled(PrimarySkillType skill) { + String skillName = StringUtils.getCapitalized(skill.toString()); + ConfigurationSection section = config.getConfigurationSection("Double_Drops." + skillName); + if (section == null) + return false; + Set keys = section.getKeys(false); + boolean disabled = true; + + for (String key : keys) { + if (getBooleanValue("Double_Drops." + skillName + "." + key)) { + disabled = false; + break; + } + } + + return disabled; + } + + /* Axes */ + public int getAxesGate() { + return getIntValue("Skills.Axes.Ability_Activation_Level_Gate", 10); + } + + /* Acrobatics */ + public boolean getDodgeLightningDisabled() { + return getBooleanValue("Skills.Acrobatics.Prevent_Dodge_Lightning", false); + } + + public int getXPAfterTeleportCooldown() { + return getIntValue("Skills.Acrobatics.XP_After_Teleport_Cooldown", 5); + } + + /* Alchemy */ + public boolean getEnabledForHoppers() { + return getBooleanValue("Skills.Alchemy.Enabled_for_Hoppers", true); + } + + public boolean getPreventHopperTransferIngredients() { + return getBooleanValue("Skills.Alchemy.Prevent_Hopper_Transfer_Ingredients", false); + } + + public boolean getPreventHopperTransferBottles() { + return getBooleanValue("Skills.Alchemy.Prevent_Hopper_Transfer_Bottles", false); + } + + /* Fishing */ + public boolean getFishingDropsEnabled() { + return getBooleanValue("Skills.Fishing.Drops_Enabled", true); + } + + public boolean getFishingOverrideTreasures() { + return getBooleanValue("Skills.Fishing.Override_Vanilla_Treasures", true); + } + + public boolean getFishingExtraFish() { + return getBooleanValue("Skills.Fishing.Extra_Fish", true); + } + + public double getFishingLureModifier() { + return getDoubleValue("Skills.Fishing.Lure_Modifier", 4.0D); + } + + /* Mining */ + public Material getDetonatorItem() { + return Material.matchMaterial(getStringValue("Skills.Mining.Detonator_Name", "FLINT_AND_STEEL")); + } + + public int getMiningGate() { + return getIntValue("Skills.Mining.Ability_Activation_Level_Gate", 10); + } + + /* Excavation */ + public int getExcavationGate() { + return getIntValue("Skills.Excavation.Ability_Activation_Level_Gate", 10); + } + + /* Repair */ + public boolean getRepairAnvilMessagesEnabled() { + return getBooleanValue("Skills.Repair.Anvil_Messages", true); + } + + public boolean getRepairAnvilPlaceSoundsEnabled() { + return getBooleanValue("Skills.Repair.Anvil_Placed_Sounds", true); + } + + public boolean getRepairAnvilUseSoundsEnabled() { + return getBooleanValue("Skills.Repair.Anvil_Use_Sounds", true); + } + + public Material getRepairAnvilMaterial() { + return Material.matchMaterial(getStringValue("Skills.Repair.Anvil_Material", "IRON_BLOCK")); + } + + public boolean getRepairConfirmRequired() { + return getBooleanValue("Skills.Repair.Confirm_Required", true); + } + + /* Salvage */ + public boolean getSalvageAnvilMessagesEnabled() { + return getBooleanValue("Skills.Salvage.Anvil_Messages", true); + } + + public boolean getSalvageAnvilPlaceSoundsEnabled() { + return getBooleanValue("Skills.Salvage.Anvil_Placed_Sounds", true); + } + + public boolean getSalvageAnvilUseSoundsEnabled() { + return getBooleanValue("Skills.Salvage.Anvil_Use_Sounds", true); + } + + public Material getSalvageAnvilMaterial() { + return Material.matchMaterial(getStringValue("Skills.Salvage.Anvil_Material", "GOLD_BLOCK")); + } + + public boolean getSalvageConfirmRequired() { + return getBooleanValue("Skills.Salvage.Confirm_Required", true); + } + + /* Unarmed */ + public boolean getUnarmedBlockCrackerSmoothbrickToCracked() { + return getBooleanValue("Skills.Unarmed.Block_Cracker.SmoothBrick_To_CrackedBrick", true); + } + + public boolean getUnarmedItemPickupDisabled() { + return getBooleanValue("Skills.Unarmed.Item_Pickup_Disabled_Full_Inventory", true); + } + + public boolean getUnarmedItemsAsUnarmed() { + return getBooleanValue("Skills.Unarmed.Items_As_Unarmed", false); + } + + public int getUnarmedGate() { + return getIntValue("Skills.Unarmed.Ability_Activation_Level_Gate", 10); + } + + /* Swords */ + public int getSwordsGate() { + return getIntValue("Skills.Swords.Ability_Activation_Level_Gate", 10); + } + + /* Taming */ + public Material getTamingCOTWMaterial(EntityType type) { + return Material.matchMaterial(getStringValue("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Material")); + } + + public int getTamingCOTWCost(EntityType type) { + return getIntValue("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Amount"); + } + + public int getTamingCOTWAmount(EntityType type) { + return getIntValue("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Summon_Amount"); + } + + public int getTamingCOTWLength(EntityType type) { + return getIntValue("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Summon_Length"); + } + + public int getTamingCOTWMaxAmount(EntityType type) { + return getIntValue("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Summon_Max_Amount"); + } + + public double getTamingCOTWRange() { + return getDoubleValue("Skills.Taming.Call_Of_The_Wild.Range", 40.0D); + } + + /* Woodcutting */ + public boolean getWoodcuttingDoubleDropsEnabled(BlockData material) { + return getBooleanValue("Double_Drops.Woodcutting." + StringUtils.getFriendlyConfigBlockDataString(material)); + } + + public boolean getTreeFellerSoundsEnabled() { + return getBooleanValue("Skills.Woodcutting.Tree_Feller_Sounds", true); + } + + public int getWoodcuttingGate() { + return getIntValue("Skills.Woodcutting.Ability_Activation_Level_Gate", 10); + } + + /* AFK Leveling */ + public boolean getAcrobaticsPreventAFK() { + return getBooleanValue("Skills.Acrobatics.Prevent_AFK_Leveling", true); + } + + public int getAcrobaticsAFKMaxTries() { + return getIntValue("Skills.Acrobatics.Max_Tries_At_Same_Location", 3); + } + + public boolean getHerbalismPreventAFK() { + return getBooleanValue("Skills.Herbalism.Prevent_AFK_Leveling", true); + } + + /* Level Caps */ + public int getPowerLevelCap() { + int cap = getIntValue("General.Power_Level_Cap", 0); + return (cap <= 0) ? Integer.MAX_VALUE : cap; + } + + public int getLevelCap(PrimarySkillType skill) { + int cap = getIntValue("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Level_Cap"); + return (cap <= 0) ? Integer.MAX_VALUE : cap; + } + + + /*public int isSuperAbilityUnlocked(PrimarySkillType skill) { + return getIntValue("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Ability_Activation_Level_Gate"); + }*/ + + public boolean getTruncateSkills() { + return getBooleanValue("General.TruncateSkills", false); + } + + /* PVP & PVE Settings */ + public boolean getPVPEnabled(PrimarySkillType skill) { + return getBooleanValue("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVP", true); + } + + public boolean getPVEEnabled(PrimarySkillType skill) { + return getBooleanValue("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVE", true); + } + + //public float getMasterVolume() { return (float) getDoubleValue("Sounds.MasterVolume", 1.0); } +} diff --git a/core/src/main/java/com/gmail/nossr50/core/config/RankConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/RankConfig.java index 5d2ad8f34..fe584a4e4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/RankConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/RankConfig.java @@ -7,12 +7,11 @@ import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; import java.util.ArrayList; import java.util.List; -public class RankConfig extends ConfigurableLoader { +public class RankConfig extends ConfigValidated { private static RankConfig instance; public RankConfig() { super(McmmoCore.getDataFolderPath().getAbsoluteFile(),"skillranks.yml"); - validate(); this.instance = this; } @@ -24,12 +23,22 @@ public class RankConfig extends ConfigurableLoader { } @Override - protected void loadKeys() { + public void unload() { + instance = null; + } + /** + * The version of this config + * + * @return + */ + @Override + public double getConfigVersion() { + return 1; } @Override - protected boolean validateKeys() { + public List validateKeys() { List reason = new ArrayList(); /* @@ -37,7 +46,7 @@ public class RankConfig extends ConfigurableLoader { */ checkKeys(reason); - return noErrorsInConfig(reason); + return reason; } /** @@ -74,14 +83,14 @@ public class RankConfig extends ConfigurableLoader { * @return the level requirement for a subskill at this particular rank */ private int findRankByRootAddress(int rank, String key) { - String scalingKey = Config.getInstance().getIsRetroMode() ? ".RetroMode." : ".Standard."; + String scalingKey = MainConfig.getInstance().getIsRetroMode() ? ".RetroMode." : ".Standard."; String targetRank = "Rank_" + rank; key += scalingKey; key += targetRank; - return config.getInt(key); + return getIntValue(key); } /** diff --git a/core/src/main/java/com/gmail/nossr50/core/config/RegistersKeys.java b/core/src/main/java/com/gmail/nossr50/core/config/RegistersKeys.java new file mode 100644 index 000000000..fa5ca1639 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/config/RegistersKeys.java @@ -0,0 +1,11 @@ +package com.gmail.nossr50.core.config; + +/** + * A class that registers keys + */ +public interface RegistersKeys { + /** + * Loads up keys + */ + void loadKeys(); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/config/SoundConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/SoundConfig.java index aabae1077..05abe9987 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/SoundConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/SoundConfig.java @@ -3,12 +3,14 @@ package com.gmail.nossr50.core.config; import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.util.sounds.SoundType; -public class SoundConfig extends ConfigurableLoader { +import java.util.ArrayList; +import java.util.List; + +public class SoundConfig extends ConfigValidated { private static SoundConfig instance; public SoundConfig() { super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "sounds.yml"); - validate(); this.instance = this; } @@ -20,45 +22,56 @@ public class SoundConfig extends ConfigurableLoader { } @Override - protected void loadKeys() { + public void unload() { + instance = null; + } + /** + * The version of this config + * + * @return + */ + @Override + public double getConfigVersion() { + return 1; } @Override - protected boolean validateKeys() { + public List validateKeys() { + ArrayList reasons = new ArrayList<>(); + for (SoundType soundType : SoundType.values()) { - if (config.getDouble("Sounds." + soundType.toString() + ".Volume") < 0) { - plugin.getLogger().info("[mcMMO] Sound volume cannot be below 0 for " + soundType.toString()); - return false; + if (getDoubleValue("Sounds." + soundType.toString() + ".Volume") < 0) { + reasons.add("[mcMMO] Sound volume cannot be below 0 for " + soundType.toString()); } //Sounds with custom pitching don't use pitch values if (!soundType.usesCustomPitch()) { - if (config.getDouble("Sounds." + soundType.toString() + ".Pitch") < 0) { - plugin.getLogger().info("[mcMMO] Sound pitch cannot be below 0 for " + soundType.toString()); - return false; + if (getDoubleValue("Sounds." + soundType.toString() + ".Pitch") < 0) { + reasons.add("[mcMMO] Sound pitch cannot be below 0 for " + soundType.toString()); } } } - return true; + + return reasons; } public float getMasterVolume() { - return (float) config.getDouble("Sounds.MasterVolume", 1.0); + return (float) getDoubleValue("Sounds.MasterVolume", 1.0); } public float getVolume(SoundType soundType) { String key = "Sounds." + soundType.toString() + ".Volume"; - return (float) config.getDouble(key); + return (float) getDoubleValue(key); } public float getPitch(SoundType soundType) { String key = "Sounds." + soundType.toString() + ".Pitch"; - return (float) config.getDouble(key); + return (float) getDoubleValue(key); } public boolean getIsEnabled(SoundType soundType) { String key = "Sounds." + soundType.toString() + ".Enabled"; - return config.getBoolean(key, true); + return getBooleanValue(key, true); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/Unload.java b/core/src/main/java/com/gmail/nossr50/core/config/Unload.java new file mode 100644 index 000000000..f7dd3bdb4 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/config/Unload.java @@ -0,0 +1,8 @@ +package com.gmail.nossr50.core.config; + +/** + * Unloads values, sort of like a constructor + */ +public interface Unload { + void unload(); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java index 6a5621bb2..056a8ca17 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.config.experience; import com.gmail.nossr50.core.McmmoCore; -import com.gmail.nossr50.core.config.ConfigurableLoader; +import com.gmail.nossr50.core.config.ConfigValidated; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.skills.MaterialType; import com.gmail.nossr50.core.skills.PotionStage; @@ -11,12 +11,11 @@ import com.gmail.nossr50.core.util.StringUtils; import java.util.ArrayList; import java.util.List; -public class ExperienceConfig extends ConfigurableLoader { +public class ExperienceConfig extends ConfigValidated { private static ExperienceConfig instance; private ExperienceConfig() { - super(McmmoCore.getDataFolderPath().getAbsoluteFile(),"experience.yml"); - validate(); + super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "experience.yml"); } public static ExperienceConfig getInstance() { @@ -27,12 +26,23 @@ public class ExperienceConfig extends ConfigurableLoader { return instance; } + /** + * The version of this config + * + * @return + */ @Override - protected void loadKeys() { + public double getConfigVersion() { + return 1; } @Override - protected boolean validateKeys() { + public void unload() { + instance = null; //TODO: this might be a bit problematic + } + + @Override + public List validateKeys() { List reason = new ArrayList(); /* @@ -131,7 +141,7 @@ public class ExperienceConfig extends ConfigurableLoader { reason.add("Experience.Taming.Animal_Taming.Ocelot should be greater than 0!"); } - return noErrorsInConfig(reason); + return reason; } /* @@ -140,34 +150,34 @@ public class ExperienceConfig extends ConfigurableLoader { /* EXPLOIT TOGGLES */ public boolean isEndermanEndermiteFarmingPrevented() { - return config.getBoolean("ExploitFix.EndermanEndermiteFarms", true); + return getBooleanValue("ExploitFix.EndermanEndermiteFarms", true); } /* Curve settings */ public FormulaType getFormulaType() { - return FormulaType.getFormulaType(config.getString("Experience_Formula.Curve")); + return FormulaType.getFormulaType(getStringValue("Experience_Formula.Curve")); } public boolean getCumulativeCurveEnabled() { - return config.getBoolean("Experience_Formula.Cumulative_Curve", false); + return getBooleanValue("Experience_Formula.Cumulative_Curve", false); } /* Curve values */ public double getMultiplier(FormulaType type) { - return config.getDouble("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.multiplier"); + return getDoubleValue("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.multiplier"); } public int getBase(FormulaType type) { - return config.getInt("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.base"); + return getIntValue("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.base"); } public double getExponent(FormulaType type) { - return config.getDouble("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.exponent"); + return getDoubleValue("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.exponent"); } /* Global modifier */ public double getExperienceGainsGlobalMultiplier() { - return config.getDouble("Experience_Formula.Multiplier.Global", 1.0); + return getDoubleValue("Experience_Formula.Multiplier.Global", 1.0); } public void setExperienceGainsGlobalMultiplier(double value) { @@ -176,48 +186,48 @@ public class ExperienceConfig extends ConfigurableLoader { /* PVP modifier */ public double getPlayerVersusPlayerXP() { - return config.getDouble("Experience_Formula.Multiplier.PVP", 1.0); + return getDoubleValue("Experience_Formula.Multiplier.PVP", 1.0); } /* Spawned Mob modifier */ public double getSpawnedMobXpMultiplier() { - return config.getDouble("Experience_Formula.Mobspawners.Multiplier", 0.0); + return getDoubleValue("Experience_Formula.Mobspawners.Multiplier", 0.0); } public double getBredMobXpMultiplier() { - return config.getDouble("Experience_Formula.Breeding.Multiplier", 1.0); + return getDoubleValue("Experience_Formula.Breeding.Multiplier", 1.0); } /* Skill modifiers */ public double getFormulaSkillModifier(PrimarySkillType skill) { - return config.getDouble("Experience_Formula.Modifier." + StringUtils.getCapitalized(skill.toString())); + return getDoubleValue("Experience_Formula.Modifier." + StringUtils.getCapitalized(skill.toString())); } /* Custom XP perk */ public double getCustomXpPerkBoost() { - return config.getDouble("Experience_Formula.Custom_XP_Perk.Boost", 1.25); + return getDoubleValue("Experience_Formula.Custom_XP_Perk.Boost", 1.25); } /* Diminished Returns */ public float getDiminishedReturnsCap() { - return (float) config.getDouble("Dimished_Returns.Guaranteed_Minimum_Percentage", 0.05D); + return (float) getDoubleValue("Dimished_Returns.Guaranteed_Minimum_Percentage", 0.05D); } public boolean getDiminishedReturnsEnabled() { - return config.getBoolean("Diminished_Returns.Enabled", false); + return getBooleanValue("Diminished_Returns.Enabled", false); } public int getDiminishedReturnsThreshold(PrimarySkillType skill) { - return config.getInt("Diminished_Returns.Threshold." + StringUtils.getCapitalized(skill.toString()), 20000); + return getIntValue("Diminished_Returns.Threshold." + StringUtils.getCapitalized(skill.toString()), 20000); } public int getDiminishedReturnsTimeInterval() { - return config.getInt("Diminished_Returns.Time_Interval", 10); + return getIntValue("Diminished_Returns.Time_Interval", 10); } /* Conversion */ public double getExpModifier() { - return config.getDouble("Conversion.Exp_Modifier", 1); + return getDoubleValue("Conversion.Exp_Modifier", 1); } /* @@ -226,20 +236,20 @@ public class ExperienceConfig extends ConfigurableLoader { /* General Settings */ public boolean getExperienceGainsPlayerVersusPlayerEnabled() { - return config.getBoolean("Experience.PVP.Rewards", true); + return getBooleanValue("Experience.PVP.Rewards", true); } /* Combat XP Multipliers */ public double getCombatXP(EntityType entity) { - return config.getDouble("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); + return getDoubleValue("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); } public double getAnimalsXP(EntityType entity) { - return config.getDouble("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_"), getAnimalsXP()); + return getDoubleValue("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_"), getAnimalsXP()); } public double getAnimalsXP() { - return config.getDouble("Experience.Combat.Multiplier.Animals", 1.0); + return getDoubleValue("Experience.Combat.Multiplier.Animals", 1.0); } public boolean hasCombatXP(EntityType entity) { @@ -251,13 +261,13 @@ public class ExperienceConfig extends ConfigurableLoader { String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + "."; String explicitString = baseString + StringUtils.getExplicitConfigMaterialString(data); if (config.contains(explicitString)) - return config.getInt(explicitString); + return getIntValue(explicitString); String friendlyString = baseString + StringUtils.getFriendlyConfigMaterialString(data); if (config.contains(friendlyString)) - return config.getInt(friendlyString); + return getIntValue(friendlyString); String wildcardString = baseString + StringUtils.getWildcardConfigMaterialString(data); if (config.contains(wildcardString)) - return config.getInt(wildcardString); + return getIntValue(wildcardString); return 0; } @@ -266,13 +276,13 @@ public class ExperienceConfig extends ConfigurableLoader { String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + "."; String explicitString = baseString + StringUtils.getExplicitConfigBlockDataString(data); if (config.contains(explicitString)) - return config.getInt(explicitString); + return getIntValue(explicitString); String friendlyString = baseString + StringUtils.getFriendlyConfigBlockDataString(data); if (config.contains(friendlyString)) - return config.getInt(friendlyString); + return getIntValue(friendlyString); String wildcardString = baseString + StringUtils.getWildcardConfigBlockDataString(data); if (config.contains(wildcardString)) - return config.getInt(wildcardString); + return getIntValue(wildcardString); return 0; } @@ -305,31 +315,31 @@ public class ExperienceConfig extends ConfigurableLoader { */ public boolean isPartyExperienceBarsEnabled() { - return config.getBoolean("Experience_Bars.Update.Party", true); + return getBooleanValue("Experience_Bars.Update.Party", true); } public boolean isPassiveGainsExperienceBarsEnabled() { - return config.getBoolean("Experience_Bars.Update.Passive", true); + return getBooleanValue("Experience_Bars.Update.Passive", true); } public boolean getDoExperienceBarsAlwaysUpdateTitle() { - return config.getBoolean("Experience_Bars.ThisMayCauseLag.AlwaysUpdateTitlesWhenXPIsGained.Enable", false) || getAddExtraDetails(); + return getBooleanValue("Experience_Bars.ThisMayCauseLag.AlwaysUpdateTitlesWhenXPIsGained.Enable", false) || getAddExtraDetails(); } public boolean getAddExtraDetails() { - return config.getBoolean("Experience_Bars.ThisMayCauseLag.AlwaysUpdateTitlesWhenXPIsGained.ExtraDetails", false); + return getBooleanValue("Experience_Bars.ThisMayCauseLag.AlwaysUpdateTitlesWhenXPIsGained.ExtraDetails", false); } public boolean isExperienceBarsEnabled() { - return config.getBoolean("Experience_Bars.Enable", true); + return getBooleanValue("Experience_Bars.Enable", true); } public boolean isExperienceBarEnabled(PrimarySkillType primarySkillType) { - return config.getBoolean("Experience_Bars." + StringUtils.getCapitalized(primarySkillType.toString()) + ".Enable", true); + return getBooleanValue("Experience_Bars." + StringUtils.getCapitalized(primarySkillType.toString()) + ".Enable", true); } public BarColor getExperienceBarColor(PrimarySkillType primarySkillType) { - String colorValueFromConfig = config.getString("Experience_Bars." + StringUtils.getCapitalized(primarySkillType.toString()) + ".Color"); + String colorValueFromConfig = getStringValue("Experience_Bars." + StringUtils.getCapitalized(primarySkillType.toString()) + ".Color"); for (BarColor barColor : BarColor.values()) { if (barColor.toString().equalsIgnoreCase(colorValueFromConfig)) @@ -341,7 +351,7 @@ public class ExperienceConfig extends ConfigurableLoader { } public BarStyle getExperienceBarStyle(PrimarySkillType primarySkillType) { - String colorValueFromConfig = config.getString("Experience_Bars." + StringUtils.getCapitalized(primarySkillType.toString()) + ".BarStyle"); + String colorValueFromConfig = getStringValue("Experience_Bars." + StringUtils.getCapitalized(primarySkillType.toString()) + ".BarStyle"); for (BarStyle barStyle : BarStyle.values()) { if (barStyle.toString().equalsIgnoreCase(colorValueFromConfig)) @@ -354,46 +364,46 @@ public class ExperienceConfig extends ConfigurableLoader { /* Acrobatics */ public int getDodgeXPModifier() { - return config.getInt("Experience.Acrobatics.Dodge", 120); + return getIntValue("Experience.Acrobatics.Dodge", 120); } public int getRollXPModifier() { - return config.getInt("Experience.Acrobatics.Roll", 80); + return getIntValue("Experience.Acrobatics.Roll", 80); } public int getFallXPModifier() { - return config.getInt("Experience.Acrobatics.Fall", 120); + return getIntValue("Experience.Acrobatics.Fall", 120); } public double getFeatherFallXPModifier() { - return config.getDouble("Experience.Acrobatics.FeatherFall_Multiplier", 2.0); + return getDoubleValue("Experience.Acrobatics.FeatherFall_Multiplier", 2.0); } /* Alchemy */ public double getPotionXP(PotionStage stage) { - return config.getDouble("Experience.Alchemy.Potion_Stage_" + stage.toNumerical(), 10D); + return getDoubleValue("Experience.Alchemy.Potion_Stage_" + stage.toNumerical(), 10D); } /* Archery */ public double getArcheryDistanceMultiplier() { - return config.getDouble("Experience.Archery.Distance_Multiplier", 0.025); + return getDoubleValue("Experience.Archery.Distance_Multiplier", 0.025); } public int getFishingShakeXP() { - return config.getInt("Experience.Fishing.Shake", 50); + return getIntValue("Experience.Fishing.Shake", 50); } /* Repair */ public double getRepairXPBase() { - return config.getDouble("Experience.Repair.Base", 1000.0); + return getDoubleValue("Experience.Repair.Base", 1000.0); } public double getRepairXP(MaterialType repairMaterialType) { - return config.getDouble("Experience.Repair." + StringUtils.getCapitalized(repairMaterialType.toString())); + return getDoubleValue("Experience.Repair." + StringUtils.getCapitalized(repairMaterialType.toString())); } /* Taming */ public int getTamingXP(EntityType type) { - return config.getInt("Experience.Taming.Animal_Taming." + StringUtils.getPrettyEntityTypeString(type)); + return getIntValue("Experience.Taming.Animal_Taming." + StringUtils.getPrettyEntityTypeString(type)); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/ArmorConfigManager.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/ArmorConfigManager.java index 2bb39b343..37d6eda0e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/ArmorConfigManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/ArmorConfigManager.java @@ -1,15 +1,16 @@ package com.gmail.nossr50.core.config.mods; +import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.util.ModManager; import java.io.File; import java.util.regex.Pattern; public class ArmorConfigManager { - public ArmorConfigManager(mcMMO plugin) { + public ArmorConfigManager() { Pattern middlePattern = Pattern.compile("armor\\.(?:.+)\\.yml"); Pattern startPattern = Pattern.compile("(?:.+)\\.armor\\.yml"); - File dataFolder = new File(mcMMO.getModDirectory()); + File dataFolder = new File(McmmoCore.getModDataFolderPath()); File vanilla = new File(dataFolder, "armor.default.yml"); ModManager modManager = mcMMO.getModManager(); diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/BlockConfigManager.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/BlockConfigManager.java index c094f6782..d0ec88bf6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/BlockConfigManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/BlockConfigManager.java @@ -1,18 +1,18 @@ package com.gmail.nossr50.core.config.mods; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.ModManager; +import com.gmail.nossr50.core.McmmoCore; +import com.gmail.nossr50.core.util.ModManager; import java.io.File; import java.util.regex.Pattern; public class BlockConfigManager { - public BlockConfigManager(mcMMO plugin) { + public BlockConfigManager() { Pattern middlePattern = Pattern.compile("blocks\\.(?:.+)\\.yml"); Pattern startPattern = Pattern.compile("(?:.+)\\.blocks\\.yml"); - File dataFolder = new File(mcMMO.getModDirectory()); + File dataFolder = new File(McmmoCore.getModDataFolderPath()); File vanilla = new File(dataFolder, "blocks.default.yml"); - ModManager modManager = mcMMO.getModManager(); + ModManager modManager = McmmoCore.getModManager(); if (!vanilla.exists()) { plugin.saveResource(vanilla.getParentFile().getName() + File.separator + "blocks.default.yml", false); diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java index dc119ef6d..b916451b2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java @@ -1,22 +1,19 @@ package com.gmail.nossr50.core.config.mods; import com.gmail.nossr50.core.McmmoCore; -import com.gmail.nossr50.core.config.ConfigLoader; -import com.gmail.nossr50.core.config.ConfigurableLoader; -import com.gmail.nossr50.core.mcmmo.skills.ItemType; -import com.gmail.nossr50.core.mcmmo.skills.MaterialType; -import com.gmail.nossr50.skills.repair.repairables.Repairable; -import com.gmail.nossr50.skills.repair.repairables.RepairableFactory; -import com.gmail.nossr50.util.skills.SkillUtils; -import org.bukkit.Material; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.config.ConfigKeyRegister; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; +import com.gmail.nossr50.core.skills.ItemType; +import com.gmail.nossr50.core.skills.MaterialType; +import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; +import com.gmail.nossr50.core.skills.primary.repair.repairables.RepairableFactory; +import com.gmail.nossr50.core.util.skills.SkillUtils; import java.util.ArrayList; import java.util.List; import java.util.Set; -public class CustomArmorConfig extends ConfigurableLoader { +public class CustomArmorConfig extends ConfigKeyRegister { public List customBoots = new ArrayList(); public List customChestplates = new ArrayList(); public List customHelmets = new ArrayList(); @@ -29,8 +26,18 @@ public class CustomArmorConfig extends ConfigurableLoader { loadKeys(); } + /** + * The version of this config + * + * @return + */ @Override - protected void loadKeys() { + public double getConfigVersion() { + return 1; + } + + @Override + public void loadKeys() { loadArmor("Boots", customBoots); loadArmor("Chestplates", customChestplates); loadArmor("Helmets", customHelmets); @@ -68,8 +75,8 @@ public class CustomArmorConfig extends ConfigurableLoader { continue; } - boolean repairable = config.getBoolean(armorType + "." + armorName + ".Repairable"); - Material repairMaterial = Material.matchMaterial(config.getString(armorType + "." + armorName + ".Repair_Material", "")); + boolean repairable = getBooleanValue(armorType + "." + armorName + ".Repairable"); + Material repairMaterial = Material.matchMaterial(getStringValue(armorType + "." + armorName + ".Repair_Material", "")); if (repairable && (repairMaterial == null)) { plugin.getLogger().warning("Incomplete repair information. This item will be unrepairable. - " + armorName); @@ -77,21 +84,21 @@ public class CustomArmorConfig extends ConfigurableLoader { } if (repairable) { - byte repairData = (byte) config.getInt(armorType + "." + armorName + ".Repair_Material_Data_Value", -1); + byte repairData = (byte) getIntValue(armorType + "." + armorName + ".Repair_Material_Data_Value", -1); int repairQuantity = SkillUtils.getRepairAndSalvageQuantities(new ItemStack(armorMaterial), repairMaterial, repairData); if (repairQuantity == 0) { - repairQuantity = config.getInt(armorType + "." + armorName + ".Repair_Material_Quantity", 2); + repairQuantity = getIntValue(armorType + "." + armorName + ".Repair_Material_Quantity", 2); } - String repairItemName = config.getString(armorType + "." + armorName + ".Repair_Material_Pretty_Name"); - int repairMinimumLevel = config.getInt(armorType + "." + armorName + ".Repair_MinimumLevel", 0); - double repairXpMultiplier = config.getDouble(armorType + "." + armorName + ".Repair_XpMultiplier", 1); + String repairItemName = getStringValue(armorType + "." + armorName + ".Repair_Material_Pretty_Name"); + int repairMinimumLevel = getIntValue(armorType + "." + armorName + ".Repair_MinimumLevel", 0); + double repairXpMultiplier = getDoubleValue(armorType + "." + armorName + ".Repair_XpMultiplier", 1); short durability = armorMaterial.getMaxDurability(); if (durability == 0) { - durability = (short) config.getInt(armorType + "." + armorName + ".Durability", 70); + durability = (short) getIntValue(armorType + "." + armorName + ".Durability", 70); } repairables.add(RepairableFactory.getRepairable(armorMaterial, repairMaterial, repairData, repairItemName, repairMinimumLevel, repairQuantity, durability, ItemType.ARMOR, MaterialType.OTHER, repairXpMultiplier)); diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java index 6d995a367..20a9b429b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.core.config.mods; import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.config.ConfigLoader; -import com.gmail.nossr50.core.config.ConfigurableLoader; +import com.gmail.nossr50.core.config.ConfigKeyRegister; import com.gmail.nossr50.core.mcmmo.mods.CustomBlock; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; @@ -12,7 +12,7 @@ import java.util.HashMap; import java.util.List; import java.util.Set; -public class CustomBlockConfig extends ConfigurableLoader { +public class CustomBlockConfig extends ConfigKeyRegister { public List customExcavationBlocks = new ArrayList<>(); public List customHerbalismBlocks = new ArrayList<>(); public List customMiningBlocks = new ArrayList<>(); @@ -78,14 +78,14 @@ public class CustomBlockConfig extends ConfigurableLoader { continue; } - int xp = config.getInt(skillType + "." + blockName + ".XP_Gain"); + int xp = getIntValue(skillType + "." + blockName + ".XP_Gain"); int smeltingXp = 0; - if (skillType.equals("Mining") && config.getBoolean(skillType + "." + blockName + ".Is_Ore")) { + if (skillType.equals("Mining") && getBooleanValue(skillType + "." + blockName + ".Is_Ore")) { customOres.add(blockMaterial); - smeltingXp = config.getInt(skillType + "." + blockName + ".Smelting_XP_Gain", xp / 10); + smeltingXp = getIntValue(skillType + "." + blockName + ".Smelting_XP_Gain", xp / 10); } else if (skillType.equals("Woodcutting")) { - if (config.getBoolean(skillType + "." + blockName + ".Is_Log")) { + if (getBooleanValue(skillType + "." + blockName + ".Is_Log")) { customLogs.add(blockMaterial); } else { customLeaves.add(blockMaterial); @@ -93,7 +93,7 @@ public class CustomBlockConfig extends ConfigurableLoader { } } - customBlockMap.put(blockMaterial, new CustomBlock(xp, config.getBoolean(skillType + "." + blockName + ".Double_Drops_Enabled"), smeltingXp)); + customBlockMap.put(blockMaterial, new CustomBlock(xp, getBooleanValue(skillType + "." + blockName + ".Double_Drops_Enabled"), smeltingXp)); } } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java index 95293cade..24dd9914d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.core.config.mods; import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.config.ConfigLoader; -import com.gmail.nossr50.core.config.ConfigurableLoader; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.mcmmo.mods.CustomEntity; import org.apache.commons.lang.ClassUtils; import org.bukkit.Material; @@ -10,7 +10,7 @@ import org.bukkit.inventory.ItemStack; import java.util.HashMap; -public class CustomEntityConfig extends ConfigurableLoader { +public class CustomEntityConfig extends Config { public HashMap customEntityClassMap = new HashMap(); public HashMap customEntityTypeMap = new HashMap(); @@ -28,7 +28,7 @@ public class CustomEntityConfig extends ConfigurableLoader { for (String entityName : config.getKeys(false)) { Class clazz = null; - String className = config.getString(entityName + ".Class", ""); + String className = getStringValue(entityName + ".Class", ""); try { clazz = ClassUtils.getClass(className); @@ -38,15 +38,15 @@ public class CustomEntityConfig extends ConfigurableLoader { } String entityTypeName = entityName.replace("_", "."); - double xpMultiplier = config.getDouble(entityName + ".XP_Multiplier", 1.0D); + double xpMultiplier = getDoubleValue(entityName + ".XP_Multiplier", 1.0D); - boolean canBeTamed = config.getBoolean(entityName + ".Tameable"); - int tamingXp = config.getInt(entityName + ".Taming_XP"); + boolean canBeTamed = getBooleanValue(entityName + ".Tameable"); + int tamingXp = getIntValue(entityName + ".Taming_XP"); - boolean canBeSummoned = config.getBoolean(entityName + ".CanBeSummoned"); - Material callOfTheWildMaterial = Material.matchMaterial(config.getString(entityName + ".COTW_Material", "")); - byte callOfTheWildData = (byte) config.getInt(entityName + ".COTW_Material_Data"); - int callOfTheWildAmount = config.getInt(entityName + ".COTW_Material_Amount"); + boolean canBeSummoned = getBooleanValue(entityName + ".CanBeSummoned"); + Material callOfTheWildMaterial = Material.matchMaterial(getStringValue(entityName + ".COTW_Material", "")); + byte callOfTheWildData = (byte) getIntValue(entityName + ".COTW_Material_Data"); + int callOfTheWildAmount = getIntValue(entityName + ".COTW_Material_Amount"); if (canBeSummoned && (callOfTheWildMaterial == null || callOfTheWildAmount == 0)) { plugin.getLogger().warning("Incomplete Call of the Wild information. This entity will not be able to be summoned by Call of the Wild."); diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java index 4a8ba56c2..5897ec3e7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.core.config.mods; import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.config.ConfigLoader; -import com.gmail.nossr50.core.config.ConfigurableLoader; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.mcmmo.mods.CustomTool; import com.gmail.nossr50.core.mcmmo.skills.ItemType; import com.gmail.nossr50.core.mcmmo.skills.MaterialType; @@ -18,7 +18,7 @@ import java.util.HashMap; import java.util.List; import java.util.Set; -public class CustomToolConfig extends ConfigurableLoader { +public class CustomToolConfig extends Config { public List customAxes = new ArrayList(); public List customBows = new ArrayList(); public List customHoes = new ArrayList(); @@ -75,8 +75,8 @@ public class CustomToolConfig extends ConfigurableLoader { continue; } - boolean repairable = config.getBoolean(toolType + "." + toolName + ".Repairable"); - Material repairMaterial = Material.matchMaterial(config.getString(toolType + "." + toolName + ".Repair_Material", "")); + boolean repairable = getBooleanValue(toolType + "." + toolName + ".Repairable"); + Material repairMaterial = Material.matchMaterial(getStringValue(toolType + "." + toolName + ".Repair_Material", "")); if (repairable && (repairMaterial == null)) { plugin.getLogger().warning("Incomplete repair information. This item will be unrepairable. - " + toolName); @@ -84,29 +84,29 @@ public class CustomToolConfig extends ConfigurableLoader { } if (repairable) { - byte repairData = (byte) config.getInt(toolType + "." + toolName + ".Repair_Material_Data_Value", -1); + byte repairData = (byte) getIntValue(toolType + "." + toolName + ".Repair_Material_Data_Value", -1); int repairQuantity = SkillUtils.getRepairAndSalvageQuantities(new ItemStack(toolMaterial), repairMaterial, repairData); if (repairQuantity == 0) { - repairQuantity = config.getInt(toolType + "." + toolName + ".Repair_Material_Quantity", 2); + repairQuantity = getIntValue(toolType + "." + toolName + ".Repair_Material_Quantity", 2); } - String repairItemName = config.getString(toolType + "." + toolName + ".Repair_Material_Pretty_Name"); - int repairMinimumLevel = config.getInt(toolType + "." + toolName + ".Repair_MinimumLevel", 0); - double repairXpMultiplier = config.getDouble(toolType + "." + toolName + ".Repair_XpMultiplier", 1); + String repairItemName = getStringValue(toolType + "." + toolName + ".Repair_Material_Pretty_Name"); + int repairMinimumLevel = getIntValue(toolType + "." + toolName + ".Repair_MinimumLevel", 0); + double repairXpMultiplier = getDoubleValue(toolType + "." + toolName + ".Repair_XpMultiplier", 1); short durability = toolMaterial.getMaxDurability(); if (durability == 0) { - durability = (short) config.getInt(toolType + "." + toolName + ".Durability", 60); + durability = (short) getIntValue(toolType + "." + toolName + ".Durability", 60); } repairables.add(RepairableFactory.getRepairable(toolMaterial, repairMaterial, repairData, repairItemName, repairMinimumLevel, repairQuantity, durability, ItemType.TOOL, MaterialType.OTHER, repairXpMultiplier)); } - double multiplier = config.getDouble(toolType + "." + toolName + ".XP_Modifier", 1.0); - boolean abilityEnabled = config.getBoolean(toolType + "." + toolName + ".Ability_Enabled", true); - int tier = config.getInt(toolType + "." + toolName + ".Tier", 1); + double multiplier = getDoubleValue(toolType + "." + toolName + ".XP_Modifier", 1.0); + boolean abilityEnabled = getBooleanValue(toolType + "." + toolName + ".Ability_Enabled", true); + int tier = getIntValue(toolType + "." + toolName + ".Tier", 1); CustomTool tool = new CustomTool(tier, abilityEnabled, multiplier); diff --git a/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java index 64cde7761..6c1db862a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java @@ -1,14 +1,10 @@ package com.gmail.nossr50.core.config.party; import com.gmail.nossr50.core.McmmoCore; -import com.gmail.nossr50.core.config.ConfigLoader; -import com.gmail.nossr50.core.config.ConfigurableLoader; -import com.gmail.nossr50.util.StringUtils; -import org.bukkit.Material; +import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.util.StringUtils; -import java.util.HashSet; - -public class ItemWeightConfig extends ConfigurableLoader { +public class ItemWeightConfig extends Config { private static ItemWeightConfig instance; private ItemWeightConfig() { @@ -24,13 +20,13 @@ public class ItemWeightConfig extends ConfigurableLoader { } public int getItemWeight(Material material) { - return config.getInt("Item_Weights." + StringUtils.getPrettyItemString(material).replace(" ", "_"), config.getInt("Item_Weights.Default")); + return getIntValue("Item_Weights." + StringUtils.getPrettyItemString(material).replace(" ", "_"), getIntValue("Item_Weights.Default")); } public HashSet getMiscItems() { HashSet miscItems = new HashSet(); - for (String item : config.getStringList("Party_Shareables.Misc_Items")) { + for (String item : getStringValueList("Party_Shareables.Misc_Items")) { Material material = Material.getMaterial(item.toUpperCase()); if (material != null) { diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java index 9e434116e..ada2e96b5 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.config.skills.alchemy; import com.gmail.nossr50.core.McmmoCore; -import com.gmail.nossr50.core.config.ConfigurableLoader; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.mcmmo.colors.ChatColor; import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyPotion; @@ -12,7 +12,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -public class PotionConfig extends ConfigurableLoader { +public class PotionConfig extends Config { private static PotionConfig instance; private List concoctionsIngredientsTierOne = new ArrayList(); diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java index f0238a5e4..0c2530907 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java @@ -1,22 +1,19 @@ -package com.gmail.nossr50.config.skills.repair; +package com.gmail.nossr50.core.config.skills.repair; -import com.gmail.nossr50.config.ConfigLoader; -import com.gmail.nossr50.core.config.ConfigurableLoader; -import com.gmail.nossr50.core.mcmmo.skills.ItemType; -import com.gmail.nossr50.core.mcmmo.skills.MaterialType; -import com.gmail.nossr50.skills.repair.repairables.Repairable; -import com.gmail.nossr50.skills.repair.repairables.RepairableFactory; -import com.gmail.nossr50.util.ItemUtils; -import com.gmail.nossr50.util.skills.SkillUtils; -import org.bukkit.Material; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; +import com.gmail.nossr50.core.skills.ItemType; +import com.gmail.nossr50.core.skills.MaterialType; +import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; +import com.gmail.nossr50.core.skills.primary.repair.repairables.RepairableFactory; +import com.gmail.nossr50.core.util.ItemUtils; +import com.gmail.nossr50.core.util.skills.SkillUtils; import java.util.ArrayList; import java.util.List; import java.util.Set; -public class RepairConfig extends ConfigurableLoader { +public class RepairConfig extends Config { private List repairables; public RepairConfig(String fileName) { @@ -49,7 +46,7 @@ public class RepairConfig extends ConfigurableLoader { // Repair Material Type MaterialType repairMaterialType = MaterialType.OTHER; - String repairMaterialTypeString = config.getString("Repairables." + key + ".MaterialType", "OTHER"); + String repairMaterialTypeString = getStringValue("Repairables." + key + ".MaterialType", "OTHER"); if (!config.contains("Repairables." + key + ".MaterialType") && itemMaterial != null) { ItemStack repairItem = new ItemStack(itemMaterial); @@ -78,7 +75,7 @@ public class RepairConfig extends ConfigurableLoader { } // Repair Material - String repairMaterialName = config.getString("Repairables." + key + ".RepairMaterial"); + String repairMaterialName = getStringValue("Repairables." + key + ".RepairMaterial"); Material repairMaterial = (repairMaterialName == null ? repairMaterialType.getDefaultMaterial() : Material.matchMaterial(repairMaterialName)); if (repairMaterial == null) { @@ -86,10 +83,10 @@ public class RepairConfig extends ConfigurableLoader { } // Maximum Durability - short maximumDurability = (itemMaterial != null ? itemMaterial.getMaxDurability() : (short) config.getInt("Repairables." + key + ".MaximumDurability")); + short maximumDurability = (itemMaterial != null ? itemMaterial.getMaxDurability() : (short) getIntValue("Repairables." + key + ".MaximumDurability")); if (maximumDurability <= 0) { - maximumDurability = (short) config.getInt("Repairables." + key + ".MaximumDurability"); + maximumDurability = (short) getIntValue("Repairables." + key + ".MaximumDurability"); } if (maximumDurability <= 0) { @@ -98,7 +95,7 @@ public class RepairConfig extends ConfigurableLoader { // ItemStack Type ItemType repairItemType = ItemType.OTHER; - String repairItemTypeString = config.getString("Repairables." + key + ".ItemType", "OTHER"); + String repairItemTypeString = getStringValue("Repairables." + key + ".ItemType", "OTHER"); if (!config.contains("Repairables." + key + ".ItemType") && itemMaterial != null) { ItemStack repairItem = new ItemStack(itemMaterial); @@ -116,19 +113,19 @@ public class RepairConfig extends ConfigurableLoader { } } - byte repairMetadata = (byte) config.getInt("Repairables." + key + ".RepairMaterialMetadata", -1); - int minimumLevel = config.getInt("Repairables." + key + ".MinimumLevel"); - double xpMultiplier = config.getDouble("Repairables." + key + ".XpMultiplier", 1); + byte repairMetadata = (byte) getIntValue("Repairables." + key + ".RepairMaterialMetadata", -1); + int minimumLevel = getIntValue("Repairables." + key + ".MinimumLevel"); + double xpMultiplier = getDoubleValue("Repairables." + key + ".XpMultiplier", 1); if (minimumLevel < 0) { reason.add(key + " has an invalid MinimumLevel of " + minimumLevel); } // Minimum Quantity - int minimumQuantity = (itemMaterial != null ? SkillUtils.getRepairAndSalvageQuantities(new ItemStack(itemMaterial), repairMaterial, repairMetadata) : config.getInt("Repairables." + key + ".MinimumQuantity", 2)); + int minimumQuantity = (itemMaterial != null ? SkillUtils.getRepairAndSalvageQuantities(new ItemStack(itemMaterial), repairMaterial, repairMetadata) : getIntValue("Repairables." + key + ".MinimumQuantity", 2)); if (minimumQuantity <= 0 && itemMaterial != null) { - minimumQuantity = config.getInt("Repairables." + key + ".MinimumQuantity", 2); + minimumQuantity = getIntValue("Repairables." + key + ".MinimumQuantity", 2); } if (minimumQuantity <= 0) { diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java index 5a4ad4d79..e9dffc0f7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.config.skills.salvage; import com.gmail.nossr50.config.ConfigLoader; import com.gmail.nossr50.core.McmmoCore; -import com.gmail.nossr50.core.config.ConfigurableLoader; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.mcmmo.skills.ItemType; import com.gmail.nossr50.core.mcmmo.skills.MaterialType; import com.gmail.nossr50.skills.salvage.salvageables.Salvageable; @@ -17,7 +17,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Set; -public class SalvageConfig extends ConfigurableLoader { +public class SalvageConfig extends Config { private List salvageables; public SalvageConfig(String fileName) { @@ -45,7 +45,7 @@ public class SalvageConfig extends ConfigurableLoader { // Salvage Material Type MaterialType salvageMaterialType = MaterialType.OTHER; - String salvageMaterialTypeString = config.getString("Salvageables." + key + ".MaterialType", "OTHER"); + String salvageMaterialTypeString = getStringValue("Salvageables." + key + ".MaterialType", "OTHER"); if (!config.contains("Salvageables." + key + ".MaterialType") && itemMaterial != null) { ItemStack salvageItem = new ItemStack(itemMaterial); @@ -74,7 +74,7 @@ public class SalvageConfig extends ConfigurableLoader { } // Salvage Material - String salvageMaterialName = config.getString("Salvageables." + key + ".SalvageMaterial"); + String salvageMaterialName = getStringValue("Salvageables." + key + ".SalvageMaterial"); Material salvageMaterial = (salvageMaterialName == null ? salvageMaterialType.getDefaultMaterial() : Material.matchMaterial(salvageMaterialName)); if (salvageMaterial == null) { @@ -82,11 +82,11 @@ public class SalvageConfig extends ConfigurableLoader { } // Maximum Durability - short maximumDurability = (itemMaterial != null ? itemMaterial.getMaxDurability() : (short) config.getInt("Salvageables." + key + ".MaximumDurability")); + short maximumDurability = (itemMaterial != null ? itemMaterial.getMaxDurability() : (short) getIntValue("Salvageables." + key + ".MaximumDurability")); // ItemStack Type ItemType salvageItemType = ItemType.OTHER; - String salvageItemTypeString = config.getString("Salvageables." + key + ".ItemType", "OTHER"); + String salvageItemTypeString = getStringValue("Salvageables." + key + ".ItemType", "OTHER"); if (!config.contains("Salvageables." + key + ".ItemType") && itemMaterial != null) { ItemStack salvageItem = new ItemStack(itemMaterial); @@ -104,22 +104,22 @@ public class SalvageConfig extends ConfigurableLoader { } } - byte salvageMetadata = (byte) config.getInt("Salvageables." + key + ".SalvageMaterialMetadata", -1); - int minimumLevel = config.getInt("Salvageables." + key + ".MinimumLevel"); - double xpMultiplier = config.getDouble("Salvageables." + key + ".XpMultiplier", 1); + byte salvageMetadata = (byte) getIntValue("Salvageables." + key + ".SalvageMaterialMetadata", -1); + int minimumLevel = getIntValue("Salvageables." + key + ".MinimumLevel"); + double xpMultiplier = getDoubleValue("Salvageables." + key + ".XpMultiplier", 1); if (minimumLevel < 0) { reason.add(key + " has an invalid MinimumLevel of " + minimumLevel); } // Maximum Quantity - int maximumQuantity = (itemMaterial != null ? SkillUtils.getRepairAndSalvageQuantities(new ItemStack(itemMaterial), salvageMaterial, salvageMetadata) : config.getInt("Salvageables." + key + ".MaximumQuantity", 2)); + int maximumQuantity = (itemMaterial != null ? SkillUtils.getRepairAndSalvageQuantities(new ItemStack(itemMaterial), salvageMaterial, salvageMetadata) : getIntValue("Salvageables." + key + ".MaximumQuantity", 2)); if (maximumQuantity <= 0 && itemMaterial != null) { - maximumQuantity = config.getInt("Salvageables." + key + ".MaximumQuantity", 1); + maximumQuantity = getIntValue("Salvageables." + key + ".MaximumQuantity", 1); } - int configMaximumQuantity = config.getInt("Salvageables." + key + ".MaximumQuantity", -1); + int configMaximumQuantity = getIntValue("Salvageables." + key + ".MaximumQuantity", -1); if (configMaximumQuantity > 0) { maximumQuantity = configMaximumQuantity; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java index 3feff02f4..d22c940ea 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.config.treasure; import com.gmail.nossr50.core.McmmoCore; -import com.gmail.nossr50.core.config.ConfigurableLoader; +import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.mcmmo.colors.ChatColor; import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.treasure.*; @@ -12,7 +12,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; -public class TreasureConfig extends ConfigurableLoader { +public class TreasureConfig extends Config { private static TreasureConfig instance; @@ -47,8 +47,8 @@ public class TreasureConfig extends ConfigurableLoader { double totalItemDropRate = 0; for (Rarity rarity : Rarity.values()) { - double enchantDropRate = config.getDouble("Enchantment_Drop_Rates." + tier + "." + rarity.toString()); - double itemDropRate = config.getDouble("Item_Drop_Rates." + tier + "." + rarity.toString()); + double enchantDropRate = getDoubleValue("Enchantment_Drop_Rates." + tier + "." + rarity.toString()); + double itemDropRate = getDoubleValue("Item_Drop_Rates." + tier + "." + rarity.toString()); if ((enchantDropRate < 0.0 || enchantDropRate > 100.0) && rarity != Rarity.RECORD) { reason.add("The enchant drop rate for " + tier + " items that are " + rarity.toString() + "should be between 0.0 and 100.0!"); @@ -134,8 +134,8 @@ public class TreasureConfig extends ConfigurableLoader { material = Material.matchMaterial(materialName); } - int amount = config.getInt(type + "." + treasureName + ".Amount"); - short data = (treasureInfo.length == 2) ? Short.parseShort(treasureInfo[1]) : (short) config.getInt(type + "." + treasureName + ".Data"); + int amount = getIntValue(type + "." + treasureName + ".Amount"); + short data = (treasureInfo.length == 2) ? Short.parseShort(treasureInfo[1]) : (short) getIntValue(type + "." + treasureName + ".Data"); if (material == null) { reason.add("Invalid material: " + materialName); @@ -153,9 +153,9 @@ public class TreasureConfig extends ConfigurableLoader { * XP, Drop Chance, and Drop Level */ - int xp = config.getInt(type + "." + treasureName + ".XP"); - double dropChance = config.getDouble(type + "." + treasureName + ".Drop_Chance"); - int dropLevel = config.getInt(type + "." + treasureName + ".Drop_Level"); + int xp = getIntValue(type + "." + treasureName + ".XP"); + double dropChance = getDoubleValue(type + "." + treasureName + ".Drop_Chance"); + int dropLevel = getIntValue(type + "." + treasureName + ".Drop_Level"); if (xp < 0) { reason.add(treasureName + " has an invalid XP value: " + xp); @@ -175,7 +175,7 @@ public class TreasureConfig extends ConfigurableLoader { Rarity rarity = null; if (isFishing) { - rarity = Rarity.getRarity(config.getString(type + "." + treasureName + ".Rarity")); + rarity = Rarity.getRarity(getStringValue(type + "." + treasureName + ".Rarity")); if (rarity == null) { reason.add("Invalid Rarity for item: " + treasureName); @@ -197,21 +197,21 @@ public class TreasureConfig extends ConfigurableLoader { PotionType potionType = null; try { - potionType = PotionType.valueOf(config.getString(type + "." + treasureName + ".PotionData.PotionType", "WATER")); + potionType = PotionType.valueOf(getStringValue(type + "." + treasureName + ".PotionData.PotionType", "WATER")); } catch (IllegalArgumentException ex) { - reason.add("Invalid Potion_Type: " + config.getString(type + "." + treasureName + ".PotionData.PotionType", "WATER")); + reason.add("Invalid Potion_Type: " + getStringValue(type + "." + treasureName + ".PotionData.PotionType", "WATER")); } - boolean extended = config.getBoolean(type + "." + treasureName + ".PotionData.Extended", false); - boolean upgraded = config.getBoolean(type + "." + treasureName + ".PotionData.Upgraded", false); + boolean extended = getBooleanValue(type + "." + treasureName + ".PotionData.Extended", false); + boolean upgraded = getBooleanValue(type + "." + treasureName + ".PotionData.Upgraded", false); itemMeta.setBasePotionData(new PotionData(potionType, extended, upgraded)); if (config.contains(type + "." + treasureName + ".Custom_Name")) { - itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', config.getString(type + "." + treasureName + ".Custom_Name"))); + itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', getStringValue(type + "." + treasureName + ".Custom_Name"))); } if (config.contains(type + "." + treasureName + ".Lore")) { List lore = new ArrayList(); - for (String s : config.getStringList(type + "." + treasureName + ".Lore")) { + for (String s : getStringValueList(type + "." + treasureName + ".Lore")) { lore.add(ChatColor.translateAlternateColorCodes('&', s)); } itemMeta.setLore(lore); @@ -223,14 +223,14 @@ public class TreasureConfig extends ConfigurableLoader { if (config.contains(type + "." + treasureName + ".Custom_Name")) { ItemMeta itemMeta = item.getItemMeta(); - itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', config.getString(type + "." + treasureName + ".Custom_Name"))); + itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', getStringValue(type + "." + treasureName + ".Custom_Name"))); item.setItemMeta(itemMeta); } if (config.contains(type + "." + treasureName + ".Lore")) { ItemMeta itemMeta = item.getItemMeta(); List lore = new ArrayList(); - for (String s : config.getStringList(type + "." + treasureName + ".Lore")) { + for (String s : getStringValueList(type + "." + treasureName + ".Lore")) { lore.add(ChatColor.translateAlternateColorCodes('&', s)); } itemMeta.setLore(lore); @@ -250,7 +250,7 @@ public class TreasureConfig extends ConfigurableLoader { shakeMap.get(entityType).add(shakeTreasure); } else if (isExcavation) { ExcavationTreasure excavationTreasure = new ExcavationTreasure(item, xp, dropChance, dropLevel); - List dropList = config.getStringList(type + "." + treasureName + ".Drops_From"); + List dropList = getStringValueList(type + "." + treasureName + ".Drops_From"); for (String blockType : dropList) { if (!excavationMap.containsKey(blockType)) @@ -259,7 +259,7 @@ public class TreasureConfig extends ConfigurableLoader { } } else if (isHylian) { HylianTreasure hylianTreasure = new HylianTreasure(item, xp, dropChance, dropLevel); - List dropList = config.getStringList(type + "." + treasureName + ".Drops_From"); + List dropList = getStringValueList(type + "." + treasureName + ".Drops_From"); for (String dropper : dropList) { if (dropper.equals("Bushes")) { @@ -318,7 +318,7 @@ public class TreasureConfig extends ConfigurableLoader { } for (String enchantmentName : enchantmentSection.getKeys(false)) { - int level = config.getInt("Enchantments_Rarity." + rarity.toString() + "." + enchantmentName); + int level = getIntValue("Enchantments_Rarity." + rarity.toString() + "." + enchantmentName); Enchantment enchantment = EnchantmentUtils.getByName(enchantmentName); if (enchantment == null) { @@ -336,22 +336,22 @@ public class TreasureConfig extends ConfigurableLoader { } public boolean getInventoryStealStacks() { - return config.getBoolean("Shake.PLAYER.INVENTORY.Whole_Stacks"); + return getBooleanValue("Shake.PLAYER.INVENTORY.Whole_Stacks"); } public double getInventoryStealDropChance() { - return config.getDouble("Shake.PLAYER.INVENTORY.Drop_Chance"); + return getDoubleValue("Shake.PLAYER.INVENTORY.Drop_Chance"); } public int getInventoryStealDropLevel() { - return config.getInt("Shake.PLAYER.INVENTORY.Drop_Level"); + return getIntValue("Shake.PLAYER.INVENTORY.Drop_Level"); } public double getItemDropRate(int tier, Rarity rarity) { - return config.getDouble("Item_Drop_Rates.Tier_" + tier + "." + rarity.toString()); + return getDoubleValue("Item_Drop_Rates.Tier_" + tier + "." + rarity.toString()); } public double getEnchantmentDropRate(int tier, Rarity rarity) { - return config.getDouble("Enchantment_Drop_Rates.Tier_" + tier + "." + rarity.toString()); + return getDoubleValue("Enchantment_Drop_Rates.Tier_" + tier + "." + rarity.toString()); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java index 638f3729d..adb8cd87b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.data.database; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.database.DatabaseType; import com.gmail.nossr50.core.datatypes.database.PlayerStat; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; @@ -12,7 +12,7 @@ import java.util.UUID; public interface DatabaseManager { // One month in milliseconds - public final long PURGE_TIME = 2630000000L * Config.getInstance().getOldUsersCutoff(); + public final long PURGE_TIME = 2630000000L * MainConfig.getInstance().getOldUsersCutoff(); // During convertUsers, how often to output a status public final int progressInterval = 200; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java index 0f2d722eb..98c9251a6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.datatypes.party; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; @@ -190,7 +190,7 @@ public class Party { public int getXpToLevel() { FormulaType formulaType = ExperienceConfig.getInstance().getFormulaType(); - return (mcMMO.getFormulaManager().getCachedXpToLevel(level, formulaType)) * (getOnlineMembers().size() + Config.getInstance().getPartyXpCurveMultiplier()); + return (mcMMO.getFormulaManager().getCachedXpToLevel(level, formulaType)) * (getOnlineMembers().size() + MainConfig.getInstance().getPartyXpCurveMultiplier()); } public String getXpToLevelPercentage() { @@ -229,13 +229,13 @@ public class Party { return; } - if (!Config.getInstance().getPartyInformAllMembers()) { + if (!MainConfig.getInstance().getPartyInformAllMembers()) { Player leader = mcMMO.p.getServer().getPlayer(this.leader.getUniqueId()); if (leader != null) { leader.sendMessage(LocaleLoader.getString("Party.LevelUp", levelsGained, getLevel())); - if (Config.getInstance().getLevelUpSoundsEnabled()) { + if (MainConfig.getInstance().getLevelUpSoundsEnabled()) { SoundManager.sendSound(leader, leader.getLocation(), SoundType.LEVEL_UP); } } @@ -246,7 +246,7 @@ public class Party { } public boolean hasReachedLevelCap() { - return Config.getInstance().getPartyLevelCap() < getLevel() + 1; + return MainConfig.getInstance().getPartyLevelCap() < getLevel() + 1; } public ShareMode getXpShareMode() { diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java index 971310e44..a107c8ae7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.datatypes.party; import com.gmail.nossr50.commands.party.PartySubcommandType; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; @@ -19,7 +19,7 @@ public enum PartyFeature { } public String getFeatureLockedLocaleString() { - return LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Party.Feature.Locked." + StringUtils.getPrettyPartyFeatureString(this).replace(" ", ""), Config.getInstance().getPartyFeatureUnlockLevel(this))); + return LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Party.Feature.Locked." + StringUtils.getPrettyPartyFeatureString(this).replace(" ", ""), MainConfig.getInstance().getPartyFeatureUnlockLevel(this))); } public boolean hasPermission(Player player) { diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java index ddc0b8ab6..74b1014e1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.datatypes.party; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.util.Misc; import org.bukkit.entity.Player; @@ -12,7 +12,7 @@ public class PartyTeleportRecord { public PartyTeleportRecord() { requestor = null; enabled = true; - confirmRequired = Config.getInstance().getPTPCommandConfirmRequired(); + confirmRequired = MainConfig.getInstance().getPTPCommandConfirmRequired(); timeout = 0; lastUse = 0; } diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java index 47cf36dd1..4ce27d31d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.core.datatypes.player; import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.config.AdvancedConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.config.WorldBlacklist; import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.data.UserManager; @@ -490,7 +490,7 @@ public class McMMOPlayer { return; } - if (!Config.getInstance().getPartyXpNearMembersNeeded() || !PartyManager.getNearMembers(this).isEmpty()) { + if (!MainConfig.getInstance().getPartyXpNearMembersNeeded() || !PartyManager.getNearMembers(this).isEmpty()) { party.applyXpGain(modifyXpGain(skill, xp)); } } @@ -553,7 +553,7 @@ public class McMMOPlayer { return; } - if (Config.getInstance().getLevelUpSoundsEnabled()) { + if (MainConfig.getInstance().getLevelUpSoundsEnabled()) { SoundManager.sendSound(player, player.getLocation(), SoundType.LEVEL_UP); } @@ -739,13 +739,13 @@ public class McMMOPlayer { * @return Modified experience */ private float modifyXpGain(PrimarySkillType primarySkillType, float xp) { - if (player.getGameMode() == GameMode.CREATIVE || (primarySkillType.getMaxLevel() <= getSkillLevel(primarySkillType)) || (Config.getInstance().getPowerLevelCap() <= getPowerLevel())) { + if (player.getGameMode() == GameMode.CREATIVE || (primarySkillType.getMaxLevel() <= getSkillLevel(primarySkillType)) || (MainConfig.getInstance().getPowerLevelCap() <= getPowerLevel())) { return 0; } xp = (float) (xp / primarySkillType.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()); - if (Config.getInstance().getToolModsEnabled()) { + if (MainConfig.getInstance().getToolModsEnabled()) { CustomTool tool = mcMMO.getModManager().getTool(player.getInventory().getItemInMainHand()); if (tool != null) { @@ -854,7 +854,7 @@ public class McMMOPlayer { } public void processAbilityActivation(PrimarySkillType skill) { - if (Config.getInstance().getAbilitiesOnlyActivateWhenSneaking() && !player.isSneaking()) { + if (MainConfig.getInstance().getAbilitiesOnlyActivateWhenSneaking() && !player.isSneaking()) { return; } @@ -891,7 +891,7 @@ public class McMMOPlayer { } } - if (Config.getInstance().getAbilityMessagesEnabled()) { + if (MainConfig.getInstance().getAbilityMessagesEnabled()) { NotificationManager.sendPlayerInformation(player, NotificationType.TOOL, tool.getRaiseTool()); SoundManager.sendSound(player, player.getLocation(), SoundType.TOOL_READY); } @@ -913,7 +913,7 @@ public class McMMOPlayer { } private boolean hasReachedLevelCap(PrimarySkillType skill) { - return (skill.getMaxLevel() < getSkillLevel(skill) + 1) || (Config.getInstance().getPowerLevelCap() < getPowerLevel() + 1); + return (skill.getMaxLevel() < getSkillLevel(skill) + 1) || (MainConfig.getInstance().getPowerLevelCap() < getPowerLevel() + 1); } /* @@ -985,7 +985,7 @@ public class McMMOPlayer { UserManager.remove(thisPlayer); - if (Config.getInstance().getScoreboardsEnabled()) + if (MainConfig.getInstance().getScoreboardsEnabled()) ScoreboardManager.teardownPlayer(thisPlayer); if (inParty()) { diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java index 642c52a9e..6eeda2cb1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.core.datatypes.player; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.AdvancedConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.datatypes.experience.SkillXpGain; @@ -46,7 +46,7 @@ public class PlayerProfile { this.uuid = uuid; this.playerName = playerName; - mobHealthbarType = Config.getInstance().getMobHealthbarDefault(); + mobHealthbarType = MainConfig.getInstance().getMobHealthbarDefault(); scoreboardTipsShown = 0; for (SuperAbilityType superAbilityType : SuperAbilityType.values()) { diff --git a/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java b/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java index 034b8827d..63582f4f2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java +++ b/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.locale; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.mcMMO; import org.bukkit.ChatColor; @@ -77,7 +77,7 @@ public final class LocaleLoader { if (bundle == null) { Locale.setDefault(new Locale("en", "US")); Locale locale = null; - String[] myLocale = Config.getInstance().getLocale().split("[-_ ]"); + String[] myLocale = MainConfig.getInstance().getLocale().split("[-_ ]"); if (myLocale.length == 1) { locale = new Locale(myLocale[0]); diff --git a/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java b/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java index f99689c18..4ed88df41 100644 --- a/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.party; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.database.UpgradeType; @@ -63,7 +63,7 @@ public final class PartyManager { * @return true if party is full and cannot be joined */ public static boolean isPartyFull(Player player, Party targetParty) { - return !Permissions.partySizeBypass(player) && Config.getInstance().getPartyMaxSize() >= 1 && targetParty.getOnlineMembers().size() >= Config.getInstance().getPartyMaxSize(); + return !Permissions.partySizeBypass(player) && MainConfig.getInstance().getPartyMaxSize() >= 1 && targetParty.getOnlineMembers().size() >= MainConfig.getInstance().getPartyMaxSize(); } /** @@ -131,7 +131,7 @@ public final class PartyManager { if (party != null) { Player player = mcMMOPlayer.getPlayer(); - double range = Config.getInstance().getPartyShareRange(); + double range = MainConfig.getInstance().getPartyShareRange(); for (Player member : party.getOnlineMembers()) { if (!player.equals(member) && member.isValid() && Misc.isNear(player.getLocation(), member.getLocation(), range)) { @@ -149,7 +149,7 @@ public final class PartyManager { if (party != null) { Player player = mcMMOPlayer.getPlayer(); - double range = Config.getInstance().getPartyShareRange(); + double range = MainConfig.getInstance().getPartyShareRange(); for (Player member : party.getVisibleMembers(player)) { if (!player.equals(member) @@ -403,8 +403,8 @@ public final class PartyManager { /* * Don't let players join a full party */ - if (Config.getInstance().getPartyMaxSize() > 0 && invite.getMembers().size() >= Config.getInstance().getPartyMaxSize()) { - NotificationManager.sendPlayerInformation(mcMMOPlayer.getPlayer(), NotificationType.PARTY_MESSAGE, "Commands.Party.PartyFull.InviteAccept", invite.getName(), String.valueOf(Config.getInstance().getPartyMaxSize())); + if (MainConfig.getInstance().getPartyMaxSize() > 0 && invite.getMembers().size() >= MainConfig.getInstance().getPartyMaxSize()) { + NotificationManager.sendPlayerInformation(mcMMOPlayer.getPlayer(), NotificationType.PARTY_MESSAGE, "Commands.Party.PartyFull.InviteAccept", invite.getName(), String.valueOf(MainConfig.getInstance().getPartyMaxSize())); return; } @@ -761,7 +761,7 @@ public final class PartyManager { * @param level The current party level */ public static void informPartyMembersLevelUp(Party party, int levelsGained, int level) { - boolean levelUpSoundsEnabled = Config.getInstance().getLevelUpSoundsEnabled(); + boolean levelUpSoundsEnabled = MainConfig.getInstance().getLevelUpSoundsEnabled(); for (Player member : party.getOnlineMembers()) { member.sendMessage(LocaleLoader.getString("Party.LevelUp", levelsGained, level)); diff --git a/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java b/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java index 57509a36c..0f786512d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java +++ b/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.party; import com.gmail.nossr50.config.party.ItemWeightConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; @@ -45,7 +45,7 @@ public final class ShareHandler { nearMembers.add(mcMMOPlayer.getPlayer()); int partySize = nearMembers.size(); - double shareBonus = Math.min(Config.getInstance().getPartyShareBonusBase() + (partySize * Config.getInstance().getPartyShareBonusIncrease()), Config.getInstance().getPartyShareBonusCap()); + double shareBonus = Math.min(MainConfig.getInstance().getPartyShareBonusBase() + (partySize * MainConfig.getInstance().getPartyShareBonusIncrease()), MainConfig.getInstance().getPartyShareBonusCap()); float splitXp = (float) (xp / partySize * shareBonus); for (Player member : nearMembers) { diff --git a/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java b/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java index 19f65c3e4..da29d2d9c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java +++ b/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java @@ -71,4 +71,10 @@ public interface Platform { * @return this platform's data folder */ File getDataFolderPath(); + + /** + * Gets the path of the mods config folder inside the Data folder for this platform + * @return this platform's mod config subdirectory + */ + String getModDataFolderPath(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java index 9b784eb32..e53ba3571 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.backups; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.mcMMO; import org.bukkit.scheduler.BukkitRunnable; @@ -48,10 +48,10 @@ public class CleanBackupsTask extends BukkitRunnable { int weekOfYear = cal.get(Calendar.WEEK_OF_YEAR); int year = cal.get(Calendar.YEAR); - if (isPast24Hours(date) && Config.getInstance().getKeepLast24Hours()) { + if (isPast24Hours(date) && MainConfig.getInstance().getKeepLast24Hours()) { // Keep all files from the last 24 hours continue; - } else if (isLastWeek(date) && !savedDays.contains(dayOfWeek) && Config.getInstance().getKeepDailyLastWeek()) { + } else if (isLastWeek(date) && !savedDays.contains(dayOfWeek) && MainConfig.getInstance().getKeepDailyLastWeek()) { // Keep daily backups of the past week savedDays.add(dayOfWeek); continue; @@ -62,7 +62,7 @@ public class CleanBackupsTask extends BukkitRunnable { savedYearsWeeks.put(year, savedWeeks); } - if (!savedWeeks.contains(weekOfYear) && Config.getInstance().getKeepWeeklyPastMonth()) { + if (!savedWeeks.contains(weekOfYear) && MainConfig.getInstance().getKeepWeeklyPastMonth()) { // Keep one net.shatteredlands.shatt.backup of each week savedWeeks.add(weekOfYear); continue; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java index dd0139053..2dae89bdc 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.commands; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; @@ -30,7 +30,7 @@ public class McrankCommandDisplayTask extends BukkitRunnable { @Override public void run() { - if (useBoard && Config.getInstance().getScoreboardsEnabled()) { + if (useBoard && MainConfig.getInstance().getScoreboardsEnabled()) { displayBoard(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java index 2ed03772a..cd335ddb0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.commands; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.database.PlayerStat; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; @@ -34,7 +34,7 @@ public class MctopCommandDisplayTask extends BukkitRunnable { @Override public void run() { - if (useBoard && Config.getInstance().getScoreboardsEnabled()) { + if (useBoard && MainConfig.getInstance().getScoreboardsEnabled()) { displayBoard(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java index 51f402316..7034b3203 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.runnables.database; import com.gmail.nossr50.core.McmmoCore; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import java.util.concurrent.locks.ReentrantLock; @@ -13,7 +13,7 @@ public class UserPurgeTask implements Runnable { lock.lock(); McmmoCore.getDatabaseManager().purgePowerlessUsers(); - if (Config.getInstance().getOldUsersCutoff() != -1) { + if (MainConfig.getInstance().getOldUsersCutoff() != -1) { McmmoCore.getDatabaseManager().purgeOldUsers(); } lock.unlock(); diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/items/ChimaeraWingWarmup.java b/core/src/main/java/com/gmail/nossr50/core/runnables/items/ChimaeraWingWarmup.java index f3a8209e3..b7f3695d5 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/items/ChimaeraWingWarmup.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/items/ChimaeraWingWarmup.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.items; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.util.ChimaeraWing; @@ -36,13 +36,13 @@ public class ChimaeraWingWarmup extends BukkitRunnable { ItemStack inHand = player.getInventory().getItemInMainHand(); - if (!ItemUtils.isChimaeraWing(inHand) || inHand.getAmount() < Config.getInstance().getChimaeraUseCost()) { + if (!ItemUtils.isChimaeraWing(inHand) || inHand.getAmount() < MainConfig.getInstance().getChimaeraUseCost()) { player.sendMessage(LocaleLoader.getString("Skills.NeedMore", LocaleLoader.getString("Item.ChimaeraWing.Name"))); return; } long recentlyHurt = mcMMOPlayer.getRecentlyHurt(); - int hurtCooldown = Config.getInstance().getChimaeraRecentlyHurtCooldown(); + int hurtCooldown = MainConfig.getInstance().getChimaeraRecentlyHurtCooldown(); if (hurtCooldown > 0) { int timeRemaining = SkillUtils.calculateTimeLeft(recentlyHurt * Misc.TIME_CONVERSION_FACTOR, hurtCooldown, player); diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/items/TeleportationWarmup.java b/core/src/main/java/com/gmail/nossr50/core/runnables/items/TeleportationWarmup.java index 6da79ba2f..5092d6aaa 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/items/TeleportationWarmup.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/items/TeleportationWarmup.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.items; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.party.PartyManager; @@ -40,7 +40,7 @@ public class TeleportationWarmup extends BukkitRunnable { return; } - int hurtCooldown = Config.getInstance().getPTPCommandRecentlyHurtCooldown(); + int hurtCooldown = MainConfig.getInstance().getPTPCommandRecentlyHurtCooldown(); if (hurtCooldown > 0) { int timeRemaining = SkillUtils.calculateTimeLeft(recentlyHurt * Misc.TIME_CONVERSION_FACTOR, hurtCooldown, teleportingPlayer); diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyAutoKickTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyAutoKickTask.java index 991ca3714..bbb041acc 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyAutoKickTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyAutoKickTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.party; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.party.PartyManager; @@ -14,7 +14,7 @@ import java.util.Map.Entry; import java.util.UUID; public class PartyAutoKickTask extends BukkitRunnable { - private final static long KICK_TIME = 24L * 60L * 60L * 1000L * Config.getInstance().getAutoPartyKickTime(); + private final static long KICK_TIME = 24L * 60L * 60L * 1000L * MainConfig.getInstance().getAutoPartyKickTime(); @Override public void run() { diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyChatTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyChatTask.java index 795d59baa..95665042a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyChatTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyChatTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.party; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.locale.LocaleLoader; import org.bukkit.ChatColor; @@ -30,7 +30,7 @@ public class PartyChatTask extends BukkitRunnable { @Override public void run() { - if (Config.getInstance().getPartyChatColorLeaderName() && senderName.equalsIgnoreCase(party.getLeader().getPlayerName())) { + if (MainConfig.getInstance().getPartyChatColorLeaderName() && senderName.equalsIgnoreCase(party.getLeader().getPlayerName())) { message = message.replaceFirst(Pattern.quote(displayName), ChatColor.GOLD + Matcher.quoteReplacement(displayName) + ChatColor.RESET); } @@ -40,7 +40,7 @@ public class PartyChatTask extends BukkitRunnable { if (party.getAlly() != null) { for (Player member : party.getAlly().getOnlineMembers()) { - String allyPrefix = LocaleLoader.formatString(Config.getInstance().getPartyChatPrefixAlly()); + String allyPrefix = LocaleLoader.formatString(MainConfig.getInstance().getPartyChatPrefixAlly()); member.sendMessage(allyPrefix + message); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java index 123b9b401..0734d2ba1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.player; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; @@ -77,16 +77,16 @@ public class PlayerProfileLoadingTask extends BukkitRunnable { UserManager.track(mcMMOPlayer); mcMMOPlayer.actualizeRespawnATS(); - if (Config.getInstance().getScoreboardsEnabled()) { + if (MainConfig.getInstance().getScoreboardsEnabled()) { ScoreboardManager.setupPlayer(player); - if (Config.getInstance().getShowStatsAfterLogin()) { + if (MainConfig.getInstance().getShowStatsAfterLogin()) { ScoreboardManager.enablePlayerStatsScoreboard(player); new McScoreboardKeepTask(player).runTaskLater(mcMMO.p, 1 * Misc.TICK_CONVERSION_FACTOR); } } - if (Config.getInstance().getShowProfileLoadedMessage()) { + if (MainConfig.getInstance().getShowProfileLoadedMessage()) { player.sendMessage(LocaleLoader.getString("Profile.Loading.Success")); } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityDisableTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityDisableTask.java index 10f45890f..5537c4e47 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityDisableTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityDisableTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.skills; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.SuperAbilityType; @@ -40,7 +40,7 @@ public class AbilityDisableTask extends BukkitRunnable { // Fallthrough case BERSERK: - if (Config.getInstance().getRefreshChunksEnabled()) { + if (MainConfig.getInstance().getRefreshChunksEnabled()) { resendChunkRadiusAt(player, 1); } // Fallthrough diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ToolLowerTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ToolLowerTask.java index 28af327dd..be96b1506 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ToolLowerTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ToolLowerTask.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.runnables.skills; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.ToolType; @@ -24,7 +24,7 @@ public class ToolLowerTask extends BukkitRunnable { mcMMOPlayer.setToolPreparationMode(tool, false); - if (Config.getInstance().getAbilityMessagesEnabled()) { + if (MainConfig.getInstance().getAbilityMessagesEnabled()) { NotificationManager.sendPlayerInformation(mcMMOPlayer.getPlayer(), NotificationType.TOOL, tool.getLowerTool()); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java b/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java index 94968880f..ab9c259fb 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills; import com.gmail.nossr50.core.McmmoCore; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.mcmmo.colors.Color; @@ -104,7 +104,7 @@ public enum PrimarySkillType { } public static PrimarySkillType getSkill(String skillName) { - if (!Config.getInstance().getLocale().equalsIgnoreCase("en_US")) { + if (!MainConfig.getInstance().getLocale().equalsIgnoreCase("en_US")) { for (PrimarySkillType type : values()) { if (skillName.equalsIgnoreCase(LocaleLoader.getString(StringUtils.getCapitalized(type.name()) + ".SkillName"))) { return type; @@ -158,7 +158,7 @@ public enum PrimarySkillType { * @return the max level of this skill */ public int getMaxLevel() { - return Config.getInstance().getLevelCap(this); + return MainConfig.getInstance().getLevelCap(this); } public boolean isSuperAbilityUnlocked(Player player) { @@ -166,31 +166,31 @@ public enum PrimarySkillType { } public boolean getPVPEnabled() { - return Config.getInstance().getPVPEnabled(this); + return MainConfig.getInstance().getPVPEnabled(this); } public boolean getPVEEnabled() { - return Config.getInstance().getPVEEnabled(this); + return MainConfig.getInstance().getPVEEnabled(this); } public boolean getDoubleDropsDisabled() { - return Config.getInstance().getDoubleDropsDisabled(this); + return MainConfig.getInstance().getDoubleDropsDisabled(this); } public boolean getHardcoreStatLossEnabled() { - return Config.getInstance().getHardcoreStatLossEnabled(this); + return MainConfig.getInstance().getHardcoreStatLossEnabled(this); } public void setHardcoreStatLossEnabled(boolean enable) { - Config.getInstance().setHardcoreStatLossEnabled(this, enable); + MainConfig.getInstance().setHardcoreStatLossEnabled(this, enable); } public boolean getHardcoreVampirismEnabled() { - return Config.getInstance().getHardcoreVampirismEnabled(this); + return MainConfig.getInstance().getHardcoreVampirismEnabled(this); } public void setHardcoreVampirismEnabled(boolean enable) { - Config.getInstance().setHardcoreVampirismEnabled(this, enable); + MainConfig.getInstance().setHardcoreVampirismEnabled(this, enable); } public ToolType getTool() { @@ -218,7 +218,7 @@ public enum PrimarySkillType { } public String getName() { - return Config.getInstance().getLocale().equalsIgnoreCase("en_US") ? StringUtils.getCapitalized(this.toString()) : StringUtils.getCapitalized(LocaleLoader.getString(StringUtils.getCapitalized(this.toString()) + ".SkillName")); + return MainConfig.getInstance().getLocale().equalsIgnoreCase("en_US") ? StringUtils.getCapitalized(this.toString()) : StringUtils.getCapitalized(LocaleLoader.getString(StringUtils.getCapitalized(this.toString()) + ".SkillName")); } public boolean getPermissions(Player player) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java b/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java index 9f84d67fd..914e23864 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.mcmmo.block.BlockState; import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.util.BlockUtils; @@ -99,11 +99,11 @@ public enum SuperAbilityType { } public int getCooldown() { - return Config.getInstance().getCooldown(this); + return MainConfig.getInstance().getCooldown(this); } public int getMaxLength() { - return Config.getInstance().getMaxLength(this); + return MainConfig.getInstance().getMaxLength(this); } public String getAbilityOn() { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java index 30f9a473e..abffc7fac 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.core.skills.child.salvage; import com.gmail.nossr50.core.config.AdvancedConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import org.bukkit.Material; public class Salvage { - public static Material anvilMaterial = Config.getInstance().getSalvageAnvilMaterial(); + public static Material anvilMaterial = MainConfig.getInstance().getSalvageAnvilMaterial(); /*public static int salvageMaxPercentageLevel = AdvancedConfig.getInstance().getSalvageMaxPercentageLevel(); public static double salvageMaxPercentage = AdvancedConfig.getInstance().getSalvageMaxPercentage(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java index 86ba31888..59d993adc 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.child.salvage; import com.gmail.nossr50.core.config.AdvancedConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; @@ -49,11 +49,11 @@ public class SalvageManager extends SkillManager { return; } - if (Config.getInstance().getSalvageAnvilMessagesEnabled()) { + if (MainConfig.getInstance().getSalvageAnvilMessagesEnabled()) { NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Salvage.Listener.Anvil"); } - if (Config.getInstance().getSalvageAnvilPlaceSoundsEnabled()) { + if (MainConfig.getInstance().getSalvageAnvilPlaceSoundsEnabled()) { SoundManager.sendSound(player, player.getLocation(), SoundType.ANVIL); } @@ -130,7 +130,7 @@ public class SalvageManager extends SkillManager { Misc.dropItems(location, salvageResults, 1); // BWONG BWONG BWONG - CLUNK! - if (Config.getInstance().getSalvageAnvilUseSoundsEnabled()) { + if (MainConfig.getInstance().getSalvageAnvilUseSoundsEnabled()) { SoundManager.sendSound(player, player.getLocation(), SoundType.ANVIL); SoundManager.sendSound(player, player.getLocation(), SoundType.ITEM_BREAK); @@ -248,7 +248,7 @@ public class SalvageManager extends SkillManager { Player player = getPlayer(); long lastUse = getLastAnvilUse(); - if (!SkillUtils.cooldownExpired(lastUse, 3) || !Config.getInstance().getSalvageConfirmRequired()) { + if (!SkillUtils.cooldownExpired(lastUse, 3) || !MainConfig.getInstance().getSalvageConfirmRequired()) { return true; } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java index 2b1cbdd02..fa5f76660 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.child.smelting; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; @@ -79,13 +79,13 @@ public class SmeltingManager extends SkillManager { // We need to distribute Mining XP here, because the block break event gets cancelled applyXpGain(Mining.getBlockXp(blockState), XPGainReason.PVE, XPGainSource.PASSIVE); - SkillUtils.handleDurabilityChange(getPlayer().getInventory().getItemInMainHand(), Config.getInstance().getAbilityToolDamage()); + SkillUtils.handleDurabilityChange(getPlayer().getInventory().getItemInMainHand(), MainConfig.getInstance().getAbilityToolDamage()); Misc.dropItems(Misc.getBlockCenter(blockState), item, isSecondSmeltSuccessful() ? 2 : 1); blockState.setType(Material.AIR); - if (Config.getInstance().getFluxPickaxeSoundEnabled()) { + if (MainConfig.getInstance().getFluxPickaxeSoundEnabled()) { SoundManager.sendSound(player, blockState.getLocation(), SoundType.FIZZ); } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java index f0b145326..0b6707494 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java @@ -2,12 +2,12 @@ package com.gmail.nossr50.core.skills.primary.acrobatics; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.AdvancedConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; public final class Acrobatics { public static double dodgeDamageModifier = AdvancedConfig.getInstance().getDodgeDamageModifier(); public static int dodgeXpModifier = ExperienceConfig.getInstance().getDodgeXPModifier(); - public static boolean dodgeLightningDisabled = Config.getInstance().getDodgeLightningDisabled(); + public static boolean dodgeLightningDisabled = MainConfig.getInstance().getDodgeLightningDisabled(); private Acrobatics() { } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java index db7afc5d3..1941478a4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.primary.excavation; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; @@ -77,6 +77,6 @@ public class ExcavationManager extends SkillManager { excavationBlockCheck(blockState); excavationBlockCheck(blockState); - SkillUtils.handleDurabilityChange(getPlayer().getInventory().getItemInMainHand(), Config.getInstance().getAbilityToolDamage()); + SkillUtils.handleDurabilityChange(getPlayer().getInventory().getItemInMainHand(), MainConfig.getInstance().getAbilityToolDamage()); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java index 102e43e5a..b32fed307 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.core.skills.primary.fishing; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.AdvancedConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.config.treasure.TreasureConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; @@ -197,7 +197,7 @@ public class FishingManager extends SkillManager { Player player = getPlayer(); FishingTreasure treasure = null; - if (Config.getInstance().getFishingDropsEnabled() && Permissions.isSubSkillEnabled(player, SubSkillType.FISHING_TREASURE_HUNTER)) { + if (MainConfig.getInstance().getFishingDropsEnabled() && Permissions.isSubSkillEnabled(player, SubSkillType.FISHING_TREASURE_HUNTER)) { treasure = getFishingTreasure(); this.fishingCatch = null; } @@ -234,7 +234,7 @@ public class FishingManager extends SkillManager { NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Fishing.Ability.TH.MagicFound"); } - if (Config.getInstance().getFishingExtraFish()) { + if (MainConfig.getInstance().getFishingExtraFish()) { Misc.dropItem(player.getEyeLocation(), fishingCatch.getItemStack()); } @@ -364,7 +364,7 @@ public class FishingManager extends SkillManager { } // Rather than subtracting luck (and causing a minimum 3% chance for every drop), scale by luck. - diceRoll *= (1.0 - luck * Config.getInstance().getFishingLureModifier() / 100); + diceRoll *= (1.0 - luck * MainConfig.getInstance().getFishingLureModifier() / 100); FishingTreasure treasure = null; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java index 7b183ed22..531980a3e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.primary.herbalism; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.config.treasure.TreasureConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; @@ -36,7 +36,7 @@ public class HerbalismManager extends SkillManager { } public boolean canBlockCheck() { - return !(Config.getInstance().getHerbalismPreventAFK() && getPlayer().isInsideVehicle()); + return !(MainConfig.getInstance().getHerbalismPreventAFK() && getPlayer().isInsideVehicle()); } public boolean canGreenThumbBlock(BlockState blockState) { @@ -148,7 +148,7 @@ public class HerbalismManager extends SkillManager { } else { xp = ExperienceConfig.getInstance().getXp(skill, blockState.getBlockData()); - if (Config.getInstance().getDoubleDropsEnabled(skill, material) && Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_DOUBLE_DROPS)) { + if (MainConfig.getInstance().getDoubleDropsEnabled(skill, material) && Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_DOUBLE_DROPS)) { drops = blockState.getBlock().getDrops(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java index 008f44cdf..640c99755 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.primary.mining; import com.gmail.nossr50.core.config.AdvancedConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.mcMMO; @@ -42,7 +42,7 @@ public class BlastMining { }*/ public final static int MAXIMUM_REMOTE_DETONATION_DISTANCE = 100; - public static Material detonator = Config.getInstance().getDetonatorItem(); + public static Material detonator = MainConfig.getInstance().getDetonatorItem(); public static double getBlastRadiusModifier(int rank) { return AdvancedConfig.getInstance().getBlastRadiusModifier(rank); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java index 158d5d65f..aec17ca88 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.primary.mining; import com.gmail.nossr50.core.config.AdvancedConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; @@ -85,10 +85,10 @@ public class MiningManager extends SkillManager { Material material = blockState.getType(); if (mcMMOPlayer.getAbilityMode(skill.getAbility())) { - SkillUtils.handleDurabilityChange(getPlayer().getInventory().getItemInMainHand(), Config.getInstance().getAbilityToolDamage()); + SkillUtils.handleDurabilityChange(getPlayer().getInventory().getItemInMainHand(), MainConfig.getInstance().getAbilityToolDamage()); } - if ((mcMMO.getModManager().isCustomMiningBlock(blockState) && !mcMMO.getModManager().getBlock(blockState).isDoubleDropEnabled()) || !Config.getInstance().getDoubleDropsEnabled(skill, material)) { + if ((mcMMO.getModManager().isCustomMiningBlock(blockState) && !mcMMO.getModManager().getBlock(blockState).isDoubleDropEnabled()) || !MainConfig.getInstance().getDoubleDropsEnabled(skill, material)) { return; } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java index 69f092bef..581231212 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.core.skills.primary.repair; import com.gmail.nossr50.core.config.AdvancedConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import org.bukkit.Material; public class Repair { public static int repairMasteryMaxBonusLevel = AdvancedConfig.getInstance().getRepairMasteryMaxLevel(); public static double repairMasteryMaxBonus = AdvancedConfig.getInstance().getRepairMasteryMaxBonus(); - public static Material anvilMaterial = Config.getInstance().getRepairAnvilMaterial(); + public static Material anvilMaterial = MainConfig.getInstance().getRepairAnvilMaterial(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java index 3ba382af0..979d77c54 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.core.skills.primary.repair; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.AdvancedConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; @@ -51,11 +51,11 @@ public class RepairManager extends SkillManager { return; } - if (Config.getInstance().getRepairAnvilMessagesEnabled()) { + if (MainConfig.getInstance().getRepairAnvilMessagesEnabled()) { NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Repair.Listener.Anvil"); } - if (Config.getInstance().getRepairAnvilPlaceSoundsEnabled()) { + if (MainConfig.getInstance().getRepairAnvilPlaceSoundsEnabled()) { SoundManager.sendSound(player, player.getLocation(), SoundType.ANVIL); } @@ -155,7 +155,7 @@ public class RepairManager extends SkillManager { applyXpGain((float) ((getPercentageRepaired(startDurability, newDurability, repairable.getMaximumDurability()) * repairable.getXpMultiplier()) * ExperienceConfig.getInstance().getRepairXPBase() * ExperienceConfig.getInstance().getRepairXP(repairable.getRepairMaterialType())), XPGainReason.PVE); // BWONG BWONG BWONG - if (Config.getInstance().getRepairAnvilUseSoundsEnabled()) { + if (MainConfig.getInstance().getRepairAnvilUseSoundsEnabled()) { SoundManager.sendSound(player, player.getLocation(), SoundType.ANVIL); SoundManager.sendSound(player, player.getLocation(), SoundType.ITEM_BREAK); } @@ -177,7 +177,7 @@ public class RepairManager extends SkillManager { Player player = getPlayer(); long lastUse = getLastAnvilUse(); - if (!SkillUtils.cooldownExpired(lastUse, 3) || !Config.getInstance().getRepairConfirmRequired()) { + if (!SkillUtils.cooldownExpired(lastUse, 3) || !MainConfig.getInstance().getRepairConfirmRequired()) { return true; } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java index b69bcf6d6..ab51e45cd 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.core.skills.primary.taming; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.AdvancedConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; @@ -168,7 +168,7 @@ public class TamingManager extends SkillManager { return; } - callOfTheWild(EntityType.OCELOT, Config.getInstance().getTamingCOTWCost(EntityType.OCELOT)); + callOfTheWild(EntityType.OCELOT, MainConfig.getInstance().getTamingCOTWCost(EntityType.OCELOT)); } /** @@ -182,7 +182,7 @@ public class TamingManager extends SkillManager { return; } - callOfTheWild(EntityType.WOLF, Config.getInstance().getTamingCOTWCost(EntityType.WOLF)); + callOfTheWild(EntityType.WOLF, MainConfig.getInstance().getTamingCOTWCost(EntityType.WOLF)); } /** @@ -196,7 +196,7 @@ public class TamingManager extends SkillManager { return; } - callOfTheWild(EntityType.HORSE, Config.getInstance().getTamingCOTWCost(EntityType.HORSE)); + callOfTheWild(EntityType.HORSE, MainConfig.getInstance().getTamingCOTWCost(EntityType.HORSE)); } /** @@ -290,8 +290,8 @@ public class TamingManager extends SkillManager { return; } - int amount = Config.getInstance().getTamingCOTWAmount(type); - int tamingCOTWLength = Config.getInstance().getTamingCOTWLength(type); + int amount = MainConfig.getInstance().getTamingCOTWAmount(type); + int tamingCOTWLength = MainConfig.getInstance().getTamingCOTWLength(type); for (int i = 0; i < amount; i++) { if (!summonAmountCheck(type)) { @@ -360,7 +360,7 @@ public class TamingManager extends SkillManager { } private boolean rangeCheck(EntityType type) { - double range = Config.getInstance().getTamingCOTWRange(); + double range = MainConfig.getInstance().getTamingCOTWRange(); Player player = getPlayer(); if (range == 0) { @@ -380,7 +380,7 @@ public class TamingManager extends SkillManager { private boolean summonAmountCheck(EntityType entityType) { Player player = getPlayer(); - int maxAmountSummons = Config.getInstance().getTamingCOTWMaxAmount(entityType); + int maxAmountSummons = MainConfig.getInstance().getTamingCOTWMaxAmount(entityType); if (maxAmountSummons <= 0) { return true; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TrackedTamingEntity.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TrackedTamingEntity.java index daaacd00b..55149187c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TrackedTamingEntity.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TrackedTamingEntity.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.primary.taming; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.skills.CombatUtils; @@ -22,7 +22,7 @@ public class TrackedTamingEntity extends BukkitRunnable { this.livingEntity = livingEntity; this.id = livingEntity.getUniqueId(); - int tamingCOTWLength = Config.getInstance().getTamingCOTWLength(livingEntity.getType()); + int tamingCOTWLength = MainConfig.getInstance().getTamingCOTWLength(livingEntity.getType()); if (tamingCOTWLength > 0) { this.length = tamingCOTWLength * Misc.TICK_CONVERSION_FACTOR; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java index dd8e3c247..743de2c72 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.primary.unarmed; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.util.sounds.SoundManager; import com.gmail.nossr50.util.sounds.SoundType; import org.bukkit.entity.Player; @@ -8,7 +8,7 @@ import org.bukkit.event.entity.EntityPickupItemEvent; import org.bukkit.inventory.ItemStack; public class Unarmed { - public static boolean blockCrackerSmoothBrick = Config.getInstance().getUnarmedBlockCrackerSmoothbrickToCracked(); + public static boolean blockCrackerSmoothBrick = MainConfig.getInstance().getUnarmedBlockCrackerSmoothbrickToCracked(); public static double berserkDamageModifier = 1.5; public static long lastAttacked = 0; public static long attackInterval = 750; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java index 68a0fe3fc..36a37bf7f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.primary.woodcutting; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.BlockUtils; @@ -28,7 +28,7 @@ public final class Woodcutting { new int[]{1, -2}, new int[]{1, -1}, new int[]{1, 0}, new int[]{1, 1}, new int[]{1, 2}, new int[]{2, -1}, new int[]{2, 0}, new int[]{2, 1}, }; - public static int treeFellerThreshold = Config.getInstance().getTreeFellerThreshold(); + public static int treeFellerThreshold = MainConfig.getInstance().getTreeFellerThreshold(); protected static boolean treeFellerReachedThreshold = false; private Woodcutting() { @@ -58,7 +58,7 @@ public final class Woodcutting { if (mcMMO.getModManager().isCustomLog(blockState) && mcMMO.getModManager().getBlock(blockState).isDoubleDropEnabled()) { Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops()); } else { - if (Config.getInstance().getWoodcuttingDoubleDropsEnabled(blockState.getBlockData())) { + if (MainConfig.getInstance().getWoodcuttingDoubleDropsEnabled(blockState.getBlockData())) { Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops()); } } @@ -143,7 +143,7 @@ public final class Woodcutting { for (BlockState blockState : treeFellerBlocks) { if (BlockUtils.isLog(blockState)) { - durabilityLoss += Config.getInstance().getAbilityToolDamage(); + durabilityLoss += MainConfig.getInstance().getAbilityToolDamage(); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java index b85e604fd..fba9bba41 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.core.skills.subskills.acrobatics; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.AdvancedConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.LimitedSizeList; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; @@ -212,7 +212,7 @@ public class Roll extends AcrobaticsSubSkill { SoundManager.sendCategorizedSound(player, player.getLocation(), SoundType.ROLL_ACTIVATED, SoundCategory.PLAYERS); //player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.Text")); - //if (!SkillUtils.cooldownExpired((long) mcMMOPlayer.getTeleportATS(), Config.getInstance().getXPAfterTeleportCooldown())) { + //if (!SkillUtils.cooldownExpired((long) mcMMOPlayer.getTeleportATS(), MainConfig.getInstance().getXPAfterTeleportCooldown())) { if (!isExploiting(player)) SkillUtils.applyXpGain(mcMMOPlayer, getPrimarySkill(), calculateRollXP(player, damage, true), XPGainReason.PVE); //} @@ -220,7 +220,7 @@ public class Roll extends AcrobaticsSubSkill { addFallLocation(player); return modifiedDamage; } else if (!isFatal(player, damage)) { - //if (!SkillUtils.cooldownExpired((long) mcMMOPlayer.getTeleportATS(), Config.getInstance().getXPAfterTeleportCooldown())) { + //if (!SkillUtils.cooldownExpired((long) mcMMOPlayer.getTeleportATS(), MainConfig.getInstance().getXPAfterTeleportCooldown())) { if (!isExploiting(player)) SkillUtils.applyXpGain(mcMMOPlayer, getPrimarySkill(), calculateRollXP(player, damage, false), XPGainReason.PVE); //} @@ -272,7 +272,7 @@ public class Roll extends AcrobaticsSubSkill { * @return true if exploits are detected, false otherwise */ private boolean isExploiting(Player player) { - if (!Config.getInstance().getAcrobaticsPreventAFK()) { + if (!MainConfig.getInstance().getAcrobaticsPreventAFK()) { return false; } @@ -291,7 +291,7 @@ public class Roll extends AcrobaticsSubSkill { return false; //NOT EXPLOITING /* Location fallLocation = player.getLocation(); - int maxTries = Config.getInstance().getAcrobaticsAFKMaxTries(); + int maxTries = MainConfig.getInstance().getAcrobaticsAFKMaxTries(); boolean sameLocation = (lastFallLocation != null && Misc.isNear(lastFallLocation, fallLocation, 2)); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java index 14b4ab33f..2b1edd24a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.treasure; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import org.bukkit.inventory.ItemStack; public abstract class Treasure { @@ -42,7 +42,7 @@ public abstract class Treasure { public int getDropLevel() { //If they are in retro mode all requirements are scaled up by 10 - if (Config.getInstance().getIsRetroMode()) + if (MainConfig.getInstance().getIsRetroMode()) return dropLevel * 10; return dropLevel; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java b/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java index 48180fc81..dbe4b9124 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; @@ -38,7 +38,7 @@ public final class ChimaeraWing { * @param player Player whose item usage to check */ public static void activationCheck(Player player) { - if (!Config.getInstance().getChimaeraEnabled()) { + if (!MainConfig.getInstance().getChimaeraEnabled()) { return; } @@ -61,13 +61,13 @@ public final class ChimaeraWing { int amount = inHand.getAmount(); - if (amount < Config.getInstance().getChimaeraUseCost()) { - NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Item.ChimaeraWing.NotEnough", String.valueOf(Config.getInstance().getChimaeraUseCost() - amount), "Item.ChimaeraWing.Name"); + if (amount < MainConfig.getInstance().getChimaeraUseCost()) { + NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Item.ChimaeraWing.NotEnough", String.valueOf(MainConfig.getInstance().getChimaeraUseCost() - amount), "Item.ChimaeraWing.Name"); return; } long lastTeleport = mcMMOPlayer.getChimeraWingLastUse(); - int cooldown = Config.getInstance().getChimaeraCooldown(); + int cooldown = MainConfig.getInstance().getChimaeraCooldown(); if (cooldown > 0) { int timeRemaining = SkillUtils.calculateTimeLeft(lastTeleport * Misc.TIME_CONVERSION_FACTOR, cooldown, player); @@ -79,7 +79,7 @@ public final class ChimaeraWing { } long recentlyHurt = mcMMOPlayer.getRecentlyHurt(); - int hurtCooldown = Config.getInstance().getChimaeraRecentlyHurtCooldown(); + int hurtCooldown = MainConfig.getInstance().getChimaeraRecentlyHurtCooldown(); if (hurtCooldown > 0) { int timeRemaining = SkillUtils.calculateTimeLeft(recentlyHurt * Misc.TIME_CONVERSION_FACTOR, hurtCooldown, player); @@ -92,9 +92,9 @@ public final class ChimaeraWing { location = player.getLocation(); - if (Config.getInstance().getChimaeraPreventUseUnderground()) { + if (MainConfig.getInstance().getChimaeraPreventUseUnderground()) { if (location.getY() < player.getWorld().getHighestBlockYAt(location)) { - player.getInventory().setItemInMainHand(new ItemStack(getChimaeraWing(amount - Config.getInstance().getChimaeraUseCost()))); + player.getInventory().setItemInMainHand(new ItemStack(getChimaeraWing(amount - MainConfig.getInstance().getChimaeraUseCost()))); NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Item.ChimaeraWing.Fail"); player.updateInventory(); player.setVelocity(new Vector(0, 0.5D, 0)); @@ -106,7 +106,7 @@ public final class ChimaeraWing { mcMMOPlayer.actualizeTeleportCommenceLocation(player); - long warmup = Config.getInstance().getChimaeraWarmup(); + long warmup = MainConfig.getInstance().getChimaeraWarmup(); if (warmup > 0) { NotificationManager.sendPlayerInformation(player, NotificationType.ITEM_MESSAGE, "Teleport.Commencing", String.valueOf(warmup)); @@ -119,7 +119,7 @@ public final class ChimaeraWing { public static void chimaeraExecuteTeleport() { Player player = mcMMOPlayer.getPlayer(); - if (Config.getInstance().getChimaeraUseBedSpawn() && player.getBedSpawnLocation() != null) { + if (MainConfig.getInstance().getChimaeraUseBedSpawn() && player.getBedSpawnLocation() != null) { player.teleport(player.getBedSpawnLocation()); } else { Location spawnLocation = player.getWorld().getSpawnLocation(); @@ -130,12 +130,12 @@ public final class ChimaeraWing { } } - player.getInventory().setItemInMainHand(new ItemStack(getChimaeraWing(player.getInventory().getItemInMainHand().getAmount() - Config.getInstance().getChimaeraUseCost()))); + player.getInventory().setItemInMainHand(new ItemStack(getChimaeraWing(player.getInventory().getItemInMainHand().getAmount() - MainConfig.getInstance().getChimaeraUseCost()))); player.updateInventory(); mcMMOPlayer.actualizeChimeraWingLastUse(); mcMMOPlayer.setTeleportCommenceLocation(null); - if (Config.getInstance().getChimaeraSoundEnabled()) { + if (MainConfig.getInstance().getChimaeraSoundEnabled()) { SoundManager.sendSound(player, location, SoundType.CHIMAERA_WING); } @@ -143,7 +143,7 @@ public final class ChimaeraWing { } public static ItemStack getChimaeraWing(int amount) { - ItemStack itemStack = new ItemStack(Config.getInstance().getChimaeraItem(), amount); + ItemStack itemStack = new ItemStack(MainConfig.getInstance().getChimaeraItem(), amount); ItemMeta itemMeta = itemStack.getItemMeta(); itemMeta.setDisplayName(ChatColor.GOLD + LocaleLoader.getString("Item.ChimaeraWing.Name")); @@ -158,8 +158,8 @@ public final class ChimaeraWing { } public static ShapelessRecipe getChimaeraWingRecipe() { - Material ingredient = Config.getInstance().getChimaeraItem(); - int amount = Config.getInstance().getChimaeraRecipeCost(); + Material ingredient = MainConfig.getInstance().getChimaeraItem(); + int amount = MainConfig.getInstance().getChimaeraRecipeCost(); ShapelessRecipe chimeraWing = new ShapelessRecipe(new NamespacedKey(mcMMO.p, "Chimera"), getChimaeraWing(1)); chimeraWing.addIngredient(amount, ingredient); diff --git a/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java b/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java index 504d28abb..91b4a6148 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; @@ -15,8 +15,8 @@ public final class HardcoreManager { } public static void invokeStatPenalty(Player player) { - double statLossPercentage = Config.getInstance().getHardcoreDeathStatPenaltyPercentage(); - int levelThreshold = Config.getInstance().getHardcoreDeathStatPenaltyLevelThreshold(); + double statLossPercentage = MainConfig.getInstance().getHardcoreDeathStatPenaltyPercentage(); + int levelThreshold = MainConfig.getInstance().getHardcoreDeathStatPenaltyLevelThreshold(); PlayerProfile playerProfile = UserManager.getPlayer(player).getProfile(); int totalLevelsLost = 0; @@ -57,8 +57,8 @@ public final class HardcoreManager { } public static void invokeVampirism(Player killer, Player victim) { - double vampirismStatLeechPercentage = Config.getInstance().getHardcoreVampirismStatLeechPercentage(); - int levelThreshold = Config.getInstance().getHardcoreVampirismLevelThreshold(); + double vampirismStatLeechPercentage = MainConfig.getInstance().getHardcoreVampirismStatLeechPercentage(); + int levelThreshold = MainConfig.getInstance().getHardcoreVampirismLevelThreshold(); PlayerProfile killerProfile = UserManager.getPlayer(killer).getProfile(); PlayerProfile victimProfile = UserManager.getPlayer(victim).getProfile(); diff --git a/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java index 9e045adff..af074fc8f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.util; import com.gmail.nossr50.config.party.ItemWeightConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import org.bukkit.ChatColor; @@ -150,7 +150,7 @@ public final class ItemUtils { * @return true if the item counts as unarmed, false otherwise */ public static boolean isUnarmed(ItemStack item) { - if (Config.getInstance().getUnarmedItemsAsUnarmed()) { + if (MainConfig.getInstance().getUnarmedItemsAsUnarmed()) { return !isMinecraftTool(item); } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/Misc.java b/core/src/main/java/com/gmail/nossr50/core/util/Misc.java index 96e3e7237..cb3ddd796 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/Misc.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/Misc.java @@ -27,14 +27,14 @@ public final class Misc { // Sound Pitches & Volumes from CB /* public static final float ANVIL_USE_PITCH = 0.3F; // Not in CB directly, I went off the place sound values - public static final float ANVIL_USE_VOLUME = 1.0F * Config.getInstance().getMasterVolume(); // Not in CB directly, I went off the place sound values - public static final float FIZZ_VOLUME = 0.5F * Config.getInstance().getMasterVolume(); - public static final float POP_VOLUME = 0.2F * Config.getInstance().getMasterVolume(); - public static final float BAT_VOLUME = 1.0F * Config.getInstance().getMasterVolume(); + public static final float ANVIL_USE_VOLUME = 1.0F * MainConfig.getInstance().getMasterVolume(); // Not in CB directly, I went off the place sound values + public static final float FIZZ_VOLUME = 0.5F * MainConfig.getInstance().getMasterVolume(); + public static final float POP_VOLUME = 0.2F * MainConfig.getInstance().getMasterVolume(); + public static final float BAT_VOLUME = 1.0F * MainConfig.getInstance().getMasterVolume(); public static final float BAT_PITCH = 0.6F; - public static final float GHAST_VOLUME = 1.0F * Config.getInstance().getMasterVolume(); + public static final float GHAST_VOLUME = 1.0F * MainConfig.getInstance().getMasterVolume(); public static final float LEVELUP_PITCH = 0.5F; // Reduced to differentiate between vanilla level-up - public static final float LEVELUP_VOLUME = 0.75F * Config.getInstance().getMasterVolume(); // Use max volume always*/ + public static final float LEVELUP_VOLUME = 0.75F * MainConfig.getInstance().getMasterVolume(); // Use max volume always*/ private static Random random = new Random(); private Misc() { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java index c72e04a49..981724b59 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.config.AdvancedConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.meta.OldName; import com.gmail.nossr50.core.runnables.MobHealthDisplayUpdaterTask; import com.gmail.nossr50.core.skills.MobHealthbarType; @@ -38,7 +38,7 @@ public final class MobHealthbarUtils { * @param damage damage done by the attack triggering this */ public static void handleMobHealthbars(LivingEntity target, double damage, mcMMO plugin) { - if (mcMMO.isHealthBarPluginEnabled() || !Config.getInstance().getMobHealthbarEnabled()) { + if (mcMMO.isHealthBarPluginEnabled() || !MainConfig.getInstance().getMobHealthbarEnabled()) { return; } @@ -62,12 +62,12 @@ public final class MobHealthbarUtils { } boolean oldNameVisible = target.isCustomNameVisible(); - String newName = createHealthDisplay(Config.getInstance().getMobHealthbarDefault(), target, damage); + String newName = createHealthDisplay(MainConfig.getInstance().getMobHealthbarDefault(), target, damage); target.setCustomName(newName); target.setCustomNameVisible(true); - int displayTime = Config.getInstance().getMobHealthbarTime(); + int displayTime = MainConfig.getInstance().getMobHealthbarTime(); if (displayTime != -1) { boolean updateName = !ChatColor.stripColor(oldName).equalsIgnoreCase(ChatColor.stripColor(newName)); diff --git a/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java b/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java index e8c2af8ac..c45717efa 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java @@ -4,7 +4,7 @@ import com.gmail.nossr50.config.mods.CustomArmorConfig; import com.gmail.nossr50.config.mods.CustomBlockConfig; import com.gmail.nossr50.config.mods.CustomEntityConfig; import com.gmail.nossr50.config.mods.CustomToolConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.mods.CustomBlock; import com.gmail.nossr50.core.datatypes.mods.CustomEntity; import com.gmail.nossr50.core.datatypes.mods.CustomTool; @@ -89,71 +89,71 @@ public class ModManager { } public boolean isCustomBoots(Material material) { - return Config.getInstance().getArmorModsEnabled() && customBoots.contains(material); + return MainConfig.getInstance().getArmorModsEnabled() && customBoots.contains(material); } public boolean isCustomChestplate(Material material) { - return Config.getInstance().getArmorModsEnabled() && customChestplates.contains(material); + return MainConfig.getInstance().getArmorModsEnabled() && customChestplates.contains(material); } public boolean isCustomHelmet(Material material) { - return Config.getInstance().getArmorModsEnabled() && customHelmets.contains(material); + return MainConfig.getInstance().getArmorModsEnabled() && customHelmets.contains(material); } public boolean isCustomLeggings(Material material) { - return Config.getInstance().getArmorModsEnabled() && customLeggings.contains(material); + return MainConfig.getInstance().getArmorModsEnabled() && customLeggings.contains(material); } public boolean isCustomAxe(Material material) { - return Config.getInstance().getToolModsEnabled() && customAxes.contains(material); + return MainConfig.getInstance().getToolModsEnabled() && customAxes.contains(material); } public boolean isCustomBow(Material material) { - return Config.getInstance().getToolModsEnabled() && customBows.contains(material); + return MainConfig.getInstance().getToolModsEnabled() && customBows.contains(material); } public boolean isCustomHoe(Material material) { - return Config.getInstance().getToolModsEnabled() && customHoes.contains(material); + return MainConfig.getInstance().getToolModsEnabled() && customHoes.contains(material); } public boolean isCustomPickaxe(Material material) { - return Config.getInstance().getToolModsEnabled() && customPickaxes.contains(material); + return MainConfig.getInstance().getToolModsEnabled() && customPickaxes.contains(material); } public boolean isCustomShovel(Material material) { - return Config.getInstance().getToolModsEnabled() && customShovels.contains(material); + return MainConfig.getInstance().getToolModsEnabled() && customShovels.contains(material); } public boolean isCustomSword(Material material) { - return Config.getInstance().getToolModsEnabled() && customSwords.contains(material); + return MainConfig.getInstance().getToolModsEnabled() && customSwords.contains(material); } public boolean isCustomOre(Material data) { - return Config.getInstance().getBlockModsEnabled() && customOres.contains(data); + return MainConfig.getInstance().getBlockModsEnabled() && customOres.contains(data); } public boolean isCustomLog(BlockState state) { - return Config.getInstance().getBlockModsEnabled() && customLogs.contains(state.getType()); + return MainConfig.getInstance().getBlockModsEnabled() && customLogs.contains(state.getType()); } public boolean isCustomLeaf(BlockState state) { - return Config.getInstance().getBlockModsEnabled() && customLeaves.contains(state.getType()); + return MainConfig.getInstance().getBlockModsEnabled() && customLeaves.contains(state.getType()); } public boolean isCustomAbilityBlock(BlockState state) { - return Config.getInstance().getBlockModsEnabled() && customAbilityBlocks.contains(state.getType()); + return MainConfig.getInstance().getBlockModsEnabled() && customAbilityBlocks.contains(state.getType()); } public boolean isCustomExcavationBlock(BlockState state) { - return Config.getInstance().getBlockModsEnabled() && customExcavationBlocks.contains(state.getType()); + return MainConfig.getInstance().getBlockModsEnabled() && customExcavationBlocks.contains(state.getType()); } public boolean isCustomHerbalismBlock(BlockState state) { - return Config.getInstance().getBlockModsEnabled() && customHerbalismBlocks.contains(state.getType()); + return MainConfig.getInstance().getBlockModsEnabled() && customHerbalismBlocks.contains(state.getType()); } public boolean isCustomMiningBlock(BlockState state) { - return Config.getInstance().getBlockModsEnabled() && customMiningBlocks.contains(state.getType()); + return MainConfig.getInstance().getBlockModsEnabled() && customMiningBlocks.contains(state.getType()); } public CustomBlock getBlock(BlockState state) { @@ -171,7 +171,7 @@ public class ModManager { * @return true if the item is a custom tool, false otherwise */ public boolean isCustomTool(ItemStack item) { - return Config.getInstance().getToolModsEnabled() && item != null && customToolMap.containsKey(item.getType()); + return MainConfig.getInstance().getToolModsEnabled() && item != null && customToolMap.containsKey(item.getType()); } /** @@ -189,7 +189,7 @@ public class ModManager { } public boolean isCustomEntity(Entity entity) { - if (!Config.getInstance().getEntityModsEnabled()) { + if (!MainConfig.getInstance().getEntityModsEnabled()) { return false; } @@ -228,7 +228,7 @@ public class ModManager { } public void addCustomEntity(Entity entity) { - if (!Config.getInstance().getEntityModsEnabled()) { + if (!MainConfig.getInstance().getEntityModsEnabled()) { return; } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/Motd.java b/core/src/main/java/com/gmail/nossr50/core/util/Motd.java index 8f758af45..8163ae045 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/Motd.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/Motd.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.skills.PerksUtils; @@ -71,11 +71,11 @@ public final class Motd { player.sendMessage(LocaleLoader.getString("MOTD.Hardcore.Enabled", statLossInfo + seperator + vampirismInfo)); if (deathStatLossEnabled) { - player.sendMessage(LocaleLoader.getString("MOTD.Hardcore.DeathStatLoss.Stats", Config.getInstance().getHardcoreDeathStatPenaltyPercentage())); + player.sendMessage(LocaleLoader.getString("MOTD.Hardcore.DeathStatLoss.Stats", MainConfig.getInstance().getHardcoreDeathStatPenaltyPercentage())); } if (vampirismEnabled) { - player.sendMessage(LocaleLoader.getString("MOTD.Hardcore.Vampirism.Stats", Config.getInstance().getHardcoreVampirismStatLeechPercentage())); + player.sendMessage(LocaleLoader.getString("MOTD.Hardcore.Vampirism.Stats", MainConfig.getInstance().getHardcoreVampirismStatLeechPercentage())); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java b/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java index 107ca7d92..892f072c0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.config.RankConfig; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.json.McMMOUrl; @@ -52,7 +52,7 @@ public class TextComponentFactory { } public static void sendPlayerSubSkillWikiLink(Player player, String subskillformatted) { - if (!Config.getInstance().getUrlLinksEnabled()) + if (!MainConfig.getInstance().getUrlLinksEnabled()) return; Player.Spigot spigotPlayer = player.spigot(); diff --git a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java index 280aa0c4d..34955a960 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java @@ -14,7 +14,7 @@ import com.gmail.nossr50.commands.hardcore.HardcoreCommand; import com.gmail.nossr50.commands.hardcore.VampirismCommand; import com.gmail.nossr50.commands.party.PartyCommand; import com.gmail.nossr50.commands.party.teleport.PtpCommand; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.StringUtils; @@ -265,7 +265,7 @@ public final class CommandRegistrationManager { private static void registerMcpurgeCommand() { PluginCommand command = mcMMO.p.getCommand("mcpurge"); - command.setDescription(LocaleLoader.getString("Commands.Description.mcpurge", Config.getInstance().getOldUsersCutoff())); + command.setDescription(LocaleLoader.getString("Commands.Description.mcpurge", MainConfig.getInstance().getOldUsersCutoff())); command.setPermission("mcmmo.commands.mcpurge"); command.setPermissionMessage(permissionsMessage); command.setUsage(LocaleLoader.getString("Commands.Usage.0", "mcpurge")); diff --git a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java index 04b164638..ebfe4c7d3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util.commands; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; @@ -48,7 +48,7 @@ public final class CommandUtils { } public static boolean tooFar(CommandSender sender, Player target, boolean hasPermission) { - if (sender instanceof Player && !Misc.isNear(((Player) sender).getLocation(), target.getLocation(), Config.getInstance().getInspectDistance()) && !hasPermission) { + if (sender instanceof Player && !Misc.isNear(((Player) sender).getLocation(), target.getLocation(), MainConfig.getInstance().getInspectDistance()) && !hasPermission) { sender.sendMessage(LocaleLoader.getString("Inspect.TooFar")); return true; } @@ -261,7 +261,7 @@ public final class CommandUtils { * @return Matched name or {@code partialName} if no match was found */ public static String getMatchedPlayerName(String partialName) { - if (Config.getInstance().getMatchOfflinePlayers()) { + if (MainConfig.getInstance().getMatchOfflinePlayers()) { List matches = matchPlayer(partialName); if (matches.size() == 1) { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java b/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java index f239e8144..cb973462d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.util.experience; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; @@ -25,7 +25,7 @@ public class FormulaManager { public FormulaManager() { /* Setting for Classic Mode (Scales a lot of stuff up by * 10) */ - retroModeEnabled = Config.getInstance().getIsRetroMode(); + retroModeEnabled = MainConfig.getInstance().getIsRetroMode(); loadFormula(); } @@ -80,7 +80,7 @@ public class FormulaManager { public int[] calculateNewLevel(PrimarySkillType primarySkillType, int experience, FormulaType formulaType) { int newLevel = 0; int remainder = 0; - int maxLevel = Config.getInstance().getLevelCap(primarySkillType); + int maxLevel = MainConfig.getInstance().getLevelCap(primarySkillType); while (experience > 0 && newLevel < maxLevel) { int experienceToNextLevel = getCachedXpToLevel(newLevel, formulaType); diff --git a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java index d55723a1c..87977ba1c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util.scoreboards; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.database.PlayerStat; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; @@ -65,7 +65,7 @@ public class ScoreboardManager { * Stylizes the targetBoard in a Rainbow Pattern * This is off by default */ - if (Config.getInstance().getScoreboardRainbows()) { + if (MainConfig.getInstance().getScoreboardRainbows()) { // Everything but black, gray, gold List colors = Lists.newArrayList( ChatColor.WHITE, @@ -135,7 +135,7 @@ public class ScoreboardManager { } private static String formatAbility(ChatColor color, String abilityName) { - if (Config.getInstance().getShowAbilityNames()) { + if (MainConfig.getInstance().getShowAbilityNames()) { return getShortenedName(color + abilityName); } else { return color + LocaleLoader.getString("Scoreboard.Misc.Ability"); @@ -207,11 +207,11 @@ public class ScoreboardManager { } } - if (Config.getInstance().getPowerLevelTagsEnabled() && !dirtyPowerLevels.contains(playerName)) { + if (MainConfig.getInstance().getPowerLevelTagsEnabled() && !dirtyPowerLevels.contains(playerName)) { dirtyPowerLevels.add(playerName); } - if (Config.getInstance().getSkillLevelUpBoard()) { + if (MainConfig.getInstance().getSkillLevelUpBoard()) { enablePlayerSkillLevelUpScoreboard(player, skill); } } @@ -242,7 +242,7 @@ public class ScoreboardManager { wrapper.setOldScoreboard(); wrapper.setTypeSkill(skill); - changeScoreboard(wrapper, Config.getInstance().getSkillScoreboardTime()); + changeScoreboard(wrapper, MainConfig.getInstance().getSkillScoreboardTime()); } // **** Setup methods **** // @@ -258,7 +258,7 @@ public class ScoreboardManager { wrapper.setOldScoreboard(); wrapper.setTypeSkill(skill); - changeScoreboard(wrapper, Config.getInstance().getSkillLevelUpTime()); + changeScoreboard(wrapper, MainConfig.getInstance().getSkillLevelUpTime()); } public static void enablePlayerStatsScoreboard(Player player) { @@ -267,7 +267,7 @@ public class ScoreboardManager { wrapper.setOldScoreboard(); wrapper.setTypeSelfStats(); - changeScoreboard(wrapper, Config.getInstance().getStatsScoreboardTime()); + changeScoreboard(wrapper, MainConfig.getInstance().getStatsScoreboardTime()); } public static void enablePlayerInspectScoreboard(Player player, PlayerProfile targetProfile) { @@ -276,7 +276,7 @@ public class ScoreboardManager { wrapper.setOldScoreboard(); wrapper.setTypeInspectStats(targetProfile); - changeScoreboard(wrapper, Config.getInstance().getInspectScoreboardTime()); + changeScoreboard(wrapper, MainConfig.getInstance().getInspectScoreboardTime()); } public static void enablePlayerCooldownScoreboard(Player player) { @@ -285,7 +285,7 @@ public class ScoreboardManager { wrapper.setOldScoreboard(); wrapper.setTypeCooldowns(); - changeScoreboard(wrapper, Config.getInstance().getCooldownScoreboardTime()); + changeScoreboard(wrapper, MainConfig.getInstance().getCooldownScoreboardTime()); } public static void showPlayerRankScoreboard(Player player, Map rank) { @@ -295,7 +295,7 @@ public class ScoreboardManager { wrapper.setTypeSelfRank(); wrapper.acceptRankData(rank); - changeScoreboard(wrapper, Config.getInstance().getRankScoreboardTime()); + changeScoreboard(wrapper, MainConfig.getInstance().getRankScoreboardTime()); } public static void showPlayerRankScoreboardOthers(Player player, String targetName, Map rank) { @@ -305,7 +305,7 @@ public class ScoreboardManager { wrapper.setTypeInspectRank(targetName); wrapper.acceptRankData(rank); - changeScoreboard(wrapper, Config.getInstance().getRankScoreboardTime()); + changeScoreboard(wrapper, MainConfig.getInstance().getRankScoreboardTime()); } public static void showTopScoreboard(Player player, PrimarySkillType skill, int pageNumber, List stats) { @@ -315,7 +315,7 @@ public class ScoreboardManager { wrapper.setTypeTop(skill, pageNumber); wrapper.acceptLeaderboardData(stats); - changeScoreboard(wrapper, Config.getInstance().getTopScoreboardTime()); + changeScoreboard(wrapper, MainConfig.getInstance().getTopScoreboardTime()); } public static void showTopPowerScoreboard(Player player, int pageNumber, List stats) { @@ -325,7 +325,7 @@ public class ScoreboardManager { wrapper.setTypeTopPower(pageNumber); wrapper.acceptLeaderboardData(stats); - changeScoreboard(wrapper, Config.getInstance().getTopScoreboardTime()); + changeScoreboard(wrapper, MainConfig.getInstance().getTopScoreboardTime()); } /** @@ -370,7 +370,7 @@ public class ScoreboardManager { * @return the main targetBoard objective, or null if disabled */ public static Objective getPowerLevelObjective() { - if (!Config.getInstance().getPowerLevelTagsEnabled()) { + if (!MainConfig.getInstance().getPowerLevelTagsEnabled()) { Objective objective = mcMMO.p.getServer().getScoreboardManager().getMainScoreboard().getObjective(POWER_OBJECTIVE); if (objective != null) { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java index bec7faf8c..90bccb79b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util.scoreboards; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.database.PlayerStat; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; @@ -54,7 +54,7 @@ public class ScoreboardWrapper { sidebarObjective = this.scoreboard.registerNewObjective(ScoreboardManager.SIDEBAR_OBJECTIVE, "dummy"); powerObjective = this.scoreboard.registerNewObjective(ScoreboardManager.POWER_OBJECTIVE, "dummy"); - if (Config.getInstance().getPowerLevelTagsEnabled()) { + if (MainConfig.getInstance().getPowerLevelTagsEnabled()) { powerObjective.setDisplayName(ScoreboardManager.TAG_POWER_LEVEL); powerObjective.setDisplaySlot(DisplaySlot.BELOW_NAME); @@ -169,7 +169,7 @@ public class ScoreboardWrapper { PlayerProfile profile = UserManager.getPlayer(player).getProfile(); - if (profile.getScoreboardTipsShown() >= Config.getInstance().getTipsAmount()) { + if (profile.getScoreboardTipsShown() >= MainConfig.getInstance().getTipsAmount()) { return; } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java index 8544db699..b11cbdfeb 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.util.skills; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.mcMMO; import org.bukkit.FireworkEffect.Type; import org.bukkit.block.Block; @@ -20,7 +20,7 @@ public final class ParticleEffectUtils { ; public static void playBleedEffect(LivingEntity livingEntity) { - if (!Config.getInstance().getBleedEffectEnabled()) { + if (!MainConfig.getInstance().getBleedEffectEnabled()) { return; } @@ -28,7 +28,7 @@ public final class ParticleEffectUtils { } public static void playDodgeEffect(Player player) { - if (!Config.getInstance().getDodgeEffectEnabled()) { + if (!MainConfig.getInstance().getDodgeEffectEnabled()) { return; } @@ -36,7 +36,7 @@ public final class ParticleEffectUtils { } public static void playFluxEffect(Location location) { - if (!Config.getInstance().getFluxEffectEnabled()) { + if (!MainConfig.getInstance().getFluxEffectEnabled()) { return; } @@ -60,7 +60,7 @@ public final class ParticleEffectUtils { } public static void playGreaterImpactEffect(LivingEntity livingEntity) { - if (!Config.getInstance().getGreaterImpactEffectEnabled()) { + if (!MainConfig.getInstance().getGreaterImpactEffectEnabled()) { return; } @@ -70,7 +70,7 @@ public final class ParticleEffectUtils { } public static void playCallOfTheWildEffect(LivingEntity livingEntity) { - if (!Config.getInstance().getCallOfTheWildEffectEnabled()) { + if (!MainConfig.getInstance().getCallOfTheWildEffectEnabled()) { return; } @@ -78,7 +78,7 @@ public final class ParticleEffectUtils { } public static void playAbilityEnabledEffect(Player player) { - if (!Config.getInstance().getAbilityActivationEffectEnabled()) { + if (!MainConfig.getInstance().getAbilityActivationEffectEnabled()) { return; } @@ -88,7 +88,7 @@ public final class ParticleEffectUtils { } public static void playAbilityDisabledEffect(Player player) { - if (!Config.getInstance().getAbilityDeactivationEffectEnabled()) { + if (!MainConfig.getInstance().getAbilityDeactivationEffectEnabled()) { return; } @@ -105,7 +105,7 @@ public final class ParticleEffectUtils { Firework firework = (Firework) player.getWorld().spawnEntity(location, EntityType.FIREWORK); firework.setMetadata(mcMMO.funfettiMetadataKey, new FixedMetadataValue(mcMMO.p, null)); FireworkMeta fireworkMeta = firework.getFireworkMeta(); - FireworkEffect effect = FireworkEffect.builder().flicker(false).withColor(color).with((Config.getInstance().getLargeFireworks() ? Type.BALL_LARGE : Type.BALL)).trail(true).build(); + FireworkEffect effect = FireworkEffect.builder().flicker(false).withColor(color).with((MainConfig.getInstance().getLargeFireworks() ? Type.BALL_LARGE : Type.BALL)).trail(true).build(); fireworkMeta.addEffect(effect); fireworkMeta.addEffect(effect); fireworkMeta.setPower(0); diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java index 4c8e4c6f9..0004feec9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.util.skills; import com.gmail.nossr50.core.config.AdvancedConfig; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.config.ChunkConversionOptions; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; @@ -114,7 +114,7 @@ public class SkillUtils { * @return true if this is a valid skill, false otherwise */ public static boolean isSkill(String skillName) { - return Config.getInstance().getLocale().equalsIgnoreCase("en_US") ? PrimarySkillType.getSkill(skillName) != null : isLocalizedSkill(skillName); + return MainConfig.getInstance().getLocale().equalsIgnoreCase("en_US") ? PrimarySkillType.getSkill(skillName) != null : isLocalizedSkill(skillName); } public static void sendSkillMessage(Player player, NotificationType notificationType, String key) { diff --git a/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java b/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java index 81415d88d..89176332a 100644 --- a/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java +++ b/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java @@ -1,6 +1,6 @@ package net.shatteredlands.shatt.backup; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.mcMMO; import java.io.File; @@ -27,7 +27,7 @@ public class ZipLibrary { private static File REPAIR_FILE = new File(mcMMO.getMainDirectory() + "repair.vanilla.yml"); public static void mcMMOBackup() throws IOException { - if (Config.getInstance().getUseMySQL()) { + if (MainConfig.getInstance().getUseMySQL()) { mcMMO.p.debug("This server is running in SQL Mode."); mcMMO.p.debug("Only config files will be backed up."); } From 1d9a7cc7209ee9dafce607536edea18dbc1de060 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 14 Feb 2019 14:02:36 -0800 Subject: [PATCH 23/28] mcMMO is back to requiring bukkit instead of spigot --- bukkit/1_12/build.gradle.kts | 2 +- bukkit/1_13/build.gradle.kts | 2 +- bukkit/1_8_8/build.gradle.kts | 2 +- bukkit/build.gradle.kts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bukkit/1_12/build.gradle.kts b/bukkit/1_12/build.gradle.kts index 0fcf65839..b36e76a20 100644 --- a/bukkit/1_12/build.gradle.kts +++ b/bukkit/1_12/build.gradle.kts @@ -4,7 +4,7 @@ plugins { } dependencies { - implementation("org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT") // Spigot API + implementation("org.spigotmc:bukkit-api:1.12.2-R0.1-SNAPSHOT") // Spigot API implementation("com.sk89q.worldguard", "worldguard-legacy", "6.2") // WorldGuard } diff --git a/bukkit/1_13/build.gradle.kts b/bukkit/1_13/build.gradle.kts index 2fd5dd30d..4cf4bc663 100644 --- a/bukkit/1_13/build.gradle.kts +++ b/bukkit/1_13/build.gradle.kts @@ -4,7 +4,7 @@ plugins { } dependencies { - implementation("org.spigotmc:spigot-api:1.13.2-R0.1-SNAPSHOT") // Spigot API + implementation("org.spigotmc:bukkit-api:1.13.2-R0.1-SNAPSHOT") // Spigot API implementation("com.sk89q.worldguard", "worldguard-core", "7.0.0-SNAPSHOT") // WorldGuard implementation("com.sk89q.worldguard", "worldguard-legacy", "7.0.0-SNAPSHOT") // NEEDED } diff --git a/bukkit/1_8_8/build.gradle.kts b/bukkit/1_8_8/build.gradle.kts index 210fd08fe..71c59f40a 100644 --- a/bukkit/1_8_8/build.gradle.kts +++ b/bukkit/1_8_8/build.gradle.kts @@ -4,7 +4,7 @@ plugins { } dependencies { - implementation("org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT") // Spigot API + implementation("org.spigotmc:bukkit-api:1.8.8-R0.1-SNAPSHOT") // Spigot API implementation("com.sk89q.worldguard:worldguard-legacy:6.1.2") // Old worldguard } diff --git a/bukkit/build.gradle.kts b/bukkit/build.gradle.kts index 2a781f905..ad540ccb1 100644 --- a/bukkit/build.gradle.kts +++ b/bukkit/build.gradle.kts @@ -30,5 +30,5 @@ plugins { java } dependencies { - implementation("org.spigotmc:spigot-api:1.13.2-R0.1-SNAPSHOT") // Spigot API + implementation("org.spigotmc:bukkit-api:1.13.2-R0.1-SNAPSHOT") // Spigot API } From 4ea9037dd4f2d6c4aa0a224f8a3e9122cd7124ff Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 15 Feb 2019 15:08:15 -0800 Subject: [PATCH 24/28] new config system pt 6 doing some work on experience.yml --- Changelog.txt | 6 +- .../com/gmail/nossr50/core/config/Config.java | 17 +- .../config/experience/ExperienceConfig.java | 258 ++++++++++-------- .../mcmmo/{BlockTypes.java => BlockType.java} | 15 +- .../nossr50/core/mcmmo/bossbars/BarColor.java | 15 + .../nossr50/core/mcmmo/bossbars/BarStyle.java | 12 + .../nossr50/core/mcmmo/entity/EntityType.java | 10 + .../gmail/nossr50/core/util/StringUtils.java | 5 +- 8 files changed, 218 insertions(+), 120 deletions(-) rename core/src/main/java/com/gmail/nossr50/core/mcmmo/{BlockTypes.java => BlockType.java} (58%) create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/bossbars/BarColor.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/bossbars/BarStyle.java create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/EntityType.java diff --git a/Changelog.txt b/Changelog.txt index 8845f00c7..5fccb2c49 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -8,10 +8,14 @@ Key: - Removal Version 2.2.0 + mcMMO has a new config system (WIP) + mcMMO for Bukkit no longer requires Spigot in order to play, you can now use Bukkit instead (WIP) mcMMO is now abstracted from the Bukkit API in order to support more platforms (WIP) - Salvage config entries are no longer case sensitive mcMMO has changed from using maven to gradle! mcMMO is now a gradle project (this makes it much easier for us to support older versions of MC and other APIs) + +Version 2.1.12 + Salvage config entries are no longer case sensitive Fixed a bug where Fishing was not rewarding vanilla XP orbs Version 2.1.11 diff --git a/core/src/main/java/com/gmail/nossr50/core/config/Config.java b/core/src/main/java/com/gmail/nossr50/core/config/Config.java index 54f61a067..d7e1f3ec3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/Config.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/Config.java @@ -280,23 +280,32 @@ public abstract class Config implements VersionedConfig, Unload { return userRootNode; } - int getIntValue(String... path) + public int getIntValue(String... path) { return userRootNode.getNode(path).getInt(); } - double getDoubleValue(String... path) + public double getDoubleValue(String... path) { return userRootNode.getNode(path).getDouble(); } - boolean getBooleanValue(String... path) + public boolean getBooleanValue(String... path) { return userRootNode.getNode(path).getBoolean(); } - String getStringValue(String... path) + public String getStringValue(String... path) { return userRootNode.getNode(path).getString(); } + + /** + * Checks to see if a node exists in the user's config file + * @param path path to the node + * @return true if the node exists + */ + public boolean hasNode(String... path) { + return (userRootNode.getNode(path) != null); + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java index 056a8ca17..f2ff721f3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java @@ -3,6 +3,10 @@ package com.gmail.nossr50.core.config.experience; import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.config.ConfigValidated; import com.gmail.nossr50.core.datatypes.experience.FormulaType; +import com.gmail.nossr50.core.mcmmo.BlockType; +import com.gmail.nossr50.core.mcmmo.bossbars.BarColor; +import com.gmail.nossr50.core.mcmmo.bossbars.BarStyle; +import com.gmail.nossr50.core.mcmmo.entity.EntityType; import com.gmail.nossr50.core.skills.MaterialType; import com.gmail.nossr50.core.skills.PotionStage; import com.gmail.nossr50.core.skills.PrimarySkillType; @@ -12,6 +16,64 @@ import java.util.ArrayList; import java.util.List; public class ExperienceConfig extends ConfigValidated { + public static final String EXPLOIT_FIX = "ExploitFix"; + public static final String ENDERMAN_ENDERMITE_FARMS = "EndermanEndermiteFarms"; + public static final String EXPERIENCE = "Experience"; + public static final String EXPERIENCE_FORMULA = EXPERIENCE + "_Formula"; + public static final String CURVE = "Curve"; + public static final String VALUES = "_Values"; + public static final String MULTIPLIER = "multiplier"; + public static final String BASE = "base"; + public static final String EXPONENT = "exponent"; + public static final String MULTIPLIER1 = "Multiplier"; + public static final String GLOBAL = "Global"; + public static final String MOBSPAWNERS = "Mobspawners"; + public static final String BREEDING = "Breeding"; + public static final String MODIFIER = "Modifier"; + public static final String CUSTOM_XP_PERK = "Custom_XP_Perk"; + public static final String BOOST = "Boost"; + public static final String DIMISHED_RETURNS = "Dimished_Returns"; + public static final String GUARANTEED_MINIMUM_PERCENTAGE = "Guaranteed_Minimum_Percentage"; + public static final String DIMINISHED_RETURNS = "Diminished_Returns"; + public static final String ENABLE = "Enable"; + public static final String ENABLED = ENABLE + "d"; + public static final String TIME_INTERVAL = "Time_Interval"; + public static final String CONVERSION = "Conversion"; + public static final String EXP = "Exp_"; + public static final String PVP = "PVP"; + public static final String REWARDS = "Rewards"; + public static final String COMBAT = "Combat"; + public static final String ANIMALS = "Animals"; + public static final String BARS = "_Bars"; + public static final String UPDATE = "Update"; + public static final String PASSIVE = "Passive"; + public static final String THIS_MAY_CAUSE_LAG = "ThisMayCauseLag"; + public static final String ALWAYS = "Always"; + public static final String TITLES_WHEN_XPIS_GAINED = "TitlesWhenXPIsGained"; + public static final String EXTRA_DETAILS = "ExtraDetails"; + public static final String COLOR = "Color"; + public static final String BAR_STYLE = "BarStyle"; + public static final String ACROBATICS = "Acrobatics"; + public static final String DODGE = "Dodge"; + public static final String ROLL = "Roll"; + public static final String FALL = "Fall"; + public static final String FEATHER = "Feather"; + public static final String ALCHEMY = "Alchemy"; + public static final String POTION_STAGE = "Potion_Stage_"; + public static final String ARCHERY = "Archery"; + public static final String DISTANCE = "Distance_"; + public static final String FISHING = "Fishing"; + public static final String SHAKE = "Shake"; + public static final String REPAIR = "Repair"; + public static final String BASE1 = "Base"; + public static final String TAMING = "Taming"; + public static final String ANIMAL_TAMING = "Animal_Taming"; + public static final String PARTY = "Party"; + public static final String THRESHOLD = "Threshold"; + public static final String CUMULATIVE = "Cumulative_"; + public static final String OCELOT = "Ocelot"; + public static final String WOLF = "Wolf"; + public static final String FEATHER_FALL_MULTIPLIER = "FeatherFall_Multiplier"; private static ExperienceConfig instance; private ExperienceConfig() { @@ -51,40 +113,40 @@ public class ExperienceConfig extends ConfigValidated { /* Curve values */ if (getMultiplier(FormulaType.EXPONENTIAL) <= 0) { - reason.add("Experience_Formula.Exponential_Values.multiplier should be greater than 0!"); + reason.add(EXPERIENCE_FORMULA + ".Exponential" + VALUES + "." + MULTIPLIER + " should be greater than 0!"); } if (getMultiplier(FormulaType.LINEAR) <= 0) { - reason.add("Experience_Formula.Linear_Values.multiplier should be greater than 0!"); + reason.add(EXPERIENCE_FORMULA + ".Linear" + VALUES + "." + MULTIPLIER + " should be greater than 0!"); } if (getExponent(FormulaType.EXPONENTIAL) <= 0) { - reason.add("Experience_Formula.Exponential_Values.exponent should be greater than 0!"); + reason.add(EXPERIENCE_FORMULA + ".Exponential" + VALUES + "." + EXPONENT + " should be greater than 0!"); } /* Global modifier */ if (getExperienceGainsGlobalMultiplier() <= 0) { - reason.add("Experience_Formula.Multiplier.Global should be greater than 0!"); + reason.add(EXPERIENCE_FORMULA + "." + MULTIPLIER1 + "." + GLOBAL + " should be greater than 0!"); } /* PVP modifier */ if (getPlayerVersusPlayerXP() < 0) { - reason.add("Experience_Formula.Multiplier.PVP should be at least 0!"); + reason.add(EXPERIENCE_FORMULA + "." + MULTIPLIER1 + "." + PVP + " should be at least 0!"); } /* Spawned Mob modifier */ if (getSpawnedMobXpMultiplier() < 0) { - reason.add("Experience_Formula.Mobspawners.Multiplier should be at least 0!"); + reason.add(EXPERIENCE_FORMULA + "." + MOBSPAWNERS + "." + MULTIPLIER1 + " should be at least 0!"); } /* Bred Mob modifier */ if (getBredMobXpMultiplier() < 0) { - reason.add("Experience_Formula.Breeding.Multiplier should be at least 0!"); + reason.add(EXPERIENCE_FORMULA + "." + BREEDING + "." + MULTIPLIER1 + " should be at least 0!"); } /* Conversion */ if (getExpModifier() <= 0) { - reason.add("Conversion.Exp_Modifier should be greater than 0!"); + reason.add(CONVERSION + "." + EXP + MODIFIER + " should be greater than 0!"); } /* @@ -94,51 +156,51 @@ public class ExperienceConfig extends ConfigValidated { /* Alchemy */ for (PotionStage potionStage : PotionStage.values()) { if (getPotionXP(potionStage) < 0) { - reason.add("Experience.Alchemy.Potion_Stage_" + potionStage.toNumerical() + " should be at least 0!"); + reason.add(EXPERIENCE + "." + ALCHEMY + "." + POTION_STAGE + potionStage.toNumerical() + " should be at least 0!"); } } /* Archery */ if (getArcheryDistanceMultiplier() < 0) { - reason.add("Experience.Archery.Distance_Multiplier should be at least 0!"); + reason.add(EXPERIENCE + "." + ARCHERY + "." + DISTANCE + MULTIPLIER1 + " should be at least 0!"); } /* Combat XP Multipliers */ if (getAnimalsXP() < 0) { - reason.add("Experience.Combat.Multiplier.Animals should be at least 0!"); + reason.add(EXPERIENCE + "." + COMBAT + "." + MULTIPLIER1 + "." + ANIMALS + " should be at least 0!"); } if (getDodgeXPModifier() < 0) { - reason.add("Skills.Acrobatics.Dodge_XP_Modifier should be at least 0!"); + reason.add("Skills." + ACROBATICS + "." + DODGE + "_XP_" + MODIFIER + " should be at least 0!"); } if (getRollXPModifier() < 0) { - reason.add("Skills.Acrobatics.Roll_XP_Modifier should be at least 0!"); + reason.add("Skills." + ACROBATICS + "." + ROLL + "_XP_" + MODIFIER + " should be at least 0!"); } if (getFallXPModifier() < 0) { - reason.add("Skills.Acrobatics.Fall_XP_Modifier should be at least 0!"); + reason.add("Skills." + ACROBATICS + "." + FALL + "_XP_" + MODIFIER + " should be at least 0!"); } /* Fishing */ // TODO: Add validation for each fish type once enum is available. if (getFishingShakeXP() <= 0) { - reason.add("Experience.Fishing.Shake should be greater than 0!"); + reason.add(EXPERIENCE + "." + FISHING + "." + SHAKE + " should be greater than 0!"); } /* Repair */ if (getRepairXPBase() <= 0) { - reason.add("Experience.Repair.Base should be greater than 0!"); + reason.add(EXPERIENCE + "." + REPAIR + "." + BASE1 + " should be greater than 0!"); } /* Taming */ if (getTamingXP(EntityType.WOLF) <= 0) { - reason.add("Experience.Taming.Animal_Taming.Wolf should be greater than 0!"); + reason.add(EXPERIENCE + "." + TAMING + "." + ANIMAL_TAMING + "." + WOLF + " should be greater than 0!"); } if (getTamingXP(EntityType.OCELOT) <= 0) { - reason.add("Experience.Taming.Animal_Taming.Ocelot should be greater than 0!"); + reason.add(EXPERIENCE + "." + TAMING + "." + ANIMAL_TAMING + "." + OCELOT + " should be greater than 0!"); } return reason; @@ -150,84 +212,85 @@ public class ExperienceConfig extends ConfigValidated { /* EXPLOIT TOGGLES */ public boolean isEndermanEndermiteFarmingPrevented() { - return getBooleanValue("ExploitFix.EndermanEndermiteFarms", true); + return getBooleanValue(EXPLOIT_FIX, ENDERMAN_ENDERMITE_FARMS); } /* Curve settings */ public FormulaType getFormulaType() { - return FormulaType.getFormulaType(getStringValue("Experience_Formula.Curve")); + return FormulaType.getFormulaType(getStringValue(EXPERIENCE_FORMULA, CURVE)); } public boolean getCumulativeCurveEnabled() { - return getBooleanValue("Experience_Formula.Cumulative_Curve", false); + return getBooleanValue(EXPERIENCE_FORMULA, CUMULATIVE + CURVE); } /* Curve values */ public double getMultiplier(FormulaType type) { - return getDoubleValue("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.multiplier"); + return getDoubleValue(EXPERIENCE_FORMULA, StringUtils.getCapitalized(type.toString()) + VALUES, MULTIPLIER); } public int getBase(FormulaType type) { - return getIntValue("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.base"); + return getIntValue(EXPERIENCE_FORMULA, StringUtils.getCapitalized(type.toString()) + VALUES, BASE); } public double getExponent(FormulaType type) { - return getDoubleValue("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.exponent"); + return getDoubleValue(EXPERIENCE_FORMULA, StringUtils.getCapitalized(type.toString()) + VALUES, EXPONENT); } /* Global modifier */ public double getExperienceGainsGlobalMultiplier() { - return getDoubleValue("Experience_Formula.Multiplier.Global", 1.0); + return getDoubleValue(EXPERIENCE_FORMULA, MULTIPLIER1, GLOBAL); } - public void setExperienceGainsGlobalMultiplier(double value) { - config.set("Experience_Formula.Multiplier.Global", value); - } + //TODO: Rewrite this + /*public void setExperienceGainsGlobalMultiplier(double value) { + config.set(EXPERIENCE_FORMULA, MULTIPLIER1, GLOBAL, value); + }*/ /* PVP modifier */ public double getPlayerVersusPlayerXP() { - return getDoubleValue("Experience_Formula.Multiplier.PVP", 1.0); + return getDoubleValue(EXPERIENCE_FORMULA, MULTIPLIER1, PVP); } /* Spawned Mob modifier */ public double getSpawnedMobXpMultiplier() { - return getDoubleValue("Experience_Formula.Mobspawners.Multiplier", 0.0); + return getDoubleValue(EXPERIENCE_FORMULA, MOBSPAWNERS, MULTIPLIER1); } public double getBredMobXpMultiplier() { - return getDoubleValue("Experience_Formula.Breeding.Multiplier", 1.0); + return getDoubleValue(EXPERIENCE_FORMULA, BREEDING, MULTIPLIER1); } /* Skill modifiers */ public double getFormulaSkillModifier(PrimarySkillType skill) { - return getDoubleValue("Experience_Formula.Modifier." + StringUtils.getCapitalized(skill.toString())); + return getDoubleValue(EXPERIENCE_FORMULA, MODIFIER, StringUtils.getCapitalized(skill.toString())); } /* Custom XP perk */ public double getCustomXpPerkBoost() { - return getDoubleValue("Experience_Formula.Custom_XP_Perk.Boost", 1.25); + return getDoubleValue(EXPERIENCE_FORMULA, CUSTOM_XP_PERK, BOOST); } /* Diminished Returns */ public float getDiminishedReturnsCap() { - return (float) getDoubleValue("Dimished_Returns.Guaranteed_Minimum_Percentage", 0.05D); + return (float) getDoubleValue(DIMISHED_RETURNS, GUARANTEED_MINIMUM_PERCENTAGE); } public boolean getDiminishedReturnsEnabled() { - return getBooleanValue("Diminished_Returns.Enabled", false); + return getBooleanValue(DIMINISHED_RETURNS, ENABLED); } public int getDiminishedReturnsThreshold(PrimarySkillType skill) { - return getIntValue("Diminished_Returns.Threshold." + StringUtils.getCapitalized(skill.toString()), 20000); + return getIntValue(DIMINISHED_RETURNS, THRESHOLD, StringUtils.getCapitalized(skill.toString())); } public int getDiminishedReturnsTimeInterval() { - return getIntValue("Diminished_Returns.Time_Interval", 10); + return getIntValue(DIMINISHED_RETURNS, TIME_INTERVAL); } /* Conversion */ public double getExpModifier() { - return getDoubleValue("Conversion.Exp_Modifier", 1); + return getDoubleValue(CONVERSION, EXP + MODIFIER); } /* @@ -236,78 +299,53 @@ public class ExperienceConfig extends ConfigValidated { /* General Settings */ public boolean getExperienceGainsPlayerVersusPlayerEnabled() { - return getBooleanValue("Experience.PVP.Rewards", true); + return getBooleanValue(EXPERIENCE, PVP, REWARDS); } /* Combat XP Multipliers */ public double getCombatXP(EntityType entity) { - return getDoubleValue("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); + return getDoubleValue(EXPERIENCE, COMBAT, MULTIPLIER1, entity.getConfigName()); } public double getAnimalsXP(EntityType entity) { - return getDoubleValue("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_"), getAnimalsXP()); + return getDoubleValue(EXPERIENCE, COMBAT, MULTIPLIER1, entity.getConfigName()); } public double getAnimalsXP() { - return getDoubleValue("Experience.Combat.Multiplier.Animals", 1.0); + return getDoubleValue(EXPERIENCE, COMBAT, MULTIPLIER1, ANIMALS); } public boolean hasCombatXP(EntityType entity) { - return config.contains("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); + return hasNode(EXPERIENCE, COMBAT, MULTIPLIER1, entity.getConfigName()); } /* Materials */ - public int getXp(PrimarySkillType skill, Material data) { - String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + "."; - String explicitString = baseString + StringUtils.getExplicitConfigMaterialString(data); - if (config.contains(explicitString)) - return getIntValue(explicitString); - String friendlyString = baseString + StringUtils.getFriendlyConfigMaterialString(data); - if (config.contains(friendlyString)) - return getIntValue(friendlyString); - String wildcardString = baseString + StringUtils.getWildcardConfigMaterialString(data); - if (config.contains(wildcardString)) - return getIntValue(wildcardString); - return 0; + + /** + * Gets the raw XP given for breaking this block, this does not include modifiers + * @param skill The skill to give XP for + * @param blockType the type of block + * @return the raw amount of XP for this block before modifiers + */ + public int getXp(PrimarySkillType skill, BlockType blockType) { + //TODO: This is going to need to be changed, this code here is only placeholder + String[] path = new String[]{ EXPERIENCE, StringUtils.getCapitalized(skill.toString()), blockType.getConfigName() }; + return getIntValue(path); } - /* Materials */ - public int getXp(PrimarySkillType skill, BlockData data) { - String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + "."; - String explicitString = baseString + StringUtils.getExplicitConfigBlockDataString(data); - if (config.contains(explicitString)) - return getIntValue(explicitString); - String friendlyString = baseString + StringUtils.getFriendlyConfigBlockDataString(data); - if (config.contains(friendlyString)) - return getIntValue(friendlyString); - String wildcardString = baseString + StringUtils.getWildcardConfigBlockDataString(data); - if (config.contains(wildcardString)) - return getIntValue(wildcardString); - return 0; - } - - public boolean doesBlockGiveSkillXP(PrimarySkillType skill, Material data) { - String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + "."; - String explicitString = baseString + StringUtils.getExplicitConfigMaterialString(data); - if (config.contains(explicitString)) - return true; - String friendlyString = baseString + StringUtils.getFriendlyConfigMaterialString(data); - if (config.contains(friendlyString)) - return true; - String wildcardString = baseString + StringUtils.getWildcardConfigMaterialString(data); - return config.contains(wildcardString); - } - - public boolean doesBlockGiveSkillXP(PrimarySkillType skill, BlockData data) { - String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + "."; - String explicitString = baseString + StringUtils.getExplicitConfigBlockDataString(data); - if (config.contains(explicitString)) - return true; - String friendlyString = baseString + StringUtils.getFriendlyConfigBlockDataString(data); - if (config.contains(friendlyString)) - return true; - String wildcardString = baseString + StringUtils.getWildcardConfigBlockDataString(data); - return config.contains(wildcardString); + /** + * Checks if a block gives XP + * This is used to determine whether or not mcMMO should track a block that is placed by a user, among other things. + * Note: If the block has an entry in the config that will return true even if the XP is 0, this does not check the value of the XP + * @param skill The skill to check for + * @param blockType the type of block + * @return true if the block does give XP + */ + public boolean doesBlockGiveSkillXP(PrimarySkillType skill, BlockType blockType) { + //TODO: This used to support wildcard characters, seems a bit unnecessary to do so. + //TODO: This is going to need to be changed, this code here is only placeholder + String[] path = new String[] {EXPERIENCE, StringUtils.getCapitalized(skill.toString()), blockType.getConfigName()}; + return hasNode(path); } /* @@ -315,31 +353,31 @@ public class ExperienceConfig extends ConfigValidated { */ public boolean isPartyExperienceBarsEnabled() { - return getBooleanValue("Experience_Bars.Update.Party", true); + return getBooleanValue(EXPERIENCE + BARS, UPDATE, PARTY); } public boolean isPassiveGainsExperienceBarsEnabled() { - return getBooleanValue("Experience_Bars.Update.Passive", true); + return getBooleanValue(EXPERIENCE + BARS, UPDATE, PASSIVE); } public boolean getDoExperienceBarsAlwaysUpdateTitle() { - return getBooleanValue("Experience_Bars.ThisMayCauseLag.AlwaysUpdateTitlesWhenXPIsGained.Enable", false) || getAddExtraDetails(); + return getBooleanValue(EXPERIENCE + BARS, THIS_MAY_CAUSE_LAG, ALWAYS + UPDATE + TITLES_WHEN_XPIS_GAINED, ENABLE) || getAddExtraDetails(); } public boolean getAddExtraDetails() { - return getBooleanValue("Experience_Bars.ThisMayCauseLag.AlwaysUpdateTitlesWhenXPIsGained.ExtraDetails", false); + return getBooleanValue(EXPERIENCE + BARS, THIS_MAY_CAUSE_LAG, ALWAYS + UPDATE + TITLES_WHEN_XPIS_GAINED, EXTRA_DETAILS); } public boolean isExperienceBarsEnabled() { - return getBooleanValue("Experience_Bars.Enable", true); + return getBooleanValue(EXPERIENCE + BARS, ENABLE); } public boolean isExperienceBarEnabled(PrimarySkillType primarySkillType) { - return getBooleanValue("Experience_Bars." + StringUtils.getCapitalized(primarySkillType.toString()) + ".Enable", true); + return getBooleanValue(EXPERIENCE + BARS, StringUtils.getCapitalized(primarySkillType.toString()), ENABLE); } public BarColor getExperienceBarColor(PrimarySkillType primarySkillType) { - String colorValueFromConfig = getStringValue("Experience_Bars." + StringUtils.getCapitalized(primarySkillType.toString()) + ".Color"); + String colorValueFromConfig = getStringValue(EXPERIENCE + BARS, StringUtils.getCapitalized(primarySkillType.toString()), COLOR); for (BarColor barColor : BarColor.values()) { if (barColor.toString().equalsIgnoreCase(colorValueFromConfig)) @@ -351,7 +389,7 @@ public class ExperienceConfig extends ConfigValidated { } public BarStyle getExperienceBarStyle(PrimarySkillType primarySkillType) { - String colorValueFromConfig = getStringValue("Experience_Bars." + StringUtils.getCapitalized(primarySkillType.toString()) + ".BarStyle"); + String colorValueFromConfig = getStringValue(EXPERIENCE + BARS, StringUtils.getCapitalized(primarySkillType.toString()), BAR_STYLE); for (BarStyle barStyle : BarStyle.values()) { if (barStyle.toString().equalsIgnoreCase(colorValueFromConfig)) @@ -364,46 +402,46 @@ public class ExperienceConfig extends ConfigValidated { /* Acrobatics */ public int getDodgeXPModifier() { - return getIntValue("Experience.Acrobatics.Dodge", 120); + return getIntValue(EXPERIENCE, ACROBATICS, DODGE); } public int getRollXPModifier() { - return getIntValue("Experience.Acrobatics.Roll", 80); + return getIntValue(EXPERIENCE, ACROBATICS, ROLL); } public int getFallXPModifier() { - return getIntValue("Experience.Acrobatics.Fall", 120); + return getIntValue(EXPERIENCE, ACROBATICS, FALL); } public double getFeatherFallXPModifier() { - return getDoubleValue("Experience.Acrobatics.FeatherFall_Multiplier", 2.0); + return getDoubleValue(EXPERIENCE, ACROBATICS, FEATHER_FALL_MULTIPLIER); } /* Alchemy */ public double getPotionXP(PotionStage stage) { - return getDoubleValue("Experience.Alchemy.Potion_Stage_" + stage.toNumerical(), 10D); + return getDoubleValue(EXPERIENCE, ALCHEMY, POTION_STAGE + stage.toNumerical()); } /* Archery */ public double getArcheryDistanceMultiplier() { - return getDoubleValue("Experience.Archery.Distance_Multiplier", 0.025); + return getDoubleValue(EXPERIENCE, ARCHERY, DISTANCE + MULTIPLIER1); } public int getFishingShakeXP() { - return getIntValue("Experience.Fishing.Shake", 50); + return getIntValue(EXPERIENCE, FISHING, SHAKE); } /* Repair */ public double getRepairXPBase() { - return getDoubleValue("Experience.Repair.Base", 1000.0); + return getDoubleValue(EXPERIENCE, REPAIR, BASE1); } public double getRepairXP(MaterialType repairMaterialType) { - return getDoubleValue("Experience.Repair." + StringUtils.getCapitalized(repairMaterialType.toString())); + return getDoubleValue(EXPERIENCE, REPAIR, StringUtils.getCapitalized(repairMaterialType.toString())); } /* Taming */ public int getTamingXP(EntityType type) { - return getIntValue("Experience.Taming.Animal_Taming." + StringUtils.getPrettyEntityTypeString(type)); + return getIntValue(EXPERIENCE, TAMING, ANIMAL_TAMING, type.getConfigName()); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/BlockTypes.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/BlockType.java similarity index 58% rename from core/src/main/java/com/gmail/nossr50/core/mcmmo/BlockTypes.java rename to core/src/main/java/com/gmail/nossr50/core/mcmmo/BlockType.java index 9ac7b8d73..1873363a5 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/BlockTypes.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/BlockType.java @@ -6,6 +6,19 @@ package com.gmail.nossr50.core.mcmmo; * For example, an Oak Log in older versions of MC was simply a block with state information of being variant oak * To account for all the differences between version we have our own custom constants that will match based on platform */ -public enum BlockTypes { +public enum BlockType { + //TODO: Fill in every block that has ever existed + AIR, + WATER; + //TODO: Wire this up + + /** + * Gets the config name for a block type + * @return the config name for this block type + */ + public String getConfigName() + { + + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/bossbars/BarColor.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/bossbars/BarColor.java new file mode 100644 index 000000000..03b1f53c5 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/bossbars/BarColor.java @@ -0,0 +1,15 @@ +package com.gmail.nossr50.core.mcmmo.bossbars; + +/** + * Boss bars can only be specific colors + * Those colors are listed here + */ +public enum BarColor { + BLUE, + GREEN, + PINK, + PURPLE, + RED, + WHITE, + YELLOW +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/bossbars/BarStyle.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/bossbars/BarStyle.java new file mode 100644 index 000000000..6e9f5fecf --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/bossbars/BarStyle.java @@ -0,0 +1,12 @@ +package com.gmail.nossr50.core.mcmmo.bossbars; + +/** + * Represents the visual style for Boss Bar, these are hardcoded and only the following are available + */ +public enum BarStyle { + SEGMENTED_6, + SEGMENTED_10, + SEGMENTED_12, + SEGMENTED_20, + SOLID +} diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/EntityType.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/EntityType.java new file mode 100644 index 000000000..7aaed73a1 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/EntityType.java @@ -0,0 +1,10 @@ +package com.gmail.nossr50.core.mcmmo.entity; + +public enum EntityType { + //TODO: Fill this out + WOLF, + OCELOT; + + //TODO: Wire this up + public String getConfigName() { return toString(); } +} diff --git a/core/src/main/java/com/gmail/nossr50/core/util/StringUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/StringUtils.java index e4234f181..24080b1c2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/StringUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/StringUtils.java @@ -1,11 +1,8 @@ package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.datatypes.party.PartyFeature; +import com.gmail.nossr50.core.mcmmo.entity.EntityType; import com.gmail.nossr50.core.skills.SuperAbilityType; -import org.bukkit.Material; -import org.bukkit.block.data.Ageable; -import org.bukkit.block.data.BlockData; -import org.bukkit.entity.EntityType; public class StringUtils { From f9fb9a17a9c61250b72138876cdfdfd265a33d75 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 15 Feb 2019 15:20:36 -0800 Subject: [PATCH 25/28] defining entitytype (wip) --- .../src/main/java/com/gmail/nossr50/core/TODO | 10 +- .../nossr50/core/mcmmo/entity/EntityType.java | 105 +++++++++++++++++- 2 files changed, 111 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/gmail/nossr50/core/TODO b/core/src/main/java/com/gmail/nossr50/core/TODO index bd54d3d0d..449d0c8d1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/TODO +++ b/core/src/main/java/com/gmail/nossr50/core/TODO @@ -1,7 +1,7 @@ This file is just going to take note of all the caveats of mcMMO code as I abstract out bukkit 1) In several places mcMMO is disabling itself, pretty sure this is not a good idea and this should be changed - eg: in McMMOPlayer, and when loading configs and finding bad vlaues + eg: in McMMOPlayer, and when loading configs and finding bad values 2) mcMMO uses a a global reference of its Plugin class for Bukkit in order to schedule tasks @@ -9,4 +9,10 @@ This file is just going to take note of all the caveats of mcMMO code as I abstr 4) Safety check the hardcore/vampirism commands -5) Tweak configs to not do any string operations \ No newline at end of file +5) Tweak configs to not do any string operations + +6) Need to add and check validation for all current configs + +7) Weird stuff going on with ageables and strings in general in StringUtils + +8) Reduce the amount of string operations in mcMMO as much as possible \ No newline at end of file diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/EntityType.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/EntityType.java index 7aaed73a1..4c2b636a3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/EntityType.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/EntityType.java @@ -1,10 +1,111 @@ package com.gmail.nossr50.core.mcmmo.entity; +/** + * Used bukkit as a reference for this, should probably make sure nothing weird is in here + */ public enum EntityType { //TODO: Fill this out + AREA_EFFECT_CLOUD, + ARROW, + BAT, + BLAZE, + BOAT, + CAVE_SPIDER, + CHICKEN, + COD, + COMPLEX_PART, + COW, + CREEPER, + DOLPHIN, + DONKEY, + DRAGON_FIREBALL, + DROPPED_ITEM, + DROWNED, + EGG, + ELDER_GUARDIAN, + ENDER_CRYSTAL, + ENDER_DRAGON, + ENDER_PEARL, + ENDER_SIGNAL, + ENDERMAN, + ENDERMITE, + EVOKER, + EVOKER_FANGS, + EXPERIENCE_ORB, + FALLING_BLOCK, + FIREBALL, + FIREWORK, + FISHING_HOOK, + GHAST, + GIANT, + GUARDIAN, + HORSE, + HUSK, + ILLUSIONER, + IRON_GOLEM, + ITEM_FRAME, + LEASH_HITCH, + LIGHTNING, + LINGERING_POTION, + LLAMA, + LLAMA_SPIT, + MAGMA_CUBE, + MINECART, + MINECART_CHEST, + MINECART_COMMAND, + MINECART_FURNACE, + MINECART_HOPPER, + MINECART_MOB_SPAWNER, + MINECART_TNT, + MULE, + MUSHROOM_COW, + OCELOT, + PAINTING, + PARROT, + PHANTOM, + PIG, + PIG_ZOMBIE, + PLAYER, + POLAR_BEAR, + PRIMED_TNT, + PUFFERFISH, + RABBIT, + SALMON, + SHEEP, + SHULKER, + SHULKER_BULLET, + SILVERFISH, + SKELETON, + SKELETON_HORSE, + SLIME, + SMALL_FIREBALL, + SNOWBALL, + SNOWMAN, + SPECTRAL_ARROW, + SPIDER, + SPLASH_POTION, + SQUID, + STRAY, + THROWN_XP_BOTTLE, + TIPPED_ARROW, + TRIDENT, + TROPICAL_FISH, + TURTLE, + VEX, + VILLAGER, + VINDICATOR, + WEATHER, + WITCH, + WITHER, + WITHER_SKELETON, + WITHER_SKULL, WOLF, - OCELOT; + ZOMBIE, + ZOMBIE_HORSE, + ZOMBIE_VILLAGER; //TODO: Wire this up - public String getConfigName() { return toString(); } + public String getConfigName() { + //return toString(); + } } From 4e8e95e3cb414f0bf218c9d2faa7d20687cac416 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 15 Feb 2019 17:45:48 -0800 Subject: [PATCH 26/28] new config system pt 7 (jesus) --- .../nossr50/core/config/AdvancedConfig.java | 2 +- .../com/gmail/nossr50/core/config/Config.java | 33 +++++++- .../core/config/ConfigKeyRegister.java | 8 +- .../nossr50/core/config/ConfigValidated.java | 8 +- .../nossr50/core/config/CoreSkillsConfig.java | 2 +- .../gmail/nossr50/core/config/MainConfig.java | 3 +- .../gmail/nossr50/core/config/RankConfig.java | 2 +- .../nossr50/core/config/SoundConfig.java | 2 +- .../config/experience/ExperienceConfig.java | 3 +- .../core/config/mods/CustomArmorConfig.java | 6 +- .../core/config/mods/CustomBlockConfig.java | 2 +- .../config/skills/repair/RepairConfig.java | 84 ++++++++++++------- .../nossr50/core/mcmmo/item/ItemStack.java | 7 ++ .../nossr50/core/mcmmo/item/ItemType.java | 12 +++ ...{ItemType.java => ConfigItemCategory.java} | 2 +- .../skills/child/salvage/SalvageManager.java | 2 +- .../salvage/salvageables/Salvageable.java | 4 +- .../salvageables/SalvageableFactory.java | 8 +- .../salvageables/SimpleSalvageable.java | 12 +-- .../skills/primary/repair/RepairManager.java | 2 +- .../repair/repairables/Repairable.java | 4 +- .../repair/repairables/RepairableFactory.java | 12 +-- .../repair/repairables/SimpleRepairable.java | 12 +-- .../core/util/InvalidItemException.java | 7 ++ .../gmail/nossr50/core/util/ItemUtils.java | 30 +++++-- .../gmail/nossr50/core/util/Permissions.java | 27 +++--- 26 files changed, 196 insertions(+), 100 deletions(-) create mode 100644 core/src/main/java/com/gmail/nossr50/core/mcmmo/item/ItemType.java rename core/src/main/java/com/gmail/nossr50/core/skills/{ItemType.java => ConfigItemCategory.java} (69%) create mode 100644 core/src/main/java/com/gmail/nossr50/core/util/InvalidItemException.java diff --git a/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java index c6cc31424..181f8ae74 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/AdvancedConfig.java @@ -126,7 +126,7 @@ public class AdvancedConfig extends ConfigValidated { private static AdvancedConfig instance; private AdvancedConfig() { - super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "advanced.yml"); + super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "advanced.yml", true); } public static AdvancedConfig getInstance() { diff --git a/core/src/main/java/com/gmail/nossr50/core/config/Config.java b/core/src/main/java/com/gmail/nossr50/core/config/Config.java index d7e1f3ec3..d66a36e61 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/Config.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/Config.java @@ -18,6 +18,9 @@ import java.io.InputStream; //@ConfigSerializable public abstract class Config implements VersionedConfig, Unload { + /* SETTINGS */ + private boolean mergeNewKeys; + /* PATH VARS */ public final File DIRECTORY_DATA_FOLDER; //Directory that the file is in @@ -42,16 +45,17 @@ public abstract class Config implements VersionedConfig, Unload { /* CONFIG MANAGER */ private ConfigurationLoader configManager; - public Config(String pathToParentFolder, String relativePath) { + public Config(String pathToParentFolder, String relativePath, boolean mergeNewKeys) { //TODO: Check if this works... - this(new File(pathToParentFolder), relativePath); + this(new File(pathToParentFolder), relativePath, mergeNewKeys); System.out.println("mcMMO Debug: Don't forget to check if loading config file by string instead of File works..."); } - public Config(File pathToParentFolder, String relativePath) { + public Config(File pathToParentFolder, String relativePath, boolean mergeNewKeys) { /* * These must be at the top */ + this.mergeNewKeys = mergeNewKeys; //Whether or not we add new keys when they are found mkdirDefaults(); // Make our default config dir DIRECTORY_DATA_FOLDER = pathToParentFolder; //Data Folder for our plugin FILE_RELATIVE_PATH = relativePath; //Relative path to config from a parent folder @@ -240,7 +244,8 @@ public abstract class Config implements VersionedConfig, Unload { McmmoCore.getLogger().info(userRootNode.getChildrenMap().size() +" items in default root map"); // Merge Values from default - userRootNode = userRootNode.mergeValuesFrom(defaultRootNode); + if(mergeNewKeys) + userRootNode = userRootNode.mergeValuesFrom(defaultRootNode); // Update config version updateConfigVersion(); @@ -280,21 +285,41 @@ public abstract class Config implements VersionedConfig, Unload { return userRootNode; } + /** + * Grabs an int from the specified node + * @param path + * @return the int from the node, null references will zero initialize + */ public int getIntValue(String... path) { return userRootNode.getNode(path).getInt(); } + /** + * Grabs a double from the specified node + * @param path + * @return the double from the node, null references will zero initialize + */ public double getDoubleValue(String... path) { return userRootNode.getNode(path).getDouble(); } + /** + * Grabs a boolean from the specified node + * @param path + * @return the boolean from the node, null references will zero initialize + */ public boolean getBooleanValue(String... path) { return userRootNode.getNode(path).getBoolean(); } + /** + * Grabs a string from the specified node + * @param path + * @return the string from the node, null references will zero initialize + */ public String getStringValue(String... path) { return userRootNode.getNode(path).getString(); diff --git a/core/src/main/java/com/gmail/nossr50/core/config/ConfigKeyRegister.java b/core/src/main/java/com/gmail/nossr50/core/config/ConfigKeyRegister.java index 666dcc5cd..3c91e53ed 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/ConfigKeyRegister.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/ConfigKeyRegister.java @@ -7,13 +7,13 @@ import java.io.File; */ public abstract class ConfigKeyRegister extends Config implements RegistersKeys { - public ConfigKeyRegister(String pathToParentFolder, String relativePath) { - super(pathToParentFolder, relativePath); + public ConfigKeyRegister(String pathToParentFolder, String relativePath, boolean mergeNewKeys) { + super(pathToParentFolder, relativePath, mergeNewKeys); loadKeys(); } - public ConfigKeyRegister(File pathToParentFolder, String relativePath) { - super(pathToParentFolder, relativePath); + public ConfigKeyRegister(File pathToParentFolder, String relativePath, boolean mergeNewKeys) { + super(pathToParentFolder, relativePath, mergeNewKeys); loadKeys(); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/ConfigValidated.java b/core/src/main/java/com/gmail/nossr50/core/config/ConfigValidated.java index 0e0d1e979..da2999b20 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/ConfigValidated.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/ConfigValidated.java @@ -9,15 +9,15 @@ import java.util.List; * This class is used for config files that validate their entries */ public abstract class ConfigValidated extends Config implements DefaultKeys { - public ConfigValidated(String parentFolderPath, String relativePath) + public ConfigValidated(String parentFolderPath, String relativePath, boolean mergeNewKeys) { - super(parentFolderPath, relativePath); + super(parentFolderPath, relativePath, mergeNewKeys); validateEntries(); } - public ConfigValidated(File parentFolderFile, String relativePath) + public ConfigValidated(File parentFolderFile, String relativePath, boolean mergeNewKeys) { - super(parentFolderFile, relativePath); + super(parentFolderFile, relativePath, mergeNewKeys); validateEntries(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/CoreSkillsConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/CoreSkillsConfig.java index 17a8b2baa..cdd72237d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/CoreSkillsConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/CoreSkillsConfig.java @@ -9,7 +9,7 @@ public class CoreSkillsConfig extends Config { private static CoreSkillsConfig instance; public CoreSkillsConfig() { - super(McmmoCore.getDataFolderPath().getAbsoluteFile(),"coreskills.yml"); + super(McmmoCore.getDataFolderPath().getAbsoluteFile(),"coreskills.yml", true); } public static CoreSkillsConfig getInstance() { diff --git a/core/src/main/java/com/gmail/nossr50/core/config/MainConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/MainConfig.java index a399a3347..95cdcae25 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/MainConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/MainConfig.java @@ -3,6 +3,7 @@ package com.gmail.nossr50.core.config; import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.data.database.SQLDatabaseManager; import com.gmail.nossr50.core.datatypes.party.PartyFeature; +import com.gmail.nossr50.core.mcmmo.entity.EntityType; import com.gmail.nossr50.core.skills.MobHealthbarType; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; @@ -16,7 +17,7 @@ public class MainConfig extends ConfigValidated { private static MainConfig instance; private MainConfig() { - super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "config.yml"); + super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "config.yml", true); } public static MainConfig getInstance() { diff --git a/core/src/main/java/com/gmail/nossr50/core/config/RankConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/RankConfig.java index fe584a4e4..c3cc63549 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/RankConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/RankConfig.java @@ -11,7 +11,7 @@ public class RankConfig extends ConfigValidated { private static RankConfig instance; public RankConfig() { - super(McmmoCore.getDataFolderPath().getAbsoluteFile(),"skillranks.yml"); + super(McmmoCore.getDataFolderPath().getAbsoluteFile(),"skillranks.yml", true); this.instance = this; } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/SoundConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/SoundConfig.java index 05abe9987..12f7fa2eb 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/SoundConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/SoundConfig.java @@ -10,7 +10,7 @@ public class SoundConfig extends ConfigValidated { private static SoundConfig instance; public SoundConfig() { - super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "sounds.yml"); + super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "sounds.yml", true); this.instance = this; } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java index f2ff721f3..e1c233ac2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java @@ -76,8 +76,9 @@ public class ExperienceConfig extends ConfigValidated { public static final String FEATHER_FALL_MULTIPLIER = "FeatherFall_Multiplier"; private static ExperienceConfig instance; + //TODO: Should merge be false? Seems okay to leave it as true.. private ExperienceConfig() { - super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "experience.yml"); + super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "experience.yml", true); } public static ExperienceConfig getInstance() { diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java index b916451b2..ae7fc4136 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java @@ -3,7 +3,7 @@ package com.gmail.nossr50.core.config.mods; import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.config.ConfigKeyRegister; import com.gmail.nossr50.core.mcmmo.item.ItemStack; -import com.gmail.nossr50.core.skills.ItemType; +import com.gmail.nossr50.core.skills.ConfigItemCategory; import com.gmail.nossr50.core.skills.MaterialType; import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; import com.gmail.nossr50.core.skills.primary.repair.repairables.RepairableFactory; @@ -22,7 +22,7 @@ public class CustomArmorConfig extends ConfigKeyRegister { private boolean needsUpdate = false; protected CustomArmorConfig(String fileName) { - super(McmmoCore.getDataFolderPath().getPath() + "mods", fileName); + super(McmmoCore.getDataFolderPath().getPath() + "mods", fileName, false); loadKeys(); } @@ -101,7 +101,7 @@ public class CustomArmorConfig extends ConfigKeyRegister { durability = (short) getIntValue(armorType + "." + armorName + ".Durability", 70); } - repairables.add(RepairableFactory.getRepairable(armorMaterial, repairMaterial, repairData, repairItemName, repairMinimumLevel, repairQuantity, durability, ItemType.ARMOR, MaterialType.OTHER, repairXpMultiplier)); + repairables.add(RepairableFactory.getRepairable(armorMaterial, repairMaterial, repairData, repairItemName, repairMinimumLevel, repairQuantity, durability, ConfigItemCategory.ARMOR, MaterialType.OTHER, repairXpMultiplier)); } materialList.add(armorMaterial); diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java index 20a9b429b..4b983ec9d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java @@ -24,7 +24,7 @@ public class CustomBlockConfig extends ConfigKeyRegister { private boolean needsUpdate = false; protected CustomBlockConfig(String fileName) { - super(McmmoCore.getDataFolderPath().getPath() + "mods", fileName); + super(McmmoCore.getDataFolderPath().getPath() + "mods", fileName, false); loadKeys(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java index 0c2530907..f5d50ce5a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java @@ -1,46 +1,74 @@ package com.gmail.nossr50.core.config.skills.repair; -import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.McmmoCore; +import com.gmail.nossr50.core.config.ConfigKeyRegister; import com.gmail.nossr50.core.mcmmo.item.ItemStack; -import com.gmail.nossr50.core.skills.ItemType; +import com.gmail.nossr50.core.skills.ConfigItemCategory; import com.gmail.nossr50.core.skills.MaterialType; import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; import com.gmail.nossr50.core.skills.primary.repair.repairables.RepairableFactory; +import com.gmail.nossr50.core.util.InvalidItemException; import com.gmail.nossr50.core.util.ItemUtils; import com.gmail.nossr50.core.util.skills.SkillUtils; +import ninja.leaping.configurate.ConfigurationNode; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; -import java.util.Set; -public class RepairConfig extends Config { +/** + * This config + */ +public class RepairConfig extends ConfigKeyRegister { private List repairables; public RepairConfig(String fileName) { - super(fileName); + super(McmmoCore.getDataFolderPath().getAbsoluteFile(), fileName, false); loadKeys(); } @Override - protected void loadKeys() { + public void unload() { + + } + + /** + * The version of this config + * + * @return + */ + @Override + public double getConfigVersion() { + return 1; + } + + @Override + public void loadKeys() { repairables = new ArrayList(); - ConfigurationSection section = config.getConfigurationSection("Repairables"); - Set keys = section.getKeys(false); + ConfigurationNode repairablesNode = getUserRootNode().getNode("Repairables"); + List repairablesNodeChildrenList = repairablesNode.getChildrenList(); + Iterator configIter = repairablesNodeChildrenList.iterator(); - for (String key : keys) { - if (config.contains("Repairables." + key + ".ItemId")) { - backup(); - return; - } + for(Iterator i = repairablesNodeChildrenList.iterator(); i.hasNext();) + { + ConfigurationNode iterNode = i.next(); + //TODO: Verify that this is getting the key + String key = iterNode.getKey().toString(); //Get the String of the node // Validate all the things! List reason = new ArrayList(); - // ItemStack Material - Material itemMaterial = Material.matchMaterial(key); - if (itemMaterial == null) { + + try { + // ItemStack Material + ConfigItemCategory configItemCategory = ItemUtils.matchItemType(key); + } catch (InvalidItemException e) { + e.printStackTrace(); + } + + if (itemType == null) { reason.add("Invalid material: " + key); } @@ -48,8 +76,8 @@ public class RepairConfig extends Config { MaterialType repairMaterialType = MaterialType.OTHER; String repairMaterialTypeString = getStringValue("Repairables." + key + ".MaterialType", "OTHER"); - if (!config.contains("Repairables." + key + ".MaterialType") && itemMaterial != null) { - ItemStack repairItem = new ItemStack(itemMaterial); + if (!config.contains("Repairables." + key + ".MaterialType") && itemType != null) { + ItemStack repairItem = ItemStack.makeNew(itemType); if (ItemUtils.isWoodTool(repairItem)) { repairMaterialType = MaterialType.WOOD; @@ -83,7 +111,7 @@ public class RepairConfig extends Config { } // Maximum Durability - short maximumDurability = (itemMaterial != null ? itemMaterial.getMaxDurability() : (short) getIntValue("Repairables." + key + ".MaximumDurability")); + short maximumDurability = (itemType != null ? itemType.getMaxDurability() : (short) getIntValue("Repairables." + key + ".MaximumDurability")); if (maximumDurability <= 0) { maximumDurability = (short) getIntValue("Repairables." + key + ".MaximumDurability"); @@ -94,20 +122,20 @@ public class RepairConfig extends Config { } // ItemStack Type - ItemType repairItemType = ItemType.OTHER; + ConfigItemCategory repairConfigItemCategory = ConfigItemCategory.OTHER; String repairItemTypeString = getStringValue("Repairables." + key + ".ItemType", "OTHER"); - if (!config.contains("Repairables." + key + ".ItemType") && itemMaterial != null) { - ItemStack repairItem = new ItemStack(itemMaterial); + if (!config.contains("Repairables." + key + ".ItemType") && itemType != null) { + ItemStack repairItem = new ItemStack(itemType); if (ItemUtils.isMinecraftTool(repairItem)) { - repairItemType = ItemType.TOOL; + repairConfigItemCategory = ConfigItemCategory.TOOL; } else if (ItemUtils.isArmor(repairItem)) { - repairItemType = ItemType.ARMOR; + repairConfigItemCategory = ConfigItemCategory.ARMOR; } } else { try { - repairItemType = ItemType.valueOf(repairItemTypeString); + repairConfigItemCategory = ConfigItemCategory.valueOf(repairItemTypeString); } catch (IllegalArgumentException ex) { reason.add(key + " has an invalid ItemType of " + repairItemTypeString); } @@ -122,9 +150,9 @@ public class RepairConfig extends Config { } // Minimum Quantity - int minimumQuantity = (itemMaterial != null ? SkillUtils.getRepairAndSalvageQuantities(new ItemStack(itemMaterial), repairMaterial, repairMetadata) : getIntValue("Repairables." + key + ".MinimumQuantity", 2)); + int minimumQuantity = (itemType != null ? SkillUtils.getRepairAndSalvageQuantities(new ItemStack(itemType), repairMaterial, repairMetadata) : getIntValue("Repairables." + key + ".MinimumQuantity", 2)); - if (minimumQuantity <= 0 && itemMaterial != null) { + if (minimumQuantity <= 0 && itemType != null) { minimumQuantity = getIntValue("Repairables." + key + ".MinimumQuantity", 2); } @@ -133,7 +161,7 @@ public class RepairConfig extends Config { } if (noErrorsInRepairable(reason)) { - Repairable repairable = RepairableFactory.getRepairable(itemMaterial, repairMaterial, repairMetadata, minimumLevel, minimumQuantity, maximumDurability, repairItemType, repairMaterialType, xpMultiplier); + Repairable repairable = RepairableFactory.getRepairable(itemType, repairMaterial, repairMetadata, minimumLevel, minimumQuantity, maximumDurability, repairConfigItemCategory, repairMaterialType, xpMultiplier); repairables.add(repairable); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/item/ItemStack.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/item/ItemStack.java index 4a7ee3c38..f932f3542 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/item/ItemStack.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/item/ItemStack.java @@ -9,6 +9,13 @@ import java.util.ArrayList; */ public interface ItemStack { + /** + * Makes a new ItemStack for a given itemType with a size of 1 and default properties + * @param itemType the item type for the item stack + * @return a new item stack of size 1 with default properties + */ + ItemStack makeNew(ItemType itemType); + /** * The maximum amount of this item allowed in a stack * @return the maximum stack size of the item diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/item/ItemType.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/item/ItemType.java new file mode 100644 index 000000000..d02f66116 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/item/ItemType.java @@ -0,0 +1,12 @@ +package com.gmail.nossr50.core.mcmmo.item; + +/** + * Items are things that the player can pick up and hold in his hand + * Which includes item versions of blocks + */ +public enum ItemType { + //TODO: Fill this in + + COOKED_BEEF, + CAKE; +} diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/ItemType.java b/core/src/main/java/com/gmail/nossr50/core/skills/ConfigItemCategory.java similarity index 69% rename from core/src/main/java/com/gmail/nossr50/core/skills/ItemType.java rename to core/src/main/java/com/gmail/nossr50/core/skills/ConfigItemCategory.java index 2035e841c..86d4a5c13 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/ItemType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/ConfigItemCategory.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills; -public enum ItemType { +public enum ConfigItemCategory { ARMOR, TOOL, OTHER; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java index 59d993adc..9e27e5be2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java @@ -71,7 +71,7 @@ public class SalvageManager extends SkillManager { } // Permissions checks on material and item types - if (!Permissions.salvageItemType(player, salvageable.getSalvageItemType())) { + if (!Permissions.salvageItemType(player, salvageable.getSalvageConfigItemCategory())) { NotificationManager.sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission"); return; } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/Salvageable.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/Salvageable.java index d15e4be72..ea75c98c4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/Salvageable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/Salvageable.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.child.salvage.salvageables; -import com.gmail.nossr50.core.skills.ItemType; +import com.gmail.nossr50.core.skills.ConfigItemCategory; import com.gmail.nossr50.core.skills.MaterialType; import org.bukkit.Material; @@ -31,7 +31,7 @@ public interface Salvageable { * * @return the ItemType for this salvageable */ - public ItemType getSalvageItemType(); + public ConfigItemCategory getSalvageConfigItemCategory(); /** * Gets the MaterialType value for this salvageable item diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableFactory.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableFactory.java index 155ca567f..c894386d2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableFactory.java @@ -1,16 +1,16 @@ package com.gmail.nossr50.core.skills.child.salvage.salvageables; -import com.gmail.nossr50.core.skills.ItemType; +import com.gmail.nossr50.core.skills.ConfigItemCategory; import com.gmail.nossr50.core.skills.MaterialType; import org.bukkit.Material; public class SalvageableFactory { public static Salvageable getSalvageable(Material itemMaterial, Material repairMaterial, byte repairMetadata, int maximumQuantity, short maximumDurability) { - return getSalvageable(itemMaterial, repairMaterial, repairMetadata, 0, maximumQuantity, maximumDurability, ItemType.OTHER, MaterialType.OTHER, 1); + return getSalvageable(itemMaterial, repairMaterial, repairMetadata, 0, maximumQuantity, maximumDurability, ConfigItemCategory.OTHER, MaterialType.OTHER, 1); } - public static Salvageable getSalvageable(Material itemMaterial, Material repairMaterial, byte repairMetadata, int minimumLevel, int maximumQuantity, short maximumDurability, ItemType repairItemType, MaterialType repairMaterialType, double xpMultiplier) { + public static Salvageable getSalvageable(Material itemMaterial, Material repairMaterial, byte repairMetadata, int minimumLevel, int maximumQuantity, short maximumDurability, ConfigItemCategory repairConfigItemCategory, MaterialType repairMaterialType, double xpMultiplier) { // TODO: Add in loading from config what type of repairable we want. - return new SimpleSalvageable(itemMaterial, repairMaterial, repairMetadata, minimumLevel, maximumQuantity, maximumDurability, repairItemType, repairMaterialType, xpMultiplier); + return new SimpleSalvageable(itemMaterial, repairMaterial, repairMetadata, minimumLevel, maximumQuantity, maximumDurability, repairConfigItemCategory, repairMaterialType, xpMultiplier); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SimpleSalvageable.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SimpleSalvageable.java index b2c4c0ac9..99ba64274 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SimpleSalvageable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SimpleSalvageable.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.child.salvage.salvageables; -import com.gmail.nossr50.core.skills.ItemType; +import com.gmail.nossr50.core.skills.ConfigItemCategory; import com.gmail.nossr50.core.skills.MaterialType; import org.bukkit.Material; @@ -10,15 +10,15 @@ public class SimpleSalvageable implements Salvageable { private final int maximumQuantity, minimumLevel; private final short maximumDurability, baseSalvageDurability; private final byte salvageMetadata; - private final ItemType salvageItemType; + private final ConfigItemCategory salvageConfigItemCategory; private final MaterialType salvageMaterialType; private final double xpMultiplier; - protected SimpleSalvageable(Material type, Material salvageMaterial, byte salvageMetadata, int minimumLevel, int maximumQuantity, short maximumDurability, ItemType salvageItemType, MaterialType salvageMaterialType, double xpMultiplier) { + protected SimpleSalvageable(Material type, Material salvageMaterial, byte salvageMetadata, int minimumLevel, int maximumQuantity, short maximumDurability, ConfigItemCategory salvageConfigItemCategory, MaterialType salvageMaterialType, double xpMultiplier) { this.itemMaterial = type; this.salvageMaterial = salvageMaterial; this.salvageMetadata = salvageMetadata; - this.salvageItemType = salvageItemType; + this.salvageConfigItemCategory = salvageConfigItemCategory; this.salvageMaterialType = salvageMaterialType; this.minimumLevel = minimumLevel; this.maximumQuantity = maximumQuantity; @@ -43,8 +43,8 @@ public class SimpleSalvageable implements Salvageable { } @Override - public ItemType getSalvageItemType() { - return salvageItemType; + public ConfigItemCategory getSalvageConfigItemCategory() { + return salvageConfigItemCategory; } @Override diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java index 979d77c54..32250d8bd 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java @@ -77,7 +77,7 @@ public class RepairManager extends SkillManager { return; } - if (!Permissions.repairItemType(player, repairable.getRepairItemType())) { + if (!Permissions.repairItemType(player, repairable.getRepairConfigItemCategory())) { NotificationManager.sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission"); return; } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/Repairable.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/Repairable.java index ca51d18b8..6131d282f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/Repairable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/Repairable.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.primary.repair.repairables; -import com.gmail.nossr50.core.skills.ItemType; +import com.gmail.nossr50.core.skills.ConfigItemCategory; import com.gmail.nossr50.core.skills.MaterialType; import org.bukkit.Material; @@ -39,7 +39,7 @@ public interface Repairable { * * @return the RepairItemType for this repairable */ - public ItemType getRepairItemType(); + public ConfigItemCategory getRepairConfigItemCategory(); /** * Gets the RepairMaterialType value for this repairable item diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableFactory.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableFactory.java index 4f50e2153..bfb5c13f1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableFactory.java @@ -1,21 +1,21 @@ package com.gmail.nossr50.core.skills.primary.repair.repairables; -import com.gmail.nossr50.core.skills.ItemType; +import com.gmail.nossr50.core.skills.ConfigItemCategory; import com.gmail.nossr50.core.skills.MaterialType; import org.bukkit.Material; public class RepairableFactory { public static Repairable getRepairable(Material itemMaterial, Material repairMaterial, byte repairMetadata, int minimumQuantity, short maximumDurability) { - return getRepairable(itemMaterial, repairMaterial, repairMetadata, null, 0, minimumQuantity, maximumDurability, ItemType.OTHER, MaterialType.OTHER, 1); + return getRepairable(itemMaterial, repairMaterial, repairMetadata, null, 0, minimumQuantity, maximumDurability, ConfigItemCategory.OTHER, MaterialType.OTHER, 1); } - public static Repairable getRepairable(Material itemMaterial, Material repairMaterial, byte repairMetadata, int minimumLevel, int minimumQuantity, short maximumDurability, ItemType repairItemType, MaterialType repairMaterialType, double xpMultiplier) { - return getRepairable(itemMaterial, repairMaterial, repairMetadata, null, minimumLevel, minimumQuantity, maximumDurability, repairItemType, repairMaterialType, xpMultiplier); + public static Repairable getRepairable(Material itemMaterial, Material repairMaterial, byte repairMetadata, int minimumLevel, int minimumQuantity, short maximumDurability, ConfigItemCategory repairConfigItemCategory, MaterialType repairMaterialType, double xpMultiplier) { + return getRepairable(itemMaterial, repairMaterial, repairMetadata, null, minimumLevel, minimumQuantity, maximumDurability, repairConfigItemCategory, repairMaterialType, xpMultiplier); } - public static Repairable getRepairable(Material itemMaterial, Material repairMaterial, byte repairMetadata, String repairMaterialPrettyName, int minimumLevel, int minimumQuantity, short maximumDurability, ItemType repairItemType, MaterialType repairMaterialType, double xpMultiplier) { + public static Repairable getRepairable(Material itemMaterial, Material repairMaterial, byte repairMetadata, String repairMaterialPrettyName, int minimumLevel, int minimumQuantity, short maximumDurability, ConfigItemCategory repairConfigItemCategory, MaterialType repairMaterialType, double xpMultiplier) { // TODO: Add in loading from config what type of repairable we want. - return new SimpleRepairable(itemMaterial, repairMaterial, repairMetadata, repairMaterialPrettyName, minimumLevel, minimumQuantity, maximumDurability, repairItemType, repairMaterialType, xpMultiplier); + return new SimpleRepairable(itemMaterial, repairMaterial, repairMetadata, repairMaterialPrettyName, minimumLevel, minimumQuantity, maximumDurability, repairConfigItemCategory, repairMaterialType, xpMultiplier); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairable.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairable.java index bfe9efeac..1f37848c7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairable.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.skills.primary.repair.repairables; -import com.gmail.nossr50.core.skills.ItemType; +import com.gmail.nossr50.core.skills.ConfigItemCategory; import com.gmail.nossr50.core.skills.MaterialType; import org.bukkit.Material; @@ -10,17 +10,17 @@ public class SimpleRepairable implements Repairable { private final int minimumQuantity, minimumLevel; private final short maximumDurability, baseRepairDurability; private final byte repairMetadata; - private final ItemType repairItemType; + private final ConfigItemCategory repairConfigItemCategory; private final MaterialType repairMaterialType; private final double xpMultiplier; private String repairMaterialPrettyName; - protected SimpleRepairable(Material type, Material repairMaterial, byte repairMetadata, String repairMaterialPrettyName, int minimumLevel, int minimumQuantity, short maximumDurability, ItemType repairItemType, MaterialType repairMaterialType, double xpMultiplier) { + protected SimpleRepairable(Material type, Material repairMaterial, byte repairMetadata, String repairMaterialPrettyName, int minimumLevel, int minimumQuantity, short maximumDurability, ConfigItemCategory repairConfigItemCategory, MaterialType repairMaterialType, double xpMultiplier) { this.itemMaterial = type; this.repairMaterial = repairMaterial; this.repairMetadata = repairMetadata; this.repairMaterialPrettyName = repairMaterialPrettyName; - this.repairItemType = repairItemType; + this.repairConfigItemCategory = repairConfigItemCategory; this.repairMaterialType = repairMaterialType; this.minimumLevel = minimumLevel; this.minimumQuantity = minimumQuantity; @@ -50,8 +50,8 @@ public class SimpleRepairable implements Repairable { } @Override - public ItemType getRepairItemType() { - return repairItemType; + public ConfigItemCategory getRepairConfigItemCategory() { + return repairConfigItemCategory; } @Override diff --git a/core/src/main/java/com/gmail/nossr50/core/util/InvalidItemException.java b/core/src/main/java/com/gmail/nossr50/core/util/InvalidItemException.java new file mode 100644 index 000000000..297322d2c --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/util/InvalidItemException.java @@ -0,0 +1,7 @@ +package com.gmail.nossr50.core.util; + +public class InvalidItemException extends RuntimeException { + public InvalidItemException(String message) { + super(message); + } +} diff --git a/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java index af074fc8f..b84afc675 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java @@ -1,18 +1,32 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.config.party.ItemWeightConfig; import com.gmail.nossr50.core.config.MainConfig; +import com.gmail.nossr50.core.config.party.ItemWeightConfig; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.inventory.FurnaceRecipe; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.Recipe; -import org.bukkit.inventory.meta.ItemMeta; +import com.gmail.nossr50.core.mcmmo.colors.ChatColor; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; +import com.gmail.nossr50.core.mcmmo.item.ItemType; public final class ItemUtils { private ItemUtils() { + + } + + /** + * Get an ItemType matching a string + * @param itemTypeString the string to match + * @return the matching ItemType for this string + */ + public static ItemType matchItemType(String itemTypeString) + { + for(ItemType itemType : ItemType.values()) + { + if(itemType.toString().equalsIgnoreCase(itemTypeString)) + return itemType; + } + + //TODO: Add custom exception + throw new InvalidItemException("[mcMMO] ItemType of name "+itemTypeString+" is invalid!"); } /** diff --git a/core/src/main/java/com/gmail/nossr50/core/util/Permissions.java b/core/src/main/java/com/gmail/nossr50/core/util/Permissions.java index 0055051bb..16270091d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/Permissions.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/Permissions.java @@ -1,8 +1,11 @@ package com.gmail.nossr50.core.util; +import com.gmail.nossr50.core.McmmoCore; +import com.gmail.nossr50.core.mcmmo.BlockType; +import com.gmail.nossr50.core.mcmmo.entity.EntityType; import com.gmail.nossr50.core.mcmmo.permissions.Permissible; import com.gmail.nossr50.core.mcmmo.world.World; -import com.gmail.nossr50.core.skills.ItemType; +import com.gmail.nossr50.core.skills.ConfigItemCategory; import com.gmail.nossr50.core.skills.MaterialType; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; @@ -366,12 +369,12 @@ public final class Permissions { return permissible.hasPermission("mcmmo.ability.herbalism.greenterra"); } - public static boolean greenThumbBlock(Permissible permissible, Material material) { - return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.blocks." + material.toString().replace("_", "").toLowerCase()); + public static boolean greenThumbBlock(Permissible permissible, BlockType blockType) { + return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.blocks." + blockType.getConfigName().toLowerCase()); } - public static boolean greenThumbPlant(Permissible permissible, Material material) { - return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.plants." + material.toString().replace("_", "").toLowerCase()); + public static boolean greenThumbPlant(Permissible permissible, BlockType blockType) { + return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.plants." + blockType.getConfigName().toLowerCase()); } /* MINING */ @@ -392,8 +395,8 @@ public final class Permissions { } /* REPAIR */ - public static boolean repairItemType(Permissible permissible, ItemType repairItemType) { - return permissible.hasPermission("mcmmo.ability.repair." + repairItemType.toString().toLowerCase() + "repair"); + public static boolean repairItemType(Permissible permissible, ConfigItemCategory repairConfigItemCategory) { + return permissible.hasPermission("mcmmo.ability.repair." + repairConfigItemCategory.toString().toLowerCase() + "repair"); } public static boolean repairMaterialType(Permissible permissible, MaterialType repairMaterialType) { @@ -409,8 +412,8 @@ public final class Permissions { return permissible.hasPermission("mcmmo.ability.salvage.arcanesalvage"); } - public static boolean salvageItemType(Permissible permissible, ItemType salvageItemType) { - return permissible.hasPermission("mcmmo.ability.salvage." + salvageItemType.toString().toLowerCase() + "salvage"); + public static boolean salvageItemType(Permissible permissible, ConfigItemCategory salvageConfigItemCategory) { + return permissible.hasPermission("mcmmo.ability.salvage." + salvageConfigItemCategory.toString().toLowerCase() + "salvage"); } public static boolean salvageMaterialType(Permissible permissible, MaterialType salvageMaterialType) { @@ -494,11 +497,9 @@ public final class Permissions { return permissible.hasPermission("mcmmo.commands.ptp.world." + world.getName()); } + //TODO: Do we even document that server admins can do this anywhere? public static void generateWorldTeleportPermissions() { - Server server = mcMMO.p.getServer(); - PluginManager pluginManager = server.getPluginManager(); - - for (World world : server.getWorlds()) { + for (World world : McmmoCore.getServer().getWorlds()) { addDynamicPermission("mcmmo.commands.ptp.world." + world.getName(), PermissionDefault.OP, pluginManager); } } From a5a613e200c649c1fcc5b8730d150616aba2fb02 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 15 Feb 2019 19:40:59 -0800 Subject: [PATCH 27/28] Killing Dead Imports --- .../main/java/com/gmail/nossr50/mcMMO.java | 2 +- .../src/main/java/com/gmail/nossr50/core/TODO | 18 ++++++- .../{skills/child => config}/ChildConfig.java | 7 ++- .../com/gmail/nossr50/core/config/Config.java | 2 + .../core/config/mods/CustomBlockConfig.java | 6 +-- .../core/config/mods/CustomEntityConfig.java | 7 +-- .../core/config/mods/CustomToolConfig.java | 17 +++---- .../core/config/mods/EntityConfigManager.java | 4 +- .../core/config/mods/ToolConfigManager.java | 4 +- .../config/skills/alchemy/PotionConfig.java | 1 - .../skills/repair/RepairConfigManager.java | 6 +-- .../config/skills/salvage/SalvageConfig.java | 18 +++---- .../core/data/blockmeta/ChunkletManager.java | 5 +- .../data/blockmeta/HashChunkletManager.java | 5 +- .../conversion/BlockStoreConversionMain.java | 2 - .../database/FlatfileDatabaseManager.java | 28 +++++----- .../data/database/SQLDatabaseManager.java | 26 +++++----- .../nossr50/core/datatypes/chat/ChatMode.java | 2 +- .../datatypes/experience/SkillXpGain.java | 2 +- .../datatypes/json/CustomBaseComponent.java | 1 - .../core/datatypes/json/McMMOWebLinks.java | 4 +- .../nossr50/core/datatypes/meta/OldName.java | 2 - .../core/datatypes/mods/CustomEntity.java | 3 +- .../core/datatypes/party/ItemShareType.java | 8 +-- .../nossr50/core/datatypes/party/Party.java | 19 ++++--- .../core/datatypes/party/PartyFeature.java | 9 ++-- .../datatypes/party/PartyTeleportRecord.java | 4 +- .../core/datatypes/party/ShareMode.java | 3 +- .../core/datatypes/player/PlayerProfile.java | 7 ++- .../core/events/chat/McMMOPartyChatEvent.java | 3 +- .../McMMOPlayerExperienceEvent.java | 5 +- .../McMMOPlayerLevelChangeEvent.java | 2 +- .../experience/McMMOPlayerLevelDownEvent.java | 3 +- .../experience/McMMOPlayerLevelUpEvent.java | 3 +- .../experience/McMMOPlayerXpGainEvent.java | 3 +- .../core/events/fake/FakeBlockBreakEvent.java | 4 +- .../events/fake/FakeBlockDamageEvent.java | 6 +-- .../core/events/fake/FakeBrewEvent.java | 3 -- .../fake/FakeEntityDamageByEntityEvent.java | 5 -- .../events/fake/FakeEntityDamageEvent.java | 4 -- .../core/events/fake/FakeEntityTameEvent.java | 3 -- .../events/fake/FakePlayerAnimationEvent.java | 4 +- .../core/events/fake/FakePlayerFishEvent.java | 6 +-- .../McMMOPlayerDeathPenaltyEvent.java | 5 +- .../McMMOPlayerPreDeathPenaltyEvent.java | 5 +- .../hardcore/McMMOPlayerStatLossEvent.java | 3 +- .../hardcore/McMMOPlayerVampirismEvent.java | 3 +- .../events/items/McMMOItemSpawnEvent.java | 6 +-- .../party/McMMOPartyAllianceChangeEvent.java | 5 +- .../events/party/McMMOPartyChangeEvent.java | 5 +- .../events/party/McMMOPartyLevelUpEvent.java | 3 -- .../events/party/McMMOPartyTeleportEvent.java | 4 +- .../events/party/McMMOPartyXpGainEvent.java | 3 -- .../scoreboard/McMMOScoreboardEvent.java | 5 +- .../McMMOScoreboardMakeboardEvent.java | 3 +- .../McMMOScoreboardObjectiveEvent.java | 5 +- .../McMMOScoreboardRevertEvent.java | 3 +- .../skills/McMMOPlayerNotificationEvent.java | 9 ++-- .../events/skills/McMMOPlayerSkillEvent.java | 4 +- .../McMMOPlayerAbilityActivateEvent.java | 3 +- .../McMMOPlayerAbilityDeactivateEvent.java | 2 +- .../abilities/McMMOPlayerAbilityEvent.java | 2 +- .../skills/alchemy/McMMOPlayerBrewEvent.java | 7 +-- .../alchemy/McMMOPlayerCatalysisEvent.java | 3 +- .../fishing/McMMOPlayerFishingEvent.java | 3 +- .../McMMOPlayerFishingTreasureEvent.java | 4 +- .../fishing/McMMOPlayerMagicHunterEvent.java | 6 +-- .../skills/fishing/McMMOPlayerShakeEvent.java | 5 +- .../repair/McMMOPlayerRepairCheckEvent.java | 5 +- .../salvage/McMMOPlayerSalvageCheckEvent.java | 5 +- .../secondaryabilities/SubSkillEvent.java | 3 +- .../SubSkillRandomCheckEvent.java | 2 +- .../unarmed/McMMOPlayerDisarmEvent.java | 3 +- .../nossr50/core/locale/LocaleLoader.java | 3 +- .../nossr50/core/party/PartyManager.java | 9 ++-- .../nossr50/core/party/ShareHandler.java | 7 ++- .../nossr50/core/runnables/CheckDateTask.java | 4 +- .../MobHealthDisplayUpdaterTask.java | 3 -- .../core/runnables/PistonTrackerTask.java | 8 +-- .../nossr50/core/runnables/SaveTimerTask.java | 4 +- .../runnables/StickyPistonTrackerTask.java | 6 +-- .../runnables/backups/CleanBackupsTask.java | 2 - .../commands/McScoreboardKeepTask.java | 5 +- .../commands/McrankCommandAsyncTask.java | 7 +-- .../commands/McrankCommandDisplayTask.java | 8 ++- .../commands/MctopCommandAsyncTask.java | 7 +-- .../commands/MctopCommandDisplayTask.java | 10 ++-- .../database/DatabaseConversionTask.java | 4 +- .../runnables/items/ChimaeraWingWarmup.java | 15 +++--- .../runnables/items/TeleportationWarmup.java | 13 +++-- .../runnables/party/PartyAutoKickTask.java | 7 +-- .../core/runnables/party/PartyChatTask.java | 6 +-- .../player/ClearRegisteredXPGainTask.java | 1 - .../player/PlayerProfileLoadingTask.java | 9 ++-- .../player/PlayerProfileSaveTask.java | 1 - .../player/PlayerUpdateInventoryTask.java | 4 +- .../player/PowerLevelUpdatingTask.java | 4 +- .../runnables/skills/AbilityCooldownTask.java | 3 +- .../runnables/skills/AbilityDisableTask.java | 19 +++---- .../skills/AlchemyBrewCheckTask.java | 7 +-- .../runnables/skills/AlchemyBrewTask.java | 17 +++---- .../core/runnables/skills/AprilTask.java | 15 +++--- .../runnables/skills/AwardCombatXpTask.java | 2 - .../skills/ExperienceBarHideTask.java | 3 +- .../skills/HerbalismBlockUpdaterTask.java | 4 +- .../skills/SkillUnlockNotificationTask.java | 3 +- .../core/runnables/skills/ToolLowerTask.java | 3 +- .../nossr50/core/skills/MaterialType.java | 1 - .../nossr50/core/skills/SubSkillFlags.java | 19 ------- .../gmail/nossr50/core/skills/ToolType.java | 5 +- .../core/skills/child/salvage/Salvage.java | 1 - .../skills/child/salvage/SalvageManager.java | 34 +++++-------- .../salvage/salvageables/Salvageable.java | 1 - .../salvageables/SalvageableFactory.java | 1 - .../salvageables/SalvageableManager.java | 4 +- .../salvageables/SimpleSalvageable.java | 1 - .../SimpleSalvageableManager.java | 5 +- .../core/skills/child/smelting/Smelting.java | 9 ++-- .../child/smelting/SmeltingManager.java | 31 +++++------ .../core/skills/interfaces/Progression.java | 1 - .../core/skills/interfaces/Toolable.java | 3 +- .../skills/primary/acrobatics/Acrobatics.java | 2 +- .../primary/acrobatics/AcrobaticsManager.java | 20 ++++---- .../core/skills/primary/alchemy/Alchemy.java | 9 +--- .../primary/alchemy/AlchemyManager.java | 10 ++-- .../skills/primary/alchemy/AlchemyPotion.java | 10 +--- .../primary/alchemy/AlchemyPotionBrewer.java | 25 ++++----- .../core/skills/primary/archery/Archery.java | 12 ++--- .../primary/archery/ArcheryManager.java | 21 +++----- .../skills/primary/archery/TrackedEntity.java | 3 -- .../core/skills/primary/axes/Axes.java | 9 ++-- .../core/skills/primary/axes/AxesManager.java | 17 +++---- .../skills/primary/excavation/Excavation.java | 7 ++- .../primary/excavation/ExcavationManager.java | 13 +++-- .../core/skills/primary/fishing/Fishing.java | 12 ++--- .../primary/fishing/FishingManager.java | 36 +++++-------- .../skills/primary/herbalism/Herbalism.java | 10 ++-- .../primary/herbalism/HerbalismManager.java | 30 +++++------ .../skills/primary/mining/BlastMining.java | 9 +--- .../core/skills/primary/mining/Mining.java | 10 ++-- .../core/skills/primary/repair/Repair.java | 1 - .../skills/primary/repair/RepairManager.java | 37 ++++++-------- .../repair/repairables/Repairable.java | 1 - .../repair/repairables/RepairableFactory.java | 1 - .../repair/repairables/RepairableManager.java | 4 +- .../repair/repairables/SimpleRepairable.java | 1 - .../repairables/SimpleRepairableManager.java | 5 +- .../skills/primary/swords/SwordsManager.java | 21 +++----- .../core/skills/primary/taming/Taming.java | 4 +- .../skills/primary/taming/TamingManager.java | 33 ++++++------ .../primary/taming/TrackedTamingEntity.java | 12 ++--- .../core/skills/primary/unarmed/Unarmed.java | 9 ++-- .../primary/unarmed/UnarmedManager.java | 27 ++++------ .../primary/woodcutting/Woodcutting.java | 15 +++--- .../woodcutting/WoodcuttingManager.java | 22 ++++---- .../skills/subskills/AbstractSubSkill.java | 4 +- .../acrobatics/AcrobaticsSubSkill.java | 7 +-- .../skills/subskills/acrobatics/Roll.java | 39 ++++++-------- .../subskills/interfaces/Interaction.java | 3 -- .../skills/subskills/interfaces/SubSkill.java | 3 +- .../skills/treasure/EnchantmentTreasure.java | 1 - .../skills/treasure/ExcavationTreasure.java | 3 +- .../core/skills/treasure/FishingTreasure.java | 3 +- .../core/skills/treasure/HylianTreasure.java | 3 +- .../core/skills/treasure/ShakeTreasure.java | 3 +- .../core/skills/treasure/Treasure.java | 2 +- .../gmail/nossr50/core/util/BlockUtils.java | 10 +--- .../gmail/nossr50/core/util/ChimaeraWing.java | 14 ++--- .../nossr50/core/util/EnchantmentUtils.java | 3 -- .../gmail/nossr50/core/util/EventUtils.java | 51 ++++++++----------- .../nossr50/core/util/HardcoreManager.java | 2 +- .../nossr50/core/util/HolidayManager.java | 14 ++--- .../gmail/nossr50/core/util/LogFilter.java | 1 - .../nossr50/core/util/MaterialUtils.java | 2 - .../com/gmail/nossr50/core/util/Misc.java | 14 ++--- .../nossr50/core/util/MobHealthbarUtils.java | 10 ++-- .../gmail/nossr50/core/util/ModManager.java | 16 +++--- .../com/gmail/nossr50/core/util/Motd.java | 4 +- .../core/util/TextComponentFactory.java | 7 ++- .../core/util/adapter/BiomeAdapter.java | 1 - .../commands/CommandRegistrationManager.java | 16 ------ .../core/util/commands/CommandUtils.java | 6 +-- .../util/experience/ExperienceBarManager.java | 3 +- .../util/experience/ExperienceBarWrapper.java | 12 ++--- .../core/util/experience/FormulaManager.java | 4 +- .../core/util/player/NotificationManager.java | 13 ++--- .../random/InvalidActivationException.java | 5 +- .../core/util/random/InvalidStaticChance.java | 5 +- .../util/random/RandomChanceSkillStatic.java | 2 +- .../core/util/random/RandomChanceUtil.java | 6 +-- .../util/scoreboards/ScoreboardManager.java | 7 +-- .../util/scoreboards/ScoreboardWrapper.java | 13 ++--- .../nossr50/core/util/skills/CombatUtils.java | 27 +++------- .../core/util/skills/ParticleEffectUtils.java | 14 ++--- .../nossr50/core/util/skills/PerksUtils.java | 4 +- .../nossr50/core/util/skills/SkillUtils.java | 15 ++---- .../core/util/sounds/SoundManager.java | 7 +-- .../core/util/upgrade/UpgradeManager.java | 1 - .../nossr50/core/util/uuid/UUIDFetcher.java | 4 +- .../core/worldguard/WorldGuardFlags.java | 1 - .../core/worldguard/WorldGuardManager.java | 12 +---- .../core/worldguard/WorldGuardUtils.java | 5 -- .../shatt/backup/ZipLibrary.java | 1 - 203 files changed, 583 insertions(+), 1017 deletions(-) rename core/src/main/java/com/gmail/nossr50/core/{skills/child => config}/ChildConfig.java (92%) delete mode 100644 core/src/main/java/com/gmail/nossr50/core/skills/SubSkillFlags.java diff --git a/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java b/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java index 256fad2b8..04a5298b9 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java @@ -26,7 +26,7 @@ import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask; import com.gmail.nossr50.core.runnables.player.PowerLevelUpdatingTask; import com.gmail.nossr50.core.runnables.skills.BleedTimerTask; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.child.ChildConfig; +import com.gmail.nossr50.core.config.ChildConfig; import com.gmail.nossr50.core.skills.child.salvage.salvageables.Salvageable; import com.gmail.nossr50.core.skills.child.salvage.salvageables.SalvageableManager; import com.gmail.nossr50.core.skills.child.salvage.salvageables.SimpleSalvageableManager; diff --git a/core/src/main/java/com/gmail/nossr50/core/TODO b/core/src/main/java/com/gmail/nossr50/core/TODO index 449d0c8d1..4030a7354 100644 --- a/core/src/main/java/com/gmail/nossr50/core/TODO +++ b/core/src/main/java/com/gmail/nossr50/core/TODO @@ -15,4 +15,20 @@ This file is just going to take note of all the caveats of mcMMO code as I abstr 7) Weird stuff going on with ageables and strings in general in StringUtils -8) Reduce the amount of string operations in mcMMO as much as possible \ No newline at end of file +8) Reduce the amount of string operations in mcMMO as much as possible + + + +//////////// + +CONFIG NOTES + +/////////// + +1) All Config files need their validation redone and checked + +2) All Config files need unload programmed in + +3) All Config files need string operations reduced and to be double checked for errors in paths + +4) Need to setup removing old keys on configs \ No newline at end of file diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/ChildConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/ChildConfig.java similarity index 92% rename from core/src/main/java/com/gmail/nossr50/core/skills/child/ChildConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/ChildConfig.java index f32e698b9..c434c0a97 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/ChildConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/ChildConfig.java @@ -1,9 +1,8 @@ -package com.gmail.nossr50.core.skills.child; +package com.gmail.nossr50.core.config; -import com.gmail.nossr50.core.config.AutoUpdateConfigLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.util.StringUtils; -import org.bukkit.configuration.file.YamlConfiguration; +import com.gmail.nossr50.core.skills.child.FamilyTree; +import com.gmail.nossr50.core.util.StringUtils; import java.util.EnumSet; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/Config.java b/core/src/main/java/com/gmail/nossr50/core/config/Config.java index d66a36e61..2fcbaa16c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/Config.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/Config.java @@ -247,6 +247,8 @@ public abstract class Config implements VersionedConfig, Unload { if(mergeNewKeys) userRootNode = userRootNode.mergeValuesFrom(defaultRootNode); + removeOldKeys(); + // Update config version updateConfigVersion(); diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java index 4b983ec9d..4ab5dcddd 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java @@ -1,15 +1,11 @@ package com.gmail.nossr50.core.config.mods; import com.gmail.nossr50.core.McmmoCore; -import com.gmail.nossr50.core.config.ConfigLoader; import com.gmail.nossr50.core.config.ConfigKeyRegister; -import com.gmail.nossr50.core.mcmmo.mods.CustomBlock; -import org.bukkit.Material; -import org.bukkit.configuration.ConfigurationSection; +import com.gmail.nossr50.core.datatypes.mods.CustomBlock; import java.util.ArrayList; import java.util.HashMap; -import java.util.List; import java.util.Set; public class CustomBlockConfig extends ConfigKeyRegister { diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java index 24dd9914d..27f2c8f95 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java @@ -1,12 +1,9 @@ package com.gmail.nossr50.core.config.mods; import com.gmail.nossr50.core.McmmoCore; -import com.gmail.nossr50.core.config.ConfigLoader; import com.gmail.nossr50.core.config.Config; -import com.gmail.nossr50.core.mcmmo.mods.CustomEntity; -import org.apache.commons.lang.ClassUtils; -import org.bukkit.Material; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.datatypes.mods.CustomEntity; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import java.util.HashMap; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java index 5897ec3e7..c60489d56 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java @@ -1,20 +1,15 @@ package com.gmail.nossr50.core.config.mods; import com.gmail.nossr50.core.McmmoCore; -import com.gmail.nossr50.core.config.ConfigLoader; import com.gmail.nossr50.core.config.Config; -import com.gmail.nossr50.core.mcmmo.mods.CustomTool; -import com.gmail.nossr50.core.mcmmo.skills.ItemType; -import com.gmail.nossr50.core.mcmmo.skills.MaterialType; -import com.gmail.nossr50.skills.repair.repairables.Repairable; -import com.gmail.nossr50.skills.repair.repairables.RepairableFactory; -import com.gmail.nossr50.util.skills.SkillUtils; -import org.bukkit.Material; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.datatypes.mods.CustomTool; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; +import com.gmail.nossr50.core.skills.MaterialType; +import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; +import com.gmail.nossr50.core.skills.primary.repair.repairables.RepairableFactory; +import com.gmail.nossr50.core.util.skills.SkillUtils; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Set; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/EntityConfigManager.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/EntityConfigManager.java index 05d6e2968..a4217f5e7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/EntityConfigManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/EntityConfigManager.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.config.mods; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.ModManager; + +import com.gmail.nossr50.core.util.ModManager; import java.io.File; import java.util.regex.Pattern; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/ToolConfigManager.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/ToolConfigManager.java index e7cc09e18..c2a14337c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/ToolConfigManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/ToolConfigManager.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.config.mods; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.ModManager; + +import com.gmail.nossr50.core.util.ModManager; import java.io.File; import java.util.regex.Pattern; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java index ada2e96b5..b04ff0f38 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java @@ -5,7 +5,6 @@ import com.gmail.nossr50.core.config.Config; import com.gmail.nossr50.core.mcmmo.colors.ChatColor; import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyPotion; -import org.bukkit.configuration.ConfigurationSection; import java.util.ArrayList; import java.util.HashMap; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfigManager.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfigManager.java index fec3cb859..eb0b0f098 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfigManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfigManager.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.config.skills.repair; +package com.gmail.nossr50.core.config.skills.repair; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.repair.repairables.Repairable; +import com.gmail.nossr50.core.config.skills.repair.RepairConfig; +import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; import java.io.File; import java.util.ArrayList; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java index e9dffc0f7..7a431fbd6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java @@ -1,17 +1,13 @@ -package com.gmail.nossr50.config.skills.salvage; +package com.gmail.nossr50.core.config.skills.salvage; -import com.gmail.nossr50.config.ConfigLoader; import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.config.Config; -import com.gmail.nossr50.core.mcmmo.skills.ItemType; -import com.gmail.nossr50.core.mcmmo.skills.MaterialType; -import com.gmail.nossr50.skills.salvage.salvageables.Salvageable; -import com.gmail.nossr50.skills.salvage.salvageables.SalvageableFactory; -import com.gmail.nossr50.util.ItemUtils; -import com.gmail.nossr50.util.skills.SkillUtils; -import org.bukkit.Material; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; +import com.gmail.nossr50.core.skills.MaterialType; +import com.gmail.nossr50.core.skills.child.salvage.salvageables.Salvageable; +import com.gmail.nossr50.core.skills.child.salvage.salvageables.SalvageableFactory; +import com.gmail.nossr50.core.util.ItemUtils; +import com.gmail.nossr50.core.util.skills.SkillUtils; import java.util.ArrayList; import java.util.List; diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManager.java index 5b6fab200..f013b968f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManager.java @@ -1,7 +1,8 @@ package com.gmail.nossr50.core.data.blockmeta; -import org.bukkit.World; -import org.bukkit.block.Block; + +import com.gmail.nossr50.core.mcmmo.block.Block; +import com.gmail.nossr50.core.mcmmo.world.World; public interface ChunkletManager { /** diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/HashChunkletManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/HashChunkletManager.java index e80edc8d0..e0699219b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/HashChunkletManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/HashChunkletManager.java @@ -1,8 +1,7 @@ package com.gmail.nossr50.core.data.blockmeta; -import com.gmail.nossr50.mcMMO; -import org.bukkit.World; -import org.bukkit.block.Block; +import com.gmail.nossr50.core.mcmmo.block.Block; +import com.gmail.nossr50.core.mcmmo.world.World; import java.io.*; import java.util.HashMap; diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java index 6938eb767..9131798d2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java @@ -1,8 +1,6 @@ package com.gmail.nossr50.core.data.blockmeta.conversion; import com.gmail.nossr50.core.config.ChunkConversionOptions; -import com.gmail.nossr50.mcMMO; -import org.bukkit.scheduler.BukkitScheduler; import java.io.File; diff --git a/core/src/main/java/com/gmail/nossr50/core/data/database/FlatfileDatabaseManager.java b/core/src/main/java/com/gmail/nossr50/core/data/database/FlatfileDatabaseManager.java index 6409f7ad9..264c679df 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/database/FlatfileDatabaseManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/FlatfileDatabaseManager.java @@ -1,20 +1,18 @@ package com.gmail.nossr50.core.data.database; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.core.mcmmo.MobHealthbarType; -import com.gmail.nossr50.core.mcmmo.database.DatabaseType; -import com.gmail.nossr50.core.mcmmo.database.PlayerStat; -import com.gmail.nossr50.core.mcmmo.database.UpgradeType; -import com.gmail.nossr50.core.mcmmo.player.PlayerProfile; -import com.gmail.nossr50.core.mcmmo.player.UniqueDataType; -import com.gmail.nossr50.core.mcmmo.skills.PrimarySkillType; -import com.gmail.nossr50.core.mcmmo.skills.SuperAbilityType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.runnables.database.UUIDUpdateAsyncTask; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.StringUtils; -import org.bukkit.OfflinePlayer; +import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.datatypes.database.DatabaseType; +import com.gmail.nossr50.core.datatypes.database.PlayerStat; +import com.gmail.nossr50.core.datatypes.database.UpgradeType; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.player.UniqueDataType; +import com.gmail.nossr50.core.runnables.database.UUIDUpdateAsyncTask; +import com.gmail.nossr50.core.skills.MobHealthbarType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SuperAbilityType; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.StringUtils; +import sun.security.krb5.Config; import java.io.*; import java.util.*; diff --git a/core/src/main/java/com/gmail/nossr50/core/data/database/SQLDatabaseManager.java b/core/src/main/java/com/gmail/nossr50/core/data/database/SQLDatabaseManager.java index 48a3a73ad..b1d43d55a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/database/SQLDatabaseManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/SQLDatabaseManager.java @@ -1,21 +1,19 @@ package com.gmail.nossr50.core.data.database; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.core.mcmmo.MobHealthbarType; -import com.gmail.nossr50.core.mcmmo.database.DatabaseType; -import com.gmail.nossr50.core.mcmmo.database.PlayerStat; -import com.gmail.nossr50.core.mcmmo.database.UpgradeType; -import com.gmail.nossr50.core.mcmmo.player.PlayerProfile; -import com.gmail.nossr50.core.mcmmo.player.UniqueDataType; -import com.gmail.nossr50.core.mcmmo.skills.PrimarySkillType; -import com.gmail.nossr50.core.mcmmo.skills.SuperAbilityType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.runnables.database.UUIDUpdateAsyncTask; -import com.gmail.nossr50.util.Misc; +import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.datatypes.database.DatabaseType; +import com.gmail.nossr50.core.datatypes.database.PlayerStat; +import com.gmail.nossr50.core.datatypes.database.UpgradeType; +import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.datatypes.player.UniqueDataType; +import com.gmail.nossr50.core.runnables.database.UUIDUpdateAsyncTask; +import com.gmail.nossr50.core.skills.MobHealthbarType; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SuperAbilityType; +import com.gmail.nossr50.core.util.Misc; import org.apache.tomcat.jdbc.pool.DataSource; import org.apache.tomcat.jdbc.pool.PoolProperties; -import org.bukkit.scheduler.BukkitRunnable; +import sun.security.krb5.Config; import java.sql.*; import java.util.*; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java index 4a6c3c267..b6d12729d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.datatypes.chat; -import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.core.locale.LocaleLoader; public enum ChatMode { ADMIN(LocaleLoader.getString("Commands.AdminChat.On"), LocaleLoader.getString("Commands.AdminChat.Off")), diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java index 8bbb7c55d..e9781523c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.core.datatypes.experience; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.skills.PrimarySkillType; import java.util.concurrent.Delayed; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/json/CustomBaseComponent.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/json/CustomBaseComponent.java index 70193bfb1..72115c965 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/json/CustomBaseComponent.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/json/CustomBaseComponent.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.core.datatypes.json; -import net.md_5.bungee.api.chat.BaseComponent; public class CustomBaseComponent extends BaseComponent { @Override diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java index 749fc920c..e59e315c3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.datatypes.json; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.StringUtils; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.StringUtils; public enum McMMOWebLinks { WEBSITE, diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java index df89f3eeb..8c7372f5c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java @@ -1,7 +1,5 @@ package com.gmail.nossr50.core.datatypes.meta; -import com.gmail.nossr50.mcMMO; -import org.bukkit.metadata.FixedMetadataValue; /** * This class is for storing mob names since we switch them to heart values diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomEntity.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomEntity.java index d99c279aa..c01f31396 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomEntity.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/mods/CustomEntity.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.core.datatypes.mods; -import org.bukkit.inventory.ItemStack; + +import com.gmail.nossr50.core.mcmmo.item.ItemStack; public class CustomEntity { private double xpMultiplier; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java index 54f1995c3..a294a2229 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.core.datatypes.party; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.ItemUtils; -import com.gmail.nossr50.util.StringUtils; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; +import com.gmail.nossr50.core.util.ItemUtils; +import com.gmail.nossr50.core.util.StringUtils; public enum ItemShareType { LOOT, diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java index 98c9251a6..07ace3010 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java @@ -1,17 +1,16 @@ package com.gmail.nossr50.core.datatypes.party; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.MainConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.experience.FormulaType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.EventUtils; -import com.gmail.nossr50.util.sounds.SoundManager; -import com.gmail.nossr50.util.sounds.SoundType; -import org.bukkit.ChatColor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.colors.ChatColor; +import com.gmail.nossr50.core.mcmmo.commands.CommandSender; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.party.PartyManager; +import com.gmail.nossr50.core.util.EventUtils; +import com.gmail.nossr50.core.util.sounds.SoundManager; +import com.gmail.nossr50.core.util.sounds.SoundType; import java.text.DecimalFormat; import java.util.ArrayList; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java index a107c8ae7..8d471d7e4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyFeature.java @@ -1,11 +1,10 @@ package com.gmail.nossr50.core.datatypes.party; -import com.gmail.nossr50.commands.party.PartySubcommandType; import com.gmail.nossr50.core.config.MainConfig; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.StringUtils; -import org.bukkit.entity.Player; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.StringUtils; public enum PartyFeature { CHAT, diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java index 74b1014e1..771e1af39 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.core.datatypes.party; import com.gmail.nossr50.core.config.MainConfig; -import com.gmail.nossr50.util.Misc; -import org.bukkit.entity.Player; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.util.Misc; public class PartyTeleportRecord { private Player requestor; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java index bda169d6c..440ea18dc 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.core.datatypes.party; -import com.gmail.nossr50.util.commands.CommandUtils; + +import com.gmail.nossr50.core.util.commands.CommandUtils; public enum ShareMode { NONE, diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java index 6eeda2cb1..a6a7b7415 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java @@ -1,17 +1,16 @@ package com.gmail.nossr50.core.datatypes.player; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.config.MainConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.datatypes.experience.SkillXpGain; +import com.gmail.nossr50.core.runnables.player.PlayerProfileSaveTask; import com.gmail.nossr50.core.skills.MobHealthbarType; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.runnables.player.PlayerProfileSaveTask; -import com.gmail.nossr50.skills.child.FamilyTree; +import com.gmail.nossr50.core.skills.child.FamilyTree; import com.google.common.collect.ImmutableMap; import java.util.HashMap; diff --git a/core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOPartyChatEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOPartyChatEvent.java index 970ce811e..76f001222 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOPartyChatEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/chat/McMMOPartyChatEvent.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.core.events.chat; -import org.bukkit.plugin.Plugin; + +import com.gmail.nossr50.core.mcmmo.plugin.Plugin; /** * Called when a chat is sent to a party channel diff --git a/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerExperienceEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerExperienceEvent.java index 247f8d3c4..9a7b194ac 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerExperienceEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerExperienceEvent.java @@ -2,11 +2,8 @@ package com.gmail.nossr50.core.events.experience; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; -import org.bukkit.entity.Player; -import org.bukkit.event.Cancellable; -import org.bukkit.event.HandlerList; -import org.bukkit.event.player.PlayerEvent; /** * Generic event for mcMMO experience events. diff --git a/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelChangeEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelChangeEvent.java index 3c769a19c..3e79947b2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelChangeEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelChangeEvent.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.core.events.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; -import org.bukkit.entity.Player; /** * Called when a user levels change diff --git a/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelDownEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelDownEvent.java index b153d2c1f..1646c887d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelDownEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelDownEvent.java @@ -1,9 +1,8 @@ package com.gmail.nossr50.core.events.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; -import org.bukkit.entity.Player; -import org.bukkit.event.HandlerList; /** * Called when a user loses levels in a skill diff --git a/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelUpEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelUpEvent.java index 342c5479a..320667152 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelUpEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerLevelUpEvent.java @@ -1,9 +1,8 @@ package com.gmail.nossr50.core.events.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; -import org.bukkit.entity.Player; -import org.bukkit.event.HandlerList; /** * Called when a user levels up in a skill diff --git a/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerXpGainEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerXpGainEvent.java index 3c5febfb2..b80535b6d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerXpGainEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/experience/McMMOPlayerXpGainEvent.java @@ -1,9 +1,8 @@ package com.gmail.nossr50.core.events.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; -import org.bukkit.entity.Player; -import org.bukkit.event.HandlerList; /** * Called when a player gains XP in a skill diff --git a/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBlockBreakEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBlockBreakEvent.java index 11892986c..c09ec60e7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBlockBreakEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBlockBreakEvent.java @@ -1,8 +1,6 @@ package com.gmail.nossr50.core.events.fake; -import org.bukkit.block.Block; -import org.bukkit.entity.Player; -import org.bukkit.event.block.BlockBreakEvent; +import com.gmail.nossr50.core.mcmmo.entity.Player; /** * Called when mcMMO breaks a block due to a special ability. diff --git a/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBlockDamageEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBlockDamageEvent.java index 06442f1c8..76f3e1294 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBlockDamageEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBlockDamageEvent.java @@ -1,9 +1,7 @@ package com.gmail.nossr50.core.events.fake; -import org.bukkit.block.Block; -import org.bukkit.entity.Player; -import org.bukkit.event.block.BlockDamageEvent; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; /** * Called when mcMMO damages a block due to a special ability. diff --git a/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBrewEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBrewEvent.java index f50ef5574..3f160a8e8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBrewEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeBrewEvent.java @@ -1,8 +1,5 @@ package com.gmail.nossr50.core.events.fake; -import org.bukkit.block.Block; -import org.bukkit.event.inventory.BrewEvent; -import org.bukkit.inventory.BrewerInventory; public class FakeBrewEvent extends BrewEvent { public FakeBrewEvent(Block brewer, BrewerInventory contents, int fuelLevel) { diff --git a/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityDamageByEntityEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityDamageByEntityEvent.java index 5776eee32..aa47b5e40 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityDamageByEntityEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityDamageByEntityEvent.java @@ -2,11 +2,6 @@ package com.gmail.nossr50.core.events.fake; import com.google.common.base.Function; import com.google.common.base.Functions; -import org.bukkit.entity.Entity; -import org.bukkit.event.entity.EntityDamageByEntityEvent; - -import java.util.EnumMap; -import java.util.Map; /** * Called when mcMMO applies damage from an entity due to special abilities. diff --git a/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityDamageEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityDamageEvent.java index ff0b2fd58..c7f2737b9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityDamageEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityDamageEvent.java @@ -2,11 +2,7 @@ package com.gmail.nossr50.core.events.fake; import com.google.common.base.Function; import com.google.common.base.Functions; -import org.bukkit.entity.Entity; -import org.bukkit.event.entity.EntityDamageEvent; -import java.util.EnumMap; -import java.util.Map; /** * Called when mcMMO applies damage due to special abilities. diff --git a/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityTameEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityTameEvent.java index 078a866fc..2a74dbbec 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityTameEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakeEntityTameEvent.java @@ -1,8 +1,5 @@ package com.gmail.nossr50.core.events.fake; -import org.bukkit.entity.AnimalTamer; -import org.bukkit.entity.LivingEntity; -import org.bukkit.event.entity.EntityTameEvent; /** * Called when mcMMO tames an animal via Call of the Wild diff --git a/core/src/main/java/com/gmail/nossr50/core/events/fake/FakePlayerAnimationEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakePlayerAnimationEvent.java index 61263c64f..0aac2f2b4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/fake/FakePlayerAnimationEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakePlayerAnimationEvent.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.events.fake; -import org.bukkit.entity.Player; -import org.bukkit.event.player.PlayerAnimationEvent; + +import com.gmail.nossr50.core.mcmmo.entity.Player; /** * Called when handling extra drops to avoid issues with NoCheat. diff --git a/core/src/main/java/com/gmail/nossr50/core/events/fake/FakePlayerFishEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakePlayerFishEvent.java index 746c03abc..4e7e57a5d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/fake/FakePlayerFishEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/fake/FakePlayerFishEvent.java @@ -1,9 +1,7 @@ package com.gmail.nossr50.core.events.fake; -import org.bukkit.entity.Entity; -import org.bukkit.entity.FishHook; -import org.bukkit.entity.Player; -import org.bukkit.event.player.PlayerFishEvent; + +import com.gmail.nossr50.core.mcmmo.entity.Player; public class FakePlayerFishEvent extends PlayerFishEvent { public FakePlayerFishEvent(Player player, Entity entity, FishHook hookEntity, State state) { diff --git a/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerDeathPenaltyEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerDeathPenaltyEvent.java index 212b21b63..9c1df24e3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerDeathPenaltyEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerDeathPenaltyEvent.java @@ -1,9 +1,6 @@ package com.gmail.nossr50.core.events.hardcore; -import org.bukkit.entity.Player; -import org.bukkit.event.Cancellable; -import org.bukkit.event.HandlerList; -import org.bukkit.event.player.PlayerEvent; +import com.gmail.nossr50.core.mcmmo.entity.Player; import java.util.HashMap; diff --git a/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerPreDeathPenaltyEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerPreDeathPenaltyEvent.java index 6093ecf3f..1beaf9957 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerPreDeathPenaltyEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerPreDeathPenaltyEvent.java @@ -1,9 +1,6 @@ package com.gmail.nossr50.core.events.hardcore; -import org.bukkit.entity.Player; -import org.bukkit.event.Cancellable; -import org.bukkit.event.HandlerList; -import org.bukkit.event.player.PlayerEvent; +import com.gmail.nossr50.core.mcmmo.entity.Player; public class McMMOPlayerPreDeathPenaltyEvent extends PlayerEvent implements Cancellable { /** diff --git a/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerStatLossEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerStatLossEvent.java index 158390b13..5cc685d23 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerStatLossEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerStatLossEvent.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.core.events.hardcore; -import org.bukkit.entity.Player; + +import com.gmail.nossr50.core.mcmmo.entity.Player; import java.util.HashMap; diff --git a/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerVampirismEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerVampirismEvent.java index f7162b8fb..3ba1e70cc 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerVampirismEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/hardcore/McMMOPlayerVampirismEvent.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.core.events.hardcore; -import org.bukkit.entity.Player; + +import com.gmail.nossr50.core.mcmmo.entity.Player; import java.util.HashMap; diff --git a/core/src/main/java/com/gmail/nossr50/core/events/items/McMMOItemSpawnEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/items/McMMOItemSpawnEvent.java index d4790bb89..3ef20445b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/items/McMMOItemSpawnEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/items/McMMOItemSpawnEvent.java @@ -1,10 +1,6 @@ package com.gmail.nossr50.core.events.items; -import org.bukkit.Location; -import org.bukkit.event.Cancellable; -import org.bukkit.event.Event; -import org.bukkit.event.HandlerList; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; /** * Called when mcMMO is preparing to drop an item. diff --git a/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyAllianceChangeEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyAllianceChangeEvent.java index 6d3f7a419..0ba2e08b0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyAllianceChangeEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyAllianceChangeEvent.java @@ -1,9 +1,6 @@ package com.gmail.nossr50.core.events.party; -import org.bukkit.entity.Player; -import org.bukkit.event.Cancellable; -import org.bukkit.event.HandlerList; -import org.bukkit.event.player.PlayerEvent; +import com.gmail.nossr50.core.mcmmo.entity.Player; public class McMMOPartyAllianceChangeEvent extends PlayerEvent implements Cancellable { /** diff --git a/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyChangeEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyChangeEvent.java index 24b200218..9e7d15bad 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyChangeEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyChangeEvent.java @@ -1,9 +1,6 @@ package com.gmail.nossr50.core.events.party; -import org.bukkit.entity.Player; -import org.bukkit.event.Cancellable; -import org.bukkit.event.HandlerList; -import org.bukkit.event.player.PlayerEvent; +import com.gmail.nossr50.core.mcmmo.entity.Player; /** * Called when a player attempts to join, leave, or change parties. diff --git a/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyLevelUpEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyLevelUpEvent.java index 4e70108fa..36df6fb88 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyLevelUpEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyLevelUpEvent.java @@ -1,9 +1,6 @@ package com.gmail.nossr50.core.events.party; import com.gmail.nossr50.core.datatypes.party.Party; -import org.bukkit.event.Cancellable; -import org.bukkit.event.Event; -import org.bukkit.event.HandlerList; public class McMMOPartyLevelUpEvent extends Event implements Cancellable { /** diff --git a/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyTeleportEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyTeleportEvent.java index 9be1111ad..2ea7f9c26 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyTeleportEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyTeleportEvent.java @@ -1,8 +1,6 @@ package com.gmail.nossr50.core.events.party; -import org.bukkit.entity.Player; -import org.bukkit.event.HandlerList; -import org.bukkit.event.player.PlayerTeleportEvent; +import com.gmail.nossr50.core.mcmmo.entity.Player; /** * Called just before a player teleports using the /ptp command. diff --git a/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyXpGainEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyXpGainEvent.java index 234721ffe..3e567ccbe 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyXpGainEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/party/McMMOPartyXpGainEvent.java @@ -1,9 +1,6 @@ package com.gmail.nossr50.core.events.party; import com.gmail.nossr50.core.datatypes.party.Party; -import org.bukkit.event.Cancellable; -import org.bukkit.event.Event; -import org.bukkit.event.HandlerList; public class McMMOPartyXpGainEvent extends Event implements Cancellable { /** diff --git a/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardEvent.java index 2246c8b2e..513ce2f21 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardEvent.java @@ -1,9 +1,6 @@ package com.gmail.nossr50.core.events.scoreboard; -import org.bukkit.entity.Player; -import org.bukkit.event.Event; -import org.bukkit.event.HandlerList; -import org.bukkit.scoreboard.Scoreboard; +import com.gmail.nossr50.core.mcmmo.entity.Player; /** * The parent class of all mcMMO scoreboard events diff --git a/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardMakeboardEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardMakeboardEvent.java index 4d8ffec8d..160555e1a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardMakeboardEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardMakeboardEvent.java @@ -1,7 +1,6 @@ package com.gmail.nossr50.core.events.scoreboard; -import org.bukkit.entity.Player; -import org.bukkit.scoreboard.Scoreboard; +import com.gmail.nossr50.core.mcmmo.entity.Player; /** * This event is called when mcMMO creates its custom boards diff --git a/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardObjectiveEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardObjectiveEvent.java index fe471604a..5d7cbfc71 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardObjectiveEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardObjectiveEvent.java @@ -1,9 +1,6 @@ package com.gmail.nossr50.core.events.scoreboard; -import org.bukkit.entity.Player; -import org.bukkit.event.Cancellable; -import org.bukkit.scoreboard.Objective; -import org.bukkit.scoreboard.Scoreboard; +import com.gmail.nossr50.core.mcmmo.entity.Player; public class McMMOScoreboardObjectiveEvent extends McMMOScoreboardEvent implements Cancellable { protected final ScoreboardObjectiveEventReason objectiveEventReason; diff --git a/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardRevertEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardRevertEvent.java index dbe261e91..cdcfd9299 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardRevertEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/scoreboard/McMMOScoreboardRevertEvent.java @@ -1,7 +1,6 @@ package com.gmail.nossr50.core.events.scoreboard; -import org.bukkit.entity.Player; -import org.bukkit.scoreboard.Scoreboard; +import com.gmail.nossr50.core.mcmmo.entity.Player; /** * This event is called when mcMMO is attempting to change a players targetBoard back to their previous board diff --git a/core/src/main/java/com/gmail/nossr50/core/events/skills/McMMOPlayerNotificationEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/McMMOPlayerNotificationEvent.java index 02564d84a..075a1276c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/skills/McMMOPlayerNotificationEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/McMMOPlayerNotificationEvent.java @@ -1,12 +1,9 @@ package com.gmail.nossr50.core.events.skills; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; -import net.md_5.bungee.api.ChatMessageType; -import net.md_5.bungee.api.chat.TextComponent; -import org.bukkit.entity.Player; -import org.bukkit.event.Cancellable; -import org.bukkit.event.HandlerList; -import org.bukkit.event.player.PlayerEvent; +import com.gmail.nossr50.core.mcmmo.entity.Player; + +import java.awt.*; /** * This event is sent for when mcMMO informs a player about various important information diff --git a/core/src/main/java/com/gmail/nossr50/core/events/skills/McMMOPlayerSkillEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/McMMOPlayerSkillEvent.java index 4ddc9ffb1..a679d4c64 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/skills/McMMOPlayerSkillEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/McMMOPlayerSkillEvent.java @@ -1,10 +1,8 @@ package com.gmail.nossr50.core.events.skills; import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; -import org.bukkit.entity.Player; -import org.bukkit.event.HandlerList; -import org.bukkit.event.player.PlayerEvent; /** * Generic event for mcMMO skill handling. diff --git a/core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityActivateEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityActivateEvent.java index 241b669ee..45e5e85e3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityActivateEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityActivateEvent.java @@ -1,8 +1,7 @@ package com.gmail.nossr50.core.events.skills.abilities; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; -import org.bukkit.entity.Player; -import org.bukkit.event.Cancellable; public class McMMOPlayerAbilityActivateEvent extends McMMOPlayerAbilityEvent implements Cancellable { private boolean cancelled; diff --git a/core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityDeactivateEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityDeactivateEvent.java index e1c6a2d64..befdd55bf 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityDeactivateEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityDeactivateEvent.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.events.skills.abilities; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; -import org.bukkit.entity.Player; public class McMMOPlayerAbilityDeactivateEvent extends McMMOPlayerAbilityEvent { public McMMOPlayerAbilityDeactivateEvent(Player player, PrimarySkillType skill) { diff --git a/core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityEvent.java index 1ff35b90a..f772757fe 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/abilities/McMMOPlayerAbilityEvent.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.core.events.skills.abilities; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent; -import org.bukkit.entity.Player; public class McMMOPlayerAbilityEvent extends McMMOPlayerSkillEvent { private SuperAbilityType ability; diff --git a/core/src/main/java/com/gmail/nossr50/core/events/skills/alchemy/McMMOPlayerBrewEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/alchemy/McMMOPlayerBrewEvent.java index 1a1ec0d19..b6dfdac66 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/skills/alchemy/McMMOPlayerBrewEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/alchemy/McMMOPlayerBrewEvent.java @@ -1,12 +1,9 @@ package com.gmail.nossr50.core.events.skills.alchemy; +import com.gmail.nossr50.core.mcmmo.block.BlockState; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent; -import org.bukkit.block.Block; -import org.bukkit.block.BlockState; -import org.bukkit.block.BrewingStand; -import org.bukkit.entity.Player; -import org.bukkit.event.Cancellable; public class McMMOPlayerBrewEvent extends McMMOPlayerSkillEvent implements Cancellable { private BlockState brewingStand; diff --git a/core/src/main/java/com/gmail/nossr50/core/events/skills/alchemy/McMMOPlayerCatalysisEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/alchemy/McMMOPlayerCatalysisEvent.java index 499b9fc7f..cc11d7af1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/skills/alchemy/McMMOPlayerCatalysisEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/alchemy/McMMOPlayerCatalysisEvent.java @@ -1,9 +1,8 @@ package com.gmail.nossr50.core.events.skills.alchemy; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent; -import org.bukkit.entity.Player; -import org.bukkit.event.Cancellable; public class McMMOPlayerCatalysisEvent extends McMMOPlayerSkillEvent implements Cancellable { private double speed; diff --git a/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerFishingEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerFishingEvent.java index 981573842..b1456c086 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerFishingEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerFishingEvent.java @@ -1,9 +1,8 @@ package com.gmail.nossr50.core.events.skills.fishing; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent; -import org.bukkit.entity.Player; -import org.bukkit.event.Cancellable; public class McMMOPlayerFishingEvent extends McMMOPlayerSkillEvent implements Cancellable { private boolean cancelled; diff --git a/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerFishingTreasureEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerFishingTreasureEvent.java index a5c0d5dd3..890e70bc2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerFishingTreasureEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerFishingTreasureEvent.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.events.skills.fishing; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; public class McMMOPlayerFishingTreasureEvent extends McMMOPlayerFishingEvent { private ItemStack treasure; diff --git a/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerMagicHunterEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerMagicHunterEvent.java index 017fc0d41..aacc831f9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerMagicHunterEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerMagicHunterEvent.java @@ -1,10 +1,8 @@ package com.gmail.nossr50.core.events.skills.fishing; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; -import java.util.Map; public class McMMOPlayerMagicHunterEvent extends McMMOPlayerFishingTreasureEvent { private Map enchants; diff --git a/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerShakeEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerShakeEvent.java index 74ba47e16..5e5cb2d01 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerShakeEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/fishing/McMMOPlayerShakeEvent.java @@ -1,7 +1,8 @@ package com.gmail.nossr50.core.events.skills.fishing; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; + +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; public class McMMOPlayerShakeEvent extends McMMOPlayerFishingEvent { private ItemStack drop; diff --git a/core/src/main/java/com/gmail/nossr50/core/events/skills/repair/McMMOPlayerRepairCheckEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/repair/McMMOPlayerRepairCheckEvent.java index 651a1b18b..48fb7047b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/skills/repair/McMMOPlayerRepairCheckEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/repair/McMMOPlayerRepairCheckEvent.java @@ -1,10 +1,9 @@ package com.gmail.nossr50.core.events.skills.repair; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent; -import org.bukkit.entity.Player; -import org.bukkit.event.Cancellable; -import org.bukkit.inventory.ItemStack; /** * Called just before a player repairs an object with mcMMO. diff --git a/core/src/main/java/com/gmail/nossr50/core/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java index c988212ad..3cdfff660 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java @@ -1,10 +1,9 @@ package com.gmail.nossr50.core.events.skills.salvage; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent; -import org.bukkit.entity.Player; -import org.bukkit.event.Cancellable; -import org.bukkit.inventory.ItemStack; /** * Called just before a player salvages an item with mcMMO. diff --git a/core/src/main/java/com/gmail/nossr50/core/events/skills/secondaryabilities/SubSkillEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/secondaryabilities/SubSkillEvent.java index 507b9cefd..40a978771 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/skills/secondaryabilities/SubSkillEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/secondaryabilities/SubSkillEvent.java @@ -1,11 +1,10 @@ package com.gmail.nossr50.core.events.skills.secondaryabilities; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent; -import org.bukkit.entity.Player; -import org.bukkit.event.Cancellable; public class SubSkillEvent extends McMMOPlayerSkillEvent implements Cancellable { private SubSkillType subSkillType; diff --git a/core/src/main/java/com/gmail/nossr50/core/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java index 6e463eafc..4276eec3e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.core.events.skills.secondaryabilities; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; -import org.bukkit.entity.Player; public class SubSkillRandomCheckEvent extends SubSkillEvent { private double chance; diff --git a/core/src/main/java/com/gmail/nossr50/core/events/skills/unarmed/McMMOPlayerDisarmEvent.java b/core/src/main/java/com/gmail/nossr50/core/events/skills/unarmed/McMMOPlayerDisarmEvent.java index 0c492684d..27a620947 100644 --- a/core/src/main/java/com/gmail/nossr50/core/events/skills/unarmed/McMMOPlayerDisarmEvent.java +++ b/core/src/main/java/com/gmail/nossr50/core/events/skills/unarmed/McMMOPlayerDisarmEvent.java @@ -1,9 +1,8 @@ package com.gmail.nossr50.core.events.skills.unarmed; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent; -import org.bukkit.entity.Player; -import org.bukkit.event.Cancellable; public class McMMOPlayerDisarmEvent extends McMMOPlayerSkillEvent implements Cancellable { private boolean cancelled; diff --git a/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java b/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java index 63582f4f2..20bc6a83e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java +++ b/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java @@ -1,8 +1,7 @@ package com.gmail.nossr50.core.locale; import com.gmail.nossr50.core.config.MainConfig; -import com.gmail.nossr50.mcMMO; -import org.bukkit.ChatColor; +import com.gmail.nossr50.core.mcmmo.colors.ChatColor; import java.text.MessageFormat; import java.util.Locale; diff --git a/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java b/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java index 4ed88df41..3b8cc6f29 100644 --- a/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java @@ -11,18 +11,15 @@ import com.gmail.nossr50.core.datatypes.party.PartyLeader; import com.gmail.nossr50.core.datatypes.party.ShareMode; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.events.party.McMMOPartyAllianceChangeEvent; +import com.gmail.nossr50.core.events.party.McMMOPartyChangeEvent; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.player.NotificationManager; import com.gmail.nossr50.core.util.sounds.SoundManager; import com.gmail.nossr50.core.util.sounds.SoundType; -import com.gmail.nossr50.events.party.McMMOPartyAllianceChangeEvent; -import com.gmail.nossr50.events.party.McMMOPartyChangeEvent; -import com.gmail.nossr50.mcMMO; -import org.bukkit.OfflinePlayer; -import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.entity.Player; import java.io.File; import java.util.ArrayList; diff --git a/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java b/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java index 0f786512d..df02837c9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java +++ b/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.party; -import com.gmail.nossr50.config.party.ItemWeightConfig; import com.gmail.nossr50.core.config.MainConfig; +import com.gmail.nossr50.core.config.party.ItemWeightConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; @@ -9,11 +9,10 @@ import com.gmail.nossr50.core.datatypes.party.ItemShareType; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.ShareMode; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Misc; -import org.bukkit.entity.Item; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; import java.util.List; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/CheckDateTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/CheckDateTask.java index 2a796ed7d..91f57a653 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/CheckDateTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/CheckDateTask.java @@ -1,9 +1,7 @@ package com.gmail.nossr50.core.runnables; import com.gmail.nossr50.core.runnables.skills.AprilTask; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Misc; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.util.Misc; public class CheckDateTask extends BukkitRunnable { diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/MobHealthDisplayUpdaterTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/MobHealthDisplayUpdaterTask.java index 4ea6db325..bc2cae4ac 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/MobHealthDisplayUpdaterTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/MobHealthDisplayUpdaterTask.java @@ -1,8 +1,5 @@ package com.gmail.nossr50.core.runnables; -import com.gmail.nossr50.mcMMO; -import org.bukkit.entity.LivingEntity; -import org.bukkit.scheduler.BukkitRunnable; public class MobHealthDisplayUpdaterTask extends BukkitRunnable { private LivingEntity target; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/PistonTrackerTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/PistonTrackerTask.java index b137ebd96..7b5db70cd 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/PistonTrackerTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/PistonTrackerTask.java @@ -1,12 +1,6 @@ package com.gmail.nossr50.core.runnables; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.BlockUtils; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.List; +import com.gmail.nossr50.core.util.BlockUtils; public class PistonTrackerTask extends BukkitRunnable { private List blocks; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/SaveTimerTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/SaveTimerTask.java index 8620f2520..ee58d4637 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/SaveTimerTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/SaveTimerTask.java @@ -2,10 +2,8 @@ package com.gmail.nossr50.core.runnables; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.runnables.player.PlayerProfileSaveTask; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.party.PartyManager; -import org.bukkit.scheduler.BukkitRunnable; public class SaveTimerTask extends BukkitRunnable { @Override diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/StickyPistonTrackerTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/StickyPistonTrackerTask.java index d3f8d5e48..a8f2b8aa7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/StickyPistonTrackerTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/StickyPistonTrackerTask.java @@ -1,10 +1,6 @@ package com.gmail.nossr50.core.runnables; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.BlockUtils; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.util.BlockUtils; public class StickyPistonTrackerTask extends BukkitRunnable { private BlockFace direction; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java index e53ba3571..b1c055035 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java @@ -1,8 +1,6 @@ package com.gmail.nossr50.core.runnables.backups; import com.gmail.nossr50.core.config.MainConfig; -import com.gmail.nossr50.mcMMO; -import org.bukkit.scheduler.BukkitRunnable; import java.io.File; import java.text.ParseException; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McScoreboardKeepTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McScoreboardKeepTask.java index 7f42b6505..f2372dfb1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McScoreboardKeepTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McScoreboardKeepTask.java @@ -1,8 +1,7 @@ package com.gmail.nossr50.core.runnables.commands; -import com.gmail.nossr50.util.scoreboards.ScoreboardManager; -import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; public class McScoreboardKeepTask extends BukkitRunnable { private Player player; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandAsyncTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandAsyncTask.java index 50e3c074f..2d783ec0b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandAsyncTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandAsyncTask.java @@ -1,11 +1,8 @@ package com.gmail.nossr50.core.runnables.commands; +import com.gmail.nossr50.core.mcmmo.commands.CommandSender; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.mcMMO; -import org.apache.commons.lang.Validate; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; import java.util.Map; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java index 2dae89bdc..c14dc56d4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java @@ -2,12 +2,10 @@ package com.gmail.nossr50.core.runnables.commands; import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.commands.CommandSender; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.scoreboards.ScoreboardManager; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; import java.util.Map; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandAsyncTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandAsyncTask.java index 214bb4e04..36d67429d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandAsyncTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandAsyncTask.java @@ -1,12 +1,9 @@ package com.gmail.nossr50.core.runnables.commands; import com.gmail.nossr50.core.datatypes.database.PlayerStat; +import com.gmail.nossr50.core.mcmmo.commands.CommandSender; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.mcMMO; -import org.apache.commons.lang.Validate; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; import java.util.List; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java index cd335ddb0..4d464035d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java @@ -3,13 +3,11 @@ package com.gmail.nossr50.core.runnables.commands; import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.database.PlayerStat; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.colors.ChatColor; +import com.gmail.nossr50.core.mcmmo.commands.CommandSender; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.scoreboards.ScoreboardManager; -import org.bukkit.ChatColor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; import java.util.List; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/database/DatabaseConversionTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/database/DatabaseConversionTask.java index 2b0a30f71..18f63f879 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/database/DatabaseConversionTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/database/DatabaseConversionTask.java @@ -2,9 +2,7 @@ package com.gmail.nossr50.core.runnables.database; import com.gmail.nossr50.core.data.database.DatabaseManager; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; -import org.bukkit.command.CommandSender; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.mcmmo.commands.CommandSender; public class DatabaseConversionTask extends BukkitRunnable { private final DatabaseManager sourceDatabase; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/items/ChimaeraWingWarmup.java b/core/src/main/java/com/gmail/nossr50/core/runnables/items/ChimaeraWingWarmup.java index b7f3695d5..838b40680 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/items/ChimaeraWingWarmup.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/items/ChimaeraWingWarmup.java @@ -3,14 +3,13 @@ package com.gmail.nossr50.core.runnables.items; import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.util.ChimaeraWing; -import com.gmail.nossr50.util.ItemUtils; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.skills.SkillUtils; -import org.bukkit.Location; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; +import com.gmail.nossr50.core.mcmmo.world.Location; +import com.gmail.nossr50.core.util.ChimaeraWing; +import com.gmail.nossr50.core.util.ItemUtils; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.skills.SkillUtils; public class ChimaeraWingWarmup extends BukkitRunnable { private McMMOPlayer mcMMOPlayer; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/items/TeleportationWarmup.java b/core/src/main/java/com/gmail/nossr50/core/runnables/items/TeleportationWarmup.java index 5092d6aaa..8f6aef7b3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/items/TeleportationWarmup.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/items/TeleportationWarmup.java @@ -3,13 +3,12 @@ package com.gmail.nossr50.core.runnables.items; import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.EventUtils; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.skills.SkillUtils; -import org.bukkit.Location; -import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.world.Location; +import com.gmail.nossr50.core.party.PartyManager; +import com.gmail.nossr50.core.util.EventUtils; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.skills.SkillUtils; public class TeleportationWarmup extends BukkitRunnable { private McMMOPlayer mcMMOPlayer; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyAutoKickTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyAutoKickTask.java index bbb041acc..688ec4d4b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyAutoKickTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyAutoKickTask.java @@ -2,15 +2,10 @@ package com.gmail.nossr50.core.runnables.party; import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.party.Party; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.party.PartyManager; -import org.bukkit.OfflinePlayer; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.party.PartyManager; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map.Entry; import java.util.UUID; public class PartyAutoKickTask extends BukkitRunnable { diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyChatTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyChatTask.java index 95665042a..6e4e5fc4d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyChatTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/party/PartyChatTask.java @@ -3,10 +3,8 @@ package com.gmail.nossr50.core.runnables.party; import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.locale.LocaleLoader; -import org.bukkit.ChatColor; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.mcmmo.colors.ChatColor; +import com.gmail.nossr50.core.mcmmo.entity.Player; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/player/ClearRegisteredXPGainTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/player/ClearRegisteredXPGainTask.java index 4e775e865..d939b2e07 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/player/ClearRegisteredXPGainTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/player/ClearRegisteredXPGainTask.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.core.runnables.player; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import org.bukkit.scheduler.BukkitRunnable; public class ClearRegisteredXPGainTask extends BukkitRunnable { @Override diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java index 0734d2ba1..c0586808a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java @@ -5,13 +5,10 @@ import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.runnables.commands.McScoreboardKeepTask; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.scoreboards.ScoreboardManager; -import org.bukkit.Server; -import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; public class PlayerProfileLoadingTask extends BukkitRunnable { private static final int MAX_TRIES = 5; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileSaveTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileSaveTask.java index 65f01837e..76ec711ca 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileSaveTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileSaveTask.java @@ -1,7 +1,6 @@ package com.gmail.nossr50.core.runnables.player; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import org.bukkit.scheduler.BukkitRunnable; public class PlayerProfileSaveTask extends BukkitRunnable { private PlayerProfile playerProfile; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerUpdateInventoryTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerUpdateInventoryTask.java index 85835d946..e735a2be7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerUpdateInventoryTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerUpdateInventoryTask.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.runnables.player; -import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; + +import com.gmail.nossr50.core.mcmmo.entity.Player; @SuppressWarnings("deprecation") public class PlayerUpdateInventoryTask extends BukkitRunnable { diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/player/PowerLevelUpdatingTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PowerLevelUpdatingTask.java index dfe98f8cd..2cb6eb5e5 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/player/PowerLevelUpdatingTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PowerLevelUpdatingTask.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.runnables.player; -import com.gmail.nossr50.util.scoreboards.ScoreboardManager; -import org.bukkit.scheduler.BukkitRunnable; + +import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; public class PowerLevelUpdatingTask extends BukkitRunnable { @Override diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityCooldownTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityCooldownTask.java index 773bd3c8e..caec39c4c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityCooldownTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityCooldownTask.java @@ -3,8 +3,7 @@ package com.gmail.nossr50.core.runnables.skills; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.util.player.NotificationManager; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.util.player.NotificationManager; public class AbilityCooldownTask extends BukkitRunnable { private McMMOPlayer mcMMOPlayer; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityDisableTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityDisableTask.java index 5537c4e47..e7c91840a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityDisableTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AbilityDisableTask.java @@ -3,18 +3,15 @@ package com.gmail.nossr50.core.runnables.skills; import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.world.World; import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.EventUtils; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.skills.ParticleEffectUtils; -import com.gmail.nossr50.util.skills.PerksUtils; -import com.gmail.nossr50.util.skills.SkillUtils; -import org.bukkit.Chunk; -import org.bukkit.World; -import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.util.EventUtils; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.player.NotificationManager; +import com.gmail.nossr50.core.util.skills.ParticleEffectUtils; +import com.gmail.nossr50.core.util.skills.PerksUtils; +import com.gmail.nossr50.core.util.skills.SkillUtils; public class AbilityDisableTask extends BukkitRunnable { private McMMOPlayer mcMMOPlayer; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewCheckTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewCheckTask.java index 34fe29488..751d27221 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewCheckTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewCheckTask.java @@ -1,12 +1,9 @@ package com.gmail.nossr50.core.runnables.skills; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy; import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyPotionBrewer; -import org.bukkit.Location; -import org.bukkit.block.BrewingStand; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.scheduler.BukkitRunnable; import java.util.Arrays; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewTask.java index a378f4b7d..42b7aac7d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewTask.java @@ -1,21 +1,16 @@ package com.gmail.nossr50.core.runnables.skills; import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.events.skills.alchemy.McMMOPlayerBrewEvent; +import com.gmail.nossr50.core.events.skills.alchemy.McMMOPlayerCatalysisEvent; +import com.gmail.nossr50.core.mcmmo.block.BlockState; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy; import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyPotionBrewer; -import com.gmail.nossr50.events.skills.alchemy.McMMOPlayerBrewEvent; -import com.gmail.nossr50.events.skills.alchemy.McMMOPlayerCatalysisEvent; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.BlockState; -import org.bukkit.block.BrewingStand; -import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.Permissions; public class AlchemyBrewTask extends BukkitRunnable { private static double DEFAULT_BREW_SPEED = 1.0; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AprilTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AprilTask.java index 65149ba3a..3f9fcdd78 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AprilTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AprilTask.java @@ -1,14 +1,11 @@ package com.gmail.nossr50.core.runnables.skills; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.HolidayManager; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.sounds.SoundManager; -import com.gmail.nossr50.util.sounds.SoundType; -import org.bukkit.ChatColor; -import org.bukkit.Statistic; -import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.mcmmo.colors.ChatColor; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.util.HolidayManager; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.sounds.SoundManager; +import com.gmail.nossr50.core.util.sounds.SoundType; public class AprilTask extends BukkitRunnable { diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AwardCombatXpTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AwardCombatXpTask.java index 006d6c7b5..c57be36e7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AwardCombatXpTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AwardCombatXpTask.java @@ -4,8 +4,6 @@ import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; -import org.bukkit.entity.LivingEntity; -import org.bukkit.scheduler.BukkitRunnable; public class AwardCombatXpTask extends BukkitRunnable { private McMMOPlayer mcMMOPlayer; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ExperienceBarHideTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ExperienceBarHideTask.java index d6ca141e2..a1b58dcfa 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ExperienceBarHideTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ExperienceBarHideTask.java @@ -2,8 +2,7 @@ package com.gmail.nossr50.core.runnables.skills; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.util.experience.ExperienceBarManager; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.util.experience.ExperienceBarManager; public class ExperienceBarHideTask extends BukkitRunnable { public final McMMOPlayer mcMMOPlayer; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/HerbalismBlockUpdaterTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/HerbalismBlockUpdaterTask.java index 1430e3f6e..ec5a5b661 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/HerbalismBlockUpdaterTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/HerbalismBlockUpdaterTask.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.runnables.skills; -import org.bukkit.block.BlockState; -import org.bukkit.scheduler.BukkitRunnable; + +import com.gmail.nossr50.core.mcmmo.block.BlockState; public class HerbalismBlockUpdaterTask extends BukkitRunnable { private BlockState blockState; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/SkillUnlockNotificationTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/SkillUnlockNotificationTask.java index e597ce833..393454321 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/SkillUnlockNotificationTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/SkillUnlockNotificationTask.java @@ -2,8 +2,7 @@ package com.gmail.nossr50.core.runnables.skills; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.util.player.NotificationManager; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.util.player.NotificationManager; public class SkillUnlockNotificationTask extends BukkitRunnable { diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ToolLowerTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ToolLowerTask.java index be96b1506..12e6197a4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ToolLowerTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ToolLowerTask.java @@ -4,8 +4,7 @@ import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.ToolType; -import com.gmail.nossr50.util.player.NotificationManager; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.util.player.NotificationManager; public class ToolLowerTask extends BukkitRunnable { private McMMOPlayer mcMMOPlayer; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/MaterialType.java b/core/src/main/java/com/gmail/nossr50/core/skills/MaterialType.java index 920017345..25956f535 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/MaterialType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/MaterialType.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.core.skills; -import org.bukkit.Material; public enum MaterialType { STRING, diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillFlags.java b/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillFlags.java deleted file mode 100644 index 453d288e7..000000000 --- a/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillFlags.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.gmail.nossr50.core.skills; - -public class SubSkillFlags { - /* - * Bitwise Flags - * These are so I can flag properties for subskills - * Flags are in the power of 2 because binary is a base-2 system - */ - public static final int ACTIVE = 1; //Active subskills are ones that aren't passive - public static final int SUPERABILITY = 2; // Super abilities are redundantly active - public static final int RNG = 4; //If the subskill makes use of RNG - public static final int PVP = 8; //If the subskill has properties that change in PVP conditions - public static final int TIMED = 16; //If the subskill has a duration or time component - public static final int TARGET_COLLECTION = 32; //If the subskill has multiple target types - public static final int REWARD_COLLECTION = 64; //If the subskill has multiple reward types - public static final int CHARGES = 128; - public static final int LIMITED = 256; - //public static final int RANDOM_ACTIVATION = 128; //If the subskill has random activation -} diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/ToolType.java b/core/src/main/java/com/gmail/nossr50/core/skills/ToolType.java index 4b513b58b..86027387e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/ToolType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/ToolType.java @@ -1,8 +1,7 @@ package com.gmail.nossr50.core.skills; -import com.gmail.nossr50.util.ItemUtils; -import org.bukkit.Material; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; +import com.gmail.nossr50.core.util.ItemUtils; public enum ToolType { AXE("Axes.Ability.Lower", "Axes.Ability.Ready"), diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java index abffc7fac..1a383fadc 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.core.skills.child.salvage; import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.config.MainConfig; -import org.bukkit.Material; public class Salvage { public static Material anvilMaterial = MainConfig.getInstance().getSalvageAnvilMaterial(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java index 9e27e5be2..4ce8f7df8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java @@ -5,31 +5,23 @@ import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.child.salvage.salvageables.Salvageable; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.EventUtils; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.StringUtils; -import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.random.RandomChanceSkillStatic; -import com.gmail.nossr50.util.random.RandomChanceUtil; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillUtils; -import com.gmail.nossr50.util.sounds.SoundManager; -import com.gmail.nossr50.util.sounds.SoundType; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.EnchantmentStorageMeta; - -import java.util.Map; -import java.util.Map.Entry; +import com.gmail.nossr50.core.util.EventUtils; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.StringUtils; +import com.gmail.nossr50.core.util.player.NotificationManager; +import com.gmail.nossr50.core.util.random.RandomChanceSkillStatic; +import com.gmail.nossr50.core.util.random.RandomChanceUtil; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillUtils; +import com.gmail.nossr50.core.util.sounds.SoundManager; +import com.gmail.nossr50.core.util.sounds.SoundType; public class SalvageManager extends SkillManager { private boolean placedAnvil; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/Salvageable.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/Salvageable.java index ea75c98c4..de73cd1a0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/Salvageable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/Salvageable.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.core.skills.child.salvage.salvageables; import com.gmail.nossr50.core.skills.ConfigItemCategory; import com.gmail.nossr50.core.skills.MaterialType; -import org.bukkit.Material; public interface Salvageable { /** diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableFactory.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableFactory.java index c894386d2..fd780e95d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableFactory.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.core.skills.child.salvage.salvageables; import com.gmail.nossr50.core.skills.ConfigItemCategory; import com.gmail.nossr50.core.skills.MaterialType; -import org.bukkit.Material; public class SalvageableFactory { public static Salvageable getSalvageable(Material itemMaterial, Material repairMaterial, byte repairMetadata, int maximumQuantity, short maximumDurability) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableManager.java index 53d93e7d5..aa45dfc99 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableManager.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.child.salvage.salvageables; -import org.bukkit.Material; -import org.bukkit.inventory.ItemStack; + +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import java.util.List; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SimpleSalvageable.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SimpleSalvageable.java index 99ba64274..44d4fa390 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SimpleSalvageable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SimpleSalvageable.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.core.skills.child.salvage.salvageables; import com.gmail.nossr50.core.skills.ConfigItemCategory; import com.gmail.nossr50.core.skills.MaterialType; -import org.bukkit.Material; public class SimpleSalvageable implements Salvageable { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SimpleSalvageableManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SimpleSalvageableManager.java index b1608879a..ff06da104 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SimpleSalvageableManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SimpleSalvageableManager.java @@ -1,9 +1,8 @@ package com.gmail.nossr50.core.skills.child.salvage.salvageables; -import org.bukkit.Material; -import org.bukkit.inventory.ItemStack; -import java.util.HashMap; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; + import java.util.List; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/Smelting.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/Smelting.java index f844cff47..324660f88 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/Smelting.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/Smelting.java @@ -1,13 +1,12 @@ package com.gmail.nossr50.core.skills.child.smelting; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.skills.RankUtils; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.util.skills.RankUtils; public class Smelting { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java index fa5f76660..a76d5605b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java @@ -4,27 +4,24 @@ import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.mcmmo.block.BlockState; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.primary.mining.Mining; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.BlockUtils; -import com.gmail.nossr50.util.EventUtils; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.random.RandomChanceUtil; -import com.gmail.nossr50.util.skills.ParticleEffectUtils; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; -import com.gmail.nossr50.util.skills.SkillUtils; -import com.gmail.nossr50.util.sounds.SoundManager; -import com.gmail.nossr50.util.sounds.SoundType; -import org.bukkit.Material; -import org.bukkit.block.BlockState; -import org.bukkit.entity.Player; -import org.bukkit.event.inventory.FurnaceBurnEvent; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.util.BlockUtils; +import com.gmail.nossr50.core.util.EventUtils; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.random.RandomChanceUtil; +import com.gmail.nossr50.core.util.skills.ParticleEffectUtils; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; +import com.gmail.nossr50.core.util.skills.SkillUtils; +import com.gmail.nossr50.core.util.sounds.SoundManager; +import com.gmail.nossr50.core.util.sounds.SoundType; public class SmeltingManager extends SkillManager { public SmeltingManager(McMMOPlayer mcMMOPlayer) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Progression.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Progression.java index 92cd66109..3e8df5a67 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Progression.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Progression.java @@ -1,7 +1,6 @@ package com.gmail.nossr50.core.skills.interfaces; import com.gmail.nossr50.core.skills.subskills.interfaces.InteractType; -import org.bukkit.event.Event; public interface Progression { /** diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Toolable.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Toolable.java index 8997fbce6..a5c065032 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Toolable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Toolable.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.core.skills.interfaces; -import org.bukkit.inventory.ItemStack; + +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import java.util.Collection; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java index 0b6707494..37f051dd3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.core.skills.primary.acrobatics; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.config.MainConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; public final class Acrobatics { public static double dodgeDamageModifier = AdvancedConfig.getInstance().getDodgeDamageModifier(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/AcrobaticsManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/AcrobaticsManager.java index 2c7d8df3a..219a0f615 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/AcrobaticsManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/AcrobaticsManager.java @@ -3,20 +3,18 @@ package com.gmail.nossr50.core.skills.primary.acrobatics; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.random.RandomChanceUtil; -import com.gmail.nossr50.util.skills.ParticleEffectUtils; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; -import com.gmail.nossr50.util.skills.SkillUtils; -import org.bukkit.entity.Entity; -import org.bukkit.entity.LightningStrike; -import org.bukkit.entity.Player; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.player.NotificationManager; +import com.gmail.nossr50.core.util.random.RandomChanceUtil; +import com.gmail.nossr50.core.util.skills.ParticleEffectUtils; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; +import com.gmail.nossr50.core.util.skills.SkillUtils; public class AcrobaticsManager extends SkillManager { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/Alchemy.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/Alchemy.java index 1a36d4434..b6f4ecbc8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/Alchemy.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/Alchemy.java @@ -1,16 +1,11 @@ package com.gmail.nossr50.core.skills.primary.alchemy; import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.runnables.skills.AlchemyBrewTask; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.runnables.skills.AlchemyBrewTask; -import com.gmail.nossr50.util.skills.RankUtils; -import org.bukkit.Location; - +import com.gmail.nossr50.core.util.skills.RankUtils; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; public final class Alchemy { /*public enum Tier { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyManager.java index e7235ad70..93914a1dd 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyManager.java @@ -1,17 +1,17 @@ package com.gmail.nossr50.core.skills.primary.alchemy; -import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.config.skills.alchemy.PotionConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.skills.alchemy.PotionConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.PotionStage; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.util.StringUtils; -import com.gmail.nossr50.util.skills.RankUtils; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.util.StringUtils; +import com.gmail.nossr50.core.util.skills.RankUtils; import java.util.List; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotion.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotion.java index 1030a0c47..310cb9ef0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotion.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotion.java @@ -1,13 +1,7 @@ package com.gmail.nossr50.core.skills.primary.alchemy; -import com.gmail.nossr50.config.skills.alchemy.PotionConfig; -import org.bukkit.Color; -import org.bukkit.Material; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.PotionMeta; -import org.bukkit.potion.Potion; -import org.bukkit.potion.PotionData; -import org.bukkit.potion.PotionEffect; +import com.gmail.nossr50.core.config.skills.alchemy.PotionConfig; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import java.util.List; import java.util.Map; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotionBrewer.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotionBrewer.java index 89c617a0a..ccce4e9a2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotionBrewer.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotionBrewer.java @@ -1,24 +1,17 @@ package com.gmail.nossr50.core.skills.primary.alchemy; -import com.gmail.nossr50.config.skills.alchemy.PotionConfig; +import com.gmail.nossr50.core.config.skills.alchemy.PotionConfig; import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.events.fake.FakeBrewEvent; +import com.gmail.nossr50.core.mcmmo.block.BlockState; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.inventory.Inventory; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; +import com.gmail.nossr50.core.runnables.player.PlayerUpdateInventoryTask; +import com.gmail.nossr50.core.runnables.skills.AlchemyBrewCheckTask; import com.gmail.nossr50.core.skills.PotionStage; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.events.fake.FakeBrewEvent; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.runnables.player.PlayerUpdateInventoryTask; -import com.gmail.nossr50.runnables.skills.AlchemyBrewCheckTask; -import com.gmail.nossr50.util.Permissions; -import org.bukkit.Material; -import org.bukkit.block.BlockState; -import org.bukkit.block.BrewingStand; -import org.bukkit.entity.HumanEntity; -import org.bukkit.entity.Player; -import org.bukkit.event.inventory.ClickType; -import org.bukkit.inventory.BrewerInventory; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.InventoryView; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.util.Permissions; import java.util.ArrayList; import java.util.List; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/Archery.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/Archery.java index 870405a80..d1b7bab11 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/Archery.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/Archery.java @@ -1,14 +1,12 @@ package com.gmail.nossr50.core.skills.primary.archery; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.skills.RankUtils; -import org.bukkit.Material; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.skills.RankUtils; import java.util.ArrayList; import java.util.Iterator; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/ArcheryManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/ArcheryManager.java index 53772546b..1bf0ddcfe 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/ArcheryManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/ArcheryManager.java @@ -3,22 +3,17 @@ package com.gmail.nossr50.core.skills.primary.archery; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.world.Location; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.random.RandomChanceUtil; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; -import org.bukkit.Location; -import org.bukkit.entity.Entity; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.player.NotificationManager; +import com.gmail.nossr50.core.util.random.RandomChanceUtil; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; public class ArcheryManager extends SkillManager { public ArcheryManager(McMMOPlayer mcMMOPlayer) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/TrackedEntity.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/TrackedEntity.java index f7170bb6e..560c1e24b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/TrackedEntity.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/TrackedEntity.java @@ -1,8 +1,5 @@ package com.gmail.nossr50.core.skills.primary.archery; -import com.gmail.nossr50.mcMMO; -import org.bukkit.entity.LivingEntity; -import org.bukkit.scheduler.BukkitRunnable; import java.util.UUID; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/Axes.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/Axes.java index f26de6ed8..684aa4e7e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/Axes.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/Axes.java @@ -1,12 +1,11 @@ package com.gmail.nossr50.core.skills.primary.axes; import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.util.ItemUtils; -import com.gmail.nossr50.util.skills.RankUtils; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.util.ItemUtils; +import com.gmail.nossr50.core.util.skills.RankUtils; public class Axes { public static double axeMasteryRankDamageMultiplier = AdvancedConfig.getInstance().getAxeMasteryRankDamageMultiplier(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/AxesManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/AxesManager.java index 10b168e70..a3e5232e1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/AxesManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/AxesManager.java @@ -3,17 +3,14 @@ package com.gmail.nossr50.core.skills.primary.axes; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.*; -import com.gmail.nossr50.util.ItemUtils; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.random.RandomChanceUtil; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.event.entity.EntityDamageEvent.DamageModifier; -import org.bukkit.inventory.ItemStack; - -import java.util.Map; +import com.gmail.nossr50.core.util.ItemUtils; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.player.NotificationManager; +import com.gmail.nossr50.core.util.random.RandomChanceUtil; +import com.gmail.nossr50.core.util.skills.*; public class AxesManager extends SkillManager { public AxesManager(McMMOPlayer mcMMOPlayer) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/Excavation.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/Excavation.java index bb772370b..a884daf02 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/Excavation.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/Excavation.java @@ -1,12 +1,11 @@ package com.gmail.nossr50.core.skills.primary.excavation; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.treasure.TreasureConfig; +import com.gmail.nossr50.core.mcmmo.block.BlockState; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.treasure.ExcavationTreasure; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.StringUtils; -import org.bukkit.block.BlockState; +import com.gmail.nossr50.core.util.StringUtils; import java.util.ArrayList; import java.util.List; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java index 1941478a4..2b4c31beb 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java @@ -3,17 +3,16 @@ package com.gmail.nossr50.core.skills.primary.excavation; import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.mcmmo.block.BlockState; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.treasure.ExcavationTreasure; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.random.RandomChanceUtil; -import com.gmail.nossr50.util.skills.SkillUtils; -import org.bukkit.Location; -import org.bukkit.block.BlockState; -import org.bukkit.entity.Player; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.random.RandomChanceUtil; +import com.gmail.nossr50.core.util.skills.SkillUtils; import java.util.List; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/Fishing.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/Fishing.java index 31ba7f82c..87d6f5585 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/Fishing.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/Fishing.java @@ -2,18 +2,12 @@ package com.gmail.nossr50.core.skills.primary.fishing; import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.config.treasure.TreasureConfig; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.treasure.ShakeTreasure; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.adapter.BiomeAdapter; -import org.bukkit.Material; -import org.bukkit.block.Biome; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.LivingEntity; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.adapter.BiomeAdapter; -import java.util.HashMap; import java.util.List; -import java.util.Set; public final class Fishing { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java index b32fed307..10ae3cbc2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java @@ -1,12 +1,17 @@ package com.gmail.nossr50.core.skills.primary.fishing; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.config.MainConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.treasure.TreasureConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.events.skills.fishing.McMMOPlayerFishingTreasureEvent; +import com.gmail.nossr50.core.events.skills.fishing.McMMOPlayerShakeEvent; +import com.gmail.nossr50.core.mcmmo.entity.EntityType; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; @@ -14,28 +19,13 @@ import com.gmail.nossr50.core.skills.treasure.EnchantmentTreasure; import com.gmail.nossr50.core.skills.treasure.FishingTreasure; import com.gmail.nossr50.core.skills.treasure.Rarity; import com.gmail.nossr50.core.skills.treasure.ShakeTreasure; -import com.gmail.nossr50.events.skills.fishing.McMMOPlayerFishingTreasureEvent; -import com.gmail.nossr50.events.skills.fishing.McMMOPlayerShakeEvent; -import com.gmail.nossr50.util.*; -import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.random.RandomChanceSkillStatic; -import com.gmail.nossr50.util.random.RandomChanceUtil; -import com.gmail.nossr50.util.skills.CombatUtils; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillUtils; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Item; -import org.bukkit.entity.LivingEntity; -import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.PlayerInventory; -import org.bukkit.inventory.meta.SkullMeta; -import org.bukkit.util.BoundingBox; - +import com.gmail.nossr50.core.util.*; +import com.gmail.nossr50.core.util.player.NotificationManager; +import com.gmail.nossr50.core.util.random.RandomChanceSkillStatic; +import com.gmail.nossr50.core.util.random.RandomChanceUtil; +import com.gmail.nossr50.core.util.skills.CombatUtils; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillUtils; import java.util.*; public class FishingManager extends SkillManager { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/Herbalism.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/Herbalism.java index 3f1f62352..e8109f91b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/Herbalism.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/Herbalism.java @@ -1,11 +1,9 @@ package com.gmail.nossr50.core.skills.primary.herbalism; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.skills.SkillUtils; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.block.BlockState; + +import com.gmail.nossr50.core.mcmmo.block.Block; +import com.gmail.nossr50.core.mcmmo.block.BlockState; +import com.gmail.nossr50.core.util.skills.SkillUtils; import java.util.HashSet; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java index 531980a3e..83709ec51 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java @@ -1,31 +1,25 @@ package com.gmail.nossr50.core.skills.primary.herbalism; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.MainConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.treasure.TreasureConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.mods.CustomBlock; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.mcmmo.block.BlockState; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; +import com.gmail.nossr50.core.runnables.skills.HerbalismBlockUpdaterTask; import com.gmail.nossr50.core.skills.*; import com.gmail.nossr50.core.skills.treasure.HylianTreasure; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.runnables.skills.HerbalismBlockUpdaterTask; -import com.gmail.nossr50.util.*; -import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.random.RandomChanceSkillStatic; -import com.gmail.nossr50.util.random.RandomChanceUtil; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; -import com.gmail.nossr50.util.skills.SkillUtils; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.BlockState; -import org.bukkit.block.data.Ageable; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.PlayerInventory; -import org.bukkit.metadata.FixedMetadataValue; +import com.gmail.nossr50.core.util.*; +import com.gmail.nossr50.core.util.player.NotificationManager; +import com.gmail.nossr50.core.util.random.RandomChanceSkillStatic; +import com.gmail.nossr50.core.util.random.RandomChanceUtil; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; +import com.gmail.nossr50.core.util.skills.SkillUtils; import java.util.Collection; import java.util.List; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java index 640c99755..3fce937b0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java @@ -3,14 +3,9 @@ package com.gmail.nossr50.core.skills.primary.mining; import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.skills.RankUtils; -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.entity.TNTPrimed; -import org.bukkit.event.entity.EntityDamageByEntityEvent; -import org.bukkit.event.entity.EntityDamageEvent.DamageModifier; +import com.gmail.nossr50.core.util.skills.RankUtils; public class BlastMining { // The order of the values is extremely important, a few methods depend on it to work properly diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/Mining.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/Mining.java index a75595fac..25cfc002f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/Mining.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/Mining.java @@ -1,12 +1,10 @@ package com.gmail.nossr50.core.skills.primary.mining; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.mcmmo.block.BlockState; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Misc; -import org.bukkit.Material; -import org.bukkit.block.BlockState; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.util.Misc; public class Mining { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java index 581231212..0f90a4c91 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.core.skills.primary.repair; import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.config.MainConfig; -import org.bukkit.Material; public class Repair { public static int repairMasteryMaxBonusLevel = AdvancedConfig.getInstance().getRepairMasteryMaxLevel(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java index 32250d8bd..da01b7cb5 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java @@ -1,37 +1,30 @@ package com.gmail.nossr50.core.skills.primary.repair; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.config.MainConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.EventUtils; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.StringUtils; -import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.random.RandomChanceSkillStatic; -import com.gmail.nossr50.util.random.RandomChanceUtil; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; -import com.gmail.nossr50.util.skills.SkillUtils; -import com.gmail.nossr50.util.sounds.SoundManager; -import com.gmail.nossr50.util.sounds.SoundType; -import org.bukkit.Material; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.PlayerInventory; - -import java.util.Map; -import java.util.Map.Entry; +import com.gmail.nossr50.core.util.EventUtils; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.StringUtils; +import com.gmail.nossr50.core.util.player.NotificationManager; +import com.gmail.nossr50.core.util.random.RandomChanceSkillStatic; +import com.gmail.nossr50.core.util.random.RandomChanceUtil; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; +import com.gmail.nossr50.core.util.skills.SkillUtils; +import com.gmail.nossr50.core.util.sounds.SoundManager; +import com.gmail.nossr50.core.util.sounds.SoundType; public class RepairManager extends SkillManager { private boolean placedAnvil; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/Repairable.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/Repairable.java index 6131d282f..0b361bd8f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/Repairable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/Repairable.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.core.skills.primary.repair.repairables; import com.gmail.nossr50.core.skills.ConfigItemCategory; import com.gmail.nossr50.core.skills.MaterialType; -import org.bukkit.Material; public interface Repairable { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableFactory.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableFactory.java index bfb5c13f1..e44d1d9c8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableFactory.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.core.skills.primary.repair.repairables; import com.gmail.nossr50.core.skills.ConfigItemCategory; import com.gmail.nossr50.core.skills.MaterialType; -import org.bukkit.Material; public class RepairableFactory { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableManager.java index 96bbc537e..e7973eaab 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableManager.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.primary.repair.repairables; -import org.bukkit.Material; -import org.bukkit.inventory.ItemStack; + +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import java.util.List; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairable.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairable.java index 1f37848c7..d44661016 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairable.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.core.skills.primary.repair.repairables; import com.gmail.nossr50.core.skills.ConfigItemCategory; import com.gmail.nossr50.core.skills.MaterialType; -import org.bukkit.Material; public class SimpleRepairable implements Repairable { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairableManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairableManager.java index 9577cb297..6a93624da 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairableManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairableManager.java @@ -1,9 +1,8 @@ package com.gmail.nossr50.core.skills.primary.repair.repairables; -import org.bukkit.Material; -import org.bukkit.inventory.ItemStack; -import java.util.HashMap; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; + import java.util.List; public class SimpleRepairableManager implements RepairableManager { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/SwordsManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/SwordsManager.java index 6953dd462..7da92127e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/SwordsManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/SwordsManager.java @@ -3,20 +3,15 @@ package com.gmail.nossr50.core.skills.primary.swords; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.runnables.skills.BleedTimerTask; import com.gmail.nossr50.core.skills.*; -import com.gmail.nossr50.runnables.skills.BleedTimerTask; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.random.RandomChanceUtil; -import com.gmail.nossr50.util.skills.CombatUtils; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; -import org.bukkit.entity.Entity; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.event.entity.EntityDamageEvent.DamageModifier; - -import java.util.Map; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.player.NotificationManager; +import com.gmail.nossr50.core.util.random.RandomChanceUtil; +import com.gmail.nossr50.core.util.skills.CombatUtils; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; public class SwordsManager extends SkillManager { public SwordsManager(McMMOPlayer mcMMOPlayer) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/Taming.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/Taming.java index a2824734c..ce426e90f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/Taming.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/Taming.java @@ -1,7 +1,9 @@ package com.gmail.nossr50.core.skills.primary.taming; import com.gmail.nossr50.core.config.AdvancedConfig; -import org.bukkit.EntityEffect; +import com.gmail.nossr50.core.mcmmo.entity.EntityType; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.entity.Tameable; public class Taming { public static double fastFoodServiceActivationChance = AdvancedConfig.getInstance().getFastFoodChance(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java index ab51e45cd..074b50169 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java @@ -1,31 +1,32 @@ package com.gmail.nossr50.core.skills.primary.taming; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.config.MainConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.events.fake.FakeEntityTameEvent; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.entity.EntityType; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.entity.Tameable; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; +import com.gmail.nossr50.core.mcmmo.world.Location; +import com.gmail.nossr50.core.runnables.skills.BleedTimerTask; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.events.fake.FakeEntityTameEvent; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.runnables.skills.BleedTimerTask; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.StringUtils; -import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.random.RandomChanceSkillStatic; -import com.gmail.nossr50.util.random.RandomChanceUtil; -import com.gmail.nossr50.util.skills.ParticleEffectUtils; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; -import org.bukkit.Location; -import org.bukkit.Sound; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.StringUtils; +import com.gmail.nossr50.core.util.player.NotificationManager; +import com.gmail.nossr50.core.util.random.RandomChanceSkillStatic; +import com.gmail.nossr50.core.util.random.RandomChanceUtil; +import com.gmail.nossr50.core.util.skills.ParticleEffectUtils; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; import java.util.ArrayList; import java.util.HashMap; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TrackedTamingEntity.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TrackedTamingEntity.java index 55149187c..f93c0efa6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TrackedTamingEntity.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TrackedTamingEntity.java @@ -1,15 +1,9 @@ package com.gmail.nossr50.core.skills.primary.taming; import com.gmail.nossr50.core.config.MainConfig; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.skills.CombatUtils; -import com.gmail.nossr50.util.skills.ParticleEffectUtils; -import org.bukkit.Location; -import org.bukkit.Sound; -import org.bukkit.entity.LivingEntity; -import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -import org.bukkit.scheduler.BukkitRunnable; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.skills.CombatUtils; +import com.gmail.nossr50.core.util.skills.ParticleEffectUtils; import java.util.UUID; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java index 743de2c72..dd539a7e5 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java @@ -1,11 +1,10 @@ package com.gmail.nossr50.core.skills.primary.unarmed; import com.gmail.nossr50.core.config.MainConfig; -import com.gmail.nossr50.util.sounds.SoundManager; -import com.gmail.nossr50.util.sounds.SoundType; -import org.bukkit.entity.Player; -import org.bukkit.event.entity.EntityPickupItemEvent; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; +import com.gmail.nossr50.core.util.sounds.SoundManager; +import com.gmail.nossr50.core.util.sounds.SoundType; public class Unarmed { public static boolean blockCrackerSmoothBrick = MainConfig.getInstance().getUnarmedBlockCrackerSmoothbrickToCracked(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/UnarmedManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/UnarmedManager.java index 57936d574..77b314187 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/UnarmedManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/UnarmedManager.java @@ -4,23 +4,18 @@ import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.mcmmo.block.BlockState; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.*; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.EventUtils; -import com.gmail.nossr50.util.ItemUtils; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.random.RandomChanceUtil; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; -import org.bukkit.Material; -import org.bukkit.block.BlockState; -import org.bukkit.block.data.BlockData; -import org.bukkit.entity.Item; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.util.EventUtils; +import com.gmail.nossr50.core.util.ItemUtils; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.player.NotificationManager; +import com.gmail.nossr50.core.util.random.RandomChanceUtil; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; public class UnarmedManager extends SkillManager { public UnarmedManager(McMMOPlayer mcMMOPlayer) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java index 36a37bf7f..cc5c358ab 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java @@ -1,16 +1,13 @@ package com.gmail.nossr50.core.skills.primary.woodcutting; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.MainConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.mcmmo.block.BlockState; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.BlockUtils; -import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.skills.SkillUtils; -import org.bukkit.Material; -import org.bukkit.block.BlockFace; -import org.bukkit.block.BlockState; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.util.BlockUtils; +import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.skills.SkillUtils; import java.util.ArrayList; import java.util.List; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/WoodcuttingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/WoodcuttingManager.java index fe6359e3d..fe5381ee7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/WoodcuttingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/WoodcuttingManager.java @@ -4,23 +4,21 @@ import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.mods.CustomBlock; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.mcmmo.block.Block; +import com.gmail.nossr50.core.mcmmo.block.BlockState; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.core.skills.primary.woodcutting.Woodcutting.ExperienceGainMethod; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.*; -import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.random.RandomChanceUtil; -import com.gmail.nossr50.util.skills.CombatUtils; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.BlockState; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.util.*; +import com.gmail.nossr50.core.util.player.NotificationManager; +import com.gmail.nossr50.core.util.random.RandomChanceUtil; +import com.gmail.nossr50.core.util.skills.CombatUtils; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; import java.util.HashSet; import java.util.Set; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/AbstractSubSkill.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/AbstractSubSkill.java index bfb0e7d60..e36cbecd8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/AbstractSubSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/AbstractSubSkill.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.core.skills.subskills; import com.gmail.nossr50.core.config.CoreSkillsConfig; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.interfaces.Interaction; import com.gmail.nossr50.core.skills.subskills.interfaces.Rank; import com.gmail.nossr50.core.skills.subskills.interfaces.SubSkill; import com.gmail.nossr50.core.skills.subskills.interfaces.SubSkillProperties; -import com.gmail.nossr50.locale.LocaleLoader; -import org.bukkit.entity.Player; public abstract class AbstractSubSkill implements SubSkill, Interaction, Rank, SubSkillProperties { /* diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/AcrobaticsSubSkill.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/AcrobaticsSubSkill.java index 569f24f41..33f3feb6c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/AcrobaticsSubSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/AcrobaticsSubSkill.java @@ -1,14 +1,11 @@ package com.gmail.nossr50.core.skills.subskills.acrobatics; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.core.skills.subskills.interfaces.InteractType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.StringUtils; -import org.bukkit.event.Event; -import org.bukkit.event.EventPriority; +import com.gmail.nossr50.core.util.StringUtils; public abstract class AcrobaticsSubSkill extends AbstractSubSkill { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java index fba9bba41..f4675e310 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java @@ -1,38 +1,29 @@ package com.gmail.nossr50.core.skills.subskills.acrobatics; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.config.MainConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.LimitedSizeList; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.EventUtils; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.util.random.RandomChanceSkill; -import com.gmail.nossr50.util.random.RandomChanceUtil; -import com.gmail.nossr50.util.skills.PerksUtils; -import com.gmail.nossr50.util.skills.RankUtils; -import com.gmail.nossr50.util.skills.SkillActivationType; -import com.gmail.nossr50.util.skills.SkillUtils; -import com.gmail.nossr50.util.sounds.SoundManager; -import com.gmail.nossr50.util.sounds.SoundType; -import net.md_5.bungee.api.chat.ComponentBuilder; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.SoundCategory; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.event.Event; -import org.bukkit.event.EventPriority; -import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.util.EventUtils; +import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.core.util.player.NotificationManager; +import com.gmail.nossr50.core.util.random.RandomChanceSkill; +import com.gmail.nossr50.core.util.random.RandomChanceUtil; +import com.gmail.nossr50.core.util.skills.PerksUtils; +import com.gmail.nossr50.core.util.skills.RankUtils; +import com.gmail.nossr50.core.util.skills.SkillActivationType; +import com.gmail.nossr50.core.util.skills.SkillUtils; +import com.gmail.nossr50.core.util.sounds.SoundManager; +import com.gmail.nossr50.core.util.sounds.SoundType; import java.util.HashMap; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Interaction.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Interaction.java index 94723591c..b7d4616a4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Interaction.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Interaction.java @@ -1,8 +1,5 @@ package com.gmail.nossr50.core.skills.subskills.interfaces; -import com.gmail.nossr50.mcMMO; -import org.bukkit.event.Event; -import org.bukkit.event.EventPriority; public interface Interaction { /** diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/SubSkill.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/SubSkill.java index 712012194..9cf815f89 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/SubSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/SubSkill.java @@ -1,8 +1,7 @@ package com.gmail.nossr50.core.skills.subskills.interfaces; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.interfaces.Skill; -import net.md_5.bungee.api.chat.ComponentBuilder; -import org.bukkit.entity.Player; public interface SubSkill extends Skill { /** diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/EnchantmentTreasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/EnchantmentTreasure.java index 50ccb6980..ad718e913 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/EnchantmentTreasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/EnchantmentTreasure.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.core.skills.treasure; -import org.bukkit.enchantments.Enchantment; public class EnchantmentTreasure { private Enchantment enchantment; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ExcavationTreasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ExcavationTreasure.java index 92ba9c7c9..113532459 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ExcavationTreasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ExcavationTreasure.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.core.skills.treasure; -import org.bukkit.inventory.ItemStack; + +import com.gmail.nossr50.core.mcmmo.item.ItemStack; public class ExcavationTreasure extends Treasure { public ExcavationTreasure(ItemStack drop, int xp, double dropChance, int dropLevel) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/FishingTreasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/FishingTreasure.java index bce93839e..b3ee51786 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/FishingTreasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/FishingTreasure.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.core.skills.treasure; -import org.bukkit.inventory.ItemStack; + +import com.gmail.nossr50.core.mcmmo.item.ItemStack; public class FishingTreasure extends Treasure { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/HylianTreasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/HylianTreasure.java index e5595f58f..cbd3b1e8f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/HylianTreasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/HylianTreasure.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.core.skills.treasure; -import org.bukkit.inventory.ItemStack; + +import com.gmail.nossr50.core.mcmmo.item.ItemStack; public class HylianTreasure extends Treasure { public HylianTreasure(ItemStack drop, int xp, double dropChance, int dropLevel) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ShakeTreasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ShakeTreasure.java index 41bd533fe..d669f6dda 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ShakeTreasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ShakeTreasure.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.core.skills.treasure; -import org.bukkit.inventory.ItemStack; + +import com.gmail.nossr50.core.mcmmo.item.ItemStack; public class ShakeTreasure extends Treasure { public ShakeTreasure(ItemStack drop, int xp, double dropChance, int dropLevel) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java index 2b1edd24a..c909d4072 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.treasure; import com.gmail.nossr50.core.config.MainConfig; -import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; public abstract class Treasure { private int xp; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/BlockUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/BlockUtils.java index 0db94f6d5..dfc912b9d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/BlockUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/BlockUtils.java @@ -1,16 +1,10 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.mcmmo.block.BlockState; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.child.salvage.Salvage; import com.gmail.nossr50.core.skills.primary.repair.Repair; -import com.gmail.nossr50.mcMMO; -import org.bukkit.Material; -import org.bukkit.block.BlockState; -import org.bukkit.block.data.Ageable; -import org.bukkit.block.data.BlockData; - -import java.util.HashSet; public final class BlockUtils { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java b/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java index dbe4b9124..54146011a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java @@ -5,25 +5,19 @@ import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.colors.ChatColor; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.runnables.items.ChimaeraWingWarmup; import com.gmail.nossr50.core.util.player.NotificationManager; import com.gmail.nossr50.core.util.skills.CombatUtils; import com.gmail.nossr50.core.util.skills.SkillUtils; import com.gmail.nossr50.core.util.sounds.SoundManager; import com.gmail.nossr50.core.util.sounds.SoundType; -import com.gmail.nossr50.mcMMO; -import org.bukkit.ChatColor; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.NamespacedKey; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.ShapelessRecipe; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.util.Vector; import java.util.ArrayList; import java.util.List; +import java.util.Vector; public final class ChimaeraWing { private static McMMOPlayer mcMMOPlayer; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/EnchantmentUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/EnchantmentUtils.java index 1a65377d7..15aa170d7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/EnchantmentUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/EnchantmentUtils.java @@ -1,8 +1,5 @@ package com.gmail.nossr50.core.util; -import org.bukkit.enchantments.Enchantment; - -import java.util.HashMap; public class EnchantmentUtils { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/EventUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/EventUtils.java index 84b3a6837..1408dd7ad 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/EventUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/EventUtils.java @@ -6,42 +6,33 @@ import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.events.experience.McMMOPlayerLevelChangeEvent; +import com.gmail.nossr50.core.events.experience.McMMOPlayerLevelDownEvent; +import com.gmail.nossr50.core.events.experience.McMMOPlayerLevelUpEvent; +import com.gmail.nossr50.core.events.experience.McMMOPlayerXpGainEvent; +import com.gmail.nossr50.core.events.fake.*; +import com.gmail.nossr50.core.events.hardcore.McMMOPlayerPreDeathPenaltyEvent; +import com.gmail.nossr50.core.events.hardcore.McMMOPlayerStatLossEvent; +import com.gmail.nossr50.core.events.hardcore.McMMOPlayerVampirismEvent; +import com.gmail.nossr50.core.events.party.McMMOPartyLevelUpEvent; +import com.gmail.nossr50.core.events.party.McMMOPartyTeleportEvent; +import com.gmail.nossr50.core.events.party.McMMOPartyXpGainEvent; +import com.gmail.nossr50.core.events.skills.abilities.McMMOPlayerAbilityActivateEvent; +import com.gmail.nossr50.core.events.skills.abilities.McMMOPlayerAbilityDeactivateEvent; +import com.gmail.nossr50.core.events.skills.fishing.McMMOPlayerFishingTreasureEvent; +import com.gmail.nossr50.core.events.skills.fishing.McMMOPlayerMagicHunterEvent; +import com.gmail.nossr50.core.events.skills.repair.McMMOPlayerRepairCheckEvent; +import com.gmail.nossr50.core.events.skills.salvage.McMMOPlayerSalvageCheckEvent; +import com.gmail.nossr50.core.events.skills.secondaryabilities.SubSkillEvent; +import com.gmail.nossr50.core.events.skills.unarmed.McMMOPlayerDisarmEvent; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.core.util.skills.CombatUtils; -import com.gmail.nossr50.events.experience.McMMOPlayerLevelChangeEvent; -import com.gmail.nossr50.events.experience.McMMOPlayerLevelDownEvent; -import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent; -import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent; -import com.gmail.nossr50.events.hardcore.McMMOPlayerPreDeathPenaltyEvent; -import com.gmail.nossr50.events.hardcore.McMMOPlayerStatLossEvent; -import com.gmail.nossr50.events.hardcore.McMMOPlayerVampirismEvent; -import com.gmail.nossr50.events.party.McMMOPartyLevelUpEvent; -import com.gmail.nossr50.events.party.McMMOPartyTeleportEvent; -import com.gmail.nossr50.events.party.McMMOPartyXpGainEvent; -import com.gmail.nossr50.events.skills.abilities.McMMOPlayerAbilityActivateEvent; -import com.gmail.nossr50.events.skills.abilities.McMMOPlayerAbilityDeactivateEvent; -import com.gmail.nossr50.events.skills.fishing.McMMOPlayerFishingTreasureEvent; -import com.gmail.nossr50.events.skills.fishing.McMMOPlayerMagicHunterEvent; -import com.gmail.nossr50.events.skills.repair.McMMOPlayerRepairCheckEvent; -import com.gmail.nossr50.events.skills.salvage.McMMOPlayerSalvageCheckEvent; -import com.gmail.nossr50.events.skills.secondaryabilities.SubSkillEvent; -import com.gmail.nossr50.events.skills.unarmed.McMMOPlayerDisarmEvent; -import com.gmail.nossr50.mcMMO; -import org.bukkit.block.Block; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Entity; -import org.bukkit.entity.FishHook; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.event.Event; -import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.event.player.PlayerFishEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.plugin.PluginManager; import java.util.HashMap; import java.util.Map; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java b/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java index 91b4a6148..09746e731 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java @@ -4,9 +4,9 @@ import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.player.NotificationManager; -import org.bukkit.entity.Player; import java.util.HashMap; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/HolidayManager.java b/core/src/main/java/com/gmail/nossr50/core/util/HolidayManager.java index 3eb4c341c..09e264271 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/HolidayManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/HolidayManager.java @@ -1,24 +1,18 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.commands.skills.AprilCommand; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.colors.ChatColor; +import com.gmail.nossr50.core.mcmmo.commands.CommandSender; +import com.gmail.nossr50.core.mcmmo.entity.EntityType; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.player.NotificationManager; import com.gmail.nossr50.core.util.skills.ParticleEffectUtils; import com.gmail.nossr50.core.util.sounds.SoundManager; import com.gmail.nossr50.core.util.sounds.SoundType; -import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; -import org.bukkit.FireworkEffect.Type; -import org.bukkit.command.CommandSender; -import org.bukkit.command.PluginCommand; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Firework; -import org.bukkit.entity.Player; -import org.bukkit.event.player.PlayerStatisticIncrementEvent; -import org.bukkit.inventory.meta.FireworkMeta; import java.io.*; import java.util.*; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/LogFilter.java b/core/src/main/java/com/gmail/nossr50/core/util/LogFilter.java index 6c19f22d5..02c703b84 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/LogFilter.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/LogFilter.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.mcMMO; import java.util.logging.Filter; import java.util.logging.LogRecord; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/MaterialUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/MaterialUtils.java index 65b79d9b7..aa26018f2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/MaterialUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/MaterialUtils.java @@ -1,7 +1,5 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.mcMMO; -import org.bukkit.Material; public final class MaterialUtils { private MaterialUtils() { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/Misc.java b/core/src/main/java/com/gmail/nossr50/core/util/Misc.java index cb3ddd796..40802dc31 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/Misc.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/Misc.java @@ -1,18 +1,12 @@ package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.events.items.McMMOItemSpawnEvent; +import com.gmail.nossr50.core.mcmmo.block.BlockState; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask; -import com.gmail.nossr50.events.items.McMMOItemSpawnEvent; -import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableSet; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.BlockState; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Item; -import org.bukkit.entity.NPC; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; import java.util.Collection; import java.util.Random; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java index 981724b59..01e13384b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java @@ -3,15 +3,11 @@ package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.meta.OldName; +import com.gmail.nossr50.core.mcmmo.colors.ChatColor; +import com.gmail.nossr50.core.mcmmo.entity.EntityType; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.runnables.MobHealthDisplayUpdaterTask; import com.gmail.nossr50.core.skills.MobHealthbarType; -import com.gmail.nossr50.mcMMO; -import org.bukkit.ChatColor; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.event.entity.EntityDamageByEntityEvent; -import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.metadata.FixedMetadataValue; public final class MobHealthbarUtils { private MobHealthbarUtils() { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java b/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java index c45717efa..5afe70465 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java @@ -1,20 +1,16 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.config.mods.CustomArmorConfig; -import com.gmail.nossr50.config.mods.CustomBlockConfig; -import com.gmail.nossr50.config.mods.CustomEntityConfig; -import com.gmail.nossr50.config.mods.CustomToolConfig; import com.gmail.nossr50.core.config.MainConfig; +import com.gmail.nossr50.core.config.mods.CustomArmorConfig; +import com.gmail.nossr50.core.config.mods.CustomBlockConfig; +import com.gmail.nossr50.core.config.mods.CustomEntityConfig; +import com.gmail.nossr50.core.config.mods.CustomToolConfig; import com.gmail.nossr50.core.datatypes.mods.CustomBlock; import com.gmail.nossr50.core.datatypes.mods.CustomEntity; import com.gmail.nossr50.core.datatypes.mods.CustomTool; +import com.gmail.nossr50.core.mcmmo.block.BlockState; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; -import com.gmail.nossr50.mcMMO; -import org.bukkit.Material; -import org.bukkit.block.BlockState; -import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.entity.Entity; -import org.bukkit.inventory.ItemStack; import java.io.File; import java.util.ArrayList; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/Motd.java b/core/src/main/java/com/gmail/nossr50/core/util/Motd.java index 8163ae045..b6f34acd6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/Motd.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/Motd.java @@ -2,11 +2,9 @@ package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.skills.PerksUtils; -import com.gmail.nossr50.mcMMO; -import org.bukkit.entity.Player; -import org.bukkit.plugin.PluginDescriptionFile; import java.text.DecimalFormat; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java b/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java index 892f072c0..1aafebb36 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java @@ -6,15 +6,14 @@ import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.json.McMMOUrl; import com.gmail.nossr50.core.datatypes.json.McMMOWebLinks; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.colors.ChatColor; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.core.util.skills.RankUtils; -import com.gmail.nossr50.listeners.InteractionManager; -import net.md_5.bungee.api.ChatColor; -import net.md_5.bungee.api.ChatMessageType; -import org.bukkit.entity.Player; +import java.awt.*; import java.util.ArrayList; import java.util.List; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/adapter/BiomeAdapter.java b/core/src/main/java/com/gmail/nossr50/core/util/adapter/BiomeAdapter.java index f36fb1a69..5dea6bac2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/adapter/BiomeAdapter.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/adapter/BiomeAdapter.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.core.util.adapter; -import org.bukkit.block.Biome; import java.util.*; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java index 34955a960..ed49c4963 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java @@ -1,25 +1,9 @@ package com.gmail.nossr50.core.util.commands; -import com.gmail.nossr50.commands.chat.AdminChatCommand; -import com.gmail.nossr50.commands.chat.McChatSpy; -import com.gmail.nossr50.commands.chat.PartyChatCommand; -import com.gmail.nossr50.commands.database.McpurgeCommand; -import com.gmail.nossr50.commands.database.McremoveCommand; -import com.gmail.nossr50.commands.database.MmoshowdbCommand; -import com.gmail.nossr50.commands.experience.AddlevelsCommand; -import com.gmail.nossr50.commands.experience.AddxpCommand; -import com.gmail.nossr50.commands.experience.MmoeditCommand; -import com.gmail.nossr50.commands.experience.SkillresetCommand; -import com.gmail.nossr50.commands.hardcore.HardcoreCommand; -import com.gmail.nossr50.commands.hardcore.VampirismCommand; -import com.gmail.nossr50.commands.party.PartyCommand; -import com.gmail.nossr50.commands.party.teleport.PtpCommand; import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.StringUtils; -import com.gmail.nossr50.mcMMO; -import org.bukkit.command.PluginCommand; import java.util.ArrayList; import java.util.List; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java index ebfe4c7d3..0c57a6b09 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java @@ -5,15 +5,13 @@ import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.commands.CommandSender; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.core.util.StringUtils; import com.gmail.nossr50.core.util.skills.SkillUtils; -import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; -import org.bukkit.OfflinePlayer; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; import java.util.ArrayList; import java.util.List; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarManager.java b/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarManager.java index 240bf7251..7c53d0bfe 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarManager.java @@ -1,10 +1,9 @@ package com.gmail.nossr50.core.util.experience; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.runnables.skills.ExperienceBarHideTask; import com.gmail.nossr50.core.skills.PrimarySkillType; -import org.bukkit.plugin.Plugin; import java.util.HashMap; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarWrapper.java b/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarWrapper.java index f3acec350..0235f1229 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarWrapper.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarWrapper.java @@ -1,17 +1,13 @@ package com.gmail.nossr50.core.util.experience; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.bossbars.BarColor; +import com.gmail.nossr50.core.mcmmo.bossbars.BarStyle; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.StringUtils; -import org.bukkit.Server; -import org.bukkit.boss.BarColor; -import org.bukkit.boss.BarStyle; -import org.bukkit.boss.BossBar; -import org.bukkit.entity.Player; - -import java.util.List; /** * A visual representation of a players skill level progress for a PrimarySkillType diff --git a/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java b/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java index cb973462d..18a0062a1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java @@ -1,11 +1,9 @@ package com.gmail.nossr50.core.util.experience; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.MainConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.mcMMO; -import org.bukkit.configuration.file.YamlConfiguration; import java.io.File; import java.util.HashMap; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/player/NotificationManager.java b/core/src/main/java/com/gmail/nossr50/core/util/player/NotificationManager.java index c8bea6c92..a4d50c9d1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/player/NotificationManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/player/NotificationManager.java @@ -3,20 +3,17 @@ package com.gmail.nossr50.core.util.player; import com.gmail.nossr50.core.config.AdvancedConfig; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.events.skills.McMMOPlayerNotificationEvent; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.world.Location; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.util.sounds.SoundManager; import com.gmail.nossr50.core.util.sounds.SoundType; -import com.gmail.nossr50.events.skills.McMMOPlayerNotificationEvent; -import net.md_5.bungee.api.ChatMessageType; -import net.md_5.bungee.api.chat.TextComponent; -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.Server; -import org.bukkit.SoundCategory; -import org.bukkit.entity.Player; + +import java.awt.*; public class NotificationManager { /** diff --git a/core/src/main/java/com/gmail/nossr50/core/util/random/InvalidActivationException.java b/core/src/main/java/com/gmail/nossr50/core/util/random/InvalidActivationException.java index 176db6236..cb0f25b2c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/random/InvalidActivationException.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/InvalidActivationException.java @@ -1,5 +1,8 @@ package com.gmail.nossr50.core.util.random; public class InvalidActivationException extends Exception { - //Weee + public InvalidActivationException(String msg) + { + super(msg); + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/random/InvalidStaticChance.java b/core/src/main/java/com/gmail/nossr50/core/util/random/InvalidStaticChance.java index b339eb79a..b383dbed2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/random/InvalidStaticChance.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/InvalidStaticChance.java @@ -1,5 +1,8 @@ package com.gmail.nossr50.core.util.random; public class InvalidStaticChance extends Exception { - //Weeee + public InvalidStaticChance(String msg) + { + super(msg); + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkillStatic.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkillStatic.java index 8618cc0d1..a01cc2b53 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkillStatic.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkillStatic.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.util.random; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.SubSkillType; -import org.bukkit.entity.Player; public class RandomChanceSkillStatic extends RandomChanceSkill { private final double xPos; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceUtil.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceUtil.java index c5b988c7c..1d3227851 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceUtil.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceUtil.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.core.util.random; import com.gmail.nossr50.core.config.AdvancedConfig; +import com.gmail.nossr50.core.events.skills.secondaryabilities.SubSkillEvent; +import com.gmail.nossr50.core.events.skills.secondaryabilities.SubSkillRandomCheckEvent; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.core.util.EventUtils; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.skills.SkillActivationType; -import com.gmail.nossr50.events.skills.secondaryabilities.SubSkillEvent; -import com.gmail.nossr50.events.skills.secondaryabilities.SubSkillRandomCheckEvent; -import org.bukkit.entity.Player; import java.text.DecimalFormat; import java.util.Random; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java index 87977ba1c..67ad54bb4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java @@ -6,17 +6,14 @@ import com.gmail.nossr50.core.datatypes.database.PlayerStat; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.colors.ChatColor; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.core.util.Misc; -import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; -import org.bukkit.ChatColor; -import org.bukkit.entity.Player; -import org.bukkit.scoreboard.DisplaySlot; -import org.bukkit.scoreboard.Objective; import java.util.*; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java index 90bccb79b..fadb48b56 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java @@ -5,22 +5,15 @@ import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.database.PlayerStat; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.events.scoreboard.*; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.colors.ChatColor; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.core.skills.child.FamilyTree; import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager.SidebarType; -import com.gmail.nossr50.mcMMO; -import org.apache.commons.lang.Validate; -import org.bukkit.ChatColor; -import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; -import org.bukkit.scheduler.BukkitTask; -import org.bukkit.scoreboard.DisplaySlot; -import org.bukkit.scoreboard.Objective; -import org.bukkit.scoreboard.Score; -import org.bukkit.scoreboard.Scoreboard; import java.util.List; import java.util.Map; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/CombatUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/CombatUtils.java index 2aa3ed355..686c94ead 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/CombatUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/CombatUtils.java @@ -1,10 +1,17 @@ package com.gmail.nossr50.core.util.skills; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.events.fake.FakeEntityDamageByEntityEvent; +import com.gmail.nossr50.core.events.fake.FakeEntityDamageEvent; +import com.gmail.nossr50.core.mcmmo.entity.EntityType; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.entity.Tameable; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; +import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.runnables.skills.AwardCombatXpTask; import com.gmail.nossr50.core.runnables.skills.BleedTimerTask; import com.gmail.nossr50.core.skills.PrimarySkillType; @@ -18,25 +25,7 @@ import com.gmail.nossr50.core.skills.primary.unarmed.Unarmed; import com.gmail.nossr50.core.skills.primary.unarmed.UnarmedManager; import com.gmail.nossr50.core.util.*; import com.gmail.nossr50.core.util.player.NotificationManager; -import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent; -import com.gmail.nossr50.events.fake.FakeEntityDamageEvent; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.*; import com.google.common.collect.ImmutableMap; -import org.bukkit.GameMode; -import org.bukkit.Material; -import org.bukkit.entity.LivingEntity; -import org.bukkit.event.entity.EntityDamageByEntityEvent; -import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -import org.bukkit.event.entity.EntityDamageEvent.DamageModifier; -import org.bukkit.inventory.ItemStack; -import org.bukkit.projectiles.ProjectileSource; - -import java.util.EnumMap; -import java.util.HashMap; -import java.util.Map; public final class CombatUtils { private CombatUtils() { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java index b11cbdfeb..b876c0b02 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java @@ -1,16 +1,10 @@ package com.gmail.nossr50.core.util.skills; import com.gmail.nossr50.core.config.MainConfig; -import com.gmail.nossr50.mcMMO; -import org.bukkit.FireworkEffect.Type; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Firework; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.inventory.meta.FireworkMeta; -import org.bukkit.metadata.FixedMetadataValue; +import com.gmail.nossr50.core.mcmmo.entity.EntityType; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.world.Location; +import com.gmail.nossr50.core.mcmmo.world.World; public final class ParticleEffectUtils { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/PerksUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/PerksUtils.java index 9c8f068b1..8e8eef864 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/PerksUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/PerksUtils.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.core.util.skills; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.mcmmo.entity.Player; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Permissions; -import org.bukkit.entity.Player; public final class PerksUtils { private static final int LUCKY_SKILL_ACTIVATION_CHANCE = 75; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java index 0004feec9..e0996d508 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java @@ -9,6 +9,9 @@ import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.item.ItemStack; +import com.gmail.nossr50.core.mcmmo.world.Location; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; @@ -16,18 +19,6 @@ import com.gmail.nossr50.core.util.ItemUtils; import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.core.util.StringUtils; import com.gmail.nossr50.core.util.player.NotificationManager; -import com.gmail.nossr50.mcMMO; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.Recipe; -import org.bukkit.inventory.ShapedRecipe; -import org.bukkit.inventory.ShapelessRecipe; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; import java.util.ArrayList; import java.util.List; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundManager.java b/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundManager.java index 3ffeab4b1..e5fd19155 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundManager.java @@ -1,12 +1,9 @@ package com.gmail.nossr50.core.util.sounds; import com.gmail.nossr50.core.config.SoundConfig; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.mcmmo.world.World; import com.gmail.nossr50.core.util.Misc; -import org.bukkit.Location; -import org.bukkit.Sound; -import org.bukkit.SoundCategory; -import org.bukkit.World; -import org.bukkit.entity.Player; public class SoundManager { /** diff --git a/core/src/main/java/com/gmail/nossr50/core/util/upgrade/UpgradeManager.java b/core/src/main/java/com/gmail/nossr50/core/util/upgrade/UpgradeManager.java index d3c05ca12..03d69ba49 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/upgrade/UpgradeManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/upgrade/UpgradeManager.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.core.util.upgrade; -import com.gmail.nossr50.core.config.ConfigLoader; import com.gmail.nossr50.core.datatypes.database.UpgradeType; import java.util.Arrays; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/uuid/UUIDFetcher.java b/core/src/main/java/com/gmail/nossr50/core/util/uuid/UUIDFetcher.java index 5fa9e7452..40cabbb0f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/uuid/UUIDFetcher.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/uuid/UUIDFetcher.java @@ -1,9 +1,7 @@ package com.gmail.nossr50.core.util.uuid; import com.google.common.collect.ImmutableList; -import org.json.simple.JSONArray; -import org.json.simple.JSONObject; -import org.json.simple.parser.JSONParser; +import jdk.nashorn.internal.parser.JSONParser; import java.io.InputStreamReader; import java.io.OutputStream; diff --git a/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardFlags.java b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardFlags.java index f632a76f9..e51d2d87c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardFlags.java +++ b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardFlags.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.core.worldguard; -import com.sk89q.worldguard.protection.flags.StateFlag; public class WorldGuardFlags { // StateFlag with the name "my-custom-flag", which defaults to "allow" diff --git a/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardManager.java b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardManager.java index 41d0de8ea..368a4bd97 100644 --- a/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardManager.java @@ -1,16 +1,6 @@ package com.gmail.nossr50.core.worldguard; -import com.sk89q.worldedit.bukkit.BukkitAdapter; -import com.sk89q.worldedit.bukkit.BukkitPlayer; -import com.sk89q.worldguard.WorldGuard; -import com.sk89q.worldguard.bukkit.WorldGuardPlugin; -import com.sk89q.worldguard.protection.flags.registry.FlagConflictException; -import com.sk89q.worldguard.protection.flags.registry.FlagRegistry; -import com.sk89q.worldguard.protection.regions.RegionContainer; -import com.sk89q.worldguard.protection.regions.RegionQuery; -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; +import com.gmail.nossr50.core.mcmmo.entity.Player; public class WorldGuardManager { private static WorldGuardManager instance; diff --git a/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardUtils.java b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardUtils.java index 6aae57a0f..64eaa88e6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardUtils.java @@ -1,10 +1,5 @@ package com.gmail.nossr50.core.worldguard; -import com.gmail.nossr50.mcMMO; -import com.sk89q.worldguard.bukkit.WorldGuardPlugin; -import org.bukkit.Bukkit; -import org.bukkit.plugin.Plugin; - public class WorldGuardUtils { private static WorldGuardPlugin worldGuardPluginRef; private static boolean isLoaded = false; diff --git a/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java b/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java index 89176332a..627e17bab 100644 --- a/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java +++ b/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java @@ -1,7 +1,6 @@ package net.shatteredlands.shatt.backup; import com.gmail.nossr50.core.config.MainConfig; -import com.gmail.nossr50.mcMMO; import java.io.File; import java.io.FileInputStream; From 3a765e11645de3acfb674b9dca38b9323f560be6 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 16 Feb 2019 15:09:56 -0800 Subject: [PATCH 28/28] new config pt 8 (moving to configurable branch to test..) --- .../com/gmail/nossr50/core/api/PartyAPI.java | 15 ++- .../nossr50/core/chat/PartyChatManager.java | 3 +- .../nossr50/core/config/ConfigCollection.java | 7 ++ ...eyRegister.java => ConfigCollections.java} | 6 +- .../collectionconfigs/MultiConfigManager.java | 107 ++++++++++++++++++ .../RepairConfig.java | 25 ++-- .../SalvageConfig.java | 34 ++++-- .../core/config/mods/CustomArmorConfig.java | 4 +- .../core/config/mods/CustomBlockConfig.java | 4 +- .../skills/repair/RepairConfigManager.java | 42 ------- .../skills/salvage/SalvageConfigManager.java | 42 ------- 11 files changed, 170 insertions(+), 119 deletions(-) create mode 100644 core/src/main/java/com/gmail/nossr50/core/config/ConfigCollection.java rename core/src/main/java/com/gmail/nossr50/core/config/{ConfigKeyRegister.java => ConfigCollections.java} (63%) create mode 100644 core/src/main/java/com/gmail/nossr50/core/config/collectionconfigs/MultiConfigManager.java rename core/src/main/java/com/gmail/nossr50/core/config/{skills/repair => collectionconfigs}/RepairConfig.java (92%) rename core/src/main/java/com/gmail/nossr50/core/config/{skills/salvage => collectionconfigs}/SalvageConfig.java (92%) delete mode 100644 core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfigManager.java delete mode 100644 core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfigManager.java diff --git a/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java index 64d60d3d7..58d953746 100644 --- a/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java @@ -1,15 +1,14 @@ package com.gmail.nossr50.core.api; +import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyLeader; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.player.NotificationManager; -import org.bukkit.OfflinePlayer; -import org.bukkit.entity.Player; +import com.gmail.nossr50.core.mcmmo.entity.Player; +import com.gmail.nossr50.core.party.PartyManager; +import com.gmail.nossr50.core.util.player.NotificationManager; import java.util.*; @@ -83,7 +82,7 @@ public final class PartyAPI { Party party = PartyManager.getParty(partyName); if (party == null) { - party = new Party(new PartyLeader(player.getUniqueId(), player.getName()), partyName); + party = new Party(new PartyLeader(player.getUUID(), player.getName()), partyName); } else { if (PartyManager.isPartyFull(player, party)) { NotificationManager.sendPlayerInformation(player, NotificationType.PARTY_MESSAGE, "Commands.Party.PartyFull", party.toString()); @@ -117,7 +116,7 @@ public final class PartyAPI { Party party = PartyManager.getParty(partyName); if (party == null) { - party = new Party(new PartyLeader(player.getUniqueId(), player.getName()), partyName); + party = new Party(new PartyLeader(player.getUUID(), player.getName()), partyName); } PartyManager.addToParty(UserManager.getPlayer(player), party); @@ -156,7 +155,7 @@ public final class PartyAPI { */ @Deprecated public static void setPartyLeader(String partyName, String playerName) { - PartyManager.setPartyLeader(mcMMO.p.getServer().getOfflinePlayer(playerName).getUniqueId(), PartyManager.getParty(partyName)); + PartyManager.setPartyLeader(McmmoCore.getServer().getOfflinePlayer(playerName).getUniqueId(), PartyManager.getParty(partyName)); } /** diff --git a/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java b/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java index 4e85dab1c..512cbc791 100644 --- a/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java @@ -2,9 +2,8 @@ package com.gmail.nossr50.core.chat; import com.gmail.nossr50.core.config.MainConfig; import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.events.chat.McMMOPartyChatEvent; import com.gmail.nossr50.core.runnables.party.PartyChatTask; -import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; -import org.bukkit.plugin.Plugin; public class PartyChatManager extends ChatManager { private Party party; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/ConfigCollection.java b/core/src/main/java/com/gmail/nossr50/core/config/ConfigCollection.java new file mode 100644 index 000000000..845dc1a1a --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/config/ConfigCollection.java @@ -0,0 +1,7 @@ +package com.gmail.nossr50.core.config; + +import java.util.Collection; + +public interface ConfigCollection { + Collection getLoadedCollection(); +} diff --git a/core/src/main/java/com/gmail/nossr50/core/config/ConfigKeyRegister.java b/core/src/main/java/com/gmail/nossr50/core/config/ConfigCollections.java similarity index 63% rename from core/src/main/java/com/gmail/nossr50/core/config/ConfigKeyRegister.java rename to core/src/main/java/com/gmail/nossr50/core/config/ConfigCollections.java index 3c91e53ed..01238cc84 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/ConfigKeyRegister.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/ConfigCollections.java @@ -5,14 +5,14 @@ import java.io.File; /** * Represents a config file that registers keys after its initialized */ -public abstract class ConfigKeyRegister extends Config implements RegistersKeys { +public abstract class ConfigCollections extends Config implements RegistersKeys, ConfigCollection { - public ConfigKeyRegister(String pathToParentFolder, String relativePath, boolean mergeNewKeys) { + public ConfigCollections(String pathToParentFolder, String relativePath, boolean mergeNewKeys) { super(pathToParentFolder, relativePath, mergeNewKeys); loadKeys(); } - public ConfigKeyRegister(File pathToParentFolder, String relativePath, boolean mergeNewKeys) { + public ConfigCollections(File pathToParentFolder, String relativePath, boolean mergeNewKeys) { super(pathToParentFolder, relativePath, mergeNewKeys); loadKeys(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/collectionconfigs/MultiConfigManager.java b/core/src/main/java/com/gmail/nossr50/core/config/collectionconfigs/MultiConfigManager.java new file mode 100644 index 000000000..5a3fc25ed --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/core/config/collectionconfigs/MultiConfigManager.java @@ -0,0 +1,107 @@ +package com.gmail.nossr50.core.config.collectionconfigs; + +import com.gmail.nossr50.core.McmmoCore; +import com.gmail.nossr50.core.config.ConfigCollection; +import com.gmail.nossr50.core.config.ConfigCollections; +import com.gmail.nossr50.core.skills.child.salvage.salvageables.Salvageable; +import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.regex.Pattern; + +/** + * Represents a collection of config files that serve a similar purpose + * For example, files named repair.*.yml are all loaded into memory, this lets admins keep their config files clean + * + * To be honest I'm not sure how many people make use of this system, but I'm keeping it since its been in mcMMO for like 6+ years + */ +public final class MultiConfigManager { + + public static final String DEFAULT_MULTICONFIG_FILENAME_SUFFIX = ".vanilla.yml"; + + //Configs + public RepairConfig vanillaRepairConfig; //This is the main config file that mcMMO will copy out + public SalvageConfig vanillaSalvageConfig; + + private static List repairables; + private static List salvageables; + + public MultiConfigManager(String fileNamePrefix) + { + //init Collections + repairables = new ArrayList<>(); + salvageables = new ArrayList<>(); + + //init vanilla configs + vanillaRepairConfig = new RepairConfig(getVanillaConfigName("repair")); + vanillaSalvageConfig = new SalvageConfig(getVanillaConfigName("salvage")); + + //add valid vanilla collections to main collection + repairables.addAll(vanillaRepairConfig.getLoadedCollection()); + salvageables.addAll(vanillaSalvageConfig.getLoadedCollection()); + + //add valid custom collections to main collection + loadCustomCollections("repair", repairables, RepairConfig.class); + loadCustomCollections("salvage", salvageables, SalvageConfig.class); + } + + /** + * mcMMO allows collection config files to be named things like repair.whatevernameyouwanthere.yml and so on, + * these files are treated in the same way as the vanilla file. They serve the purpose of organization + * @param configPrefix the prefix of the file name, for example "repair", "salvage", etc + * @param collection the collection that will be added to + */ + public void loadCustomCollections(String configPrefix, Collection collection, Class configClass) + { + String vanillaConfigFileName = getVanillaConfigName(configPrefix); + + //Find other files + Pattern pattern = Pattern.compile(configPrefix+"\\.(?:.+)\\.yml"); + File dataFolder = McmmoCore.getDataFolderPath(); + + for (String fileName : dataFolder.list()) { + //Vanilla Config is already loaded + if(fileName.equalsIgnoreCase(vanillaConfigFileName)) + continue; + + //Find files that match the pattern + if (!pattern.matcher(fileName).matches()) { + continue; + } + + //Init file + File currentFile = new File(dataFolder, fileName); + + //Make sure its not a directory (needed?) + if(currentFile.isDirectory()) + continue; + + + try { + ConfigCollections customConfig = configClass.getClass().getConstructor(fileName).newInstance(); + collection.addAll(customConfig.getLoadedCollection()); + + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } + + + } + } + + private String getVanillaConfigName(String configPrefix) + { + return configPrefix+DEFAULT_MULTICONFIG_FILENAME_SUFFIX; + } + +} diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/collectionconfigs/RepairConfig.java similarity index 92% rename from core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/collectionconfigs/RepairConfig.java index f5d50ce5a..dfe1b213a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/collectionconfigs/RepairConfig.java @@ -1,7 +1,7 @@ -package com.gmail.nossr50.core.config.skills.repair; +package com.gmail.nossr50.core.config.collectionconfigs; import com.gmail.nossr50.core.McmmoCore; -import com.gmail.nossr50.core.config.ConfigKeyRegister; +import com.gmail.nossr50.core.config.ConfigCollections; import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.ConfigItemCategory; import com.gmail.nossr50.core.skills.MaterialType; @@ -13,23 +13,28 @@ import com.gmail.nossr50.core.util.skills.SkillUtils; import ninja.leaping.configurate.ConfigurationNode; import java.util.ArrayList; +import java.util.Collection; import java.util.Iterator; import java.util.List; /** * This config */ -public class RepairConfig extends ConfigKeyRegister { +public class RepairConfig extends ConfigCollections { private List repairables; public RepairConfig(String fileName) { super(McmmoCore.getDataFolderPath().getAbsoluteFile(), fileName, false); - loadKeys(); } @Override public void unload() { + repairables = null; + } + @Override + public Collection getLoadedCollection() { + return repairables == null ? new ArrayList() : repairables; } /** @@ -59,8 +64,6 @@ public class RepairConfig extends ConfigKeyRegister { // Validate all the things! List reason = new ArrayList(); - - try { // ItemStack Material ConfigItemCategory configItemCategory = ItemUtils.matchItemType(key); @@ -167,13 +170,15 @@ public class RepairConfig extends ConfigKeyRegister { } } - protected List getLoadedRepairables() { - return repairables == null ? new ArrayList() : repairables; - } + /** + * Check if there are any errors for this repairable and if there are reports them to console + * @param issues errors related to loading a repairable + * @return returns true if there are no errors for this repairable + */ private boolean noErrorsInRepairable(List issues) { for (String issue : issues) { - plugin.getLogger().warning(issue); + McmmoCore.getLogger().warning(issue); } return issues.isEmpty(); diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/collectionconfigs/SalvageConfig.java similarity index 92% rename from core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java rename to core/src/main/java/com/gmail/nossr50/core/config/collectionconfigs/SalvageConfig.java index 7a431fbd6..ececbbac2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/collectionconfigs/SalvageConfig.java @@ -1,7 +1,9 @@ -package com.gmail.nossr50.core.config.skills.salvage; +package com.gmail.nossr50.core.config.collectionconfigs; import com.gmail.nossr50.core.McmmoCore; import com.gmail.nossr50.core.config.Config; +import com.gmail.nossr50.core.config.ConfigCollection; +import com.gmail.nossr50.core.config.ConfigCollections; import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.MaterialType; import com.gmail.nossr50.core.skills.child.salvage.salvageables.Salvageable; @@ -10,15 +12,35 @@ import com.gmail.nossr50.core.util.ItemUtils; import com.gmail.nossr50.core.util.skills.SkillUtils; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import java.util.Set; -public class SalvageConfig extends Config { +public class SalvageConfig extends ConfigCollections { private List salvageables; public SalvageConfig(String fileName) { - super(McmmoCore.getDataFolderPath().getAbsoluteFile(), fileName); - loadKeys(); + super(McmmoCore.getDataFolderPath().getAbsoluteFile(), fileName, false); + } + + @Override + public Collection getLoadedCollection() { + return salvageables == null ? new ArrayList() : salvageables; + } + + @Override + public void unload() { + salvageables = null; + } + + /** + * The version of this config + * + * @return + */ + @Override + public double getConfigVersion() { + return 1; } @Override @@ -132,10 +154,6 @@ public class SalvageConfig extends Config { } } - protected List getLoadedSalvageables() { - return salvageables == null ? new ArrayList() : salvageables; - } - private boolean noErrorsInSalvageable(List issues) { if (!issues.isEmpty()) { plugin.getLogger().warning("Errors have been found in: " + fileName); diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java index ae7fc4136..7cc576f52 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.config.mods; import com.gmail.nossr50.core.McmmoCore; -import com.gmail.nossr50.core.config.ConfigKeyRegister; +import com.gmail.nossr50.core.config.ConfigCollections; import com.gmail.nossr50.core.mcmmo.item.ItemStack; import com.gmail.nossr50.core.skills.ConfigItemCategory; import com.gmail.nossr50.core.skills.MaterialType; @@ -13,7 +13,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Set; -public class CustomArmorConfig extends ConfigKeyRegister { +public class CustomArmorConfig extends ConfigCollections { public List customBoots = new ArrayList(); public List customChestplates = new ArrayList(); public List customHelmets = new ArrayList(); diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java index 4ab5dcddd..173424845 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.core.config.mods; import com.gmail.nossr50.core.McmmoCore; -import com.gmail.nossr50.core.config.ConfigKeyRegister; +import com.gmail.nossr50.core.config.ConfigCollections; import com.gmail.nossr50.core.datatypes.mods.CustomBlock; import java.util.ArrayList; import java.util.HashMap; import java.util.Set; -public class CustomBlockConfig extends ConfigKeyRegister { +public class CustomBlockConfig extends ConfigCollections { public List customExcavationBlocks = new ArrayList<>(); public List customHerbalismBlocks = new ArrayList<>(); public List customMiningBlocks = new ArrayList<>(); diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfigManager.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfigManager.java deleted file mode 100644 index eb0b0f098..000000000 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfigManager.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gmail.nossr50.core.config.skills.repair; - -import com.gmail.nossr50.core.config.skills.repair.RepairConfig; -import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Pattern; - -public class RepairConfigManager { - private final List repairables = new ArrayList(); - - public RepairConfigManager(mcMMO plugin) { - Pattern pattern = Pattern.compile("repair\\.(?:.+)\\.yml"); - File dataFolder = plugin.getDataFolder(); - File vanilla = new File(dataFolder, "repair.vanilla.yml"); - - if (!vanilla.exists()) { - plugin.saveResource("repair.vanilla.yml", false); - } - - for (String fileName : dataFolder.list()) { - if (!pattern.matcher(fileName).matches()) { - continue; - } - - File file = new File(dataFolder, fileName); - - if (file.isDirectory()) { - continue; - } - - RepairConfig rConfig = new RepairConfig(fileName); - repairables.addAll(rConfig.getLoadedRepairables()); - } - } - - public List getLoadedRepairables() { - return repairables; - } -} diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfigManager.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfigManager.java deleted file mode 100644 index 3324a0ce2..000000000 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfigManager.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gmail.nossr50.core.config.skills.salvage; - - -import com.gmail.nossr50.core.skills.child.salvage.salvageables.Salvageable; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Pattern; - -public class SalvageConfigManager { - private final List salvageables = new ArrayList(); - - public SalvageConfigManager(mcMMO plugin) { - Pattern pattern = Pattern.compile("salvage\\.(?:.+)\\.yml"); - File dataFolder = plugin.getDataFolder(); - File vanilla = new File(dataFolder, "salvage.vanilla.yml"); - - if (!vanilla.exists()) { - plugin.saveResource("salvage.vanilla.yml", false); - } - - for (String fileName : dataFolder.list()) { - if (!pattern.matcher(fileName).matches()) { - continue; - } - - File file = new File(dataFolder, fileName); - - if (file.isDirectory()) { - continue; - } - - com.gmail.nossr50.config.skills.salvage.SalvageConfig salvageConfig = new com.gmail.nossr50.config.skills.salvage.SalvageConfig(fileName); - salvageables.addAll(salvageConfig.getLoadedSalvageables()); - } - } - - public List getLoadedSalvageables() { - return salvageables; - } -}