本文整理汇总了Java中com.massivecraft.factions.entity.MPlayer.get方法的典型用法代码示例。如果您正苦于以下问题:Java MPlayer.get方法的具体用法?Java MPlayer.get怎么用?Java MPlayer.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.massivecraft.factions.entity.MPlayer
的用法示例。
在下文中一共展示了MPlayer.get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRelationTo
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
@Override
public Rel getRelationTo(Object comparing) {
// Convert our FactionsFramework Factions object to their object
if (comparing instanceof Faction) {
Faction faction = (Faction) comparing;
comparing = this.faction.getColl().get(faction.getId());
}
// Convert our FactionsFramework FPlayer object to their object
if (comparing instanceof FPlayer) {
FPlayer fplayer = (FPlayer) comparing;
comparing = MPlayer.get(fplayer.getId());
}
if (comparing instanceof RelationParticipator) {
Rel rel = Factions_2_8_6.convertRelationship(this.faction.getRelationTo((RelationParticipator) comparing));
return rel;
}
return null;
}
示例2: getRelationTo
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
@Override
public Rel getRelationTo(Object object) {
if (this.id == "@console") return Rel.NEUTRAL;
if (object instanceof Faction) {
object = FactionColl.get().get(((Faction) object).getId());
}
if (object instanceof FPlayer) {
object = MPlayer.get(((FPlayer) object).getId());
}
if (object instanceof Player) {
object = MPlayer.get((Player) object);
}
return Factions_2_8_6.convertRelationship(this.mplayer.getRelationTo((RelationParticipator) object));
}
示例3: chunkChangeDetect
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void chunkChangeDetect(PlayerMoveEvent event)
{
// If the player is moving from one chunk to another ...
if (MUtil.isSameChunk(event)) return;
Player player = event.getPlayer();
if (this.isntPlayer(player)) return;
// ... gather info on the player and the move ...
MPlayer mplayer = MPlayer.get(player);
PS chunkFrom = PS.valueOf(event.getFrom()).getChunk(true);
PS chunkTo = PS.valueOf(event.getTo()).getChunk(true);
Faction factionFrom = BoardColl.get().getFactionAt(chunkFrom);
Faction factionTo = BoardColl.get().getFactionAt(chunkTo);
if ( ! isChunkCoord(player)) return;
// ... and send info onwards.
EngineMain.get().chunkChangeTerritoryInfo(mplayer, player, chunkFrom, chunkTo, factionFrom, factionTo);
EngineMain.get().chunkChangeAutoClaim(mplayer, chunkTo);
}
示例4: formatFac
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
public static String formatFac(String text, Player sender, Object receiver){
MPlayer mp = MPlayer.get(sender.getUniqueId());
if (!mp.getFaction().isNone()){
Faction fac = mp.getFaction();
text = text
.replace("{fac-id}", fac.getId())
.replace("{fac-name}", fac.getName());
if (fac.hasMotd()){
text = text
.replace("{fac-motd}", fac.getMotd());
}
if (fac.hasDescription()){
text = text
.replace("{fac-description}", fac.getDescription());
}
if (receiver instanceof Player){
MPlayer recmp = MPlayer.get(((Player)receiver).getUniqueId());
text = text
.replace("{fac-relation-name}", fac.getName(recmp))
.replace("{fac-relation-color}", fac.getColorTo(recmp).toString());
}
}
return text;
}
示例5: getInitialRanges
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
@Override
public List<ProtectionRange> getInitialRanges(Player player) {
ArrayList<ProtectionRange> ranges = new ArrayList<>();
MPlayer mplayer = MPlayer.get(player);
if (mplayer.hasFaction()) {
Faction faction = mplayer.getFaction();
MPerm downloadPerm = plugin.getOrRegisterDownloadPerm();
if (downloadPerm.has(mplayer, faction, false)) {
Set<PS> positions = getFactionPositions(player.getWorld(), faction);
ranges.addAll(convertPSToRanges(player.getWorld(), positions, faction));
}
}
return ranges;
}
示例6: FPlayer_2_8_6
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
public FPlayer_2_8_6(String id) {
this.id = id;
if (this.id == "@console") {
this.mplayer = MPlayer.get(Bukkit.getConsoleSender());
} else {
this.mplayer = MPlayer.get(id);
}
}
示例7: isProtected
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
private boolean isProtected(Player player, Block b) {
Faction faction = BoardColl.get().getFactionAt(PS.valueOf(b));
MPlayer mp = MPlayer.get(player);
if (faction != null && !faction.getId().equals("none")) {
if (!faction.getId().equals(mp.getFactionId())) return true;
}
return false;
}
示例8: convertPlayerToMPlayer
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
/**
* Converts a {@link Player} to an {@link MPlayer}.
*
* @return The mplayer.
*/
private MPlayer convertPlayerToMPlayer(Player player) {
if (player == null) {
return null;
}
if (!MUtil.isPlayer(player)) {
// If they aren't a player (IE, they are an NPC?)
return null;
}
return MPlayer.get(player);
}
示例9: replaceFaction
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
public static String replaceFaction(Player player, String msg) {
if (!HookManager.checkFactions()) {
return msg.replace("%faction", "");
}
final MPlayer uplayer = MPlayer.get(player);
final Faction faction = uplayer.getFaction();
return msg.replace("%faction", faction.getName());
}
示例10: getFactionPlayers
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
public static Collection<Player> getFactionPlayers( Player p ) {
Collection<Player> factionPlayers = new ArrayList<>();
MPlayer uplayer = MPlayer.get( p );
for ( Player ps : uplayer.getFaction().getOnlinePlayers() ) {
if ( ps.hasPermission( "bungeesuite.chat.channel.faction" ) ) {
factionPlayers.add( ps );
}
}
return factionPlayers;
}
示例11: getFactionAllyPlayers
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
public static Collection<Player> getFactionAllyPlayers( Player p ) {
/*Collection<Player> factionPlayers = new ArrayList<>();
MPlayer uplayer = MPlayer.get( p );
Map<Rel, List<String>> rels = uplayer.getFaction().getRelationNames(uplayer.getFaction(), rels, skipPeaceful).getFactionNamesPerRelation( uplayer.getFaction() );
for ( Player ps : uplayer.getFaction().getOnlinePlayers() ) {
if ( ps.hasPermission( "bungeesuite.chat.channel.factionally" ) ) {
factionPlayers.add( ps );
}
}
for ( String data : rels.get( Rel.ALLY ) ) {
Faction f = FactionColls.get().getForUniverse( uplayer.getFaction().getUniverse() ).getByName( ChatColor.stripColor( data ) );
for ( Player ps : f.getOnlinePlayers() ) {
if ( ps.hasPermission( "bungeesuite.chat.channel.factionally" ) ) {
factionPlayers.add( ps );
}
}
}
return factionPlayers;*/
Collection<Player> factionPlayers = new ArrayList<Player>();
MPlayer uplayer = MPlayer.get(p);
Faction mine = uplayer.getFaction();
for(Faction f : FactionColl.get().getAll()){
if(mine.getRelationTo(f) == Rel.ALLY){
factionPlayers.addAll(f.getOnlinePlayers());
}
}
return factionPlayers;
}
示例12: getFactionChannelPerm
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
public static boolean getFactionChannelPerm( CommandSender sender ) {
if ( !BungeeSuiteChat.factionChat ) {
return false;
}
MPlayer p = MPlayer.get( sender );
if ( !p.hasFaction() ) {
return false;
}
if ( p.getFaction().isDefault() ) {
return false;
}
return true;
}
示例13: getRelationship
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
@Override
public MyRel getRelationship(Object player1, Object player2) {
MPlayer uplayer1 = MPlayer.get(player1);
MPlayer uplayer2 = MPlayer.get(player2);
Rel rel = uplayer1.getRelationTo(uplayer2.getFaction());
if (null != rel)
{
switch (rel) {
case NEUTRAL:
return MyRel.NEUTRAL;
case ALLY:
return MyRel.ALLY;
case TRUCE:
return MyRel.TRUCE;
case ENEMY:
return MyRel.ENEMY;
case LEADER:
return MyRel.LEADER;
case MEMBER:
return MyRel.MEMBER;
case RECRUIT:
return MyRel.RECRUIT;
case OFFICER:
return MyRel.OFFICER;
default:
return null;
}
}
return null;
}
示例14: getRelation
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
@Override
public ChatColor getRelation(Player player, String factionId) {
MPlayer mplayer = MPlayer.get(player);
Faction faction = Faction.get(factionId);
return mplayer.getFaction().getRelationTo(faction).getColor();
}
示例15: isInFaction
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
public boolean isInFaction() {
MPlayer mPlayer = MPlayer.get((Object) player);
Faction faction = mPlayer.getFaction();
String id = faction.getId();
return !(id.equals(Factions.ID_NONE) || id.equals(Factions.ID_SAFEZONE) || id.equals(Factions.ID_WARZONE));
}