本文整理汇总了Java中org.bukkit.craftbukkit.util.LongHash.toLong方法的典型用法代码示例。如果您正苦于以下问题:Java LongHash.toLong方法的具体用法?Java LongHash.toLong怎么用?Java LongHash.toLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.craftbukkit.util.LongHash
的用法示例。
在下文中一共展示了LongHash.toLong方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addNextTickIfNeeded
import org.bukkit.craftbukkit.util.LongHash; //导入方法依赖的package包/类
private void addNextTickIfNeeded(NextTickListEntry ent) {
long coord = LongHash.toLong(ent.a >> 4, ent.c >> 4);
Set<NextTickListEntry> chunkset = this.tickEntriesByChunk.get(coord);
if (chunkset == null) {
chunkset = new HashSet<NextTickListEntry>();
this.tickEntriesByChunk.put(coord, chunkset);
} else if (chunkset.contains(ent)) {
return;
}
chunkset.add(ent);
this.tickEntryQueue.add(ent);
}
示例2: removeNextTickIfNeeded
import org.bukkit.craftbukkit.util.LongHash; //导入方法依赖的package包/类
private void removeNextTickIfNeeded(NextTickListEntry ent) {
long coord = LongHash.toLong(ent.a >> 4, ent.c >> 4);
Set<NextTickListEntry> chunkset = this.tickEntriesByChunk.get(coord);
if (chunkset != null) {
chunkset.remove(ent);
if (chunkset.isEmpty()) {
this.tickEntriesByChunk.remove(coord);
}
}
this.tickEntryQueue.remove(ent);
}
示例3: getNextTickEntriesForChunk
import org.bukkit.craftbukkit.util.LongHash; //导入方法依赖的package包/类
private List<NextTickListEntry> getNextTickEntriesForChunk(Chunk chunk, boolean remove) {
long coord = LongHash.toLong(chunk.x, chunk.z);
Set<NextTickListEntry> chunkset = this.tickEntriesByChunk.get(coord);
List<NextTickListEntry> list = null;
if (chunkset != null) {
list = new ArrayList<NextTickListEntry>(chunkset);
if (remove) {
this.tickEntriesByChunk.remove(coord);
this.tickEntryQueue.removeAll(list);
chunkset.clear();
}
}
// See if any on list of ticks being processed now
if (this.nextPendingTickEntry < this.pendingTickEntries.size()) {
int xmin = (chunk.x << 4);
int xmax = xmin + 16;
int zmin = (chunk.z << 4);
int zmax = zmin + 16;
int te_cnt = this.pendingTickEntries.size();
for (int i = this.nextPendingTickEntry; i < te_cnt; i++) {
NextTickListEntry ent = this.pendingTickEntries.get(i);
if ((ent.a >= xmin) && (ent.a < xmax) && (ent.c >= zmin) && (ent.c < zmax)) {
if (list == null) {
list = new ArrayList<NextTickListEntry>();
}
list.add(ent);
}
}
}
return list;
}
示例4: V2B
import org.bukkit.craftbukkit.util.LongHash; //导入方法依赖的package包/类
private static long V2B(long key) {
return LongHash.toLong((int) (key & 0xFFFFFFFFL), (int) (key >>> 32));
}
示例5: lastAccessed
import org.bukkit.craftbukkit.util.LongHash; //导入方法依赖的package包/类
public long lastAccessed(int x, int z)
{
long chunkHash = LongHash.toLong(x, z);
if (!loadedChunkHashMap.containsKey(chunkHash)) return 0;
return loadedChunkHashMap.get(chunkHash).lastAccessedTick;
}