Search in sources :

Example 6 with BakedQuad

use of net.minecraft.client.renderer.model.BakedQuad in project Overloaded by CJ-MC-Mods.

the class ModelUtils method renderQuads.

public static void renderQuads(List<BakedQuad> listQuads) {
    Tessellator tessellator = Tessellator.getInstance();
    BufferBuilder vertexbuffer = tessellator.getBuilder();
    int i = 0;
    vertexbuffer.begin(7, DefaultVertexFormats.BLOCK);
    for (int j = listQuads.size(); i < j; ++i) {
        BakedQuad bakedquad = listQuads.get(i);
        // vertexbuffer.putBulkData(bakedquad);
        vertexbuffer.color(1, 1, 1, 1);
        Vector3i vec3i = bakedquad.getDirection().getNormal();
        vertexbuffer.normal((float) vec3i.getX(), (float) vec3i.getY(), (float) vec3i.getZ());
    }
    tessellator.end();
}
Also used : BakedQuad(net.minecraft.client.renderer.model.BakedQuad) Tessellator(net.minecraft.client.renderer.Tessellator) BufferBuilder(net.minecraft.client.renderer.BufferBuilder) Vector3i(net.minecraft.util.math.vector.Vector3i)

Example 7 with BakedQuad

use of net.minecraft.client.renderer.model.BakedQuad in project AgriCraft by AgriCraft.

the class BotanyPotsPlantRenderer method fetchQuads.

protected List<BakedQuad> fetchQuads(IAgriPlant plant, IAgriGrowthStage stage, Direction... sides) {
    List<BakedQuad> quads = Lists.newArrayList();
    for (Direction dir : sides) {
        quads.addAll(AgriPlantModelBridge.getOrBakeQuads(plant, stage, dir));
    }
    quads.addAll(AgriPlantModelBridge.getOrBakeQuads(plant, stage, null));
    return quads;
}
Also used : BakedQuad(net.minecraft.client.renderer.model.BakedQuad) Direction(net.minecraft.util.Direction)

Aggregations

BakedQuad (net.minecraft.client.renderer.model.BakedQuad)7 Direction (net.minecraft.util.Direction)4 Nonnull (javax.annotation.Nonnull)2 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)2 VertexFormatElement (net.minecraft.client.renderer.vertex.VertexFormatElement)2 IModelData (net.minecraftforge.client.model.data.IModelData)2 BakedQuadBuilder (net.minecraftforge.client.model.pipeline.BakedQuadBuilder)2 IVertexConsumer (net.minecraftforge.client.model.pipeline.IVertexConsumer)2 VertexTransformer (net.minecraftforge.client.model.pipeline.VertexTransformer)2 TileBPMultipart (com.bluepowermod.tile.TileBPMultipart)1 TileWire (com.bluepowermod.tile.tier1.TileWire)1 MultipartUtils (com.bluepowermod.util.MultipartUtils)1 IAgriPlant (com.infinityraider.agricraft.api.v1.plant.IAgriPlant)1 ITessellator (com.infinityraider.infinitylib.render.tessellation.ITessellator)1 Pair (com.mojang.datafixers.util.Pair)1 java.util (java.util)1 Collectors (java.util.stream.Collectors)1 Nullable (javax.annotation.Nullable)1 BlockState (net.minecraft.block.BlockState)1 Minecraft (net.minecraft.client.Minecraft)1