• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Faction类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.massivecraft.factions.Faction的典型用法代码示例。如果您正苦于以下问题:Java Faction类的具体用法?Java Faction怎么用?Java Faction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Faction类属于com.massivecraft.factions包,在下文中一共展示了Faction类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: isAdded

import com.massivecraft.factions.Faction; //导入依赖的package包/类
public boolean isAdded(final RegionWrapper locs, final World world, final Player player, final boolean perm, MaskType type) {
    for (int x = locs.minX; x <= locs.maxX; x++) {
        for (int z = locs.minZ; z <= locs.maxZ; z++) {
            final Faction fac = this.instance.getFactionAt(new FLocation(world.getName(), x, z));
            if (fac == null) {
                return false;
            }
            // TODO types
            if (!fac.getOnlinePlayers().contains(player)) {
                return false;
            }
            if (fac.isWilderness() && !perm) {
                return false;
            }
        }
    }
    return true;
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:19,代码来源:FactionsUUIDFeature.java


示例2: isWarZone

import com.massivecraft.factions.Faction; //导入依赖的package包/类
private final boolean isWarZone(Location location)
{
	if (! isEnabled())
		return false;

	try
	{
		Faction fac = Board.getAbsoluteFactionAt(new FLocation(location));
		return fac.isWarZone();
	}
	catch (Throwable ex)
	{
		//
	}

	return false;
}
 
开发者ID:dmulloy2,项目名称:SwornRPG,代码行数:18,代码来源:SwornNationsHandler.java


示例3: isSafeZone

import com.massivecraft.factions.Faction; //导入依赖的package包/类
private final boolean isSafeZone(Location location)
{
	if (! isEnabled())
		return false;

	try
	{
		Faction fac = Board.getAbsoluteFactionAt(new FLocation(location));
		return fac.isSafeZone();
	}
	catch (Throwable ex)
	{
		//
	}

	return false;
}
 
开发者ID:dmulloy2,项目名称:SwornRPG,代码行数:18,代码来源:SwornNationsHandler.java


示例4: isWarZone

import com.massivecraft.factions.Faction; //导入依赖的package包/类
private final boolean isWarZone(Location location)
{
	if (! isEnabled())
		return false;

	try
	{
		Faction fac = Board.getAbsoluteFactionAt(new FLocation(location));
		return fac.isWarZone();
	}
	catch (Throwable ex)
	{
		handler.getLogHandler().debug(Level.WARNING, Util.getUsefulStack(ex, "isWarZone()"));
	}

	return false;
}
 
开发者ID:dmulloy2,项目名称:SwornGuns,代码行数:18,代码来源:SwornNationsHandler.java


示例5: isSafeZone

import com.massivecraft.factions.Faction; //导入依赖的package包/类
private final boolean isSafeZone(Location location)
{
	if (! isEnabled())
		return false;

	try
	{
		Faction fac = Board.getAbsoluteFactionAt(new FLocation(location));
		return fac.isSafeZone();
	}
	catch (Throwable ex)
	{
		handler.getLogHandler().debug(Level.WARNING, Util.getUsefulStack(ex, "isSafeZone()"));
	}

	return false;
}
 
开发者ID:dmulloy2,项目名称:SwornGuns,代码行数:18,代码来源:SwornNationsHandler.java


示例6: onClaim

import com.massivecraft.factions.Faction; //导入依赖的package包/类
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onClaim(LandClaimEvent event) {
    Faction faction = Board.getFactionAt(event.getLocation());
    Multimap<String, ChunkPos> claims = HashMultimap.create();
    claims.put(faction.getId(), getChunkPos(event.getLocation()));
    callEvent(new FactionClaimEvent(event.getFaction().getId(), claims));
}
 
开发者ID:novucs,项目名称:factions-top,代码行数:8,代码来源:Factions0108.java


示例7: isFactionOffline

import com.massivecraft.factions.Faction; //导入依赖的package包/类
@Override
public boolean isFactionOffline(Location loc) {
    Faction faction = Board.getInstance().getFactionAt(new FLocation(loc));
    if (!faction.isNormal()) { // Checks if faction isn't safezone, warzone, or wilderness.
        //ObsidianDestroyer.debug("Factions16x.isFactionOffline: false");
        return false;
    }
    //ObsidianDestroyer.debug("Factions16x.isFactionOffline: " + (faction.getOnlinePlayers().size() == 0));
    return faction.getOnlinePlayers().size() == 0;
}
 
开发者ID:drtshock,项目名称:ObsidianDestroyer,代码行数:11,代码来源:Factions16xUU.java


示例8: isExplosionsEnabled

import com.massivecraft.factions.Faction; //导入依赖的package包/类
@Override
public boolean isExplosionsEnabled(Location loc) {
    Faction faction = Board.getInstance().getFactionAt(new FLocation(loc));
    if (!faction.isNormal()) {
        return faction.getId().equalsIgnoreCase("0"); // Checks if faction is wilderness.
    }
    //ObsidianDestroyer.debug("Factions16x.isExplosionsEnabled: " + !faction.noExplosionsInTerritory());
    return !faction.noExplosionsInTerritory();
}
 
开发者ID:drtshock,项目名称:ObsidianDestroyer,代码行数:10,代码来源:Factions16xUU.java


示例9: getRelationship

import com.massivecraft.factions.Faction; //导入依赖的package包/类
@Override
public MyRel getRelationship(Object player1, Object player2) {
    FPlayer fSenderPlayer = FPlayers.getInstance().getByPlayer(player1);
    Faction SenderFaction = fSenderPlayer.getFaction();
    FPlayer fplayer = FPlayers.getInstance().getByPlayer(player2);
    Relation rel = SenderFaction.getRelationTo(fplayer);
    if (fSenderPlayer.getFactionId().equals(fplayer.getFactionId())) {
        return MyRel.MEMBER;
    }
    if (rel == Relation.NEUTRAL) {
        return MyRel.NEUTRAL;
    }
    if (rel == Relation.ALLY) {
        return MyRel.ALLY;
    }
    if (rel == Relation.ENEMY) {
        return MyRel.ENEMY;
    }
    if (rel == Relation.MEMBER) {
        return MyRel.MEMBER;
    }
    if (hasTruce() && rel == Relation.TRUCE) {
        return MyRel.TRUCE;
    }

    return null;
}
 
开发者ID:James137137,项目名称:FactionChat,代码行数:28,代码来源:FactionsAPI_1_6_2.java


示例10: getRelationship

import com.massivecraft.factions.Faction; //导入依赖的package包/类
@Override
public MyRel getRelationship(Object player1, Object player2) {
    FPlayer fSenderPlayer = FPlayers.getInstance().getByPlayer(player1);
    Faction SenderFaction = fSenderPlayer.getFaction();
    FPlayer fplayer = FPlayers.getInstance().getByPlayer(player2);
    Relation rel = SenderFaction.getRelationTo(fplayer);
    if (fSenderPlayer.getFactionId().equals(fplayer.getFactionId()))
    {
        return MyRel.MEMBER;
    }
    if (rel == Relation.NEUTRAL)
    {
        return MyRel.NEUTRAL;
    }
    if (rel == Relation.ALLY)
    {
        return MyRel.ALLY;
    }
    if (rel == Relation.ENEMY)
    {
        return MyRel.ENEMY;
    }
    if (rel == Relation.MEMBER)
    {
        return MyRel.MEMBER;
    }
    
    return null;
}
 
开发者ID:James137137,项目名称:FactionChat,代码行数:30,代码来源:FactionsAPI_1_6.java


示例11: getFactionAt

import com.massivecraft.factions.Faction; //导入依赖的package包/类
@Override
public String getFactionAt(String worldName, int chunkX, int chunkZ) {
    Faction faction = Board.getFactionAt(new FLocation(worldName, chunkX, chunkZ));
    return faction.getId();
}
 
开发者ID:novucs,项目名称:factions-top,代码行数:6,代码来源:Factions0108.java


示例12: getRelation

import com.massivecraft.factions.Faction; //导入依赖的package包/类
@Override
public ChatColor getRelation(Player player, String factionId) {
    FPlayer fplayer = FPlayers.i.get(player);
    Faction faction = Factions.i.get(factionId);
    return fplayer.getFaction().getRelationTo(faction).getColor();
}
 
开发者ID:novucs,项目名称:factions-top,代码行数:7,代码来源:Factions0108.java


示例13: isFactionAtPower

import com.massivecraft.factions.Faction; //导入依赖的package包/类
@Override
public boolean isFactionAtPower(Location loc) {
    Faction faction = Board.getInstance().getFactionAt(new FLocation(loc));
    return faction.getPower() >= faction.getLandRounded();
}
 
开发者ID:drtshock,项目名称:ObsidianDestroyer,代码行数:6,代码来源:Factions16xUU.java


示例14: onBreakSign

import com.massivecraft.factions.Faction; //导入依赖的package包/类
@EventHandler
public void onBreakSign(BlockBreakEvent e) {
	
	if(e.getBlock().getType().equals(Material.WALL_SIGN)) {
		
		Player player = e.getPlayer();
		
		FPlayer fplayer = FPlayers.getInstance().getByPlayer(player);
		
		Faction playerfaction = fplayer.getFaction();
		
		Block sign = e.getBlock();
		
		Location bsignloc = sign.getLocation();
		
		FLocation fsignloc = new FLocation(bsignloc);
		
		Faction signfaction = Board.getInstance().getFactionAt(fsignloc);
		
		if(playerfaction.equals(signfaction)) {
			
			Sign s = (Sign) sign.getState();
			
			if(canUseChest(player, fplayer, s)==false) {
				
				e.setCancelled(true);
				
				player.sendMessage(color("&cYou do not have access to this Subclaim!"));
				
			}
			
		}
		
	}
	
}
 
开发者ID:beatlynx,项目名称:SimpleSubclaimsUUID,代码行数:37,代码来源:SubclaimListenerUUID.java



注:本文中的com.massivecraft.factions.Faction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WSDLGeneratorExtension类代码示例发布时间:2022-05-23
下一篇:
Java SubstitutionGroupHandler类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap