Remove ID update. Add NPC awareness.
This commit is contained in:
@@ -23,6 +23,7 @@ import com.massivecraft.massivecore.mixin.TeleporterException;
|
||||
import com.massivecraft.massivecore.ps.PS;
|
||||
import com.massivecraft.massivecore.teleport.Destination;
|
||||
import com.massivecraft.massivecore.teleport.DestinationSimple;
|
||||
import com.massivecraft.massivecore.util.MUtil;
|
||||
|
||||
|
||||
public class CmdFactionsHome extends FactionsCommandHome
|
||||
@@ -119,6 +120,8 @@ public class CmdFactionsHome extends FactionsCommandHome
|
||||
|
||||
for (Player p : me.getServer().getOnlinePlayers())
|
||||
{
|
||||
if (MUtil.isNpc(p)) continue;
|
||||
|
||||
if (p == null || !p.isOnline() || p.isDead() || p == me || p.getWorld() != w)
|
||||
continue;
|
||||
|
||||
|
@@ -10,6 +10,7 @@ import org.bukkit.command.CommandSender;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.FactionColl;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.entity.MPlayerColl;
|
||||
import com.massivecraft.massivecore.CaseInsensitiveComparator;
|
||||
import com.massivecraft.massivecore.MassiveCore;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
@@ -53,7 +54,7 @@ public class ARFaction extends ARAbstract<Faction>
|
||||
|
||||
// MPlayer Name Exact
|
||||
String id = IdUtil.getId(str);
|
||||
MPlayer mplayer = MPlayer.get(id);
|
||||
MPlayer mplayer = MPlayerColl.get().get(id, false);
|
||||
if (mplayer != null)
|
||||
{
|
||||
return mplayer.getFaction();
|
||||
|
@@ -5,6 +5,7 @@ import org.bukkit.command.CommandSender;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.cmd.MassiveCommand;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqAbstract;
|
||||
import com.massivecraft.massivecore.util.MUtil;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class ReqHasFaction extends ReqAbstract
|
||||
@@ -25,7 +26,9 @@ public class ReqHasFaction extends ReqAbstract
|
||||
@Override
|
||||
public boolean apply(CommandSender sender, MassiveCommand command)
|
||||
{
|
||||
return MPlayer.get(sender).hasFaction();
|
||||
if (MUtil.isNpc(sender)) return false;
|
||||
MPlayer mplayer = MPlayer.get(sender);
|
||||
return mplayer.hasFaction();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -5,6 +5,7 @@ import org.bukkit.command.CommandSender;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.cmd.MassiveCommand;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqAbstract;
|
||||
import com.massivecraft.massivecore.util.MUtil;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class ReqHasntFaction extends ReqAbstract
|
||||
@@ -25,7 +26,9 @@ public class ReqHasntFaction extends ReqAbstract
|
||||
@Override
|
||||
public boolean apply(CommandSender sender, MassiveCommand command)
|
||||
{
|
||||
return !MPlayer.get(sender).hasFaction();
|
||||
if (MUtil.isNpc(sender)) return true;
|
||||
MPlayer mplayer = MPlayer.get(sender);
|
||||
return !mplayer.hasFaction();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -6,6 +6,7 @@ import com.massivecraft.factions.Rel;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.cmd.MassiveCommand;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqAbstract;
|
||||
import com.massivecraft.massivecore.util.MUtil;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class ReqRoleIsAtLeast extends ReqAbstract
|
||||
@@ -33,6 +34,7 @@ public class ReqRoleIsAtLeast extends ReqAbstract
|
||||
@Override
|
||||
public boolean apply(CommandSender sender, MassiveCommand command)
|
||||
{
|
||||
if (MUtil.isNpc(sender)) return false;
|
||||
MPlayer mplayer = MPlayer.get(sender);
|
||||
return mplayer.getRole().isAtLeast(this.rel);
|
||||
}
|
||||
|
Reference in New Issue
Block a user