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

Old Claim Commands Deprecation (Phase 2) #1721

Merged
Merged
Show file tree
Hide file tree
Changes from 4 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 @@ -95,9 +95,13 @@ class MfClaimService(private val plugin: MedievalFactions, private val repositor
val subtitle = "${ChatColor.of(faction.flags[plugin.flags.color])}${faction.description}"
if (plugin.config.getBoolean("factions.titleTerritoryIndicator")) {
player.resetTitle()
player.sendTitle(title, subtitle, plugin.config.getInt("factions.titleTerritoryFadeInLength"),
player.sendTitle(
title,
subtitle,
plugin.config.getInt("factions.titleTerritoryFadeInLength"),
plugin.config.getInt("factions.titleTerritoryDuration"),
plugin.config.getInt("factions.titleTerritoryFadeOutLength"))
plugin.config.getInt("factions.titleTerritoryFadeOutLength")
)
}
if (plugin.config.getBoolean("factions.actionBarTerritoryIndicator")) {
player.spigot().sendMessage(ACTION_BAR, *TextComponent.fromLegacyText(title))
Expand Down Expand Up @@ -141,9 +145,13 @@ class MfClaimService(private val plugin: MedievalFactions, private val repositor
"${ChatColor.of(plugin.config.getString("wilderness.color"))}${plugin.language["Wilderness"]}"
if (plugin.config.getBoolean("factions.titleTerritoryIndicator")) {
player.resetTitle()
player.sendTitle(title, null, plugin.config.getInt("factions.titleTerritoryFadeInLength"),
player.sendTitle(
title,
null,
plugin.config.getInt("factions.titleTerritoryFadeInLength"),
plugin.config.getInt("factions.titleTerritoryDuration"),
plugin.config.getInt("factions.titleTerritoryFadeOutLength"))
plugin.config.getInt("factions.titleTerritoryFadeOutLength")
)
}
if (plugin.config.getBoolean("factions.actionBarTerritoryIndicator")) {
player.spigot().sendMessage(ACTION_BAR, *TextComponent.fromLegacyText(title))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,16 @@ class MfFactionCommand(private val plugin: MedievalFactions) : CommandExecutor,
in devAliases -> factionDevCommand.onCommand(sender, command, label, args.drop(1).toTypedArray())
// Backwards compatibility:
in claimAutoAliases -> {
sender.sendMessage("${RED}Command deprecated, use \"/mf claim auto\" instead")
factionClaimAutoCommand.onCommand(sender, command, label, args.drop(1).toTypedArray())
sender.sendMessage("${RED}${plugin.language["DeprecationWarningAutoclaim"]}")
false
}
in claimFillAliases -> {
sender.sendMessage("${RED}Command deprecated, use \"/mf claim fill\" instead")
factionClaimFillCommand.onCommand(sender, command, label, args.drop(1).toTypedArray())
sender.sendMessage("${RED}${plugin.language["DeprecationWarningFillclaim"]}")
false
}
in claimCheckAliases -> {
sender.sendMessage("${RED}Command deprecated, use \"/mf claim check\" instead")
factionClaimCheckCommand.onCommand(sender, command, label, args.drop(1).toTypedArray())
sender.sendMessage("${RED}${plugin.language["DeprecationWarningCheckclaim"]}")
false
}
else -> {
sender.sendMessage("$AQUA${plugin.language["MedievalFactionsTitle", plugin.description.version]}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,13 @@ class MfFactionSetNameCommand(private val plugin: MedievalFactions) : CommandExe
val subtitle = "${ChatColor.of(updatedFaction.flags[plugin.flags.color])}${updatedFaction.description}"
if (plugin.config.getBoolean("factions.titleTerritoryIndicator")) {
player.resetTitle()
player.sendTitle(title, subtitle, plugin.config.getInt("factions.titleTerritoryFadeInLength"),
player.sendTitle(
title,
subtitle,
plugin.config.getInt("factions.titleTerritoryFadeInLength"),
plugin.config.getInt("factions.titleTerritoryDuration"),
plugin.config.getInt("factions.titleTerritoryFadeOutLength"))
plugin.config.getInt("factions.titleTerritoryFadeOutLength")
)
}
if (plugin.config.getBoolean("factions.actionBarTerritoryIndicator")) {
player.spigot().sendMessage(ACTION_BAR, *TextComponent.fromLegacyText(title))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@ class PlayerJoinListener(private val plugin: MedievalFactions) : Listener {

if (plugin.config.getBoolean("factions.titleTerritoryIndicator")) {
event.player.resetTitle()
event.player.sendTitle(title, subtitle, plugin.config.getInt("factions.titleTerritoryFadeInLength"),
event.player.sendTitle(
title,
subtitle,
plugin.config.getInt("factions.titleTerritoryFadeInLength"),
plugin.config.getInt("factions.titleTerritoryDuration"),
plugin.config.getInt("factions.titleTerritoryFadeOutLength"))
plugin.config.getInt("factions.titleTerritoryFadeOutLength")
)
}
if (plugin.config.getBoolean("factions.actionBarTerritoryIndicator")) {
event.player.spigot().sendMessage(ACTION_BAR, *TextComponent.fromLegacyText(title))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,13 @@ class PlayerMoveListener(private val plugin: MedievalFactions) : Listener {
}
if (plugin.config.getBoolean("factions.titleTerritoryIndicator")) {
event.player.resetTitle()
event.player.sendTitle(title, subtitle, plugin.config.getInt("factions.titleTerritoryFadeInLength"),
event.player.sendTitle(
title,
subtitle,
plugin.config.getInt("factions.titleTerritoryFadeInLength"),
plugin.config.getInt("factions.titleTerritoryDuration"),
plugin.config.getInt("factions.titleTerritoryFadeOutLength"))
plugin.config.getInt("factions.titleTerritoryFadeOutLength")
)
}
if (plugin.config.getBoolean("factions.actionBarTerritoryIndicator")) {
event.player.spigot().sendMessage(ACTION_BAR, *TextComponent.fromLegacyText(title))
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/lang/lang_de_DE.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,9 @@ CommandFactionAddMemberUnknownNewPlayerFaction=Unbekanntes neues Mitglied
CommandFactionAddMemberSuccess=Dieser Spieler ist jetzt Mitglied der angegebenen Fraktion.
CommandFactionHelpAddMember=/faction addmember <player> <faction> - F�gt zwangsweise ein Mitglied zu einer Fraktion hinzu.
CommandFactionRoleSetPermissionCannotModifyRolePermissionToModifyOwnRolePermission=Du kannst die Berechtigung deiner Rolle nicht �ndern, um die Berechtigungen deiner eigenen Rolle zu �ndern.
DeprecationWarningAutoclaim=Warnung: Die automatische Anspruchsfunktion wird in einer zuk�nftigen Version entfernt. Verwenden Sie stattdessen /f claim auto.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe 'Achtung' over 'Warnung', also use impolite form (everything else uses 'du')
Pass this by our translators maybe?

Copy link
Member Author

@dmccoystephenson dmccoystephenson Jun 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had Copilot generate these when usually I use Google Translate. That probably explains the discrepancy.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've posted this in the translator chat.

Google Translate suggested the following:

DeprecationWarningAutoclaim=Befehl veraltet. Verwenden Sie stattdessen /fclaim auto.
DeprecationWarningFillclaim=Befehl veraltet. Verwenden Sie stattdessen /f Claim Fill.
DeprecationWarningCheckclaim=Befehl veraltet. Verwenden Sie stattdessen die Anspruchsprüfung /f.

Copy link
Member

@renbinden renbinden Jul 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about:

DeprecationWarningAutoclaim=Befehl veraltet. Verwendest du stattdessen /f claim auto. 
DeprecationWarningFillclaim=Befehl veraltet. Verwendest du stattdessen /f claim fill.
DeprecationWarningCheckclaim=Befehl veraltet. Verwendest du stattdessen /f claim check.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your suggested translations have been implemented :)

DeprecationWarningFillclaim=Warnung: Die F�llanspruchsfunktion wird in einer zuk�nftigen Version entfernt. Verwenden Sie stattdessen /f claim fill.
DeprecationWarningCheckclaim=Warnung: Die Anspruchspr�fungsfunktion wird in einer zuk�nftigen Version entfernt. Verwenden Sie stattdessen /f claim check.
CommandFactionInviteFactionFull=Die Fraktion, zu der du diesen Spieler einladen m�chtest, ist voll.
CommandFactionJoinFactionFull=Die Fraktion, der du beitreten m�chtest, ist voll.
CommandFactionAddMemberTargetFactionFull=Die Fraktion, zu der du diesen Spieler hinzuf�gen m�chtest, ist voll.
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/lang/lang_en_GB.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,9 @@ CommandFactionInfoAlliesTitle=Allies:
CommandFactionInfoEnemiesTitle=Enemies:
BlockNotLocked=That block is not locked.
CommandFactionRoleSetPermissionCannotModifyRolePermissionToModifyOwnRolePermission=You cannot modify your role''s permission to modify your own role''s permissions.
DeprecationWarningAutoclaim=Command deprecated. Use /f claim auto instead.
DeprecationWarningFillclaim=Command deprecated. Use /f claim fill instead.
DeprecationWarningCheckclaim=Command deprecated. Use /f claim check instead.
CommandFactionInviteFactionFull=You cannot invite any more members to your faction.
CommandFactionJoinFactionFull=The faction you are trying to join is full.
CommandFactionAddMemberTargetFactionFull=The faction you are trying to add a member to is full.
Expand Down
6 changes: 4 additions & 2 deletions src/main/resources/lang/lang_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1068,9 +1068,11 @@ CommandFactionInfoVassalsTitle=Vassals:
CommandFactionInfoAlliesTitle=Allies:
CommandFactionInfoEnemiesTitle=Enemies:
CommandFactionRoleSetPermissionCannotModifyRolePermissionToModifyOwnRolePermission=You cannot modify your role''s permission to modify your own role''s permissions.
DeprecationWarningAutoclaim=Command deprecated. Use /f claim auto instead.
DeprecationWarningFillclaim=Command deprecated. Use /f claim fill instead.
DeprecationWarningCheckclaim=Command deprecated. Use /f claim check instead.
CommandFactionInviteFactionFull=You cannot invite any more members to your faction.
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.
PlayerInteractEntityCannotTradeWithVillager=You cannot trade with this villager.
3 changes: 3 additions & 0 deletions src/main/resources/lang/lang_fr_FR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,9 @@ CommandFactionAddMemberSuccess=Ce joueur est maintenant membre de la faction sp
CommandFactionHelpAddMember=/faction addmember <joueur> <faction> - Ajoute de force un membre � une faction.
BlockNotLocked=Ce bloc n'est pas verrouill�.
CommandFactionRoleSetPermissionCannotModifyRolePermissionToModifyOwnRolePermission=Vous ne pouvez pas modifier les autorisations de votre r\u00e9le pour modifier les autorisations de votre propre r\u00e9le.
DeprecationWarningAutoclaim=La commande /f autoclaim est obsol�te. Utilisez /f claim auto � la place.
DeprecationWarningFillclaim=La commande /f fillclaim est obsol�te. Utilisez /f claim fill � la place.
DeprecationWarningCheckclaim=La commande /f checkclaim est obsol�te. Utilisez /f claim check � la place.
CommandFactionInviteFactionFull=La faction est pleine.
CommandFactionJoinFactionFull=La faction est pleine.
CommandFactionAddMemberTargetFactionFull=La faction est pleine.
Expand Down