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.CascadingMessageContextProvider,org.kingdoms.locale.provider.MessageContextProvider
- Direct Known Subclasses:
Plunder
public class Invasion
extends Object
implements org.kingdoms.constants.namespace.NamespacedMetadataContainer, org.kingdoms.locale.provider.CascadingMessageContextProvider
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Set<SimpleChunkLocation> protected final Kingdomprotected intprotected org.kingdoms.utils.bossbars.BossBarSessionprotected doubleprotected org.bukkit.entity.Creatureprotected final Kingdomprotected intprotected org.kingdoms.utils.bossbars.BossBarSessionprotected doubleprotected longprotected final KingdomPlayerprotected final org.bukkit.entity.Playerstatic final Stringprotected final Landprotected org.kingdoms.scheduler.ScheduledTaskprotected final booleanprotected TracedObject<Invasion.Result> protected booleanprotected booleanprotected final longprotected org.bukkit.Locationprotected org.kingdoms.scheduler.ScheduledTaskprotected 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 MessagePlaceholderProvider builder) voidprotected voidcleanup()voidend(Invasion.Result result) voidstatic voidforAllRelatedRangedBossBarInvasions(Kingdom kingdom, Consumer<Invasion> action) voidintorg.kingdoms.utils.bossbars.BossBarSessiondouble@Nullable org.bukkit.entity.CreaturegetCooldown(Kingdom attacker, Kingdom defender) longintorg.kingdoms.utils.bossbars.BossBarSessiondoublelongList<org.bukkit.entity.LivingEntity> org.bukkit.entity.Playerstatic @Nullable InvasiongetInvasion(@NonNull org.bukkit.entity.LivingEntity entity) static InvasiongetInvasionFromChampion(@NonNull org.bukkit.entity.LivingEntity entity) org.kingdoms.constants.namespace.NamespacedMap<Object> Deprecated.longgetStart()org.bukkit.Locationorg.kingdoms.utils.bossbars.BossBarSessionlongprotected doublebooleanhasEnded()booleanisAffected(SimpleChunkLocation chunk) booleanWhether the countdown has ended and the champion spawned.booleanprotected static voidperformCommands(org.bukkit.entity.Player player) voidremoveBossBar(org.bukkit.entity.Player player) voidsetAttackerDeathLimit(int attackerDeathLimit) voidsetAttackerScore(double attackerScore) voidsetDefenderDeathLimit(int defenderDeathLimit) voidsetDefenderScore(double defenderScore) voidsetDuration(long duration) voidsetPreparationTask(org.kingdoms.scheduler.ScheduledTask preparationTask) voidsetTask(org.kingdoms.scheduler.ScheduledTask task) voidbooleanvoidspawnChampion(org.bukkit.Location spawnLocation) voidstart()voidupdateProgress(org.kingdoms.utils.bossbars.BossBarSession bossBar, double progress) voidupdateRangedBossBar(double range, org.bukkit.Location location) voidupdateTimeLimitBossBar(long timePassed, Kingdom kingdom, Supplier<Double> progressSupplier) org.kingdoms.scheduler.ScheduledTaskMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.kingdoms.locale.provider.CascadingMessageContextProvider
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.kingdoms.scheduler.ScheduledTask task -
attackerScore
protected double attackerScore -
defenderScore
protected double defenderScore -
result
-
preparationTask
protected org.kingdoms.scheduler.ScheduledTask preparationTask -
attackerDeathLimit
protected int attackerDeathLimit -
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.kingdoms.scheduler.ScheduledTask 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.CascadingMessageContextProvider
-
updateProgress
public void updateProgress(org.kingdoms.utils.bossbars.BossBarSession bossBar, double progress) -
addBossBarToAllMembers
public void addBossBarToAllMembers() -
updateRangedBossBar
public void updateRangedBossBar(double range, org.bukkit.Location location) -
setTask
public void setTask(org.kingdoms.scheduler.ScheduledTask 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() -
getVisualRange
protected double getVisualRange() -
useStandardTask
public org.kingdoms.scheduler.ScheduledTask useStandardTask() -
getDefaultDuration
public long getDefaultDuration() -
getAttackerProgress
public org.kingdoms.utils.bossbars.BossBarSession getAttackerProgress() -
getTimeLimitProgress
public org.kingdoms.utils.bossbars.BossBarSession getTimeLimitProgress() -
getResult
-
cleanup
protected void cleanup() -
hasEnded
public boolean hasEnded() -
end
-
generateChestBonuses
public void generateChestBonuses() -
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()Whether the countdown has ended and the champion spawned. -
getInvaderPlayer
public org.bukkit.entity.Player getInvaderPlayer() -
getAttacker
-
getAttackerDeathLimit
public int getAttackerDeathLimit() -
setAttackerDeathLimit
public void setAttackerDeathLimit(int attackerDeathLimit) -
getDefenderDeathLimit
public int getDefenderDeathLimit() -
setDefenderDeathLimit
public void setDefenderDeathLimit(int defenderDeathLimit) -
getMetadata
- Specified by:
getMetadatain interfaceorg.kingdoms.constants.namespace.NamespacedMetadataContainer
-
getStartLocation()instead.