Java Code Examples for net.minecraft.client.renderer.block.model.ItemCameraTransforms#TransformType

The following examples show how to use net.minecraft.client.renderer.block.model.ItemCameraTransforms#TransformType . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LayerTofunianHeldItem.java    From TofuCraftReload with MIT License 6 votes vote down vote up
private void renderHeldItem(EntityLivingBase p_188358_1_, ItemStack p_188358_2_, ItemCameraTransforms.TransformType p_188358_3_, EnumHandSide handSide)
{
    if (!p_188358_2_.isEmpty())
    {
        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.
        this.translateToHand(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) / 60.0F, 0.125F, -0.25F);
        Minecraft.getMinecraft().getItemRenderer().renderItemSide(p_188358_1_, p_188358_2_, p_188358_3_, flag);
        GlStateManager.popMatrix();
    }
}
 
Example 2
Source File: RenderCyberlimbHand.java    From Cyberware with MIT License 6 votes vote down vote up
public void renderItemSide(EntityLivingBase entitylivingbaseIn, ItemStack heldStack, ItemCameraTransforms.TransformType transform, boolean p_187462_4_)
{
	if (heldStack != null)
	{
		Item item = heldStack.getItem();
		Block block = Block.getBlockFromItem(item);
		GlStateManager.pushMatrix();
		boolean flag = this.itemRenderer.shouldRenderItemIn3D(heldStack) && this.isBlockTranslucent(block);

		if (flag)
		{
			GlStateManager.depthMask(false);
		}

		this.itemRenderer.renderItem(heldStack, entitylivingbaseIn, transform, p_187462_4_);

		if (flag)
		{
			GlStateManager.depthMask(true);
		}

		GlStateManager.popMatrix();
	}
}
 
Example 3
Source File: RenderChannelValve.java    From AgriCraft with MIT License 5 votes vote down vote up
@Override
public void renderInventoryBlockWood(ITessellator tessellator, World world, IBlockState state, BlockWaterChannelValve block, TileEntityChannelValve tile,
        ItemStack stack, EntityLivingBase entity, ItemCameraTransforms.TransformType type, TextureAtlasSprite icon) {

    final TextureAtlasSprite sepIcon = BaseIcons.IRON_BLOCK.getIcon();

    //Render channel.
    tessellator.drawScaledPrism(2, 4, 4, 14, 12, 5, icon);
    tessellator.drawScaledPrism(2, 4, 11, 14, 12, 12, icon);
    tessellator.drawScaledPrism(2, 4, 5, 14, 5, 11, icon);

    //Render separators.
    tessellator.drawScaledPrism(0.001f, 11.5f, 5, 1.999f, 15.001f, 11, sepIcon);
    tessellator.drawScaledPrism(0.001f, 0.999f, 5, 1.999f, 5.5f, 11, sepIcon);
    tessellator.drawScaledPrism(14.001f, 11.5f, 5, 15.999f, 15.001f, 11, sepIcon);
    tessellator.drawScaledPrism(14.001f, 0.999f, 5, 15.999f, 5.5f, 11, sepIcon);

    //render the wooden guide rails along z-axis
    tessellator.drawScaledPrism(0, 0, 3.999F, 2, 16, 5.999F, icon);
    tessellator.translate(0, 0, 6 * Constants.UNIT);
    tessellator.drawScaledPrism(0, 0, 3.999F, 2, 16, 5.999F, icon);
    tessellator.translate(14 * Constants.UNIT, 0, 0);
    tessellator.drawScaledPrism(0, 0, 3.999F, 2, 16, 5.999F, icon);
    tessellator.translate(0, 0, -6 * Constants.UNIT);
    tessellator.drawScaledPrism(0, 0, 3.999F, 2, 16, 5.999F, icon);
    tessellator.translate(-14 * Constants.UNIT, 0, 0);
}
 
Example 4
Source File: RenderSprinkler.java    From AgriCraft with MIT License 5 votes vote down vote up
@Override
public void renderInventoryBlock(ITessellator tess, World world, IBlockState state, BlockSprinkler block, TileEntitySprinkler tile, ItemStack stack, EntityLivingBase entity, ItemCameraTransforms.TransformType type) {
    // Save translation matrix.
    tess.pushMatrix();
    
    // Translate to connect to above channel.
    tess.translate(0, -4 * Constants.UNIT, 0);
    
    // Render parts.
    this.renderConnector(tess, tile.getChannelIcon());
    this.renderHead(tess, 0, tile.getHeadIcon());
    
    // Reset matrix.
    tess.popMatrix();
}
 
Example 5
Source File: RenderTank.java    From AgriCraft with MIT License 5 votes vote down vote up
@Override
protected void renderInventoryBlockWood(ITessellator tess, World world, IBlockState state, BlockWaterTank block, TileEntityTank tile,
        ItemStack stack, EntityLivingBase entity, ItemCameraTransforms.TransformType type, TextureAtlasSprite sprite) {
    renderSide(tess, EnumFacing.NORTH, (byte)0, sprite);
    renderSide(tess, EnumFacing.EAST, (byte)0, sprite);
    renderSide(tess, EnumFacing.SOUTH, (byte)0, sprite);
    renderSide(tess, EnumFacing.WEST, (byte)0, sprite);
    renderBottom(tess, (byte)0, sprite);
}
 
Example 6
Source File: RenderBlockGrate.java    From AgriCraft with MIT License 5 votes vote down vote up
@Override
public void renderInventoryBlockWood(ITessellator tessellator, World world, IBlockState state, BlockGrate block, TileEntityGrate tile,
        ItemStack stack, EntityLivingBase entity, ItemCameraTransforms.TransformType type, TextureAtlasSprite icon) {
    tessellator.drawScaledPrism(7, 0, 1, 9, 16, 3, icon);
    tessellator.drawScaledPrism(7, 0, 5, 9, 16, 7, icon);
    tessellator.drawScaledPrism(7, 0, 9, 9, 16, 11, icon);
    tessellator.drawScaledPrism(7, 0, 13, 9, 16, 15, icon);
    tessellator.drawScaledPrism(7, 1, 0, 9, 3, 16, icon);
    tessellator.drawScaledPrism(7, 5, 0, 9, 7, 16, icon);
    tessellator.drawScaledPrism(7, 9, 0, 9, 11, 16, icon);
    tessellator.drawScaledPrism(7, 13, 0, 9, 15, 16, icon);
}
 
Example 7
Source File: ModelEnderBucket.java    From enderutilities with GNU Lesser General Public License v3.0 5 votes vote down vote up
public BakedEnderBucket(ModelEnderBucket parent, ImmutableList<BakedQuad> quads, TextureAtlasSprite particle, VertexFormat format,
        ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transforms, Map<String, IBakedModel> cache)
{
    this.quads = quads;
    this.particle = particle;
    this.format = format;
    this.parent = parent;
    this.transforms = transforms;
    this.cache = cache;
}
 
Example 8
Source File: InfuserCoreBakedModel.java    From Valkyrien-Skies with Apache License 2.0 5 votes vote down vote up
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(
    ItemCameraTransforms.TransformType cameraTransformType) {
    switch (cameraTransformType) {
        case GUI:
            return inventoryModel.handlePerspective(cameraTransformType);
        default:
            return handModel.handlePerspective(cameraTransformType);
    }
}
 
Example 9
Source File: BakedWrapper.java    From TFC2 with GNU General Public License v3.0 4 votes vote down vote up
public Perspective(IBakedModel parent, ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transforms) {
	super(parent);
	this.transforms = transforms;
}
 
Example 10
Source File: BakedWrapper.java    From TFC2 with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
	return IPerspectiveAwareModel.MapWrapper.handlePerspective(this, transforms, cameraTransformType);
}
 
Example 11
Source File: MixinHaloRenderItem.java    From VanillaFix with MIT License 4 votes vote down vote up
@Inject(method = "renderItem", at = @At("HEAD"), remap = false)
private void onRenderItem(ItemStack stack, ItemCameraTransforms.TransformType transformType, CallbackInfo ci) {
    if (stack.getItem() instanceof IHaloRenderItem) {
        ((IPatchedTextureAtlasSprite) ((IHaloRenderItem) stack.getItem()).getHaloTexture(stack)).markNeedsAnimationUpdate();
    }
}
 
Example 12
Source File: GTModelUtils.java    From GT-Classic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public static Matrix4f getItemTransform(ItemCameraTransforms.TransformType type) {
	Matrix4f mat = TRANSFORM_MAP_ITEM.get(type);
	return mat != null ? mat : TRSRTransformation.identity().getMatrix();
}
 
Example 13
Source File: RenderSeedAnalyzer.java    From AgriCraft with MIT License 4 votes vote down vote up
@Override
public void renderInventoryBlock(ITessellator tessellator, World world, IBlockState state, BlockSeedAnalyzer block, TileEntitySeedAnalyzer tile,
        ItemStack stack, EntityLivingBase entity, ItemCameraTransforms.TransformType type) {
    renderModel(tessellator, EnumFacing.NORTH, true);
}
 
Example 14
Source File: RenderBlockCustomWood.java    From AgriCraft with MIT License 4 votes vote down vote up
@Override
public final void renderInventoryBlock(ITessellator tessellator, World world, IBlockState state, B block, T tile,
        ItemStack stack, EntityLivingBase entity, ItemCameraTransforms.TransformType type) {
    tile.setMaterial(stack);
    this.renderInventoryBlockWood(tessellator, world, state, block, tile, stack, entity, type, getIcon(tile));
}
 
Example 15
Source File: RenderBlockCustomWood.java    From AgriCraft with MIT License 4 votes vote down vote up
protected abstract void renderInventoryBlockWood(ITessellator tess, World world, IBlockState state, B block, T tile,
ItemStack stack, EntityLivingBase entity, ItemCameraTransforms.TransformType type, TextureAtlasSprite icon);
 
Example 16
Source File: GTBakedTestTube.java    From GT-Classic with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(
		ItemCameraTransforms.TransformType cameraTransformType) {
	return Pair.of(this, GTModelUtils.getItemTransform(cameraTransformType));
}
 
Example 17
Source File: RenderSeedStorage.java    From AgriCraft with MIT License 4 votes vote down vote up
@Override
protected void renderInventoryBlockWood(ITessellator tess, World world, IBlockState state, BlockSeedStorage block, TileEntitySeedStorage tile,
        ItemStack stack, EntityLivingBase entity, ItemCameraTransforms.TransformType type, TextureAtlasSprite icon) {
    renderSides(tess, icon);
}
 
Example 18
Source File: RenderCrop.java    From AgriCraft with MIT License 4 votes vote down vote up
@Override
public void renderInventoryBlock(ITessellator tessellator, World world, IBlockState state, BlockCrop block, TileEntityCrop tile,
        ItemStack stack, EntityLivingBase entity, ItemCameraTransforms.TransformType type) {

}
 
Example 19
Source File: RenderPeripheral.java    From AgriCraft with MIT License 4 votes vote down vote up
@Override
public void renderInventoryBlock(ITessellator tessellator, World world, IBlockState state, BlockPeripheral block, TileEntityPeripheral tile,
        ItemStack stack, EntityLivingBase entity, ItemCameraTransforms.TransformType type) {
    renderChasis(tessellator);
    renderProbe(tessellator);
}
 
Example 20
Source File: MixinItemRenderer.java    From LiquidBounce with GNU General Public License v3.0 4 votes vote down vote up
@Shadow
public abstract void renderItem(EntityLivingBase entityIn, ItemStack heldStack, ItemCameraTransforms.TransformType transform);