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

Java FLocation类代码示例

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

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



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

示例1: mimicUnclaim

import com.massivecraft.factions.FLocation; //导入依赖的package包/类
private Boolean mimicUnclaim(com.massivecraft.factions.FPlayer fplayer, com.massivecraft.factions.Faction faction, FLocation flocation) {
	if (Econ.shouldBeUsed()) {
		double refund = Econ.calculateClaimRefund(faction.getLandRounded());
		
		if (Conf.bankEnabled && Conf.bankFactionPaysLandCosts) {
			if ( ! Econ.modifyMoney(faction, refund, "to unclaim this land", "for unclaiming this land")) return false;
		} else {
			if ( ! Econ.modifyMoney(fplayer, refund, "to unclaim this land", "for unclaiming this land")) return false;
		}
	}
	
	Board.getInstance().removeAt(flocation);
	faction.msg("%s<i> unclaimed some land.", fplayer.describeTo(faction, true));

	// Log if factions wants us to 
	if (Conf.logLandUnclaims) {
		P.p.log(fplayer.getName()+" unclaimed land at ("+flocation.getCoordString()+") from the faction: "+faction.getTag());
	}
	
	return true;
}
 
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:22,代码来源:Events_1_6.java


示例2: mimicUnclaim

import com.massivecraft.factions.FLocation; //导入依赖的package包/类
private Boolean mimicUnclaim(com.massivecraft.factions.FPlayer fplayer, com.massivecraft.factions.Faction faction, FLocation flocation) {
	if (Econ.shouldBeUsed()) {
		double refund = Econ.calculateClaimRefund(faction.getLandRounded());
		
		if (Conf.bankEnabled && Conf.bankFactionPaysLandCosts) {
			if ( ! Econ.modifyMoney(faction, refund, "to unclaim this land", "for unclaiming this land")) return false;
		} else {
			if ( ! Econ.modifyMoney(fplayer, refund, "to unclaim this land", "for unclaiming this land")) return false;
		}
	}
	
	Board.removeAt(flocation);
	
	faction.msg("%s<i> unclaimed some land.", fplayer.describeTo(faction, true));

	// Log if factions wants us to 
	if (Conf.logLandUnclaims) {
		P.p.log(fplayer.getName()+" unclaimed land at ("+flocation.getCoordString()+") from the faction: "+faction.getTag());
	}
	
	return true;
}
 
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:23,代码来源:Events_1_8.java


示例3: isAdded

import com.massivecraft.factions.FLocation; //导入依赖的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


示例4: doesFactionsApply

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

	try
	{
		return ! Board.getAbsoluteFactionAt(new FLocation(location)).isNone();
	}
	catch (Throwable ex)
	{
		handler.getLogHandler().debug(Level.WARNING, "doesFactionsApply()");
	}

	return false;
}
 
开发者ID:MineSworn,项目名称:SwornCritters,代码行数:17,代码来源:SwornNationsHandler.java


示例5: isWarZone

import com.massivecraft.factions.FLocation; //导入依赖的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


示例6: isSafeZone

import com.massivecraft.factions.FLocation; //导入依赖的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


示例7: isWarZone

import com.massivecraft.factions.FLocation; //导入依赖的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


示例8: isSafeZone

import com.massivecraft.factions.FLocation; //导入依赖的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


示例9: onEventFactionsChunksChange

import com.massivecraft.factions.FLocation; //导入依赖的package包/类
@EventHandler
public void onEventFactionsChunksChange(LandClaimEvent event) {
	// Grab all the information for the event 
	FLocation flocation = event.getLocation();
	
	Chunk chunk = flocation.getWorld().getChunkAt(Math.toIntExact(flocation.getX()), Math.toIntExact(flocation.getZ()));
	
	Set<Chunk> chunks = new TreeSet<Chunk>();
	chunks.add(chunk);
	
	Faction newFaction = Factions.getById(event.getFaction().getId());
	
	FPlayer fplayer = FPlayers.getById(event.getfPlayer().getId());
	
	// Create and call our event 
	EventFactionsChunksChange eventFactionsChunksChange = new EventFactionsChunksChange(newFaction, fplayer, chunks);
	eventFactionsChunksChange.setCancelled(event.isCancelled());
	eventFactionsChunksChange.call();
	
	// Update event information
	event.setCancelled(eventFactionsChunksChange.isCancelled());
	
	// If all the chunks have been removed, cancel the event 
	if (eventFactionsChunksChange.getChunks().size() == 0) {
		event.setCancelled(true);
		return;
	}
	
	// If there are more than 1 or the only chunk there is not the existing chunk
	if (eventFactionsChunksChange.getChunks().size() > 1 || this.getFinalChunk(eventFactionsChunksChange.getChunks()) != chunk) {
		event.setCancelled(true);
		this.handleNewClaims(event.getfPlayer(), event.getFaction(), eventFactionsChunksChange.getChunks());
		return;
	}
}
 
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:36,代码来源:Events_1_6.java


示例10: getAt

import com.massivecraft.factions.FLocation; //导入依赖的package包/类
@Override
public Faction getAt(Chunk chunk) {
	FLocation flocation = new FLocation(chunk.getWorld().getName(), chunk.getX(), chunk.getZ());
	String id = Board.getInstance().getIdAt(flocation);
	
	if (id == null) return null;
	
	return get(id);
}
 
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:10,代码来源:Factions_1_6.java


示例11: onEventFactionsChunksChange

import com.massivecraft.factions.FLocation; //导入依赖的package包/类
@EventHandler
public void onEventFactionsChunksChange(LandClaimEvent event) {
	// Grab all the information for the event 
	FLocation flocation = event.getLocation();
	
	Chunk chunk = flocation.getWorld().getChunkAt(Math.toIntExact(flocation.getX()), Math.toIntExact(flocation.getZ()));
	
	Set<Chunk> chunks = new TreeSet<Chunk>();
	chunks.add(chunk);
	
	Faction newFaction = Factions.getById(event.getFaction().getId());
	
	FPlayer fplayer = FPlayers.getById(event.getFPlayer().getId());
	
	// Create and call our event 
	EventFactionsChunksChange eventFactionsChunksChange = new EventFactionsChunksChange(newFaction, fplayer, chunks);
	eventFactionsChunksChange.setCancelled(event.isCancelled());
	eventFactionsChunksChange.call();
	
	// Update event information
	event.setCancelled(eventFactionsChunksChange.isCancelled());
	
	// If all the chunks have been removed, cancel the event 
	if (eventFactionsChunksChange.getChunks().size() == 0) {
		event.setCancelled(true);
		return;
	}
	
	// If there are more than 1 or the only chunk there is not the existing chunk
	if (eventFactionsChunksChange.getChunks().size() > 1 || this.getFinalChunk(eventFactionsChunksChange.getChunks()) != chunk) {
		event.setCancelled(true);
		this.handleNewClaims(event.getFPlayer(), event.getFaction(), eventFactionsChunksChange.getChunks());
		return;
	}
}
 
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:36,代码来源:Events_1_8.java


示例12: getAt

import com.massivecraft.factions.FLocation; //导入依赖的package包/类
@Override
public Faction getAt(Chunk chunk) {
	FLocation flocation = new FLocation(chunk.getWorld().getName(), chunk.getX(), chunk.getZ());
	String id = Board.getIdAt(flocation);
	
	if (id == null) return null;
	
	return get(id);
}
 
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:10,代码来源:Factions_1_8.java


示例13: initialize

import com.massivecraft.factions.FLocation; //导入依赖的package包/类
@Override
public void initialize() {
    try {
        Field flocationIdsField = Board.class.getDeclaredField("flocationIds");
        flocationIdsField.setAccessible(true);
        flocationIds = (Map<FLocation, TerritoryAccess>) flocationIdsField.get(null);
        flocationIdsField.setAccessible(false);
    } catch (NoSuchFieldException | IllegalAccessException ex) {
        getPlugin().getLogger().severe("Factions version found is incompatible!");
        getPlugin().getServer().getPluginManager().disablePlugin(getPlugin());
        return;
    }

    super.initialize();
}
 
开发者ID:novucs,项目名称:factions-top,代码行数:16,代码来源:Factions0108.java


示例14: factionsUUIDClaim

import com.massivecraft.factions.FLocation; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public boolean factionsUUIDClaim(Location loc) {
    if (wild.getConfig().getBoolean("FactionsUUID")) {
        //Long call to insure it calls FactionsUUID method not massivecraft Factions
        com.massivecraft.factions.Faction faction = com.massivecraft.factions.Board.getInstance().getFactionAt(new com.massivecraft.factions.FLocation(loc));
        if (!faction.isNone() && !checkSurroundingFactionsUUID(loc))
            return true;
        else
            return false;
    } else
        return false;
}
 
开发者ID:Qballl,项目名称:WildernessTp,代码行数:13,代码来源:ClaimChecks.java


示例15: checkSurroundingFactionsUUID

import com.massivecraft.factions.FLocation; //导入依赖的package包/类
@SuppressWarnings("deprecation")
private boolean checkSurroundingFactionsUUID(Location loc) {
    Board board = com.massivecraft.factions.Board.getInstance();
    int distance = range / 2;
    Vector top = new Vector(loc.getX() + distance, loc.getY(), loc.getZ() + distance);
    Vector bottom = new Vector(loc.getX() - distance, loc.getY(), loc.getZ() - distance);
    for (int z = bottom.getBlockZ(); z <= top.getBlockZ(); z++) {
        for (int x = bottom.getBlockX(); x <= top.getBlockX(); x++) {
            if (board.getFactionAt(new FLocation(new Location(loc.getWorld(), loc.getX() + x, loc.getY(), loc.getZ() + z))).isNone())
                return true;
        }
    }
    return false;
}
 
开发者ID:Qballl,项目名称:WildernessTp,代码行数:15,代码来源:ClaimChecks.java


示例16: legacyFactionsClaim

import com.massivecraft.factions.FLocation; //导入依赖的package包/类
public boolean legacyFactionsClaim(Location loc){
    //WHY DO THEY REFACTOR THE PACKAGE
    //Long call to get the board of legacy factions
    if(wild.getConfig().getBoolean("LegacyFactions")){
        net.redstoneore.legacyfactions.entity.Board board = net.redstoneore.legacyfactions.entity.Board.get();
        net.redstoneore.legacyfactions.entity.Faction faction = board.getFactionAt(new net.redstoneore.legacyfactions.FLocation(loc));
        if(faction.isWilderness()&&!checkSurroundingLegacyFactions(loc))
            return true;
        else
            return false;
    }
    return false;
}
 
开发者ID:Qballl,项目名称:WildernessTp,代码行数:14,代码来源:ClaimChecks.java


示例17: checkSurroundingLegacyFactions

import com.massivecraft.factions.FLocation; //导入依赖的package包/类
private boolean checkSurroundingLegacyFactions(Location loc) {
    net.redstoneore.legacyfactions.entity.Board board = net.redstoneore.legacyfactions.entity.Board.get();        int distance = range / 2;
    Vector top = new Vector(loc.getX() + distance, loc.getY(), loc.getZ() + distance);
    Vector bottom = new Vector(loc.getX() - distance, loc.getY(), loc.getZ() - distance);
    for (int z = bottom.getBlockZ(); z <= top.getBlockZ(); z++) {
        for (int x = bottom.getBlockX(); x <= top.getBlockX(); x++) {
            if (board.getFactionAt(new net.redstoneore.legacyfactions.FLocation(new Location(loc.getWorld(), loc.getX() + x, loc.getY(), loc.getZ() + z))).isWilderness())
                return true;
        }
    }
    return false;
}
 
开发者ID:Qballl,项目名称:WildernessTp,代码行数:13,代码来源:ClaimChecks.java


示例18: isAdded

import com.massivecraft.factions.FLocation; //导入依赖的package包/类
public boolean isAdded(final RegionWrapper locs, final World world, final Player player, final boolean perm, MaskType type) {
    try {
        for (int x = locs.minX; x <= locs.maxX; x++) {
            for (int z = locs.minZ; z <= locs.maxZ; z++) {
                final Object fac = methodGetFactionAt.invoke(null, new FLocation(world.getName(), x, z));
                if (fac == null) {
                    return false;
                }
                if (type == MaskType.OWNER) {
                    Object leader = fac.getClass().getDeclaredMethod("getFPlayerLeader").invoke(fac);
                    return player.getName().equals(leader.getClass().getDeclaredMethod("getName").invoke(leader));
                }
                Method methodGetOnlinePlayers = fac.getClass().getDeclaredMethod("getOnlinePlayers");
                List<Player> players = (List<Player>) methodGetOnlinePlayers.invoke(fac);
                if (!players.contains(player)) {
                    return false;
                }
                Method isNone = fac.getClass().getDeclaredMethod("isNone");
                if ((boolean) isNone.invoke(fac)) {
                    return false;
                }
            }
        }
        return true;
    } catch (Throwable e) {
        MainUtil.handleError(e);
        return false;
    }
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:30,代码来源:FactionsOneFeature.java


示例19: isFactionOffline

import com.massivecraft.factions.FLocation; //导入依赖的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


示例20: isExplosionsEnabled

import com.massivecraft.factions.FLocation; //导入依赖的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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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