Search in sources :

Example 1 with ObjectArraySet

use of it.unimi.dsi.fastutil.objects.ObjectArraySet in project Rikaishi-Nikui by zhuaidadaya.

the class VanillaMinecraftAssetsParser method getFasterAssetsDownloads.

public Set<NetworkFileInformation> getFasterAssetsDownloads() {
    Object2ObjectRBTreeMap<String, VanillaMinecraftAssetParser> assets = getAssets();
    ObjectArraySet<NetworkFileInformation> downloads = new ObjectArraySet<>();
    for (String s : assets.keySet()) {
        VanillaMinecraftAssetParser asset = assets.get(s);
        downloads.add(new NetworkFileInformation(s, String.format("%s/assets/objects/%s", area, asset.getPath()), asset.getHash()));
    }
    return downloads;
}
Also used : NetworkFileInformation(com.github.zhuaidadaya.rikaishinikui.handler.network.downloader.NetworkFileInformation) ObjectArraySet(it.unimi.dsi.fastutil.objects.ObjectArraySet)

Example 2 with ObjectArraySet

use of it.unimi.dsi.fastutil.objects.ObjectArraySet in project Mekanism by mekanism.

the class TileEntityDigitalMiner method getChunkSet.

@Override
public Set<ChunkPos> getChunkSet() {
    ChunkPos minerChunk = new ChunkPos(worldPosition);
    if (targetChunk != null) {
        // If we have a target check to make sure it is in the radius (most likely it is)
        if ((worldPosition.getX() - radius) >> 4 <= targetChunk.x && targetChunk.x <= (worldPosition.getX() + radius) >> 4 && (worldPosition.getZ() - radius) >> 4 <= targetChunk.z && targetChunk.z <= (worldPosition.getZ() + radius) >> 4) {
            // if it is, return the chunks we should be loading, provide the chunk the miner is in
            // and the chunk that the miner is currently mining
            Set<ChunkPos> chunks = new ObjectArraySet<>(2);
            chunks.add(minerChunk);
            // TODO: At some point we may want to change the ticket of the chunk the miner is mining to be
            // at a lower level and not cause tiles in it to actually tick
            chunks.add(targetChunk);
            return chunks;
        }
    }
    // Otherwise, just return the miner's chunk
    return Collections.singleton(minerChunk);
}
Also used : ChunkPos(net.minecraft.util.math.ChunkPos) ObjectArraySet(it.unimi.dsi.fastutil.objects.ObjectArraySet)

Aggregations

ObjectArraySet (it.unimi.dsi.fastutil.objects.ObjectArraySet)2 NetworkFileInformation (com.github.zhuaidadaya.rikaishinikui.handler.network.downloader.NetworkFileInformation)1 ChunkPos (net.minecraft.util.math.ChunkPos)1