Allowing specifying faction for the home shortcuts

This commit is contained in:
Magnus Ulf 2021-05-23 14:21:53 +02:00
parent 8500b7bcfa
commit 3a83e75eb4
3 changed files with 16 additions and 3 deletions

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}