本文整理汇总了Java中net.minecraft.world.chunk.Chunk.getWorld方法的典型用法代码示例。如果您正苦于以下问题:Java Chunk.getWorld方法的具体用法?Java Chunk.getWorld怎么用?Java Chunk.getWorld使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.chunk.Chunk
的用法示例。
在下文中一共展示了Chunk.getWorld方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: syncWithPlayers
import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
private void syncWithPlayers(World world) {
List<EntityPlayer> players = world.playerEntities;
for (Map.Entry<Chunk, Set<EntityPlayer>> entry : syncList.entrySet()) {
Chunk chunk = entry.getKey();
Set<EntityPlayer> syncedPlayers = entry.getValue();
int chunkX = chunk.x * 16 - 8;
int chunkZ = chunk.z * 16 - 8;
for (EntityPlayer player : players) {
if (chunk.getWorld() == world) {
double dist = PneumaticCraftUtils.distBetween(player.posX, 0, player.posZ, chunkX, 0, chunkZ);
if (dist < SYNC_DISTANCE) {
if (syncedPlayers.add(player)) {
for(List<ISemiBlock> semiBlocks : semiBlocks.get(chunk).values()){
for (ISemiBlock semiBlock : semiBlocks) {
if (!semiBlock.isInvalid()) {
NetworkHandler.sendTo(new PacketAddSemiBlock(semiBlock), (EntityPlayerMP) player);
PacketDescription descPacket = semiBlock.getDescriptionPacket();
if (descPacket != null) NetworkHandler.sendTo(descPacket, (EntityPlayerMP) player);
}
}
}
}
} else if (dist > SYNC_DISTANCE + 5) {
syncedPlayers.remove(player);
}
} else {
syncedPlayers.remove(player);
}
}
}
}
示例2: Tile
import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
public Tile(Chunk chunk)
{
this.tilePosition = new TilePos(chunk.getPos());
this.world = chunk.getWorld();
this.chunks = this.createChunkArray();
this.biome = generateTileBiome();
this.generateTileBiome();
TileList.get(world).addTile(this);
}
示例3: ChunkEvent
import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
public ChunkEvent(Chunk chunk)
{
super(chunk.getWorld());
this.chunk = chunk;
}