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


Java LongHash.lsw方法代码示例

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


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

示例1: getEntityCount

import org.bukkit.craftbukkit.util.LongHash; //导入方法依赖的package包/类
private int getEntityCount(WorldServer server, Class oClass)
{
    int i = 0;
    Iterator<Long> it = this.b.iterator();
    while ( it.hasNext() )
    {
        Long coord = it.next();
        int x = LongHash.msw( coord );
        int z = LongHash.lsw( coord );
        if ( !((ChunkProviderServer)server.chunkProvider).unloadQueue.contains( coord ) && server.isChunkLoaded( x, z, true ) )
        {
            i += server.getChunkAt( x, z ).entityCount.get( oClass );
        }
    }
    return i;
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:17,代码来源:SpawnerCreature.java

示例2: callStage2

import org.bukkit.craftbukkit.util.LongHash; //导入方法依赖的package包/类
public void callStage2(QueuedChunk queuedChunk, Chunk chunk) throws RuntimeException {
    if(chunk == null) {
        // If the chunk loading failed just do it synchronously (may generate)
        queuedChunk.provider.getChunkAt(LongHash.msw(queuedChunk.coords), LongHash.lsw(queuedChunk.coords));
        return;
    }

    int x = LongHash.msw(queuedChunk.coords);
    int z = LongHash.lsw(queuedChunk.coords);

    // See if someone already loaded this chunk while we were working on it (API, etc)
    if (queuedChunk.provider.chunks.containsKey(queuedChunk.coords)) {
        // Make sure it isn't queued for unload, we need it
        queuedChunk.provider.unloadQueue.remove(queuedChunk.coords);
        return;
    }

    queuedChunk.loader.loadEntities(chunk, queuedChunk.compound.getCompound("Level"), queuedChunk.world);
    chunk.n = queuedChunk.provider.world.getTime();
    queuedChunk.provider.chunks.put(queuedChunk.coords, chunk);
    chunk.addEntities();

    if (queuedChunk.provider.chunkProvider != null) {
        queuedChunk.provider.chunkProvider.recreateStructures(x, z);
    }

    Server server = queuedChunk.provider.world.getServer();
    if (server != null) {
        server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(chunk.bukkitChunk, false));
    }

    chunk.a(queuedChunk.provider, queuedChunk.provider, x, z);
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:34,代码来源:ChunkIOProvider.java

示例3: getEntityCount

import org.bukkit.craftbukkit.util.LongHash; //导入方法依赖的package包/类
private int getEntityCount(WorldServer server, Class oClass)
{
    int i = 0;
    for ( Long coord : this.a.keySet() )
    {
        int x = LongHash.msw( coord );
        int z = LongHash.lsw( coord );
        if ( !server.chunkProviderServer.unloadQueue.contains( coord ) && server.isChunkLoaded( x, z ) )
        {
            i += server.getChunkAt( x, z ).entityCount.get( oClass );
        }
    }
    return i;
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:15,代码来源:SpawnerCreature.java

示例4: callStage2

import org.bukkit.craftbukkit.util.LongHash; //导入方法依赖的package包/类
public void callStage2(QueuedChunk queuedChunk, net.minecraft.world.chunk.Chunk chunk) throws RuntimeException {
    if(chunk == null) {
        // If the chunk loading failed just do it synchronously (may generate)
        queuedChunk.provider.func_73158_c(LongHash.msw(queuedChunk.coords), LongHash.lsw(queuedChunk.coords));
        return;
    }

    int x = LongHash.msw(queuedChunk.coords);
    int z = LongHash.lsw(queuedChunk.coords);

    // See if someone already loaded this chunk while we were working on it (API, etc)
    if (queuedChunk.provider.field_73244_f.containsKey(queuedChunk.coords)) {
        // Make sure it isn't queued for unload, we need it
        queuedChunk.provider.field_73248_b.remove(queuedChunk.coords);
        return;
    }

    queuedChunk.loader.loadEntities(chunk, queuedChunk.compound.func_74775_l("Level"), queuedChunk.world);
    chunk.field_76641_n = queuedChunk.provider.field_73251_h.func_82737_E();
    queuedChunk.provider.field_73244_f.put(queuedChunk.coords, chunk);
    chunk.func_76631_c();

    if (queuedChunk.provider.field_73246_d != null) {
        queuedChunk.provider.field_73246_d.func_82695_e(x, z);
    }

    Server server = queuedChunk.provider.field_73251_h.getServer();
    if (server != null) {
        server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(chunk.bukkitChunk, false));
    }
    
    chunk.func_76624_a(queuedChunk.provider, queuedChunk.provider, x, z);
}
 
开发者ID:agaricusb,项目名称:MCPBukkit,代码行数:34,代码来源:ChunkIOProvider.java


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