本文整理汇总了Java中net.minecraft.client.model.ModelChest.renderAll方法的典型用法代码示例。如果您正苦于以下问题:Java ModelChest.renderAll方法的具体用法?Java ModelChest.renderAll怎么用?Java ModelChest.renderAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.model.ModelChest
的用法示例。
在下文中一共展示了ModelChest.renderAll方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderChest
import net.minecraft.client.model.ModelChest; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public static void renderChest(ItemStack stack, float lidAngle) {
ModelChest modelChest = new ModelChest();
GlStateManager.color(1, 1, 1, 1);
RenderUtils.bindTexture(getChestType(stack).modelTexture);
GlStateManager.pushMatrix();
GlStateManager.enableRescaleNormal();
GlStateManager.color(1, 1, 1, 1);
GlStateManager.translate(0, 1.0, 1.0F);
GlStateManager.scale(1.0F, -1.0F, -1.0F);
GlStateManager.translate(0.5F, 0.5F, 0.5F);
GlStateManager.rotate(2 * 90, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, -0.5F);
modelChest.chestLid.rotateAngleX = lidAngle;
modelChest.renderAll();
GlStateManager.popMatrix();
}
示例2: render
import net.minecraft.client.model.ModelChest; //导入方法依赖的package包/类
@Override
public void render( EntityLivingBase entity, ItemStack stack, String modName, float par2, float par3, float par4, float par5, float par6, float par7 )
{
TextureManager re = Minecraft.getMinecraft().getTextureManager();
EquipmentItem equipment = ( EquipmentItem ) stack.getItem();
BackpackModifier mod = ( BackpackModifier ) Modifier.getModifier( modName );
ClientUtils.bindTexture( mod.getModelTexture( equipment.equipment.getModifierLevel( stack, modName ) ) );
ModelChest chest = new ModelChest();
GL11.glScalef( 0.5f, 0.5f, 0.5f );
GL11.glRotatef( 180, 0, 1, 0 );
GL11.glTranslatef( -0.5f, 0, -0.75f );
chest.renderAll();
}
示例3: render
import net.minecraft.client.model.ModelChest; //导入方法依赖的package包/类
public void render(BlockARChest chestBlock, boolean isDouble, double x, double y, double z)
{
ModelChest chestModel = null;
//ModelLargeChest largeModel = null;
if (!isDouble)
{
chestModel = this.chestModel;
Minecraft.getMinecraft().renderEngine.bindTexture(((BlockARChest)chestBlock).getSmallTexture());
}
else
{
chestModel = this.largeChestModel;
Minecraft.getMinecraft().renderEngine.bindTexture(((BlockARChest)chestBlock).getLargeTexture());
}
GL11.glPushMatrix();
//GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glTranslatef((float) x, (float) y + 1.0F, (float) z + 1.0F);
GL11.glScalef(1.0F, -1.0F, -1.0F);
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
GL11.glRotated(-90, 0, 1, 0);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
chestModel.renderAll();
//GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
示例4: renderTileEntityChestAt
import net.minecraft.client.model.ModelChest; //导入方法依赖的package包/类
/**
* Renders the TileEntity for the chest at a position.
*/
public void renderTileEntityChestAt(TileEntityHauntedChest te, double x, double y, double z, float par8) {
int metadata = 0;
if(te == null) {
te = CHEST_TE;
}
GL11.glPushMatrix();
if (te.hasWorld()) {
metadata = te.getBlockMetadata();
} else {
GL11.glRotatef(45, 0, 1, 0);
GL11.glScalef(0.6F, 0.6F, 0.6F);
GL11.glTranslatef((float) x + 0.2F, (float) y + 0.3F, (float) z);
}
ModelChest modelchest = this.chestModel;
if (this.isChristmas) {
this.bindTexture(Resources.CHRISTMAS_CHEST);
} else {
this.bindTexture(Resources.DEFAULT_CHEST);
}
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1, 1, 1, 1);
GL11.glTranslatef((float) x, (float) y + 1, (float) z + 1);
GL11.glScalef(1, -1, -1);
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
float direction = 0;
switch (metadata) {
case 2:
direction = 180;
break;
case 3:
direction = 0;
break;
case 4:
direction = 90;
break;
case 5:
direction = -90;
break;
}
GL11.glRotatef(direction, 0, 1, 0);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
float f1 = te.prevLidAngle + (te.lidAngle - te.prevLidAngle) * par8;
f1 = 1 - f1;
f1 = 1 - f1 * f1 * f1;
modelchest.chestLid.rotateAngleX = -(f1 * (float) Math.PI / 2F);
modelchest.renderAll();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
GL11.glColor4f(1, 1, 1, 1);
}
示例5: renderTileEntityAt
import net.minecraft.client.model.ModelChest; //导入方法依赖的package包/类
@Override
public void renderTileEntityAt(TileEntityLimitableChest te, double x, double y, double z, float partialTicks, int destroyStage, IBlockState state) {
GlStateManager.enableDepth();
GlStateManager.depthFunc(515);
GlStateManager.depthMask(true);
int i;
if (te == null)
te = TileEntityLimitableChestRenderer.te;
if (!te.hasWorld()) {
i = 0;
} else {
i = te.getBlockMetadata();
}
ModelChest modelchest;
modelchest = this.simpleChest;
if (destroyStage >= 0) {
this.bindTexture(DESTROY_STAGES[destroyStage]);
GlStateManager.matrixMode(5890);
GlStateManager.pushMatrix();
GlStateManager.scale(4.0F, 4.0F, 1.0F);
GlStateManager.translate(0.0625F, 0.0625F, 0.0625F);
GlStateManager.matrixMode(5888);
}
this.bindTexture(textureNormal);
GlStateManager.pushMatrix();
GlStateManager.enableRescaleNormal();
if (destroyStage < 0) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
GlStateManager.translate((float) x, (float) y + 1.0F, (float) z + 1.0F);
GlStateManager.scale(1.0F, -1.0F, -1.0F);
GlStateManager.translate(0.5F, 0.5F, 0.5F);
int j = 0;
if (i == 2) {
j = 180;
}
if (i == 3) {
j = 0;
}
if (i == 4) {
j = 90;
}
if (i == 5) {
j = -90;
}
GlStateManager.rotate(j, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, -0.5F);
float f = te.prevLidAngle + (te.lidAngle - te.prevLidAngle) * partialTicks;
f = 1.0F - f;
f = 1.0F - f * f * f;
modelchest.chestLid.rotateAngleX = -(f * (float) Math.PI / 2.0F);
modelchest.renderAll();
GlStateManager.disableRescaleNormal();
GlStateManager.popMatrix();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
if (destroyStage >= 0) {
GlStateManager.matrixMode(5890);
GlStateManager.popMatrix();
GlStateManager.matrixMode(5888);
}
}
示例6: doRender
import net.minecraft.client.model.ModelChest; //导入方法依赖的package包/类
public void doRender(EntityMinecart entityMinecart, double xCoord, double yCoord, double zCoord, float p_76986_8_,
float p_76986_9_) {
GL11.glPushMatrix();
this.bindEntityTexture(entityMinecart);
long i = (long)entityMinecart.getEntityId() * 493286711L;
i = i * i * 4392167121L + i * 98761L;
float f2 = (((float)(i >> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F;
float f3 = (((float)(i >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F;
float f4 = (((float)(i >> 24 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F;
GL11.glTranslatef(f2, f3, f4);
double d3 = entityMinecart.lastTickPosX + (entityMinecart.posX - entityMinecart.lastTickPosX) * (double)p_76986_9_;
double d4 = entityMinecart.lastTickPosY + (entityMinecart.posY - entityMinecart.lastTickPosY) * (double)p_76986_9_;
double d5 = entityMinecart.lastTickPosZ + (entityMinecart.posZ - entityMinecart.lastTickPosZ) * (double)p_76986_9_;
double d6 = 0.30000001192092896D;
Vec3 vec3 = entityMinecart.func_70489_a(d3, d4, d5);
float f5 = entityMinecart.prevRotationPitch + (entityMinecart.rotationPitch - entityMinecart.prevRotationPitch) * p_76986_9_;
if (vec3 != null) {
Vec3 vec31 = entityMinecart.func_70495_a(d3, d4, d5, d6);
Vec3 vec32 = entityMinecart.func_70495_a(d3, d4, d5, -d6);
if (vec31 == null) {
vec31 = vec3;
}
if (vec32 == null) {
vec32 = vec3;
}
xCoord += vec3.xCoord - d3;
yCoord += (vec31.yCoord + vec32.yCoord) / 2.0D - d4;
zCoord += vec3.zCoord - d5;
Vec3 vec33 = vec32.addVector(-vec31.xCoord, -vec31.yCoord, -vec31.zCoord);
if (vec33.lengthVector() != 0.0D) {
vec33 = vec33.normalize();
p_76986_8_ = (float)(Math.atan2(vec33.zCoord, vec33.xCoord) * 180.0D / Math.PI);
f5 = (float)(Math.atan(vec33.yCoord) * 73.0D);
}
}
GL11.glTranslatef((float)xCoord, (float)yCoord, (float)zCoord);
GL11.glRotatef(180.0F - p_76986_8_, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-f5, 0.0F, 0.0F, 1.0F);
float f7 = (float)entityMinecart.getRollingAmplitude() - p_76986_9_;
float f8 = entityMinecart.getDamage() - p_76986_9_;
if (f8 < 0.0F) {
f8 = 0.0F;
}
if (f7 > 0.0F) {
GL11.glRotatef(MathHelper.sin(f7) * f7 * f8 / 10.0F * (float)entityMinecart.getRollingDirection(), 1.0F, 0.0F, 0.0F);
}
int k = entityMinecart.getDisplayTileOffset();
GL11.glPushMatrix();
ModelChest modelChest = new ModelChest();
this.bindTexture(Resources.Model.LEADED_CHEST);
GL11.glRotatef(-90, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(180, 0.0F, 0.0F, 1.0F);
GL11.glTranslatef(-0.38F, -0.65F, -0.38F);
float f6 = 0.75F;
GL11.glScalef(f6, f6, f6);
modelChest.chestLid.rotateAngleX = 0;
modelChest.renderAll();
GL11.glTranslatef(0.0F, (float) k / 16.0F, 0.0F);
GL11.glPopMatrix();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.bindEntityTexture(entityMinecart);
GL11.glScalef(-1.0F, -1.0F, 1.0F);
this.modelMinecart.render(entityMinecart, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
GL11.glPopMatrix();
}
示例7: renderTileEntityChestAt
import net.minecraft.client.model.ModelChest; //导入方法依赖的package包/类
/**
* Renders the TileEntity for the chest at a position.
*/
public void renderTileEntityChestAt(TileSortingChest par1TileEntityChest, double par2, double par4, double par6, float par8)
{
int i;
if (!par1TileEntityChest.hasWorldObj())
{
i = 0;
}
else
{
i = par1TileEntityChest.getFacing();
}
ModelChest modelchest = this.chestModel;
if (MinecraftForgeClient.getRenderPass() == 0)
{
bindTexture(RES_NORMAL_SINGLE);
}
else
{
bindTexture(Resources.MODEL_TEXTURE_OVERLAY_CHEST);
}
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glTranslatef((float) par2, (float) par4 + 1.0F, (float) par6 + 1.0F);
GL11.glScalef(1.0F, -1.0F, -1.0F);
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
short short1 = 0;
if (i == 2)
{
short1 = 180;
}
if (i == 3)
{
short1 = 0;
}
if (i == 4)
{
short1 = 90;
}
if (i == 5)
{
short1 = -90;
}
GL11.glRotatef((float) short1, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
float f1 = par1TileEntityChest.prevLidAngle + (par1TileEntityChest.lidAngle - par1TileEntityChest.prevLidAngle) * par8;
f1 = 1.0F - f1;
f1 = 1.0F - f1 * f1 * f1;
modelchest.chestLid.rotateAngleX = -(f1 * (float) Math.PI / 2.0F);
modelchest.renderAll();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
示例8: renderTETravelingChestAt
import net.minecraft.client.model.ModelChest; //导入方法依赖的package包/类
/**
* Renders the TileEntity for the chest at a position.
*/
public void renderTETravelingChestAt(TETravelingChest par1TileEntityChest,
double par2, double par4, double par6, float par8) {
int i;
if (!par1TileEntityChest.hasWorldObj()) {
i = 0;
} else {
i = par1TileEntityChest.getBlockMetadata();
}
ModelChest modelchest;
modelchest = this.chestModel;
this.bindTexture(texture);
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glTranslatef((float) par2, (float) par4 + 1.0F,
(float) par6 + 1.0F);
GL11.glScalef(1.0F, -1.0F, -1.0F);
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
short short1 = 0;
if (i == 2) {
short1 = 180;
}
if (i == 3) {
short1 = 0;
}
if (i == 4) {
short1 = 90;
}
if (i == 5) {
short1 = -90;
}
GL11.glRotatef(short1, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
float f1 = par1TileEntityChest.prevLidAngle
+ (par1TileEntityChest.lidAngle - par1TileEntityChest.prevLidAngle)
* par8;
f1 = 1.0F - f1;
f1 = 1.0F - f1 * f1 * f1;
modelchest.chestLid.rotateAngleX = -(f1 * (float) Math.PI / 2.0F);
modelchest.renderAll();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}