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


Java LongHash类代码示例

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


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

示例1: loadChunk

import org.bukkit.craftbukkit.util.LongHash; //导入依赖的package包/类
public boolean loadChunk(int x, int z, boolean generate) {
    chunkLoadCount++;
    if (generate) {
        // Use the default variant of loadChunk when generate == true.
        return world.theChunkProviderServer.loadChunk(x, z) != null;
    }

    world.theChunkProviderServer.chunksToUnload.remove(x, z);
    net.minecraft.world.chunk.Chunk chunk = world.theChunkProviderServer.loadedChunkHashMap.get(LongHash.toLong(x, z));

    if (chunk == null) {
        world.timings.syncChunkLoadTimer.startTiming(); // Spigot
        chunk = world.theChunkProviderServer.safeLoadChunk(x, z);

        chunkLoadPostProcess(chunk, x, z);
        world.timings.syncChunkLoadTimer.stopTiming(); // Spigot
    }
    return chunk != null;
}
 
开发者ID:CyberdyneCC,项目名称:ThermosRebased,代码行数:20,代码来源:CraftWorld.java

示例2: chunkLoadPostProcess

import org.bukkit.craftbukkit.util.LongHash; //导入依赖的package包/类
private void chunkLoadPostProcess(net.minecraft.world.chunk.Chunk chunk, int x, int z) {
    if (chunk != null) {
        world.theChunkProviderServer.loadedChunkHashMap.put(LongHash.toLong(x, z), chunk);
        world.theChunkProviderServer.loadedChunks.add(chunk); // Cauldron - vanilla compatibility

        chunk.onChunkLoad();

        if (!chunk.isTerrainPopulated && world.theChunkProviderServer.chunkExists(x + 1, z + 1) && world.theChunkProviderServer.chunkExists(x, z + 1) && world.theChunkProviderServer.chunkExists(x + 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x, z);
        }

        if (world.theChunkProviderServer.chunkExists(x - 1, z) && !world.theChunkProviderServer.provideChunk(x - 1, z).isTerrainPopulated && world.theChunkProviderServer.chunkExists(x - 1, z + 1) && world.theChunkProviderServer.chunkExists(x, z + 1) && world.theChunkProviderServer.chunkExists(x - 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x - 1, z);
        }

        if (world.theChunkProviderServer.chunkExists(x, z - 1) && !world.theChunkProviderServer.provideChunk(x, z - 1).isTerrainPopulated && world.theChunkProviderServer.chunkExists(x + 1, z - 1) && world.theChunkProviderServer.chunkExists(x, z - 1) && world.theChunkProviderServer.chunkExists(x + 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x, z - 1);
        }

        if (world.theChunkProviderServer.chunkExists(x - 1, z - 1) && !world.theChunkProviderServer.provideChunk(x - 1, z - 1).isTerrainPopulated && world.theChunkProviderServer.chunkExists(x - 1, z - 1) && world.theChunkProviderServer.chunkExists(x, z - 1) && world.theChunkProviderServer.chunkExists(x - 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x - 1, z - 1);
        }
    }
}
 
开发者ID:CyberdyneCC,项目名称:ThermosRebased,代码行数:25,代码来源:CraftWorld.java

示例3: chunkLoadPostProcess

import org.bukkit.craftbukkit.util.LongHash; //导入依赖的package包/类
private void chunkLoadPostProcess(net.minecraft.world.chunk.Chunk chunk, int x, int z) {
    if (chunk != null) {
        world.theChunkProviderServer.loadedChunkHashMap_KC.add(LongHash.toLong(x, z), chunk); // Passes to chunkt_TH
        world.theChunkProviderServer.loadedChunks.add(chunk); // Cauldron - vanilla compatibility
        chunk.onChunkLoad();

        if (!chunk.isTerrainPopulated && world.theChunkProviderServer.chunkExists(x + 1, z + 1) && world.theChunkProviderServer.chunkExists(x, z + 1) && world.theChunkProviderServer.chunkExists(x + 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x, z);
        }

        if (world.theChunkProviderServer.chunkExists(x - 1, z) && !world.theChunkProviderServer.provideChunk(x - 1, z).isTerrainPopulated && world.theChunkProviderServer.chunkExists(x - 1, z + 1) && world.theChunkProviderServer.chunkExists(x, z + 1) && world.theChunkProviderServer.chunkExists(x - 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x - 1, z);
        }

        if (world.theChunkProviderServer.chunkExists(x, z - 1) && !world.theChunkProviderServer.provideChunk(x, z - 1).isTerrainPopulated && world.theChunkProviderServer.chunkExists(x + 1, z - 1) && world.theChunkProviderServer.chunkExists(x, z - 1) && world.theChunkProviderServer.chunkExists(x + 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x, z - 1);
        }

        if (world.theChunkProviderServer.chunkExists(x - 1, z - 1) && !world.theChunkProviderServer.provideChunk(x - 1, z - 1).isTerrainPopulated && world.theChunkProviderServer.chunkExists(x - 1, z - 1) && world.theChunkProviderServer.chunkExists(x, z - 1) && world.theChunkProviderServer.chunkExists(x - 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x - 1, z - 1);
        }
    }
}
 
开发者ID:CyberdyneCC,项目名称:Thermos,代码行数:24,代码来源:CraftWorld.java

示例4: loadChunk

import org.bukkit.craftbukkit.util.LongHash; //导入依赖的package包/类
public boolean loadChunk(int x, int z, boolean generate) {
    chunkLoadCount++;
    if (generate) {
        // Use the default variant of loadChunk when generate == true.
        return world.theChunkProviderServer.loadChunk(x, z) != null;
    }

    world.theChunkProviderServer.chunksToUnload.remove(x, z);
    net.minecraft.world.chunk.Chunk chunk = world.theChunkProviderServer.loadedChunkHashMap_KC.get(LongHash.toLong(x, z));

    if (chunk == null) {
        world.timings.syncChunkLoadTimer.startTiming(); // Spigot
        chunk = world.theChunkProviderServer.safeLoadChunk(x, z);

        chunkLoadPostProcess(chunk, x, z);
        world.timings.syncChunkLoadTimer.stopTiming(); // Spigot
    }
    return chunk != null;
}
 
开发者ID:djoveryde,项目名称:KCauldron,代码行数:20,代码来源:CraftWorld.java

示例5: chunkLoadPostProcess

import org.bukkit.craftbukkit.util.LongHash; //导入依赖的package包/类
private void chunkLoadPostProcess(net.minecraft.world.chunk.Chunk chunk, int x, int z) {
    if (chunk != null) {
        world.theChunkProviderServer.loadedChunkHashMap_KC.put(LongHash.toLong(x, z), chunk);
        world.theChunkProviderServer.loadedChunks.add(chunk); // Cauldron - vanilla compatibility

        chunk.onChunkLoad();

        if (!chunk.isTerrainPopulated && world.theChunkProviderServer.chunkExists(x + 1, z + 1) && world.theChunkProviderServer.chunkExists(x, z + 1) && world.theChunkProviderServer.chunkExists(x + 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x, z);
        }

        if (world.theChunkProviderServer.chunkExists(x - 1, z) && !world.theChunkProviderServer.provideChunk(x - 1, z).isTerrainPopulated && world.theChunkProviderServer.chunkExists(x - 1, z + 1) && world.theChunkProviderServer.chunkExists(x, z + 1) && world.theChunkProviderServer.chunkExists(x - 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x - 1, z);
        }

        if (world.theChunkProviderServer.chunkExists(x, z - 1) && !world.theChunkProviderServer.provideChunk(x, z - 1).isTerrainPopulated && world.theChunkProviderServer.chunkExists(x + 1, z - 1) && world.theChunkProviderServer.chunkExists(x, z - 1) && world.theChunkProviderServer.chunkExists(x + 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x, z - 1);
        }

        if (world.theChunkProviderServer.chunkExists(x - 1, z - 1) && !world.theChunkProviderServer.provideChunk(x - 1, z - 1).isTerrainPopulated && world.theChunkProviderServer.chunkExists(x - 1, z - 1) && world.theChunkProviderServer.chunkExists(x, z - 1) && world.theChunkProviderServer.chunkExists(x - 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x - 1, z - 1);
        }
    }
}
 
开发者ID:djoveryde,项目名称:KCauldron,代码行数:25,代码来源:CraftWorld.java

示例6: loadChunk

import org.bukkit.craftbukkit.util.LongHash; //导入依赖的package包/类
public boolean loadChunk(int x, int z, boolean generate) {
    chunkLoadCount++;
    if (generate) {
        // Use the default variant of loadChunk when generate == true.
        return world.theChunkProviderServer.loadChunk(x, z) != null;
    }

    world.theChunkProviderServer.chunksToUnload.remove(x, z);
    net.minecraft.world.chunk.Chunk chunk = (net.minecraft.world.chunk.Chunk) world.theChunkProviderServer.loadedChunkHashMap_KC.get(LongHash.toLong(x, z));

    if (chunk == null) {
        world.timings.syncChunkLoadTimer.startTiming(); // Spigot
        chunk = world.theChunkProviderServer.safeLoadChunk(x, z);

        chunkLoadPostProcess(chunk, x, z);
        world.timings.syncChunkLoadTimer.stopTiming(); // Spigot
    }
    return chunk != null;
}
 
开发者ID:Bogdan-G,项目名称:FFoKC,代码行数:20,代码来源:CraftWorld.java

示例7: chunkLoadPostProcess

import org.bukkit.craftbukkit.util.LongHash; //导入依赖的package包/类
private void chunkLoadPostProcess(net.minecraft.world.chunk.Chunk chunk, int x, int z) {
    if (chunk != null) {
        world.theChunkProviderServer.loadedChunkHashMap_KC.put(LongHash.toLong(x, z), chunk);
        world.theChunkProviderServer.loadedChunks.add(chunk); // Cauldron - vanilla compatibility
        //world.theChunkProviderServer.loadedChunkHashMap.add(ChunkCoordIntPair.chunkXZ2Int(x, z), chunk);

        chunk.onChunkLoad();

        if (!chunk.isTerrainPopulated && world.theChunkProviderServer.chunkExists(x + 1, z + 1) && world.theChunkProviderServer.chunkExists(x, z + 1) && world.theChunkProviderServer.chunkExists(x + 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x, z);
        }

        if (world.theChunkProviderServer.chunkExists(x - 1, z) && !world.theChunkProviderServer.provideChunk(x - 1, z).isTerrainPopulated && world.theChunkProviderServer.chunkExists(x - 1, z + 1) && world.theChunkProviderServer.chunkExists(x, z + 1) && world.theChunkProviderServer.chunkExists(x - 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x - 1, z);
        }

        if (world.theChunkProviderServer.chunkExists(x, z - 1) && !world.theChunkProviderServer.provideChunk(x, z - 1).isTerrainPopulated && world.theChunkProviderServer.chunkExists(x + 1, z - 1) && world.theChunkProviderServer.chunkExists(x, z - 1) && world.theChunkProviderServer.chunkExists(x + 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x, z - 1);
        }

        if (world.theChunkProviderServer.chunkExists(x - 1, z - 1) && !world.theChunkProviderServer.provideChunk(x - 1, z - 1).isTerrainPopulated && world.theChunkProviderServer.chunkExists(x - 1, z - 1) && world.theChunkProviderServer.chunkExists(x, z - 1) && world.theChunkProviderServer.chunkExists(x - 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x - 1, z - 1);
        }
    }
}
 
开发者ID:Bogdan-G,项目名称:FFoKC,代码行数:26,代码来源:CraftWorld.java

示例8: unloadChunk

import org.bukkit.craftbukkit.util.LongHash; //导入依赖的package包/类
public boolean unloadChunk(int x, int z, boolean save, boolean safe) {
    if (safe && isChunkInUse(x, z)) {
        return false;
    }

    net.minecraft.server.Chunk chunk = world.chunkProviderServer.getOrCreateChunk(x, z);
    if (chunk.mustSave) {   // If chunk had previously been queued to save, must do save to avoid loss of that data
        save = true;
    }

    chunk.removeEntities(); // Always remove entities - even if discarding, need to get them out of world table

    if (save && !(chunk instanceof EmptyChunk)) {
        world.chunkProviderServer.saveChunk(chunk);
        world.chunkProviderServer.saveChunkNOP(chunk);
    }

    world.chunkProviderServer.unloadQueue.remove(x, z);
    world.chunkProviderServer.chunks.remove(LongHash.toLong(x, z));

    return true;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:23,代码来源:CraftWorld.java

示例9: loadChunk

import org.bukkit.craftbukkit.util.LongHash; //导入依赖的package包/类
public boolean loadChunk(int x, int z, boolean generate) {
    chunkLoadCount++;
    if (generate) {
        // Use the default variant of loadChunk when generate == true.
        return world.chunkProviderServer.getChunkAt(x, z) != null;
    }

    world.chunkProviderServer.unloadQueue.remove(x, z);
    net.minecraft.server.Chunk chunk = world.chunkProviderServer.chunks.get(LongHash.toLong(x, z));

    if (chunk == null) {
        chunk = world.chunkProviderServer.loadChunk(x, z);

        chunkLoadPostProcess(chunk, x, z);
    }
    return chunk != null;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:18,代码来源:CraftWorld.java

示例10: chunkLoadPostProcess

import org.bukkit.craftbukkit.util.LongHash; //导入依赖的package包/类
private void chunkLoadPostProcess(net.minecraft.server.Chunk chunk, int x, int z) {
    if (chunk != null) {
        world.chunkProviderServer.chunks.put(LongHash.toLong(x, z), chunk);

        chunk.addEntities();

        if (!chunk.done && world.chunkProviderServer.isChunkLoaded(x + 1, z + 1) && world.chunkProviderServer.isChunkLoaded(x, z + 1) && world.chunkProviderServer.isChunkLoaded(x + 1, z)) {
            world.chunkProviderServer.getChunkAt(world.chunkProviderServer, x, z);
        }

        if (world.chunkProviderServer.isChunkLoaded(x - 1, z) && !world.chunkProviderServer.getOrCreateChunk(x - 1, z).done && world.chunkProviderServer.isChunkLoaded(x - 1, z + 1) && world.chunkProviderServer.isChunkLoaded(x, z + 1) && world.chunkProviderServer.isChunkLoaded(x - 1, z)) {
            world.chunkProviderServer.getChunkAt(world.chunkProviderServer, x - 1, z);
        }

        if (world.chunkProviderServer.isChunkLoaded(x, z - 1) && !world.chunkProviderServer.getOrCreateChunk(x, z - 1).done && world.chunkProviderServer.isChunkLoaded(x + 1, z - 1) && world.chunkProviderServer.isChunkLoaded(x, z - 1) && world.chunkProviderServer.isChunkLoaded(x + 1, z)) {
            world.chunkProviderServer.getChunkAt(world.chunkProviderServer, x, z - 1);
        }

        if (world.chunkProviderServer.isChunkLoaded(x - 1, z - 1) && !world.chunkProviderServer.getOrCreateChunk(x - 1, z - 1).done && world.chunkProviderServer.isChunkLoaded(x - 1, z - 1) && world.chunkProviderServer.isChunkLoaded(x, z - 1) && world.chunkProviderServer.isChunkLoaded(x - 1, z)) {
            world.chunkProviderServer.getChunkAt(world.chunkProviderServer, x - 1, z - 1);
        }
    }
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:24,代码来源:CraftWorld.java

示例11: getOrCreateChunk

import org.bukkit.craftbukkit.util.LongHash; //导入依赖的package包/类
public Chunk getOrCreateChunk(int i, int j) {
    // CraftBukkit start
    Chunk chunk = (Chunk) this.chunks.get(LongHash.toLong(i, j));

    chunk = chunk == null ? (!this.world.isLoading && !this.forceChunkLoad ? this.emptyChunk : this.getChunkAt(i, j)) : chunk;
    if (chunk == this.emptyChunk) return chunk;
    if (i != chunk.locX || j != chunk.locZ) {
        b.error("Chunk (" + chunk.locX + ", " + chunk.locZ + ") stored at  (" + i + ", " + j + ") in world '" + world.getWorld().getName() + "'");
        b.error(chunk.getClass().getName());
        Throwable ex = new Throwable();
        ex.fillInStackTrace();
        ex.printStackTrace();
    }
    return chunk;
    // CraftBukkit end
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:17,代码来源:ChunkProviderServer.java

示例12: chunkLoadPostProcess

import org.bukkit.craftbukkit.util.LongHash; //导入依赖的package包/类
private void chunkLoadPostProcess(net.minecraft.server.Chunk chunk, int cx, int cz) {
    if (chunk != null) {
        world.chunkProviderServer.chunks.put(LongHash.toLong(cx, cz), chunk);

        chunk.addEntities();

        // Update neighbor counts
        for (int x = -2; x < 3; x++) {
            for (int z = -2; z < 3; z++) {
                if (x == 0 && z == 0) {
                    continue;
                }

                net.minecraft.server.Chunk neighbor = world.chunkProviderServer.getChunkIfLoaded(chunk.locX + x, chunk.locZ + z);
                if (neighbor != null) {
                    neighbor.setNeighborLoaded(-x, -z);
                    chunk.setNeighborLoaded(x, z);
                }
            }
        }
        // CraftBukkit end

        chunk.loadNearby(world.chunkProviderServer, world.chunkProviderServer, cx, cz);
    }
}
 
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:26,代码来源:CraftWorld.java

示例13: loadChunk

import org.bukkit.craftbukkit.util.LongHash; //导入依赖的package包/类
public boolean loadChunk(int x, int z, boolean generate) {
    if (Thread.currentThread() != MinecraftServer.getServer().primaryThread) throw new IllegalStateException("Asynchronous chunk load!"); // Spigot
    chunkLoadCount++;
    if (generate) {
        // Use the default variant of loadChunk when generate == true.
        return world.chunkProviderServer.getChunkAt(x, z) != null;
    }

    world.chunkProviderServer.unloadQueue.remove(x, z);
    net.minecraft.server.Chunk chunk = world.chunkProviderServer.chunks.get(LongHash.toLong(x, z));

    if (chunk == null) {
        chunk = world.chunkProviderServer.loadChunk(x, z);

        chunkLoadPostProcess(chunk, x, z);
    }
    return chunk != null;
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:19,代码来源:CraftWorld.java

示例14: getOrCreateChunk

import org.bukkit.craftbukkit.util.LongHash; //导入依赖的package包/类
public Chunk getOrCreateChunk(int i, int j) {
    // CraftBukkit start
    Chunk chunk = (Chunk) this.chunks.get(LongHash.toLong(i, j));

    chunk = chunk == null ? (!this.world.isLoading && !this.forceChunkLoad ? this.emptyChunk : this.getChunkAt(i, j)) : chunk;
    if (chunk == this.emptyChunk) return chunk;
    if (i != chunk.x || j != chunk.z) {
        this.world.getLogger().severe("Chunk (" + chunk.x + ", " + chunk.z + ") stored at  (" + i + ", " + j + ") in world '" + world.getWorld().getName() + "'");
        this.world.getLogger().severe(chunk.getClass().getName());
        Throwable ex = new Throwable();
        ex.fillInStackTrace();
        ex.printStackTrace();
    }
    return chunk;
    // CraftBukkit end
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:17,代码来源:ChunkProviderServer.java

示例15: unloadChunk

import org.bukkit.craftbukkit.util.LongHash; //导入依赖的package包/类
public boolean unloadChunk(int x, int z, boolean save, boolean safe) {
    org.spigotmc.AsyncCatcher.catchOp( "chunk unload"); // Spigot
    if (safe && isChunkInUse(x, z)) {
        return false;
    }

    net.minecraft.server.Chunk chunk = world.chunkProviderServer.getOrCreateChunk(x, z);
    if (chunk.mustSave) {   // If chunk had previously been queued to save, must do save to avoid loss of that data
        save = true;
    }

    chunk.removeEntities(); // Always remove entities - even if discarding, need to get them out of world table

    if (save && !(chunk instanceof EmptyChunk)) {
        world.chunkProviderServer.saveChunk(chunk);
        world.chunkProviderServer.saveChunkNOP(chunk);
    }

    world.chunkProviderServer.unloadQueue.remove(x, z);
    world.chunkProviderServer.chunks.remove(LongHash.toLong(x, z));

    return true;
}
 
开发者ID:pvginkel,项目名称:Tweakkit-Server,代码行数:24,代码来源:CraftWorld.java


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