当前位置: 首页>>代码示例>>Java>>正文


Java Chunk.getZ方法代码示例

本文整理汇总了Java中org.bukkit.Chunk.getZ方法的典型用法代码示例。如果您正苦于以下问题:Java Chunk.getZ方法的具体用法?Java Chunk.getZ怎么用?Java Chunk.getZ使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bukkit.Chunk的用法示例。


在下文中一共展示了Chunk.getZ方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onChunkChange

import org.bukkit.Chunk; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@EventHandler
    public void onChunkChange(PlayerMoveEvent event) {
        Location to = event.getTo();
        Location from = event.getFrom();
        if (to.getBlockX() == from.getBlockX() && to.getBlockZ() == from.getBlockZ()) {
            return;
        }
        Chunk toChunk = to.getChunk();
        Chunk fromChunk = from.getChunk();
        if (toChunk.getX() == fromChunk.getX() && toChunk.getZ() == fromChunk.getZ()) {
            return;
        }
        
		PlayerModule.getInstance().getPlayer(event.getPlayer()).handleViewDistance(); 
		}
 
开发者ID:ThEWiZ76,项目名称:KingdomFactions,代码行数:17,代码来源:ChunkChangeEvent.java

示例2: populate

import org.bukkit.Chunk; //导入方法依赖的package包/类
@Override
public void populate(World world, Random random, Chunk chunk)
{
    for (int x = chunk.getX(); x < chunk.getX() + 16; x++)
    {
        for (int z = chunk.getZ(); z < chunk.getZ() + 16; z++)
        {
            for (int y = 0; y < 250; y++)
            {
                Block block = chunk.getBlock(x, y, z);

                if (this.toRemove.contains(block.getType()))
                    block.setType(Material.STONE);
            }
        }
    }
}
 
开发者ID:SamaGames,项目名称:SurvivalAPI,代码行数:18,代码来源:OreRemoverPopulator.java

示例3: populate

import org.bukkit.Chunk; //导入方法依赖的package包/类
@Override
public void populate(World world, Random random, Chunk chunk)
{
    if (chunk == null)
        return;

    CraftWorld handle = (CraftWorld) world;
    int xr = this.randInt(random, -200, 200);

    if (xr >= 50)
        new WorldGenCaves().a(handle.getHandle().chunkProviderServer, handle.getHandle(), chunk.getX(), chunk.getZ(), new ChunkSnapshot());
    else if (xr <= -50)
        new WorldGenCanyon().a(handle.getHandle().chunkProviderServer, handle.getHandle(), chunk.getX(), chunk.getZ(), new ChunkSnapshot());

    for (Rule bloc : this.rules)
    {
        for (int i = 0; i < bloc.round; i++)
        {
            int x = chunk.getX() * 16 + random.nextInt(16);
            int y = bloc.minY + random.nextInt(bloc.maxY - bloc.minY);
            int z = chunk.getZ() * 16 + random.nextInt(16);
            this.generate(world, random, x, y, z, bloc.size, bloc);
        }
    }

}
 
开发者ID:SamaGames,项目名称:SurvivalAPI,代码行数:27,代码来源:OrePopulator.java

示例4: populate

import org.bukkit.Chunk; //导入方法依赖的package包/类
@Override
public void populate(World world, Random random, Chunk chunk)
{
    if (this.bukkitWorld == null)
    {
        this.bukkitWorld = new BukkitWorld(world);
        this.es = WorldEdit.getInstance().getEditSessionFactory().getEditSession(this.bukkitWorld, -1);
        this.es.setFastMode(false);
    }

    if (MathHelper.nextInt(random, 0, 100) == 0)
    {
        int xFortress = chunk.getX() * 16 + random.nextInt(15);
        int zFortress = chunk.getZ() * 16 + random.nextInt(15);

        this.generateBlazeFortress(world, xFortress, zFortress);
    }
}
 
开发者ID:SamaGames,项目名称:SurvivalAPI,代码行数:19,代码来源:FortressPopulator.java

示例5: onChunkLoad

import org.bukkit.Chunk; //导入方法依赖的package包/类
@EventHandler
public void onChunkLoad(ChunkLoadEvent e) {
	if (!e.isNewChunk())
		return;

	Chunk chunk = e.getChunk();
	int x = chunk.getX() * 16;
	int z = chunk.getZ() * 16;
	int y = chunk.getWorld().getHighestBlockYAt(x + 8, z + 2);

	Location loc = new Location(e.getWorld(), x + 8, y, z + 2);
	Random r = new Random();

	// 0.2% chance of spawning shelter on generating new chunks
	if (r.nextInt(1000) < 2) {
		FalloutShelter s = new FalloutShelter(loc.clone());
		s.generateFalloutShelter();
	}
}
 
开发者ID:kadeska,项目名称:MT_Core,代码行数:20,代码来源:WorldListener.java

示例6: unloadChunk

import org.bukkit.Chunk; //导入方法依赖的package包/类
public static void unloadChunk(Chunk chunk) {
	long chunk_id = ((long) chunk.getX() << 32L) + (long) chunk.getZ();
	UUID world_uuid = chunk.getWorld().getUID();
	//CropControl.getPlugin().debug("Registering unload for chunk {0}:{1}", world_uuid, chunk_id);
	Map<Long, WorldChunk> chunks = chunkCacheLoc.get(world_uuid);
	if (chunks == null) {
		return;
	}
	WorldChunk cacheChunk = chunks.get(chunk_id);
	if (cacheChunk != null) {
		unloadQueue.offer(cacheChunk);
	}
	// note we do not actually remove it here.
}
 
开发者ID:DevotedMC,项目名称:CropControl,代码行数:15,代码来源:WorldChunk.java

示例7: isSameChunk

import org.bukkit.Chunk; //导入方法依赖的package包/类
public static boolean isSameChunk(Chunk chunk1, Chunk chunk2) {
	String c1w = chunk1.getWorld().getName();
	String c2w = chunk2.getWorld().getName();
	int c1x = chunk1.getX();
	int c2x = chunk2.getX();
	int c1z = chunk1.getZ();
	int c2z = chunk2.getZ();
	if (c1w.equals(c2w) && c1x == c2x && c1z == c2z) {
		return true;
	} else {
		return false;
	}
}
 
开发者ID:GelandiAssociation,项目名称:EscapeLag,代码行数:14,代码来源:Utils.java

示例8: getByChunk

import org.bukkit.Chunk; //导入方法依赖的package包/类
/**
 * @param chunk
 * the chunk to check
 * @return
 * the faction that owns this chunk
 */
public Faction getByChunk(Chunk chunk) {
    for (Faction faction : factions) {
        for (LazyChunk fChunk : faction.getChunks()) {
            if (chunk.getX() == fChunk.getX() && chunk.getZ() == fChunk.getX()) {
                return faction;
            }
        }
    }
    return null;
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:17,代码来源:FactionCache.java

示例9: getByChunk

import org.bukkit.Chunk; //导入方法依赖的package包/类
/**
 * @param chunk
 * the chunk to check
 * @return
 * the region that contains the chunk
 */
public Region getByChunk(Chunk chunk) {
    for (Region region : regions) {
        if (region.getWorld().equals(chunk.getWorld())) {
            for (LazyChunk rChunk : region.getChunks()) {
                if (rChunk.getX() == chunk.getX() && rChunk.getZ() == chunk.getZ()) {
                    return region;
                }
            }
        }
    }
    return null;
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:19,代码来源:Board.java

示例10: removeChunk

import org.bukkit.Chunk; //导入方法依赖的package包/类
private void removeChunk(Region region, Chunk chunk) {
    LazyChunk remove = null;
    for (LazyChunk rChunk : region.getChunks()) {
        if (chunk.getX() == rChunk.getX() && chunk.getZ() == rChunk.getZ()) {
            remove = rChunk;
        }
    }
    region.getChunks().remove(remove);
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:10,代码来源:WorldCommand.java

示例11: isSlimeChunk

import org.bukkit.Chunk; //导入方法依赖的package包/类
/**
 * Is the supplied chunk a slime chunk? Since there is no bukkit API for this, we have to use the formula ourselves.
 * @param chunk
 * @return Is the specified chunk a slime chunk?
 */
private static boolean isSlimeChunk(Chunk chunk) {
    int x = chunk.getX();
    int z = chunk.getZ();
    return new Random(chunk.getWorld().getSeed() +
            x * x * 4987142 +
            x * 5947611 +
            z * z * 4392871L +
            z * 389711 ^ 0x3AD8025F).nextInt(10) == 0;
}
 
开发者ID:Kneesnap,项目名称:Kineticraft,代码行数:15,代码来源:SlimeFinder.java

示例12: ChunkPos

import org.bukkit.Chunk; //导入方法依赖的package包/类
public ChunkPos(Chunk chunk) {
	this(chunk.getWorld().getName(), chunk.getX(), chunk.getZ());
}
 
开发者ID:cjburkey01,项目名称:ClaimChunk,代码行数:4,代码来源:ChunkPos.java

示例13: ChunkWrapper

import org.bukkit.Chunk; //导入方法依赖的package包/类
public ChunkWrapper(Chunk c) {
    this.x = c.getX();
    this.z = c.getZ();
    this.world = c.getWorld().getName();
}
 
开发者ID:edasaki,项目名称:ZentrelaCore,代码行数:6,代码来源:ChunkWrapper.java

示例14: of

import org.bukkit.Chunk; //导入方法依赖的package包/类
public static ChunkPosition of(Chunk chunk) {
    return new ChunkPosition(chunk.getX(), chunk.getZ());
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:4,代码来源:ChunkPosition.java

示例15: of

import org.bukkit.Chunk; //导入方法依赖的package包/类
public static ChunkVector of(Chunk chunk) {
    return new ChunkVector(chunk.getX(), chunk.getZ());
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:4,代码来源:ChunkVector.java


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