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; }
public LoadRenderersEvent(ViewFrustum viewFrustum, ChunkRenderDispatcher renderDispatcher) { this.viewFrustum = viewFrustum; this.renderDispatcher = renderDispatcher; }
public ViewFrustum getViewFrustum() { return viewFrustum; }
public static void onLoadRenderers(ViewFrustum viewFrustum, ChunkRenderDispatcher renderDispatcher) { MinecraftForge.EVENT_BUS.post(new LoadRenderersEvent(viewFrustum, renderDispatcher)); }
@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"); } } }