Readd home command

This commit is contained in:
Magnus Ulf 2021-03-02 22:04:50 +01:00
parent 9ae143933e
commit cbf9246981
3 changed files with 42 additions and 2 deletions

View File

@ -28,6 +28,7 @@ public class CmdFactions extends FactionsCommand
public CmdFactionsJoin cmdFactionsJoin = new CmdFactionsJoin(); public CmdFactionsJoin cmdFactionsJoin = new CmdFactionsJoin();
public CmdFactionsLeave cmdFactionsLeave = new CmdFactionsLeave(); public CmdFactionsLeave cmdFactionsLeave = new CmdFactionsLeave();
public CmdFactionsWarp cmdFactionsWarp = new CmdFactionsWarp(); public CmdFactionsWarp cmdFactionsWarp = new CmdFactionsWarp();
public CmdFactionsHome cmdFactionsHome = new CmdFactionsHome();
public CmdFactionsVote cmdFactionsVote = new CmdFactionsVote(); public CmdFactionsVote cmdFactionsVote = new CmdFactionsVote();
public CmdFactionsMap cmdFactionsMap = new CmdFactionsMap(); public CmdFactionsMap cmdFactionsMap = new CmdFactionsMap();
public CmdFactionsCreate cmdFactionsCreate = new CmdFactionsCreate(); public CmdFactionsCreate cmdFactionsCreate = new CmdFactionsCreate();
@ -78,7 +79,6 @@ public class CmdFactions extends FactionsCommand
// Deprecated Commands // Deprecated Commands
this.addChild(new MassiveCommandDeprecated(this.cmdFactionsRank, "leader", "owner", "officer", "moderator", "coleader")); this.addChild(new MassiveCommandDeprecated(this.cmdFactionsRank, "leader", "owner", "officer", "moderator", "coleader"));
this.addChild(new MassiveCommandDeprecated(this.cmdFactionsWarp, "home"));
this.addChild(new MassiveCommandDeprecated(this.cmdFactionsWarp.cmdFactionWarpAdd, "sethome")); this.addChild(new MassiveCommandDeprecated(this.cmdFactionsWarp.cmdFactionWarpAdd, "sethome"));
this.addChild(new MassiveCommandDeprecated(this.cmdFactionsWarp.cmdFactionWarpRemove, "unsethome")); this.addChild(new MassiveCommandDeprecated(this.cmdFactionsWarp.cmdFactionWarpRemove, "unsethome"));
} }

View File

@ -0,0 +1,37 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.entity.MConf;
import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.command.Visibility;
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
import com.massivecraft.massivecore.util.MUtil;
import java.util.List;
public class CmdFactionsHome extends FactionsCommandWarp
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsHome()
{
// Requirements
this.addRequirements(RequirementIsPlayer.get());
// Visibility
this.setVisibility(Visibility.INVISIBLE);
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform() throws MassiveException
{
List<String> args = MUtil.list(MConf.get().warpsHomeName);
CmdFactions.get().cmdFactionsWarp.cmdFactionsWarpGo.execute(me, args);
}
}

View File

@ -258,7 +258,10 @@ public class MConf extends Entity<MConf>
// It's usually a wise idea keeping this true. // It's usually a wise idea keeping this true.
// Otherwise players can set their warps inside enemy territory. // Otherwise players can set their warps inside enemy territory.
public boolean warpsMustBeInClaimedTerritory = true; public boolean warpsMustBeInClaimedTerritory = true;
// And what faction warp should be used when a player types /f home
public String warpsHomeName = "home";
// These options can be used to limit rights to warp under different circumstances. // These options can be used to limit rights to warp under different circumstances.
public boolean warpsTeleportAllowedFromEnemyTerritory = true; public boolean warpsTeleportAllowedFromEnemyTerritory = true;
public boolean warpsTeleportAllowedFromDifferentWorld = true; public boolean warpsTeleportAllowedFromDifferentWorld = true;