private void renderHeldItem(EntityObj entityObj, ItemStack itemStack, ItemCameraTransforms.TransformType cameraTransforms, EnumHandSide handSide)
{
if (!itemStack.isEmpty())
{
GlStateManager.pushMatrix();
if (entityObj.isSneaking())
{
GlStateManager.translate(0.0F, 0.2F, 0.0F);
}
objRenderer.transformToHandAndRotateAndScale(handSide);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(-180.0F, 0.0F, 1.0F, 0.0F);
boolean flag = handSide == EnumHandSide.LEFT;
Minecraft.getMinecraft().getItemRenderer().renderItemSide(entityObj, itemStack, cameraTransforms, flag);
GlStateManager.popMatrix();
}
}
java类net.minecraft.client.renderer.block.model.ItemCameraTransforms的实例源码
LayerHeldItemAnimated.java 文件源码
项目:ObsidianSuite
阅读 19
收藏 0
点赞 0
评论 0
ModelSpellPage.java 文件源码
项目:Infernum
阅读 21
收藏 0
点赞 0
评论 0
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType cameraTransformType) {
if (baseSpellPageModel instanceof IPerspectiveAwareModel) {
Matrix4f matrix4f = ((IPerspectiveAwareModel) baseSpellPageModel).handlePerspective(cameraTransformType)
.getRight();
return Pair.of(this, matrix4f);
}
ItemCameraTransforms itemCameraTransforms = baseSpellPageModel.getItemCameraTransforms();
ItemTransformVec3f itemTransformVec3f = itemCameraTransforms.getTransform(cameraTransformType);
TRSRTransformation tr = new TRSRTransformation(itemTransformVec3f);
Matrix4f mat = null;
if (tr != null) {
mat = tr.getMatrix();
}
return Pair.of(this, mat);
}
BlockModelUtils.java 文件源码
项目:Backmemed
阅读 24
收藏 0
点赞 0
评论 0
public static IBakedModel makeModelCube(TextureAtlasSprite p_makeModelCube_0_, int p_makeModelCube_1_)
{
List list = new ArrayList();
EnumFacing[] aenumfacing = EnumFacing.VALUES;
Map<EnumFacing, List<BakedQuad>> map = new HashMap();
for (int i = 0; i < aenumfacing.length; ++i)
{
EnumFacing enumfacing = aenumfacing[i];
List list1 = new ArrayList();
list1.add(makeBakedQuad(enumfacing, p_makeModelCube_0_, p_makeModelCube_1_));
map.put(enumfacing, list1);
}
ItemOverrideList itemoverridelist = new ItemOverrideList(new ArrayList());
IBakedModel ibakedmodel = new SimpleBakedModel(list, map, true, true, p_makeModelCube_0_, ItemCameraTransforms.DEFAULT, itemoverridelist);
return ibakedmodel;
}
BakedModelSpellPage.java 文件源码
项目:Infernum
阅读 27
收藏 0
点赞 0
评论 0
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType cameraTransformType) {
if (parentModel instanceof IPerspectiveAwareModel) {
Matrix4f matrix4f = ((IPerspectiveAwareModel) parentModel).handlePerspective(cameraTransformType)
.getRight();
return Pair.of(this, matrix4f);
}
ItemCameraTransforms itemCameraTransforms = parentModel.getItemCameraTransforms();
ItemTransformVec3f itemTransformVec3f = itemCameraTransforms.getTransform(cameraTransformType);
TRSRTransformation tr = new TRSRTransformation(itemTransformVec3f);
Matrix4f mat = null;
if (tr != null) {
mat = tr.getMatrix();
}
return Pair.of(this, mat);
}
DankNullRenderer.java 文件源码
项目:DankNull
阅读 22
收藏 0
点赞 0
评论 0
public void renderItem(ItemStack stack, IBakedModel model) {
if (!stack.isEmpty()) {
if (model.isBuiltInRenderer() && !(stack.getItem() instanceof ItemDankNullHolder)) {
Minecraft.getMinecraft().getItemRenderer().renderItem(EasyMappings.player(), stack, ItemCameraTransforms.TransformType.NONE);
}
else {
RenderModel.render(model, stack);
if (stack.hasEffect()) {
if ((stack.getItem() instanceof ItemDankNull)) {
if (!Options.superShine) {
GlintEffectRenderer.apply(model, stack.getItemDamage());
}
else {
GlintEffectRenderer.apply2(model, DankNullUtils.getColor(stack.getItemDamage(), false));
}
}
else {
GlintEffectRenderer.apply(model, -1);
}
}
}
}
}
RenderItem.java 文件源码
项目:DecompiledMinecraft
阅读 42
收藏 0
点赞 0
评论 0
protected void renderItemModelTransform(ItemStack stack, IBakedModel model, ItemCameraTransforms.TransformType cameraTransformType)
{
this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
this.textureManager.getTexture(TextureMap.locationBlocksTexture).setBlurMipmap(false, false);
this.preTransform(stack);
GlStateManager.enableRescaleNormal();
GlStateManager.alphaFunc(516, 0.1F);
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GlStateManager.pushMatrix();
ItemCameraTransforms itemcameratransforms = model.getItemCameraTransforms();
itemcameratransforms.applyTransform(cameraTransformType);
if (this.func_183005_a(itemcameratransforms.getTransform(cameraTransformType)))
{
GlStateManager.cullFace(1028);
}
this.renderItem(stack, model);
GlStateManager.cullFace(1029);
GlStateManager.popMatrix();
GlStateManager.disableRescaleNormal();
GlStateManager.disableBlend();
this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
this.textureManager.getTexture(TextureMap.locationBlocksTexture).restoreLastBlurMipmap();
}
RenderItem.java 文件源码
项目:DecompiledMinecraft
阅读 25
收藏 0
点赞 0
评论 0
public void renderItemIntoGUI(ItemStack stack, int x, int y)
{
IBakedModel ibakedmodel = this.itemModelMesher.getItemModel(stack);
GlStateManager.pushMatrix();
this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
this.textureManager.getTexture(TextureMap.locationBlocksTexture).setBlurMipmap(false, false);
GlStateManager.enableRescaleNormal();
GlStateManager.enableAlpha();
GlStateManager.alphaFunc(516, 0.1F);
GlStateManager.enableBlend();
GlStateManager.blendFunc(770, 771);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.setupGuiTransform(x, y, ibakedmodel.isGui3d());
ibakedmodel.getItemCameraTransforms().applyTransform(ItemCameraTransforms.TransformType.GUI);
this.renderItem(stack, ibakedmodel);
GlStateManager.disableAlpha();
GlStateManager.disableRescaleNormal();
GlStateManager.disableLighting();
GlStateManager.popMatrix();
this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
this.textureManager.getTexture(TextureMap.locationBlocksTexture).restoreLastBlurMipmap();
}
BlockModelUtils.java 文件源码
项目:BaseClient
阅读 20
收藏 0
点赞 0
评论 0
public static IBakedModel makeModelCube(TextureAtlasSprite p_makeModelCube_0_, int p_makeModelCube_1_)
{
List list = new ArrayList();
EnumFacing[] aenumfacing = EnumFacing.VALUES;
List list1 = new ArrayList(aenumfacing.length);
for (int i = 0; i < aenumfacing.length; ++i)
{
EnumFacing enumfacing = aenumfacing[i];
List list2 = new ArrayList();
list2.add(makeBakedQuad(enumfacing, p_makeModelCube_0_, p_makeModelCube_1_));
list1.add(list2);
}
IBakedModel ibakedmodel = new SimpleBakedModel(list, list1, true, true, p_makeModelCube_0_, ItemCameraTransforms.DEFAULT);
return ibakedmodel;
}
LayerHeldItem.java 文件源码
项目:CustomWorldGen
阅读 25
收藏 0
点赞 0
评论 0
private void renderHeldItem(EntityLivingBase p_188358_1_, ItemStack p_188358_2_, ItemCameraTransforms.TransformType p_188358_3_, EnumHandSide handSide)
{
if (p_188358_2_ != null)
{
GlStateManager.pushMatrix();
if (p_188358_1_.isSneaking())
{
GlStateManager.translate(0.0F, 0.2F, 0.0F);
}
// Forge: moved this call down, fixes incorrect offset while sneaking.
((ModelBiped)this.livingEntityRenderer.getMainModel()).postRenderArm(0.0625F, handSide);
GlStateManager.rotate(-90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
boolean flag = handSide == EnumHandSide.LEFT;
GlStateManager.translate((float)(flag ? -1 : 1) / 16.0F, 0.125F, -0.625F);
Minecraft.getMinecraft().getItemRenderer().renderItemSide(p_188358_1_, p_188358_2_, p_188358_3_, flag);
GlStateManager.popMatrix();
}
}
BlockModelUtils.java 文件源码
项目:BaseClient
阅读 24
收藏 0
点赞 0
评论 0
public static IBakedModel makeModelCube(TextureAtlasSprite p_makeModelCube_0_, int p_makeModelCube_1_)
{
List list = new ArrayList();
EnumFacing[] aenumfacing = EnumFacing.values();
List list1 = new ArrayList(aenumfacing.length);
for (int i = 0; i < aenumfacing.length; ++i)
{
EnumFacing enumfacing = aenumfacing[i];
List list2 = new ArrayList();
list2.add(makeBakedQuad(enumfacing, p_makeModelCube_0_, p_makeModelCube_1_));
list1.add(list2);
}
IBakedModel ibakedmodel = new SimpleBakedModel(list, list1, true, true, p_makeModelCube_0_, ItemCameraTransforms.DEFAULT);
return ibakedmodel;
}
ItemRenderer.java 文件源码
项目:Backmemed
阅读 24
收藏 0
点赞 0
评论 0
public void renderItemSide(EntityLivingBase entitylivingbaseIn, ItemStack heldStack, ItemCameraTransforms.TransformType transform, boolean leftHanded)
{
if (!heldStack.func_190926_b())
{
Item item = heldStack.getItem();
Block block = Block.getBlockFromItem(item);
GlStateManager.pushMatrix();
boolean flag = this.itemRenderer.shouldRenderItemIn3D(heldStack) && block.getBlockLayer() == BlockRenderLayer.TRANSLUCENT;
if (flag && (!Config.isShaders() || !Shaders.renderItemKeepDepthMask))
{
GlStateManager.depthMask(false);
}
this.itemRenderer.renderItem(heldStack, entitylivingbaseIn, transform, leftHanded);
if (flag)
{
GlStateManager.depthMask(true);
}
GlStateManager.popMatrix();
}
}
LayerHeldItem.java 文件源码
项目:CustomWorldGen
阅读 25
收藏 0
点赞 0
评论 0
public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
boolean flag = entitylivingbaseIn.getPrimaryHand() == EnumHandSide.RIGHT;
ItemStack itemstack = flag ? entitylivingbaseIn.getHeldItemOffhand() : entitylivingbaseIn.getHeldItemMainhand();
ItemStack itemstack1 = flag ? entitylivingbaseIn.getHeldItemMainhand() : entitylivingbaseIn.getHeldItemOffhand();
if (itemstack != null || itemstack1 != null)
{
GlStateManager.pushMatrix();
if (this.livingEntityRenderer.getMainModel().isChild)
{
float f = 0.5F;
GlStateManager.translate(0.0F, 0.625F, 0.0F);
GlStateManager.rotate(-20.0F, -1.0F, 0.0F, 0.0F);
GlStateManager.scale(0.5F, 0.5F, 0.5F);
}
this.renderHeldItem(entitylivingbaseIn, itemstack1, ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND, EnumHandSide.RIGHT);
this.renderHeldItem(entitylivingbaseIn, itemstack, ItemCameraTransforms.TransformType.THIRD_PERSON_LEFT_HAND, EnumHandSide.LEFT);
GlStateManager.popMatrix();
}
}
RenderItem.java 文件源码
项目:BaseClient
阅读 21
收藏 0
点赞 0
评论 0
public void renderItemIntoGUI(ItemStack stack, int x, int y)
{
IBakedModel ibakedmodel = this.itemModelMesher.getItemModel(stack);
GlStateManager.pushMatrix();
this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
this.textureManager.getTexture(TextureMap.locationBlocksTexture).setBlurMipmap(false, false);
GlStateManager.enableRescaleNormal();
GlStateManager.enableAlpha();
GlStateManager.alphaFunc(516, 0.1F);
GlStateManager.enableBlend();
GlStateManager.blendFunc(770, 771);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.setupGuiTransform(x, y, ibakedmodel.isGui3d());
ibakedmodel.getItemCameraTransforms().applyTransform(ItemCameraTransforms.TransformType.GUI);
this.renderItem(stack, ibakedmodel);
GlStateManager.disableAlpha();
GlStateManager.disableRescaleNormal();
GlStateManager.disableLighting();
GlStateManager.popMatrix();
this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
this.textureManager.getTexture(TextureMap.locationBlocksTexture).restoreLastBlurMipmap();
}
RenderHelper.java 文件源码
项目:Solar
阅读 20
收藏 0
点赞 0
评论 0
public static void renderItemStack(ItemStack stack) {
//Fix stack 'y' center
if(stack.getItem() instanceof ItemBlock) {
GlStateManager.translate(0F, -0.1F, 0F);
}
RenderItem render = Minecraft.getMinecraft().getRenderItem();
GlStateManager.pushAttrib();
net.minecraft.client.renderer.RenderHelper.enableStandardItemLighting();
render.renderItem(stack, ItemCameraTransforms.TransformType.GROUND);
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
GlStateManager.popAttrib();
}
ForgeHooksClient.java 文件源码
项目:CustomWorldGen
阅读 25
收藏 0
点赞 0
评论 0
@SuppressWarnings("deprecation")
public static IBakedModel handleCameraTransforms(IBakedModel model, ItemCameraTransforms.TransformType cameraTransformType, boolean leftHandHackery)
{
if(model instanceof IPerspectiveAwareModel)
{
Pair<? extends IBakedModel, Matrix4f> pair = ((IPerspectiveAwareModel)model).handlePerspective(cameraTransformType);
if(pair.getRight() != null)
{
Matrix4f matrix = new Matrix4f(pair.getRight());
if(leftHandHackery)
{
matrix.mul(flipX, matrix);
matrix.mul(matrix, flipX);
}
multiplyCurrentGlMatrix(matrix);
}
return pair.getLeft();
}
else
{
//if(leftHandHackery) GlStateManager.scale(-1, 1, 1);
ItemCameraTransforms.applyTransformSide(model.getItemCameraTransforms().getTransform(cameraTransformType), leftHandHackery);
//if(leftHandHackery) GlStateManager.scale(-1, 1, 1);
}
return model;
}
TESRPedestal.java 文件源码
项目:Infernum
阅读 26
收藏 0
点赞 0
评论 0
private void renderItem(TilePedestal te) {
ItemStack stack = te.getStack();
if (stack != null) {
RenderHelper.enableStandardItemLighting();
GlStateManager.enableLighting();
GlStateManager.pushMatrix();
GlStateManager.translate(0.5, 0.75, 0.5);
GlStateManager.scale(0.4F, .4F, 0.4F);
Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.NONE);
GlStateManager.popMatrix();
}
}
RenderCraftItem.java 文件源码
项目:uniquecrops
阅读 16
收藏 0
点赞 0
评论 0
private void renderItem(ItemStack stack) {
float toScale = stack.getItem() instanceof ItemBlock ? 0.25F : 0.4375F;
GlStateManager.scale(toScale, toScale, toScale);
float playerView = Minecraft.getMinecraft().getRenderManager().playerViewY;
GlStateManager.rotate(180.0F - playerView, 0, 1.0F, 0);
Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.NONE);
}
RenderProjectile.java 文件源码
项目:MeeCreeps
阅读 17
收藏 0
点赞 0
评论 0
@Override
public void doRender(T entity, double x, double y, double z, float entityYaw, float partialTicks) {
GlStateManager.pushMatrix();
GlStateManager.translate((float) x, (float) y, (float) z);
GlStateManager.enableRescaleNormal();
GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate((this.renderManager.options.thirdPersonView == 2 ? -1 : 1) * this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.disableLighting();
this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
if (this.renderOutlines) {
GlStateManager.enableColorMaterial();
GlStateManager.enableOutlineMode(this.getTeamColor(entity));
}
this.itemRenderer.renderItem(new ItemStack(ModItems.projectileItem), ItemCameraTransforms.TransformType.GROUND);
if (this.renderOutlines) {
GlStateManager.disableOutlineMode();
GlStateManager.disableColorMaterial();
}
GlStateManager.enableLighting();
GlStateManager.disableRescaleNormal();
GlStateManager.popMatrix();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
ToolHeadModel.java 文件源码
项目:Adventurers-Toolbox
阅读 25
收藏 0
点赞 0
评论 0
public BakedToolHeadModel(ToolHeadModel parent, ImmutableList<BakedQuad> quads, VertexFormat format,
ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transforms,
Map<String, IBakedModel> cache) {
this.quads = quads;
this.format = format;
this.parent = parent;
this.transforms = itemTransforms();
}
LayerSnowmanHead.java 文件源码
项目:CustomWorldGen
阅读 26
收藏 0
点赞 0
评论 0
public void doRenderLayer(EntitySnowman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (!entitylivingbaseIn.isInvisible() && !entitylivingbaseIn.isPumpkinEquipped())
{
GlStateManager.pushMatrix();
this.snowManRenderer.getMainModel().head.postRender(0.0625F);
float f = 0.625F;
GlStateManager.translate(0.0F, -0.34375F, 0.0F);
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.scale(0.625F, -0.625F, -0.625F);
Minecraft.getMinecraft().getItemRenderer().renderItem(entitylivingbaseIn, new ItemStack(Blocks.PUMPKIN, 1), ItemCameraTransforms.TransformType.HEAD);
GlStateManager.popMatrix();
}
}
GLHelper.java 文件源码
项目:ArcaneMagic
阅读 19
收藏 0
点赞 0
评论 0
public static void renderItemWithTransform(World world, ItemStack stack,
ItemCameraTransforms.TransformType transform)
{
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
GlStateManager.enableCull();
GlStateManager.depthMask(true);
RenderHelper.enableStandardItemLighting();
GlStateManager.enableAlpha();
GlStateManager.enableRescaleNormal();
GlStateManager.alphaFunc(516, 0.1F);
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA,
GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE,
GlStateManager.DestFactor.ZERO);
IBakedModel ibakedmodel = Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(stack, world,
(EntityLivingBase) null);
IBakedModel transformedModel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel,
transform, false);
Minecraft.getMinecraft().getRenderItem().renderItem(stack, transformedModel);
GlStateManager.disableBlend();
GlStateManager.disableAlpha();
RenderHelper.disableStandardItemLighting();
GlStateManager.depthMask(false);
GlStateManager.disableCull();
GlStateManager.popAttrib();
GlStateManager.popMatrix();
}
ArcaneTransfigurationTableTESR.java 文件源码
项目:ArcaneMagic
阅读 18
收藏 0
点赞 0
评论 0
private void renderItem(ItemStack stack, int slot)
{
if (stack != null && !stack.isEmpty())
{
int slotX = slot;
int slotY = 0;
if (slot >= 6)
{
slotX = slot - 6;
slotY = 2;
} else if (slot >= 3)
{
slotX = slot - 3;
slotY = 1;
}
RenderHelper.enableStandardItemLighting();
GlStateManager.enableLighting();
GlStateManager.pushMatrix();
GlStateManager.translate((slotX / 5.35d) + 0.315, .675, (slotY / 5.35d) + 0.315);
GlStateManager.scale(.1f, .1f, .1f);
if (!(stack.getItem() instanceof ItemBlock))
{
GlStateManager.rotate(-90, 1, 0, 0);
GlStateManager.translate(0, 0, -0.5);
}
Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.NONE);
GlStateManager.popMatrix();
}
}
SimpleBakedModel.java 文件源码
项目:DecompiledMinecraft
阅读 25
收藏 0
点赞 0
评论 0
public SimpleBakedModel(List<BakedQuad> p_i46077_1_, List<List<BakedQuad>> p_i46077_2_, boolean p_i46077_3_, boolean p_i46077_4_, TextureAtlasSprite p_i46077_5_, ItemCameraTransforms p_i46077_6_)
{
this.generalQuads = p_i46077_1_;
this.faceQuads = p_i46077_2_;
this.ambientOcclusion = p_i46077_3_;
this.gui3d = p_i46077_4_;
this.texture = p_i46077_5_;
this.cameraTransforms = p_i46077_6_;
}
SimpleBakedModel.java 文件源码
项目:DecompiledMinecraft
阅读 21
收藏 0
点赞 0
评论 0
private Builder(boolean p_i46076_1_, boolean p_i46076_2_, ItemCameraTransforms p_i46076_3_)
{
this.builderGeneralQuads = Lists.<BakedQuad>newArrayList();
this.builderFaceQuads = Lists.<List<BakedQuad>>newArrayListWithCapacity(6);
for (EnumFacing enumfacing : EnumFacing.values())
{
this.builderFaceQuads.add(Lists.<BakedQuad>newArrayList());
}
this.builderAmbientOcclusion = p_i46076_1_;
this.builderGui3d = p_i46076_2_;
this.builderCameraTransforms = p_i46076_3_;
}
RenderSnowball.java 文件源码
项目:DecompiledMinecraft
阅读 22
收藏 0
点赞 0
评论 0
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doe
*/
public void doRender(T entity, double x, double y, double z, float entityYaw, float partialTicks)
{
GlStateManager.pushMatrix();
GlStateManager.translate((float)x, (float)y, (float)z);
GlStateManager.enableRescaleNormal();
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
this.bindTexture(TextureMap.locationBlocksTexture);
this.field_177083_e.func_181564_a(this.func_177082_d(entity), ItemCameraTransforms.TransformType.GROUND);
GlStateManager.disableRescaleNormal();
GlStateManager.popMatrix();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
LayerSnowmanHead.java 文件源码
项目:DecompiledMinecraft
阅读 21
收藏 0
点赞 0
评论 0
public void doRenderLayer(EntitySnowman entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
if (!entitylivingbaseIn.isInvisible())
{
GlStateManager.pushMatrix();
this.snowManRenderer.getMainModel().head.postRender(0.0625F);
float f = 0.625F;
GlStateManager.translate(0.0F, -0.34375F, 0.0F);
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.scale(f, -f, -f);
Minecraft.getMinecraft().getItemRenderer().renderItem(entitylivingbaseIn, new ItemStack(Blocks.pumpkin, 1), ItemCameraTransforms.TransformType.HEAD);
GlStateManager.popMatrix();
}
}
RenderItem.java 文件源码
项目:DecompiledMinecraft
阅读 20
收藏 0
点赞 0
评论 0
public void func_181564_a(ItemStack p_181564_1_, ItemCameraTransforms.TransformType p_181564_2_)
{
if (p_181564_1_ != null)
{
IBakedModel ibakedmodel = this.itemModelMesher.getItemModel(p_181564_1_);
this.renderItemModelTransform(p_181564_1_, ibakedmodel, p_181564_2_);
}
}
ItemRenderer.java 文件源码
项目:DecompiledMinecraft
阅读 27
收藏 0
点赞 0
评论 0
public void renderItem(EntityLivingBase entityIn, ItemStack heldStack, ItemCameraTransforms.TransformType transform)
{
if (heldStack != null)
{
Item item = heldStack.getItem();
Block block = Block.getBlockFromItem(item);
GlStateManager.pushMatrix();
if (this.itemRenderer.shouldRenderItemIn3D(heldStack))
{
GlStateManager.scale(2.0F, 2.0F, 2.0F);
if (this.isBlockTranslucent(block))
{
GlStateManager.depthMask(false);
}
}
this.itemRenderer.renderItemModelForEntity(heldStack, entityIn, transform);
if (this.isBlockTranslucent(block))
{
GlStateManager.depthMask(true);
}
GlStateManager.popMatrix();
}
}
RenderMeltery.java 文件源码
项目:Meltery
阅读 23
收藏 0
点赞 0
评论 0
public void renderItem(double x, double y, double z, TileMeltery meltery) {
// calculate x/z parameters
double x1 = meltery.getPos().getX();
double y1 = meltery.getPos().getY();
double z1 = meltery.getPos().getZ();
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
RenderUtil.pre(x, y, z);
GlStateManager.translate(0.5,1/16d,0.5);
GlStateManager.disableCull();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
RenderHelper.enableStandardItemLighting();
int brightness = meltery.getWorld().getCombinedLight(meltery.getPos(), 0);
ItemStack stack = meltery.inventory.getStackInSlot(0);
boolean isItem = !(stack.getItem() instanceof ItemBlock);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) (brightness % 0x10000) / 1f,
(float) (brightness / 0x10000) / 1f);
if (isItem) {
GlStateManager.rotate(-90, 1, 0, 0);
} else {
GlStateManager.scale(0.5,0.5,0.5);
}
IBakedModel model = Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(stack, meltery.getWorld(), null);
model = ForgeHooksClient.handleCameraTransforms(model, ItemCameraTransforms.TransformType.NONE, false);
Minecraft.getMinecraft().getRenderItem().renderItem(stack, model);
if (isItem) {
GlStateManager.rotate(90, 1, 0, 0);
}
RenderHelper.enableStandardItemLighting();
GlStateManager.enableCull();
RenderUtil.post();
}
BakedToolModel.java 文件源码
项目:Adventurers-Toolbox
阅读 19
收藏 0
点赞 0
评论 0
public BakedToolModel(IModel parent, ImmutableList<BakedQuad> quads, VertexFormat format,
ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transforms,
Map<String, IBakedModel> cache) {
this.quads = quads;
this.format = format;
this.parent = parent;
this.transforms = itemTransforms();
this.cache = cache;
}