Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config Option - Only Render Territories Upon Startup #1768

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ class MedievalFactions : JavaPlugin() {
MedievalFactionsPlaceholderExpansion(this).register()
}

if (config.getBoolean("dynmap.onlyRenderTerritoriesUponStartup")) {
logger.info(language["DynmapOnlyRenderTerritoriesUponStartupEnabled"])
}

if (dynmapService != null) {
factionService.factions.forEach { faction ->
dynmapService.scheduleUpdateClaims(faction)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class MfClaimService(private val plugin: MedievalFactions, private val repositor
}
)
val dynmapService = plugin.services.dynmapService
if (dynmapService != null) {
if (dynmapService != null && !plugin.config.getBoolean("dynmap.onlyRenderTerritoriesUponStartup")) {
plugin.server.scheduler.runTask(
plugin,
Runnable {
Expand Down Expand Up @@ -167,7 +167,7 @@ class MfClaimService(private val plugin: MedievalFactions, private val repositor
if (dynmapService != null) {
val factionService = plugin.services.factionService
val faction = factionService.getFaction(claim.factionId)
if (faction != null) {
if (faction != null && !plugin.config.getBoolean("dynmap.onlyRenderTerritoriesUponStartup")) {
plugin.server.scheduler.runTask(
plugin,
Runnable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class MfFactionService(private val plugin: MedievalFactions, private val reposit
val result = repository.upsert(factionToSave)
factionsById[result.id] = result
val dynmapService = plugin.services.dynmapService
if (dynmapService != null) {
if (dynmapService != null && !plugin.config.getBoolean("dynmap.onlyRenderTerritoriesUponStartup")) {
plugin.server.scheduler.runTask(
plugin,
Runnable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class MfPlayerService(private val plugin: MedievalFactions, private val playerRe
if (dynmapService != null) {
val factionService = plugin.services.factionService
val faction = factionService.getFaction(result.id)
if (faction != null) {
if (faction != null && !plugin.config.getBoolean("dynmap.onlyRenderTerritoriesUponStartup")) {
plugin.server.scheduler.runTask(
plugin,
Runnable {
Expand All @@ -74,7 +74,7 @@ class MfPlayerService(private val plugin: MedievalFactions, private val playerRe
playerRepository.decreaseOfflinePlayerPower(onlinePlayerIds)
playersById.putAll(playerRepository.getPlayers().associateBy(MfPlayer::id))
val dynmapService = plugin.services.dynmapService
if (dynmapService != null) {
if (dynmapService != null && !plugin.config.getBoolean("dynmap.onlyRenderTerritoriesUponStartup")) {
val factionService = plugin.services.factionService
factionService.factions.forEach { faction ->
plugin.server.scheduler.runTask(
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,6 @@ duels:
notificationDistance: 64
dynmap:
enableDynmapIntegration: true
onlyRenderTerritoriesUponStartup: false
dev:
enableDevCommands: false
1 change: 1 addition & 0 deletions src/main/resources/lang/lang_de_DE.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1074,3 +1074,4 @@ CommandFactionJoinFactionFull=Die Fraktion, der du beitreten m
CommandFactionAddMemberTargetFactionFull=Die Fraktion, zu der du diesen Spieler hinzuf�gen m�chtest, ist voll.
PlayerInteractEntityFailedToSavePlayer=Der Spieler konnte nicht gespeichert werden.
PlayerInteractEntityCannotTradeWithVillager=Du kannst nicht mit diesem Dorfbewohner handeln.
DynmapOnlyRenderTerritoriesUponStartupEnabled=Die Konfigurationsoption ?dynmap.onlyRenderTerritoriesUponStartup? ist aktiviert. Gebiete werden nur beim Start gerendert.
1 change: 1 addition & 0 deletions src/main/resources/lang/lang_en_GB.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1076,3 +1076,4 @@ CommandFactionJoinFactionFull=The faction you are trying to join is full.
CommandFactionAddMemberTargetFactionFull=The faction you are trying to add a member to is full.
PlayerInteractEntityFailedToSavePlayer=Failed to save player.
PlayerInteractEntityCannotTradeWithVillager=You cannot trade with this villager.
DynmapOnlyRenderTerritoriesUponStartupEnabled=The `dynmap.onlyRenderTerritoriesUponStartup` config option is enabled. Territories will only be rendered upon startup.
1 change: 1 addition & 0 deletions src/main/resources/lang/lang_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1076,3 +1076,4 @@ CommandFactionJoinFactionFull=The faction you are trying to join is full.
CommandFactionAddMemberTargetFactionFull=The faction you are trying to add a member to is full.
PlayerInteractEntityFailedToSavePlayer=Failed to save player.
PlayerInteractEntityCannotTradeWithVillager=You cannot trade with this villager.
DynmapOnlyRenderTerritoriesUponStartupEnabled=The `dynmap.onlyRenderTerritoriesUponStartup` config option is enabled. Territories will only be rendered upon startup.
1 change: 1 addition & 0 deletions src/main/resources/lang/lang_fr_FR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1076,3 +1076,4 @@ CommandFactionJoinFactionFull=La faction est pleine.
CommandFactionAddMemberTargetFactionFull=La faction est pleine.
PlayerInteractEntityFailedToSavePlayer=Impossible de sauvegarder le joueur.
PlayerInteractEntityCannotTradeWithVillager=Vous ne pouvez pas commercer avec ce villageois.
DynmapOnlyRenderTerritoriesUponStartupEnabled=L'option de configuration `dynmap.onlyRenderTerritoriesUponStartup` est activ�e. Les territoires ne seront rendus qu'au d�marrage.