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

Removed old claim commands (Phase 3 deprecation) #1769

Merged
merged 1 commit into from
Jan 3, 2024
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 @@ -7,10 +7,7 @@ import com.dansplugins.factionsystem.command.faction.bonuspower.MfFactionBonusPo
import com.dansplugins.factionsystem.command.faction.breakalliance.MfFactionBreakAllianceCommand
import com.dansplugins.factionsystem.command.faction.bypass.MfFactionBypassCommand
import com.dansplugins.factionsystem.command.faction.chat.MfFactionChatCommand
import com.dansplugins.factionsystem.command.faction.claim.MfFactionClaimAutoCommand
import com.dansplugins.factionsystem.command.faction.claim.MfFactionClaimCheckCommand
import com.dansplugins.factionsystem.command.faction.claim.MfFactionClaimCommand
import com.dansplugins.factionsystem.command.faction.claim.MfFactionClaimFillCommand
import com.dansplugins.factionsystem.command.faction.create.MfFactionCreateCommand
import com.dansplugins.factionsystem.command.faction.declareindependence.MfFactionDeclareIndependenceCommand
import com.dansplugins.factionsystem.command.faction.declarewar.MfFactionDeclareWarCommand
Expand Down Expand Up @@ -44,7 +41,6 @@ import com.dansplugins.factionsystem.command.faction.vassalize.MfFactionVassaliz
import com.dansplugins.factionsystem.command.faction.who.MfFactionWhoCommand
import org.bukkit.ChatColor.AQUA
import org.bukkit.ChatColor.GRAY
import org.bukkit.ChatColor.RED
import org.bukkit.ChatColor.YELLOW
import org.bukkit.command.Command
import org.bukkit.command.CommandExecutor
Expand Down Expand Up @@ -92,11 +88,6 @@ class MfFactionCommand(private val plugin: MedievalFactions) : CommandExecutor,
private val factionAddMemberCommand = MfFactionAddMemberCommand(plugin)
private val factionDevCommand = MfFactionDevCommand(plugin)

// Backwards compatibility:
private val factionClaimAutoCommand = MfFactionClaimAutoCommand(plugin)
private val factionClaimFillCommand = MfFactionClaimFillCommand(plugin)
private val factionClaimCheckCommand = MfFactionClaimCheckCommand(plugin)

private val helpAliases = listOf("help", plugin.language["CmdFactionHelp"])
private val createAliases = listOf("create", plugin.language["CmdFactionCreate"])
private val claimAliases = listOf("claim", plugin.language["CmdFactionClaim"])
Expand Down Expand Up @@ -136,11 +127,6 @@ class MfFactionCommand(private val plugin: MedievalFactions) : CommandExecutor,
private val addMemberAliases = listOf("addmember", plugin.language["CmdFactionAddMember"])
private val devAliases = if (plugin.config.getBoolean("dev.enableDevCommands")) listOf("dev") else emptyList()

// Backwards compatibility:
private val claimAutoAliases = listOf("autoclaim")
private val claimFillAliases = listOf("claimfill")
private val claimCheckAliases = listOf("checkclaim")

private val subcommands = helpAliases +
createAliases +
claimAliases +
Expand Down Expand Up @@ -178,11 +164,7 @@ class MfFactionCommand(private val plugin: MedievalFactions) : CommandExecutor,
bonusPowerAliases +
relationshipAliases +
addMemberAliases +
devAliases +
// Backwards compatibility aliases:
claimAutoAliases +
claimFillAliases +
claimCheckAliases
devAliases

override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<out String>): Boolean {
return when (args.firstOrNull()?.lowercase()) {
Expand Down Expand Up @@ -224,19 +206,6 @@ class MfFactionCommand(private val plugin: MedievalFactions) : CommandExecutor,
in relationshipAliases -> factionRelationshipCommand.onCommand(sender, command, label, args.drop(1).toTypedArray())
in addMemberAliases -> factionAddMemberCommand.onCommand(sender, command, label, args.drop(1).toTypedArray())
in devAliases -> factionDevCommand.onCommand(sender, command, label, args.drop(1).toTypedArray())
// Backwards compatibility:
in claimAutoAliases -> {
sender.sendMessage("${RED}${plugin.language["DeprecationWarningAutoclaim"]}")
false
}
in claimFillAliases -> {
sender.sendMessage("${RED}${plugin.language["DeprecationWarningFillclaim"]}")
false
}
in claimCheckAliases -> {
sender.sendMessage("${RED}${plugin.language["DeprecationWarningCheckclaim"]}")
false
}
else -> {
sender.sendMessage("$AQUA${plugin.language["MedievalFactionsTitle", plugin.description.version]}")
sender.sendMessage("$GRAY${plugin.language["DeveloperList", plugin.description.authors.joinToString()]}")
Expand Down Expand Up @@ -295,10 +264,6 @@ class MfFactionCommand(private val plugin: MedievalFactions) : CommandExecutor,
in relationshipAliases -> factionRelationshipCommand.onTabComplete(sender, command, label, args.drop(1).toTypedArray())
in addMemberAliases -> factionAddMemberCommand.onTabComplete(sender, command, label, args.drop(1).toTypedArray())
in devAliases -> factionDevCommand.onTabComplete(sender, command, label, args.drop(1).toTypedArray())
// Backwards compatibility:
in claimAutoAliases -> factionClaimAutoCommand.onTabComplete(sender, command, label, args.drop(1).toTypedArray())
in claimFillAliases -> factionClaimFillCommand.onTabComplete(sender, command, label, args.drop(1).toTypedArray())
in claimCheckAliases -> factionClaimCheckCommand.onTabComplete(sender, command, label, args.drop(1).toTypedArray())
else -> emptyList()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ class MfFactionClaimCommand(private val plugin: MedievalFactions) : CommandExecu
private val fillAliases = listOf("fill", plugin.language["CmdFactionClaimFill"])
private val checkAliases = listOf("check", plugin.language["CmdFactionClaimCheck"])
private val circleAliases = listOf("circle", plugin.language["CmdFactionClaimCircle"])
// private val squareAliases = listOf("square", plugin.language["CmdFactionClaimSquare"])
// private val rectangleAliases = listOf("rectangle", plugin.language["CmdFactionClaimRectangle"])

private val subcommands = autoAliases + fillAliases + checkAliases + circleAliases

Expand All @@ -27,8 +25,6 @@ class MfFactionClaimCommand(private val plugin: MedievalFactions) : CommandExecu
in fillAliases -> factionClaimFillCommand.onCommand(sender, command, label, args.drop(1).toTypedArray())
in checkAliases -> factionClaimCheckCommand.onCommand(sender, command, label, args.drop(1).toTypedArray())
in circleAliases -> factionClaimCircleCommand.onCommand(sender, command, label, args.drop(1).toTypedArray())
// in squareAliases -> FactionClaimSquareCommand.onCommand(sender, command, label, args.drop(1).toTypedArray())
// in rectangleAliases -> FactionClaimRectangleCommand.onCommand(sender, command, label, args.drop(1).toTypedArray())
else -> {
return factionClaimCircleCommand.onCommand(sender, command, label, args)
}
Expand Down
3 changes: 0 additions & 3 deletions src/main/resources/lang/lang_en_GB.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1068,9 +1068,6 @@ 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
3 changes: 0 additions & 3 deletions src/main/resources/lang/lang_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1068,9 +1068,6 @@ 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.
Expand Down