当前位置: 首页>>代码示例>>Java>>正文


Java TileEntity.getMaxRenderDistanceSquared方法代码示例

本文整理汇总了Java中net.minecraft.tileentity.TileEntity.getMaxRenderDistanceSquared方法的典型用法代码示例。如果您正苦于以下问题:Java TileEntity.getMaxRenderDistanceSquared方法的具体用法?Java TileEntity.getMaxRenderDistanceSquared怎么用?Java TileEntity.getMaxRenderDistanceSquared使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.tileentity.TileEntity的用法示例。


在下文中一共展示了TileEntity.getMaxRenderDistanceSquared方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderTileEntity

import net.minecraft.tileentity.TileEntity; //导入方法依赖的package包/类
public void renderTileEntity(TileEntity tileentityIn, float partialTicks, int destroyStage)
{
    if (tileentityIn.getDistanceSq(this.entityX, this.entityY, this.entityZ) < tileentityIn.getMaxRenderDistanceSquared())
    {
        RenderHelper.enableStandardItemLighting();
        boolean flag = true;

        if (Reflector.ForgeTileEntity_hasFastRenderer.exists())
        {
            flag = !this.drawingBatch || !Reflector.callBoolean(tileentityIn, Reflector.ForgeTileEntity_hasFastRenderer, new Object[0]);
        }

        if (flag)
        {
            int i = this.worldObj.getCombinedLight(tileentityIn.getPos(), 0);
            int j = i % 65536;
            int k = i / 65536;
            OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j, (float)k);
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        }

        BlockPos blockpos = tileentityIn.getPos();
        this.renderTileEntityAt(tileentityIn, (double)blockpos.getX() - staticPlayerX, (double)blockpos.getY() - staticPlayerY, (double)blockpos.getZ() - staticPlayerZ, partialTicks, destroyStage);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:TileEntityRendererDispatcher.java

示例2: renderTileEntity

import net.minecraft.tileentity.TileEntity; //导入方法依赖的package包/类
public void renderTileEntity(TileEntity tileentityIn, float partialTicks, int destroyStage)
{
    if (tileentityIn.getDistanceSq(this.entityX, this.entityY, this.entityZ) < tileentityIn.getMaxRenderDistanceSquared())
    {
        RenderHelper.enableStandardItemLighting();
        if(!drawingBatch || !tileentityIn.hasFastRenderer())
        {
        int i = this.worldObj.getCombinedLight(tileentityIn.getPos(), 0);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j, (float)k);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        }
        BlockPos blockpos = tileentityIn.getPos();
        this.renderTileEntityAt(tileentityIn, (double)blockpos.getX() - staticPlayerX, (double)blockpos.getY() - staticPlayerY, (double)blockpos.getZ() - staticPlayerZ, partialTicks, destroyStage);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:TileEntityRendererDispatcher.java

示例3: renderTileEntity

import net.minecraft.tileentity.TileEntity; //导入方法依赖的package包/类
public void renderTileEntity(TileEntity tileentityIn, float partialTicks, int destroyStage)
{
    if (tileentityIn.getDistanceSq(this.entityX, this.entityY, this.entityZ) < tileentityIn.getMaxRenderDistanceSquared())
    {
        int i = this.worldObj.getCombinedLight(tileentityIn.getPos(), 0);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        BlockPos blockpos = tileentityIn.getPos();
        this.renderTileEntityAt(tileentityIn, (double)blockpos.getX() - staticPlayerX, (double)blockpos.getY() - staticPlayerY, (double)blockpos.getZ() - staticPlayerZ, partialTicks, destroyStage);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:TileEntityRendererDispatcher.java


注:本文中的net.minecraft.tileentity.TileEntity.getMaxRenderDistanceSquared方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。