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