本文整理汇总了Java中net.minecraft.tileentity.TileEntity.getDistanceSq方法的典型用法代码示例。如果您正苦于以下问题:Java TileEntity.getDistanceSq方法的具体用法?Java TileEntity.getDistanceSq怎么用?Java TileEntity.getDistanceSq使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.tileentity.TileEntity
的用法示例。
在下文中一共展示了TileEntity.getDistanceSq方法的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);
}
}
示例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);
}
}
示例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);
}
}