Fixes more warnings

This commit is contained in:
Kristian Knarvik 2023-06-23 21:51:30 +02:00
parent 9986e940c5
commit 75140cf97b
69 changed files with 142 additions and 175 deletions

View File

@ -28,21 +28,21 @@ public class CmdFactions extends FactionsCommand {
public CmdFactionsPlayer cmdFactionsPlayer = new CmdFactionsPlayer(); public CmdFactionsPlayer cmdFactionsPlayer = new CmdFactionsPlayer();
public CmdFactionsStatus cmdFactionsStatus = new CmdFactionsStatus(); public CmdFactionsStatus cmdFactionsStatus = new CmdFactionsStatus();
public CmdFactionsJoin cmdFactionsJoin = new CmdFactionsJoin(); public CmdFactionsJoin cmdFactionsJoin = new CmdFactionsJoin();
public CmdFactionsLeave cmdFactionsLeave = new CmdFactionsLeave(); public final CmdFactionsLeave cmdFactionsLeave = new CmdFactionsLeave();
public CmdFactionsWarp cmdFactionsWarp = new CmdFactionsWarp(); public final CmdFactionsWarp cmdFactionsWarp = new CmdFactionsWarp();
public CmdFactionsHome cmdFactionsHome = new CmdFactionsHome(); public CmdFactionsHome cmdFactionsHome = new CmdFactionsHome();
public CmdFactionsSethome cmdFactionsSethome = new CmdFactionsSethome(); public CmdFactionsSethome cmdFactionsSethome = new CmdFactionsSethome();
public CmdFactionsUnsethome cmdFactionsUnsethome = new CmdFactionsUnsethome(); public CmdFactionsUnsethome cmdFactionsUnsethome = new CmdFactionsUnsethome();
public CmdFactionsVote cmdFactionsVote = new CmdFactionsVote(); public final CmdFactionsVote cmdFactionsVote = new CmdFactionsVote();
public CmdFactionsMap cmdFactionsMap = new CmdFactionsMap(); public CmdFactionsMap cmdFactionsMap = new CmdFactionsMap();
public CmdFactionsCreate cmdFactionsCreate = new CmdFactionsCreate(); public final CmdFactionsCreate cmdFactionsCreate = new CmdFactionsCreate();
public CmdFactionsName cmdFactionsName = new CmdFactionsName(); public final CmdFactionsName cmdFactionsName = new CmdFactionsName();
public CmdFactionsDescription cmdFactionsDescription = new CmdFactionsDescription(); public final CmdFactionsDescription cmdFactionsDescription = new CmdFactionsDescription();
public CmdFactionsMotd cmdFactionsMotd = new CmdFactionsMotd(); public CmdFactionsMotd cmdFactionsMotd = new CmdFactionsMotd();
public CmdFactionsInvite cmdFactionsInvite = new CmdFactionsInvite(); public final CmdFactionsInvite cmdFactionsInvite = new CmdFactionsInvite();
public CmdFactionsKick cmdFactionsKick = new CmdFactionsKick(); public final CmdFactionsKick cmdFactionsKick = new CmdFactionsKick();
public CmdFactionsTitle cmdFactionsTitle = new CmdFactionsTitle(); public final CmdFactionsTitle cmdFactionsTitle = new CmdFactionsTitle();
public CmdFactionsRank cmdFactionsRank = new CmdFactionsRank(); public final CmdFactionsRank cmdFactionsRank = new CmdFactionsRank();
public CmdFactionsMoney cmdFactionsMoney = new CmdFactionsMoney(); public CmdFactionsMoney cmdFactionsMoney = new CmdFactionsMoney();
public CmdFactionsTop cmdFactionsTop = new CmdFactionsTop(); public CmdFactionsTop cmdFactionsTop = new CmdFactionsTop();
public CmdFactionsSeeChunk cmdFactionsSeeChunk = new CmdFactionsSeeChunk(); public CmdFactionsSeeChunk cmdFactionsSeeChunk = new CmdFactionsSeeChunk();
@ -52,17 +52,17 @@ public class CmdFactions extends FactionsCommand {
public CmdFactionsUnclaim cmdFactionsUnclaim = new CmdFactionsUnclaim(); public CmdFactionsUnclaim cmdFactionsUnclaim = new CmdFactionsUnclaim();
public CmdFactionsAccess cmdFactionsAccess = new CmdFactionsAccess(); public CmdFactionsAccess cmdFactionsAccess = new CmdFactionsAccess();
public CmdFactionsChunkname cmdFactionsChunkname = new CmdFactionsChunkname(); public CmdFactionsChunkname cmdFactionsChunkname = new CmdFactionsChunkname();
public CmdFactionsRelation cmdFactionsRelation = new CmdFactionsRelation(); public final CmdFactionsRelation cmdFactionsRelation = new CmdFactionsRelation();
public CmdFactionsRelationOld cmdFactionsRelationOldAlly = new CmdFactionsRelationOld("ally"); public CmdFactionsRelationOld cmdFactionsRelationOldAlly = new CmdFactionsRelationOld("ally");
public CmdFactionsRelationOld cmdFactionsRelationOldTruce = new CmdFactionsRelationOld("truce"); public CmdFactionsRelationOld cmdFactionsRelationOldTruce = new CmdFactionsRelationOld("truce");
public CmdFactionsRelationOld cmdFactionsRelationOldNeutral = new CmdFactionsRelationOld("neutral"); public CmdFactionsRelationOld cmdFactionsRelationOldNeutral = new CmdFactionsRelationOld("neutral");
public CmdFactionsRelationOld cmdFactionsRelationOldEnemy = new CmdFactionsRelationOld("enemy"); public CmdFactionsRelationOld cmdFactionsRelationOldEnemy = new CmdFactionsRelationOld("enemy");
public CmdFactionsTax cmdFactionsTax = new CmdFactionsTax(); public CmdFactionsTax cmdFactionsTax = new CmdFactionsTax();
public CmdFactionsPerm cmdFactionsPerm = new CmdFactionsPerm(); public final CmdFactionsPerm cmdFactionsPerm = new CmdFactionsPerm();
public CmdFactionsFlag cmdFactionsFlag = new CmdFactionsFlag(); public final CmdFactionsFlag cmdFactionsFlag = new CmdFactionsFlag();
public CmdFactionsFly cmdFactionsFly = new CmdFactionsFly(); public CmdFactionsFly cmdFactionsFly = new CmdFactionsFly();
public CmdFactionsUnstuck cmdFactionsUnstuck = new CmdFactionsUnstuck(); public CmdFactionsUnstuck cmdFactionsUnstuck = new CmdFactionsUnstuck();
public CmdFactionsOverride cmdFactionsOverride = new CmdFactionsOverride(); public final CmdFactionsOverride cmdFactionsOverride = new CmdFactionsOverride();
public CmdFactionsDisband cmdFactionsDisband = new CmdFactionsDisband(); public CmdFactionsDisband cmdFactionsDisband = new CmdFactionsDisband();
public CmdFactionsPowerboost cmdFactionsPowerBoost = new CmdFactionsPowerboost(); public CmdFactionsPowerboost cmdFactionsPowerBoost = new CmdFactionsPowerboost();
public CmdFactionsSetpower cmdFactionsSetpower = new CmdFactionsSetpower(); public CmdFactionsSetpower cmdFactionsSetpower = new CmdFactionsSetpower();

View File

@ -4,7 +4,6 @@ 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.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;
@ -36,7 +35,7 @@ public class CmdFactionsAccessSetFill extends CmdFactionsAccessSetXSimple {
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public Set<PS> getChunks() throws MassiveException { public Set<PS> getChunks() {
// Common Startup // Common Startup
final PS chunk = PS.valueOf(me.getLocation()).getChunk(true); final PS chunk = PS.valueOf(me.getLocation()).getChunk(true);

View File

@ -10,7 +10,6 @@ import com.massivecraft.factions.entity.Invitation;
import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.entity.MPlayerColl; import com.massivecraft.factions.entity.MPlayerColl;
import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.collections.MassiveSet; import com.massivecraft.massivecore.collections.MassiveSet;
import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.ps.PS;
import com.massivecraft.massivecore.store.EntityInternalMap; import com.massivecraft.massivecore.store.EntityInternalMap;
@ -26,7 +25,7 @@ public class CmdFactionsClean extends FactionsCommand {
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public void perform() throws MassiveException { public void perform() {
Object message; Object message;
int count; int count;

View File

@ -2,7 +2,6 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.entity.MFlag; import com.massivecraft.factions.entity.MFlag;
import com.massivecraft.factions.entity.MFlagColl; import com.massivecraft.factions.entity.MFlagColl;
import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
import java.util.List; import java.util.List;
@ -22,7 +21,7 @@ public class CmdFactionsDocumentationFlags extends FactionsCommandDocumentation
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public void perform() throws MassiveException { public void perform() {
msgDoc("Flags are a way to give certain factions certain attributes " + msgDoc("Flags are a way to give certain factions certain attributes " +
" such as disabling pvp or enabling friendly fire."); " such as disabling pvp or enabling friendly fire.");
msgDoc("To see all the flags type:"); msgDoc("To see all the flags type:");

View File

@ -1,7 +1,5 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.massivecore.MassiveException;
public class CmdFactionsDocumentationPerms extends FactionsCommandDocumentation { public class CmdFactionsDocumentationPerms extends FactionsCommandDocumentation {
// -------------------------------------------- // // -------------------------------------------- //
// CONSTRUCT // CONSTRUCT
@ -16,7 +14,7 @@ public class CmdFactionsDocumentationPerms extends FactionsCommandDocumentation
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public void perform() throws MassiveException { public void perform() {
msgDoc("Permissions decide who can do what in your faction. " + msgDoc("Permissions decide who can do what in your faction. " +
"Permissions can be given to a rank, a player, a relation, " + "Permissions can be given to a rank, a player, a relation, " +
"everyone in another faction or everyone with a specific rank in another faction."); "everyone in another faction or everyone with a specific rank in another faction.");

View File

@ -1,7 +1,6 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.massivecore.MassiveException;
public class CmdFactionsDocumentationPower extends FactionsCommandDocumentation { public class CmdFactionsDocumentationPower extends FactionsCommandDocumentation {
// -------------------------------------------- // // -------------------------------------------- //
@ -17,7 +16,7 @@ public class CmdFactionsDocumentationPower extends FactionsCommandDocumentation
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public void perform() throws MassiveException { public void perform() {
msgDoc("All players have an amount of power ranging from <h>%.2f <i>to <h>%.2f<i>.", MConf.get().powerMin, MConf.get().powerMax); msgDoc("All players have an amount of power ranging from <h>%.2f <i>to <h>%.2f<i>.", MConf.get().powerMin, MConf.get().powerMax);
msgDoc("The power of a faction is equal to the combined power of all it's members."); msgDoc("The power of a faction is equal to the combined power of all it's members.");
msgDoc("Your power is <h>%.2f<i>", msender.getPower()); msgDoc("Your power is <h>%.2f<i>", msender.getPower());

View File

@ -1,7 +1,6 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.entity.Rank; import com.massivecraft.factions.entity.Rank;
import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.mson.Mson; import com.massivecraft.massivecore.mson.Mson;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -24,7 +23,7 @@ public class CmdFactionsDocumentationRanks extends FactionsCommandDocumentation
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public void perform() throws MassiveException { public void perform() {
msgDoc("Ranks divide the faction into groups."); msgDoc("Ranks divide the faction into groups.");
List<Rank> ranks = msenderFaction.getRanks().getAll(Comparator.comparingInt(Rank::getPriority).reversed()); List<Rank> ranks = msenderFaction.getRanks().getAll(Comparator.comparingInt(Rank::getPriority).reversed());

View File

@ -2,7 +2,6 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.cmd.req.ReqTaxEnabled; import com.massivecraft.factions.cmd.req.ReqTaxEnabled;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.money.Money; import com.massivecraft.massivecore.money.Money;
import com.massivecraft.massivecore.util.TimeDiffUtil; import com.massivecraft.massivecore.util.TimeDiffUtil;
import com.massivecraft.massivecore.util.TimeUnit; import com.massivecraft.massivecore.util.TimeUnit;
@ -24,7 +23,7 @@ public class CmdFactionsDocumentationTax extends FactionsCommandDocumentation {
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public void perform() throws MassiveException { public void perform() {
LinkedHashMap<TimeUnit, Long> timeUnitcounts = TimeDiffUtil.limit(TimeDiffUtil.unitcounts(MConf.get().taxTaskPeriodMillis, TimeUnit.getAll()), 3); LinkedHashMap<TimeUnit, Long> timeUnitcounts = TimeDiffUtil.limit(TimeDiffUtil.unitcounts(MConf.get().taxTaskPeriodMillis, TimeUnit.getAll()), 3);
String periodString = TimeDiffUtil.formatedVerboose(timeUnitcounts); String periodString = TimeDiffUtil.formatedVerboose(timeUnitcounts);

View File

@ -4,7 +4,6 @@ import com.massivecraft.factions.cmd.req.ReqFactionWarpsEnabled;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.factions.entity.MPerm.MPermable; import com.massivecraft.factions.entity.MPerm.MPermable;
import com.massivecraft.massivecore.MassiveException;
import java.util.Set; import java.util.Set;
@ -22,7 +21,7 @@ public class CmdFactionsDocumentationWarps extends FactionsCommandDocumentation
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public void perform() throws MassiveException { public void perform() {
msgDoc("A faction can have warps which allows it's members to easily go to important places within the faction."); msgDoc("A faction can have warps which allows it's members to easily go to important places within the faction.");
if (MConf.get().warpsMax < 0) { if (MConf.get().warpsMax < 0) {

View File

@ -5,8 +5,8 @@ public class CmdFactionsFlag extends FactionsCommand {
// FIELDS // FIELDS
// -------------------------------------------- // // -------------------------------------------- //
public CmdFactionsFlagList cmdFactionsFlagList = new CmdFactionsFlagList(); public final CmdFactionsFlagList cmdFactionsFlagList = new CmdFactionsFlagList();
public CmdFactionsFlagShow cmdFactionsFlagShow = new CmdFactionsFlagShow(); public CmdFactionsFlagShow cmdFactionsFlagShow = new CmdFactionsFlagShow();
public CmdFactionsFlagSet cmdFactionsFlagSet = new CmdFactionsFlagSet(); public final CmdFactionsFlagSet cmdFactionsFlagSet = new CmdFactionsFlagSet();
} }

View File

@ -38,7 +38,7 @@ public class CmdFactionsFly extends MassiveCommandToggle {
} }
@Override @Override
public boolean getValue() throws MassiveException { public boolean getValue() {
return MPlayer.get(sender).isFlying(); return MPlayer.get(sender).isFlying();
} }

View File

@ -2,7 +2,6 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.cmd.type.TypeFaction;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.command.Visibility; import com.massivecraft.massivecore.command.Visibility;
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.MUtil;
@ -31,7 +30,7 @@ public class CmdFactionsHome extends FactionsCommandWarp {
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public void perform() throws MassiveException { public void perform() {
List<String> args = MUtil.list(MConf.get().warpsHomeName, this.argAt(0)); List<String> args = MUtil.list(MConf.get().warpsHomeName, this.argAt(0));
CmdFactions.get().cmdFactionsWarp.cmdFactionsWarpGo.execute(me, args); CmdFactions.get().cmdFactionsWarp.cmdFactionsWarpGo.execute(me, args);
} }

View File

@ -6,7 +6,7 @@ public class CmdFactionsInvite extends FactionsCommand {
// -------------------------------------------- // // -------------------------------------------- //
public CmdFactionsInviteList cmdFactionsInviteList = new CmdFactionsInviteList(); public CmdFactionsInviteList cmdFactionsInviteList = new CmdFactionsInviteList();
public CmdFactionsInviteAdd cmdFactionsInviteAdd = new CmdFactionsInviteAdd(); public final CmdFactionsInviteAdd cmdFactionsInviteAdd = new CmdFactionsInviteAdd();
public CmdFactionsInviteRemove cmdFactionsInviteRemove = new CmdFactionsInviteRemove(); public final CmdFactionsInviteRemove cmdFactionsInviteRemove = new CmdFactionsInviteRemove();
} }

View File

@ -5,10 +5,10 @@ public class CmdFactionsPerm extends FactionsCommand {
// FIELDS // FIELDS
// -------------------------------------------- // // -------------------------------------------- //
CmdFactionsPermList cmdFactionsPermList = new CmdFactionsPermList(); final CmdFactionsPermList cmdFactionsPermList = new CmdFactionsPermList();
CmdFactionsPermShow cmdFactionsPermShow = new CmdFactionsPermShow(); final CmdFactionsPermShow cmdFactionsPermShow = new CmdFactionsPermShow();
CmdFactionsPermView cmdFactionsPermView = new CmdFactionsPermView(); final CmdFactionsPermView cmdFactionsPermView = new CmdFactionsPermView();
CmdFactionsPermViewall cmdFactionsPermViewall = new CmdFactionsPermViewall(); final CmdFactionsPermViewall cmdFactionsPermViewall = new CmdFactionsPermViewall();
CmdFactionsPermSet cmdFactionsPermSet = new CmdFactionsPermSet(); final CmdFactionsPermSet cmdFactionsPermSet = new CmdFactionsPermSet();
} }

View File

@ -5,8 +5,8 @@ public class CmdFactionsPowerboost extends FactionsCommand {
// FIELDS // FIELDS
// -------------------------------------------- // // -------------------------------------------- //
public CmdFactionsPowerboostPlayer cmdFactionsPowerBoostPlayer = new CmdFactionsPowerboostPlayer(); public final CmdFactionsPowerboostPlayer cmdFactionsPowerBoostPlayer = new CmdFactionsPowerboostPlayer();
public CmdFactionsPowerboostFaction cmdFactionsPowerBoostFaction = new CmdFactionsPowerboostFaction(); public final CmdFactionsPowerboostFaction cmdFactionsPowerBoostFaction = new CmdFactionsPowerboostFaction();
// -------------------------------------------- // // -------------------------------------------- //
// CONSTRUCT // CONSTRUCT

View File

@ -5,7 +5,7 @@ public class CmdFactionsRank extends FactionsCommand {
// FIELDS // FIELDS
// -------------------------------------------- // // -------------------------------------------- //
public CmdFactionsRankSet cmdFactionsRankSet = new CmdFactionsRankSet(); public final CmdFactionsRankSet cmdFactionsRankSet = new CmdFactionsRankSet();
public CmdFactionsRankShow cmdFactionsRankShow = new CmdFactionsRankShow(); public CmdFactionsRankShow cmdFactionsRankShow = new CmdFactionsRankShow();
public CmdFactionsRankList cmdFactionsRankList = new CmdFactionsRankList(); public CmdFactionsRankList cmdFactionsRankList = new CmdFactionsRankList();
public CmdFactionsRankEdit cmdFactionsRankEdit = new CmdFactionsRankEdit(); public CmdFactionsRankEdit cmdFactionsRankEdit = new CmdFactionsRankEdit();

View File

@ -5,7 +5,7 @@ public class CmdFactionsRelation extends FactionsCommand {
// FIELDS // FIELDS
// -------------------------------------------- // // -------------------------------------------- //
public CmdFactionsRelationSet cmdFactionsRelationSet = new CmdFactionsRelationSet(); public final CmdFactionsRelationSet cmdFactionsRelationSet = new CmdFactionsRelationSet();
public CmdFactionsRelationList cmdFactionsRelationList = new CmdFactionsRelationList(); public CmdFactionsRelationList cmdFactionsRelationList = new CmdFactionsRelationList();
public CmdFactionsRelationWishes cmdFactionsRelationWishes = new CmdFactionsRelationWishes(); public CmdFactionsRelationWishes cmdFactionsRelationWishes = new CmdFactionsRelationWishes();

View File

@ -4,7 +4,6 @@ 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.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;
@ -41,7 +40,7 @@ public class CmdFactionsSetFill extends CmdFactionsSetXSimple {
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public Set<PS> getChunks() throws MassiveException { public Set<PS> getChunks() {
// Common Startup // Common Startup
final PS chunk = PS.valueOf(me.getLocation()).getChunk(true); final PS chunk = PS.valueOf(me.getLocation()).getChunk(true);

View File

@ -2,7 +2,6 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.cmd.type.TypeFaction;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.command.Visibility; import com.massivecraft.massivecore.command.Visibility;
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.MUtil;
@ -30,7 +29,7 @@ public class CmdFactionsSethome extends FactionsCommandWarp {
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public void perform() throws MassiveException { public void perform() {
List<String> args = MUtil.list(MConf.get().warpsHomeName, this.argAt(0)); List<String> args = MUtil.list(MConf.get().warpsHomeName, this.argAt(0));
CmdFactions.get().cmdFactionsWarp.cmdFactionWarpAdd.execute(me, args); CmdFactions.get().cmdFactionsWarp.cmdFactionWarpAdd.execute(me, args);
} }

View File

@ -2,7 +2,6 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.cmd.req.ReqTaxEnabled; import com.massivecraft.factions.cmd.req.ReqTaxEnabled;
import com.massivecraft.factions.task.TaskTax; import com.massivecraft.factions.task.TaskTax;
import com.massivecraft.massivecore.MassiveException;
public class CmdFactionsTaxRun extends FactionsCommand { public class CmdFactionsTaxRun extends FactionsCommand {
// -------------------------------------------- // // -------------------------------------------- //
@ -18,7 +17,7 @@ public class CmdFactionsTaxRun extends FactionsCommand {
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public void perform() throws MassiveException { public void perform() {
TaskTax.get().invoke(System.currentTimeMillis()); TaskTax.get().invoke(System.currentTimeMillis());
} }

View File

@ -64,17 +64,12 @@ public class CmdFactionsTop extends FactionsCommand {
} }
private static double getNumber(TopCategory category, Faction faction) { private static double getNumber(TopCategory category, Faction faction) {
switch (category) { return switch (category) {
case MONEY: case MONEY -> Econ.getMoney(faction);
return Econ.getMoney(faction); case MEMBERS -> faction.getMPlayers().size();
case MEMBERS: case TERRITORY -> faction.getLandCount();
return faction.getMPlayers().size(); case AGE -> faction.getAge();
case TERRITORY: };
return faction.getLandCount();
case AGE:
return faction.getAge();
}
throw new RuntimeException();
} }
private static String getValue(TopCategory category, Faction faction, MPlayer mplayer) { private static String getValue(TopCategory category, Faction faction, MPlayer mplayer) {

View File

@ -2,7 +2,6 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.cmd.type.TypeFaction;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.command.Visibility; import com.massivecraft.massivecore.command.Visibility;
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.MUtil;
@ -30,7 +29,7 @@ public class CmdFactionsUnsethome extends FactionsCommandWarp {
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public void perform() throws MassiveException { public void perform() {
List<String> args = MUtil.list(MConf.get().warpsHomeName, this.argAt(0)); List<String> args = MUtil.list(MConf.get().warpsHomeName, this.argAt(0));
CmdFactions.get().cmdFactionsWarp.cmdFactionWarpRemove.execute(me, args); CmdFactions.get().cmdFactionsWarp.cmdFactionWarpRemove.execute(me, args);
} }

View File

@ -6,7 +6,6 @@ import com.massivecraft.factions.entity.FactionColl;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
import com.massivecraft.massivecore.mixin.MixinTeleport; import com.massivecraft.massivecore.mixin.MixinTeleport;
import com.massivecraft.massivecore.mixin.TeleporterException; import com.massivecraft.massivecore.mixin.TeleporterException;
@ -34,7 +33,7 @@ public class CmdFactionsUnstuck extends FactionsCommand {
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public void perform() throws MassiveException { public void perform() {
// If the player is in a chunk ... // If the player is in a chunk ...
final PS center = PS.valueOf(me.getLocation().getChunk()); final PS center = PS.valueOf(me.getLocation().getChunk());

View File

@ -7,7 +7,7 @@ public class CmdFactionsVote extends FactionsCommand {
public CmdFactionsVoteShow cmdFactionsVoteShow = new CmdFactionsVoteShow(); public CmdFactionsVoteShow cmdFactionsVoteShow = new CmdFactionsVoteShow();
public CmdFactionsVoteList cmdFactionsVoteList = new CmdFactionsVoteList(); public CmdFactionsVoteList cmdFactionsVoteList = new CmdFactionsVoteList();
public CmdFactionsVoteDo cmdFactionsVoteDo = new CmdFactionsVoteDo(); public final CmdFactionsVoteDo cmdFactionsVoteDo = new CmdFactionsVoteDo();
public CmdFactionsVoteCreate cmdFactionsVoteCreate = new CmdFactionsVoteCreate(); public CmdFactionsVoteCreate cmdFactionsVoteCreate = new CmdFactionsVoteCreate();
public CmdFactionsVoteRemove cmdFactionsVoteRemove = new CmdFactionsVoteRemove(); public CmdFactionsVoteRemove cmdFactionsVoteRemove = new CmdFactionsVoteRemove();

View File

@ -5,9 +5,9 @@ public class CmdFactionsWarp extends FactionsCommand {
// FIELDS // FIELDS
// -------------------------------------------- // // -------------------------------------------- //
public CmdFactionsWarpGo cmdFactionsWarpGo = new CmdFactionsWarpGo(); public final CmdFactionsWarpGo cmdFactionsWarpGo = new CmdFactionsWarpGo();
public CmdFactionsWarpList cmdFactionsWarpList = new CmdFactionsWarpList(); public CmdFactionsWarpList cmdFactionsWarpList = new CmdFactionsWarpList();
public CmdFactionsWarpAdd cmdFactionWarpAdd = new CmdFactionsWarpAdd(); public final CmdFactionsWarpAdd cmdFactionWarpAdd = new CmdFactionsWarpAdd();
public CmdFactionsWarpRemove cmdFactionWarpRemove = new CmdFactionsWarpRemove(); public final CmdFactionsWarpRemove cmdFactionWarpRemove = new CmdFactionsWarpRemove();
} }

View File

@ -162,7 +162,7 @@ public class EngineCanCombatHappen extends Engine {
} }
// ... PVP flag may cause a damage block ... // ... PVP flag may cause a damage block ...
if (defenderPsFaction.getFlag(MFlag.getFlagPvp()) == false) { if (!defenderPsFaction.getFlag(MFlag.getFlagPvp())) {
if (eattacker == null) { if (eattacker == null) {
// No attacker? // No attacker?
// Let's behave as if it were a player // Let's behave as if it were a player
@ -198,7 +198,7 @@ public class EngineCanCombatHappen extends Engine {
// ... PVP flag may cause a damage block ... // ... PVP flag may cause a damage block ...
// (just checking the defender as above isn't enough. What about the attacker? It could be in a no-pvp area) // (just checking the defender as above isn't enough. What about the attacker? It could be in a no-pvp area)
// NOTE: This check is probably not that important, but we could keep it anyway. // NOTE: This check is probably not that important, but we could keep it anyway.
if (attackerPsFaction.getFlag(MFlag.getFlagPvp()) == false) { if (!attackerPsFaction.getFlag(MFlag.getFlagPvp())) {
ret = falseUnlessDisallowedPvpEventCancelled(attacker, defender, DisallowCause.PEACEFUL_LAND, event); ret = falseUnlessDisallowedPvpEventCancelled(attacker, defender, DisallowCause.PEACEFUL_LAND, event);
if (!ret && notify) { if (!ret && notify) {
uattacker.msg("<i>PVP is disabled in %s.", attackerPsFaction.describeTo(uattacker)); uattacker.msg("<i>PVP is disabled in %s.", attackerPsFaction.describeTo(uattacker));
@ -239,7 +239,7 @@ public class EngineCanCombatHappen extends Engine {
Rel relation = defendFaction.getRelationTo(attackFaction); Rel relation = defendFaction.getRelationTo(attackFaction);
// Check the relation // Check the relation
if (relation.isFriend() && defenderPsFaction.getFlag(MFlag.getFlagFriendlyire()) == false) { if (relation.isFriend() && !defenderPsFaction.getFlag(MFlag.getFlagFriendlyire())) {
ret = falseUnlessDisallowedPvpEventCancelled(attacker, defender, DisallowCause.FRIENDLYFIRE, event); ret = falseUnlessDisallowedPvpEventCancelled(attacker, defender, DisallowCause.FRIENDLYFIRE, event);
if (!ret && notify) { if (!ret && notify) {
uattacker.msg("<i>You can't hurt %s<i>.", relation.getDescPlayerMany()); uattacker.msg("<i>You can't hurt %s<i>.", relation.getDescPlayerMany());

View File

@ -18,6 +18,7 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent; import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.plugin.EventExecutor; import org.bukkit.plugin.EventExecutor;
import org.jetbrains.annotations.NotNull;
import java.util.Iterator; import java.util.Iterator;
import java.util.function.Predicate; import java.util.function.Predicate;
@ -66,7 +67,7 @@ public class EngineChat extends Engine {
private static class SetFormatEventExecutor implements EventExecutor { private static class SetFormatEventExecutor implements EventExecutor {
@Override @Override
public void execute(Listener listener, Event event) throws EventException { public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException {
try { try {
if (!(event instanceof AsyncPlayerChatEvent)) { if (!(event instanceof AsyncPlayerChatEvent)) {
return; return;
@ -88,7 +89,7 @@ public class EngineChat extends Engine {
private static class ParseTagsEventExecutor implements EventExecutor { private static class ParseTagsEventExecutor implements EventExecutor {
@Override @Override
public void execute(Listener listener, Event event) throws EventException { public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException {
try { try {
if (!(event instanceof AsyncPlayerChatEvent)) { if (!(event instanceof AsyncPlayerChatEvent)) {
return; return;
@ -117,7 +118,7 @@ public class EngineChat extends Engine {
private static class ParseRelcolorEventExecutor implements EventExecutor { private static class ParseRelcolorEventExecutor implements EventExecutor {
@Override @Override
public void execute(Listener listener, Event event) throws EventException { public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException {
try { try {
if (!(event instanceof EventMassiveCorePlayerToRecipientChat)) { if (!(event instanceof EventMassiveCorePlayerToRecipientChat)) {
return; return;

View File

@ -123,9 +123,8 @@ public class EngineDenyTeleport extends Engine {
if (!mconf.allowEnderPearlInOtherTerritory && types.contains(TerritoryType.OTHER)) { if (!mconf.allowEnderPearlInOtherTerritory && types.contains(TerritoryType.OTHER)) {
return Couple.valueOf(cause, TerritoryType.OTHER); return Couple.valueOf(cause, TerritoryType.OTHER);
} }
} else {
// Don't cancel other kinds of teleports
} }
// Don't cancel other kinds of teleports
return null; return null;
} }

View File

@ -112,7 +112,7 @@ public class EngineFly extends Engine {
if (event.getFlag() != MFlag.getFlagFly()) { if (event.getFlag() != MFlag.getFlagFly()) {
return; return;
} }
if (event.isNewValue() == true) { if (event.isNewValue()) {
return; return;
} }

View File

@ -43,10 +43,7 @@ public class Board extends Entity<Board> implements BoardInterface {
if (this.map == null) { if (this.map == null) {
return true; return true;
} }
if (this.map.isEmpty()) { return this.map.isEmpty();
return true;
}
return false;
} }
// -------------------------------------------- // // -------------------------------------------- //
@ -249,11 +246,7 @@ public class Board extends Entity<Board> implements BoardInterface {
} }
nearby = ps.withChunkZ(ps.getChunkZ() - 1); nearby = ps.withChunkZ(ps.getChunkZ() - 1);
if (faction != this.getFactionAt(nearby)) { return faction != this.getFactionAt(nearby);
return true;
}
return false;
} }
@Override @Override
@ -284,11 +277,7 @@ public class Board extends Entity<Board> implements BoardInterface {
} }
nearby = ps.withChunkZ(ps.getChunkZ() - 1); nearby = ps.withChunkZ(ps.getChunkZ() - 1);
if (faction == this.getFactionAt(nearby)) { return faction == this.getFactionAt(nearby);
return true;
}
return false;
} }
@Override @Override

View File

@ -37,6 +37,7 @@ public class BoardColl extends Coll<Board> implements BoardInterface {
// STACK TRACEABILITY // STACK TRACEABILITY
// -------------------------------------------- // // -------------------------------------------- //
@SuppressWarnings("EmptyMethod")
@Override @Override
public void onTick() { public void onTick() {
super.onTick(); super.onTick();

View File

@ -829,11 +829,7 @@ public class Faction extends Entity<Faction> implements FactionsParticipator, MP
if (isPermitted(mplayer.getRank().getId(), permId)) { if (isPermitted(mplayer.getRank().getId(), permId)) {
return true; return true;
} }
if (isPermitted(RelationUtil.getRelationOfThatToMe(mplayer, this).toString(), permId)) { return isPermitted(RelationUtil.getRelationOfThatToMe(mplayer, this).toString(), permId);
return true;
}
return false;
} }
public boolean isPlayerPermitted(MPlayer mplayer, MPerm mperm) { public boolean isPlayerPermitted(MPlayer mplayer, MPerm mperm) {
@ -844,11 +840,7 @@ public class Faction extends Entity<Faction> implements FactionsParticipator, MP
if (isPermitted(faction.getId(), permId)) { if (isPermitted(faction.getId(), permId)) {
return true; return true;
} }
if (isPermitted(RelationUtil.getRelationOfThatToMe(faction, this).toString(), permId)) { return isPermitted(RelationUtil.getRelationOfThatToMe(faction, this).toString(), permId);
return true;
}
return false;
} }
public boolean isFactionPermitted(Faction faction, MPerm mperm) { public boolean isFactionPermitted(Faction faction, MPerm mperm) {

View File

@ -28,6 +28,7 @@ public class FactionColl extends Coll<Faction> {
// STACK TRACEABILITY // STACK TRACEABILITY
// -------------------------------------------- // // -------------------------------------------- //
@SuppressWarnings("EmptyMethod")
@Override @Override
public void onTick() { public void onTick() {
super.onTick(); super.onTick();

View File

@ -18,6 +18,7 @@ public class MConfColl extends Coll<MConf> {
// STACK TRACEABILITY // STACK TRACEABILITY
// -------------------------------------------- // // -------------------------------------------- //
@SuppressWarnings("EmptyMethod")
@Override @Override
public void onTick() { public void onTick() {
super.onTick(); super.onTick();

View File

@ -24,6 +24,7 @@ public class MFlagColl extends Coll<MFlag> {
// STACK TRACEABILITY // STACK TRACEABILITY
// -------------------------------------------- // // -------------------------------------------- //
@SuppressWarnings("EmptyMethod")
@Override @Override
public void onTick() { public void onTick() {
super.onTick(); super.onTick();

View File

@ -27,6 +27,7 @@ public class MPermColl extends Coll<MPerm> {
// STACK TRACEABILITY // STACK TRACEABILITY
// -------------------------------------------- // // -------------------------------------------- //
@SuppressWarnings("EmptyMethod")
@Override @Override
public void onTick() { public void onTick() {
super.onTick(); super.onTick();

View File

@ -96,11 +96,7 @@ public class MPlayer extends SenderEntity<MPlayer> implements FactionsParticipat
if (this.isOverriding()) { if (this.isOverriding()) {
return false; return false;
} }
if (this.isTerritoryInfoTitles() != MConf.get().territoryInfoTitlesDefault) { return this.isTerritoryInfoTitles() == MConf.get().territoryInfoTitlesDefault;
return false;
}
return true;
} }
// -------------------------------------------- // // -------------------------------------------- //
@ -517,13 +513,7 @@ public class MPlayer extends SenderEntity<MPlayer> implements FactionsParticipat
// -------------------------------------------- // // -------------------------------------------- //
public boolean isMapAutoUpdating() { public boolean isMapAutoUpdating() {
if (this.mapAutoUpdating == null) { return Objects.requireNonNullElse(this.mapAutoUpdating, false);
return false;
}
if (this.mapAutoUpdating == false) {
return false;
}
return true;
} }
public void setMapAutoUpdating(Boolean mapAutoUpdating) { public void setMapAutoUpdating(Boolean mapAutoUpdating) {
@ -553,7 +543,7 @@ public class MPlayer extends SenderEntity<MPlayer> implements FactionsParticipat
if (this.overriding == null) { if (this.overriding == null) {
return false; return false;
} }
if (this.overriding == false) { if (!this.overriding) {
return false; return false;
} }

View File

@ -21,6 +21,7 @@ public class MPlayerColl extends SenderColl<MPlayer> {
// STACK TRACEABILITY // STACK TRACEABILITY
// -------------------------------------------- // // -------------------------------------------- //
@SuppressWarnings("EmptyMethod")
@Override @Override
public void onTick() { public void onTick() {
super.onTick(); super.onTick();

View File

@ -94,10 +94,7 @@ public class Warp extends EntityInternal<Warp> implements Named {
if (!MConf.get().warpsMustBeInClaimedTerritory) { if (!MConf.get().warpsMustBeInClaimedTerritory) {
return true; return true;
} }
if (BoardColl.get().getFactionAt(this.getLocation()) == faction) { return BoardColl.get().getFactionAt(this.getLocation()) == faction;
return true;
}
return false;
} }
public boolean isValid() { public boolean isValid() {

View File

@ -8,6 +8,7 @@ import com.massivecraft.massivecore.ps.PS;
import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.MUtil;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import java.util.Collections; import java.util.Collections;
import java.util.Map; import java.util.Map;
@ -22,7 +23,7 @@ public class EventFactionsChunksChange extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -2,6 +2,7 @@ package com.massivecraft.factions.event;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EventFactionsCreate extends EventFactionsAbstractSender { public class EventFactionsCreate extends EventFactionsAbstractSender {
// -------------------------------------------- // // -------------------------------------------- //
@ -11,7 +12,7 @@ public class EventFactionsCreate extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -1,6 +1,7 @@
package com.massivecraft.factions.event; package com.massivecraft.factions.event;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
/** /**
* External plugins that add Faction flags should make sure they exist when this event is called. * External plugins that add Faction flags should make sure they exist when this event is called.
@ -13,7 +14,7 @@ public class EventFactionsCreateFlags extends EventFactionsAbstract {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -1,6 +1,7 @@
package com.massivecraft.factions.event; package com.massivecraft.factions.event;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
/** /**
* External plugins that add Faction perms should make sure they exist when this event is called. * External plugins that add Faction perms should make sure they exist when this event is called.
@ -13,7 +14,7 @@ public class EventFactionsCreatePerms extends EventFactionsAbstract {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -3,6 +3,7 @@ package com.massivecraft.factions.event;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EventFactionsDescriptionChange extends EventFactionsAbstractSender { public class EventFactionsDescriptionChange extends EventFactionsAbstractSender {
// -------------------------------------------- // // -------------------------------------------- //
@ -12,7 +13,7 @@ public class EventFactionsDescriptionChange extends EventFactionsAbstractSender
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -3,6 +3,7 @@ package com.massivecraft.factions.event;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EventFactionsDisband extends EventFactionsAbstractSender { public class EventFactionsDisband extends EventFactionsAbstractSender {
// -------------------------------------------- // // -------------------------------------------- //
@ -12,7 +13,7 @@ public class EventFactionsDisband extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -4,6 +4,7 @@ import com.massivecraft.massivecore.collections.MassiveTreeMap;
import com.massivecraft.massivecore.comparator.ComparatorCaseInsensitive; import com.massivecraft.massivecore.comparator.ComparatorCaseInsensitive;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import java.util.Map; import java.util.Map;
@ -15,7 +16,7 @@ public class EventFactionsExpansions extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -4,6 +4,7 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.massivecore.PriorityLines; import com.massivecraft.massivecore.PriorityLines;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -16,7 +17,7 @@ public class EventFactionsFactionShowAsync extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -4,6 +4,7 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MFlag; import com.massivecraft.factions.entity.MFlag;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EventFactionsFlagChange extends EventFactionsAbstractSender { public class EventFactionsFlagChange extends EventFactionsAbstractSender {
// -------------------------------------------- // // -------------------------------------------- //
@ -13,7 +14,7 @@ public class EventFactionsFlagChange extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -4,6 +4,7 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EventFactionsInvitedChange extends EventFactionsAbstractSender { public class EventFactionsInvitedChange extends EventFactionsAbstractSender {
// -------------------------------------------- // // -------------------------------------------- //
@ -13,7 +14,7 @@ public class EventFactionsInvitedChange extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -4,6 +4,7 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EventFactionsMembershipChange extends EventFactionsAbstractSender { public class EventFactionsMembershipChange extends EventFactionsAbstractSender {
// -------------------------------------------- // // -------------------------------------------- //
@ -13,7 +14,7 @@ public class EventFactionsMembershipChange extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -3,6 +3,7 @@ package com.massivecraft.factions.event;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EventFactionsMotdChange extends EventFactionsAbstractSender { public class EventFactionsMotdChange extends EventFactionsAbstractSender {
// -------------------------------------------- // // -------------------------------------------- //
@ -12,7 +13,7 @@ public class EventFactionsMotdChange extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -3,6 +3,7 @@ package com.massivecraft.factions.event;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EventFactionsNameChange extends EventFactionsAbstractSender { public class EventFactionsNameChange extends EventFactionsAbstractSender {
// -------------------------------------------- // // -------------------------------------------- //
@ -12,7 +13,7 @@ public class EventFactionsNameChange extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -4,6 +4,7 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPerm;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EventFactionsPermChange extends EventFactionsAbstractSender { public class EventFactionsPermChange extends EventFactionsAbstractSender {
// -------------------------------------------- // // -------------------------------------------- //
@ -13,7 +14,7 @@ public class EventFactionsPermChange extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -3,6 +3,7 @@ package com.massivecraft.factions.event;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EventFactionsPowerChange extends EventFactionsAbstractSender { public class EventFactionsPowerChange extends EventFactionsAbstractSender {
// -------------------------------------------- // // -------------------------------------------- //
@ -12,7 +13,7 @@ public class EventFactionsPowerChange extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }
@ -66,7 +67,6 @@ public class EventFactionsPowerChange extends EventFactionsAbstractSender {
DEATH, DEATH,
COMMAND, COMMAND,
UNDEFINED, UNDEFINED,
;
} }
} }

View File

@ -5,6 +5,7 @@ import com.massivecraft.factions.entity.MPlayer;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.jetbrains.annotations.NotNull;
/** /**
* This event is fired when PVP is disallowed between players due to any rules in Factions. * This event is fired when PVP is disallowed between players due to any rules in Factions.
@ -21,7 +22,7 @@ public class EventFactionsPvpDisallowed extends EventFactionsAbstract {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -4,6 +4,7 @@ import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.entity.Rank; import com.massivecraft.factions.entity.Rank;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EventFactionsRankChange extends EventFactionsAbstractSender { public class EventFactionsRankChange extends EventFactionsAbstractSender {
// -------------------------------------------- // // -------------------------------------------- //
@ -13,7 +14,7 @@ public class EventFactionsRankChange extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -4,6 +4,7 @@ import com.massivecraft.factions.Rel;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EventFactionsRelationChange extends EventFactionsAbstractSender { public class EventFactionsRelationChange extends EventFactionsAbstractSender {
@ -14,7 +15,7 @@ public class EventFactionsRelationChange extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -3,6 +3,7 @@ package com.massivecraft.factions.event;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EventFactionsTitleChange extends EventFactionsAbstractSender { public class EventFactionsTitleChange extends EventFactionsAbstractSender {
// -------------------------------------------- // // -------------------------------------------- //
@ -12,7 +13,7 @@ public class EventFactionsTitleChange extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -4,6 +4,7 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.Vote; import com.massivecraft.factions.entity.Vote;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EventFactionsVoteAdd extends EventFactionsAbstractSender { public class EventFactionsVoteAdd extends EventFactionsAbstractSender {
// -------------------------------------------- // // -------------------------------------------- //
@ -13,7 +14,7 @@ public class EventFactionsVoteAdd extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -4,6 +4,7 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.Vote; import com.massivecraft.factions.entity.Vote;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EventFactionsVoteRemove extends EventFactionsAbstractSender { public class EventFactionsVoteRemove extends EventFactionsAbstractSender {
// -------------------------------------------- // // -------------------------------------------- //
@ -13,7 +14,7 @@ public class EventFactionsVoteRemove extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -4,6 +4,7 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.Warp; import com.massivecraft.factions.entity.Warp;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EventFactionsWarpAdd extends EventFactionsAbstractSender { public class EventFactionsWarpAdd extends EventFactionsAbstractSender {
// -------------------------------------------- // // -------------------------------------------- //
@ -13,7 +14,7 @@ public class EventFactionsWarpAdd extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -4,6 +4,7 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.Warp; import com.massivecraft.factions.entity.Warp;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EventFactionsWarpRemove extends EventFactionsAbstractSender { public class EventFactionsWarpRemove extends EventFactionsAbstractSender {
// -------------------------------------------- // // -------------------------------------------- //
@ -13,7 +14,7 @@ public class EventFactionsWarpRemove extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -3,6 +3,7 @@ package com.massivecraft.factions.event;
import com.massivecraft.factions.entity.Warp; import com.massivecraft.factions.entity.Warp;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EventFactionsWarpTeleport extends EventFactionsAbstractSender { public class EventFactionsWarpTeleport extends EventFactionsAbstractSender {
// -------------------------------------------- // // -------------------------------------------- //
@ -12,7 +13,7 @@ public class EventFactionsWarpTeleport extends EventFactionsAbstractSender {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Override @Override
public HandlerList getHandlers() { public @NotNull HandlerList getHandlers() {
return handlers; return handlers;
} }

View File

@ -103,9 +103,7 @@ public class Econ {
if (me instanceof Faction && mperm.has((Faction) me, fYou)) { if (me instanceof Faction && mperm.has((Faction) me, fYou)) {
return true; return true;
} }
if (me instanceof MPlayer && mperm.has((MPlayer) me, fYou, false)) { return me instanceof MPlayer && mperm.has((MPlayer) me, fYou, false);
return true;
}
} }
// Otherwise you may not! ;,,; // Otherwise you may not! ;,,;
@ -168,12 +166,12 @@ public class Econ {
public static Set<MPlayer> getMPlayers(EconomyParticipator ep) { public static Set<MPlayer> getMPlayers(EconomyParticipator ep) {
Set<MPlayer> mplayers = new HashSet<>(); Set<MPlayer> mplayers = new HashSet<>();
if (ep == null) { if (ep != null) {
// Add nothing if (ep instanceof MPlayer) {
} else if (ep instanceof MPlayer) { mplayers.add((MPlayer) ep);
mplayers.add((MPlayer) ep); } else if (ep instanceof Faction) {
} else if (ep instanceof Faction) { mplayers.addAll(((Faction) ep).getMPlayers());
mplayers.addAll(((Faction) ep).getMPlayers()); }
} }
return mplayers; return mplayers;
@ -294,8 +292,8 @@ public class Econ {
faction.setMoney(money - amount); faction.setMoney(money - amount);
} else if (from != null) { } else if (from != null) {
boolean temp = Money.despawn(from, by, amount); boolean temp = Money.despawn(from, by, amount);
if (temp == false) { if (!temp) {
return temp; return false;
} }
} }

View File

@ -117,7 +117,7 @@ public class DynmapStyle {
int ret = 0x00FF00; int ret = 0x00FF00;
try { try {
ret = Integer.parseInt(string.substring(1), 16); ret = Integer.parseInt(string.substring(1), 16);
} catch (NumberFormatException nfx) { } catch (NumberFormatException ignored) {
} }
return ret; return ret;

View File

@ -630,12 +630,7 @@ public class EngineDynmap extends Engine {
return false; return false;
} }
if (!hidden.isEmpty() && hidden.stream().anyMatch(ids::contains)) { return hidden.isEmpty() || hidden.stream().noneMatch(ids::contains);
return false;
}
return true;
} }
// Thread Safe / Asynchronous: Yes // Thread Safe / Asynchronous: Yes

View File

@ -58,7 +58,7 @@ public class EngineLwc extends Engine {
if (remove == null) { if (remove == null) {
return; return;
} }
if (remove == false) { if (!remove) {
return; return;
} }

View File

@ -5,6 +5,7 @@ import com.massivecraft.factions.entity.BoardColl;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import me.clip.placeholderapi.expansion.PlaceholderExpansion; import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import java.text.DecimalFormat; import java.text.DecimalFormat;
@ -24,22 +25,22 @@ public class PlaceholderFactions extends PlaceholderExpansion {
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public String getIdentifier() { public @NotNull String getIdentifier() {
return "factions"; return "factions";
} }
@Override @Override
public String getAuthor() { public @NotNull String getAuthor() {
return "Madus"; return "Madus";
} }
@Override @Override
public String getVersion() { public @NotNull String getVersion() {
return Factions.get().getDescription().getVersion(); return Factions.get().getDescription().getVersion();
} }
@Override @Override
public String onPlaceholderRequest(Player player, String params) { public String onPlaceholderRequest(Player player, @NotNull String params) {
if (player == null) { if (player == null) {
return null; return null;
} }

View File

@ -181,11 +181,7 @@ public class TaskTax extends Task {
} }
int inactiveDays = MConf.get().taxInactiveDays; int inactiveDays = MConf.get().taxInactiveDays;
if (inactiveDays > 0 && offlinePeriod > inactiveDays * TimeUnit.MILLIS_PER_DAY) { return inactiveDays <= 0 || offlinePeriod <= inactiveDays * TimeUnit.MILLIS_PER_DAY;
return false;
}
return true;
} }
private boolean tryKickPlayer(MPlayer mplayer) { private boolean tryKickPlayer(MPlayer mplayer) {