Java 类net.minecraft.client.renderer.chunk.ChunkRenderDispatcher 实例源码

项目:ForgeHax    文件:LoadRenderersEvent.java   
public LoadRenderersEvent(ViewFrustum viewFrustum, ChunkRenderDispatcher renderDispatcher) {
    this.viewFrustum = viewFrustum;
    this.renderDispatcher = renderDispatcher;
}
项目:ForgeHax    文件:LoadRenderersEvent.java   
public ChunkRenderDispatcher getRenderDispatcher() {
    return renderDispatcher;
}
项目:Backmemed    文件:RenderGlobal.java   
/**
 * Loads all the renderers and sets up the basic settings usage
 */
public void loadRenderers()
{
    if (this.theWorld != null)
    {
        if (this.renderDispatcher == null)
        {
            this.renderDispatcher = new ChunkRenderDispatcher();
        }

        this.displayListEntitiesDirty = true;
        Blocks.LEAVES.setGraphicsLevel(Config.isTreesFancy());
        Blocks.LEAVES2.setGraphicsLevel(Config.isTreesFancy());
        BlockModelRenderer.updateAoLightValue();
        renderInfoCache.clear();

        if (Config.isDynamicLights())
        {
            DynamicLights.clear();
        }

        this.renderDistanceChunks = this.mc.gameSettings.renderDistanceChunks;
        this.renderDistance = this.renderDistanceChunks * 16;
        this.renderDistanceSq = this.renderDistance * this.renderDistance;
        boolean flag = this.vboEnabled;
        this.vboEnabled = OpenGlHelper.useVbo();

        if (flag && !this.vboEnabled)
        {
            this.renderContainer = new RenderList();
            this.renderChunkFactory = new ListChunkFactory();
        }
        else if (!flag && this.vboEnabled)
        {
            this.renderContainer = new VboRenderList();
            this.renderChunkFactory = new VboChunkFactory();
        }

        if (flag != this.vboEnabled)
        {
            this.generateStars();
            this.generateSky();
            this.generateSky2();
        }

        if (this.viewFrustum != null)
        {
            this.viewFrustum.deleteGlResources();
        }

        this.stopChunkUpdates();

        synchronized (this.setTileEntities)
        {
            this.setTileEntities.clear();
        }

        this.viewFrustum = new ViewFrustum(this.theWorld, this.mc.gameSettings.renderDistanceChunks, this, this.renderChunkFactory);

        if (this.theWorld != null)
        {
            Entity entity = this.mc.getRenderViewEntity();

            if (entity != null)
            {
                this.viewFrustum.updateChunkPositions(entity.posX, entity.posZ);
            }
        }

        this.renderEntitiesStartupCounter = 2;
    }
}
项目:CustomWorldGen    文件:RenderGlobal.java   
/**
 * Loads all the renderers and sets up the basic settings usage
 */
public void loadRenderers()
{
    if (this.theWorld != null)
    {
        if (this.renderDispatcher == null)
        {
            this.renderDispatcher = new ChunkRenderDispatcher();
        }

        this.displayListEntitiesDirty = true;
        Blocks.LEAVES.setGraphicsLevel(this.mc.gameSettings.fancyGraphics);
        Blocks.LEAVES2.setGraphicsLevel(this.mc.gameSettings.fancyGraphics);
        this.renderDistanceChunks = this.mc.gameSettings.renderDistanceChunks;
        boolean flag = this.vboEnabled;
        this.vboEnabled = OpenGlHelper.useVbo();

        if (flag && !this.vboEnabled)
        {
            this.renderContainer = new RenderList();
            this.renderChunkFactory = new ListChunkFactory();
        }
        else if (!flag && this.vboEnabled)
        {
            this.renderContainer = new VboRenderList();
            this.renderChunkFactory = new VboChunkFactory();
        }

        if (flag != this.vboEnabled)
        {
            this.generateStars();
            this.generateSky();
            this.generateSky2();
        }

        if (this.viewFrustum != null)
        {
            this.viewFrustum.deleteGlResources();
        }

        this.stopChunkUpdates();

        synchronized (this.setTileEntities)
        {
            this.setTileEntities.clear();
        }

        this.viewFrustum = new ViewFrustum(this.theWorld, this.mc.gameSettings.renderDistanceChunks, this, this.renderChunkFactory);

        if (this.theWorld != null)
        {
            Entity entity = this.mc.getRenderViewEntity();

            if (entity != null)
            {
                this.viewFrustum.updateChunkPositions(entity.posX, entity.posZ);
            }
        }

        this.renderEntitiesStartupCounter = 2;
    }
}
项目:blockbuster    文件:CommandLoadChunks.java   
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
    RenderGlobal render = Minecraft.getMinecraft().renderGlobal;
    Field frustumField = null;
    Field chunkyField = null;

    /* Find all fields */
    for (Field field : render.getClass().getDeclaredFields())
    {
        if (chunkyField == null && field.getType().equals(ChunkRenderDispatcher.class))
        {
            chunkyField = field;
            chunkyField.setAccessible(true);
        }

        if (frustumField == null && field.getType().equals(ViewFrustum.class))
        {
            frustumField = field;
            frustumField.setAccessible(true);
        }

        if (chunkyField != null && frustumField != null)
        {
            break;
        }
    }

    /* Force chunk loading */
    if (chunkyField != null && frustumField != null)
    {
        try
        {
            ChunkRenderDispatcher chunks = (ChunkRenderDispatcher) chunkyField.get(render);
            ViewFrustum frustum = (ViewFrustum) frustumField.get(render);

            for (RenderChunk chunk : frustum.renderChunks)
            {
                boolean isDummy = chunk.getCompiledChunk() == CompiledChunk.DUMMY;

                if (isDummy)
                {
                    chunks.updateChunkNow(chunk);
                }
            }

            L10n.info(sender, "commands.load_chunks");
        }
        catch (Exception e)
        {
            e.printStackTrace();

            L10n.error(sender, "commands.load_chunks");
        }
    }
}
项目:ExpandedRailsMod    文件:RenderGlobal.java   
/**
 * Loads all the renderers and sets up the basic settings usage
 */
public void loadRenderers()
{
    if (this.theWorld != null)
    {
        if (this.renderDispatcher == null)
        {
            this.renderDispatcher = new ChunkRenderDispatcher();
        }

        this.displayListEntitiesDirty = true;
        Blocks.LEAVES.setGraphicsLevel(this.mc.gameSettings.fancyGraphics);
        Blocks.LEAVES2.setGraphicsLevel(this.mc.gameSettings.fancyGraphics);
        this.renderDistanceChunks = this.mc.gameSettings.renderDistanceChunks;
        boolean flag = this.vboEnabled;
        this.vboEnabled = OpenGlHelper.useVbo();

        if (flag && !this.vboEnabled)
        {
            this.renderContainer = new RenderList();
            this.renderChunkFactory = new ListChunkFactory();
        }
        else if (!flag && this.vboEnabled)
        {
            this.renderContainer = new VboRenderList();
            this.renderChunkFactory = new VboChunkFactory();
        }

        if (flag != this.vboEnabled)
        {
            this.generateStars();
            this.generateSky();
            this.generateSky2();
        }

        if (this.viewFrustum != null)
        {
            this.viewFrustum.deleteGlResources();
        }

        this.stopChunkUpdates();

        synchronized (this.setTileEntities)
        {
            this.setTileEntities.clear();
        }

        this.viewFrustum = new ViewFrustum(this.theWorld, this.mc.gameSettings.renderDistanceChunks, this, this.renderChunkFactory);

        if (this.theWorld != null)
        {
            Entity entity = this.mc.getRenderViewEntity();

            if (entity != null)
            {
                this.viewFrustum.updateChunkPositions(entity.posX, entity.posZ);
            }
        }

        this.renderEntitiesStartupCounter = 2;
    }
}
项目:iChunUtil    文件:RenderGlobalProxy.java   
@Override
public void loadRenderers()
{
    if(this.world != null)
    {
        if(this.renderDispatcher == null)
        {
            this.renderDispatcher = new ChunkRenderDispatcher();
        }

        this.displayListEntitiesDirty = true;
        Blocks.LEAVES.setGraphicsLevel(this.mc.gameSettings.fancyGraphics);
        Blocks.LEAVES2.setGraphicsLevel(this.mc.gameSettings.fancyGraphics);
        this.renderDistanceChunks = this.mc.gameSettings.renderDistanceChunks;
        boolean flag = this.vboEnabled;
        this.vboEnabled = OpenGlHelper.useVbo();

        if(flag && !this.vboEnabled)
        {
            this.renderContainer = new RenderList();
            this.renderChunkFactory = new ListChunkFactory();
        }
        else if(!flag && this.vboEnabled)
        {
            this.renderContainer = new VboRenderList();
            this.renderChunkFactory = new VboChunkFactory();
        }

        if(flag != this.vboEnabled)
        {
            this.generateStars();
            this.generateSky();
            this.generateSky2();
        }

        cleanViewFrustums();

        this.stopChunkUpdates();

        synchronized(this.setTileEntities)
        {
            this.setTileEntities.clear();
        }

        this.renderEntitiesStartupCounter = 2;
    }
}