本文整理汇总了Java中net.minecraft.client.renderer.chunk.RenderChunk类的典型用法代码示例。如果您正苦于以下问题:Java RenderChunk类的具体用法?Java RenderChunk怎么用?Java RenderChunk使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RenderChunk类属于net.minecraft.client.renderer.chunk包,在下文中一共展示了RenderChunk类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRenderChunks
import net.minecraft.client.renderer.chunk.RenderChunk; //导入依赖的package包/类
protected void createRenderChunks(IRenderChunkFactory renderChunkFactory)
{
int i = this.countChunksX * this.countChunksY * this.countChunksZ;
this.renderChunks = new RenderChunk[i];
int j = 0;
for (int k = 0; k < this.countChunksX; ++k)
{
for (int l = 0; l < this.countChunksY; ++l)
{
for (int i1 = 0; i1 < this.countChunksZ; ++i1)
{
int j1 = (i1 * this.countChunksY + l) * this.countChunksX + k;
this.renderChunks[j1] = renderChunkFactory.create(this.world, this.renderGlobal, j++);
this.renderChunks[j1].setPosition(k * 16, l * 16, i1 * 16);
}
}
}
}
示例2: onBlockRenderInLoop
import net.minecraft.client.renderer.chunk.RenderChunk; //导入依赖的package包/类
@Override
public void onBlockRenderInLoop(final RenderChunk renderChunk, final Block block, final IBlockState state, final BlockPos pos) {
if(renderers != null) try {
renderers.computeIfPresent(renderChunk, (chk, info) -> info.compute(() -> {
GeometryTessellator tess = info.getTessellator();
if (tess != null && FastReflection.Fields.BufferBuilder_isDrawing.get(tess.getBuffer(), false)) {
BlockEntry blockEntry = options.get(state);
if(blockEntry != null
&& blockEntry.getReadableProperty(BoundProperty.class).isWithinBoundaries(pos.getY())) {
AxisAlignedBB bb = state.getSelectedBoundingBox(Helper.getWorld(), pos);
GeometryTessellator.drawLines(
tess.getBuffer(),
bb.minX, bb.minY, bb.minZ,
bb.maxX, bb.maxY, bb.maxZ,
GeometryMasks.Line.ALL,
blockEntry.getReadableProperty(ColorProperty.class).getAsBuffer()
);
info.incrementRenderCount();
}
}
}));
} catch (Exception e) {
handleException(renderChunk, e);
}
}
示例3: renderChunkLayer
import net.minecraft.client.renderer.chunk.RenderChunk; //导入依赖的package包/类
public void renderChunkLayer(BlockRenderLayer layer)
{
if (this.initialized)
{
for (RenderChunk renderchunk : this.renderChunks)
{
ListedRenderChunk listedrenderchunk = (ListedRenderChunk)renderchunk;
GlStateManager.pushMatrix();
this.preRenderChunk(renderchunk);
GlStateManager.callList(listedrenderchunk.getDisplayList(layer, listedrenderchunk.getCompiledChunk()));
GlStateManager.popMatrix();
}
GlStateManager.resetColor();
this.renderChunks.clear();
}
}
示例4: createRenderChunks
import net.minecraft.client.renderer.chunk.RenderChunk; //导入依赖的package包/类
protected void createRenderChunks(IRenderChunkFactory renderChunkFactory)
{
int i = this.countChunksX * this.countChunksY * this.countChunksZ;
this.renderChunks = new RenderChunk[i];
int j = 0;
for (int k = 0; k < this.countChunksX; ++k)
{
for (int l = 0; l < this.countChunksY; ++l)
{
for (int i1 = 0; i1 < this.countChunksZ; ++i1)
{
int j1 = (i1 * this.countChunksY + l) * this.countChunksX + k;
BlockPos blockpos = new BlockPos(k * 16, l * 16, i1 * 16);
this.renderChunks[j1] = renderChunkFactory.makeRenderChunk(this.world, this.renderGlobal, blockpos, j++);
}
}
}
}
示例5: renderChunkLayer
import net.minecraft.client.renderer.chunk.RenderChunk; //导入依赖的package包/类
public void renderChunkLayer(EnumWorldBlockLayer layer)
{
if (this.initialized)
{
for (RenderChunk renderchunk : this.renderChunks)
{
VertexBuffer vertexbuffer = renderchunk.getVertexBufferByLayer(layer.ordinal());
GlStateManager.pushMatrix();
this.preRenderChunk(renderchunk);
renderchunk.multModelviewMatrix();
vertexbuffer.bindBuffer();
this.setupArrayPointers();
vertexbuffer.drawArrays(7);
GlStateManager.popMatrix();
}
OpenGlHelper.glBindBuffer(OpenGlHelper.GL_ARRAY_BUFFER, 0);
GlStateManager.resetColor();
this.renderChunks.clear();
}
}
示例6: updateChunkLight
import net.minecraft.client.renderer.chunk.RenderChunk; //导入依赖的package包/类
private void updateChunkLight(RenderChunk p_updateChunkLight_1_, Set<BlockPos> p_updateChunkLight_2_, Set<BlockPos> p_updateChunkLight_3_)
{
if (p_updateChunkLight_1_ != null)
{
CompiledChunk compiledchunk = p_updateChunkLight_1_.getCompiledChunk();
if (compiledchunk != null && !compiledchunk.isEmpty())
{
p_updateChunkLight_1_.setNeedsUpdate(true);
}
BlockPos blockpos = p_updateChunkLight_1_.getPosition();
if (p_updateChunkLight_2_ != null)
{
p_updateChunkLight_2_.remove(blockpos);
}
if (p_updateChunkLight_3_ != null)
{
p_updateChunkLight_3_.add(blockpos);
}
}
}
示例7: renderChunkLayer
import net.minecraft.client.renderer.chunk.RenderChunk; //导入依赖的package包/类
public void renderChunkLayer(BlockRenderLayer layer)
{
if (this.initialized)
{
for (RenderChunk renderchunk : this.renderChunks)
{
net.minecraft.client.renderer.vertex.VertexBuffer vertexbuffer = renderchunk.getVertexBufferByLayer(layer.ordinal());
GlStateManager.pushMatrix();
this.preRenderChunk(renderchunk);
renderchunk.multModelviewMatrix();
vertexbuffer.bindBuffer();
this.setupArrayPointers();
vertexbuffer.drawArrays(7);
GlStateManager.popMatrix();
}
OpenGlHelper.glBindBuffer(OpenGlHelper.GL_ARRAY_BUFFER, 0);
GlStateManager.resetColor();
this.renderChunks.clear();
}
}
示例8: updateChunkPositions
import net.minecraft.client.renderer.chunk.RenderChunk; //导入依赖的package包/类
public void updateChunkPositions(double viewEntityX, double viewEntityZ)
{
int i = MathHelper.floor(viewEntityX) - 8;
int j = MathHelper.floor(viewEntityZ) - 8;
int k = this.countChunksX * 16;
for (int l = 0; l < this.countChunksX; ++l)
{
int i1 = this.getBaseCoordinate(i, k, l);
for (int j1 = 0; j1 < this.countChunksZ; ++j1)
{
int k1 = this.getBaseCoordinate(j, k, j1);
for (int l1 = 0; l1 < this.countChunksY; ++l1)
{
int i2 = l1 * 16;
RenderChunk renderchunk = this.renderChunks[(j1 * this.countChunksY + l1) * this.countChunksX + l];
renderchunk.setPosition(i1, i2, k1);
}
}
}
}
示例9: allocateRenderInformation
import net.minecraft.client.renderer.chunk.RenderChunk; //导入依赖的package包/类
private RenderGlobal.ContainerLocalRenderInformation allocateRenderInformation(RenderChunk p_allocateRenderInformation_1_, EnumFacing p_allocateRenderInformation_2_, int p_allocateRenderInformation_3_)
{
RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation;
if (renderInfoCache.isEmpty())
{
renderglobal$containerlocalrenderinformation = new RenderGlobal.ContainerLocalRenderInformation(p_allocateRenderInformation_1_, p_allocateRenderInformation_2_, p_allocateRenderInformation_3_);
}
else
{
renderglobal$containerlocalrenderinformation = (RenderGlobal.ContainerLocalRenderInformation)renderInfoCache.pollLast();
renderglobal$containerlocalrenderinformation.initialize(p_allocateRenderInformation_1_, p_allocateRenderInformation_2_, p_allocateRenderInformation_3_);
}
renderglobal$containerlocalrenderinformation.cacheable = true;
return renderglobal$containerlocalrenderinformation;
}
示例10: updateChunkPositions
import net.minecraft.client.renderer.chunk.RenderChunk; //导入依赖的package包/类
public void updateChunkPositions(double viewEntityX, double viewEntityZ)
{
int i = MathHelper.floor_double(viewEntityX) - 8;
int j = MathHelper.floor_double(viewEntityZ) - 8;
int k = this.countChunksX * 16;
for (int l = 0; l < this.countChunksX; ++l)
{
int i1 = this.getBaseCoordinate(i, k, l);
for (int j1 = 0; j1 < this.countChunksZ; ++j1)
{
int k1 = this.getBaseCoordinate(j, k, j1);
for (int l1 = 0; l1 < this.countChunksY; ++l1)
{
int i2 = l1 * 16;
RenderChunk renderchunk = this.renderChunks[(j1 * this.countChunksY + l1) * this.countChunksX + l];
renderchunk.setPosition(i1, i2, k1);
}
}
}
}
示例11: updateChunkLight
import net.minecraft.client.renderer.chunk.RenderChunk; //导入依赖的package包/类
private void updateChunkLight(RenderChunk p_updateChunkLight_1_, Set<BlockPos> p_updateChunkLight_2_, Set<BlockPos> p_updateChunkLight_3_)
{
if (p_updateChunkLight_1_ != null)
{
CompiledChunk compiledchunk = p_updateChunkLight_1_.getCompiledChunk();
if (compiledchunk != null && !compiledchunk.isEmpty())
{
p_updateChunkLight_1_.setNeedsUpdate(false);
}
BlockPos blockpos = p_updateChunkLight_1_.getPosition().toImmutable();
if (p_updateChunkLight_2_ != null)
{
p_updateChunkLight_2_.remove(blockpos);
}
if (p_updateChunkLight_3_ != null)
{
p_updateChunkLight_3_.add(blockpos);
}
}
}
示例12: updateChunks
import net.minecraft.client.renderer.chunk.RenderChunk; //导入依赖的package包/类
public void updateChunks(long finishTimeNano)
{
this.displayListEntitiesDirty |= this.renderDispatcher.runChunkUploads(finishTimeNano);
if (!this.chunksToUpdate.isEmpty())
{
Iterator<RenderChunk> iterator = this.chunksToUpdate.iterator();
while (iterator.hasNext())
{
RenderChunk renderchunk = (RenderChunk)iterator.next();
boolean flag;
if (renderchunk.isNeedsUpdateCustom())
{
flag = this.renderDispatcher.updateChunkNow(renderchunk);
}
else
{
flag = this.renderDispatcher.updateChunkLater(renderchunk);
}
if (!flag)
{
break;
}
renderchunk.clearNeedsUpdate();
iterator.remove();
long i = finishTimeNano - System.nanoTime();
if (i < 0L)
{
break;
}
}
}
}
示例13: onLoadRenderers
import net.minecraft.client.renderer.chunk.RenderChunk; //导入依赖的package包/类
@SubscribeEvent
public void onLoadRenderers(LoadRenderersEvent event) {
try {
setRenderers(new Renderers());
setCache(new TesselatorCache(VERTEX_BUFFER_COUNT, VERTEX_BUFFER_SIZE));
// allocate all space needed
for (RenderChunk renderChunk : event.getViewFrustum().renderChunks) {
renderers.register(renderChunk);
}
} catch (Exception e) {
handleException(null, e);
}
}
示例14: deleteGlResources
import net.minecraft.client.renderer.chunk.RenderChunk; //导入依赖的package包/类
public void deleteGlResources()
{
for (RenderChunk renderchunk : this.renderChunks)
{
renderchunk.deleteGlResources();
}
}
示例15: updateChunkPositions
import net.minecraft.client.renderer.chunk.RenderChunk; //导入依赖的package包/类
public void updateChunkPositions(double viewEntityX, double viewEntityZ)
{
int i = MathHelper.floor_double(viewEntityX) - 8;
int j = MathHelper.floor_double(viewEntityZ) - 8;
int k = this.countChunksX * 16;
for (int l = 0; l < this.countChunksX; ++l)
{
int i1 = this.func_178157_a(i, k, l);
for (int j1 = 0; j1 < this.countChunksZ; ++j1)
{
int k1 = this.func_178157_a(j, k, j1);
for (int l1 = 0; l1 < this.countChunksY; ++l1)
{
int i2 = l1 * 16;
RenderChunk renderchunk = this.renderChunks[(j1 * this.countChunksY + l1) * this.countChunksX + l];
BlockPos blockpos = new BlockPos(i1, i2, k1);
if (!blockpos.equals(renderchunk.getPosition()))
{
renderchunk.setPosition(blockpos);
}
}
}
}
}