From 7dcfa3b3767ed72a9de386a5718d4105306c2503 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Tue, 15 Mar 2016 11:47:25 +0100 Subject: [PATCH] Fix bug where old relation commands did not work due to invalid argument order --- .../factions/cmd/CmdFactionsRankOld.java | 6 +++++- .../factions/cmd/CmdFactionsRelationOld.java | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java b/src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java index 527af817..ba8b5f11 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java @@ -40,7 +40,11 @@ public class CmdFactionsRankOld extends FactionsCommand @Override public void perform() { - CmdFactions.get().cmdFactionsRank.execute(sender, MUtil.list(this.argAt(0), this.rankName, this.argAt(1))); + CmdFactions.get().cmdFactionsRank.execute(sender, MUtil.list( + this.argAt(0), + this.rankName, + this.argAt(1) + )); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsRelationOld.java b/src/com/massivecraft/factions/cmd/CmdFactionsRelationOld.java index 0d51a517..8de3d72f 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsRelationOld.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsRelationOld.java @@ -1,7 +1,8 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.cmd.type.TypeFaction; - +import com.massivecraft.factions.entity.Faction; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.command.Visibility; import com.massivecraft.massivecore.util.MUtil; @@ -26,7 +27,7 @@ public class CmdFactionsRelationOld extends FactionsCommand this.addAliases(relName); // Parameters - this.addParameter(TypeFaction.get(), "faction"); + this.addParameter(TypeFaction.get(), "faction", true); // Visibility this.setVisibility(Visibility.INVISIBLE); @@ -37,9 +38,16 @@ public class CmdFactionsRelationOld extends FactionsCommand // -------------------------------------------- // @Override - public void perform() + public void perform() throws MassiveException { - CmdFactions.get().cmdFactionsRelation.cmdFactionsRelationSet.execute(sender, MUtil.list(this.relName, this.argAt(0))); + // Arguments + Faction faction = this.readArg(); + + // Apply + CmdFactions.get().cmdFactionsRelation.cmdFactionsRelationSet.execute(sender, MUtil.list( + faction.getId(), + this.relName + )); } }