Package dev.kitteh.factions.data
Class MemoryFPlayer
java.lang.Object
dev.kitteh.factions.data.MemoryFPlayer
- All Implemented Interfaces:
FPlayer,Participator,Selectable
- Direct Known Subclasses:
JSONFPlayer
Logged in players always have exactly one FPlayer instance. Logged out players may or may not have an FPlayer
instance. They will always have one if they are part of a faction. This is because only players with a faction are
saved to disk (in order to not waste disk space).
The FPlayer is linked to a minecraft player using the player name.
The same instance is always returned for the same player. This means you can use the == operator. No .equals method necessary.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected @Nullable Factionprotected @Nullable Stringprotected @Nullable Factionprotected ChatTargetprotected intprotected intprotected @Nullable Stringprotected booleanprotected UUIDprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected intprotected longprotected longprotected longprotected FLocationprotected booleanprotected booleanprotected intprotected booleanprotected Stringprotected @Nullable org.bukkit.OfflinePlayerprotected doubleprotected doubleprotected Roleprotected booleanprotected booleanprotected booleanprotected booleanprotected @Nullable Stringprotected @Nullable net.kyori.adventure.text.Componentprotected Stringprotected @Nullable WarmUpUtil.Warmupprotected intprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWarmup(WarmUpUtil.Warmup warmup, int taskId) booleanvoidadminBypass(boolean val) voidalterPower(double delta) org.bukkit.OfflinePlayerGets an OfflinePlayer for the given participator.@Nullable org.bukkit.entity.PlayerasPlayer()voidattemptAutoSetZone(FLocation flocation) booleanattemptClaim(Faction forFaction, FLocation flocation, boolean notifyFailure) booleanattemptClaim(Faction forFaction, org.bukkit.Location location, boolean notifyFailure) booleanattemptUnclaim(Faction forFaction, FLocation flocation, boolean notifyFailure) @Nullable FactionvoidbooleanvoidautoFlying(boolean autoFly) booleanvoidautoLeaveExempt(boolean exempt) @Nullable StringvoidautoSetZone(@Nullable String zone) @Nullable FactionvoidautoUnclaim(@Nullable Faction faction) voidbooleancanClaimForFaction(Faction forFaction) booleancanClaimForFactionAtLocation(Faction forFaction, FLocation flocation, boolean notifyFailure) booleancanFlyAtLocation(FLocation location) voidchatTarget(ChatTarget chatTarget) voidintdeaths()faction()voidvoidbooleanflying()voidflying(boolean fly) voidflying(boolean fly, boolean damage) booleanflyTrail()voidflyTrail(boolean state) @Nullable StringvoidflyTrailEffect(String effect) intbooleanbooleanvoidignoreAllianceChat(boolean ignore) booleanvoidignoreTruceChat(boolean ignore) booleanbooleanbooleanbooleanbooleanbooleanisOnline()booleanintkills()longlongvoidlastStoodAt(FLocation flocation) voidleave(boolean makePay) booleanvoidbooleanvoidmapAutoUpdating(boolean mapAutoUpdating) intvoidmapHeight(int height) booleanvoidmonitorJoins(boolean monitor) voidSends a String.format-able message.name()net.kyori.adventure.text.Componentnet.kyori.adventure.text.ComponentvoidonDeath()voiddoublepower()voidpower(double power) doublevoidpowerBoost(double powerBoost) doublepowerMax()intdoublepowerMin()intintvoidvoidresetFactionData(boolean updateCommands) role()voidbooleanseeChunk()voidseeChunk(boolean seeingChunk) voidvoidsendMessage(@NonNull net.kyori.adventure.text.Component component) Sends a component.voidsendMessageLegacy(String msg) voidsendMessageLegacy(List<String> msgs) voidvoidsetOfflinePlayer(@Nullable org.bukkit.entity.Player player) booleanbooleanshowInfoBoard(Faction toShow) Check if the scoreboard should be shown.booleanvoidshowScoreboard(boolean show) booleanvoidspyingChat(boolean chatSpying) booleanvoidtakeFallDamage(boolean fallDamage) net.kyori.adventure.text.Componenttitle()voidtitle(net.kyori.adventure.text.Component title) uniqueId()voidvoid@Nullable WarmUpUtil.Warmupwarmup()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.kitteh.factions.FPlayer
canFlyAtLocation, eraseData, nameWithTagLegacy, nameWithTitleLegacy, titleLegacy, warmingUpMethods inherited from interface dev.kitteh.factions.Participator
colorLegacyStringTo, describeToLegacy, describeToLegacy, msgLegacy, relationTo, relationTo, sendRichMessage, textColorTo
-
Field Details
-
factionId
protected int factionId -
role
-
titleMM
-
titleComponent
protected transient @Nullable net.kyori.adventure.text.Component titleComponent -
title
-
power
protected double power -
powerBoost
protected double powerBoost -
lastPowerUpdateTime
protected long lastPowerUpdateTime -
lastLoginTime
protected long lastLoginTime -
chatTarget
-
ignoreAllianceChat
protected boolean ignoreAllianceChat -
ignoreTruceChat
protected boolean ignoreTruceChat -
id
-
name
-
monitorJoins
protected boolean monitorJoins -
spyingChat
protected boolean spyingChat -
showScoreboard
protected boolean showScoreboard -
warmup
-
warmupTask
protected int warmupTask -
isAdminBypassing
protected boolean isAdminBypassing -
kills
protected int kills -
deaths
protected int deaths -
willAutoLeave
protected boolean willAutoLeave -
mapHeight
protected int mapHeight -
isFlying
protected boolean isFlying -
isAutoFlying
protected boolean isAutoFlying -
flyTrailsState
protected boolean flyTrailsState -
flyTrailsEffect
-
seeingChunk
protected boolean seeingChunk -
lastStoodAt
-
mapAutoUpdating
protected transient boolean mapAutoUpdating -
autoClaimFor
-
autoSetZone
-
autoUnclaimFor
-
loginPvpDisabled
protected transient boolean loginPvpDisabled -
lastFrostwalkerMessage
protected transient long lastFrostwalkerMessage -
shouldTakeFallDamage
protected transient boolean shouldTakeFallDamage -
offlinePlayer
protected transient @Nullable org.bukkit.OfflinePlayer offlinePlayer
-
-
Constructor Details
-
MemoryFPlayer
-
-
Method Details
-
cleanupDeserialization
public void cleanupDeserialization() -
onLogInOut
public void onLogInOut() -
faction
-
getFactionId
public int getFactionId() -
hasFaction
public boolean hasFaction()- Specified by:
hasFactionin interfaceFPlayer
-
faction
-
monitorJoins
public void monitorJoins(boolean monitor) - Specified by:
monitorJoinsin interfaceFPlayer
-
monitorJoins
public boolean monitorJoins()- Specified by:
monitorJoinsin interfaceFPlayer
-
role
-
role
-
powerBoost
public double powerBoost()- Specified by:
powerBoostin interfaceFPlayer
-
powerBoost
public void powerBoost(double powerBoost) - Specified by:
powerBoostin interfaceFPlayer
-
autoLeaveExempt
public boolean autoLeaveExempt()- Specified by:
autoLeaveExemptin interfaceFPlayer
-
autoLeaveExempt
public void autoLeaveExempt(boolean exempt) - Specified by:
autoLeaveExemptin interfaceFPlayer
-
lastFrostwalkerMessageTime
public long lastFrostwalkerMessageTime()- Specified by:
lastFrostwalkerMessageTimein interfaceFPlayer
-
updateLastFrostwalkerMessageTime
public void updateLastFrostwalkerMessageTime()- Specified by:
updateLastFrostwalkerMessageTimein interfaceFPlayer
-
autoClaim
-
autoClaim
-
autoSetZone
- Specified by:
autoSetZonein interfaceFPlayer
-
autoSetZone
- Specified by:
autoSetZonein interfaceFPlayer
-
autoUnclaim
- Specified by:
autoUnclaimin interfaceFPlayer
-
autoUnclaim
- Specified by:
autoUnclaimin interfaceFPlayer
-
adminBypass
public boolean adminBypass()- Specified by:
adminBypassin interfaceFPlayer
-
isVanished
public boolean isVanished()- Specified by:
isVanishedin interfaceFPlayer
-
adminBypass
public void adminBypass(boolean val) - Specified by:
adminBypassin interfaceFPlayer
-
chatTarget
- Specified by:
chatTargetin interfaceFPlayer
-
chatTarget
- Specified by:
chatTargetin interfaceFPlayer
-
ignoreAllianceChat
public void ignoreAllianceChat(boolean ignore) - Specified by:
ignoreAllianceChatin interfaceFPlayer
-
ignoreAllianceChat
public boolean ignoreAllianceChat()- Specified by:
ignoreAllianceChatin interfaceFPlayer
-
ignoreTruceChat
public void ignoreTruceChat(boolean ignore) - Specified by:
ignoreTruceChatin interfaceFPlayer
-
ignoreTruceChat
public boolean ignoreTruceChat()- Specified by:
ignoreTruceChatin interfaceFPlayer
-
spyingChat
public void spyingChat(boolean chatSpying) - Specified by:
spyingChatin interfaceFPlayer
-
spyingChat
public boolean spyingChat()- Specified by:
spyingChatin interfaceFPlayer
-
asOfflinePlayer
public org.bukkit.OfflinePlayer asOfflinePlayer()Description copied from interface:ParticipatorGets an OfflinePlayer for the given participator.- Specified by:
asOfflinePlayerin interfaceParticipator- Returns:
- offline player representation
-
setOfflinePlayer
public void setOfflinePlayer(@Nullable org.bukkit.entity.Player player) -
resetFactionData
public void resetFactionData()- Specified by:
resetFactionDatain interfaceFPlayer
-
resetFactionData
public void resetFactionData(boolean updateCommands) - Specified by:
resetFactionDatain interfaceFPlayer
-
lastLogin
public long lastLogin() -
mapAutoUpdating
public boolean mapAutoUpdating()- Specified by:
mapAutoUpdatingin interfaceFPlayer
-
mapAutoUpdating
public void mapAutoUpdating(boolean mapAutoUpdating) - Specified by:
mapAutoUpdatingin interfaceFPlayer
-
loginPVPDisabled
public boolean loginPVPDisabled()- Specified by:
loginPVPDisabledin interfaceFPlayer
-
lastStoodAt
- Specified by:
lastStoodAtin interfaceFPlayer
-
lastStoodAt
- Specified by:
lastStoodAtin interfaceFPlayer
-
title
public net.kyori.adventure.text.Component title() -
title
public void title(net.kyori.adventure.text.Component title) -
name
-
setName
-
tagOrEmpty
-
nameWithTitle
public net.kyori.adventure.text.Component nameWithTitle()- Specified by:
nameWithTitlein interfaceFPlayer
-
nameWithTag
public net.kyori.adventure.text.Component nameWithTag()- Specified by:
nameWithTagin interfaceFPlayer
-
kills
public int kills() -
deaths
public int deaths() -
power
public double power() -
power
public void power(double power) -
alterPower
public void alterPower(double delta) - Specified by:
alterPowerin interfaceFPlayer
-
powerMax
public double powerMax() -
powerMin
public double powerMin() -
powerRounded
public int powerRounded()- Specified by:
powerRoundedin interfaceFPlayer
-
powerMaxRounded
public int powerMaxRounded()- Specified by:
powerMaxRoundedin interfaceFPlayer
-
powerMinRounded
public int powerMinRounded()- Specified by:
powerMinRoundedin interfaceFPlayer
-
updatePower
public void updatePower()- Specified by:
updatePowerin interfaceFPlayer
-
losePowerFromBeingOffline
public void losePowerFromBeingOffline()- Specified by:
losePowerFromBeingOfflinein interfaceFPlayer
-
onDeath
public void onDeath() -
isInOwnTerritory
public boolean isInOwnTerritory()- Specified by:
isInOwnTerritoryin interfaceFPlayer
-
isInOthersTerritory
public boolean isInOthersTerritory()- Specified by:
isInOthersTerritoryin interfaceFPlayer
-
isInAllyTerritory
public boolean isInAllyTerritory()- Specified by:
isInAllyTerritoryin interfaceFPlayer
-
isInNeutralTerritory
public boolean isInNeutralTerritory()- Specified by:
isInNeutralTerritoryin interfaceFPlayer
-
isInEnemyTerritory
public boolean isInEnemyTerritory()- Specified by:
isInEnemyTerritoryin interfaceFPlayer
-
sendFactionHereMessage
- Specified by:
sendFactionHereMessagein interfaceFPlayer
-
showInfoBoard
Check if the scoreboard should be shown. Simple method to be used by above method.- Parameters:
toShow- Faction to be shown.- Returns:
- true if should show, otherwise false.
-
showScoreboard
public boolean showScoreboard()- Specified by:
showScoreboardin interfaceFPlayer
-
showScoreboard
public void showScoreboard(boolean show) - Specified by:
showScoreboardin interfaceFPlayer
-
leave
public void leave(boolean makePay) -
attemptAutoSetZone
- Specified by:
attemptAutoSetZonein interfaceFPlayer
-
canClaimForFaction
- Specified by:
canClaimForFactionin interfaceFPlayer
-
canClaimForFactionAtLocation
public boolean canClaimForFactionAtLocation(Faction forFaction, FLocation flocation, boolean notifyFailure) - Specified by:
canClaimForFactionAtLocationin interfaceFPlayer
-
attemptClaim
public boolean attemptClaim(Faction forFaction, org.bukkit.Location location, boolean notifyFailure) - Specified by:
attemptClaimin interfaceFPlayer
-
attemptClaim
- Specified by:
attemptClaimin interfaceFPlayer
-
attemptUnclaim
- Specified by:
attemptUnclaimin interfaceFPlayer
-
shouldBeSaved
public boolean shouldBeSaved() -
msgLegacy
Description copied from interface:ParticipatorSends a String.format-able message.- Specified by:
msgLegacyin interfaceParticipator- Parameters:
str- stringargs- args
-
asPlayer
public @Nullable org.bukkit.entity.Player asPlayer() -
isOnline
public boolean isOnline() -
flightCheck
public void flightCheck()- Specified by:
flightCheckin interfaceFPlayer
-
flying
public boolean flying() -
flying
public void flying(boolean fly) -
flying
public void flying(boolean fly, boolean damage) -
autoFlying
public boolean autoFlying()- Specified by:
autoFlyingin interfaceFPlayer
-
autoFlying
public void autoFlying(boolean autoFly) - Specified by:
autoFlyingin interfaceFPlayer
-
canFlyAtLocation
- Specified by:
canFlyAtLocationin interfaceFPlayer
-
takeFallDamage
public boolean takeFallDamage()- Specified by:
takeFallDamagein interfaceFPlayer
-
takeFallDamage
public void takeFallDamage(boolean fallDamage) - Specified by:
takeFallDamagein interfaceFPlayer
-
seeChunk
public boolean seeChunk() -
seeChunk
public void seeChunk(boolean seeingChunk) -
flyTrail
public boolean flyTrail() -
flyTrail
public void flyTrail(boolean state) -
flyTrailEffect
- Specified by:
flyTrailEffectin interfaceFPlayer
-
flyTrailEffect
- Specified by:
flyTrailEffectin interfaceFPlayer
-
sendMessage
public void sendMessage(@NonNull net.kyori.adventure.text.Component component) Description copied from interface:ParticipatorSends a component.- Specified by:
sendMessagein interfaceParticipator- Parameters:
component- component
-
sendMessageLegacy
- Specified by:
sendMessageLegacyin interfaceFPlayer
-
sendMessageLegacy
- Specified by:
sendMessageLegacyin interfaceFPlayer
-
mapHeight
public int mapHeight() -
mapHeight
public void mapHeight(int height) -
uniqueId
-
cancelWarmup
public void cancelWarmup()- Specified by:
cancelWarmupin interfaceFPlayer
-
warmup
-
addWarmup
-