Skip to content

Commit

Permalink
Added configurable max chunks limit for the claim fill command
Browse files Browse the repository at this point in the history
  • Loading branch information
dmccoystephenson committed Dec 31, 2023
1 parent bdbd4c4 commit 6561ecb
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ class MfFactionClaimFillCommand(private val plugin: MedievalFactions) : CommandE
sender.sendMessage("$RED${plugin.language["CommandFactionClaimFillNoClaimableChunks"]}")
return@saveChunks
}
val claimFillMaxChunks = plugin.config.getInt("factions.claimFillMaxChunks", -1)
if (claimFillMaxChunks > 0 && claimableChunks.size > claimFillMaxChunks) {
sender.sendMessage("$RED${plugin.language["CommandFactionClaimFillTooManyChunks", plugin.config.getInt("factions.claimFillMaxChunks").toString()]}")
return@saveChunks
}
if (plugin.config.getBoolean("factions.limitLand") && claimableChunks.size + claimService.getClaims(faction.id).size > faction.power) {
sender.sendMessage("$RED${plugin.language["CommandFactionClaimFillReachedDemesneLimit", decimalFormat.format(floor(faction.power))]}")
return@saveChunks
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 @@ -71,6 +71,7 @@ factions:
factionlessFactionName: Factionless
factionHomeTeleportDelay: 5
maxMembers: -1
claimFillMaxChunks: 100
defaults:
flags:
alliesCanInteractWithLand: false
Expand Down
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.
CommandFactionClaimFillTooManyChunks=Sie können nicht mehr als {0} Chunks gleichzeitig beanspruchen.
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.
CommandFactionClaimFillTooManyChunks=You cannot claim more than {0} chunks at once.
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.
CommandFactionClaimFillTooManyChunks=You cannot claim more than {0} chunks at once.
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.
CommandFactionClaimFillTooManyChunks=Vous ne pouvez pas réclamer plus de {0} morceaux à la fois.

0 comments on commit 6561ecb

Please sign in to comment.