Allowing specifying faction for the home shortcuts
This commit is contained in:
parent
8500b7bcfa
commit
3a83e75eb4
@ -1,5 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.cmd.type.TypeFaction;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.command.Visibility;
|
||||
@ -19,6 +20,10 @@ public class CmdFactionsHome extends FactionsCommandWarp
|
||||
// Requirements
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
|
||||
// Parameters
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
|
||||
// Visibility
|
||||
this.setVisibility(Visibility.INVISIBLE);
|
||||
}
|
||||
@ -30,7 +35,7 @@ public class CmdFactionsHome extends FactionsCommandWarp
|
||||
@Override
|
||||
public void perform() throws MassiveException
|
||||
{
|
||||
List<String> args = MUtil.list(MConf.get().warpsHomeName);
|
||||
List<String> args = MUtil.list(MConf.get().warpsHomeName, this.argAt(0));
|
||||
CmdFactions.get().cmdFactionsWarp.cmdFactionsWarpGo.execute(me, args);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.cmd.type.TypeFaction;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.command.Visibility;
|
||||
@ -19,6 +20,9 @@ public class CmdFactionsSethome extends FactionsCommandWarp
|
||||
// Requirements
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
|
||||
// Parameters
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Visibility
|
||||
this.setVisibility(Visibility.INVISIBLE);
|
||||
}
|
||||
@ -30,7 +34,7 @@ public class CmdFactionsSethome extends FactionsCommandWarp
|
||||
@Override
|
||||
public void perform() throws MassiveException
|
||||
{
|
||||
List<String> args = MUtil.list(MConf.get().warpsHomeName);
|
||||
List<String> args = MUtil.list(MConf.get().warpsHomeName, this.argAt(0));
|
||||
CmdFactions.get().cmdFactionsWarp.cmdFactionWarpAdd.execute(me, args);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.cmd.type.TypeFaction;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.command.Visibility;
|
||||
@ -19,6 +20,9 @@ public class CmdFactionsUnsethome extends FactionsCommandWarp
|
||||
// Requirements
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
|
||||
// Parameters
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Visibility
|
||||
this.setVisibility(Visibility.INVISIBLE);
|
||||
}
|
||||
@ -30,7 +34,7 @@ public class CmdFactionsUnsethome extends FactionsCommandWarp
|
||||
@Override
|
||||
public void perform() throws MassiveException
|
||||
{
|
||||
List<String> args = MUtil.list(MConf.get().warpsHomeName);
|
||||
List<String> args = MUtil.list(MConf.get().warpsHomeName, this.argAt(0));
|
||||
CmdFactions.get().cmdFactionsWarp.cmdFactionWarpRemove.execute(me, args);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user