本文整理汇总了Java中com.massivecraft.factions.FLocation类的典型用法代码示例。如果您正苦于以下问题:Java FLocation类的具体用法?Java FLocation怎么用?Java FLocation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FLocation类属于com.massivecraft.factions包,在下文中一共展示了FLocation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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);
}
示例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;
}
}
示例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);
}
示例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();
}
示例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;
}
示例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;
}