Search in sources :

Example 1 with EnumRenderPart

use of crazypants.enderio.base.render.property.EnumRenderPart in project EnderIO by SleepyTrousers.

the class MachineRenderMapper method mapItemRender.

@Override
@SideOnly(Side.CLIENT)
@Nullable
public List<Pair<IBlockState, ItemStack>> mapItemRender(@Nonnull Block block, @Nonnull ItemStack stack, @Nonnull ItemQuadCollector itemQuadCollector) {
    List<Pair<IBlockState, ItemStack>> states = new ArrayList<Pair<IBlockState, ItemStack>>();
    final EnumRenderPart body_nullchecked = body;
    if (body_nullchecked != null) {
        states.add(Pair.of(ModObject.block_machine_base.getBlockNN().getDefaultState().withProperty(EnumRenderPart.SUB, body_nullchecked), stack));
    }
    states.add(Pair.of(block.getStateFromMeta(stack.getMetadata()).withProperty(EnumRenderMode.RENDER, EnumRenderMode.FRONT), stack));
    return states;
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) ArrayList(java.util.ArrayList) EnumRenderPart(crazypants.enderio.base.render.property.EnumRenderPart) ItemStack(net.minecraft.item.ItemStack) Pair(org.apache.commons.lang3.tuple.Pair) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) Nullable(javax.annotation.Nullable)

Aggregations

EnumRenderPart (crazypants.enderio.base.render.property.EnumRenderPart)1 ArrayList (java.util.ArrayList)1 Nullable (javax.annotation.Nullable)1 IBlockState (net.minecraft.block.state.IBlockState)1 ItemStack (net.minecraft.item.ItemStack)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1 Pair (org.apache.commons.lang3.tuple.Pair)1