Reduce predicate usage

This commit is contained in:
Magnus Ulf 2019-05-19 21:19:21 +02:00
parent 9953573c9f
commit 1618da1083
4 changed files with 7 additions and 6 deletions

View File

@ -7,10 +7,10 @@ import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.command.Parameter; import com.massivecraft.massivecore.command.Parameter;
import com.massivecraft.massivecore.pager.Pager; import com.massivecraft.massivecore.pager.Pager;
import com.massivecraft.massivecore.pager.Stringifier; import com.massivecraft.massivecore.pager.Stringifier;
import com.massivecraft.massivecore.predicate.Predicate;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import java.util.List; import java.util.List;
import java.util.function.Predicate;
public class CmdFactionsPermList extends FactionsCommand public class CmdFactionsPermList extends FactionsCommand
{ {

View File

@ -7,11 +7,11 @@ import com.massivecraft.factions.entity.MConf;
import com.massivecraft.massivecore.MassiveException; 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.predicate.Predicate;
import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.ps.PS;
import com.massivecraft.massivecore.util.ChunkUtil; import com.massivecraft.massivecore.util.ChunkUtil;
import java.util.Set; import java.util.Set;
import java.util.function.Predicate;
public class CmdFactionsSetFill extends CmdFactionsSetXSimple public class CmdFactionsSetFill extends CmdFactionsSetXSimple

View File

@ -2,11 +2,11 @@ package com.massivecraft.factions.predicate;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.predicate.Predicate;
import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.MUtil;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import java.io.Serializable; import java.io.Serializable;
import java.util.function.Predicate;
public class PredicateCommandSenderFaction implements Predicate<CommandSender>, Serializable public class PredicateCommandSenderFaction implements Predicate<CommandSender>, Serializable
{ {
@ -33,7 +33,7 @@ public class PredicateCommandSenderFaction implements Predicate<CommandSender>,
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public boolean apply(CommandSender sender) public boolean test(CommandSender sender)
{ {
if (MUtil.isntSender(sender)) return false; if (MUtil.isntSender(sender)) return false;

View File

@ -3,7 +3,8 @@ package com.massivecraft.factions.predicate;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.entity.Rank; import com.massivecraft.factions.entity.Rank;
import com.massivecraft.massivecore.predicate.Predicate;
import java.util.function.Predicate;
public class PredicateMPlayerRank implements Predicate<MPlayer> public class PredicateMPlayerRank implements Predicate<MPlayer>
{ {
@ -29,7 +30,7 @@ public class PredicateMPlayerRank implements Predicate<MPlayer>
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public boolean apply(MPlayer mplayer) public boolean test(MPlayer mplayer)
{ {
if (mplayer == null) return false; if (mplayer == null) return false;
Faction faction = mplayer.getFaction(); Faction faction = mplayer.getFaction();