本文整理汇总了Java中com.massivecraft.factions.Board类的典型用法代码示例。如果您正苦于以下问题:Java Board类的具体用法?Java Board怎么用?Java Board使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Board类属于com.massivecraft.factions包,在下文中一共展示了Board类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: mimicUnclaim
import com.massivecraft.factions.Board; //导入依赖的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.Board; //导入依赖的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: doesFactionsApply
import com.massivecraft.factions.Board; //导入依赖的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
示例4: isWarZone
import com.massivecraft.factions.Board; //导入依赖的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
示例5: isSafeZone
import com.massivecraft.factions.Board; //导入依赖的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
示例6: isWarZone
import com.massivecraft.factions.Board; //导入依赖的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
示例7: isSafeZone
import com.massivecraft.factions.Board; //导入依赖的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
示例8: getAt
import com.massivecraft.factions.Board; //导入依赖的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
示例9: getAt
import com.massivecraft.factions.Board; //导入依赖的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
示例10: initialize
import com.massivecraft.factions.Board; //导入依赖的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
示例11: onClaim
import com.massivecraft.factions.Board; //导入依赖的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
示例12: factionsUUIDClaim
import com.massivecraft.factions.Board; //导入依赖的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
示例13: checkSurroundingFactionsUUID
import com.massivecraft.factions.Board; //导入依赖的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
示例14: legacyFactionsClaim
import com.massivecraft.factions.Board; //导入依赖的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
示例15: checkSurroundingLegacyFactions
import com.massivecraft.factions.Board; //导入依赖的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
示例16: isFactionOffline
import com.massivecraft.factions.Board; //导入依赖的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
示例17: isExplosionsEnabled
import com.massivecraft.factions.Board; //导入依赖的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
示例18: mimicClaim
import com.massivecraft.factions.Board; //导入依赖的package包/类
private Boolean mimicClaim(com.massivecraft.factions.FPlayer fplayer, com.massivecraft.factions.Faction faction, FLocation flocation) {
boolean mustPay = Econ.shouldBeUsed() && ! fplayer.isAdminBypassing() && ! faction.isSafeZone() && ! faction.isWarZone();
double cost = 0.0;
EconomyParticipator payee = null;
if (mustPay) {
cost = Econ.calculateClaimCost(faction.getLandRounded(), faction.isNormal());
if (Conf.econClaimUnconnectedFee != 0.0 && faction.getLandRoundedInWorld(flocation.getWorldName()) > 0 && !Board.getInstance().isConnectedLocation(flocation, faction)) {
cost += Conf.econClaimUnconnectedFee;
}
if (Conf.bankEnabled && Conf.bankFactionPaysLandCosts && fplayer.hasFaction()) {
payee = faction;
} else {
payee = fplayer;
}
if ( ! Econ.hasAtLeast(payee, cost, "to claim this land")) return false;
}
// then make 'em pay (if applicable)
if (mustPay && ! Econ.modifyMoney(payee, -cost, "to claim this land", "for claiming this land")) return false;
// announce success
Set<com.massivecraft.factions.FPlayer> informTheseFPlayers = new HashSet<com.massivecraft.factions.FPlayer>();
informTheseFPlayers.add(fplayer);
informTheseFPlayers.addAll(faction.getFPlayersWhereOnline(true));
for (com.massivecraft.factions.FPlayer fp : informTheseFPlayers) {
fp.msg("<h>%s<i> claimed land for <h>%s<i> from <h>%s<i>.", faction.describeTo(fp, true), faction.describeTo(fp), faction.describeTo(fp));
}
Board.getInstance().setFactionAt(faction, flocation);
// Log if factions wants us to
if (Conf.logLandClaims) {
com.massivecraft.factions.P.p.log(fplayer.getName()+" claimed land at ("+flocation.getCoordString()+") for the faction: "+faction.getTag());
}
return true;
}
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:44,代码来源:Events_1_6.java
示例19: getFactionAt
import com.massivecraft.factions.Board; //导入依赖的package包/类
@Override
public Faction getFactionAt() {
return Factions.getById(Board.getInstance().getFactionAt(this.factionsfplayer.getLastStoodAt()).getId());
}
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:5,代码来源:FPlayer_1_6.java
示例20: mimicClaim
import com.massivecraft.factions.Board; //导入依赖的package包/类
private Boolean mimicClaim(com.massivecraft.factions.FPlayer fplayer, com.massivecraft.factions.Faction faction, FLocation flocation) {
boolean mustPay = Econ.shouldBeUsed() && ! fplayer.hasAdminMode() && faction.getId() != Factions.getSafeZone(flocation.getWorld()).getId() && faction.getId() != Factions.getWarZone(flocation.getWorld()).getId();
double cost = 0.0;
EconomyParticipator payee = null;
if (mustPay) {
cost = Econ.calculateClaimCost(faction.getLandRounded(), faction.isNormal());
if (Conf.econClaimUnconnectedFee != 0.0 && faction.getLandRoundedInWorld(flocation.getWorldName()) > 0 && !Board.isConnectedLocation(flocation, faction)) {
cost += Conf.econClaimUnconnectedFee;
}
if (Conf.bankEnabled && Conf.bankFactionPaysLandCosts && fplayer.hasFaction()) {
payee = faction;
} else {
payee = fplayer;
}
if ( ! Econ.hasAtLeast(payee, cost, "to claim this land")) return false;
}
// then make 'em pay (if applicable)
if (mustPay && ! Econ.modifyMoney(payee, -cost, "to claim this land", "for claiming this land")) return false;
// announce success
Set<com.massivecraft.factions.FPlayer> informTheseFPlayers = new HashSet<com.massivecraft.factions.FPlayer>();
informTheseFPlayers.add(fplayer);
informTheseFPlayers.addAll(faction.getFPlayersWhereOnline(true));
for (com.massivecraft.factions.FPlayer fp : informTheseFPlayers) {
fp.msg("<h>%s<i> claimed land for <h>%s<i> from <h>%s<i>.", faction.describeTo(fp, true), faction.describeTo(fp), faction.describeTo(fp));
}
Board.setFactionAt(faction, flocation);
// Log if factions wants us to
if (Conf.logLandClaims) {
com.massivecraft.factions.P.p.log(fplayer.getName()+" claimed land at ("+flocation.getCoordString()+") for the faction: "+faction.getTag());
}
return true;
}
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:44,代码来源:Events_1_8.java
注:本文中的com.massivecraft.factions.Board类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论