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

项目:Backmemed    文件:RenderChunk.java   
public RenderChunk getRenderChunkOffset16(ViewFrustum p_getRenderChunkOffset16_1_, EnumFacing p_getRenderChunkOffset16_2_)
{
    RenderChunk renderchunk = this.renderChunksOfset16[p_getRenderChunkOffset16_2_.ordinal()];

    if (renderchunk == null)
    {
        BlockPos blockpos = this.getBlockPosOffset16(p_getRenderChunkOffset16_2_);
        renderchunk = p_getRenderChunkOffset16_1_.getRenderChunk(blockpos);
        this.renderChunksOfset16[p_getRenderChunkOffset16_2_.ordinal()] = renderchunk;
    }

    return renderchunk;
}
项目:ForgeHax    文件:LoadRenderersEvent.java   
public LoadRenderersEvent(ViewFrustum viewFrustum, ChunkRenderDispatcher renderDispatcher) {
    this.viewFrustum = viewFrustum;
    this.renderDispatcher = renderDispatcher;
}
项目:ForgeHax    文件:LoadRenderersEvent.java   
public ViewFrustum getViewFrustum() {
    return viewFrustum;
}
项目:ForgeHax    文件:ForgeHaxHooks.java   
public static void onLoadRenderers(ViewFrustum viewFrustum, ChunkRenderDispatcher renderDispatcher) {
    MinecraftForge.EVENT_BUS.post(new LoadRenderersEvent(viewFrustum, renderDispatcher));
}
项目: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");
        }
    }
}