This commit is contained in:
Magnus Ulf 2019-03-06 17:10:35 +01:00
parent c38181e5e9
commit abc27821f4
5 changed files with 8 additions and 11 deletions

View File

@ -74,8 +74,7 @@ public class CmdFactionsSetAll extends CmdFactionsSetXAll
} }
else else
{ {
msg("<b>You must specify which map from console."); throw new MassiveException().addMsg("<b>You must specify which map from console.");
return null;
} }
} }
else else

View File

@ -71,8 +71,7 @@ public class CmdFactionsSetAuto extends FactionsCommand
if (newFaction == null || newFaction == msender.getAutoClaimFaction()) if (newFaction == null || newFaction == msender.getAutoClaimFaction())
{ {
msender.setAutoClaimFaction(null); msender.setAutoClaimFaction(null);
msg("<i>Disabled auto-setting as you walk around."); throw new MassiveException().addMsg("<i>Disabled auto-setting as you walk around.");
return;
} }
// MPerm Preemptive Check // MPerm Preemptive Check

View File

@ -4,13 +4,13 @@ import com.massivecraft.factions.Perm;
import com.massivecraft.factions.entity.BoardColl; import com.massivecraft.factions.entity.BoardColl;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.collections.MassiveSet; import com.massivecraft.massivecore.collections.MassiveSet;
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.ps.PS;
import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.MUtil;
import java.util.LinkedHashSet;
import java.util.Set; import java.util.Set;
@ -43,7 +43,7 @@ public class CmdFactionsSetFill extends CmdFactionsSetXSimple
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public Set<PS> getChunks() public Set<PS> getChunks() throws MassiveException
{ {
// Common Startup // Common Startup
final PS chunk = PS.valueOf(me.getLocation()).getChunk(true); final PS chunk = PS.valueOf(me.getLocation()).getChunk(true);
@ -63,8 +63,7 @@ public class CmdFactionsSetFill extends CmdFactionsSetXSimple
// Limit Reached? // Limit Reached?
if (chunks.size() >= max) if (chunks.size() >= max)
{ {
msg("<b>Fill limit of <h>%d <b>reached.", max); throw new MassiveException().addMsg("<b>Fill limit of <h>%d <b>reached.", max);
return null;
} }
// OK! // OK!

View File

@ -49,6 +49,7 @@ public abstract class CmdFactionsSetX extends FactionsCommand
// Args // Args
final Faction newFaction = this.getNewFaction(); final Faction newFaction = this.getNewFaction();
final Set<PS> chunks = this.getChunks(); final Set<PS> chunks = this.getChunks();
if (chunks == null) throw new NullPointerException("chunks");
// Apply / Inform // Apply / Inform
msender.tryClaim(newFaction, chunks, this.getFormatOne(), this.getFormatMany()); msender.tryClaim(newFaction, chunks, this.getFormatOne(), this.getFormatMany());

View File

@ -48,8 +48,7 @@ public class CmdFactionsSetpower extends FactionsCommand
double maxDifference = 0.1d; double maxDifference = 0.1d;
if (difference < maxDifference) if (difference < maxDifference)
{ {
msg("%s's <i>power is already <h>%.2f<i>.", mplayer.getDisplayName(msender), newPower); throw new MassiveException().addMsg("%s's <i>power is already <h>%.2f<i>.", mplayer.getDisplayName(msender), newPower);
return;
} }
// Event // Event