├── .github ├── CODEOWNERS ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ └── feature_suggestion.yml ├── dependabot.yml └── workflows │ ├── checkstyle.yml │ └── gradle.yml ├── common └── src │ ├── main │ ├── resources │ │ ├── rewards │ │ │ ├── global.yml │ │ │ ├── alchemy.yml │ │ │ ├── enchanting.yml │ │ │ ├── fishing.yml │ │ │ ├── mining.yml │ │ │ ├── agility.yml │ │ │ ├── archery.yml │ │ │ ├── defense.yml │ │ │ ├── farming.yml │ │ │ ├── foraging.yml │ │ │ ├── excavation.yml │ │ │ └── fighting.yml │ │ ├── presets │ │ │ └── legacy.zip │ │ ├── xp_requirements.yml │ │ ├── db │ │ │ └── migrations │ │ │ │ ├── v2__last_updated_col.sql │ │ │ │ └── v1__modifiers_table.sql │ │ └── sources │ │ │ ├── defense.yml │ │ │ ├── fishing.yml │ │ │ └── agility.yml │ └── java │ │ └── dev │ │ └── aurelium │ │ └── auraskills │ │ └── common │ │ ├── damage │ │ └── DamageResult.java │ │ ├── storage │ │ ├── StorageType.java │ │ └── sql │ │ │ ├── DatabaseCredentials.java │ │ │ ├── KeyValueRow.java │ │ │ ├── ModifierRow.java │ │ │ ├── migration │ │ │ └── Migrations.java │ │ │ └── pool │ │ │ └── MySqlConnectionPool.java │ │ ├── commands │ │ └── CommandExecutor.java │ │ ├── config │ │ ├── preset │ │ │ ├── PresetEntry.java │ │ │ ├── PresetSaveOptions.java │ │ │ ├── PresetAction.java │ │ │ ├── ConfigPreset.java │ │ │ ├── PresetLoadException.java │ │ │ └── PresetLoadResult.java │ │ └── OptionType.java │ │ ├── loot │ │ ├── LootType.java │ │ ├── enchant │ │ │ ├── LootEnchantList.java │ │ │ ├── LootEnchantEntry.java │ │ │ └── LootEnchantments.java │ │ ├── CustomParser.java │ │ ├── CustomItemParser.java │ │ ├── SourceContext.java │ │ ├── ItemSupplier.java │ │ ├── ContextProvider.java │ │ ├── CommandLoot.java │ │ └── SkillLootProvider.java │ │ ├── menu │ │ └── MenuHelper.java │ │ ├── message │ │ ├── LocalizedKey.java │ │ ├── MessageKey.java │ │ ├── recipient │ │ │ ├── Recipient.java │ │ │ └── UserRecipient.java │ │ ├── PlatformLogger.java │ │ └── type │ │ │ ├── UnitMessage.java │ │ │ ├── ActionBarMessage.java │ │ │ ├── LevelerMessage.java │ │ │ ├── LevelerFormat.java │ │ │ ├── ACFMinecraftMessage.java │ │ │ ├── RewardMessage.java │ │ │ └── ACFCoreMessage.java │ │ ├── scheduler │ │ ├── TaskStatus.java │ │ ├── Task.java │ │ ├── Tick.java │ │ ├── TaskRunnable.java │ │ ├── SubmittedTask.java │ │ └── ScheduledTask.java │ │ ├── leaderboard │ │ ├── SkillValue.java │ │ ├── AverageSorter.java │ │ └── LeaderboardSorter.java │ │ ├── antiafk │ │ ├── CheckType.java │ │ ├── LogLocation.java │ │ └── IdentityHandler.java │ │ ├── trait │ │ ├── LoadedTrait.java │ │ └── TraitOptions.java │ │ ├── ui │ │ ├── BossBarColor.java │ │ ├── BossBarStyle.java │ │ ├── ActionBarType.java │ │ └── UiProvider.java │ │ ├── region │ │ ├── WorldManager.java │ │ └── ChunkCoordinate.java │ │ ├── ref │ │ ├── ItemRef.java │ │ ├── PlayerRef.java │ │ └── LocationRef.java │ │ ├── api │ │ └── implementation │ │ │ ├── ApiProvider.java │ │ │ ├── ApiHandlers.java │ │ │ ├── ApiXpRequirements.java │ │ │ └── ApiSourceType.java │ │ ├── hooks │ │ ├── HookType.java │ │ ├── HookRegistrationException.java │ │ ├── EconomyHook.java │ │ ├── PlaceholderHook.java │ │ ├── PermissionsHook.java │ │ └── Hook.java │ │ ├── modifier │ │ ├── ModifierManager.java │ │ └── TemporaryModifier.java │ │ ├── user │ │ ├── SkillLevelMaps.java │ │ └── AntiAfkLog.java │ │ ├── ability │ │ ├── LoadedAbility.java │ │ ├── AbilityImpl.java │ │ └── AbilityConfig.java │ │ ├── source │ │ ├── parser │ │ │ ├── ParsingExtension.java │ │ │ ├── JumpingSourceParser.java │ │ │ ├── GrindstoneSourceParser.java │ │ │ ├── FishingSourceParser.java │ │ │ ├── ItemConsumeSourceParser.java │ │ │ ├── PotionSplashSourceParser.java │ │ │ ├── ManaAbilityUseSourceParser.java │ │ │ ├── EnchantingSourceParser.java │ │ │ ├── util │ │ │ │ └── PotionDataParser.java │ │ │ └── StatisticSourceParser.java │ │ ├── annotation │ │ │ └── Required.java │ │ ├── income │ │ │ ├── FixedIncome.java │ │ │ └── XpIncome.java │ │ └── type │ │ │ ├── JumpingSource.java │ │ │ ├── GrindstoneSource.java │ │ │ ├── FishingSource.java │ │ │ ├── ItemConsumeSource.java │ │ │ ├── PotionSplashSource.java │ │ │ ├── ManaAbilityUseSource.java │ │ │ ├── EnchantingSource.java │ │ │ └── BrewingSource.java │ │ ├── mana │ │ └── LoadedManaAbility.java │ │ ├── item │ │ ├── SourcePotionData.java │ │ ├── SourceItem.java │ │ ├── LootSourceItem.java │ │ └── SourceItemMeta.java │ │ ├── util │ │ ├── data │ │ │ ├── Pair.java │ │ │ ├── KeyIntPair.java │ │ │ └── Validate.java │ │ ├── TestSession.java │ │ ├── file │ │ │ └── ConfigUpdate.java │ │ ├── PlatformUtil.java │ │ ├── math │ │ │ └── BigNumber.java │ │ └── text │ │ │ └── Replacer.java │ │ ├── stat │ │ ├── LoadedStat.java │ │ ├── StatOptions.java │ │ └── StatTraitConfig.java │ │ ├── event │ │ └── EventHandler.java │ │ ├── skill │ │ ├── LoadedSkill.java │ │ └── SkillOptions.java │ │ ├── reward │ │ ├── builder │ │ │ ├── RewardBuilder.java │ │ │ ├── MessagedRewardBuilder.java │ │ │ ├── MoneyRewardBuilder.java │ │ │ └── ItemRewardBuilder.java │ │ ├── parser │ │ │ ├── RewardParser.java │ │ │ └── MoneyRewardParser.java │ │ ├── type │ │ │ └── ItemReward.java │ │ └── SkillReward.java │ │ └── jobs │ │ └── JobsBatchData.java │ ├── test │ └── java │ │ └── dev │ │ └── aurelium │ │ └── auraskills │ │ └── common │ │ └── lib │ │ └── PluralTest.java │ └── testFixtures │ └── java │ └── dev │ └── aurelium │ └── auraskills │ └── common │ └── TestUtil.java ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── wiki ├── assets │ ├── recode-features-grid.png │ └── uploading-messages-crowdin.png ├── server-requirements.md └── incompatibilities.md ├── api ├── src │ ├── main │ │ └── java │ │ │ └── dev │ │ │ └── aurelium │ │ │ └── auraskills │ │ │ └── api │ │ │ ├── loot │ │ │ ├── LootDropCause.java │ │ │ ├── package-info.java │ │ │ ├── LootContext.java │ │ │ ├── LootTableType.java │ │ │ ├── LootContextFilter.java │ │ │ ├── LootRequirements.java │ │ │ ├── LootParsingContext.java │ │ │ ├── LootParser.java │ │ │ ├── Loot.java │ │ │ ├── LootManager.java │ │ │ ├── LootValues.java │ │ │ └── LootOptioned.java │ │ │ ├── util │ │ │ └── package-info.java │ │ │ ├── config │ │ │ └── package-info.java │ │ │ ├── item │ │ │ ├── package-info.java │ │ │ ├── ModifierType.java │ │ │ ├── ItemCategory.java │ │ │ ├── PotionData.java │ │ │ ├── ItemFilter.java │ │ │ ├── LootItemFilter.java │ │ │ └── ItemFilterMeta.java │ │ │ ├── annotation │ │ │ ├── package-info.java │ │ │ └── Inject.java │ │ │ ├── registry │ │ │ ├── package-info.java │ │ │ ├── Handlers.java │ │ │ └── NamespaceIdentified.java │ │ │ ├── message │ │ │ └── package-info.java │ │ │ ├── option │ │ │ ├── package-info.java │ │ │ ├── Optioned.java │ │ │ └── OptionedProvider.java │ │ │ ├── stat │ │ │ ├── package-info.java │ │ │ ├── ReloadableIdentifier.java │ │ │ ├── StatModifier.java │ │ │ └── StatProvider.java │ │ │ ├── mana │ │ │ └── package-info.java │ │ │ ├── skill │ │ │ ├── package-info.java │ │ │ ├── Multiplier.java │ │ │ ├── XpRequirements.java │ │ │ └── SkillProvider.java │ │ │ ├── trait │ │ │ ├── package-info.java │ │ │ ├── TraitProvider.java │ │ │ ├── TraitModifier.java │ │ │ └── TraitHandler.java │ │ │ ├── user │ │ │ └── package-info.java │ │ │ ├── ability │ │ │ ├── package-info.java │ │ │ └── AbilityProvider.java │ │ │ ├── source │ │ │ ├── type │ │ │ │ ├── package-info.java │ │ │ │ ├── GrindstoneXpSource.java │ │ │ │ ├── ItemConsumeXpSource.java │ │ │ │ ├── PotionSplashXpSource.java │ │ │ │ ├── ManaAbilityUseXpSource.java │ │ │ │ ├── JumpingXpSource.java │ │ │ │ ├── EnchantingXpSource.java │ │ │ │ ├── FishingXpSource.java │ │ │ │ ├── AnvilXpSource.java │ │ │ │ ├── BrewingXpSource.java │ │ │ │ └── StatisticXpSource.java │ │ │ ├── package-info.java │ │ │ ├── UtilityParser.java │ │ │ ├── XpSourceParser.java │ │ │ ├── SourceIncome.java │ │ │ ├── SourceType.java │ │ │ └── SkillSource.java │ │ │ ├── package-info.java │ │ │ └── AuraSkillsProvider.java │ └── test │ │ └── java │ │ └── dev │ │ └── aurelium │ │ └── auraskills │ │ └── api │ │ └── registry │ │ └── NamespacedIdTest.java └── javadoc │ └── overview.html ├── api-bukkit ├── src │ └── main │ │ └── java │ │ └── dev │ │ └── aurelium │ │ └── auraskills │ │ └── api │ │ ├── event │ │ ├── package-info.java │ │ ├── user │ │ │ ├── package-info.java │ │ │ └── UserLoadEvent.java │ │ ├── damage │ │ │ └── package-info.java │ │ ├── skill │ │ │ └── package-info.java │ │ ├── trait │ │ │ └── package-info.java │ │ ├── loot │ │ │ └── package-info.java │ │ ├── mana │ │ │ ├── package-info.java │ │ │ ├── TerraformBlockBreakEvent.java │ │ │ └── ManaAbilityBlockBreakEvent.java │ │ └── item │ │ │ ├── ItemEnableEvent.java │ │ │ └── ItemDisableEvent.java │ │ ├── menu │ │ ├── package-info.java │ │ └── ContextParser.java │ │ ├── region │ │ ├── package-info.java │ │ └── Regions.java │ │ ├── bukkit │ │ ├── package-info.java │ │ └── BukkitTraitHandler.java │ │ └── damage │ │ ├── package-info.java │ │ ├── DamageType.java │ │ └── DamageModifier.java └── javadoc │ └── overview.html ├── bukkit └── src │ ├── main │ ├── java │ │ └── dev │ │ │ └── aurelium │ │ │ └── auraskills │ │ │ └── bukkit │ │ │ ├── commands │ │ │ ├── JsonArg.java │ │ │ └── StatsCommand.java │ │ │ ├── loot │ │ │ ├── item │ │ │ │ └── enchant │ │ │ │ │ ├── LootEnchantLevel.java │ │ │ │ │ └── LeveledEnchant.java │ │ │ ├── parser │ │ │ │ └── CustomEntityParser.java │ │ │ ├── context │ │ │ │ └── MobContext.java │ │ │ ├── type │ │ │ │ └── EntityLoot.java │ │ │ ├── entity │ │ │ │ ├── EntitySupplier.java │ │ │ │ └── VanillaEntityParser.java │ │ │ └── BukkitLootLoader.java │ │ │ ├── item │ │ │ ├── ExternalItemProvider.java │ │ │ ├── ItemRegistryMenuProvider.java │ │ │ └── TraitModifiers.java │ │ │ ├── region │ │ │ └── BukkitBlock.java │ │ │ ├── storage │ │ │ └── BukkitStorageFactory.java │ │ │ ├── util │ │ │ ├── EnchantmentValue.java │ │ │ └── BlockFaceUtil.java │ │ │ ├── requirement │ │ │ ├── RequirementNode.java │ │ │ ├── WorldNode.java │ │ │ ├── BiomeNode.java │ │ │ ├── PermissionNode.java │ │ │ ├── StatNode.java │ │ │ ├── SkillNode.java │ │ │ ├── ExcludedWorldNode.java │ │ │ ├── GlobalRequirement.java │ │ │ ├── BukkitLootRequirements.java │ │ │ └── ItemNode.java │ │ │ ├── api │ │ │ └── implementation │ │ │ │ ├── BukkitApiProvider.java │ │ │ │ ├── ApiRegions.java │ │ │ │ └── ApiLootManager.java │ │ │ ├── menus │ │ │ ├── contexts │ │ │ │ ├── SortTypeContext.java │ │ │ │ ├── StatContext.java │ │ │ │ ├── SkillContext.java │ │ │ │ ├── TraitContext.java │ │ │ │ ├── AbilityContext.java │ │ │ │ └── ManaAbilityContext.java │ │ │ ├── util │ │ │ │ └── SlateMenuHelper.java │ │ │ └── shared │ │ │ │ └── ModifierInstance.java │ │ │ ├── antiafk │ │ │ ├── HandlerFunctions.java │ │ │ ├── BukkitCheckType.java │ │ │ └── BukkitCheck.java │ │ │ ├── scheduler │ │ │ └── BukkitTaskWrapper.java │ │ │ ├── trait │ │ │ ├── CritDamageTrait.java │ │ │ └── CritChanceTrait.java │ │ │ ├── ref │ │ │ ├── BukkitPlayerRef.java │ │ │ ├── BukkitItemRef.java │ │ │ └── BukkitLocationRef.java │ │ │ ├── hooks │ │ │ ├── mythicmobs │ │ │ │ ├── loot │ │ │ │ │ └── MythicEntityLootParser.java │ │ │ │ └── HasManaCondition.java │ │ │ └── TownyHook.java │ │ │ ├── ability │ │ │ └── BukkitAbilityImpl.java │ │ │ ├── damage │ │ │ └── DamageHandler.java │ │ │ └── jobs │ │ │ └── JobsListener.java │ └── resources │ │ └── menus │ │ └── leaderboard.yml │ └── test │ ├── resources │ ├── .metadata │ │ └── leaderboard_metadata.yml │ └── userdata │ │ └── 4954374f-e6c8-4c0d-b5fb-686cde397d8d.yml │ └── java │ └── dev │ └── aurelium │ └── auraskills │ └── bukkit │ ├── SyncOnlyScheduler.java │ └── config │ └── BukkitConfigProviderTest.java ├── settings.gradle.kts ├── gradle.properties ├── .gitignore └── crowdin.yml /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @Archy-X 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [Archy-X] 2 | -------------------------------------------------------------------------------- /common/src/main/resources/rewards/global.yml: -------------------------------------------------------------------------------- 1 | patterns: 2 | levels: -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archy-X/AuraSkills/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /wiki/assets/recode-features-grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archy-X/AuraSkills/HEAD/wiki/assets/recode-features-grid.png -------------------------------------------------------------------------------- /wiki/assets/uploading-messages-crowdin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archy-X/AuraSkills/HEAD/wiki/assets/uploading-messages-crowdin.png -------------------------------------------------------------------------------- /common/src/main/resources/presets/legacy.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archy-X/AuraSkills/HEAD/common/src/main/resources/presets/legacy.zip -------------------------------------------------------------------------------- /common/src/main/resources/xp_requirements.yml: -------------------------------------------------------------------------------- 1 | default: 2 | expression: 'multiplier * (level - 2) ^ 2 + base' 3 | multiplier: 100.0 4 | base: 100.0 -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/loot/LootDropCause.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.loot; 2 | 3 | public interface LootDropCause { 4 | } 5 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/loot/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Loot related classes. 3 | */ 4 | package dev.aurelium.auraskills.api.loot; 5 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/event/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Package for events. 3 | */ 4 | package dev.aurelium.auraskills.api.event; 5 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/menu/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Menu related classes. 3 | */ 4 | package dev.aurelium.auraskills.api.menu; 5 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/util/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Miscellaneous utility classes. 3 | */ 4 | package dev.aurelium.auraskills.api.util; 5 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/region/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Region related classes. 3 | */ 4 | package dev.aurelium.auraskills.api.region; 5 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/config/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Main config related classes. 3 | */ 4 | package dev.aurelium.auraskills.api.config; 5 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/item/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes used to represent items. 3 | */ 4 | package dev.aurelium.auraskills.api.item; 5 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/bukkit/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Bukkit-specific API extensions. 3 | */ 4 | package dev.aurelium.auraskills.api.bukkit; 5 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/event/user/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Events relating to users. 3 | */ 4 | package dev.aurelium.auraskills.api.event.user; 5 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/commands/JsonArg.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.commands; 2 | 3 | public record JsonArg(String json) { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/damage/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes used for the damage system. 3 | */ 4 | package dev.aurelium.auraskills.api.damage; 5 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/event/damage/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Events relating to damage. 3 | */ 4 | package dev.aurelium.auraskills.api.event.damage; 5 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/annotation/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * General internally used annotations. 3 | */ 4 | package dev.aurelium.auraskills.api.annotation; 5 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/registry/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Registry and namespace related classes. 3 | */ 4 | package dev.aurelium.auraskills.api.registry; 5 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/message/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes related to messages and localization. 3 | */ 4 | package dev.aurelium.auraskills.api.message; 5 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/option/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Abstractions used to expose configuration values. 3 | */ 4 | package dev.aurelium.auraskills.api.option; 5 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/event/skill/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Events relating to skills and leveling. 3 | */ 4 | package dev.aurelium.auraskills.api.event.skill; 5 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/event/trait/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Events relating to trait mechanics. 3 | */ 4 | package dev.aurelium.auraskills.api.event.trait; 5 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/item/ModifierType.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.item; 2 | 3 | public enum ModifierType { 4 | 5 | ITEM, 6 | ARMOR 7 | 8 | } 9 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/loot/LootContext.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.loot; 2 | 3 | public interface LootContext { 4 | 5 | String getName(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/stat/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@link dev.aurelium.auraskills.api.stat.Stat} related classes. 3 | */ 4 | package dev.aurelium.auraskills.api.stat; 5 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/event/loot/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Events relating to the custom loot table system. 3 | */ 4 | package dev.aurelium.auraskills.api.event.loot; 5 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/mana/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@link dev.aurelium.auraskills.api.mana.ManaAbility} related classes. 3 | */ 4 | package dev.aurelium.auraskills.api.mana; 5 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/skill/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@link dev.aurelium.auraskills.api.skill.Skill} related classes. 3 | */ 4 | package dev.aurelium.auraskills.api.skill; 5 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/trait/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@link dev.aurelium.auraskills.api.trait.Trait} related classes. 3 | */ 4 | package dev.aurelium.auraskills.api.trait; 5 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/user/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@link dev.aurelium.auraskills.api.user.SkillsUser} related classes. 3 | */ 4 | package dev.aurelium.auraskills.api.user; 5 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/damage/DamageResult.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.damage; 2 | 3 | public record DamageResult(double damage, boolean cancel) { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/storage/StorageType.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.storage; 2 | 3 | public enum StorageType { 4 | 5 | YAML, 6 | MYSQL 7 | 8 | } 9 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/event/mana/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Events relating to the mana system and mana abilities. 3 | */ 4 | package dev.aurelium.auraskills.api.event.mana; 5 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/ability/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@link dev.aurelium.auraskills.api.ability.Ability} related classes. 3 | */ 4 | package dev.aurelium.auraskills.api.ability; 5 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/source/type/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@link dev.aurelium.auraskills.api.source.XpSource} types. 3 | */ 4 | package dev.aurelium.auraskills.api.source.type; 5 | -------------------------------------------------------------------------------- /bukkit/src/test/resources/.metadata/leaderboard_metadata.yml: -------------------------------------------------------------------------------- 1 | excluded_players: 2 | - 3d9109ad-2e75-4e70-8c11-07229746f279 3 | - 7338414f-3dad-4480-a998-331c41b05fee 4 | - 902671bd-1a9e-4639-b4b7-9a46e5d01b2b 5 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/source/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * General package for {@link dev.aurelium.auraskills.api.source.XpSource}. 3 | */ 4 | package dev.aurelium.auraskills.api.source; 5 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/commands/CommandExecutor.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.commands; 2 | 3 | public enum CommandExecutor { 4 | 5 | CONSOLE, 6 | PLAYER 7 | 8 | } 9 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/config/preset/PresetEntry.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.config.preset; 2 | 3 | public record PresetEntry(String name, PresetAction action) { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/loot/LootType.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.loot; 2 | 3 | public enum LootType { 4 | 5 | ITEM, 6 | COMMAND, 7 | ENTITY 8 | 9 | } 10 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Main package and access point for the {@link dev.aurelium.auraskills.api.AuraSkillsApi} interface 3 | */ 4 | package dev.aurelium.auraskills.api; 5 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/loot/LootTableType.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.loot; 2 | 3 | public enum LootTableType { 4 | 5 | BLOCK, 6 | FISHING, 7 | MOB, 8 | CHEST 9 | 10 | } 11 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/loot/item/enchant/LootEnchantLevel.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.loot.item.enchant; 2 | 3 | public record LootEnchantLevel(int minLevel, int maxLevel) { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/menu/MenuHelper.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.menu; 2 | 3 | public interface MenuHelper { 4 | 5 | String getFormat(String menuName, String formatName); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/message/LocalizedKey.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.message; 2 | 3 | import java.util.Locale; 4 | 5 | public record LocalizedKey(MessageKey key, Locale locale) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/scheduler/TaskStatus.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.scheduler; 2 | 3 | public enum TaskStatus { 4 | 5 | SCHEDULED, 6 | RUNNING, 7 | STOPPED 8 | 9 | } 10 | -------------------------------------------------------------------------------- /common/src/main/resources/db/migrations/v2__last_updated_col.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE auraskills_users 2 | ADD COLUMN last_updated TIMESTAMP 3 | NOT NULL 4 | DEFAULT CURRENT_TIMESTAMP 5 | ON UPDATE CURRENT_TIMESTAMP; 6 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/loot/LootContextFilter.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.loot; 2 | 3 | @FunctionalInterface 4 | public interface LootContextFilter { 5 | 6 | boolean passesFilter(Loot loot); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/leaderboard/SkillValue.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.leaderboard; 2 | 3 | import java.util.UUID; 4 | 5 | public record SkillValue(UUID id, int level, double xp) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/loot/enchant/LootEnchantList.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.loot.enchant; 2 | 3 | import java.util.List; 4 | 5 | public record LootEnchantList(List entries) {} 6 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/scheduler/Task.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.scheduler; 2 | 3 | public interface Task { 4 | 5 | TaskStatus getStatus(); 6 | 7 | void cancel(); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/config/preset/PresetSaveOptions.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.config.preset; 2 | 3 | import java.util.List; 4 | 5 | public record PresetSaveOptions(List includedPaths) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/loot/enchant/LootEnchantEntry.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.loot.enchant; 2 | 3 | public record LootEnchantEntry(String enchantName, int minLevel, int maxLevel, double chance) { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/antiafk/CheckType.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.antiafk; 2 | 3 | public interface CheckType { 4 | 5 | Class getCheckClass(); 6 | 7 | String name(); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/config/preset/PresetAction.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.config.preset; 2 | 3 | public enum PresetAction { 4 | 5 | APPEND, 6 | MERGE, 7 | REPLACE, 8 | DELETE 9 | 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/loot/enchant/LootEnchantments.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.loot.enchant; 2 | 3 | import java.util.Map; 4 | 5 | public record LootEnchantments(Map possibleEnchants) {} 6 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/scheduler/Tick.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.scheduler; 2 | 3 | public class Tick { 4 | 5 | public static final long TPS = 20L; 6 | public static final long MS = 1000L / TPS; 7 | 8 | } 9 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/trait/LoadedTrait.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.trait; 2 | 3 | import dev.aurelium.auraskills.api.trait.Trait; 4 | 5 | public record LoadedTrait(Trait trait, TraitOptions options) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "AuraSkills" 2 | 3 | include("api") 4 | include("bukkit") 5 | include("common") 6 | include("api-bukkit") 7 | 8 | plugins { 9 | id("org.gradle.toolchains.foojay-resolver-convention") version ("1.0.0") 10 | } 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Discord Support 4 | url: https://discord.gg/Bh2EZfB 5 | about: If you are trying to ask a question or have other issues with the plugin, please ask on our Discord server. -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/item/ItemCategory.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.item; 2 | 3 | public enum ItemCategory { 4 | 5 | WEAPON, 6 | ARMOR, 7 | TOOL, 8 | FISHING_JUNK, 9 | FISHING_TREASURE 10 | 11 | } 12 | -------------------------------------------------------------------------------- /common/src/main/resources/rewards/alchemy.yml: -------------------------------------------------------------------------------- 1 | patterns: 2 | - type: stat 3 | stat: wisdom 4 | value: 1 5 | pattern: 6 | interval: 1 7 | - type: stat 8 | stat: health 9 | value: 0.4 10 | pattern: 11 | interval: 2 12 | levels: -------------------------------------------------------------------------------- /common/src/main/resources/rewards/enchanting.yml: -------------------------------------------------------------------------------- 1 | patterns: 2 | - type: stat 3 | stat: wisdom 4 | value: 1 5 | pattern: 6 | interval: 1 7 | - type: stat 8 | stat: luck 9 | value: 1 10 | pattern: 11 | interval: 2 12 | levels: -------------------------------------------------------------------------------- /common/src/main/resources/rewards/fishing.yml: -------------------------------------------------------------------------------- 1 | patterns: 2 | - type: stat 3 | stat: luck 4 | value: 1 5 | pattern: 6 | interval: 1 7 | - type: stat 8 | stat: health 9 | value: 0.4 10 | pattern: 11 | interval: 2 12 | levels: -------------------------------------------------------------------------------- /common/src/main/resources/rewards/mining.yml: -------------------------------------------------------------------------------- 1 | patterns: 2 | - type: stat 3 | stat: toughness 4 | value: 1 5 | pattern: 6 | interval: 1 7 | - type: stat 8 | stat: luck 9 | value: 1 10 | pattern: 11 | interval: 2 12 | levels: -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/config/OptionType.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.config; 2 | 3 | public enum OptionType { 4 | 5 | INT, 6 | DOUBLE, 7 | BOOLEAN, 8 | STRING, 9 | LIST, 10 | COLOR 11 | 12 | } 13 | -------------------------------------------------------------------------------- /common/src/main/resources/rewards/agility.yml: -------------------------------------------------------------------------------- 1 | patterns: 2 | - type: stat 3 | stat: regeneration 4 | value: 1 5 | pattern: 6 | interval: 1 7 | - type: stat 8 | stat: wisdom 9 | value: 1 10 | pattern: 11 | interval: 2 12 | levels: -------------------------------------------------------------------------------- /common/src/main/resources/rewards/archery.yml: -------------------------------------------------------------------------------- 1 | patterns: 2 | - type: stat 3 | stat: crit_chance 4 | value: 1 5 | pattern: 6 | interval: 1 7 | - type: stat 8 | stat: strength 9 | value: 1 10 | pattern: 11 | interval: 2 12 | levels: -------------------------------------------------------------------------------- /common/src/main/resources/rewards/defense.yml: -------------------------------------------------------------------------------- 1 | patterns: 2 | - type: stat 3 | stat: toughness 4 | value: 1 5 | pattern: 6 | interval: 1 7 | - type: stat 8 | stat: health 9 | value: 0.4 10 | pattern: 11 | interval: 2 12 | levels: -------------------------------------------------------------------------------- /common/src/main/resources/rewards/farming.yml: -------------------------------------------------------------------------------- 1 | patterns: 2 | - type: stat 3 | stat: health 4 | value: 0.4 5 | pattern: 6 | interval: 1 7 | - type: stat 8 | stat: strength 9 | value: 1 10 | pattern: 11 | interval: 2 12 | levels: -------------------------------------------------------------------------------- /common/src/main/resources/rewards/foraging.yml: -------------------------------------------------------------------------------- 1 | patterns: 2 | - type: stat 3 | stat: strength 4 | value: 1 5 | pattern: 6 | interval: 1 7 | - type: stat 8 | stat: toughness 9 | value: 1 10 | pattern: 11 | interval: 2 12 | levels: -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/loot/LootRequirements.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.loot; 2 | 3 | import java.util.UUID; 4 | 5 | public abstract class LootRequirements { 6 | 7 | public abstract boolean checkByUuid(UUID uuid); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /common/src/main/resources/rewards/excavation.yml: -------------------------------------------------------------------------------- 1 | patterns: 2 | - type: stat 3 | stat: regeneration 4 | value: 1 5 | pattern: 6 | interval: 1 7 | - type: stat 8 | stat: strength 9 | value: 1 10 | pattern: 11 | interval: 2 12 | levels: -------------------------------------------------------------------------------- /common/src/main/resources/rewards/fighting.yml: -------------------------------------------------------------------------------- 1 | patterns: 2 | - type: stat 3 | stat: crit_damage 4 | value: 1 5 | pattern: 6 | interval: 1 7 | - type: stat 8 | stat: regeneration 9 | value: 1 10 | pattern: 11 | interval: 2 12 | levels: -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/loot/item/enchant/LeveledEnchant.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.loot.item.enchant; 2 | 3 | import org.bukkit.enchantments.Enchantment; 4 | 5 | public record LeveledEnchant(Enchantment enchant, int level) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/antiafk/LogLocation.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.antiafk; 2 | 3 | import dev.aurelium.auraskills.common.region.BlockPosition; 4 | 5 | public record LogLocation(BlockPosition coordinates, String worldName) { 6 | } 7 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/ui/BossBarColor.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.ui; 2 | 3 | public enum BossBarColor { 4 | 5 | PINK, 6 | BLUE, 7 | RED, 8 | GREEN, 9 | YELLOW, 10 | PURPLE, 11 | WHITE 12 | 13 | } 14 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/ui/BossBarStyle.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.ui; 2 | 3 | public enum BossBarStyle { 4 | 5 | SOLID, 6 | SEGMENTED_6, 7 | SEGMENTED_10, 8 | SEGMENTED_12, 9 | SEGMENTED_20 10 | 11 | } 12 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | projectVersion=2.3.10 2 | supportedMCVersions=1.20,1.20.1,1.20.2,1.20.3,1.20.4,1.20.5,1.20.6,1.21,1.21.1,1.21.2,1.21.3,1.21.4,1.21.5,1.21.6,1.21.7,1.21.8,1.21.9,1.21.10,1.21.11 3 | releaseTitle=Minecraft 1.21.11 support 4 | repoBaseUrl=https://github.com/Archy-X/AuraSkills 5 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/damage/DamageType.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.damage; 2 | 3 | public enum DamageType { 4 | 5 | HAND, 6 | SWORD, 7 | BOW, 8 | AXE, 9 | PICKAXE, 10 | SHOVEL, 11 | HOE, 12 | OTHER 13 | 14 | } 15 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/config/preset/ConfigPreset.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.config.preset; 2 | 3 | import java.io.File; 4 | import java.util.List; 5 | 6 | public record ConfigPreset(String name, File zipFile, List entries) { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/region/WorldManager.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.region; 2 | 3 | public interface WorldManager { 4 | 5 | boolean isBlockedWorld(String worldName); 6 | 7 | boolean isDisabledWorld(String worldName); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/storage/sql/DatabaseCredentials.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.storage.sql; 2 | 3 | public record DatabaseCredentials(String host, int port, String database, String username, String password, 4 | boolean ssl) { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/registry/Handlers.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.registry; 2 | 3 | import dev.aurelium.auraskills.api.trait.TraitHandler; 4 | 5 | public interface Handlers { 6 | 7 | void registerTraitHandler(TraitHandler traitHandler); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/message/MessageKey.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.message; 2 | 3 | public interface MessageKey { 4 | 5 | String getPath(); 6 | 7 | static MessageKey of(String path) { 8 | return () -> path; 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/message/recipient/Recipient.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.message.recipient; 2 | 3 | import net.kyori.adventure.text.Component; 4 | 5 | public interface Recipient { 6 | 7 | void sendMessage(Component component); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/ref/ItemRef.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.ref; 2 | 3 | /** 4 | * A wrapper class for platform-dependent item instances 5 | */ 6 | public interface ItemRef { 7 | 8 | Object get(); 9 | 10 | ItemRef clone(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/source/type/GrindstoneXpSource.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.source.type; 2 | 3 | import dev.aurelium.auraskills.api.source.XpSource; 4 | 5 | public interface GrindstoneXpSource extends XpSource { 6 | 7 | String getMultiplier(); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/api/implementation/ApiProvider.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.api.implementation; 2 | 3 | import dev.aurelium.auraskills.api.loot.LootManager; 4 | 5 | public interface ApiProvider { 6 | 7 | LootManager getLootManager(); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/hooks/HookType.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.hooks; 2 | 3 | public interface HookType { 4 | 5 | Class getHookClass(); 6 | 7 | String getPluginName(); 8 | 9 | boolean requiresEnabledFirst(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/loot/CustomParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.loot; 2 | 3 | import org.spongepowered.configurate.ConfigurationNode; 4 | 5 | public interface CustomParser { 6 | 7 | boolean shouldUseParser(ConfigurationNode config); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/modifier/ModifierManager.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.modifier; 2 | 3 | import dev.aurelium.auraskills.common.user.User; 4 | 5 | public interface ModifierManager { 6 | 7 | void applyModifiers(User user, boolean reload); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/stat/ReloadableIdentifier.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.stat; 2 | 3 | import dev.aurelium.auraskills.api.registry.NamespaceIdentified; 4 | 5 | public interface ReloadableIdentifier extends NamespaceIdentified { 6 | 7 | String name(); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/ref/PlayerRef.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.ref; 2 | 3 | /** 4 | * A wrapper class for platform-dependent player instances 5 | */ 6 | public interface PlayerRef { 7 | 8 | Object get(); 9 | 10 | LocationRef getLocation(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/user/SkillLevelMaps.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.user; 2 | 3 | import dev.aurelium.auraskills.api.skill.Skill; 4 | 5 | import java.util.Map; 6 | 7 | public record SkillLevelMaps(Map levels, Map xp) { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/loot/LootParsingContext.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.loot; 2 | 3 | import dev.aurelium.auraskills.api.config.ConfigNode; 4 | 5 | public interface LootParsingContext { 6 | 7 | LootValues parseValues(ConfigNode config, LootRequirements requirements); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/source/UtilityParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.source; 2 | 3 | import dev.aurelium.auraskills.api.config.ConfigNode; 4 | 5 | @FunctionalInterface 6 | public interface UtilityParser { 7 | 8 | T parse(ConfigNode source, BaseContext context); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/config/preset/PresetLoadException.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.config.preset; 2 | 3 | public class PresetLoadException extends RuntimeException { 4 | 5 | public PresetLoadException(String message) { 6 | super(message); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/hooks/HookRegistrationException.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.hooks; 2 | 3 | public class HookRegistrationException extends RuntimeException { 4 | 5 | public HookRegistrationException(String message) { 6 | super(message); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/source/XpSourceParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.source; 2 | 3 | import dev.aurelium.auraskills.api.config.ConfigNode; 4 | 5 | @FunctionalInterface 6 | public interface XpSourceParser { 7 | 8 | T parse(ConfigNode source, SourceContext context); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/ability/LoadedAbility.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.ability; 2 | 3 | import dev.aurelium.auraskills.api.ability.Ability; 4 | import dev.aurelium.auraskills.api.skill.Skill; 5 | 6 | public record LoadedAbility(Ability ability, Skill skill, AbilityConfig config) { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/loot/CustomItemParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.loot; 2 | 3 | import org.spongepowered.configurate.ConfigurationNode; 4 | 5 | public interface CustomItemParser extends CustomParser { 6 | 7 | ItemSupplier parseCustomItem(ConfigurationNode config); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/parser/ParsingExtension.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.parser; 2 | 3 | import dev.aurelium.auraskills.api.source.XpSource; 4 | 5 | @FunctionalInterface 6 | public interface ParsingExtension { 7 | 8 | XpSource parse(XpSource source); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /api/javadoc/overview.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | API documentation for AuraSkills, the ultra-versatile RPG skills plugin for Minecraft. 4 |

5 |

Quick Links:

6 | 10 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/config/preset/PresetLoadResult.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.config.preset; 2 | 3 | import java.util.List; 4 | 5 | public record PresetLoadResult(List created, List modified, List replaced, List deleted, 6 | List skipped) { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/mana/LoadedManaAbility.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.mana; 2 | 3 | import dev.aurelium.auraskills.api.mana.ManaAbility; 4 | import dev.aurelium.auraskills.api.skill.Skill; 5 | 6 | public record LoadedManaAbility(ManaAbility manaAbility, Skill skill, ManaAbilityConfig config) { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /api-bukkit/javadoc/overview.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | API documentation for AuraSkills, the ultra-versatile RPG skills plugin for Minecraft. 4 |

5 |

Quick Links:

6 | 10 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/loot/LootParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.loot; 2 | 3 | import dev.aurelium.auraskills.api.config.ConfigNode; 4 | 5 | @FunctionalInterface 6 | public interface LootParser { 7 | 8 | Loot parse(LootParsingContext context, ConfigNode config, LootRequirements requirements); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/registry/NamespaceIdentified.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.registry; 2 | 3 | public interface NamespaceIdentified { 4 | 5 | /** 6 | * Gets the {@link NamespacedId} of the object 7 | * 8 | * @return the {@link NamespacedId} 9 | */ 10 | NamespacedId getId(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/item/SourcePotionData.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.item; 2 | 3 | import dev.aurelium.auraskills.api.item.PotionData; 4 | 5 | public record SourcePotionData(String[] types, String[] excludedTypes, boolean extended, boolean upgraded, 6 | boolean excludeNegative) implements PotionData { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/ref/LocationRef.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.ref; 2 | 3 | import java.util.Optional; 4 | 5 | /** 6 | * A wrapper class for platform-dependent location instances 7 | */ 8 | public interface LocationRef { 9 | 10 | Object get(); 11 | 12 | Optional getWorldName(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/item/ExternalItemProvider.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.item; 2 | 3 | import org.bukkit.inventory.ItemStack; 4 | import org.jetbrains.annotations.Nullable; 5 | 6 | @FunctionalInterface 7 | public interface ExternalItemProvider { 8 | 9 | @Nullable 10 | ItemStack getItem(String id); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/util/data/Pair.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.util.data; 2 | 3 | import java.util.Map; 4 | 5 | public record Pair(T first, V second) { 6 | 7 | public static Pair fromEntry(Map.Entry entry) { 8 | return new Pair<>(entry.getKey(), entry.getValue()); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: "/" 5 | schedule: 6 | interval: weekly 7 | groups: 8 | all: 9 | applies-to: version-updates 10 | patterns: 11 | - "*" 12 | commit-message: 13 | prefix: chore 14 | include: scope 15 | open-pull-requests-limit: 10 16 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/util/TestSession.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.util; 2 | 3 | import dev.aurelium.auraskills.common.config.Option; 4 | 5 | import java.util.Map; 6 | 7 | public record TestSession(Map configOverrides) { 8 | 9 | public static TestSession create() { 10 | return new TestSession(Map.of()); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/leaderboard/AverageSorter.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.leaderboard; 2 | 3 | import java.util.Comparator; 4 | 5 | public class AverageSorter implements Comparator { 6 | 7 | @Override 8 | public int compare(SkillValue a, SkillValue b) { 9 | return (int) (b.xp() * 100) - (int) (a.xp() * 100); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/annotation/Inject.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target(ElementType.FIELD) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface Inject { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/user/AntiAfkLog.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.user; 2 | 3 | import dev.aurelium.auraskills.common.region.BlockPosition; 4 | import org.jetbrains.annotations.NotNull; 5 | 6 | public record AntiAfkLog( 7 | long timestamp, 8 | @NotNull String message, 9 | BlockPosition coords, 10 | @NotNull String world 11 | ) { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/source/type/ItemConsumeXpSource.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.source.type; 2 | 3 | import dev.aurelium.auraskills.api.item.ItemFilter; 4 | import dev.aurelium.auraskills.api.source.XpSource; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | public interface ItemConsumeXpSource extends XpSource { 8 | 9 | @NotNull 10 | ItemFilter getItem(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/source/type/PotionSplashXpSource.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.source.type; 2 | 3 | import dev.aurelium.auraskills.api.item.ItemFilter; 4 | import dev.aurelium.auraskills.api.source.XpSource; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | public interface PotionSplashXpSource extends XpSource { 8 | 9 | @NotNull 10 | ItemFilter getItem(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/region/BukkitBlock.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.region; 2 | 3 | import dev.aurelium.auraskills.common.region.BlockPosition; 4 | import org.bukkit.block.Block; 5 | 6 | public class BukkitBlock { 7 | 8 | public static BlockPosition from(Block block) { 9 | return new BlockPosition(block.getX(), block.getY(), block.getZ()); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/storage/sql/KeyValueRow.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.storage.sql; 2 | 3 | import org.jetbrains.annotations.NotNull; 4 | import org.jetbrains.annotations.Nullable; 5 | 6 | public record KeyValueRow( 7 | int dataId, 8 | @Nullable String categoryId, 9 | @NotNull String keyName, 10 | @NotNull String value 11 | ) { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/item/PotionData.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.item; 2 | 3 | import org.jetbrains.annotations.Nullable; 4 | 5 | public interface PotionData { 6 | 7 | @Nullable 8 | String[] types(); 9 | 10 | @Nullable 11 | String[] excludedTypes(); 12 | 13 | boolean extended(); 14 | 15 | boolean upgraded(); 16 | 17 | boolean excludeNegative(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/item/ItemFilter.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.item; 2 | 3 | import org.jetbrains.annotations.Nullable; 4 | 5 | public interface ItemFilter { 6 | 7 | @Nullable 8 | String[] materials(); 9 | 10 | @Nullable 11 | String[] excludedMaterials(); 12 | 13 | @Nullable 14 | ItemCategory category(); 15 | 16 | @Nullable 17 | ItemFilterMeta meta(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/source/type/ManaAbilityUseXpSource.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.source.type; 2 | 3 | import dev.aurelium.auraskills.api.mana.ManaAbility; 4 | import dev.aurelium.auraskills.api.source.XpSource; 5 | import org.jetbrains.annotations.Nullable; 6 | 7 | public interface ManaAbilityUseXpSource extends XpSource { 8 | 9 | @Nullable 10 | ManaAbility[] getManaAbilities(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/loot/SourceContext.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.loot; 2 | 3 | import dev.aurelium.auraskills.api.loot.LootContext; 4 | import dev.aurelium.auraskills.api.source.XpSource; 5 | 6 | public record SourceContext(XpSource source) implements LootContext { 7 | 8 | @Override 9 | public String getName() { 10 | return source.getId().toString(); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/annotation/Required.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Target(ElementType.FIELD) 10 | public @interface Required { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/source/type/JumpingXpSource.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.source.type; 2 | 3 | import dev.aurelium.auraskills.api.source.XpSource; 4 | 5 | public interface JumpingXpSource extends XpSource { 6 | 7 | /** 8 | * Gets the amount of jumps that must be performed to grant xp 9 | * 10 | * @return The interval between granting xp 11 | */ 12 | int getInterval(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/util/file/ConfigUpdate.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.util.file; 2 | 3 | import org.spongepowered.configurate.ConfigurationNode; 4 | import org.spongepowered.configurate.serialize.SerializationException; 5 | 6 | @FunctionalInterface 7 | public interface ConfigUpdate { 8 | 9 | void apply(ConfigurationNode embedded, ConfigurationNode user) throws SerializationException; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/item/SourceItem.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.item; 2 | 3 | import dev.aurelium.auraskills.api.item.ItemCategory; 4 | import dev.aurelium.auraskills.api.item.ItemFilter; 5 | import dev.aurelium.auraskills.api.item.ItemFilterMeta; 6 | 7 | public record SourceItem(String[] materials, String[] excludedMaterials, ItemCategory category, 8 | ItemFilterMeta meta) implements ItemFilter { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/stat/LoadedStat.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.stat; 2 | 3 | import com.google.common.collect.ImmutableList; 4 | import dev.aurelium.auraskills.api.stat.Stat; 5 | import dev.aurelium.auraskills.api.trait.Trait; 6 | 7 | import java.util.Map; 8 | 9 | public record LoadedStat(Stat stat, ImmutableList traits, Map traitConfigs, 10 | StatOptions options) { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/message/PlatformLogger.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.message; 2 | 3 | public interface PlatformLogger { 4 | 5 | void info(String message); 6 | 7 | void warn(String message); 8 | 9 | void warn(String message, Throwable throwable); 10 | 11 | void severe(String message); 12 | 13 | void severe(String message, Throwable throwable); 14 | 15 | void debug(String message); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/loot/parser/CustomEntityParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.loot.parser; 2 | 3 | import dev.aurelium.auraskills.bukkit.loot.entity.EntitySupplier; 4 | import dev.aurelium.auraskills.common.loot.CustomParser; 5 | import org.spongepowered.configurate.ConfigurationNode; 6 | 7 | public interface CustomEntityParser extends CustomParser { 8 | 9 | EntitySupplier getEntitySupplier(ConfigurationNode config); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/util/PlatformUtil.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.util; 2 | 3 | import net.kyori.adventure.text.Component; 4 | 5 | public interface PlatformUtil { 6 | 7 | boolean isValidMaterial(String input); 8 | 9 | boolean isValidEntityType(String input); 10 | 11 | String convertEntityName(String input); 12 | 13 | Component toComponent(String message); 14 | 15 | String toString(Component component); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/stat/StatOptions.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.stat; 2 | 3 | import dev.aurelium.auraskills.common.util.data.OptionProvider; 4 | 5 | import java.util.Map; 6 | 7 | public class StatOptions extends OptionProvider { 8 | 9 | public StatOptions(Map optionMap) { 10 | super(optionMap); 11 | } 12 | 13 | public boolean enabled() { 14 | return getBoolean("enabled"); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/loot/context/MobContext.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.loot.context; 2 | 3 | import dev.aurelium.auraskills.api.loot.LootContext; 4 | import org.bukkit.entity.EntityType; 5 | 6 | import java.util.Locale; 7 | 8 | public record MobContext(EntityType entityType) implements LootContext { 9 | 10 | @Override 11 | public String getName() { 12 | return entityType.toString().toLowerCase(Locale.ROOT); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/item/LootSourceItem.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.item; 2 | 3 | import dev.aurelium.auraskills.api.item.ItemCategory; 4 | import dev.aurelium.auraskills.api.item.ItemFilterMeta; 5 | import dev.aurelium.auraskills.api.item.LootItemFilter; 6 | 7 | public record LootSourceItem(String[] materials, String[] excludedMaterials, ItemCategory category, ItemFilterMeta meta, 8 | String lootPool) implements LootItemFilter { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/scheduler/TaskRunnable.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.scheduler; 2 | 3 | public abstract class TaskRunnable implements Runnable { 4 | 5 | private Task task; 6 | 7 | public TaskRunnable() { 8 | 9 | } 10 | 11 | public synchronized void cancel() throws IllegalStateException { 12 | task.cancel(); 13 | } 14 | 15 | public void injectTask(Task task) { 16 | this.task = task; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/trait/TraitOptions.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.trait; 2 | 3 | import dev.aurelium.auraskills.common.util.data.OptionProvider; 4 | 5 | import java.util.Map; 6 | 7 | public class TraitOptions extends OptionProvider { 8 | 9 | public TraitOptions(Map optionMap) { 10 | super(optionMap); 11 | } 12 | 13 | public boolean enabled() { 14 | return getBoolean("enabled"); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/event/mana/TerraformBlockBreakEvent.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.event.mana; 2 | 3 | import org.bukkit.block.Block; 4 | import org.bukkit.entity.Player; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | public class TerraformBlockBreakEvent extends ManaAbilityBlockBreakEvent { 8 | 9 | public TerraformBlockBreakEvent(@NotNull Block theBlock, @NotNull Player player) { 10 | super(theBlock, player); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/item/SourceItemMeta.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.item; 2 | 3 | import dev.aurelium.auraskills.api.item.ItemFilterMeta; 4 | import dev.aurelium.auraskills.api.item.PotionData; 5 | 6 | import java.util.List; 7 | 8 | public record SourceItemMeta(String displayName, List lore, PotionData potionData, boolean hasCustomModelData, 9 | int customModelData, boolean ignoreCustomModelData) implements ItemFilterMeta { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/stat/StatTraitConfig.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.stat; 2 | 3 | import dev.aurelium.auraskills.common.util.data.OptionProvider; 4 | 5 | import java.util.Map; 6 | 7 | public class StatTraitConfig extends OptionProvider { 8 | 9 | public StatTraitConfig(Map optionMap) { 10 | super(optionMap); 11 | } 12 | 13 | public double modifier() { 14 | return getDouble("modifier"); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/trait/TraitProvider.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.trait; 2 | 3 | import dev.aurelium.auraskills.api.option.OptionedProvider; 4 | 5 | import java.util.Locale; 6 | 7 | public interface TraitProvider extends OptionedProvider { 8 | 9 | boolean isEnabled(Trait trait); 10 | 11 | String getDisplayName(Trait trait, Locale locale, boolean formatted); 12 | 13 | String getMenuDisplay(Trait trait, double value, Locale locale); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/source/type/EnchantingXpSource.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.source.type; 2 | 3 | import dev.aurelium.auraskills.api.item.ItemFilter; 4 | import dev.aurelium.auraskills.api.source.XpSource; 5 | import org.jetbrains.annotations.NotNull; 6 | import org.jetbrains.annotations.Nullable; 7 | 8 | public interface EnchantingXpSource extends XpSource { 9 | 10 | @NotNull 11 | ItemFilter getItem(); 12 | 13 | @Nullable 14 | String getUnit(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/storage/sql/ModifierRow.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.storage.sql; 2 | 3 | import org.jetbrains.annotations.Nullable; 4 | 5 | public record ModifierRow( 6 | String modifierType, 7 | @Nullable String typeId, 8 | String modifierName, 9 | double modifierValue, 10 | byte modifierOperation, 11 | long expirationTime, 12 | long remainingDuration, 13 | @Nullable String metadata 14 | ) { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/loot/Loot.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.loot; 2 | 3 | import java.util.UUID; 4 | 5 | public abstract class Loot { 6 | 7 | protected final LootValues values; 8 | 9 | public Loot(LootValues values) { 10 | this.values = values; 11 | } 12 | 13 | public LootValues getValues() { 14 | return values; 15 | } 16 | 17 | public boolean checkRequirements(UUID uuid) { 18 | return values.checkRequirements(uuid); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/ui/ActionBarType.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.ui; 2 | 3 | import dev.aurelium.auraskills.common.config.Option; 4 | 5 | public enum ActionBarType { 6 | 7 | IDLE, 8 | ABILITY, 9 | XP, 10 | MAXED; 11 | 12 | private final Option option; 13 | 14 | ActionBarType() { 15 | this.option = Option.valueOf("ACTION_BAR_" + this.name()); 16 | } 17 | 18 | public Option getOption() { 19 | return this.option; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /common/src/main/resources/sources/defense.yml: -------------------------------------------------------------------------------- 1 | default: 2 | type: damage 3 | excluded_cause: fall 4 | must_survive: true 5 | use_original_damage: true 6 | sources: 7 | mob_damage: 8 | damager: mob 9 | xp: 1 10 | menu_item: 11 | material: zombie_head 12 | unit: '{sources.units.damage}' 13 | include_projectiles: true 14 | player_damage: 15 | damager: player 16 | xp: 2 17 | menu_item: 18 | material: player_head 19 | unit: '{sources.units.damage}' 20 | include_projectiles: true -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/source/type/FishingXpSource.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.source.type; 2 | 3 | import dev.aurelium.auraskills.api.item.LootItemFilter; 4 | import dev.aurelium.auraskills.api.source.XpSource; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | public interface FishingXpSource extends XpSource { 8 | 9 | /** 10 | * Gets the valid items of the source. 11 | * 12 | * @return The items 13 | */ 14 | @NotNull 15 | LootItemFilter getItem(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/message/type/UnitMessage.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.message.type; 2 | 3 | import dev.aurelium.auraskills.common.message.MessageKey; 4 | 5 | import java.util.Locale; 6 | 7 | public enum UnitMessage implements MessageKey { 8 | 9 | MANA, 10 | HP, 11 | XP; 12 | 13 | private final String path = "units." + this.toString().toLowerCase(Locale.ROOT); 14 | 15 | @Override 16 | public String getPath() { 17 | return path; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/event/mana/ManaAbilityBlockBreakEvent.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.event.mana; 2 | 3 | import org.bukkit.block.Block; 4 | import org.bukkit.entity.Player; 5 | import org.bukkit.event.block.BlockBreakEvent; 6 | import org.jetbrains.annotations.NotNull; 7 | 8 | public class ManaAbilityBlockBreakEvent extends BlockBreakEvent { 9 | 10 | public ManaAbilityBlockBreakEvent(@NotNull Block theBlock, @NotNull Player player) { 11 | super(theBlock, player); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/item/LootItemFilter.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.item; 2 | 3 | import org.jetbrains.annotations.NotNull; 4 | import org.jetbrains.annotations.Nullable; 5 | 6 | public interface LootItemFilter { 7 | 8 | @Nullable 9 | String[] materials(); 10 | 11 | @Nullable 12 | String[] excludedMaterials(); 13 | 14 | @Nullable 15 | ItemCategory category(); 16 | 17 | @NotNull 18 | ItemFilterMeta meta(); 19 | 20 | @Nullable 21 | String lootPool(); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/loot/ItemSupplier.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.loot; 2 | 3 | import dev.aurelium.auraskills.api.registry.NamespacedId; 4 | import dev.aurelium.auraskills.common.loot.enchant.LootEnchantments; 5 | import dev.aurelium.auraskills.common.ref.ItemRef; 6 | import org.jetbrains.annotations.Nullable; 7 | 8 | public record ItemSupplier( 9 | @Nullable ItemRef baseItem, 10 | @Nullable NamespacedId baseItemKey, 11 | @Nullable LootEnchantments enchantments 12 | ) {} 13 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/bukkit/BukkitTraitHandler.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.bukkit; 2 | 3 | import dev.aurelium.auraskills.api.trait.Trait; 4 | import dev.aurelium.auraskills.api.trait.TraitHandler; 5 | import dev.aurelium.auraskills.api.user.SkillsUser; 6 | import org.bukkit.entity.Player; 7 | 8 | public interface BukkitTraitHandler extends TraitHandler { 9 | 10 | double getBaseLevel(Player player, Trait trait); 11 | 12 | void onReload(Player player, SkillsUser user, Trait trait); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/storage/sql/migration/Migrations.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.storage.sql.migration; 2 | 3 | import java.util.Locale; 4 | 5 | public enum Migrations { 6 | 7 | V1__MODIFIERS_TABLE, 8 | V2__LAST_UPDATED_COL; 9 | 10 | // Excluding .sql 11 | private final String fileName; 12 | 13 | Migrations() { 14 | this.fileName = this.name().toLowerCase(Locale.ROOT); 15 | } 16 | 17 | public String getFileName() { 18 | return fileName; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/hooks/EconomyHook.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.hooks; 2 | 3 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 4 | import dev.aurelium.auraskills.common.user.User; 5 | import org.spongepowered.configurate.ConfigurationNode; 6 | 7 | public abstract class EconomyHook extends Hook { 8 | 9 | public EconomyHook(AuraSkillsPlugin plugin, ConfigurationNode config) { 10 | super(plugin, config); 11 | } 12 | 13 | public abstract void deposit(User user, double amount); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/source/type/AnvilXpSource.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.source.type; 2 | 3 | import dev.aurelium.auraskills.api.item.ItemFilter; 4 | import dev.aurelium.auraskills.api.source.XpSource; 5 | import org.jetbrains.annotations.NotNull; 6 | import org.jetbrains.annotations.Nullable; 7 | 8 | public interface AnvilXpSource extends XpSource { 9 | 10 | @NotNull 11 | ItemFilter getLeftItem(); 12 | 13 | @NotNull 14 | ItemFilter getRightItem(); 15 | 16 | @Nullable 17 | String getMultiplier(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/message/recipient/UserRecipient.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.message.recipient; 2 | 3 | import dev.aurelium.auraskills.common.user.User; 4 | import net.kyori.adventure.text.Component; 5 | 6 | public class UserRecipient implements Recipient { 7 | 8 | private final User user; 9 | 10 | public UserRecipient(User user) { 11 | this.user = user; 12 | } 13 | 14 | @Override 15 | public void sendMessage(Component component) { 16 | user.sendMessage(component); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/menu/ContextParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.menu; 2 | 3 | @FunctionalInterface 4 | public interface ContextParser { 5 | 6 | /** 7 | * Parses a context type from the menu name and input string. 8 | * 9 | * @param menuName the name of the menu as registered in the plugin 10 | * @param input the input string, which is usually the name of a map under the contexts map of a template 11 | * @return the parsed context type 12 | */ 13 | T parse(String menuName, String input); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/hooks/PlaceholderHook.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.hooks; 2 | 3 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 4 | import dev.aurelium.auraskills.common.user.User; 5 | import org.spongepowered.configurate.ConfigurationNode; 6 | 7 | public abstract class PlaceholderHook extends Hook { 8 | 9 | public PlaceholderHook(AuraSkillsPlugin plugin, ConfigurationNode config) { 10 | super(plugin, config); 11 | } 12 | 13 | public abstract String setPlaceholders(User user, String message); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/item/ItemFilterMeta.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.item; 2 | 3 | import org.jetbrains.annotations.Nullable; 4 | 5 | import java.util.List; 6 | 7 | public interface ItemFilterMeta { 8 | 9 | @Nullable 10 | String displayName(); 11 | 12 | @Nullable 13 | List lore(); 14 | 15 | @Nullable 16 | PotionData potionData(); 17 | 18 | boolean hasCustomModelData(); 19 | 20 | // Returns Integer.MIN_VALUE if not defined 21 | int customModelData(); 22 | 23 | boolean ignoreCustomModelData(); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/storage/BukkitStorageFactory.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.storage; 2 | 3 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 4 | import dev.aurelium.auraskills.common.storage.StorageFactory; 5 | 6 | public class BukkitStorageFactory extends StorageFactory { 7 | 8 | public BukkitStorageFactory(AuraSkillsPlugin plugin) { 9 | super(plugin); 10 | } 11 | 12 | @Override 13 | public String getDataDirectory() { 14 | return plugin.getPluginFolder().getPath() + "/userdata"; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/modifier/TemporaryModifier.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.modifier; 2 | 3 | import dev.aurelium.auraskills.api.util.AuraSkillsModifier; 4 | import org.jetbrains.annotations.NotNull; 5 | 6 | public record TemporaryModifier( 7 | AuraSkillsModifier modifier, 8 | long expirationTime 9 | ) implements Comparable { 10 | 11 | @Override 12 | public int compareTo(@NotNull TemporaryModifier other) { 13 | return Long.compare(this.expirationTime, other.expirationTime); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/leaderboard/LeaderboardSorter.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.leaderboard; 2 | 3 | import java.util.Comparator; 4 | 5 | public class LeaderboardSorter implements Comparator { 6 | 7 | @Override 8 | public int compare(SkillValue a, SkillValue b) { 9 | int levelA = a.level(); 10 | int levelB = b.level(); 11 | if (levelA != levelB) { 12 | return levelB - levelA; 13 | } else { 14 | return (int) (b.xp() * 100) - (int) (a.xp() * 100); 15 | } 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/util/data/KeyIntPair.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.util.data; 2 | 3 | public class KeyIntPair { 4 | 5 | private final String key; 6 | private int value; 7 | 8 | public KeyIntPair(String key, int value) { 9 | this.key = key; 10 | this.value = value; 11 | } 12 | 13 | public String getKey() { 14 | return key; 15 | } 16 | 17 | public int getValue() { 18 | return value; 19 | } 20 | 21 | public void setValue(int value) { 22 | this.value = value; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # User-specific stuff 2 | .idea/ 3 | 4 | *.iml 5 | *.ipr 6 | *.iws 7 | 8 | # IntelliJ 9 | out/ 10 | 11 | # Compiled class file 12 | *.class 13 | 14 | # Package Files # 15 | *.jar 16 | !gradle/wrapper/gradle-wrapper.jar 17 | 18 | target/ 19 | 20 | .gradle/ 21 | build/ 22 | 23 | pom.xml.tag 24 | pom.xml.releaseBackup 25 | pom.xml.versionsBackup 26 | pom.xml.next 27 | 28 | release.properties 29 | dependency-reduced-pom.xml 30 | buildNumber.properties 31 | .mvn/timing.properties 32 | .mvn/wrapper/maven-wrapper.jar 33 | .flattened-pom.xml 34 | 35 | build.xml 36 | 37 | bukkit/run/ 38 | 39 | htmlReport/ 40 | -------------------------------------------------------------------------------- /crowdin.yml: -------------------------------------------------------------------------------- 1 | commit_message: "Crowdin: Update %language% messages [ci skip]" 2 | append_commit_message: false 3 | preserve_hierarchy: true 4 | export_languages: 5 | - cs 6 | - de 7 | - es-ES 8 | - fr 9 | - id 10 | - it 11 | - ja 12 | - ko 13 | - nl 14 | - pl 15 | - pt-BR 16 | - ru 17 | - uk 18 | - vi 19 | - zh-CN 20 | - zh-TW 21 | - tr 22 | - fi 23 | - th 24 | files: 25 | - source: /common/src/main/resources/messages/messages_en.yml 26 | translation: /common/src/main/resources/messages/messages_%two_letters_code%.yml 27 | dest: /%file_name%.yml 28 | skip_untranslated_strings: true -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/message/type/ActionBarMessage.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.message.type; 2 | 3 | import dev.aurelium.auraskills.common.message.MessageKey; 4 | 5 | import java.util.Locale; 6 | 7 | public enum ActionBarMessage implements MessageKey { 8 | 9 | IDLE, 10 | XP, 11 | MAXED, 12 | ABILITY, 13 | BOSS_BAR_XP, 14 | BOSS_BAR_MAXED, 15 | BOSS_BAR_INCOME, 16 | BOSS_BAR_INCOME_MAXED; 17 | 18 | @Override 19 | public String getPath() { 20 | return "action_bar." + this.toString().toLowerCase(Locale.ROOT); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/util/EnchantmentValue.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.util; 2 | 3 | import org.bukkit.enchantments.Enchantment; 4 | 5 | public class EnchantmentValue { 6 | 7 | private final Enchantment enchantment; 8 | private final int level; 9 | 10 | public EnchantmentValue(Enchantment enchantment, int level) { 11 | this.enchantment = enchantment; 12 | this.level = level; 13 | } 14 | 15 | public Enchantment getEnchantment() { 16 | return enchantment; 17 | } 18 | 19 | public int getLevel() { 20 | return level; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/scheduler/SubmittedTask.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.scheduler; 2 | 3 | import java.util.concurrent.Future; 4 | 5 | public class SubmittedTask implements Task { 6 | 7 | private final Future future; 8 | 9 | public SubmittedTask(final Future future) { 10 | this.future = future; 11 | } 12 | 13 | @Override 14 | public TaskStatus getStatus() { 15 | return future.isDone() ? TaskStatus.STOPPED : TaskStatus.RUNNING; 16 | } 17 | 18 | @Override 19 | public void cancel() { 20 | future.cancel(false); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/loot/type/EntityLoot.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.loot.type; 2 | 3 | import dev.aurelium.auraskills.api.loot.Loot; 4 | import dev.aurelium.auraskills.api.loot.LootValues; 5 | import dev.aurelium.auraskills.bukkit.loot.entity.EntitySupplier; 6 | 7 | public class EntityLoot extends Loot { 8 | 9 | private final EntitySupplier entity; 10 | 11 | public EntityLoot(LootValues values, EntitySupplier entity) { 12 | super(values); 13 | this.entity = entity; 14 | } 15 | 16 | public EntitySupplier getEntity() { 17 | return entity; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/message/type/LevelerMessage.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.message.type; 2 | 3 | import dev.aurelium.auraskills.common.message.MessageKey; 4 | 5 | import java.util.Locale; 6 | 7 | public enum LevelerMessage implements MessageKey { 8 | 9 | LEVEL_UP, 10 | SKILL_LEVEL_UP, 11 | REWARDS, 12 | ABILITY_UNLOCK, 13 | ABILITY_LEVEL_UP, 14 | MANA_ABILITY_UNLOCK, 15 | MANA_ABILITY_LEVEL_UP, 16 | UNCLAIMED_ITEM; 17 | 18 | @Override 19 | public String getPath() { 20 | return "leveler." + this.toString().toLowerCase(Locale.ROOT); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /api/src/test/java/dev/aurelium/auraskills/api/registry/NamespacedIdTest.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.registry; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | public class NamespacedIdTest { 6 | 7 | @Test 8 | void testFromString() { 9 | assert NamespacedId.of("namespace", "key").toString().equals("namespace/key"); 10 | assert NamespacedId.fromString("namespace/key").toString().equals("namespace/key"); 11 | assert NamespacedId.fromDefault("namespace/key").toString().equals("namespace/key"); 12 | assert NamespacedId.fromDefault("key").toString().equals(NamespacedId.AURASKILLS + "/key"); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/util/math/BigNumber.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.util.math; 2 | 3 | public class BigNumber { 4 | 5 | public static String withSuffix(long count) { 6 | if (count < 1000) return "" + count; 7 | int exp = (int) (Math.log(count) / Math.log(1000)); 8 | double val = count / Math.pow(1000, exp); 9 | if (val == (long) val) { // Format as an integer 10 | return String.format("%d%c", (long) val, "KMBTQU".charAt(exp - 1)); 11 | } else { 12 | return String.format("%.1f%c", val, "KMBTQU".charAt(exp - 1)); 13 | } 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/event/EventHandler.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.event; 2 | 3 | import dev.aurelium.auraskills.api.skill.Skill; 4 | import dev.aurelium.auraskills.api.source.XpSource; 5 | import dev.aurelium.auraskills.common.user.User; 6 | import dev.aurelium.auraskills.common.util.data.Pair; 7 | import org.jetbrains.annotations.Nullable; 8 | 9 | public interface EventHandler { 10 | 11 | void callUserLoadEvent(User user); 12 | 13 | void callSkillLevelUpEvent(User user, Skill skill, int level); 14 | 15 | Pair callXpGainEvent(User user, Skill skill, @Nullable XpSource source, double amount); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/requirement/RequirementNode.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.requirement; 2 | 3 | import dev.aurelium.auraskills.bukkit.AuraSkills; 4 | import org.bukkit.entity.Player; 5 | 6 | public abstract class RequirementNode { 7 | 8 | protected AuraSkills plugin; 9 | protected String denyMessage; 10 | 11 | public RequirementNode(AuraSkills plugin, String denyMessage) { 12 | this.plugin = plugin; 13 | this.denyMessage = denyMessage; 14 | } 15 | 16 | public abstract boolean check(Player player); 17 | 18 | public String getDenyMessage() { 19 | return denyMessage; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/hooks/PermissionsHook.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.hooks; 2 | 3 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 4 | import dev.aurelium.auraskills.common.user.User; 5 | import org.spongepowered.configurate.ConfigurationNode; 6 | 7 | public abstract class PermissionsHook extends Hook { 8 | 9 | public PermissionsHook(AuraSkillsPlugin plugin, ConfigurationNode config) { 10 | super(plugin, config); 11 | } 12 | 13 | public abstract void setPermission(User user, String permission, boolean value); 14 | 15 | public abstract void unsetPermission(User user, String permission, boolean value); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/hooks/Hook.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.hooks; 2 | 3 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 4 | import org.spongepowered.configurate.ConfigurationNode; 5 | 6 | public abstract class Hook { 7 | 8 | protected final AuraSkillsPlugin plugin; 9 | private final ConfigurationNode config; 10 | 11 | public Hook(AuraSkillsPlugin plugin, ConfigurationNode config) { 12 | this.plugin = plugin; 13 | this.config = config; 14 | } 15 | 16 | public ConfigurationNode getConfig() { 17 | return config; 18 | } 19 | 20 | public abstract Class getTypeClass(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/api/implementation/BukkitApiProvider.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.api.implementation; 2 | 3 | import dev.aurelium.auraskills.api.loot.LootManager; 4 | import dev.aurelium.auraskills.bukkit.AuraSkills; 5 | import dev.aurelium.auraskills.common.api.implementation.ApiProvider; 6 | 7 | public class BukkitApiProvider implements ApiProvider { 8 | 9 | private final LootManager lootManager; 10 | 11 | public BukkitApiProvider(AuraSkills plugin) { 12 | this.lootManager = new ApiLootManager(plugin); 13 | } 14 | 15 | @Override 16 | public LootManager getLootManager() { 17 | return lootManager; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/message/type/LevelerFormat.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.message.type; 2 | 3 | import dev.aurelium.auraskills.common.message.MessageKey; 4 | 5 | import java.util.Locale; 6 | 7 | public enum LevelerFormat implements MessageKey { 8 | 9 | TITLE, 10 | SUBTITLE, 11 | CHAT, 12 | STAT_LEVEL, 13 | ABILITY_UNLOCK, 14 | ABILITY_LEVEL_UP, 15 | MANA_ABILITY_UNLOCK, 16 | MANA_ABILITY_LEVEL_UP, 17 | MONEY_REWARD, 18 | DESC_UPGRADE_VALUE, 19 | DESC_WRAP; 20 | 21 | @Override 22 | public String getPath() { 23 | return "leveler_format." + this.toString().toLowerCase(Locale.ROOT); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/skill/LoadedSkill.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.skill; 2 | 3 | import com.google.common.collect.ImmutableList; 4 | import dev.aurelium.auraskills.api.ability.Ability; 5 | import dev.aurelium.auraskills.api.mana.ManaAbility; 6 | import dev.aurelium.auraskills.api.skill.Skill; 7 | import dev.aurelium.auraskills.api.source.XpSource; 8 | import org.jetbrains.annotations.NotNull; 9 | import org.jetbrains.annotations.Nullable; 10 | 11 | public record LoadedSkill(Skill skill, @NotNull ImmutableList abilities, @Nullable ManaAbility manaAbility, 12 | @NotNull ImmutableList sources, @NotNull SkillOptions options) { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /wiki/server-requirements.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: List of requirements for using AuraSkills 3 | --- 4 | 5 | # Server Requirements 6 | 7 | AuraSkills requires the following server environment to run, as of version `2.3.7`: 8 | 9 | * Paper, Purpur, Folia, or Spigot server 10 | * Note: Spigot is not recommended. Paper is a drop-in replacement. 11 | * Minecraft 1.20 or newer (latest is always recommended) 12 | * Java 21 or newer 13 | 14 | You can view the most up-to-date list of supported Minecraft versions on [Modrinth](https://modrinth.com/plugin/auraskills/version/latest?loader=paper). 15 | 16 | Additionally, ensure your server and other plugins aren't in the list of [incompatibilities](incompatibilities.md). 17 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/stat/StatModifier.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.stat; 2 | 3 | import dev.aurelium.auraskills.api.util.AuraSkillsModifier; 4 | 5 | public class StatModifier extends AuraSkillsModifier { 6 | 7 | public static final String ITEM_PREFIX = "AuraSkills.Modifiers."; 8 | 9 | public StatModifier(String name, Stat stat, double value, Operation operation) { 10 | super(name, stat, value, operation); 11 | } 12 | 13 | @Deprecated 14 | public StatModifier(String name, Stat stat, double value) { 15 | this(name, stat, value, Operation.ADD); 16 | } 17 | 18 | public Stat stat() { 19 | return type; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/skill/SkillOptions.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.skill; 2 | 3 | import dev.aurelium.auraskills.common.util.data.OptionProvider; 4 | 5 | import java.util.Map; 6 | 7 | public class SkillOptions extends OptionProvider { 8 | 9 | public SkillOptions(Map optionMap) { 10 | super(optionMap); 11 | } 12 | 13 | public boolean enabled() { 14 | return getBoolean("enabled"); 15 | } 16 | 17 | public int maxLevel() { 18 | return getInt("max_level"); 19 | } 20 | 21 | public boolean checkMultiplierPermissions() { 22 | return getBoolean("check_multiplier_permissions"); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/requirement/WorldNode.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.requirement; 2 | 3 | import dev.aurelium.auraskills.bukkit.AuraSkills; 4 | import org.bukkit.entity.Player; 5 | 6 | public class WorldNode extends RequirementNode { 7 | 8 | private final String world; 9 | 10 | public WorldNode(AuraSkills plugin, String world, String message) { 11 | super(plugin, message); 12 | this.world = world; 13 | } 14 | 15 | @Override 16 | public boolean check(Player player) { 17 | if (!player.getWorld().getName().equalsIgnoreCase(world)) { 18 | return false; 19 | } 20 | 21 | return true; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/api/implementation/ApiHandlers.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.api.implementation; 2 | 3 | import dev.aurelium.auraskills.api.registry.Handlers; 4 | import dev.aurelium.auraskills.api.trait.TraitHandler; 5 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 6 | 7 | public class ApiHandlers implements Handlers { 8 | 9 | private final AuraSkillsPlugin plugin; 10 | 11 | public ApiHandlers(AuraSkillsPlugin plugin) { 12 | this.plugin = plugin; 13 | } 14 | 15 | @Override 16 | public void registerTraitHandler(TraitHandler traitHandler) { 17 | plugin.getTraitManager().registerTraitHandler(traitHandler); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/util/text/Replacer.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.util.text; 2 | 3 | import java.util.Map; 4 | import java.util.concurrent.ConcurrentHashMap; 5 | import java.util.function.Supplier; 6 | 7 | public class Replacer { 8 | 9 | private final Map> replacements; 10 | 11 | public Replacer() { 12 | this.replacements = new ConcurrentHashMap<>(); 13 | } 14 | 15 | public Replacer map(String from, Supplier to) { 16 | replacements.put(from, to); 17 | return this; 18 | } 19 | 20 | public Map> getReplacements() { 21 | return replacements; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /.github/workflows/checkstyle.yml: -------------------------------------------------------------------------------- 1 | name: Run checkstyle 2 | on: 3 | pull_request: 4 | permissions: 5 | contents: read 6 | jobs: 7 | checkstyle: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 11 | - name: Set up JDK 21 12 | uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e 13 | with: 14 | java-version: "21" 15 | distribution: temurin 16 | - name: Set up Gradle 17 | uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 18 | with: 19 | gradle-version: "8.10.2" 20 | - name: Run checkstyle 21 | run: ./gradlew checkstyleMain checkstyleTest 22 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/menus/contexts/SortTypeContext.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.menus.contexts; 2 | 3 | import dev.aurelium.auraskills.bukkit.menus.SourcesMenu.SortType; 4 | import dev.aurelium.slate.context.ContextProvider; 5 | import org.jetbrains.annotations.Nullable; 6 | 7 | import java.util.Locale; 8 | 9 | public class SortTypeContext implements ContextProvider { 10 | 11 | @Override 12 | public Class getType() { 13 | return SortType.class; 14 | } 15 | 16 | @Nullable 17 | @Override 18 | public SortType parse(String menuName, String s) { 19 | return SortType.valueOf(s.toUpperCase(Locale.ROOT)); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/trait/TraitModifier.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.trait; 2 | 3 | import dev.aurelium.auraskills.api.util.AuraSkillsModifier; 4 | 5 | public class TraitModifier extends AuraSkillsModifier { 6 | 7 | public static final String ITEM_PREFIX = "AuraSkills.TraitModifiers."; 8 | 9 | public TraitModifier(String name, Trait trait, double value, Operation operation) { 10 | super(name, trait, value, operation); 11 | } 12 | 13 | @Deprecated 14 | public TraitModifier(String name, Trait trait, double value) { 15 | this(name, trait, value, Operation.ADD); 16 | } 17 | 18 | public Trait trait() { 19 | return type; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/antiafk/IdentityHandler.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.antiafk; 2 | 3 | public record IdentityHandler(int minCount, String idKey) { 4 | 5 | public boolean failsCheck(CheckData data, Object currentVal) { 6 | Object previous = data.getCache(idKey, Object.class, null); 7 | if (currentVal == null) return false; 8 | 9 | data.setCache(idKey, currentVal); 10 | 11 | if (previous == null) return false; 12 | 13 | if (previous.equals(currentVal)) { 14 | data.incrementCount(); 15 | } else { 16 | data.resetCount(); 17 | } 18 | 19 | return data.getCount() >= minCount; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/option/Optioned.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.option; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | public interface Optioned { 7 | 8 | boolean optionBoolean(String key); 9 | 10 | boolean optionBoolean(String key, boolean def); 11 | 12 | int optionInt(String key); 13 | 14 | int optionInt(String key, int def); 15 | 16 | double optionDouble(String key); 17 | 18 | double optionDouble(String key, double def); 19 | 20 | String optionString(String key); 21 | 22 | String optionString(String key, String def); 23 | 24 | List optionStringList(String key); 25 | 26 | Map optionMap(String key); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/reward/builder/RewardBuilder.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.reward.builder; 2 | 3 | import dev.aurelium.auraskills.api.skill.Skill; 4 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 5 | import dev.aurelium.auraskills.common.reward.SkillReward; 6 | 7 | public abstract class RewardBuilder { 8 | 9 | protected final AuraSkillsPlugin plugin; 10 | protected Skill skill; 11 | 12 | public RewardBuilder(AuraSkillsPlugin plugin) { 13 | this.plugin = plugin; 14 | } 15 | 16 | public RewardBuilder skill(Skill skill) { 17 | this.skill = skill; 18 | return this; 19 | } 20 | 21 | public abstract SkillReward build(); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/requirement/BiomeNode.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.requirement; 2 | 3 | import dev.aurelium.auraskills.bukkit.AuraSkills; 4 | import org.bukkit.entity.Player; 5 | 6 | public class BiomeNode extends RequirementNode { 7 | 8 | private final String biome; 9 | 10 | public BiomeNode(AuraSkills plugin, String biome, String message) { 11 | super(plugin, message); 12 | this.biome = biome; 13 | } 14 | 15 | @Override 16 | public boolean check(Player player) { 17 | if (!player.getLocation().getBlock().getBiome().toString().equalsIgnoreCase(biome)) { 18 | return false; 19 | } 20 | 21 | return true; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/requirement/PermissionNode.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.requirement; 2 | 3 | import dev.aurelium.auraskills.bukkit.AuraSkills; 4 | import org.bukkit.entity.Player; 5 | 6 | public class PermissionNode extends RequirementNode { 7 | 8 | private final String permission; 9 | 10 | public PermissionNode(AuraSkills plugin, String permission, String message) { 11 | super(plugin, message); 12 | this.permission = permission; 13 | } 14 | 15 | @Override 16 | public boolean check(Player player) { 17 | if (permission == null) { 18 | return true; 19 | } 20 | 21 | return player.hasPermission(permission); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/income/FixedIncome.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.income; 2 | 3 | import dev.aurelium.auraskills.api.skill.Skill; 4 | import dev.aurelium.auraskills.api.source.SourceIncome; 5 | import dev.aurelium.auraskills.api.source.SourceValues; 6 | import dev.aurelium.auraskills.api.user.SkillsUser; 7 | 8 | public class FixedIncome implements SourceIncome { 9 | 10 | private final double income; 11 | 12 | public FixedIncome(double income) { 13 | this.income = income; 14 | } 15 | 16 | @Override 17 | public double getIncomeEarned(SkillsUser user, SourceValues sourceValues, Skill skill, double finalXp) { 18 | return income; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/skill/Multiplier.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.skill; 2 | 3 | public class Multiplier { 4 | 5 | private final String name; 6 | private final Skill skill; 7 | private final double value; 8 | 9 | public Multiplier(String name, Skill skill, double value) { 10 | this.name = name; 11 | this.skill = skill; 12 | this.value = value; 13 | } 14 | 15 | public String name() { 16 | return name; 17 | } 18 | 19 | public Skill skill() { 20 | return skill; 21 | } 22 | 23 | public double value() { 24 | return value; 25 | } 26 | 27 | public boolean isGlobal() { 28 | return skill == null; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/source/SourceIncome.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.source; 2 | 3 | import dev.aurelium.auraskills.api.skill.Skill; 4 | import dev.aurelium.auraskills.api.user.SkillsUser; 5 | 6 | public interface SourceIncome { 7 | 8 | /** 9 | * Gets the money income earned from gaining the XP source. 10 | * 11 | * @param user the user gaining XP 12 | * @param sourceValues the source value data 13 | * @param skill the skill the user is gaining XP in 14 | * @param finalXp the final XP gained by the user after multipliers 15 | * @return the income earned 16 | */ 17 | double getIncomeEarned(SkillsUser user, SourceValues sourceValues, Skill skill, double finalXp); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/requirement/StatNode.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.requirement; 2 | 3 | import dev.aurelium.auraskills.api.stat.Stat; 4 | import dev.aurelium.auraskills.bukkit.AuraSkills; 5 | import org.bukkit.entity.Player; 6 | 7 | public class StatNode extends RequirementNode { 8 | 9 | private final Stat stat; 10 | private final int value; 11 | 12 | public StatNode(AuraSkills plugin, Stat stat, int value, String message) { 13 | super(plugin, message); 14 | this.stat = stat; 15 | this.value = value; 16 | } 17 | 18 | @Override 19 | public boolean check(Player player) { 20 | return plugin.getUser(player).getStatLevel(stat) >= value; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/requirement/SkillNode.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.requirement; 2 | 3 | import dev.aurelium.auraskills.api.skill.Skill; 4 | import dev.aurelium.auraskills.bukkit.AuraSkills; 5 | import org.bukkit.entity.Player; 6 | 7 | public class SkillNode extends RequirementNode { 8 | 9 | private final Skill skill; 10 | private final int level; 11 | 12 | public SkillNode(AuraSkills plugin, Skill skill, int level, String message) { 13 | super(plugin, message); 14 | this.skill = skill; 15 | this.level = level; 16 | } 17 | 18 | @Override 19 | public boolean check(Player player) { 20 | return plugin.getUser(player).getSkillLevel(skill) >= level; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/loot/entity/EntitySupplier.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.loot.entity; 2 | 3 | import dev.aurelium.auraskills.bukkit.AuraSkills; 4 | import org.bukkit.Location; 5 | import org.bukkit.entity.Entity; 6 | 7 | public abstract class EntitySupplier { 8 | 9 | private final EntityProperties entityProperties; 10 | 11 | public EntitySupplier(EntityProperties entityProperties) { 12 | this.entityProperties = entityProperties; 13 | } 14 | 15 | public abstract Entity spawnEntity(AuraSkills plugin, Location location); 16 | 17 | public abstract void removeEntity(Entity entity); 18 | 19 | public EntityProperties getEntityProperties() { 20 | return entityProperties; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/type/JumpingSource.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.type; 2 | 3 | import dev.aurelium.auraskills.api.source.SourceValues; 4 | import dev.aurelium.auraskills.api.source.type.JumpingXpSource; 5 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 6 | import dev.aurelium.auraskills.common.source.Source; 7 | 8 | public class JumpingSource extends Source implements JumpingXpSource { 9 | 10 | private final int interval; 11 | 12 | public JumpingSource(AuraSkillsPlugin plugin, SourceValues values, int interval) { 13 | super(plugin, values); 14 | this.interval = interval; 15 | } 16 | 17 | @Override 18 | public int getInterval() { 19 | return interval; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /common/src/test/java/dev/aurelium/auraskills/common/lib/PluralTest.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.lib; 2 | 3 | import org.atteo.evo.inflector.English; 4 | import org.junit.jupiter.api.Test; 5 | 6 | public class PluralTest { 7 | 8 | @Test 9 | void testPlural() { 10 | assert English.plural("mana_ability").equals("mana_abilities"); 11 | assert English.plural("state").equals("states"); 12 | assert English.plural("cause").equals("causes"); 13 | assert English.plural("excluded_cause").equals("excluded_causes"); 14 | assert English.plural("damager").equals("damagers"); 15 | assert English.plural("excluded_material").equals("excluded_materials"); 16 | assert English.plural("trigger").equals("triggers"); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/api/implementation/ApiRegions.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.api.implementation; 2 | 3 | import dev.aurelium.auraskills.api.region.Regions; 4 | import dev.aurelium.auraskills.bukkit.AuraSkills; 5 | import org.bukkit.block.Block; 6 | 7 | public class ApiRegions implements Regions { 8 | 9 | private final AuraSkills plugin; 10 | 11 | public ApiRegions(AuraSkills plugin) { 12 | this.plugin = plugin; 13 | } 14 | 15 | @Override 16 | public boolean isPlacedBlock(Block block) { 17 | return plugin.getRegionManager().isPlacedBlock(block); 18 | } 19 | 20 | @Override 21 | public void addPlacedBlock(Block block) { 22 | plugin.getRegionManager().addPlacedBlock(block); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/reward/builder/MessagedRewardBuilder.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.reward.builder; 2 | 3 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 4 | 5 | public abstract class MessagedRewardBuilder extends RewardBuilder { 6 | 7 | protected String menuMessage; 8 | protected String chatMessage; 9 | 10 | public MessagedRewardBuilder(AuraSkillsPlugin plugin) { 11 | super(plugin); 12 | } 13 | 14 | public MessagedRewardBuilder menuMessage(String menuMessage) { 15 | this.menuMessage = menuMessage; 16 | return this; 17 | } 18 | 19 | public MessagedRewardBuilder chatMessage(String chatMessage) { 20 | this.chatMessage = chatMessage; 21 | return this; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/region/Regions.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.region; 2 | 3 | import org.bukkit.block.Block; 4 | 5 | public interface Regions { 6 | 7 | /** 8 | * Gets whether the block was placed by a player as tracked by the region manager. 9 | * Placed blocks will not give XP in most cases. 10 | * 11 | * @param block the block to check 12 | * @return whether the block is player-placed 13 | */ 14 | boolean isPlacedBlock(Block block); 15 | 16 | /** 17 | * Marks the block as being player-placed in the region manager. 18 | * Placed blocks will not give XP in most cases. 19 | * 20 | * @param block the block to mark as player-placed 21 | */ 22 | void addPlacedBlock(Block block); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/item/ItemRegistryMenuProvider.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.item; 2 | 3 | import dev.aurelium.auraskills.api.registry.NamespacedId; 4 | import dev.aurelium.slate.item.provider.KeyedItemProvider; 5 | import org.bukkit.inventory.ItemStack; 6 | import org.jetbrains.annotations.Nullable; 7 | 8 | public class ItemRegistryMenuProvider implements KeyedItemProvider { 9 | 10 | private final BukkitItemRegistry itemRegistry; 11 | 12 | public ItemRegistryMenuProvider(BukkitItemRegistry itemRegistry) { 13 | this.itemRegistry = itemRegistry; 14 | } 15 | 16 | @Override 17 | public @Nullable ItemStack getItem(String key) { 18 | return itemRegistry.getItem(NamespacedId.fromDefaultWithColon(key)); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/skill/XpRequirements.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.skill; 2 | 3 | public interface XpRequirements { 4 | 5 | /** 6 | * Gets the amount of xp required to reach the specified level. Skill specific xp requirements 7 | * are used if they exist. 8 | * 9 | * @param skill Skill to get xp required for 10 | * @param level Level to get xp required for 11 | * @return The amount of xp required 12 | */ 13 | int getXpRequired(Skill skill, int level); 14 | 15 | /** 16 | * Gets the default amount of xp required to reach the specified level 17 | * 18 | * @param level Level to get xp required for 19 | * @return The amount of xp required 20 | */ 21 | int getDefaultXpRequired(int level); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_suggestion.yml: -------------------------------------------------------------------------------- 1 | name: Feature Request 2 | description: Suggest a feature or enhancement 3 | labels: ["feature"] 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | Thank you for sharing your ideas. Please note that feature requests are not guaranteed to be added. 9 | - type: textarea 10 | id: description 11 | attributes: 12 | label: Feature description 13 | description: A clear and detailed description of what the feature is and its use case. 14 | validations: 15 | required: true 16 | - type: textarea 17 | id: additional-context 18 | attributes: 19 | label: Additional context 20 | description: Add any other context or screenshots about the feature request here. 21 | validations: 22 | required: false -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/source/type/BrewingXpSource.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.source.type; 2 | 3 | import dev.aurelium.auraskills.api.item.ItemFilter; 4 | import dev.aurelium.auraskills.api.source.XpSource; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | public interface BrewingXpSource extends XpSource { 8 | 9 | /** 10 | * Gets the valid ingredients of the source. 11 | * 12 | * @return The ingredients 13 | */ 14 | @NotNull 15 | ItemFilter getIngredients(); 16 | 17 | /** 18 | * Gets an array of triggers of the source. 19 | * 20 | * @return The triggers 21 | */ 22 | @NotNull 23 | BrewTriggers getTrigger(); 24 | 25 | enum BrewTriggers { 26 | 27 | BREW, 28 | TAKEOUT 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/reward/parser/RewardParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.reward.parser; 2 | 3 | import dev.aurelium.auraskills.api.skill.Skill; 4 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 5 | import dev.aurelium.auraskills.common.reward.SkillReward; 6 | import org.jetbrains.annotations.Nullable; 7 | import org.spongepowered.configurate.ConfigurationNode; 8 | 9 | public abstract class RewardParser { 10 | 11 | protected final AuraSkillsPlugin plugin; 12 | protected final Skill skill; 13 | 14 | public RewardParser(AuraSkillsPlugin plugin, Skill skill) { 15 | this.plugin = plugin; 16 | this.skill = skill; 17 | } 18 | 19 | @Nullable 20 | public abstract SkillReward parse(ConfigurationNode config); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/loot/LootManager.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.loot; 2 | 3 | import dev.aurelium.auraskills.api.registry.NamespacedId; 4 | import org.jetbrains.annotations.Nullable; 5 | 6 | public interface LootManager { 7 | 8 | /** 9 | * Gets a loot table from a given name. 10 | * 11 | * @param id the {@link NamespacedId} of the loot table 12 | * @return the loot table 13 | */ 14 | @Nullable 15 | LootTable getLootTable(NamespacedId id); 16 | 17 | /** 18 | * Registers a new loot type with a given name and parser. 19 | * 20 | * @param name the name used in the loot file as the value of the type field 21 | * @param parser the parser 22 | */ 23 | void registerLootType(String name, LootParser parser); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/requirement/ExcludedWorldNode.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.requirement; 2 | 3 | import dev.aurelium.auraskills.bukkit.AuraSkills; 4 | import org.bukkit.entity.Player; 5 | 6 | public class ExcludedWorldNode extends RequirementNode { 7 | 8 | private final String[] worlds; 9 | 10 | public ExcludedWorldNode(AuraSkills plugin, String[] worlds, String message) { 11 | super(plugin, message); 12 | this.worlds = worlds; 13 | } 14 | 15 | @Override 16 | public boolean check(Player player) { 17 | for (String world : worlds) { 18 | if (player.getWorld().getName().equalsIgnoreCase(world)) { 19 | return false; 20 | } 21 | } 22 | return true; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/trait/TraitHandler.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.trait; 2 | 3 | import dev.aurelium.auraskills.api.util.NumberUtil; 4 | 5 | import java.util.Locale; 6 | 7 | public interface TraitHandler { 8 | 9 | Trait[] getTraits(); 10 | 11 | default String getMenuDisplay(double value, Trait trait, Locale locale) { 12 | return NumberUtil.format1(value); 13 | } 14 | 15 | /** 16 | * Whether the value of {@link #getMenuDisplay(double, Trait, Locale)} has the same numerical value as the 17 | * actual trait level (ignoring any extra formatting like percent signs). 18 | * 19 | * @return whether the display value matches the trait value 20 | */ 21 | default boolean displayMatchesValue() { 22 | return true; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/type/GrindstoneSource.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.type; 2 | 3 | import dev.aurelium.auraskills.api.source.SourceValues; 4 | import dev.aurelium.auraskills.api.source.type.GrindstoneXpSource; 5 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 6 | import dev.aurelium.auraskills.common.source.Source; 7 | 8 | public class GrindstoneSource extends Source implements GrindstoneXpSource { 9 | 10 | private final String multiplier; 11 | 12 | public GrindstoneSource(AuraSkillsPlugin plugin, SourceValues values, String multiplier) { 13 | super(plugin, values); 14 | this.multiplier = multiplier; 15 | } 16 | 17 | @Override 18 | public String getMultiplier() { 19 | return multiplier; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/event/item/ItemEnableEvent.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.event.item; 2 | 3 | import dev.aurelium.auraskills.api.item.ModifierType; 4 | import dev.aurelium.auraskills.api.stat.ReloadableIdentifier; 5 | import dev.aurelium.auraskills.api.user.SkillsUser; 6 | import org.bukkit.entity.Player; 7 | import org.bukkit.inventory.EquipmentSlot; 8 | import org.bukkit.inventory.ItemStack; 9 | import org.jetbrains.annotations.NotNull; 10 | 11 | import java.util.Set; 12 | 13 | public class ItemEnableEvent extends ItemToggleEvent { 14 | 15 | public ItemEnableEvent(Player player, SkillsUser user, ItemStack item, ModifierType type, @NotNull EquipmentSlot slot, Set toReload) { 16 | super(player, user, item, type, slot, toReload); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/source/SourceType.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.source; 2 | 3 | import dev.aurelium.auraskills.api.registry.NamespacedId; 4 | 5 | public interface SourceType { 6 | 7 | /** 8 | * Gets the {@link NamespacedId} identifying the source type. 9 | * 10 | * @return the id 11 | */ 12 | NamespacedId getId(); 13 | 14 | /** 15 | * Gets the parser used to deserialize sources from configuration. 16 | * 17 | * @return the parser 18 | */ 19 | XpSourceParser getParser(); 20 | 21 | /** 22 | * Gets whether at least one instance of the source type is defined and loaded from 23 | * the plugin's configuration. 24 | * 25 | * @return whether the source is enabled 26 | */ 27 | boolean isEnabled(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/menus/util/SlateMenuHelper.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.menus.util; 2 | 3 | import dev.aurelium.auraskills.common.menu.MenuHelper; 4 | import dev.aurelium.slate.Slate; 5 | import dev.aurelium.slate.menu.LoadedMenu; 6 | 7 | public class SlateMenuHelper implements MenuHelper { 8 | 9 | private final Slate slate; 10 | 11 | public SlateMenuHelper(Slate slate) { 12 | this.slate = slate; 13 | } 14 | 15 | @Override 16 | public String getFormat(String menuName, String formatName) { 17 | LoadedMenu menu = slate.getLoadedMenu(menuName); 18 | if (menu != null) { 19 | return menu.formats().getOrDefault(formatName, formatName); 20 | } else { 21 | return formatName; 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/loot/ContextProvider.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.loot; 2 | 3 | import dev.aurelium.auraskills.api.loot.LootContext; 4 | import org.jetbrains.annotations.Nullable; 5 | import org.spongepowered.configurate.ConfigurationNode; 6 | import org.spongepowered.configurate.serialize.SerializationException; 7 | 8 | import java.util.Set; 9 | 10 | public abstract class ContextProvider { 11 | 12 | private final String contextKey; 13 | 14 | public ContextProvider(String contextKey) { 15 | this.contextKey = contextKey; 16 | } 17 | 18 | public String getContextKey() { 19 | return contextKey; 20 | } 21 | 22 | @Nullable 23 | public abstract Set parseContext(ConfigurationNode config) throws SerializationException; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/event/item/ItemDisableEvent.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.event.item; 2 | 3 | import dev.aurelium.auraskills.api.item.ModifierType; 4 | import dev.aurelium.auraskills.api.stat.ReloadableIdentifier; 5 | import dev.aurelium.auraskills.api.user.SkillsUser; 6 | import org.bukkit.entity.Player; 7 | import org.bukkit.inventory.EquipmentSlot; 8 | import org.bukkit.inventory.ItemStack; 9 | import org.jetbrains.annotations.NotNull; 10 | 11 | import java.util.Set; 12 | 13 | public class ItemDisableEvent extends ItemToggleEvent { 14 | 15 | public ItemDisableEvent(Player player, SkillsUser user, ItemStack item, ModifierType type, @NotNull EquipmentSlot slot, Set toReload) { 16 | super(player, user, item, type, slot, toReload); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/option/OptionedProvider.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.option; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | public interface OptionedProvider { 7 | 8 | boolean optionBoolean(T type, String key); 9 | 10 | boolean optionBoolean(T type, String key, boolean def); 11 | 12 | int optionInt(T type, String key); 13 | 14 | int optionInt(T type, String key, int def); 15 | 16 | double optionDouble(T type, String key); 17 | 18 | double optionDouble(T type, String key, double def); 19 | 20 | String optionString(T type, String key); 21 | 22 | String optionString(T type, String key, String def); 23 | 24 | List optionStringList(T type, String key); 25 | 26 | Map optionMap(T type, String key); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/damage/DamageModifier.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.damage; 2 | 3 | public class DamageModifier { 4 | 5 | private final double value; 6 | private final Operation operation; 7 | 8 | public DamageModifier(double value, Operation operation) { 9 | this.operation = operation; 10 | this.value = value; 11 | } 12 | 13 | public double value() { 14 | return value; 15 | } 16 | 17 | public Operation operation() { 18 | return operation; 19 | } 20 | 21 | public static DamageModifier none() { 22 | return new DamageModifier(0.0, Operation.NONE); 23 | } 24 | 25 | public enum Operation { 26 | 27 | MULTIPLY, 28 | ADD_BASE, 29 | ADD_COMBINED, 30 | NONE 31 | 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/jobs/JobsBatchData.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.jobs; 2 | 3 | public class JobsBatchData { 4 | 5 | private long lastAddTime = System.currentTimeMillis(); 6 | private double accumulatedIncome = 0.0; 7 | 8 | public long getLastAddTime() { 9 | return lastAddTime; 10 | } 11 | 12 | public void setLastAddTime(long lastAddTime) { 13 | this.lastAddTime = lastAddTime; 14 | } 15 | 16 | public double getAccumulatedIncome() { 17 | return accumulatedIncome; 18 | } 19 | 20 | public void setAccumulatedIncome(double accumulatedIncome) { 21 | this.accumulatedIncome = accumulatedIncome; 22 | } 23 | 24 | public void addAccumulatedIncome(double amount) { 25 | this.accumulatedIncome += amount; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/stat/StatProvider.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.stat; 2 | 3 | import dev.aurelium.auraskills.api.option.OptionedProvider; 4 | import dev.aurelium.auraskills.api.trait.Trait; 5 | 6 | import java.util.List; 7 | import java.util.Locale; 8 | 9 | public interface StatProvider extends OptionedProvider { 10 | 11 | boolean isEnabled(Stat stat); 12 | 13 | List getTraits(Stat stat); 14 | 15 | double getTraitModifier(Stat stat, Trait trait); 16 | 17 | String getDisplayName(Stat stat, Locale locale, boolean formatted); 18 | 19 | String getDescription(Stat stat, Locale locale, boolean formatted); 20 | 21 | String getColor(Stat stat, Locale locale); 22 | 23 | String getColoredName(Stat stat, Locale locale); 24 | 25 | String getSymbol(Stat stat, Locale locale); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /bukkit/src/main/resources/menus/leaderboard.yml: -------------------------------------------------------------------------------- 1 | title: '{{leaderboard_title}}' 2 | size: 5 3 | fill: 4 | enabled: true 5 | material: black_stained_glass_pane 6 | items: 7 | back: 8 | material: arrow 9 | pos: 4,4 10 | display_name: '{{back}}' 11 | lore: 12 | - '{{back_click}}' 13 | templates: 14 | leaderboard_player: 15 | material: player_head 16 | contexts: 17 | 1: 18 | pos: 1,4 19 | 2: 20 | pos: 2,3 21 | 3: 22 | pos: 2,5 23 | 4: 24 | pos: 3,1 25 | 5: 26 | pos: 3,2 27 | 6: 28 | pos: 3,3 29 | 7: 30 | pos: 3,4 31 | 8: 32 | pos: 3,5 33 | 9: 34 | pos: 3,6 35 | 10: 36 | pos: 3,7 37 | display_name: '{place}. {player}' 38 | lore: 39 | - '{{level}}: {level}' -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/antiafk/HandlerFunctions.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.antiafk; 2 | 3 | import dev.aurelium.auraskills.common.ref.LocationRef; 4 | import dev.aurelium.auraskills.common.ref.PlayerRef; 5 | 6 | import static dev.aurelium.auraskills.bukkit.ref.BukkitLocationRef.unwrap; 7 | import static dev.aurelium.auraskills.bukkit.ref.BukkitPlayerRef.unwrap; 8 | 9 | public class HandlerFunctions { 10 | 11 | public static float getYaw(PlayerRef ref) { 12 | return unwrap(ref).getLocation().getYaw(); 13 | } 14 | 15 | public static float getPitch(PlayerRef ref) { 16 | return unwrap(ref).getLocation().getPitch(); 17 | } 18 | 19 | public static double distanceSquared(LocationRef ref1, LocationRef ref2) { 20 | return unwrap(ref1).distanceSquared(unwrap(ref2)); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /bukkit/src/test/resources/userdata/4954374f-e6c8-4c0d-b5fb-686cde397d8d.yml: -------------------------------------------------------------------------------- 1 | uuid: 4954374f-e6c8-4c0d-b5fb-686cde397d8d 2 | skills: 3 | # Used by LeaderboardManagerTest 4 | auraskills/mining: 5 | level: 5 6 | xp: 1.5 7 | auraskills/excavation: 8 | level: 0 9 | xp: 0.0 10 | auraskills/archery: 11 | level: 0 12 | xp: 0.0 13 | auraskills/enchanting: 14 | level: 0 15 | xp: 0.0 16 | auraskills/defense: 17 | level: 0 18 | xp: 0.0 19 | auraskills/foraging: 20 | level: 0 21 | xp: 0.0 22 | auraskills/fighting: 23 | level: 0 24 | xp: 0.0 25 | auraskills/farming: 26 | level: 0 27 | xp: 0.0 28 | auraskills/alchemy: 29 | level: 0 30 | xp: 0.0 31 | auraskills/fishing: 32 | level: 0 33 | xp: 0.0 34 | auraskills/agility: 35 | level: 0 36 | xp: 0.0 37 | mana: 0 38 | action_bar: 39 | idle: true 40 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/menus/shared/ModifierInstance.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.menus.shared; 2 | 3 | import dev.aurelium.auraskills.api.registry.NamespaceIdentified; 4 | import dev.aurelium.auraskills.api.util.AuraSkillsModifier.Operation; 5 | import org.bukkit.inventory.ItemStack; 6 | import org.jetbrains.annotations.Nullable; 7 | 8 | public record ModifierInstance( 9 | NamespaceIdentified parent, 10 | String id, 11 | double value, 12 | Operation operation, 13 | @Nullable ItemStack item, 14 | String displayName, 15 | String description, 16 | int index 17 | ) { 18 | 19 | public ModifierInstance withIndex(int index) { 20 | return new ModifierInstance(this.parent, this.id, this.value, this.operation, this.item, this.displayName, this.description, index); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/scheduler/BukkitTaskWrapper.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.scheduler; 2 | 3 | import com.tcoded.folialib.wrapper.task.WrappedTask; 4 | import dev.aurelium.auraskills.common.scheduler.Task; 5 | import dev.aurelium.auraskills.common.scheduler.TaskStatus; 6 | 7 | public class BukkitTaskWrapper implements Task { 8 | 9 | private final WrappedTask bukkitTask; 10 | 11 | public BukkitTaskWrapper(WrappedTask bukkitTask) { 12 | this.bukkitTask = bukkitTask; 13 | } 14 | 15 | @Override 16 | public TaskStatus getStatus() { 17 | if (bukkitTask.isCancelled()) { 18 | return TaskStatus.STOPPED; 19 | } else { 20 | return TaskStatus.SCHEDULED; 21 | } 22 | } 23 | 24 | @Override 25 | public void cancel() { 26 | bukkitTask.cancel(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/api/implementation/ApiXpRequirements.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.api.implementation; 2 | 3 | import dev.aurelium.auraskills.api.skill.Skill; 4 | import dev.aurelium.auraskills.api.skill.XpRequirements; 5 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 6 | 7 | public class ApiXpRequirements implements XpRequirements { 8 | 9 | private final AuraSkillsPlugin plugin; 10 | 11 | public ApiXpRequirements(AuraSkillsPlugin plugin) { 12 | this.plugin = plugin; 13 | } 14 | 15 | @Override 16 | public int getXpRequired(Skill skill, int level) { 17 | return plugin.getXpRequirements().getXpRequired(skill, level); 18 | } 19 | 20 | @Override 21 | public int getDefaultXpRequired(int level) { 22 | return plugin.getXpRequirements().getDefaultXpRequired(level); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/loot/CommandLoot.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.loot; 2 | 3 | import dev.aurelium.auraskills.api.loot.Loot; 4 | import dev.aurelium.auraskills.api.loot.LootValues; 5 | import dev.aurelium.auraskills.common.commands.CommandExecutor; 6 | import org.jetbrains.annotations.NotNull; 7 | 8 | public class CommandLoot extends Loot { 9 | 10 | private final CommandExecutor executor; 11 | private final String[] commands; 12 | 13 | public CommandLoot(LootValues values, CommandExecutor executor, @NotNull String[] commands) { 14 | super(values); 15 | this.executor = executor; 16 | this.commands = commands; 17 | } 18 | 19 | public String[] getCommands() { 20 | return commands; 21 | } 22 | 23 | public CommandExecutor getExecutor() { 24 | return executor; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/message/type/ACFMinecraftMessage.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.message.type; 2 | 3 | import dev.aurelium.auraskills.common.message.MessageKey; 4 | 5 | import java.util.Locale; 6 | 7 | public enum ACFMinecraftMessage implements MessageKey { 8 | 9 | INVALID_WORLD, 10 | YOU_MUST_BE_HOLDING_ITEM, 11 | PLAYER_IS_VANISHED_CONFIRM, 12 | USERNAME_TOO_SHORT, 13 | IS_NOT_A_VALID_NAME, 14 | MULTIPLE_PLAYERS_MATCH, 15 | NO_PLAYER_FOUND_SERVER, 16 | NO_PLAYER_FOUND_OFFLINE, 17 | NO_PLAYER_FOUND, 18 | LOCATION_PLEASE_SPECIFY_WORLD, 19 | LOCATION_PLEASE_SPECIFY_XYZ, 20 | LOCATION_CONSOLE_NOT_RELATIVE; 21 | 22 | private final String path = "acf.minecraft." + this.name().toLowerCase(Locale.ROOT); 23 | 24 | @Override 25 | public String getPath() { 26 | return path; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/scheduler/ScheduledTask.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.scheduler; 2 | 3 | import java.util.concurrent.ScheduledFuture; 4 | import java.util.concurrent.TimeUnit; 5 | 6 | public class ScheduledTask implements Task { 7 | 8 | private final ScheduledFuture future; 9 | 10 | public ScheduledTask(final ScheduledFuture future) { 11 | this.future = future; 12 | } 13 | 14 | @Override 15 | public TaskStatus getStatus() { 16 | if (future.getDelay(TimeUnit.MILLISECONDS) > 0) { 17 | return TaskStatus.SCHEDULED; 18 | } else if (!future.isDone()) { 19 | return TaskStatus.RUNNING; 20 | } else { 21 | return TaskStatus.STOPPED; 22 | } 23 | } 24 | 25 | @Override 26 | public void cancel() { 27 | future.cancel(false); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/antiafk/BukkitCheckType.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.antiafk; 2 | 3 | import dev.aurelium.auraskills.bukkit.antiafk.checks.*; 4 | import dev.aurelium.auraskills.common.antiafk.CheckType; 5 | 6 | public enum BukkitCheckType implements CheckType { 7 | 8 | BLOCK_A(BlockA.class), 9 | DAMAGE_A(DamageA.class), 10 | DAMAGE_B(DamageB.class), 11 | DAMAGE_C(DamageC.class), 12 | ENTITY_A(EntityA.class), 13 | ENTITY_B(EntityB.class), 14 | ENTITY_C(EntityC.class), 15 | FISHING_A(FishingA.class); 16 | 17 | private final Class checkClass; 18 | 19 | BukkitCheckType(Class checkClass) { 20 | this.checkClass = checkClass; 21 | } 22 | 23 | @Override 24 | public Class getCheckClass() { 25 | return checkClass; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/trait/CritDamageTrait.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.trait; 2 | 3 | import dev.aurelium.auraskills.api.trait.Trait; 4 | import dev.aurelium.auraskills.api.trait.Traits; 5 | import dev.aurelium.auraskills.api.util.NumberUtil; 6 | import dev.aurelium.auraskills.bukkit.AuraSkills; 7 | import org.bukkit.entity.Player; 8 | 9 | import java.util.Locale; 10 | 11 | public class CritDamageTrait extends TraitImpl { 12 | 13 | CritDamageTrait(AuraSkills plugin) { 14 | super(plugin, Traits.CRIT_DAMAGE); 15 | } 16 | 17 | @Override 18 | public double getBaseLevel(Player player, Trait trait) { 19 | return Traits.CRIT_DAMAGE.optionDouble("base"); 20 | } 21 | 22 | @Override 23 | public String getMenuDisplay(double value, Trait trait, Locale locale) { 24 | return NumberUtil.format1(value) + "%"; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/type/FishingSource.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.type; 2 | 3 | import dev.aurelium.auraskills.api.item.LootItemFilter; 4 | import dev.aurelium.auraskills.api.source.SourceValues; 5 | import dev.aurelium.auraskills.api.source.type.FishingXpSource; 6 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 7 | import dev.aurelium.auraskills.common.source.Source; 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | public class FishingSource extends Source implements FishingXpSource { 11 | 12 | private final LootItemFilter item; 13 | 14 | public FishingSource(AuraSkillsPlugin plugin, SourceValues values, LootItemFilter item) { 15 | super(plugin, values); 16 | this.item = item; 17 | } 18 | 19 | @Override 20 | public @NotNull LootItemFilter getItem() { 21 | return item; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/ui/UiProvider.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.ui; 2 | 3 | import dev.aurelium.auraskills.api.skill.Skill; 4 | import dev.aurelium.auraskills.common.user.User; 5 | 6 | import java.text.NumberFormat; 7 | 8 | public interface UiProvider { 9 | 10 | ActionBarManager getActionBarManager(); 11 | 12 | // Allows ActionBarManager to access boss bar format options 13 | NumberFormat getFormat(FormatType type); 14 | 15 | void sendActionBar(User user, String message); 16 | 17 | void sendXpBossBar(User user, Skill skill, double currentXp, double levelXp, double xpGained, int level, boolean maxed, double income); 18 | 19 | void sendTitle(User user, String title, String subtitle, int fadeIn, int stay, int fadeOut); 20 | 21 | enum FormatType { 22 | 23 | XP, 24 | PERCENT, 25 | MONEY 26 | 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/type/ItemConsumeSource.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.type; 2 | 3 | import dev.aurelium.auraskills.api.item.ItemFilter; 4 | import dev.aurelium.auraskills.api.source.SourceValues; 5 | import dev.aurelium.auraskills.api.source.type.ItemConsumeXpSource; 6 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 7 | import dev.aurelium.auraskills.common.source.Source; 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | public class ItemConsumeSource extends Source implements ItemConsumeXpSource { 11 | 12 | private final ItemFilter item; 13 | 14 | public ItemConsumeSource(AuraSkillsPlugin plugin, SourceValues values, ItemFilter item) { 15 | super(plugin, values); 16 | this.item = item; 17 | } 18 | 19 | @Override 20 | public @NotNull ItemFilter getItem() { 21 | return item; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/type/PotionSplashSource.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.type; 2 | 3 | import dev.aurelium.auraskills.api.item.ItemFilter; 4 | import dev.aurelium.auraskills.api.source.SourceValues; 5 | import dev.aurelium.auraskills.api.source.type.PotionSplashXpSource; 6 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 7 | import dev.aurelium.auraskills.common.source.Source; 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | public class PotionSplashSource extends Source implements PotionSplashXpSource { 11 | 12 | private final ItemFilter item; 13 | 14 | public PotionSplashSource(AuraSkillsPlugin plugin, SourceValues values, ItemFilter item) { 15 | super(plugin, values); 16 | this.item = item; 17 | } 18 | 19 | @Override 20 | public @NotNull ItemFilter getItem() { 21 | return item; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/util/data/Validate.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.util.data; 2 | 3 | public class Validate { 4 | 5 | public static void notNull(Object object) { 6 | notNull(object, "Object " + object.toString() + " cannot be null"); 7 | } 8 | 9 | public static void notNull(Object object, String message) { 10 | if (object == null) { 11 | throw new IllegalArgumentException(message); 12 | } 13 | } 14 | 15 | public static void allNotNull(Object... args) { 16 | if (args == null) return; 17 | for (int i = 0; i < args.length; i += 2) { 18 | String key = String.valueOf(args[i]); 19 | Object value = args[i + 1]; 20 | if (value == null) { 21 | throw new IllegalArgumentException("The value of " + key + " cannot be null"); 22 | } 23 | } 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/antiafk/BukkitCheck.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.antiafk; 2 | 3 | import dev.aurelium.auraskills.common.antiafk.AntiAfkManager; 4 | import dev.aurelium.auraskills.common.antiafk.Check; 5 | import dev.aurelium.auraskills.common.antiafk.CheckData; 6 | import dev.aurelium.auraskills.common.antiafk.CheckType; 7 | import org.bukkit.entity.Player; 8 | import org.bukkit.event.Listener; 9 | 10 | import static dev.aurelium.auraskills.bukkit.ref.BukkitPlayerRef.wrap; 11 | 12 | public class BukkitCheck extends Check implements Listener { 13 | 14 | public BukkitCheck(CheckType type, AntiAfkManager manager) { 15 | super(type, manager); 16 | } 17 | 18 | protected CheckData getCheckData(Player player) { 19 | return getCheckData(wrap(player)); 20 | } 21 | 22 | protected void logFail(Player player) { 23 | logFail(wrap(player)); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/commands/StatsCommand.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.commands; 2 | 3 | import co.aikar.commands.BaseCommand; 4 | import co.aikar.commands.annotation.CommandAlias; 5 | import co.aikar.commands.annotation.CommandPermission; 6 | import co.aikar.commands.annotation.Default; 7 | import co.aikar.commands.annotation.Description; 8 | import dev.aurelium.auraskills.bukkit.AuraSkills; 9 | import org.bukkit.entity.Player; 10 | 11 | @CommandAlias("stats") 12 | public class StatsCommand extends BaseCommand { 13 | 14 | private final AuraSkills plugin; 15 | 16 | public StatsCommand(AuraSkills plugin) { 17 | this.plugin = plugin; 18 | } 19 | 20 | @Default 21 | @CommandPermission("auraskills.command.stats") 22 | @Description("%desc_stats") 23 | public void onStats(Player player) { 24 | plugin.getSlate().openMenu(player, "stats"); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/resources/sources/fishing.yml: -------------------------------------------------------------------------------- 1 | default: 2 | type: fishing 3 | menu_item: 4 | material: '{item.material}' 5 | sources: 6 | cod: 7 | item: 8 | material: 'cod' 9 | xp: 25 10 | salmon: 11 | item: 12 | material: 'salmon' 13 | xp: 60 14 | tropical_fish: 15 | item: 16 | material: 'tropical_fish' 17 | xp: 750 18 | pufferfish: 19 | item: 20 | material: 'pufferfish' 21 | xp: 115 22 | treasure: 23 | item: 24 | category: fishing_treasure 25 | xp: 1000 26 | menu_item: 27 | material: name_tag 28 | junk: 29 | item: 30 | category: fishing_junk 31 | xp: 30 32 | menu_item: 33 | material: stick 34 | rare: 35 | item: 36 | loot_pool: rare 37 | xp: 2000 38 | menu_item: 39 | material: orange_dye 40 | epic: 41 | item: 42 | loot_pool: epic 43 | xp: 5000 44 | menu_item: 45 | material: purple_dye -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/loot/LootValues.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.loot; 2 | 3 | import java.util.Map; 4 | import java.util.Set; 5 | 6 | public class LootValues extends LootOptioned { 7 | 8 | private final int weight; 9 | private final String message; 10 | private final Map> contexts; 11 | 12 | public LootValues(int weight, String message, Map> contexts, Map options, LootRequirements requirements) { 13 | super(options, requirements); 14 | this.weight = weight; 15 | this.message = message; 16 | this.contexts = contexts; 17 | } 18 | 19 | public int getWeight() { 20 | return weight; 21 | } 22 | 23 | public String getMessage() { 24 | return message; 25 | } 26 | 27 | public Map> getContexts() { 28 | return contexts; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/ref/BukkitPlayerRef.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.ref; 2 | 3 | import dev.aurelium.auraskills.common.ref.LocationRef; 4 | import dev.aurelium.auraskills.common.ref.PlayerRef; 5 | import org.bukkit.entity.Player; 6 | 7 | public class BukkitPlayerRef implements PlayerRef { 8 | 9 | private final Player player; 10 | 11 | private BukkitPlayerRef(Player player) { 12 | this.player = player; 13 | } 14 | 15 | public static BukkitPlayerRef wrap(Player player) { 16 | return new BukkitPlayerRef(player); 17 | } 18 | 19 | public static Player unwrap(PlayerRef ref) { 20 | return ((BukkitPlayerRef) ref).get(); 21 | } 22 | 23 | @Override 24 | public Player get() { 25 | return player; 26 | } 27 | 28 | @Override 29 | public LocationRef getLocation() { 30 | return BukkitLocationRef.wrap(player.getLocation()); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/reward/parser/MoneyRewardParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.reward.parser; 2 | 3 | import dev.aurelium.auraskills.api.skill.Skill; 4 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 5 | import dev.aurelium.auraskills.common.reward.SkillReward; 6 | import dev.aurelium.auraskills.common.reward.builder.MoneyRewardBuilder; 7 | import org.spongepowered.configurate.ConfigurationNode; 8 | 9 | public class MoneyRewardParser extends RewardParser { 10 | 11 | public MoneyRewardParser(AuraSkillsPlugin plugin, Skill skill) { 12 | super(plugin, skill); 13 | } 14 | 15 | @Override 16 | public SkillReward parse(ConfigurationNode config) { 17 | return new MoneyRewardBuilder(plugin) 18 | .amount(config.node("amount").getDouble()) 19 | .formula(config.node("formula").getString()) 20 | .skill(skill) 21 | .build(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/parser/JumpingSourceParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.parser; 2 | 3 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 4 | import dev.aurelium.auraskills.common.source.ConfigurateSourceContext; 5 | import dev.aurelium.auraskills.common.source.type.JumpingSource; 6 | import org.spongepowered.configurate.ConfigurationNode; 7 | import org.spongepowered.configurate.serialize.SerializationException; 8 | 9 | public class JumpingSourceParser extends SourceParser { 10 | 11 | public JumpingSourceParser(AuraSkillsPlugin plugin) { 12 | super(plugin); 13 | } 14 | 15 | @Override 16 | public JumpingSource parse(ConfigurationNode source, ConfigurateSourceContext context) throws SerializationException { 17 | int interval = source.node("interval").getInt(100); 18 | 19 | return new JumpingSource(plugin, context.parseValues(source), interval); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/type/ManaAbilityUseSource.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.type; 2 | 3 | import dev.aurelium.auraskills.api.mana.ManaAbility; 4 | import dev.aurelium.auraskills.api.source.SourceValues; 5 | import dev.aurelium.auraskills.api.source.type.ManaAbilityUseXpSource; 6 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 7 | import dev.aurelium.auraskills.common.source.Source; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public class ManaAbilityUseSource extends Source implements ManaAbilityUseXpSource { 11 | 12 | private final ManaAbility[] manaAbilities; 13 | 14 | public ManaAbilityUseSource(AuraSkillsPlugin plugin, SourceValues values, ManaAbility[] manaAbilities) { 15 | super(plugin, values); 16 | this.manaAbilities = manaAbilities; 17 | } 18 | 19 | @Override 20 | public @Nullable ManaAbility[] getManaAbilities() { 21 | return manaAbilities; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /common/src/testFixtures/java/dev/aurelium/auraskills/common/TestUtil.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common; 2 | 3 | import com.google.common.io.Resources; 4 | 5 | import java.io.File; 6 | import java.io.IOException; 7 | import java.net.URISyntaxException; 8 | import java.nio.file.Files; 9 | import java.nio.file.Path; 10 | 11 | public class TestUtil { 12 | 13 | public static void copyResourceToTemp(String filePath, AuraSkillsPlugin plugin) { 14 | File tempMetadataFile = new File(plugin.getPluginFolder(), filePath); 15 | try { 16 | Files.createDirectories(tempMetadataFile.toPath().getParent()); 17 | try { 18 | Files.copy(Path.of(Resources.getResource(filePath).toURI()), tempMetadataFile.toPath()); 19 | } catch (URISyntaxException e) { 20 | throw new RuntimeException(e); 21 | } 22 | } catch (IOException e) { 23 | throw new RuntimeException(e); 24 | } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/storage/sql/pool/MySqlConnectionPool.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.storage.sql.pool; 2 | 3 | import com.zaxxer.hikari.HikariConfig; 4 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 5 | import dev.aurelium.auraskills.common.storage.sql.DatabaseCredentials; 6 | 7 | public class MySqlConnectionPool extends ConnectionPool { 8 | 9 | public MySqlConnectionPool(AuraSkillsPlugin plugin, DatabaseCredentials credentials) { 10 | super(plugin, credentials); 11 | } 12 | 13 | @Override 14 | public void configure(HikariConfig config, DatabaseCredentials credentials) { 15 | config.setDriverClassName("com.mysql.cj.jdbc.Driver"); 16 | config.setJdbcUrl("jdbc:mysql://" + credentials.host() + ":" + credentials.port() + "/" + credentials.database() + "?useSSL=" + credentials.ssl()); 17 | config.setUsername(credentials.username()); 18 | config.setPassword(credentials.password()); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/requirement/GlobalRequirement.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.requirement; 2 | 3 | import dev.aurelium.auraskills.api.item.ModifierType; 4 | import dev.aurelium.auraskills.api.skill.Skill; 5 | import org.bukkit.Material; 6 | 7 | import java.util.Map; 8 | 9 | public class GlobalRequirement { 10 | 11 | private final ModifierType type; 12 | private final Material material; 13 | private final Map requirements; 14 | 15 | public GlobalRequirement(ModifierType type, Material material, Map requirements) { 16 | this.type = type; 17 | this.material = material; 18 | this.requirements = requirements; 19 | } 20 | 21 | public ModifierType getType() { 22 | return type; 23 | } 24 | 25 | public Material getMaterial() { 26 | return material; 27 | } 28 | 29 | public Map getRequirements() { 30 | return requirements; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/parser/GrindstoneSourceParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.parser; 2 | 3 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 4 | import dev.aurelium.auraskills.common.source.ConfigurateSourceContext; 5 | import dev.aurelium.auraskills.common.source.type.GrindstoneSource; 6 | import org.spongepowered.configurate.ConfigurationNode; 7 | import org.spongepowered.configurate.serialize.SerializationException; 8 | 9 | public class GrindstoneSourceParser extends SourceParser { 10 | 11 | public GrindstoneSourceParser(AuraSkillsPlugin plugin) { 12 | super(plugin); 13 | } 14 | 15 | @Override 16 | public GrindstoneSource parse(ConfigurationNode source, ConfigurateSourceContext context) throws SerializationException { 17 | String multiplier = source.node("multiplier").getString(); 18 | 19 | return new GrindstoneSource(plugin, context.parseValues(source), multiplier); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/source/SkillSource.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.source; 2 | 3 | import dev.aurelium.auraskills.api.skill.Skill; 4 | 5 | import java.util.Objects; 6 | 7 | public class SkillSource { 8 | 9 | private final T source; 10 | private final Skill skill; 11 | 12 | public SkillSource(T source, Skill skill) { 13 | this.source = source; 14 | this.skill = skill; 15 | } 16 | 17 | public T source() { 18 | return source; 19 | } 20 | 21 | public Skill skill() { 22 | return skill; 23 | } 24 | 25 | @Override 26 | public boolean equals(Object o) { 27 | if (o == null || getClass() != o.getClass()) return false; 28 | SkillSource that = (SkillSource) o; 29 | return Objects.equals(source, that.source) && Objects.equals(skill, that.skill); 30 | } 31 | 32 | @Override 33 | public int hashCode() { 34 | return Objects.hash(source, skill); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/requirement/BukkitLootRequirements.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.requirement; 2 | 3 | import dev.aurelium.auraskills.api.loot.LootRequirements; 4 | import org.bukkit.Bukkit; 5 | import org.bukkit.entity.Player; 6 | 7 | import java.util.List; 8 | import java.util.UUID; 9 | 10 | public class BukkitLootRequirements extends LootRequirements { 11 | 12 | private final List nodes; 13 | 14 | public BukkitLootRequirements(List nodes) { 15 | this.nodes = nodes; 16 | } 17 | 18 | public boolean checkByUuid(UUID uuid) { 19 | Player player = Bukkit.getPlayer(uuid); 20 | if (player == null) return false; 21 | 22 | return check(player); 23 | } 24 | 25 | public boolean check(Player player) { 26 | for (RequirementNode node : nodes) { 27 | if (!node.check(player)) 28 | return false; 29 | } 30 | 31 | return true; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/reward/builder/MoneyRewardBuilder.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.reward.builder; 2 | 3 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 4 | import dev.aurelium.auraskills.common.reward.SkillReward; 5 | import dev.aurelium.auraskills.common.reward.type.MoneyReward; 6 | 7 | public class MoneyRewardBuilder extends RewardBuilder { 8 | 9 | private double amount; 10 | private String formula; 11 | 12 | public MoneyRewardBuilder(AuraSkillsPlugin plugin) { 13 | super(plugin); 14 | this.formula = null; 15 | } 16 | 17 | public MoneyRewardBuilder amount(double amount) { 18 | this.amount = amount; 19 | return this; 20 | } 21 | 22 | public MoneyRewardBuilder formula(String formula) { 23 | this.formula = formula; 24 | return this; 25 | } 26 | 27 | @Override 28 | public SkillReward build() { 29 | return new MoneyReward(plugin, skill, amount, formula); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/ref/BukkitItemRef.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.ref; 2 | 3 | import dev.aurelium.auraskills.common.ref.ItemRef; 4 | import org.bukkit.inventory.ItemStack; 5 | 6 | public class BukkitItemRef implements ItemRef, Cloneable { 7 | 8 | private final ItemStack item; 9 | 10 | public BukkitItemRef(ItemStack item) { 11 | this.item = item; 12 | } 13 | 14 | public static BukkitItemRef wrap(ItemStack item) { 15 | return new BukkitItemRef(item); 16 | } 17 | 18 | public static ItemStack unwrap(ItemRef ref) { 19 | return ((BukkitItemRef) ref).get(); 20 | } 21 | 22 | @Override 23 | public ItemStack get() { 24 | return item; 25 | } 26 | 27 | @Override 28 | public ItemRef clone() { 29 | try { 30 | return wrap(unwrap((ItemRef) super.clone()).clone()); 31 | } catch (CloneNotSupportedException e) { 32 | throw new RuntimeException(e); 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /bukkit/src/test/java/dev/aurelium/auraskills/bukkit/SyncOnlyScheduler.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit; 2 | 3 | import dev.aurelium.auraskills.bukkit.scheduler.BukkitScheduler; 4 | import dev.aurelium.auraskills.common.scheduler.Task; 5 | import dev.aurelium.auraskills.common.scheduler.TaskRunnable; 6 | 7 | import java.util.concurrent.TimeUnit; 8 | 9 | public class SyncOnlyScheduler extends BukkitScheduler { 10 | 11 | public SyncOnlyScheduler(AuraSkills plugin) { 12 | super(plugin); 13 | } 14 | 15 | @Override 16 | public Task executeAsync(Runnable runnable) { 17 | return executeSync(runnable); 18 | } 19 | 20 | @Override 21 | public Task scheduleAsync(Runnable runnable, long delay, TimeUnit timeUnit) { 22 | return scheduleSync(runnable, delay, timeUnit); 23 | } 24 | 25 | @Override 26 | public Task timerAsync(TaskRunnable runnable, long delay, long period, TimeUnit timeUnit) { 27 | return timerSync(runnable, delay, period, timeUnit); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/api/implementation/ApiLootManager.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.api.implementation; 2 | 3 | import dev.aurelium.auraskills.api.loot.LootManager; 4 | import dev.aurelium.auraskills.api.loot.LootParser; 5 | import dev.aurelium.auraskills.api.loot.LootTable; 6 | import dev.aurelium.auraskills.api.registry.NamespacedId; 7 | import dev.aurelium.auraskills.bukkit.AuraSkills; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public class ApiLootManager implements LootManager { 11 | 12 | private final AuraSkills plugin; 13 | 14 | public ApiLootManager(AuraSkills plugin) { 15 | this.plugin = plugin; 16 | } 17 | 18 | @Override 19 | public @Nullable LootTable getLootTable(NamespacedId id) { 20 | return plugin.getLootManager().getLootTable(id); 21 | } 22 | 23 | @Override 24 | public void registerLootType(String name, LootParser parser) { 25 | plugin.getLootManager().registerCustomLootParser(name, parser); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /.github/workflows/gradle.yml: -------------------------------------------------------------------------------- 1 | name: Build Plugin with Gradle 2 | on: 3 | push: 4 | branches: [ "master" ] 5 | pull_request: 6 | permissions: 7 | contents: read 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 13 | - name: Set up JDK 21 14 | uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e 15 | with: 16 | java-version: "21" 17 | distribution: temurin 18 | - name: Set up Gradle 19 | uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 20 | with: 21 | gradle-version: "8.14.2" 22 | - name: Build with Gradle 23 | run: ./gradlew build --refresh-dependencies 24 | - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f 25 | with: 26 | name: AuraSkills 27 | path: build/libs/AuraSkills-**.jar 28 | - name: Delete all summary content 29 | run: rm $GITHUB_STEP_SUMMARY 30 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/reward/type/ItemReward.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.reward.type; 2 | 3 | import dev.aurelium.auraskills.api.registry.NamespacedId; 4 | import dev.aurelium.auraskills.api.skill.Skill; 5 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 6 | import dev.aurelium.auraskills.common.user.User; 7 | 8 | public class ItemReward extends MessagedReward { 9 | 10 | protected final NamespacedId itemKey; 11 | protected final int amount; // Amount of -1 means no amount was specified and should use amount of registered item 12 | 13 | public ItemReward(AuraSkillsPlugin plugin, Skill skill, String menuMessage, String chatMessage, NamespacedId itemKey, int amount) { 14 | super(plugin, skill, menuMessage, chatMessage); 15 | this.itemKey = itemKey; 16 | this.amount = amount; 17 | } 18 | 19 | @Override 20 | public void giveReward(User user, Skill skill, int level) { 21 | plugin.getItemRegistry().giveItem(user, itemKey, amount); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/skill/SkillProvider.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.skill; 2 | 3 | import dev.aurelium.auraskills.api.ability.Ability; 4 | import dev.aurelium.auraskills.api.mana.ManaAbility; 5 | import dev.aurelium.auraskills.api.option.OptionedProvider; 6 | import dev.aurelium.auraskills.api.source.XpSource; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | import java.util.List; 11 | import java.util.Locale; 12 | 13 | public interface SkillProvider extends OptionedProvider { 14 | 15 | boolean isEnabled(Skill skill); 16 | 17 | @NotNull 18 | List getAbilities(Skill skill); 19 | 20 | @Nullable 21 | ManaAbility getManaAbility(Skill skill); 22 | 23 | @NotNull 24 | List getSources(Skill skill); 25 | 26 | int getMaxLevel(Skill skill); 27 | 28 | String getDisplayName(Skill skill, Locale locale, boolean formatted); 29 | 30 | String getDescription(Skill skill, Locale locale, boolean formatted); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/util/BlockFaceUtil.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.util; 2 | 3 | import org.bukkit.block.Block; 4 | import org.bukkit.block.BlockFace; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | public class BlockFaceUtil { 10 | 11 | public static BlockFace[] getBlockSides() { 12 | return new BlockFace[]{BlockFace.EAST, BlockFace.WEST, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.UP, BlockFace.DOWN}; 13 | } 14 | 15 | public static List getSurroundingBlocks(Block block) { 16 | List blocks = new ArrayList<>(); 17 | for (int x = -1; x <= 1; x++) { 18 | for (int z = -1; z <= 1; z++) { 19 | for (int y = 1; y >= -1; y--) { 20 | if (x == 0 && y == 0 && z == 0) { 21 | continue; 22 | } 23 | blocks.add(block.getRelative(x, y, z)); 24 | } 25 | } 26 | } 27 | return blocks; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/loot/SkillLootProvider.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.loot; 2 | 3 | import dev.aurelium.auraskills.api.loot.LootDropCause; 4 | import dev.aurelium.auraskills.api.loot.LootPool; 5 | import dev.aurelium.auraskills.api.source.XpSource; 6 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 7 | import dev.aurelium.auraskills.common.user.User; 8 | 9 | public abstract class SkillLootProvider { 10 | 11 | protected final AuraSkillsPlugin plugin; 12 | protected final AbstractLootHandler handler; 13 | 14 | public SkillLootProvider(AuraSkillsPlugin plugin, AbstractLootHandler handler) { 15 | this.plugin = plugin; 16 | this.handler = handler; 17 | } 18 | 19 | public abstract LootDropCause getCause(LootPool pool); 20 | 21 | public double getChance(LootPool pool, User user) { 22 | return handler.getCommonChance(pool, user); 23 | } 24 | 25 | public boolean isApplicable(LootPool pool, XpSource source) { 26 | return true; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/requirement/ItemNode.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.requirement; 2 | 3 | import dev.aurelium.auraskills.bukkit.AuraSkills; 4 | import org.bukkit.Material; 5 | import org.bukkit.entity.Player; 6 | import org.bukkit.inventory.ItemStack; 7 | 8 | import java.util.Locale; 9 | 10 | public class ItemNode extends RequirementNode { 11 | 12 | private final String item; 13 | 14 | public ItemNode(AuraSkills plugin, String item, String message) { 15 | super(plugin, message); 16 | this.item = item.toUpperCase(Locale.ROOT); 17 | } 18 | 19 | @Override 20 | public boolean check(Player player) { 21 | ItemStack heldItem = player.getInventory().getItemInMainHand(); 22 | Material heldMaterial = heldItem != null ? heldItem.getType() : null; 23 | Material material = Material.getMaterial(item); 24 | 25 | if (material != null && heldMaterial != material) { 26 | return false; 27 | } 28 | 29 | return true; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/parser/FishingSourceParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.parser; 2 | 3 | import dev.aurelium.auraskills.api.item.LootItemFilter; 4 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 5 | import dev.aurelium.auraskills.common.source.ConfigurateSourceContext; 6 | import dev.aurelium.auraskills.common.source.type.FishingSource; 7 | import org.spongepowered.configurate.ConfigurationNode; 8 | import org.spongepowered.configurate.serialize.SerializationException; 9 | 10 | public class FishingSourceParser extends SourceParser { 11 | 12 | public FishingSourceParser(AuraSkillsPlugin plugin) { 13 | super(plugin); 14 | } 15 | 16 | @Override 17 | public FishingSource parse(ConfigurationNode source, ConfigurateSourceContext context) throws SerializationException { 18 | LootItemFilter item = context.required(source, "item").get(LootItemFilter.class); 19 | 20 | return new FishingSource(plugin, context.parseValues(source), item); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/menus/contexts/StatContext.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.menus.contexts; 2 | 3 | import dev.aurelium.auraskills.api.registry.NamespacedId; 4 | import dev.aurelium.auraskills.api.stat.Stat; 5 | import dev.aurelium.auraskills.bukkit.AuraSkills; 6 | import dev.aurelium.slate.context.ContextProvider; 7 | import org.jetbrains.annotations.Nullable; 8 | 9 | public class StatContext implements ContextProvider { 10 | 11 | private final AuraSkills plugin; 12 | 13 | public StatContext(AuraSkills plugin) { 14 | this.plugin = plugin; 15 | } 16 | 17 | @Override 18 | public Class getType() { 19 | return Stat.class; 20 | } 21 | 22 | @Nullable 23 | @Override 24 | public Stat parse(String menuName, String input) { 25 | Stat stat = plugin.getStatRegistry().getOrNull(NamespacedId.fromDefault(input)); 26 | if (stat != null && stat.isEnabled()) { 27 | return stat; 28 | } else { 29 | return null; 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/parser/ItemConsumeSourceParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.parser; 2 | 3 | import dev.aurelium.auraskills.api.item.ItemFilter; 4 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 5 | import dev.aurelium.auraskills.common.source.ConfigurateSourceContext; 6 | import dev.aurelium.auraskills.common.source.type.ItemConsumeSource; 7 | import org.spongepowered.configurate.ConfigurationNode; 8 | import org.spongepowered.configurate.serialize.SerializationException; 9 | 10 | public class ItemConsumeSourceParser extends SourceParser { 11 | 12 | public ItemConsumeSourceParser(AuraSkillsPlugin plugin) { 13 | super(plugin); 14 | } 15 | 16 | @Override 17 | public ItemConsumeSource parse(ConfigurationNode source, ConfigurateSourceContext context) throws SerializationException { 18 | ItemFilter item = context.required(source, "item").get(ItemFilter.class); 19 | 20 | return new ItemConsumeSource(plugin, context.parseValues(source), item); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /api-bukkit/src/main/java/dev/aurelium/auraskills/api/event/user/UserLoadEvent.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.event.user; 2 | 3 | import dev.aurelium.auraskills.api.user.SkillsUser; 4 | import org.bukkit.entity.Player; 5 | import org.bukkit.event.Event; 6 | import org.bukkit.event.HandlerList; 7 | import org.jetbrains.annotations.NotNull; 8 | 9 | public class UserLoadEvent extends Event { 10 | 11 | private static final HandlerList handlers = new HandlerList(); 12 | 13 | private final Player player; 14 | private final SkillsUser user; 15 | 16 | public UserLoadEvent(Player player, SkillsUser user) { 17 | this.player = player; 18 | this.user = user; 19 | } 20 | 21 | public Player getPlayer() { 22 | return player; 23 | } 24 | 25 | public SkillsUser getUser() { 26 | return user; 27 | } 28 | 29 | @NotNull 30 | @Override 31 | public HandlerList getHandlers() { 32 | return handlers; 33 | } 34 | 35 | public static HandlerList getHandlerList() { 36 | return handlers; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/message/type/RewardMessage.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.message.type; 2 | 3 | import dev.aurelium.auraskills.common.message.MessageKey; 4 | 5 | import java.util.Locale; 6 | 7 | public enum RewardMessage implements MessageKey { 8 | 9 | ITEM_DEFAULT_MENU_MESSAGE, 10 | ITEM_DEFAULT_MENU_MESSAGE_MULTIPLE, 11 | ITEM_DEFAULT_CHAT_MESSAGE, 12 | ITEM_DEFAULT_CHAT_MESSAGE_MULTIPLE; 13 | 14 | private String section; 15 | private String key; 16 | 17 | RewardMessage() { 18 | String[] split = toString().split("_", 2); 19 | if (split.length == 2) { 20 | this.section = split[0].toLowerCase(Locale.ROOT); 21 | this.key = split[1].toLowerCase(Locale.ROOT); 22 | } 23 | } 24 | 25 | @Override 26 | public String getPath() { 27 | if (section != null && key != null) { 28 | return "rewards." + section + "." + key; 29 | } else { 30 | return "rewards." + toString().toLowerCase(Locale.ROOT); 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/menus/contexts/SkillContext.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.menus.contexts; 2 | 3 | import dev.aurelium.auraskills.api.registry.NamespacedId; 4 | import dev.aurelium.auraskills.api.skill.Skill; 5 | import dev.aurelium.auraskills.bukkit.AuraSkills; 6 | import dev.aurelium.slate.context.ContextProvider; 7 | import org.jetbrains.annotations.Nullable; 8 | 9 | public class SkillContext implements ContextProvider { 10 | 11 | private final AuraSkills plugin; 12 | 13 | public SkillContext(AuraSkills plugin) { 14 | this.plugin = plugin; 15 | } 16 | 17 | @Override 18 | public Class getType() { 19 | return Skill.class; 20 | } 21 | 22 | @Nullable 23 | @Override 24 | public Skill parse(String menuName, String input) { 25 | Skill skill = plugin.getSkillRegistry().getOrNull(NamespacedId.fromDefault(input)); 26 | if (skill != null && skill.isEnabled()) { 27 | return skill; 28 | } else { 29 | return null; 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/menus/contexts/TraitContext.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.menus.contexts; 2 | 3 | import dev.aurelium.auraskills.api.registry.NamespacedId; 4 | import dev.aurelium.auraskills.api.trait.Trait; 5 | import dev.aurelium.auraskills.bukkit.AuraSkills; 6 | import dev.aurelium.slate.context.ContextProvider; 7 | import org.jetbrains.annotations.Nullable; 8 | 9 | public class TraitContext implements ContextProvider { 10 | 11 | private final AuraSkills plugin; 12 | 13 | public TraitContext(AuraSkills plugin) { 14 | this.plugin = plugin; 15 | } 16 | 17 | @Override 18 | public Class getType() { 19 | return Trait.class; 20 | } 21 | 22 | @Override 23 | @Nullable 24 | public Trait parse(String menuName, String input) { 25 | Trait trait = plugin.getTraitRegistry().getOrNull(NamespacedId.fromDefault(input)); 26 | if (trait != null && trait.isEnabled()) { 27 | return trait; 28 | } else { 29 | return null; 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/parser/PotionSplashSourceParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.parser; 2 | 3 | import dev.aurelium.auraskills.api.item.ItemFilter; 4 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 5 | import dev.aurelium.auraskills.common.source.ConfigurateSourceContext; 6 | import dev.aurelium.auraskills.common.source.type.PotionSplashSource; 7 | import org.spongepowered.configurate.ConfigurationNode; 8 | import org.spongepowered.configurate.serialize.SerializationException; 9 | 10 | public class PotionSplashSourceParser extends SourceParser { 11 | 12 | public PotionSplashSourceParser(AuraSkillsPlugin plugin) { 13 | super(plugin); 14 | } 15 | 16 | @Override 17 | public PotionSplashSource parse(ConfigurationNode source, ConfigurateSourceContext context) throws SerializationException { 18 | ItemFilter item = context.required(source, "item").get(ItemFilter.class); 19 | 20 | return new PotionSplashSource(plugin, context.parseValues(source), item); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /bukkit/src/test/java/dev/aurelium/auraskills/bukkit/config/BukkitConfigProviderTest.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.config; 2 | 3 | import dev.aurelium.auraskills.bukkit.AuraSkills; 4 | import dev.aurelium.auraskills.common.config.ConfigProvider; 5 | import dev.aurelium.auraskills.common.config.ConfigProviderTest; 6 | import dev.aurelium.auraskills.common.util.TestSession; 7 | import org.junit.jupiter.api.AfterAll; 8 | import org.junit.jupiter.api.BeforeAll; 9 | import org.mockbukkit.mockbukkit.MockBukkit; 10 | 11 | import java.util.Map; 12 | 13 | public class BukkitConfigProviderTest extends ConfigProviderTest { 14 | 15 | private static AuraSkills plugin; 16 | 17 | @BeforeAll 18 | static void setUp() { 19 | MockBukkit.mock(); 20 | plugin = MockBukkit.load(AuraSkills.class, TestSession.create()); 21 | } 22 | 23 | @AfterAll 24 | static void unload() { 25 | MockBukkit.unmock(); 26 | } 27 | 28 | @Override 29 | protected ConfigProvider getConfigProvider() { 30 | return new BukkitConfigProvider(plugin, Map.of()); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/region/ChunkCoordinate.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.region; 2 | 3 | import com.google.common.base.Objects; 4 | 5 | public class ChunkCoordinate { 6 | 7 | private final byte x; 8 | private final byte z; 9 | 10 | public ChunkCoordinate(byte x, byte z) { 11 | this.x = x; 12 | this.z = z; 13 | } 14 | 15 | public byte getX() { 16 | return x; 17 | } 18 | 19 | public byte getZ() { 20 | return z; 21 | } 22 | 23 | @Override 24 | public boolean equals(Object obj) { 25 | if (this == obj) { 26 | return true; 27 | } else if (obj == null) { 28 | return false; 29 | } else if (!(obj instanceof ChunkCoordinate)) { 30 | return false; 31 | } else { 32 | ChunkCoordinate other = (ChunkCoordinate) obj; 33 | return this.x == other.x && this.z == other.z; 34 | } 35 | } 36 | 37 | @Override 38 | public int hashCode() { 39 | return Objects.hashCode(x, z); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/hooks/mythicmobs/loot/MythicEntityLootParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.hooks.mythicmobs.loot; 2 | 3 | import dev.aurelium.auraskills.bukkit.AuraSkills; 4 | import dev.aurelium.auraskills.bukkit.loot.entity.EntityProperties; 5 | import dev.aurelium.auraskills.bukkit.loot.entity.EntitySupplier; 6 | import dev.aurelium.auraskills.bukkit.loot.parser.CustomEntityParser; 7 | import org.spongepowered.configurate.ConfigurationNode; 8 | 9 | public class MythicEntityLootParser implements CustomEntityParser { 10 | 11 | private final AuraSkills plugin; 12 | 13 | public MythicEntityLootParser(AuraSkills plugin) { 14 | this.plugin = plugin; 15 | } 16 | 17 | @Override 18 | public EntitySupplier getEntitySupplier(ConfigurationNode config) { 19 | return new MythicEntitySupplier(EntityProperties.fromConfig(config, plugin)); 20 | } 21 | 22 | @Override 23 | public boolean shouldUseParser(ConfigurationNode config) { 24 | return config.node("entity").getString("").startsWith("mythicmobs:"); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/resources/db/migrations/v1__modifiers_table.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO auraskills_modifiers 2 | (user_id, modifier_type, type_id, modifier_name, modifier_value, modifier_operation, expiration_time, remaining_duration, metadata) 3 | SELECT 4 | user_id, 5 | CASE 6 | WHEN data_id = 1 THEN 'stat' 7 | WHEN data_id = 2 THEN 'trait' 8 | END AS modifier_type, 9 | category_id AS type_id, 10 | SUBSTRING_INDEX(key_name, '||', 1) AS modifier_name, 11 | CAST(`value` AS DECIMAL(30, 10)) AS modifier_value, 12 | CASE 13 | WHEN key_name LIKE '%||%' THEN 14 | CASE 15 | WHEN SUBSTRING_INDEX(key_name, '||', -1) = 'ADD' THEN 1 16 | WHEN SUBSTRING_INDEX(key_name, '||', -1) = 'MULTIPLY' THEN 2 17 | WHEN SUBSTRING_INDEX(key_name, '||', -1) = 'ADD_PERCENT' THEN 3 18 | ELSE 1 19 | END 20 | ELSE 1 21 | END AS modifier_operation, 22 | NULL AS expiration_time, 23 | NULL AS remaining_duration, 24 | NULL AS metadata 25 | FROM auraskills_key_values 26 | WHERE data_id IN (1, 2); 27 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/hooks/TownyHook.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.hooks; 2 | 3 | import com.palmergames.bukkit.towny.object.TownyPermission; 4 | import com.palmergames.bukkit.towny.utils.PlayerCacheUtil; 5 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 6 | import dev.aurelium.auraskills.common.hooks.Hook; 7 | import org.bukkit.block.Block; 8 | import org.bukkit.entity.Player; 9 | import org.spongepowered.configurate.ConfigurationNode; 10 | 11 | public class TownyHook extends Hook { 12 | 13 | public TownyHook(AuraSkillsPlugin plugin, ConfigurationNode config) { 14 | super(plugin, config); 15 | } 16 | 17 | public boolean canBreak(Player player, Block block) { 18 | try { 19 | return PlayerCacheUtil.getCachePermission(player, block.getLocation(), block.getType(), TownyPermission.ActionType.DESTROY); 20 | } catch (Exception ignored) { 21 | } 22 | return true; 23 | } 24 | 25 | @Override 26 | public Class getTypeClass() { 27 | return TownyHook.class; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /wiki/incompatibilities.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: List of incompatible software 3 | --- 4 | 5 | # Incompatibilities 6 | 7 | ## Unsupported Server Software 8 | 9 | The following server software will not receive support. Although the plugin may work, it is prone to issues and deviates from the mechanics of Spigot/Paper. 10 | 11 | * **CraftBukkit** - Action bar will not work 12 | * **Modded hybrid servers (Arclight, Mohist, Magma, CatServer)** - Modded environments do not work well with Bukkit plugins in general, some features are reported to be broken especially around health. 13 | 14 | ## Incompatible Server Options 15 | 16 | * **Offline Mode** - We do not provide support for offline mode on Discord due to terms of service and the EULA. Certain features around player data saving may not work. Use at your own risk. 17 | 18 | ## Incompatible Plugins 19 | 20 | * **LoreAttributesRecoded** - Will reset health when doing certain actions. Can be fixed by disabling the health in that plugin. 21 | * **CustomEnchants** (not all enchant plugins, just the one specifically named this) - Will reset health when doing certain actions. 22 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/menus/contexts/AbilityContext.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.menus.contexts; 2 | 3 | import dev.aurelium.auraskills.api.ability.Ability; 4 | import dev.aurelium.auraskills.api.registry.NamespacedId; 5 | import dev.aurelium.auraskills.bukkit.AuraSkills; 6 | import dev.aurelium.slate.context.ContextProvider; 7 | import org.jetbrains.annotations.Nullable; 8 | 9 | public class AbilityContext implements ContextProvider { 10 | 11 | private final AuraSkills plugin; 12 | 13 | public AbilityContext(AuraSkills plugin) { 14 | this.plugin = plugin; 15 | } 16 | 17 | @Override 18 | public Class getType() { 19 | return Ability.class; 20 | } 21 | 22 | @Override 23 | @Nullable 24 | public Ability parse(String menuName, String input) { 25 | Ability ability = plugin.getAbilityRegistry().getOrNull(NamespacedId.fromDefault(input)); 26 | if (ability != null && ability.isEnabled()) { 27 | return ability; 28 | } else { 29 | return null; 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/source/type/StatisticXpSource.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.source.type; 2 | 3 | import dev.aurelium.auraskills.api.source.XpSource; 4 | 5 | public interface StatisticXpSource extends XpSource { 6 | 7 | /** 8 | * Gets the name of the statistic of the source. 9 | * 10 | * @return The statistic name 11 | */ 12 | String getStatistic(); 13 | 14 | /** 15 | * Gets the multiplier used to calculate the xp of the source. 16 | * This is used to allow the xp value to be in a more readable format. 17 | * For example, a per_cm statistic would have a multiplier of 0.01 for the configured xp to be in meters. 18 | * 19 | * @return The multiplier 20 | */ 21 | double getMultiplier(); 22 | 23 | /** 24 | * Gets the minimum value the statistic must increase by for the source to give xp. 25 | * If the statistic increases by less than this value, it will still be accounted for in 26 | * the next time XP is given. 27 | * 28 | * @return The minimum increase 29 | */ 30 | int getMinimumIncrease(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/ability/BukkitAbilityImpl.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.ability; 2 | 3 | import dev.aurelium.auraskills.api.ability.Ability; 4 | import dev.aurelium.auraskills.api.ability.AbilityContext; 5 | import dev.aurelium.auraskills.bukkit.AuraSkills; 6 | import dev.aurelium.auraskills.common.ability.AbilityImpl; 7 | import org.bukkit.entity.Player; 8 | import org.bukkit.event.Listener; 9 | 10 | public class BukkitAbilityImpl extends AbilityImpl implements Listener { 11 | 12 | protected final AuraSkills plugin; 13 | private final AbilityContext abilityContext; 14 | 15 | public BukkitAbilityImpl(AuraSkills plugin, Ability... abilities) { 16 | super(abilities); 17 | this.plugin = plugin; 18 | this.abilityContext = new AbilityContext(plugin.getApi()); 19 | } 20 | 21 | protected boolean isDisabled(Ability ability) { 22 | return abilityContext.isDisabled(ability); 23 | } 24 | 25 | protected boolean failsChecks(Player player, Ability ability) { 26 | return abilityContext.failsChecks(player, ability); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/ref/BukkitLocationRef.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.ref; 2 | 3 | import dev.aurelium.auraskills.common.ref.LocationRef; 4 | import org.bukkit.Location; 5 | import org.bukkit.World; 6 | 7 | import java.util.Optional; 8 | 9 | public class BukkitLocationRef implements LocationRef { 10 | 11 | private final Location location; 12 | 13 | private BukkitLocationRef(Location location) { 14 | this.location = location; 15 | } 16 | 17 | public static BukkitLocationRef wrap(Location location) { 18 | return new BukkitLocationRef(location); 19 | } 20 | 21 | public static Location unwrap(LocationRef ref) { 22 | return ((BukkitLocationRef) ref).get(); 23 | } 24 | 25 | @Override 26 | public Location get() { 27 | return location; 28 | } 29 | 30 | @Override 31 | public Optional getWorldName() { 32 | World world = location.getWorld(); 33 | if (world != null) { 34 | return Optional.of(world.getName()); 35 | } 36 | return Optional.empty(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/parser/ManaAbilityUseSourceParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.parser; 2 | 3 | import dev.aurelium.auraskills.api.mana.ManaAbility; 4 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 5 | import dev.aurelium.auraskills.common.source.ConfigurateSourceContext; 6 | import dev.aurelium.auraskills.common.source.type.ManaAbilityUseSource; 7 | import org.spongepowered.configurate.ConfigurationNode; 8 | import org.spongepowered.configurate.serialize.SerializationException; 9 | 10 | public class ManaAbilityUseSourceParser extends SourceParser { 11 | 12 | public ManaAbilityUseSourceParser(AuraSkillsPlugin plugin) { 13 | super(plugin); 14 | } 15 | 16 | @Override 17 | public ManaAbilityUseSource parse(ConfigurationNode source, ConfigurateSourceContext context) throws SerializationException { 18 | ManaAbility[] manaAbilities = context.pluralizedArray("mana_ability", source, ManaAbility.class); 19 | 20 | return new ManaAbilityUseSource(plugin, context.parseValues(source), manaAbilities); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/type/EnchantingSource.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.type; 2 | 3 | import dev.aurelium.auraskills.api.item.ItemFilter; 4 | import dev.aurelium.auraskills.api.source.SourceValues; 5 | import dev.aurelium.auraskills.api.source.type.EnchantingXpSource; 6 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 7 | import dev.aurelium.auraskills.common.source.Source; 8 | import org.jetbrains.annotations.NotNull; 9 | import org.jetbrains.annotations.Nullable; 10 | 11 | public class EnchantingSource extends Source implements EnchantingXpSource { 12 | 13 | private final ItemFilter item; 14 | private final String unit; 15 | 16 | public EnchantingSource(AuraSkillsPlugin plugin, SourceValues values, ItemFilter item, String unit) { 17 | super(plugin, values); 18 | this.item = item; 19 | this.unit = unit; 20 | } 21 | 22 | @Override 23 | public @NotNull ItemFilter getItem() { 24 | return item; 25 | } 26 | 27 | @Override 28 | public @Nullable String getUnit() { 29 | return unit; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/parser/EnchantingSourceParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.parser; 2 | 3 | import dev.aurelium.auraskills.api.item.ItemFilter; 4 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 5 | import dev.aurelium.auraskills.common.source.ConfigurateSourceContext; 6 | import dev.aurelium.auraskills.common.source.type.EnchantingSource; 7 | import org.spongepowered.configurate.ConfigurationNode; 8 | import org.spongepowered.configurate.serialize.SerializationException; 9 | 10 | public class EnchantingSourceParser extends SourceParser { 11 | 12 | public EnchantingSourceParser(AuraSkillsPlugin plugin) { 13 | super(plugin); 14 | } 15 | 16 | @Override 17 | public EnchantingSource parse(ConfigurationNode source, ConfigurateSourceContext context) throws SerializationException { 18 | ItemFilter item = context.required(source, "item").get(ItemFilter.class); 19 | String unit = source.node("unit").getString(); 20 | 21 | return new EnchantingSource(plugin, context.parseValues(source), item, unit); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/api/implementation/ApiSourceType.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.api.implementation; 2 | 3 | import dev.aurelium.auraskills.api.registry.NamespacedId; 4 | import dev.aurelium.auraskills.api.source.SourceType; 5 | import dev.aurelium.auraskills.api.source.XpSourceParser; 6 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 7 | 8 | public class ApiSourceType implements SourceType { 9 | 10 | private final AuraSkillsPlugin plugin; 11 | private final NamespacedId id; 12 | private final XpSourceParser parser; 13 | 14 | public ApiSourceType(AuraSkillsPlugin plugin, NamespacedId id, XpSourceParser parser) { 15 | this.plugin = plugin; 16 | this.id = id; 17 | this.parser = parser; 18 | } 19 | 20 | @Override 21 | public NamespacedId getId() { 22 | return id; 23 | } 24 | 25 | @Override 26 | public XpSourceParser getParser() { 27 | return parser; 28 | } 29 | 30 | @Override 31 | public boolean isEnabled() { 32 | return plugin.getSkillManager().isSourceEnabled(this); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/type/BrewingSource.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.type; 2 | 3 | import dev.aurelium.auraskills.api.item.ItemFilter; 4 | import dev.aurelium.auraskills.api.source.SourceValues; 5 | import dev.aurelium.auraskills.api.source.type.BrewingXpSource; 6 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 7 | import dev.aurelium.auraskills.common.source.Source; 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | public class BrewingSource extends Source implements BrewingXpSource { 11 | 12 | private final ItemFilter ingredients; 13 | private final BrewTriggers trigger; 14 | 15 | public BrewingSource(AuraSkillsPlugin plugin, SourceValues values, ItemFilter ingredients, BrewTriggers trigger) { 16 | super(plugin, values); 17 | this.ingredients = ingredients; 18 | this.trigger = trigger; 19 | } 20 | 21 | @Override 22 | public @NotNull ItemFilter getIngredients() { 23 | return ingredients; 24 | } 25 | 26 | @Override 27 | public @NotNull BrewTriggers getTrigger() { 28 | return trigger; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/income/XpIncome.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.income; 2 | 3 | import dev.aurelium.auraskills.api.skill.Skill; 4 | import dev.aurelium.auraskills.api.source.SourceIncome; 5 | import dev.aurelium.auraskills.api.source.SourceValues; 6 | import dev.aurelium.auraskills.api.user.SkillsUser; 7 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 8 | import dev.aurelium.auraskills.common.config.Option; 9 | 10 | public class XpIncome implements SourceIncome { 11 | 12 | private final AuraSkillsPlugin plugin; 13 | private final double incomePerXp; 14 | 15 | public XpIncome(AuraSkillsPlugin plugin, double incomePerXp) { 16 | this.plugin = plugin; 17 | this.incomePerXp = incomePerXp; 18 | } 19 | 20 | @Override 21 | public double getIncomeEarned(SkillsUser user, SourceValues sourceValues, Skill skill, double finalXp) { 22 | if (plugin.configBoolean(Option.JOBS_INCOME_USE_FINAL_XP)) { 23 | return incomePerXp * finalXp; 24 | } else { 25 | return incomePerXp * sourceValues.getXp(); 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/AuraSkillsProvider.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api; 2 | 3 | import org.jetbrains.annotations.ApiStatus.Internal; 4 | 5 | public final class AuraSkillsProvider { 6 | 7 | private static AuraSkillsApi instance = null; 8 | 9 | /** 10 | * Gets the instance of {@link AuraSkillsApi} containing API classes and methods. 11 | * 12 | * @return the API instance 13 | */ 14 | public static AuraSkillsApi getInstance() { 15 | AuraSkillsApi instance = AuraSkillsProvider.instance; 16 | if (instance == null) { 17 | throw new IllegalStateException("AuraSkillsApi is not initialized"); 18 | } 19 | return instance; 20 | } 21 | 22 | @Internal 23 | static void register(AuraSkillsApi instance) { 24 | AuraSkillsProvider.instance = instance; 25 | } 26 | 27 | @Internal 28 | static void unregister() { 29 | AuraSkillsProvider.instance = null; 30 | } 31 | 32 | @Internal 33 | private AuraSkillsProvider() { 34 | throw new UnsupportedOperationException("This class cannot be instantiated"); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/parser/util/PotionDataParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.parser.util; 2 | 3 | import dev.aurelium.auraskills.api.config.ConfigNode; 4 | import dev.aurelium.auraskills.api.item.PotionData; 5 | import dev.aurelium.auraskills.api.source.BaseContext; 6 | import dev.aurelium.auraskills.api.source.UtilityParser; 7 | import dev.aurelium.auraskills.common.item.SourcePotionData; 8 | 9 | public class PotionDataParser implements UtilityParser { 10 | 11 | @Override 12 | public PotionData parse(ConfigNode source, BaseContext context) { 13 | String[] types = context.pluralizedArray("type", source, String.class); 14 | String[] excludedTypes = context.pluralizedArray("excluded_type", source, String.class); 15 | boolean extended = source.node("extended").getBoolean(false); 16 | boolean upgraded = source.node("upgraded").getBoolean(false); 17 | boolean excludeNegative = source.node("exclude_negative").getBoolean(false); 18 | 19 | return new SourcePotionData(types, excludedTypes, extended, upgraded, excludeNegative); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/loot/BukkitLootLoader.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.loot; 2 | 3 | import dev.aurelium.auraskills.api.loot.LootParser; 4 | import dev.aurelium.auraskills.bukkit.loot.parser.EntityLootParser; 5 | import dev.aurelium.auraskills.bukkit.loot.parser.ItemLootParser; 6 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 7 | import dev.aurelium.auraskills.common.loot.CommandLootParser; 8 | import dev.aurelium.auraskills.common.loot.LootLoader; 9 | import dev.aurelium.auraskills.common.loot.LootType; 10 | 11 | public class BukkitLootLoader extends LootLoader { 12 | 13 | private final BukkitLootManager manager; 14 | 15 | public BukkitLootLoader(AuraSkillsPlugin plugin, BukkitLootManager manager) { 16 | super(plugin, manager); 17 | this.manager = manager; 18 | } 19 | 20 | @Override 21 | public LootParser getParser(LootType type) { 22 | return switch (type) { 23 | case ITEM -> new ItemLootParser(manager); 24 | case COMMAND -> new CommandLootParser(); 25 | case ENTITY -> new EntityLootParser(manager); 26 | }; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /common/src/main/resources/sources/agility.yml: -------------------------------------------------------------------------------- 1 | sources: 2 | jump_per_100: 3 | type: jumping 4 | interval: 100 5 | xp: 7 6 | menu_item: 7 | material: feather 8 | unit: '{sources.units.100_jumps}' 9 | fall_damage: 10 | type: damage 11 | xp: 1.4 12 | cause: fall 13 | must_survive: true 14 | use_original_damage: true 15 | menu_item: 16 | material: diamond_boots 17 | unit: '{sources.units.damage}' 18 | walk_per_meter: 19 | type: statistic 20 | multiplier: 0.01 21 | statistic: walk_one_cm 22 | xp: 0.2 23 | minimum_increase: 1000 24 | menu_item: 25 | material: iron_boots 26 | unit: '{sources.units.meter}' 27 | sprint_per_meter: 28 | type: statistic 29 | multiplier: 0.01 30 | statistic: sprint_one_cm 31 | xp: 0.06 32 | minimum_increase: 1000 33 | menu_item: 34 | material: leather_boots 35 | unit: '{sources.units.meter}' 36 | swim_per_meter: 37 | type: statistic 38 | multiplier: 0.01 39 | statistic: swim_one_cm 40 | xp: 0.6 41 | minimum_increase: 1000 42 | menu_item: 43 | material: water_bucket 44 | unit: '{sources.units.meter}' -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/menus/contexts/ManaAbilityContext.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.menus.contexts; 2 | 3 | import dev.aurelium.auraskills.api.mana.ManaAbility; 4 | import dev.aurelium.auraskills.api.registry.NamespacedId; 5 | import dev.aurelium.auraskills.bukkit.AuraSkills; 6 | import dev.aurelium.slate.context.ContextProvider; 7 | import org.jetbrains.annotations.Nullable; 8 | 9 | public class ManaAbilityContext implements ContextProvider { 10 | 11 | private final AuraSkills plugin; 12 | 13 | public ManaAbilityContext(AuraSkills plugin) { 14 | this.plugin = plugin; 15 | } 16 | 17 | @Override 18 | public Class getType() { 19 | return ManaAbility.class; 20 | } 21 | 22 | @Override 23 | @Nullable 24 | public ManaAbility parse(String menuName, String input) { 25 | ManaAbility manaAbility = plugin.getManaAbilityRegistry().getOrNull(NamespacedId.fromDefault(input)); 26 | if (manaAbility != null && manaAbility.isEnabled()) { 27 | return manaAbility; 28 | } else { 29 | return null; 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/loot/LootOptioned.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.loot; 2 | 3 | import org.jetbrains.annotations.Nullable; 4 | 5 | import java.util.Map; 6 | import java.util.UUID; 7 | 8 | public class LootOptioned { 9 | 10 | protected final Map options; 11 | private final LootRequirements requirements; 12 | 13 | public LootOptioned(Map options, LootRequirements requirements) { 14 | this.options = options; 15 | this.requirements = requirements; 16 | } 17 | 18 | public Map getOptions() { 19 | return options; 20 | } 21 | 22 | @Nullable 23 | public T getOption(String key, Class type) { 24 | Object o = options.get(key); 25 | if (o == null) return null; 26 | return type.cast(o); 27 | } 28 | 29 | public T getOption(String key, Class type, T def) { 30 | Object o = options.get(key); 31 | if (o == null) return def; 32 | return type.cast(o); 33 | } 34 | 35 | public boolean checkRequirements(UUID uuid) { 36 | return requirements.checkByUuid(uuid); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/item/TraitModifiers.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.item; 2 | 3 | import org.jetbrains.annotations.Nullable; 4 | 5 | import java.util.Locale; 6 | 7 | public enum TraitModifiers implements BuiltInModifier { 8 | 9 | BOUNTIFUL_HARVEST("farming_luck_ability"), 10 | LUMBERJACK("foraging_luck_ability"), 11 | LUCKY_MINER("mining_luck_ability"), 12 | LUCKY_CATCH("fishing_luck_ability"), 13 | BIGGER_SCOOP("excavation_luck_ability"), 14 | FLEETING("auraskills/fleeting"); 15 | 16 | private final String id; 17 | 18 | TraitModifiers(String id) { 19 | this.id = id; 20 | } 21 | 22 | @Nullable 23 | public static TraitModifiers fromId(String id) { 24 | for (TraitModifiers instance : TraitModifiers.values()) { 25 | if (instance.getModifierId().equals(id)) { 26 | return instance; 27 | } 28 | } 29 | return null; 30 | } 31 | 32 | public String getModifierId() { 33 | return id; 34 | } 35 | 36 | public String getMessageName() { 37 | return this.name().toLowerCase(Locale.ROOT); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/ability/AbilityImpl.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.ability; 2 | 3 | import dev.aurelium.auraskills.api.ability.Ability; 4 | import dev.aurelium.auraskills.common.user.User; 5 | 6 | import java.util.ArrayList; 7 | import java.util.Arrays; 8 | import java.util.List; 9 | import java.util.Random; 10 | 11 | public class AbilityImpl { 12 | 13 | protected final Random rand = new Random(); 14 | private final List abilities = new ArrayList<>(); 15 | 16 | public AbilityImpl(Ability... abilities) { 17 | this.abilities.addAll(Arrays.asList(abilities)); 18 | } 19 | 20 | public List getAbilities() { 21 | return abilities; 22 | } 23 | 24 | public String replaceDescPlaceholders(String input, Ability ability, User user) { 25 | return input; 26 | } 27 | 28 | protected double getValue(Ability ability, User user) { 29 | return ability.getValue(user.getAbilityLevel(ability)); 30 | } 31 | 32 | protected double getSecondaryValue(Ability ability, User user) { 33 | return ability.getSecondaryValue(user.getAbilityLevel(ability)); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/hooks/mythicmobs/HasManaCondition.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.hooks.mythicmobs; 2 | 3 | import dev.aurelium.auraskills.bukkit.AuraSkills; 4 | import io.lumine.mythic.api.skills.SkillCaster; 5 | import io.lumine.mythic.api.skills.conditions.ICasterCondition; 6 | import io.lumine.mythic.bukkit.BukkitAdapter; 7 | import io.lumine.mythic.bukkit.events.MythicConditionLoadEvent; 8 | import io.lumine.mythic.core.utils.annotations.MythicCondition; 9 | 10 | @MythicCondition(name = "hasMana") 11 | public class HasManaCondition implements ICasterCondition { 12 | 13 | private final AuraSkills plugin; 14 | private final double requiredMana; 15 | 16 | public HasManaCondition(AuraSkills plugin, MythicConditionLoadEvent loader) { 17 | this.plugin = plugin; 18 | this.requiredMana = loader.getConfig().getDouble(new String[]{"mana", "m"}, 0); 19 | } 20 | 21 | @Override 22 | public boolean check(SkillCaster caster) { 23 | if (!caster.getEntity().isPlayer()) return false; 24 | return plugin.getUser(BukkitAdapter.adapt(caster.getEntity().asPlayer())).getMana() >= requiredMana; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/reward/builder/ItemRewardBuilder.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.reward.builder; 2 | 3 | import dev.aurelium.auraskills.api.registry.NamespacedId; 4 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 5 | import dev.aurelium.auraskills.common.reward.SkillReward; 6 | import dev.aurelium.auraskills.common.reward.type.ItemReward; 7 | import dev.aurelium.auraskills.common.util.data.Validate; 8 | 9 | public class ItemRewardBuilder extends MessagedRewardBuilder { 10 | 11 | private NamespacedId itemKey; 12 | private int amount; 13 | 14 | public ItemRewardBuilder(AuraSkillsPlugin plugin) { 15 | super(plugin); 16 | } 17 | 18 | public ItemRewardBuilder itemKey(NamespacedId itemKey) { 19 | this.itemKey = itemKey; 20 | return this; 21 | } 22 | 23 | public ItemRewardBuilder amount(int amount) { 24 | this.amount = amount; 25 | return this; 26 | } 27 | 28 | @Override 29 | public SkillReward build() { 30 | Validate.allNotNull("key", itemKey); 31 | return new ItemReward(plugin, skill, menuMessage, chatMessage, itemKey, amount); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/source/parser/StatisticSourceParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.source.parser; 2 | 3 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 4 | import dev.aurelium.auraskills.common.source.ConfigurateSourceContext; 5 | import dev.aurelium.auraskills.common.source.type.StatisticSource; 6 | import org.spongepowered.configurate.ConfigurationNode; 7 | import org.spongepowered.configurate.serialize.SerializationException; 8 | 9 | public class StatisticSourceParser extends SourceParser { 10 | 11 | public StatisticSourceParser(AuraSkillsPlugin plugin) { 12 | super(plugin); 13 | } 14 | 15 | @Override 16 | public StatisticSource parse(ConfigurationNode source, ConfigurateSourceContext context) throws SerializationException { 17 | String statistic = context.required(source, "statistic").getString(); 18 | double multiplier = source.node("multiplier").getDouble(1.0); 19 | int minimumIncrease = source.node("minimum_increase").getInt(1); 20 | 21 | return new StatisticSource(plugin, context.parseValues(source), statistic, multiplier, minimumIncrease); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /api/src/main/java/dev/aurelium/auraskills/api/ability/AbilityProvider.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.api.ability; 2 | 3 | import dev.aurelium.auraskills.api.option.OptionedProvider; 4 | import dev.aurelium.auraskills.api.skill.Skill; 5 | 6 | import java.util.Locale; 7 | 8 | public interface AbilityProvider extends OptionedProvider { 9 | 10 | Skill getSkill(Ability ability); 11 | 12 | String getDisplayName(Ability ability, Locale locale, boolean formatted); 13 | 14 | String getDescription(Ability ability, Locale locale, boolean formatted); 15 | 16 | String getInfo(Ability ability, Locale locale, boolean formatted); 17 | 18 | boolean isEnabled(Ability ability); 19 | 20 | double getBaseValue(Ability ability); 21 | 22 | double getSecondaryBaseValue(Ability ability); 23 | 24 | double getValue(Ability ability, int level); 25 | 26 | double getValuePerLevel(Ability ability); 27 | 28 | double getSecondaryValuePerLevel(Ability ability); 29 | 30 | double getSecondaryValue(Ability ability, int level); 31 | 32 | int getUnlock(Ability ability); 33 | 34 | int getLevelUp(Ability ability); 35 | 36 | int getMaxLevel(Ability ability); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/loot/entity/VanillaEntityParser.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.loot.entity; 2 | 3 | import dev.aurelium.auraskills.bukkit.AuraSkills; 4 | import dev.aurelium.auraskills.bukkit.loot.parser.CustomEntityParser; 5 | import org.spongepowered.configurate.ConfigurationNode; 6 | 7 | public class VanillaEntityParser implements CustomEntityParser { 8 | 9 | private final AuraSkills plugin; 10 | 11 | public VanillaEntityParser(AuraSkills plugin) { 12 | this.plugin = plugin; 13 | } 14 | 15 | @Override 16 | public EntitySupplier getEntitySupplier(ConfigurationNode config) { 17 | return new VanillaEntitySupplier(EntityProperties.fromConfig(config, plugin)); 18 | } 19 | 20 | @Override 21 | public boolean shouldUseParser(ConfigurationNode config) { 22 | String entity = config.node("entity").getString(); 23 | 24 | if (entity == null) return false; 25 | 26 | // If it has a colon, it's a custom entity 27 | // But if it starts with minecraft:, it's a vanilla entity stated explicitly 28 | return !entity.contains(":") || entity.startsWith("minecraft:"); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/trait/CritChanceTrait.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.trait; 2 | 3 | import dev.aurelium.auraskills.api.trait.Trait; 4 | import dev.aurelium.auraskills.api.trait.Traits; 5 | import dev.aurelium.auraskills.api.util.NumberUtil; 6 | import dev.aurelium.auraskills.bukkit.AuraSkills; 7 | import dev.aurelium.auraskills.common.user.User; 8 | import org.bukkit.entity.Player; 9 | 10 | import java.util.Locale; 11 | import java.util.Random; 12 | 13 | public class CritChanceTrait extends TraitImpl { 14 | 15 | private final Random rand = new Random(); 16 | 17 | CritChanceTrait(AuraSkills plugin) { 18 | super(plugin, Traits.CRIT_CHANCE); 19 | } 20 | 21 | @Override 22 | public double getBaseLevel(Player player, Trait trait) { 23 | return Traits.CRIT_CHANCE.optionDouble("base"); 24 | } 25 | 26 | @Override 27 | public String getMenuDisplay(double value, Trait trait, Locale locale) { 28 | return NumberUtil.format1(value) + "%"; 29 | } 30 | 31 | public boolean isCrit(User user) { 32 | return rand.nextDouble() < (user.getEffectiveTraitLevel(Traits.CRIT_CHANCE) / 100); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/ability/AbilityConfig.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.ability; 2 | 3 | import dev.aurelium.auraskills.common.util.data.OptionProvider; 4 | 5 | import java.util.Map; 6 | 7 | public class AbilityConfig extends OptionProvider { 8 | 9 | public AbilityConfig(Map optionMap) { 10 | super(optionMap); 11 | } 12 | 13 | public boolean enabled() { 14 | return getBoolean("enabled"); 15 | } 16 | 17 | public double baseValue() { 18 | return getDouble("base_value"); 19 | } 20 | 21 | public double valuePerLevel() { 22 | return getDouble("value_per_level"); 23 | } 24 | 25 | public double secondaryBaseValue() { 26 | return getDouble("secondary_base_value", 0.0); 27 | } 28 | 29 | public double secondaryValuePerLevel() { 30 | return getDouble("secondary_value_per_level", 0.0); 31 | } 32 | 33 | public int unlock() { 34 | return getInt("unlock"); 35 | } 36 | 37 | public int levelUp() { 38 | return getInt("level_up"); 39 | } 40 | 41 | public int maxLevel() { 42 | return getInt("max_level"); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/reward/SkillReward.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.reward; 2 | 3 | import dev.aurelium.auraskills.api.skill.Skill; 4 | import dev.aurelium.auraskills.common.AuraSkillsPlugin; 5 | import dev.aurelium.auraskills.common.hooks.HookManager; 6 | import dev.aurelium.auraskills.common.user.User; 7 | import org.jetbrains.annotations.Nullable; 8 | 9 | import java.util.Locale; 10 | 11 | public abstract class SkillReward { 12 | 13 | protected final AuraSkillsPlugin plugin; 14 | protected final HookManager hooks; 15 | private final Skill skill; 16 | 17 | public SkillReward(AuraSkillsPlugin plugin, Skill skill) { 18 | this.plugin = plugin; 19 | this.hooks = plugin.getHookManager(); 20 | this.skill = skill; 21 | } 22 | 23 | public Skill getSkill() { 24 | return skill; 25 | } 26 | 27 | public abstract void giveReward(User user, Skill skill, int level); 28 | 29 | @Nullable 30 | public abstract String getMenuMessage(User user, Locale locale, Skill skill, int level); 31 | 32 | @Nullable 33 | public abstract String getChatMessage(User user, Locale locale, Skill skill, int level); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/damage/DamageHandler.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.damage; 2 | 3 | import dev.aurelium.auraskills.api.damage.DamageMeta; 4 | import dev.aurelium.auraskills.api.damage.DamageType; 5 | import dev.aurelium.auraskills.api.event.damage.DamageEvent; 6 | import dev.aurelium.auraskills.common.damage.DamageResult; 7 | import org.bukkit.Bukkit; 8 | import org.bukkit.entity.Entity; 9 | import org.bukkit.event.entity.EntityDamageEvent; 10 | import org.jetbrains.annotations.Nullable; 11 | 12 | public class DamageHandler { 13 | 14 | public DamageResult handleDamage(@Nullable Entity attacker, Entity target, DamageType damageType, EntityDamageEvent.DamageCause damageCause, double damage, String source) { 15 | var damageMeta = new DamageMeta(attacker, target, damageType, damageCause, damage, source); 16 | 17 | var event = new DamageEvent(damageMeta); 18 | Bukkit.getPluginManager().callEvent(event); 19 | 20 | if (event.isCancelled()) { 21 | return new DamageResult(damage, true); 22 | } 23 | 24 | double finalDamage = event.getModifiedDamage(); 25 | 26 | return new DamageResult(finalDamage, false); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /bukkit/src/main/java/dev/aurelium/auraskills/bukkit/jobs/JobsListener.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.bukkit.jobs; 2 | 3 | import dev.aurelium.auraskills.api.event.skill.XpGainEvent; 4 | import dev.aurelium.auraskills.api.skill.Skill; 5 | import dev.aurelium.auraskills.bukkit.AuraSkills; 6 | import dev.aurelium.auraskills.common.config.Option; 7 | import dev.aurelium.auraskills.common.user.User; 8 | import org.bukkit.event.EventHandler; 9 | import org.bukkit.event.EventPriority; 10 | import org.bukkit.event.Listener; 11 | 12 | public class JobsListener implements Listener { 13 | 14 | private final AuraSkills plugin; 15 | 16 | public JobsListener(AuraSkills plugin) { 17 | this.plugin = plugin; 18 | } 19 | 20 | @EventHandler(priority = EventPriority.LOWEST) 21 | public void blockXpGain(XpGainEvent event) { 22 | if (!plugin.config().jobSelectionEnabled()) return; 23 | if (!plugin.configBoolean(Option.JOBS_SELECTION_DISABLE_UNSELECTED_XP)) return; 24 | 25 | Skill skill = event.getSkill(); 26 | User user = plugin.getUser(event.getPlayer()); 27 | 28 | if (!user.getJobs().contains(skill)) { 29 | event.setCancelled(true); 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /common/src/main/java/dev/aurelium/auraskills/common/message/type/ACFCoreMessage.java: -------------------------------------------------------------------------------- 1 | package dev.aurelium.auraskills.common.message.type; 2 | 3 | import dev.aurelium.auraskills.common.message.MessageKey; 4 | 5 | import java.util.Locale; 6 | 7 | public enum ACFCoreMessage implements MessageKey { 8 | 9 | PERMISSION_DENIED, 10 | PERMISSION_DENIED_PARAMETER, 11 | ERROR_GENERIC_LOGGED, 12 | UNKNOWN_COMMAND, 13 | INVALID_SYNTAX, 14 | ERROR_PREFIX, 15 | ERROR_PERFORMING_COMMAND, 16 | INFO_MESSAGE, 17 | PLEASE_SPECIFY_ONE_OF, 18 | MUST_BE_A_NUMBER, 19 | MUST_BE_MIN_LENGTH, 20 | MUST_BE_MAX_LENGTH, 21 | PLEASE_SPECIFY_AT_LEAST, 22 | PLEASE_SPECIFY_AT_MOST, 23 | NOT_ALLOWED_ON_CONSOLE, 24 | COULD_NOT_FIND_PLAYER, 25 | NO_COMMAND_MATCHED_SEARCH, 26 | HELP_PAGE_INFORMATION, 27 | HELP_NO_RESULTS, 28 | HELP_HEADER, 29 | HELP_FORMAT, 30 | HELP_DETAILED_HEADER, 31 | HELP_DETAILED_COMMAND_FORMAT, 32 | HELP_DETAILED_PARAMETER_FORMAT, 33 | HELP_SEARCH_HEADER; 34 | 35 | private final String path = "acf.core." + this.name().toLowerCase(Locale.ROOT); 36 | 37 | @Override 38 | public String getPath() { 39 | return path; 40 | } 41 | 42 | } 43 | --------------------------------------------------------------------------------