You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
852 B
37 lines
852 B
10 years ago
|
package kcauldron.wrapper;
|
||
|
|
||
|
import gnu.trove.map.TLongObjectMap;
|
||
|
import net.minecraft.world.chunk.Chunk;
|
||
|
|
||
|
import org.bukkit.craftbukkit.util.LongHash;
|
||
|
|
||
|
public class VanillaChunkHashMap extends LongHashMapTrove<Chunk> {
|
||
|
public VanillaChunkHashMap(TLongObjectMap<Chunk> map) {
|
||
|
super(map);
|
||
|
}
|
||
|
|
||
|
private static long V2B(long key) {
|
||
|
return LongHash.toLong((int) (key & 0xFFFFFFFFL), (int) (key >>> 32));
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void add(long key, Object value) {
|
||
|
super.add(V2B(key), value);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public boolean containsItem(long key) {
|
||
|
return super.containsItem(V2B(key));
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public Object getValueByKey(long key) {
|
||
|
return super.getValueByKey(V2B(key));
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public Object remove(long key) {
|
||
|
return super.remove(V2B(key));
|
||
|
}
|
||
|
}
|