本文整理汇总了Java中com.massivecraft.factions.entity.BoardColl类的典型用法代码示例。如果您正苦于以下问题:Java BoardColl类的具体用法?Java BoardColl怎么用?Java BoardColl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BoardColl类属于com.massivecraft.factions.entity包,在下文中一共展示了BoardColl类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: chunkChangeDetect
import com.massivecraft.factions.entity.BoardColl; //导入依赖的package包/类
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void chunkChangeDetect(PlayerMoveEvent event)
{
// If the player is moving from one chunk to another ...
if (MUtil.isSameChunk(event)) return;
Player player = event.getPlayer();
if (this.isntPlayer(player)) return;
// ... gather info on the player and the move ...
MPlayer mplayer = MPlayer.get(player);
PS chunkFrom = PS.valueOf(event.getFrom()).getChunk(true);
PS chunkTo = PS.valueOf(event.getTo()).getChunk(true);
Faction factionFrom = BoardColl.get().getFactionAt(chunkFrom);
Faction factionTo = BoardColl.get().getFactionAt(chunkTo);
if ( ! isChunkCoord(player)) return;
// ... and send info onwards.
EngineMain.get().chunkChangeTerritoryInfo(mplayer, player, chunkFrom, chunkTo, factionFrom, factionTo);
EngineMain.get().chunkChangeAutoClaim(mplayer, chunkTo);
}
开发者ID:markhughes,项目名称:MassiveCoreForgeFixes,代码行数:25,代码来源:FactionsEvents.java
示例2: process
import com.massivecraft.factions.entity.BoardColl; //导入依赖的package包/类
@Override
public void process(World from, World to) {
System.out.println("Preprocessing: Faction " + f.getName());
Set<PS> chunks = BoardColl.get().getChunks(f);
for (PS ps : chunks) {
if (ps.getWorld().equals(from.getName())) {
Chunk c = ps.asBukkitChunk();
int cx = c.getX() * 16;
int cz = c.getZ() * 16;
System.out.println("Preprocessing: FactionBlock x=" + cx + ",z=" + cz);
for (int x = cx; x < cx + 16; x++) {
for (int z = cz; z < cz + 16; z++) {
for (int y = 0; y < 256; y++) {
WorldRestore.addToProcessQueues(from.getBlockAt(x, y, z));
}
}
}
}
}
}
开发者ID:StarQuestMinecraft,项目名称:StarQuestCode,代码行数:21,代码来源:FactionsPreprocessTask.java
示例3: doSetAt
import com.massivecraft.factions.entity.BoardColl; //导入依赖的package包/类
private void doSetAt(Set<PS> chunks, MPlayer player, com.massivecraft.factions.entity.Faction newFaction) {
String formatOne = "<h>%s<i> %s <h>%d <i>chunk %s<i>.";
String formatMany = "<h>%s<i> %s <h>%d <i>chunks near %s<i>.";
HashMap<com.massivecraft.factions.entity.Faction, Set<PS>> oldFactionChunks = new HashMap<com.massivecraft.factions.entity.Faction, Set<PS>>();
for (PS chunk : chunks) {
com.massivecraft.factions.entity.Faction factionHere = BoardColl.get().getFactionAt(chunk);
Set<PS> claims = new HashSet<PS>();
if (oldFactionChunks.containsKey(factionHere)) {
claims = oldFactionChunks.get(factionHere);
claims.add(chunk);
}
oldFactionChunks.put(factionHere, claims);
BoardColl.get().setFactionAt(chunk, newFaction);
}
// Inform
for (Entry<com.massivecraft.factions.entity.Faction, Set<PS>> entry : oldFactionChunks.entrySet()) {
final com.massivecraft.factions.entity.Faction oldFaction = entry.getKey();
final Set<PS> oldChunks = entry.getValue();
final PS oldChunk = oldChunks.iterator().next();
final Set<MPlayer> informees = MPlayer.getClaimInformees(player, oldFaction, newFaction);
final EventFactionsChunkChangeType type = EventFactionsChunkChangeType.get(oldFaction, newFaction, player.getFaction());
String chunkString = oldChunk.toString(PSFormatHumanSpace.get());
String typeString = type.past;
for (MPlayer informee : informees) {
informee.msg((oldChunks.size() == 1 ? formatOne : formatMany), player.describeTo(informee, true), typeString, oldChunks.size(), chunkString);
informee.msg(" <h>%s<i> --> <h>%s", oldFaction.describeTo(informee, true), newFaction.describeTo(informee, true));
}
}
}
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:37,代码来源:Events_2_7.java
示例4: getAt
import com.massivecraft.factions.entity.BoardColl; //导入依赖的package包/类
@Override
public Faction getAt(Chunk chunk) {
com.massivecraft.factions.entity.Faction mfaction = BoardColl.get().getFactionAt(PS.valueOf(chunk));
if (mfaction == null) return null;
return get(mfaction.getId());
}
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:9,代码来源:Factions_2_8_6.java
示例5: getAllFactions
import com.massivecraft.factions.entity.BoardColl; //导入依赖的package包/类
@Override
public Set<Faction> getAllFactions() {
Set<Faction> factions = new TreeSet<Faction>();
for (com.massivecraft.factions.entity.Faction faction : BoardColl.get().getFactionToChunks().keySet()) {
factions.add(Factions.getById(faction.getId()));
}
return factions;
}
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:11,代码来源:Factions_2_8_6.java
示例6: factionLandNearby
import com.massivecraft.factions.entity.BoardColl; //导入依赖的package包/类
/**
* Is there faction land within the radius from location
* @param l
* @return False if none, True if land found.
*/
public boolean factionLandNearby(Location l) {
if (Bukkit.getServer().getPluginManager().getPlugin("Factions") == null) {
return false;
}
if(!RandomCoords.getPlugin().getConfig().getString("Factions").equalsIgnoreCase("true")) {
return false;
}
int radius = RandomCoords.getPlugin().getConfig().getInt("CheckingRadius");
int chunkRadius = radius < 16 ? 1 : (radius - (radius % 16)) / 16;
int x;
int y;
int z;
for (int chX = 0 - chunkRadius; chX <= chunkRadius; chX++) {
for (int chZ = 0 - chunkRadius; chZ <= chunkRadius; chZ++) {
x = l.getBlockX();
y = l.getBlockY();
z = l.getBlockZ();
Block b = l.getWorld().getBlockAt(x + (chX * 16), y, z + (chZ * 16));
if (!(BoardColl.get().getFactionAt(PS.valueOf(b)).isNone())) {
return true;
}
}
}
return false;
}
开发者ID:jolbol1,项目名称:RandomCoordinatesV2,代码行数:37,代码来源:FactionChecker.java
示例7: getClaims
import com.massivecraft.factions.entity.BoardColl; //导入依赖的package包/类
@Override
public List<ChunkPos> getClaims() {
List<ChunkPos> target = new LinkedList<>();
for (Set<PS> ps : BoardColl.get().getFactionToChunks().values()) {
target.addAll(psToChunkPos(ps));
}
return target;
}
开发者ID:novucs,项目名称:factions-top,代码行数:9,代码来源:Factions0207.java
示例8: checkSurroundingFactions
import com.massivecraft.factions.entity.BoardColl; //导入依赖的package包/类
private boolean checkSurroundingFactions(Location loc) {
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 (BoardColl.get().getFactionAt(PS.valueOf(new Location(loc.getWorld(), loc.getX() + x, loc.getY(), loc.getZ() + z))).isNone())
return true;
}
}
return false;
}
开发者ID:Qballl,项目名称:WildernessTp,代码行数:13,代码来源:ClaimChecks.java
示例9: isProtected
import com.massivecraft.factions.entity.BoardColl; //导入依赖的package包/类
private boolean isProtected(Player player, Block b) {
Faction faction = BoardColl.get().getFactionAt(PS.valueOf(b));
MPlayer mp = MPlayer.get(player);
if (faction != null && !faction.getId().equals("none")) {
if (!faction.getId().equals(mp.getFactionId())) return true;
}
return false;
}
开发者ID:TheBusyBiscuit,项目名称:CS-CoreLib,代码行数:9,代码来源:FactionsProtectionModule.java
示例10: getNearbyChunks
import com.massivecraft.factions.entity.BoardColl; //导入依赖的package包/类
/**
* Gets the chunk-faction map for the chunks nearby the given player.
*
* A range of 0 returns 1 chunk, while a range of 1 returns a 3x3.
*/
private Map<PS, Faction> getNearbyChunks(Player player, int range) {
PS center = PS.valueOf(player.getLocation());
Set<PS> nearby = BoardColl.getNearbyChunks(center, range);
//TODO: Verify that this is the right world.
return BoardColl.getChunkFaction(nearby);
}
开发者ID:Pokechu22,项目名称:WDLCompanion-Factions,代码行数:13,代码来源:NearbyFactionsRangeProducer.java
示例11: isInClaimedLand
import com.massivecraft.factions.entity.BoardColl; //导入依赖的package包/类
public static boolean isInClaimedLand(Location l) {
Faction f = BoardColl.get().getFactionAt(PS.valueOf(l));
if (f == null)
return false;
String id = f.getId();
if (id.equals(Factions.ID_NONE) || id.equals(Factions.ID_SAFEZONE) || id.equals(Factions.ID_WARZONE)) {
return false;
}
return true;
}
开发者ID:StarQuestMinecraft,项目名称:StarQuestCode,代码行数:11,代码来源:FactionUtils.java
示例12: isFactionOffline
import com.massivecraft.factions.entity.BoardColl; //导入依赖的package包/类
@Override
public boolean isFactionOffline(Location loc) {
Faction faction = BoardColl.get().getFactionAt(PS.valueOf(loc));
if ((faction.isNone()) ||
ChatColor.stripColor(faction.getName()).equalsIgnoreCase("safezone") ||
ChatColor.stripColor(faction.getName()).equalsIgnoreCase("warzone")) {
//ObsidianDestroyer.debug("Factions25x.isFactionOffline: false");
return false;
}
//ObsidianDestroyer.debug("Factions25x.isFactionOffline: " + faction.isFactionConsideredOffline());
return faction.isFactionConsideredOffline() && faction.getFlag(MFlag.ID_OFFLINEEXPLOSIONS);
}
开发者ID:drtshock,项目名称:ObsidianDestroyer,代码行数:13,代码来源:Factions28x.java
示例13: FactionCheck
import com.massivecraft.factions.entity.BoardColl; //导入依赖的package包/类
/**
* Used to check wether or not the location is in faction land, or within the buffer.
* @param l The location that we are checking.
* @return True or False, is it in faction land?
*/
public boolean FactionCheck(final Location l) {
int checks = 1;
if (!(Bukkit.getServer().getPluginManager().getPlugin("Factions") == null)) {
if (RandomCoords.getPlugin().config.getString("Factions").equals("true")) {
final int X = l.getBlockX();
final int Y = l.getBlockY();
final int Z = l.getBlockZ();
final int r = RandomCoords.getPlugin().config.getInt("CheckingRadius");
int x = X - r;
int y = Y - r;
int z = Z - r;
final int bx = x;
final int bz = z;
for (int i = 0; i < r * 2 + 1; i++) {
for (int j = 0; j < r * 2 + 1; j++) {
for (int k = 0; k < r * 2 + 1; k++) {
//Code here
final Block b = l.getWorld().getBlockAt(x, y, z);
if (!(BoardColl.get().getFactionAt(PS.valueOf(b)).isNone())) {
return false;
}
x++;
checks++;
}
z++;
x = bx;
}
z = bz;
x = bx;
y++;
}
}
return true;
} else {
return true;
}
}
开发者ID:jolbol1,项目名称:RandomCoordinatesV2,代码行数:52,代码来源:FactionChecker.java
示例14: getFactionAt
import com.massivecraft.factions.entity.BoardColl; //导入依赖的package包/类
@Override
public String getFactionAt(String worldName, int chunkX, int chunkZ) {
Faction faction = BoardColl.get().getFactionAt(PS.valueOf(worldName, chunkX, chunkZ));
return faction == null ? Factions.ID_NONE : faction.getId();
}
开发者ID:novucs,项目名称:factions-top,代码行数:6,代码来源:Factions0207.java
示例15: FactionsFeature
import com.massivecraft.factions.entity.BoardColl; //导入依赖的package包/类
public FactionsFeature(final Plugin factionsPlugin, final FaweBukkit p3) {
super(factionsPlugin.getName());
this.factions = factionsPlugin;
this.plugin = p3;
BoardColl.get();
}
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:7,代码来源:FactionsFeature.java
示例16: isExplosionsEnabled
import com.massivecraft.factions.entity.BoardColl; //导入依赖的package包/类
@Override
public boolean isExplosionsEnabled(Location loc) {
Faction faction = BoardColl.get().getFactionAt(PS.valueOf(loc));
//ObsidianDestroyer.debug("Factions25x.isExplosionsEnabled: " + faction.getFlag(FFlag.EXPLOSIONS));
return faction == null || faction.getFlag(MFlag.ID_EXPLOSIONS);
}
开发者ID:drtshock,项目名称:ObsidianDestroyer,代码行数:7,代码来源:Factions28x.java
示例17: isFactionAtPower
import com.massivecraft.factions.entity.BoardColl; //导入依赖的package包/类
@Override
public boolean isFactionAtPower(Location loc) {
Faction faction = BoardColl.get().getFactionAt(PS.valueOf(loc));
return faction.getPower() >= faction.getLandCount();
}
开发者ID:drtshock,项目名称:ObsidianDestroyer,代码行数:6,代码来源:Factions28x.java
示例18: factionsClaim
import com.massivecraft.factions.entity.BoardColl; //导入依赖的package包/类
public boolean factionsClaim(Location loc) {
if (wild.getConfig().getBoolean("Factions")) {
Faction faction = BoardColl.get().getFactionAt(PS.valueOf(loc));
if (!faction.isNone() && !checkSurroundingFactions(loc))
return true;
else
return false;
} else
return false;
}
开发者ID:Qballl,项目名称:WildernessTp,代码行数:16,代码来源:ClaimChecks.java
注:本文中的com.massivecraft.factions.entity.BoardColl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论