Java 类net.minecraft.client.renderer.RegionRenderCacheBuilder 实例源码

项目:DecompiledMinecraft    文件:ChunkRenderDispatcher.java   
public ChunkRenderDispatcher()
{
    for (int i = 0; i < 2; ++i)
    {
        ChunkRenderWorker chunkrenderworker = new ChunkRenderWorker(this);
        Thread thread = threadFactory.newThread(chunkrenderworker);
        thread.start();
        this.listThreadedWorkers.add(chunkrenderworker);
    }

    for (int j = 0; j < 5; ++j)
    {
        this.queueFreeRenderBuilders.add(new RegionRenderCacheBuilder());
    }

    this.renderWorker = new ChunkRenderWorker(this, new RegionRenderCacheBuilder());
}
项目:DecompiledMinecraft    文件:ChunkRenderDispatcher.java   
public void stopChunkUpdates()
{
    this.clearChunkUpdates();

    while (this.runChunkUploads(0L))
    {
        ;
    }

    List<RegionRenderCacheBuilder> list = Lists.<RegionRenderCacheBuilder>newArrayList();

    while (((List)list).size() != 5)
    {
        try
        {
            list.add(this.allocateRenderBuilder());
        }
        catch (InterruptedException var3)
        {
            ;
        }
    }

    this.queueFreeRenderBuilders.addAll(list);
}
项目:BaseClient    文件:ChunkRenderDispatcher.java   
public ChunkRenderDispatcher()
{
    for (int i = 0; i < 2; ++i)
    {
        ChunkRenderWorker chunkrenderworker = new ChunkRenderWorker(this);
        Thread thread = threadFactory.newThread(chunkrenderworker);
        thread.start();
        this.listThreadedWorkers.add(chunkrenderworker);
    }

    for (int j = 0; j < 5; ++j)
    {
        this.queueFreeRenderBuilders.add(new RegionRenderCacheBuilder());
    }

    this.renderWorker = new ChunkRenderWorker(this, new RegionRenderCacheBuilder());
}
项目:BaseClient    文件:ChunkRenderDispatcher.java   
public void stopChunkUpdates()
{
    this.clearChunkUpdates();

    while (this.runChunkUploads(0L))
    {
        ;
    }

    List<RegionRenderCacheBuilder> list = Lists.<RegionRenderCacheBuilder>newArrayList();

    while (((List)list).size() != 5)
    {
        try
        {
            list.add(this.allocateRenderBuilder());
        }
        catch (InterruptedException var3)
        {
            ;
        }
    }

    this.queueFreeRenderBuilders.addAll(list);
}
项目:BaseClient    文件:ChunkRenderDispatcher.java   
public ChunkRenderDispatcher()
{
    for (int i = 0; i < 2; ++i)
    {
        ChunkRenderWorker chunkrenderworker = new ChunkRenderWorker(this);
        Thread thread = threadFactory.newThread(chunkrenderworker);
        thread.start();
        this.listThreadedWorkers.add(chunkrenderworker);
    }

    for (int j = 0; j < 5; ++j)
    {
        this.queueFreeRenderBuilders.add(new RegionRenderCacheBuilder());
    }

    this.renderWorker = new ChunkRenderWorker(this, new RegionRenderCacheBuilder());
}
项目:BaseClient    文件:ChunkRenderDispatcher.java   
public void stopChunkUpdates()
{
    this.clearChunkUpdates();

    while (this.runChunkUploads(0L))
    {
        ;
    }

    List<RegionRenderCacheBuilder> list = Lists.<RegionRenderCacheBuilder>newArrayList();

    while (((List)list).size() != 5)
    {
        try
        {
            list.add(this.allocateRenderBuilder());
        }
        catch (InterruptedException var3)
        {
            ;
        }
    }

    this.queueFreeRenderBuilders.addAll(list);
}
项目:Backmemed    文件:ChunkRenderDispatcher.java   
public void stopChunkUpdates()
{
    this.clearChunkUpdates();
    List<RegionRenderCacheBuilder> list = Lists.<RegionRenderCacheBuilder>newArrayList();

    while (((List)list).size() != this.countRenderBuilders)
    {
        this.runChunkUploads(Long.MAX_VALUE);

        try
        {
            list.add(this.allocateRenderBuilder());
        }
        catch (InterruptedException var3)
        {
            ;
        }
    }

    this.queueFreeRenderBuilders.addAll(list);
}
项目:CustomWorldGen    文件:ChunkRenderDispatcher.java   
public void stopChunkUpdates()
{
    this.clearChunkUpdates();
    List<RegionRenderCacheBuilder> list = Lists.<RegionRenderCacheBuilder>newArrayList();

    while (((List)list).size() != this.countRenderBuilders)
    {
        this.runChunkUploads(Long.MAX_VALUE);

        try
        {
            list.add(this.allocateRenderBuilder());
        }
        catch (InterruptedException var3)
        {
            ;
        }
    }

    this.queueFreeRenderBuilders.addAll(list);
}
项目:ExpandedRailsMod    文件:ChunkRenderDispatcher.java   
public void stopChunkUpdates()
{
    this.clearChunkUpdates();
    List<RegionRenderCacheBuilder> list = Lists.<RegionRenderCacheBuilder>newArrayList();

    while (((List)list).size() != this.countRenderBuilders)
    {
        this.runChunkUploads(Long.MAX_VALUE);

        try
        {
            list.add(this.allocateRenderBuilder());
        }
        catch (InterruptedException var3)
        {
            ;
        }
    }

    this.queueFreeRenderBuilders.addAll(list);
}
项目:Backmemed    文件:RenderChunk.java   
private void postRenderOverlay(BlockRenderLayer p_postRenderOverlay_1_, RegionRenderCacheBuilder p_postRenderOverlay_2_, CompiledChunk p_postRenderOverlay_3_, boolean[] p_postRenderOverlay_4_)
{
    net.minecraft.client.renderer.VertexBuffer vertexbuffer = p_postRenderOverlay_2_.getWorldRendererByLayer(p_postRenderOverlay_1_);

    if (vertexbuffer.isDrawing())
    {
        p_postRenderOverlay_3_.setLayerStarted(p_postRenderOverlay_1_);
        p_postRenderOverlay_4_[p_postRenderOverlay_1_.ordinal()] = true;
    }
}
项目:CustomWorldGen    文件:ChunkRenderDispatcher.java   
public ChunkRenderDispatcher(int countRenderBuilders)
{
    int i = Math.max(1, (int)((double)Runtime.getRuntime().maxMemory() * 0.3D) / 10485760);
    int j = Math.max(1, MathHelper.clamp_int(Runtime.getRuntime().availableProcessors(), 1, i / 5));
    if(countRenderBuilders < 0) countRenderBuilders = MathHelper.clamp_int(j * 10, 1, i);
    this.countRenderBuilders = countRenderBuilders;

    if (j > 1)
    {
        for (int k = 0; k < j; ++k)
        {
            ChunkRenderWorker chunkrenderworker = new ChunkRenderWorker(this);
            Thread thread = THREAD_FACTORY.newThread(chunkrenderworker);
            thread.start();
            this.listThreadedWorkers.add(chunkrenderworker);
            this.listWorkerThreads.add(thread);
        }
    }

    this.queueFreeRenderBuilders = Queues.<RegionRenderCacheBuilder>newArrayBlockingQueue(this.countRenderBuilders);

    for (int l = 0; l < this.countRenderBuilders; ++l)
    {
        this.queueFreeRenderBuilders.add(new RegionRenderCacheBuilder());
    }

    this.renderWorker = new ChunkRenderWorker(this, new RegionRenderCacheBuilder());
}
项目:ExpandedRailsMod    文件:ChunkRenderDispatcher.java   
public ChunkRenderDispatcher(int countRenderBuilders)
{
    int i = Math.max(1, (int)((double)Runtime.getRuntime().maxMemory() * 0.3D) / 10485760);
    int j = Math.max(1, MathHelper.clamp_int(Runtime.getRuntime().availableProcessors(), 1, i / 5));
    if(countRenderBuilders < 0) countRenderBuilders = MathHelper.clamp_int(j * 10, 1, i);
    this.countRenderBuilders = countRenderBuilders;

    if (j > 1)
    {
        for (int k = 0; k < j; ++k)
        {
            ChunkRenderWorker chunkrenderworker = new ChunkRenderWorker(this);
            Thread thread = THREAD_FACTORY.newThread(chunkrenderworker);
            thread.start();
            this.listThreadedWorkers.add(chunkrenderworker);
            this.listWorkerThreads.add(thread);
        }
    }

    this.queueFreeRenderBuilders = Queues.<RegionRenderCacheBuilder>newArrayBlockingQueue(this.countRenderBuilders);

    for (int l = 0; l < this.countRenderBuilders; ++l)
    {
        this.queueFreeRenderBuilders.add(new RegionRenderCacheBuilder());
    }

    this.renderWorker = new ChunkRenderWorker(this, new RegionRenderCacheBuilder());
}
项目:DecompiledMinecraft    文件:ChunkRenderWorker.java   
public ChunkRenderWorker(ChunkRenderDispatcher p_i46201_1_)
{
    this(p_i46201_1_, (RegionRenderCacheBuilder)null);
}
项目:DecompiledMinecraft    文件:ChunkRenderWorker.java   
public ChunkRenderWorker(ChunkRenderDispatcher chunkRenderDispatcherIn, RegionRenderCacheBuilder regionRenderCacheBuilderIn)
{
    this.chunkRenderDispatcher = chunkRenderDispatcherIn;
    this.regionRenderCacheBuilder = regionRenderCacheBuilderIn;
}
项目:DecompiledMinecraft    文件:ChunkRenderWorker.java   
private RegionRenderCacheBuilder getRegionRenderCacheBuilder() throws InterruptedException
{
    return this.regionRenderCacheBuilder != null ? this.regionRenderCacheBuilder : this.chunkRenderDispatcher.allocateRenderBuilder();
}
项目:DecompiledMinecraft    文件:ChunkRenderDispatcher.java   
public void freeRenderBuilder(RegionRenderCacheBuilder p_178512_1_)
{
    this.queueFreeRenderBuilders.add(p_178512_1_);
}
项目:DecompiledMinecraft    文件:ChunkRenderDispatcher.java   
public RegionRenderCacheBuilder allocateRenderBuilder() throws InterruptedException
{
    return (RegionRenderCacheBuilder)this.queueFreeRenderBuilders.take();
}
项目:DecompiledMinecraft    文件:ChunkCompileTaskGenerator.java   
public RegionRenderCacheBuilder getRegionRenderCacheBuilder()
{
    return this.regionRenderCacheBuilder;
}
项目:DecompiledMinecraft    文件:ChunkCompileTaskGenerator.java   
public void setRegionRenderCacheBuilder(RegionRenderCacheBuilder regionRenderCacheBuilderIn)
{
    this.regionRenderCacheBuilder = regionRenderCacheBuilderIn;
}
项目:BaseClient    文件:ChunkRenderWorker.java   
public ChunkRenderWorker(ChunkRenderDispatcher p_i46201_1_)
{
    this(p_i46201_1_, (RegionRenderCacheBuilder)null);
}
项目:BaseClient    文件:ChunkRenderWorker.java   
public ChunkRenderWorker(ChunkRenderDispatcher chunkRenderDispatcherIn, RegionRenderCacheBuilder regionRenderCacheBuilderIn)
{
    this.chunkRenderDispatcher = chunkRenderDispatcherIn;
    this.regionRenderCacheBuilder = regionRenderCacheBuilderIn;
}
项目:BaseClient    文件:ChunkRenderWorker.java   
private RegionRenderCacheBuilder getRegionRenderCacheBuilder() throws InterruptedException
{
    return this.regionRenderCacheBuilder != null ? this.regionRenderCacheBuilder : this.chunkRenderDispatcher.allocateRenderBuilder();
}
项目:BaseClient    文件:ChunkRenderDispatcher.java   
public void freeRenderBuilder(RegionRenderCacheBuilder p_178512_1_)
{
    this.queueFreeRenderBuilders.add(p_178512_1_);
}
项目:BaseClient    文件:ChunkRenderDispatcher.java   
public RegionRenderCacheBuilder allocateRenderBuilder() throws InterruptedException
{
    return (RegionRenderCacheBuilder)this.queueFreeRenderBuilders.take();
}
项目:BaseClient    文件:ChunkCompileTaskGenerator.java   
public RegionRenderCacheBuilder getRegionRenderCacheBuilder()
{
    return this.regionRenderCacheBuilder;
}
项目:BaseClient    文件:ChunkCompileTaskGenerator.java   
public void setRegionRenderCacheBuilder(RegionRenderCacheBuilder regionRenderCacheBuilderIn)
{
    this.regionRenderCacheBuilder = regionRenderCacheBuilderIn;
}
项目:BaseClient    文件:ChunkRenderWorker.java   
public ChunkRenderWorker(ChunkRenderDispatcher p_i46201_1_)
{
    this(p_i46201_1_, (RegionRenderCacheBuilder)null);
}
项目:BaseClient    文件:ChunkRenderWorker.java   
public ChunkRenderWorker(ChunkRenderDispatcher chunkRenderDispatcherIn, RegionRenderCacheBuilder regionRenderCacheBuilderIn)
{
    this.chunkRenderDispatcher = chunkRenderDispatcherIn;
    this.regionRenderCacheBuilder = regionRenderCacheBuilderIn;
}
项目:BaseClient    文件:ChunkRenderWorker.java   
private RegionRenderCacheBuilder getRegionRenderCacheBuilder() throws InterruptedException
{
    return this.regionRenderCacheBuilder != null ? this.regionRenderCacheBuilder : this.chunkRenderDispatcher.allocateRenderBuilder();
}
项目:BaseClient    文件:ChunkRenderDispatcher.java   
public void freeRenderBuilder(RegionRenderCacheBuilder p_178512_1_)
{
    this.queueFreeRenderBuilders.add(p_178512_1_);
}
项目:BaseClient    文件:ChunkRenderDispatcher.java   
public RegionRenderCacheBuilder allocateRenderBuilder() throws InterruptedException
{
    return (RegionRenderCacheBuilder)this.queueFreeRenderBuilders.take();
}
项目:BaseClient    文件:ChunkCompileTaskGenerator.java   
public RegionRenderCacheBuilder getRegionRenderCacheBuilder()
{
    return this.regionRenderCacheBuilder;
}
项目:BaseClient    文件:ChunkCompileTaskGenerator.java   
public void setRegionRenderCacheBuilder(RegionRenderCacheBuilder regionRenderCacheBuilderIn)
{
    this.regionRenderCacheBuilder = regionRenderCacheBuilderIn;
}
项目:Backmemed    文件:ChunkRenderWorker.java   
public ChunkRenderWorker(ChunkRenderDispatcher p_i46201_1_)
{
    this(p_i46201_1_, (RegionRenderCacheBuilder)null);
}
项目:Backmemed    文件:ChunkRenderWorker.java   
public ChunkRenderWorker(ChunkRenderDispatcher chunkRenderDispatcherIn, @Nullable RegionRenderCacheBuilder regionRenderCacheBuilderIn)
{
    this.shouldRun = true;
    this.chunkRenderDispatcher = chunkRenderDispatcherIn;
    this.regionRenderCacheBuilder = regionRenderCacheBuilderIn;
}
项目:Backmemed    文件:ChunkRenderWorker.java   
private RegionRenderCacheBuilder getRegionRenderCacheBuilder() throws InterruptedException
{
    return this.regionRenderCacheBuilder != null ? this.regionRenderCacheBuilder : this.chunkRenderDispatcher.allocateRenderBuilder();
}
项目:Backmemed    文件:ChunkRenderDispatcher.java   
public ChunkRenderDispatcher(int p_i1_1_)
{
    this.listWorkerThreads = Lists.<Thread>newArrayList();
    this.listThreadedWorkers = Lists.<ChunkRenderWorker>newArrayList();
    this.queueChunkUpdates = Queues.<ChunkCompileTaskGenerator>newPriorityBlockingQueue();
    this.worldVertexUploader = new WorldVertexBufferUploader();
    this.vertexUploader = new VertexBufferUploader();
    this.queueChunkUploads = Queues.<ChunkRenderDispatcher.PendingUpload>newPriorityQueue();
    int i = Math.max(1, (int)((double)Runtime.getRuntime().maxMemory() * 0.3D) / 10485760);
    int j = Math.max(1, MathHelper.clamp(Runtime.getRuntime().availableProcessors(), 1, i / 5));

    if (p_i1_1_ < 0)
    {
        this.countRenderBuilders = MathHelper.clamp(j, 1, i);
    }
    else
    {
        this.countRenderBuilders = p_i1_1_;
    }

    if (j > 1)
    {
        for (int k = 0; k < j; ++k)
        {
            ChunkRenderWorker chunkrenderworker = new ChunkRenderWorker(this);
            Thread thread = THREAD_FACTORY.newThread(chunkrenderworker);
            thread.start();
            this.listThreadedWorkers.add(chunkrenderworker);
            this.listWorkerThreads.add(thread);
        }
    }

    this.queueFreeRenderBuilders = Queues.<RegionRenderCacheBuilder>newArrayBlockingQueue(this.countRenderBuilders);

    for (int l = 0; l < this.countRenderBuilders; ++l)
    {
        this.queueFreeRenderBuilders.add(new RegionRenderCacheBuilder());
    }

    this.renderWorker = new ChunkRenderWorker(this, new RegionRenderCacheBuilder());
}
项目:Backmemed    文件:ChunkRenderDispatcher.java   
public void freeRenderBuilder(RegionRenderCacheBuilder p_178512_1_)
{
    this.queueFreeRenderBuilders.add(p_178512_1_);
}
项目:Backmemed    文件:ChunkRenderDispatcher.java   
public RegionRenderCacheBuilder allocateRenderBuilder() throws InterruptedException
{
    return (RegionRenderCacheBuilder)this.queueFreeRenderBuilders.take();
}
项目:Backmemed    文件:ChunkCompileTaskGenerator.java   
public RegionRenderCacheBuilder getRegionRenderCacheBuilder()
{
    return this.regionRenderCacheBuilder;
}