Search in sources :

Example 41 with IBakedModel

use of net.minecraft.client.renderer.block.model.IBakedModel in project EnderIO by SleepyTrousers.

the class BlockPaintedTrapDoor method mapItemRender.

@Override
@SideOnly(Side.CLIENT)
public List<IBakedModel> mapItemRender(@Nonnull Block block, @Nonnull ItemStack stack) {
    IBlockState paintSource = getPaintSource(block, stack);
    IBlockState stdOverlay = ModObject.block_machine_base.getBlockNN().getDefaultState().withProperty(EnumRenderPart.SUB, EnumRenderPart.PAINT_OVERLAY);
    IBakedModel model1 = PaintRegistry.getModel(IBakedModel.class, "trapdoor_bottom", paintSource, null);
    IBakedModel model2 = PaintRegistry.getModel(IBakedModel.class, "trapdoor_bottom", stdOverlay, PaintRegistry.OVERLAY_TRANSFORMATION3);
    List<IBakedModel> list = new ArrayList<IBakedModel>();
    list.add(model1);
    list.add(model2);
    return list;
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) ArrayList(java.util.ArrayList) IBakedModel(net.minecraft.client.renderer.block.model.IBakedModel) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 42 with IBakedModel

use of net.minecraft.client.renderer.block.model.IBakedModel in project EnderIO by SleepyTrousers.

the class BlockPaintedWall method mapItemRender.

@Override
@SideOnly(Side.CLIENT)
public List<IBakedModel> mapItemRender(@Nonnull Block block, @Nonnull ItemStack stack) {
    IBlockState paintSource = getPaintSource(block, stack);
    IBlockState stdOverlay = ModObject.block_machine_base.getBlockNN().getDefaultState().withProperty(EnumRenderPart.SUB, EnumRenderPart.PAINT_OVERLAY);
    IBakedModel model1 = PaintRegistry.getModel(IBakedModel.class, "wall_inventory", paintSource, new UVLock(null));
    IBakedModel model2 = PaintRegistry.getModel(IBakedModel.class, "wall_inventory", stdOverlay, PaintRegistry.OVERLAY_TRANSFORMATION2);
    List<IBakedModel> list = new ArrayList<IBakedModel>();
    list.add(model1);
    list.add(model2);
    return list;
}
Also used : UVLock(crazypants.enderio.base.paint.render.UVLock) IBlockState(net.minecraft.block.state.IBlockState) ArrayList(java.util.ArrayList) IBakedModel(net.minecraft.client.renderer.block.model.IBakedModel) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 43 with IBakedModel

use of net.minecraft.client.renderer.block.model.IBakedModel in project EnderIO by SleepyTrousers.

the class BlockPaintedDoor method mapItemRender.

@Override
@SideOnly(Side.CLIENT)
public List<IBakedModel> mapItemRender(@Nonnull Block block, @Nonnull ItemStack stack) {
    IBlockState paintSource = getPaintSource(block, stack);
    IBlockState stdOverlay = ModObject.block_machine_base.getBlockNN().getDefaultState().withProperty(EnumRenderPart.SUB, EnumRenderPart.PAINT_OVERLAY);
    IBakedModel model1 = PaintRegistry.getModel(IBakedModel.class, "door_inventory", paintSource, null);
    IBakedModel model2 = PaintRegistry.getModel(IBakedModel.class, "door_inventory", stdOverlay, PaintRegistry.OVERLAY_TRANSFORMATION3);
    List<IBakedModel> list = new ArrayList<IBakedModel>();
    list.add(model1);
    list.add(model2);
    return list;
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) ArrayList(java.util.ArrayList) IBakedModel(net.minecraft.client.renderer.block.model.IBakedModel) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 44 with IBakedModel

use of net.minecraft.client.renderer.block.model.IBakedModel in project EnderIO by SleepyTrousers.

the class BlockPaintedFence method mapItemRender.

@Override
@SideOnly(Side.CLIENT)
public List<IBakedModel> mapItemRender(@Nonnull Block block, @Nonnull ItemStack stack) {
    IBlockState paintSource = getPaintSource(block, stack);
    IBlockState stdOverlay = ModObject.block_machine_base.getBlockNN().getDefaultState().withProperty(EnumRenderPart.SUB, EnumRenderPart.PAINT_OVERLAY);
    IBakedModel model1 = PaintRegistry.getModel(IBakedModel.class, "fence_inventory", paintSource, new UVLock(null));
    IBakedModel model2 = PaintRegistry.getModel(IBakedModel.class, "fence_inventory", stdOverlay, PaintRegistry.OVERLAY_TRANSFORMATION2);
    List<IBakedModel> list = new ArrayList<IBakedModel>();
    list.add(model1);
    list.add(model2);
    return list;
}
Also used : UVLock(crazypants.enderio.base.paint.render.UVLock) IBlockState(net.minecraft.block.state.IBlockState) ArrayList(java.util.ArrayList) IBakedModel(net.minecraft.client.renderer.block.model.IBakedModel) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 45 with IBakedModel

use of net.minecraft.client.renderer.block.model.IBakedModel in project HorsePower by GoryMoon.

the class TileEntityHPBaseRenderer method renderBaseModel.

protected void renderBaseModel(TileEntityHPBase te, Tessellator tessellator, BufferBuilder buffer, double x, double y, double z) {
    // Most of this is blatantly copied from FastTESR
    setRenderSettings();
    IBlockState blockState = te.getWorld().getBlockState(te.getPos());
    BlockRendererDispatcher dispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
    IBakedModel model = dispatcher.getModelForState(blockState);
    buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
    buffer.setTranslation(-te.getPos().getX(), -te.getPos().getY(), -te.getPos().getZ());
    dispatcher.getBlockModelRenderer().renderModel(te.getWorld(), model, blockState, te.getPos(), buffer, false);
    buffer.setTranslation(0, 0, 0);
    GlStateManager.pushMatrix();
    GlStateManager.translate(x, y, z);
    tessellator.draw();
    GlStateManager.popMatrix();
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) IBakedModel(net.minecraft.client.renderer.block.model.IBakedModel)

Aggregations

IBakedModel (net.minecraft.client.renderer.block.model.IBakedModel)197 IBlockState (net.minecraft.block.state.IBlockState)94 BakedQuad (net.minecraft.client.renderer.block.model.BakedQuad)42 BlockPos (net.minecraft.util.math.BlockPos)40 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)38 EnumFacing (net.minecraft.util.EnumFacing)38 ResourceLocation (net.minecraft.util.ResourceLocation)36 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)30 ItemStack (net.minecraft.item.ItemStack)27 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)24 Block (net.minecraft.block.Block)23 IModel (net.minecraftforge.client.model.IModel)22 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)22 ArrayList (java.util.ArrayList)20 IExtendedBlockState (net.minecraftforge.common.property.IExtendedBlockState)17 Minecraft (net.minecraft.client.Minecraft)15 BlockRendererDispatcher (net.minecraft.client.renderer.BlockRendererDispatcher)15 List (java.util.List)14 ItemOverride (net.minecraft.client.renderer.block.model.ItemOverride)14 ImmutableList (com.google.common.collect.ImmutableList)13