From 1618da1083f1ffc37a716b73e13cdfa9c2062b3a Mon Sep 17 00:00:00 2001 From: Magnus Ulf Date: Sun, 19 May 2019 21:19:21 +0200 Subject: [PATCH] Reduce predicate usage --- src/com/massivecraft/factions/cmd/CmdFactionsPermList.java | 2 +- src/com/massivecraft/factions/cmd/CmdFactionsSetFill.java | 2 +- .../factions/predicate/PredicateCommandSenderFaction.java | 4 ++-- .../factions/predicate/PredicateMPlayerRank.java | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPermList.java b/src/com/massivecraft/factions/cmd/CmdFactionsPermList.java index 3d12e66c..f6ea0f3f 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPermList.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPermList.java @@ -7,10 +7,10 @@ import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.command.Parameter; import com.massivecraft.massivecore.pager.Pager; import com.massivecraft.massivecore.pager.Stringifier; -import com.massivecraft.massivecore.predicate.Predicate; import org.bukkit.Bukkit; import java.util.List; +import java.util.function.Predicate; public class CmdFactionsPermList extends FactionsCommand { diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetFill.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetFill.java index 0bdc09e1..45590206 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetFill.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetFill.java @@ -7,11 +7,11 @@ import com.massivecraft.factions.entity.MConf; import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; -import com.massivecraft.massivecore.predicate.Predicate; import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.util.ChunkUtil; import java.util.Set; +import java.util.function.Predicate; public class CmdFactionsSetFill extends CmdFactionsSetXSimple diff --git a/src/com/massivecraft/factions/predicate/PredicateCommandSenderFaction.java b/src/com/massivecraft/factions/predicate/PredicateCommandSenderFaction.java index d8f60998..59464a75 100644 --- a/src/com/massivecraft/factions/predicate/PredicateCommandSenderFaction.java +++ b/src/com/massivecraft/factions/predicate/PredicateCommandSenderFaction.java @@ -2,11 +2,11 @@ package com.massivecraft.factions.predicate; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MPlayer; -import com.massivecraft.massivecore.predicate.Predicate; import com.massivecraft.massivecore.util.MUtil; import org.bukkit.command.CommandSender; import java.io.Serializable; +import java.util.function.Predicate; public class PredicateCommandSenderFaction implements Predicate, Serializable { @@ -33,7 +33,7 @@ public class PredicateCommandSenderFaction implements Predicate, // -------------------------------------------- // @Override - public boolean apply(CommandSender sender) + public boolean test(CommandSender sender) { if (MUtil.isntSender(sender)) return false; diff --git a/src/com/massivecraft/factions/predicate/PredicateMPlayerRank.java b/src/com/massivecraft/factions/predicate/PredicateMPlayerRank.java index 423f22af..504570fd 100644 --- a/src/com/massivecraft/factions/predicate/PredicateMPlayerRank.java +++ b/src/com/massivecraft/factions/predicate/PredicateMPlayerRank.java @@ -3,7 +3,8 @@ package com.massivecraft.factions.predicate; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.Rank; -import com.massivecraft.massivecore.predicate.Predicate; + +import java.util.function.Predicate; public class PredicateMPlayerRank implements Predicate { @@ -29,7 +30,7 @@ public class PredicateMPlayerRank implements Predicate // -------------------------------------------- // @Override - public boolean apply(MPlayer mplayer) + public boolean test(MPlayer mplayer) { if (mplayer == null) return false; Faction faction = mplayer.getFaction();