Working on auto claim
This commit is contained in:
@@ -24,16 +24,16 @@ public class CmdFactionsAutoClaim extends FCommand
|
||||
public void perform()
|
||||
{
|
||||
Faction forFaction = this.arg(0, ARFaction.get(myFaction), myFaction);
|
||||
if (forFaction == null || forFaction == fme.getAutoClaimFor())
|
||||
if (forFaction == null || forFaction == fme.getAutoClaimFaction())
|
||||
{
|
||||
fme.setAutoClaimFor(null);
|
||||
fme.setAutoClaimFaction(null);
|
||||
msg("<i>Auto-claiming of land disabled.");
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! FPerm.TERRITORY.has(fme, forFaction, true)) return;
|
||||
if (forFaction.isNormal() && !FPerm.TERRITORY.has(fme, forFaction, true)) return;
|
||||
|
||||
fme.setAutoClaimFor(forFaction);
|
||||
fme.setAutoClaimFaction(forFaction);
|
||||
|
||||
msg("<i>Now auto-claiming land for <h>%s<i>.", forFaction.describeTo(fme));
|
||||
fme.tryClaim(forFaction, PS.valueOf(me), true, true);
|
||||
|
@@ -28,11 +28,11 @@ public class CmdFactionsMap extends FCommand
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.arg(0, ARBoolean.get(), !fme.isMapAutoUpdating()))
|
||||
if (this.arg(0, ARBoolean.get(), !mme.isMapAutoUpdating()))
|
||||
{
|
||||
// Turn on
|
||||
|
||||
fme.setMapAutoUpdating(true);
|
||||
mme.setMapAutoUpdating(true);
|
||||
msg("<i>Map auto update <green>ENABLED.");
|
||||
|
||||
// And show the map once
|
||||
@@ -41,7 +41,7 @@ public class CmdFactionsMap extends FCommand
|
||||
else
|
||||
{
|
||||
// Turn off
|
||||
fme.setMapAutoUpdating(false);
|
||||
mme.setMapAutoUpdating(false);
|
||||
msg("<i>Map auto update <red>DISABLED.");
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Rel;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.entity.UPlayer;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.mcore.cmd.MCommand;
|
||||
@@ -8,12 +9,14 @@ import com.massivecraft.mcore.util.Txt;
|
||||
|
||||
public abstract class FCommand extends MCommand
|
||||
{
|
||||
public MPlayer mme;
|
||||
public UPlayer fme;
|
||||
public Faction myFaction;
|
||||
|
||||
@Override
|
||||
public void fixSenderVars()
|
||||
{
|
||||
this.mme = MPlayer.get(sender);
|
||||
this.fme = UPlayer.get(this.sender);
|
||||
this.myFaction = this.fme.getFaction();
|
||||
}
|
||||
|
Reference in New Issue
Block a user