Skip to content
DiamondDagger590 edited this page May 26, 2020 · 4 revisions

API Notes


Using API

To use the api, consult https://jitpack.io/#Eunoians/McRPG for how to use the releases with either gradle or maven

Abilities

Each player has an instance of every ability called BaseAbility. This contains info related to each ability and can be cast into it's corresponding class. To verify the type, use an enum value from DefaultAbilities or UnlockedAbilities. Both enums are also of the interface GenericAbility to allow accepting either or as a parameter

Skills

Skills follow suit having a similar structure where every skill has an instance called Skill. This can then be type casted into the appropriate class after verifying type integrity by using values from the Skills enum.


McMMO Player


Method Result
getPowerLevel() Returns the current sum of every skill's level
getAbilityPoints() Returns the current amount of ability points a player has
setAbilityPoints(int abilityPoints) Set the amount of ability points a player has
getPendingUnlockAbilities() Returns an array of the abilities a player is waiting to confirm or deny
getBleedImmunity() Returns the true if the player is immune to bleed
setBleedImmunity(boolean immune) Set if the player is immune to bleed
getDisplayType() Returns the DisplayType the player currently has
setDisplayType(DisplayType displayType) Sets the display type of the player
getAbilityLoadout() Returns an array list of UnlockedAbilities that consist of the player's loadout
getIsReadying() Returns boolean if player is readying to use an active ability
setIsReadying(boolean isReadying) Sets if the player is readying to use an active ability.
getReadyingAbilityBit() Gets data containing the cancel ready task and the ability readying
setReadyingAbilityBit(PlayerReadyBit readyBit) Set data containing the cancel ready task and the ability readying
getIsLinkedToRemoteTransfer() Returns true if the player has their Remote Transfer linked
setIsLinkedToRemoteTransfer(boolean isLinked) Set true if the player has their Remote Transfer linked
getCanSmite() Return true if the player can Smite on hit
setCanSmite(boolean canSmite) Set true if the player can Smite on hit
getCanDenseImpact() Return true if the player can Dense Impact on hit
setCanDenseImpact(boolean canDenseImpact) Set true if the player can use Dense Impact on hit
updatePowerLevel() Returns the updated power level of the player
getSkill(Skills skill) Returns the Skill instance of a skill
getSkill(String skill) Returns the Skill instance using a string reference
getBaseAbility(GenericAbility ability) Returns the ability instance of the DefaultAbilities or UnlockedAbilities enum value provided
giveExp(Skills skill, int exp, GainReason gainReason) Gives a player exp into a certain skill
getCooldown(GenericAbility genericAbility) Returns cooldown for a player's ability or -1 if they don't have one
addAbilityOnCooldown(UnlockedAbilities ability, long cooldown) Sets the cooldown for an ability
removeAbilityOnCooldown(UnlockedAbilities ability) Removes ability from list of cooldowns
updateCooldowns() Verifies that all cooldowns haven't expired
saveData() Saves a players data
addPendingAbilityUnlock(UnlockedAbilities abilities) Adds ability to pending list
removePendingAbilityUnlock(UnlockedAbilities abilities) Removes ability from pending list
hasPendingAbility() Checks to see if the player has any pending abilities
addAbilityToLoadout(UnlockedAbilities ability) Adds an ability to a players loadout
doesPlayerHaveAbilityInLoadout(UnlockedAbilities ability) Tests for ability in the loadout
doesPlayerHaveActiveAbilityFromSkill(Skills skill) Tests to see if the player has an Active abilities from a skill
doesPlayerHaveActiveAbilityFromSkill(Skills skill) If they have an active ability for the skill, return it
replaceAbility(UnlockedAbilities oldAbility, UnlockedAbilities newAbility) Replace an old ability in the loadout with a new one

Base Ability


Method Result
getGenericAbility() Returns an enum value which can be type-casted into UnlockedAbilities or DefaultAbilities
isToggled() Returns true if the player has the ability toggled
getCurrentTier() Returns the int for the current tier, if it is 0 then the ability has yet to be unlocked
isUnlocked() Returns true if the ability is unlocked.

Events


Event Name Cause
AbilityActivateEvent Is called when any ability is activated. Event can be type-casted to the specific event
AbilityAddToLoadoutEvent Is called when any ability is added to the player loadout
AbilityRemoveFromLoadoutEvent Is called when any ability is removed from player's loadout
AbilityUnlockEvent Is called when the player unlocks any ability
AbilityUpgradeEvent Is called when the player upgrades any ability
BerserkEvent Is called when the player activates Berserk
BlastMiningEvent Is called when the player activates Blast Mining
BlastTestEvent Is a Block Break event called for when Blast Mining breaks a block
BleedEvent Is called when a player activates Bleed
BleedPlusEvent Is called when a player activates Bleed+
ChestLinkEvent Is called when a player links a chest
CheckUnlinkEvent Is called when a player unlinks a chest
DeeperWoundEvent Is called when a player activates DeeperWound
DenseImpactEvent Is called when a player activates DenseImpact
DiamondFlowersEvent Is called when a player activates DiamondFlowers
DisarmEvent Is called when a player activates Disarm
DoubleDropEvent Is called when a player acivates Double Drop
FakeChestOpenEvent Used for testing Remote Transfer stuff
FarmersDietEvent Is called when a player activates Farmers Diet
IronArmEvent Is called when a player activates Iron Arm
ItsATripleEvent Is called when a player activates Its A Triple
MassHarvestEvent Is called when a player activates Mass Harvest
McMMOPlayerExpGainEvent Is called when a player gains exp
McMMOPlayerLevelChangeEvent Is called when a player changes level(s)
NaturesWrathEvent Is called when a player activates Natures Wrath
OreScannerEvent Is called when a player activates OreScanner
PansBlessingEvent Is called when a player activates Pans Blessing
PreChestLinkEvent Called before the linking process begins
PreRageSpikeEvent Called before the Rage Spike charge
RageSpikeDamageEvent Is called when a player activates Rage Spike Will be changed
ReplantingEvent Is called when a player activates Replanting
RicherOresEvent Is called when a player activates Richer Ores
SerratedStrikesEvent Is called when a player activates Serrated Strikes
SmitingFistEvent Is called when a player activates Smiting Fist
StickyFingersEvent Is called when a player activates Sticky Fingers
SuperBreakerEvent Is called when a player activates Super Breaker
TaintedBladeEvent Is called when a player activates Tainted Blade
TighterGripEvent Is called when a player activates Tighter Grip
TooManyPlantsEvent Is called when a player activates Too Many Plants
VampireEvent Is called when a player activates Vampire
Clone this wiki locally