Package org.kingdoms.managers.invasions
Class Invasion
java.lang.Object
org.kingdoms.managers.invasions.Invasion
- All Implemented Interfaces:
org.kingdoms.constants.namespace.NamespacedMetadataContainer,org.kingdoms.locale.provider.MessageContextProvider
- Direct Known Subclasses:
Plunder
public class Invasion
extends Object
implements org.kingdoms.constants.namespace.NamespacedMetadataContainer, org.kingdoms.locale.provider.MessageContextProvider
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Set<SimpleChunkLocation>protected final Kingdomprotected org.kingdoms.utils.bossbars.BossBarSessionprotected doubleprotected org.bukkit.entity.Creatureprotected final Kingdomprotected intprotected org.kingdoms.utils.bossbars.BossBarSessionprotected doubleprotected longprotected final KingdomPlayerprotected intprotected final org.bukkit.entity.Playerstatic final Stringprotected final Landprotected org.bukkit.scheduler.BukkitTaskprotected final booleanprotected TracedObject<Invasion.Result>protected booleanprotected booleanprotected final longprotected org.bukkit.Locationprotected org.bukkit.scheduler.BukkitTaskprotected org.kingdoms.utils.bossbars.BossBarSession -
Constructor Summary
ConstructorsConstructorDescriptionInvasion(KingdomPlayer invader, Land originLand, Set<SimpleChunkLocation> affectedLands, org.bukkit.Location startLocation, boolean ransackMode) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttackerScore(double amount) voidaddBossBar(org.bukkit.entity.Player player, boolean attacker) voidvoidaddDefenderScore(double amount) voidaddMessageContextEdits(@NotNull MessageBuilder builder) voidprotected voidcleanup()voidend(Invasion.Result result) voidstatic voidforAllRelatedRangedBossBarInvasions(Kingdom kingdom, Consumer<Invasion> action) org.kingdoms.utils.bossbars.BossBarSessiondouble@Nullable org.bukkit.entity.CreaturegetCooldown(Kingdom attacker, Kingdom defender) longintorg.kingdoms.utils.bossbars.BossBarSessiondoublelongList<org.bukkit.entity.LivingEntity>intorg.bukkit.entity.Playerstatic @Nullable InvasiongetInvasion(@NonNull org.bukkit.entity.LivingEntity entity) static InvasiongetInvasionFromChampion(@NonNull org.bukkit.entity.LivingEntity entity) Deprecated.longgetStart()org.bukkit.Locationorg.kingdoms.utils.bossbars.BossBarSessionlongbooleanhasEnded()booleanisAffected(SimpleChunkLocation chunk) booleanbooleanprotected static voidperformCommands(org.bukkit.entity.Player player) voidremoveBossBar(org.bukkit.entity.Player player) voidsetAttackerScore(double attackerScore) voidsetDefenderDeathLimit(int defenderDeathLimit) voidsetDefenderScore(double defenderScore) voidsetDuration(long duration) voidsetInvaderDeathLimit(int invaderDeathLimit) voidsetPreparationTask(org.bukkit.scheduler.BukkitTask preparationTask) voidsetTask(org.bukkit.scheduler.BukkitTask task) voidbooleanvoidspawnChampion(org.bukkit.Location spawnLocation) voidstart()voidupdateProgress(org.kingdoms.utils.bossbars.BossBarSession bossBar, double progress, Object[] edits) voidupdateRangedBossBar(double range, org.bukkit.Location location) voidupdateTimeLimitBossBar(long timePassed, Kingdom kingdom, Supplier<Double> progressSupplier, Object[] edits) org.bukkit.scheduler.BukkitTaskMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.kingdoms.locale.provider.MessageContextProvider
getMessageContext
-
Field Details
-
METADATA
- See Also:
-
ransackMode
protected final boolean ransackMode -
affectedLands
-
originLand
-
defender
-
attacker
-
startLocation
protected org.bukkit.Location startLocation -
champion
protected org.bukkit.entity.Creature champion -
start
protected final long start -
attackerProgress
protected org.kingdoms.utils.bossbars.BossBarSession attackerProgress -
defenderProgress
protected org.kingdoms.utils.bossbars.BossBarSession defenderProgress -
timeLimitProgress
protected org.kingdoms.utils.bossbars.BossBarSession timeLimitProgress -
invader
-
invaderPlayer
protected final org.bukkit.entity.Player invaderPlayer -
showBossBarToAllPlayers
protected boolean showBossBarToAllPlayers -
reverseProgress
protected boolean reverseProgress -
duration
protected long duration -
task
protected org.bukkit.scheduler.BukkitTask task -
attackerScore
protected double attackerScore -
defenderScore
protected double defenderScore -
result
-
preparationTask
protected org.bukkit.scheduler.BukkitTask preparationTask -
invaderDeathLimit
protected int invaderDeathLimit -
defenderDeathLimit
protected int defenderDeathLimit
-
-
Constructor Details
-
Invasion
public Invasion(KingdomPlayer invader, Land originLand, Set<SimpleChunkLocation> affectedLands, org.bukkit.Location startLocation, boolean ransackMode)
-
-
Method Details
-
finalizePreparation
public void finalizePreparation() -
setPreparationTask
public void setPreparationTask(org.bukkit.scheduler.BukkitTask preparationTask) -
spawnChampion
public void spawnChampion(org.bukkit.Location spawnLocation) -
setupBossBars
public void setupBossBars() -
isRansackMode
public boolean isRansackMode() -
start
public void start() -
forAllRelatedRangedBossBarInvasions
-
performCommands
protected static void performCommands(org.bukkit.entity.Player player) -
getCapitalProtection
-
getCooldown
-
getInvasion
-
getInvasionFromChampion
-
getDuration
public long getDuration() -
setDuration
public void setDuration(long duration) -
updateTimeLimitBossBar
-
addMessageContextEdits
- Specified by:
addMessageContextEditsin interfaceorg.kingdoms.locale.provider.MessageContextProvider
-
updateProgress
public void updateProgress(org.kingdoms.utils.bossbars.BossBarSession bossBar, double progress, Object[] edits) -
addBossBarToAllMembers
public void addBossBarToAllMembers() -
updateRangedBossBar
public void updateRangedBossBar(double range, org.bukkit.Location location) -
setTask
public void setTask(org.bukkit.scheduler.BukkitTask task) -
showBossBarToAllPlayers
public boolean showBossBarToAllPlayers() -
removeBossBar
public void removeBossBar(org.bukkit.entity.Player player) -
addBossBar
public void addBossBar(org.bukkit.entity.Player player, boolean attacker) -
getDefenderProgress
public org.kingdoms.utils.bossbars.BossBarSession getDefenderProgress() -
championAbilitiesTick
public void championAbilitiesTick() -
useStandardTask
public org.bukkit.scheduler.BukkitTask useStandardTask() -
getDefaultDuration
public long getDefaultDuration() -
getAttackerProgress
public org.kingdoms.utils.bossbars.BossBarSession getAttackerProgress() -
getTimeLimitProgress
public org.kingdoms.utils.bossbars.BossBarSession getTimeLimitProgress() -
getResult
-
end
-
cleanup
protected void cleanup() -
hasEnded
public boolean hasEnded() -
getInvader
-
getOriginLand
Deprecated.UsegetStartLocation()instead.The land which the invasion originated from. This is simply the location that the player used/k invadefrom which also has a more precise location that isgetStartLocation() -
getEntitiesInArea
-
isAffected
-
getDefender
-
getChampion
public @Nullable org.bukkit.entity.Creature getChampion() -
getStart
public long getStart() -
getTimePassed
public long getTimePassed() -
getStartLocation
public org.bukkit.Location getStartLocation() -
getDefenderScore
public double getDefenderScore() -
getAffectedLands
-
setDefenderScore
public void setDefenderScore(double defenderScore) -
getAttackerScore
public double getAttackerScore() -
setAttackerScore
public void setAttackerScore(double attackerScore) -
addDefenderScore
public void addDefenderScore(double amount) -
addAttackerScore
public void addAttackerScore(double amount) -
isPreparing
public boolean isPreparing() -
getInvaderPlayer
public org.bukkit.entity.Player getInvaderPlayer() -
getAttacker
-
getInvaderDeathLimit
public int getInvaderDeathLimit() -
setInvaderDeathLimit
public void setInvaderDeathLimit(int invaderDeathLimit) -
getDefenderDeathLimit
public int getDefenderDeathLimit() -
setDefenderDeathLimit
public void setDefenderDeathLimit(int defenderDeathLimit) -
getMetadata
- Specified by:
getMetadatain interfaceorg.kingdoms.constants.namespace.NamespacedMetadataContainer
-
getStartLocation()instead.