• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ITessellator类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中com.infinityraider.infinitylib.render.tessellation.ITessellator的典型用法代码示例。如果您正苦于以下问题:Java ITessellator类的具体用法?Java ITessellator怎么用?Java ITessellator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ITessellator类属于com.infinityraider.infinitylib.render.tessellation包,在下文中一共展示了ITessellator类的40个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: renderItem

点赞 3

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
public void renderItem(ITessellator tessellator, World world, ItemStack stack, EntityLivingBase entity) {
    final String id = item.getModelId(stack);
    List<BakedQuad> model = models.get(id);
    if (model == null) {
        InfinityLib.instance.getLogger().debug("Baking Item Model: " + id + "!");
        model = ItemQuadGenerator.generateItemQuads(
                DefaultVertexFormats.ITEM,
                tessellator::getIcon,
                item.getBaseTexture(stack),
                item.getOverlayTextures(stack)
        );
        models.put(id, model);
    }
    tessellator.addQuads(model);
}
 

开发者ID:InfinityRaider,
项目名称:InfinityLib,
代码行数:17,
代码来源:RenderItemAuto.java

示例2: renderSide

点赞 3

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
protected void renderSide(ITessellator tessellator, IBlockState state, EnumFacing dir, IrrigationConnectionType type, TextureAtlasSprite matIcon) {
    if (!type.isPrimary()) {
        return;
    }
    switch (dir) {
        case EAST:
            //positive x
            tessellator.drawScaledFace(5, 5, 11, 12, dir, matIcon, 16);
            break;
        case WEST:
            //negative x
            tessellator.drawScaledFace(5, 5, 11, 12, dir, matIcon, 0);
            break;
        case NORTH:
            //negative z
            tessellator.drawScaledFace(5, 5, 11, 12, dir, matIcon, 0);
            break;
        case SOUTH:
            //positive z
            tessellator.drawScaledFace(5, 5, 11, 12, dir, matIcon, 16);
            break;
    }
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:25,
代码来源:RenderChannelFull.java

示例3: renderWorldBlockStatic

点赞 3

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
public void renderWorldBlockStatic(ITessellator tessellator, IBlockState state, BlockWaterPad block, EnumFacing side) {
    // Icon
    final TextureAtlasSprite matIcon = BaseIcons.DIRT.getIcon();
    final TextureAtlasSprite waterIcon = BaseIcons.WATER_STILL.getIcon();

    // Check Full
    SidedConnection connection = state instanceof IExtendedBlockState ? ((IExtendedBlockState) state).getValue(AgriProperties.CONNECTIONS) : DEFAULT;

    // Draw Base
    renderBase(tessellator, matIcon);

    // Render Sides
    for (EnumFacing dir : EnumFacing.HORIZONTALS) {
        if (!connection.isConnected(dir)) {
            renderSide(tessellator, dir, matIcon);
        }
    }

    // Render Water
    if (AgriProperties.POWERED.getValue(state)) {
        renderWater(tessellator, waterIcon);
    }
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:25,
代码来源:RenderWaterPad.java

示例4: renderInventoryBlock

点赞 3

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
public void renderInventoryBlock(ITessellator tess, World world, IBlockState state, BlockWaterPad block,
        ItemStack stack, EntityLivingBase entity, ItemCameraTransforms.TransformType type) {

    // Icons
    final TextureAtlasSprite matIcon = BaseIcons.DIRT.getIcon();
    final TextureAtlasSprite waterIcon = BaseIcons.WATER_STILL.getIcon();

    // Draw Base
    renderBase(tess, matIcon);

    // Draw Sides
    for (EnumFacing dir : EnumFacing.HORIZONTALS) {
        renderSide(tess, dir, matIcon);
    }

    // Full
    if (AgriProperties.POWERED.getValue(state)) {
        renderWater(tess, waterIcon);
    }
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:22,
代码来源:RenderWaterPad.java

示例5: renderWorldBlockWoodDynamic

点赞 3

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
protected void renderWorldBlockWoodDynamic(ITessellator tess, World world, BlockPos pos, BlockGrate block,
        TileEntityGrate grate, TextureAtlasSprite sprite) {
    //vines
    final TextureAtlasSprite vinesIcon = BaseIcons.VINE.getIcon();
    int l = this.getMixedBrightness(grate.getWorld(), grate.getPos(), Blocks.VINE.getDefaultState());
    float f0 = (float) (l >> 16 & 255) / 255.0F;
    float f1 = (float) (l >> 8 & 255) / 255.0F;
    float f2 = (float) (l & 255) / 255.0F;
    tess.setColorRGB(f0, f1, f2);

    if (grate.hasVines(true)) {
        tess.drawScaledFaceDouble(0, 0, 16, 16, EnumFacing.NORTH, vinesIcon, 0.001f);
    }
    if (grate.hasVines(false)) {
        tess.drawScaledFaceDouble(0, 0, 16, 16, EnumFacing.NORTH, vinesIcon, 1.999f);
    }
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:19,
代码来源:RenderBlockGrate.java

示例6: renderWorldBlockWoodStatic

点赞 3

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
protected void renderWorldBlockWoodStatic(ITessellator tess, IExtendedBlockState state, BlockGrate block, EnumFacing side, TextureAtlasSprite sprite) {
    // Setup
    final float offset = AgriProperties.OFFSET.getValue(state).getOffset();

    // Offset
    tess.translate(0, 0, offset);

    // Draw Grate
    tess.drawScaledPrism(1, 0, 0, 3, 16, 2, sprite);
    tess.drawScaledPrism(5, 0, 0, 7, 16, 2, sprite);
    tess.drawScaledPrism(9, 0, 0, 11, 16, 2, sprite);
    tess.drawScaledPrism(13, 0, 0, 15, 16, 2, sprite);
    tess.drawScaledPrism(0, 1, 0, 16, 3, 2, sprite);
    tess.drawScaledPrism(0, 5, 0, 16, 7, 2, sprite);
    tess.drawScaledPrism(0, 9, 0, 16, 11, 2, sprite);
    tess.drawScaledPrism(0, 13, 0, 16, 15, 2, sprite);

}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:20,
代码来源:RenderBlockGrate.java

示例7: drawSeed

点赞 3

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
/**
 * Render the seed as TESR
 */
private void drawSeed(ITessellator tess, ItemStack seed) {
    if (seed == null || seed.getItem() == null) {
        return;
    }

    float dx = 8 * Constants.UNIT;
    float dy = 5 * Constants.UNIT;
    float dz = 0.99F * Constants.UNIT;
    float f = 0.75F;

    final VertexFormat format = tess.getVertexFormat();
    tess.draw();
    renderItemStack(seed, dx, dy, dz, f, false);
    tess.startDrawingQuads(format);
    tess.pushMatrix();
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:20,
代码来源:RenderSeedStorage.java

示例8: renderWorldBlockStatic

点赞 3

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
public void renderWorldBlockStatic(ITessellator tessellator, IBlockState state, BlockCrop block, EnumFacing side) {
    TextureAtlasSprite sprite = RenderCrop.getIcon(TEXTURE);
    this.renderBaseQuads(tessellator, side, sprite);
    if (state instanceof IExtendedBlockState) {
        IExtendedBlockState extendedState = (IExtendedBlockState) state;
        IAgriPlant plant = extendedState.getValue(AgriProperties.CROP_PLANT);
        int growthstage = extendedState.getValue(AgriProperties.GROWTH_STAGE);
        if (extendedState.getValue(AgriProperties.CROSS_CROP)) {
            tessellator.drawScaledPrism(0, 10, 2, 16, 11, 3, sprite);
            tessellator.drawScaledPrism(0, 10, 13, 16, 11, 14, sprite);
            tessellator.drawScaledPrism(2, 10, 0, 3, 11, 16, sprite);
            tessellator.drawScaledPrism(13, 10, 0, 14, 11, 16, sprite);
        }
        if (plant != null) {
            tessellator.addQuads(plant.getPlantQuads(extendedState, growthstage, side, tessellator));
        }
    }
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:20,
代码来源:RenderCrop.java

示例9: renderBaseQuads

点赞 3

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
private void renderBaseQuads(ITessellator tessellator, EnumFacing side, TextureAtlasSprite sprite) {
    int index = side == null ? EnumFacing.values().length : side.ordinal();
    boolean createQuads = false;
    if (!cropQuads.containsKey(tessellator.getVertexFormat())) {
        List<BakedQuad>[] lists = new List[EnumFacing.values().length + 1];
        cropQuads.put(tessellator.getVertexFormat(), lists);
        createQuads = true;
    } else if (cropQuads.get(tessellator.getVertexFormat())[index] == null) {
        createQuads = true;
    }
    if (createQuads) {
        tessellator.translate(0, -3 * Constants.UNIT, 0);
        tessellator.drawScaledPrism(2, 0, 2, 3, 16, 3, sprite);
        tessellator.drawScaledPrism(13, 0, 2, 14, 16, 3, sprite);
        tessellator.drawScaledPrism(13, 0, 13, 14, 16, 14, sprite);
        tessellator.drawScaledPrism(2, 0, 13, 3, 16, 14, sprite);
        tessellator.translate(0, 3 * Constants.UNIT, 0);
    } else {
        tessellator.addQuads(cropQuads.get(tessellator.getVertexFormat())[index]);
    }
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:22,
代码来源:RenderCrop.java

示例10: renderWorldBlockWoodDynamic

点赞 3

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
protected void renderWorldBlockWoodDynamic(ITessellator tessellator, World world, BlockPos pos, BlockWaterTank block,
        TileEntityTank tank, TextureAtlasSprite sprite) {
    //only render water on the bottom layer
    if (tank.getYPosition() == 0) {

        // -0.0001F to avoid Z-fighting on maximum filled tanks
        float y = tank.getFluidHeight() - A;

        // Calculate water brightness.
        final int l = RenderUtilBase.getMixedBrightness(tank.getWorld(), tank.getPos(), Blocks.WATER);
        tessellator.setBrightness(l);
        tessellator.setAlpha(0.39f);

        //draw surface
        final TextureAtlasSprite waterIcon = BaseIcons.WATER_STILL.getIcon();
        tessellator.drawScaledFace(0, 0, 16, 16, EnumFacing.UP, waterIcon, y);
    }
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:20,
代码来源:RenderTank.java

示例11: renderWorldBlockDynamic

点赞 3

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
public void renderWorldBlockDynamic(ITessellator tess, World world, BlockPos pos, double x, double y, double z,
                                    BlockSprinkler block, TileEntitySprinkler tile, float partialTick, int destroyStage, float alpha) {
    tess.pushMatrix();
    tess.translate(0.5F, 0, 0.5F);
    tess.rotate(tile.getAngle(), 0, 1, 0);
    tess.translate(-0.5F, 0, -0.5F);

    final TextureAtlasSprite icon = BaseIcons.IRON_BLOCK.getIcon();
    // Draw Core
    tess.drawScaledPrism(MIN_C, MIN_Y, MIN_C, MAX_C, MAX_Y, MAX_C, icon);
    // Draw Blades
    tess.drawScaledPrism(BMX_A, MIN_Y, MIN_C, BMX_B, BMX_Y, MAX_C, icon);
    tess.drawScaledPrism(MIN_C, MIN_Y, BMX_A, MAX_C, BMX_Y, BMX_B, icon);
    tess.popMatrix();
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:17,
代码来源:RenderSprinkler.java

示例12: renderConnector

点赞 3

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
private void renderConnector(ITessellator tessellator, EnumFacing dir, TextureAtlasSprite matIcon) {
    switch (dir) {
        case EAST:
            //positive x
            tessellator.drawScaledPrism(12, 4, 5, 16, 12, 11, matIcon);
            break;
        case WEST:
            //negative x
            tessellator.drawScaledPrism(0, 4, 5, 4, 12, 11, matIcon);
            break;
        case NORTH:
            //negative z
            tessellator.drawScaledPrism(5, 4, 0, 11, 12, 4, matIcon);
            break;
        case SOUTH:
            //positive z
            tessellator.drawScaledPrism(5, 4, 12, 11, 12, 16, matIcon);
            break;
    }
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:21,
代码来源:RenderChannelValve.java

示例13: renderParticle

点赞 3

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
public void renderParticle(BufferBuilder worldRenderer, Entity entity, float partialTicks, float f0, float f1, float f2, float f3, float f4) {
    ITessellator tessellator = TessellatorVertexBuffer.getInstance(worldRenderer);
    tessellator.draw();
    tessellator.startDrawingQuads(DefaultVertexFormats.BLOCK);

    float f6 = uMin;
    float f7 = uMax;
    float f8 = vMin;
    float f9 = vMax;
    float f10 = 0.1F * this.particleScale;
    float f11 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) f0 - interpPosX);
    float f12 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) f0 - interpPosY);
    float f13 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) f0 - interpPosZ);

    Minecraft.getMinecraft().renderEngine.bindTexture(this.texture);
    tessellator.setColorRGBA(1, 1, 1, 1);

    tessellator.addVertexWithUV((f11 - f1 * f10 - f4 * f10), (f12 - f2 * f10), (f13 - f3 * f10 - f6 * f10), f7, f9);
    tessellator.addVertexWithUV((f11 - f1 * f10 + f4 * f10), (f12 + f2 * f10), (f13 - f3 * f10 + f6 * f10), f7, f8);
    tessellator.addVertexWithUV((f11 + f1 * f10 + f4 * f10), (f12 + f2 * f10), (f13 + f3 * f10 + f6 * f10), f6, f8);
    tessellator.addVertexWithUV((f11 + f1 * f10 - f4 * f10), (f12 - f2 * f10), (f13 + f3 * f10 - f6 * f10), f6, f9);

    tessellator.draw();
    tessellator.startDrawingQuads(DefaultVertexFormats.BLOCK);
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:27,
代码来源:RuneFX.java

示例14: renderStemPlant

点赞 3

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
private static void renderStemPlant(ITessellator tessellator, TextureAtlasSprite vineIcon, TextureAtlasSprite fruitIcon, int stage) {
    int translation = stage >= 6 ? 0 : 5 - stage;
    tessellator.pushMatrix();
    tessellator.translate(0, -Constants.UNIT * 2 * translation, 0);
    if (stage >= Constants.MATURE) {
        //render the vines
        renderStemPattern(tessellator, vineIcon);
        //render the block
        tessellator.drawScaledPrism(7, 0, 2, 11, 4, 6, fruitIcon);
        tessellator.drawScaledPrism(10, 0, 7, 14, 4, 11, fruitIcon);
        tessellator.drawScaledPrism(5, 0, 10, 9, 4, 14, fruitIcon);
        tessellator.drawScaledPrism(2, 0, 5, 6, 4, 9, fruitIcon);
    } else {
        //render the vines
        renderCrossPattern(tessellator, vineIcon, 0);
    }
    tessellator.popMatrix();
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:19,
代码来源:PlantRenderer.java

示例15: addVertices

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
private void addVertices(ITessellator tessellator, TextureAtlasSprite icon) {
    //face-11 front
    tessellator.setNormal(-1, 0, 1);
    tessellator.addScaledVertexWithUV(0, 0, 0, icon, 0, 16);
    tessellator.addScaledVertexWithUV(16, 0, 16, icon, 16, 16);
    tessellator.addScaledVertexWithUV(16, 16, 16, icon, 16, 0);
    tessellator.addScaledVertexWithUV(0, 16, 0, icon, 0, 0);

    //face-11 back
    tessellator.setNormal(-1, 0, 1);
    tessellator.addScaledVertexWithUV(0, 0, 0, icon, 0, 16);
    tessellator.addScaledVertexWithUV(0, 16, 0, icon, 0, 0);
    tessellator.addScaledVertexWithUV(16, 16, 16, icon, 16, 0);
    tessellator.addScaledVertexWithUV(16, 0, 16, icon, 16, 16);

    //face-10 front
    tessellator.setNormal(1, 0, 1);
    tessellator.addScaledVertexWithUV(0, 0, 16, icon, 0, 16);
    tessellator.addScaledVertexWithUV(16, 0, 0, icon, 16, 16);
    tessellator.addScaledVertexWithUV(16, 16, 0, icon, 16, 0);
    tessellator.addScaledVertexWithUV(0, 16, 16, icon, 0, 0);

    //face-10 back
    tessellator.setNormal(-1, 0, -1);
    tessellator.addScaledVertexWithUV(0, 0, 16, icon, 0, 16);
    tessellator.addScaledVertexWithUV(0, 16, 16, icon, 0, 0);
    tessellator.addScaledVertexWithUV(16, 16, 0, icon, 16, 0);
    tessellator.addScaledVertexWithUV(16, 0, 0, icon, 16, 16);
}
 

开发者ID:InfinityRaider,
项目名称:NinjaGear,
代码行数:30,
代码来源:RenderBlockRope.java

示例16: renderItem

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
public void renderItem(ITessellator tessellator, World world, ItemStack stack, EntityLivingBase entity) {
    Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    TextureAtlasSprite sprite = tessellator.getIcon(TEXTURE);
    VertexFormat format = tessellator.getVertexFormat();

    //blade quads
    if(shouldRenderBlade(stack)) {
        renderBlade(tessellator);
    }

    //handle quads
    tessellator.addQuads(model.getBakedQuads(format, sprite, 8.0F * Constants.UNIT));
}
 

开发者ID:InfinityRaider,
项目名称:3DManeuverGear,
代码行数:15,
代码来源:RenderItemHandle.java

示例17: renderBlade

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
protected void renderBlade(ITessellator tessellator) {
    tessellator.pushMatrix();
    float dx = -0.4075F;
    float dy = -0.325F;
    float dz = 0.78F;
    tessellator.translate(dx, dy, dz);
    tessellator.rotate(90, 0, 1, 0);
    tessellator.rotate(45, 0, 0, 1);
    ItemStack swordBlade = ItemResource.EnumSubItems.SWORD_BLADE.getStack();
    IBakedModel model = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(swordBlade);
    tessellator.addQuads(model.getQuads(null, null, 0));
    tessellator.popMatrix();
}
 

开发者ID:InfinityRaider,
项目名称:3DManeuverGear,
代码行数:14,
代码来源:RenderItemHandle.java

示例18: drawBlockModel

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
public static void drawBlockModel(ITessellator tessellator, IBlockState state) {
    Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(state);
    for(EnumFacing facing : EnumFacing.values()) {
        drawQuads(TessellatorVertexBuffer.getInstance(), model.getQuads(state, facing, 0));
    }
    drawQuads(TessellatorVertexBuffer.getInstance(), model.getQuads(state, null, 0));
}
 

开发者ID:InfinityRaider,
项目名称:InfinityLib,
代码行数:9,
代码来源:RenderUtilBase.java

示例19: drawQuads

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
public static void drawQuads(ITessellator tessellator, List<BakedQuad> quads) {
    if(quads.size() > 0) {
        tessellator.startDrawingQuads(quads.get(0).getFormat());
        tessellator.addQuads(quads);
        tessellator.draw();
    }
}
 

开发者ID:InfinityRaider,
项目名称:InfinityLib,
代码行数:8,
代码来源:RenderUtilBase.java

示例20: rotateBlock

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
public static void rotateBlock(ITessellator tess, EnumFacing dir) {
    tess.translate(0.5f, 0, 0.5f);
    switch (dir) {
        case WEST:
            tess.rotate(270, 0, 1, 0);
            break;
        case NORTH:
            tess.rotate(180, 0, 1, 0);
            break;
        case EAST:
            tess.rotate(90, 0, 1, 0);
            break;
    }
    tess.translate(-0.5f, 0, -0.5f);
}
 

开发者ID:InfinityRaider,
项目名称:InfinityLib,
代码行数:16,
代码来源:RenderUtilBase.java

示例21: renderTileEntityAt

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
public void renderTileEntityAt(T te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
    
    // Fetch the tessellator instance.
    ITessellator tessellator = TessellatorVertexBuffer.getInstance();
    
    // Fetch world information.
    World world = te.getWorld();
    BlockPos pos = te.getPos();

    // Bind the textures used for block rendering.
    Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);

    // Save the translation matrix.
    GlStateManager.pushMatrix();
    
    // Translate to the location to render at.
    GlStateManager.translate(x, y, z);
    
    // Reset the tesselator's drawing color.
    tessellator.setColorRGBA(1, 1, 1, 1);

    // Start the tesselator drawing quads.
    tessellator.startDrawingQuads(DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);

    // Call the block renderer to render the block dynamically.
    this.getRenderer().renderWorldBlockDynamic(tessellator, world, pos, x, y, z, this.getBlock(), te, partialTicks, destroyStage, alpha);

    // Finish tesselator drawing quads.
    tessellator.draw();

    // Restore the translation matrix.
    GlStateManager.popMatrix();

}
 

开发者ID:InfinityRaider,
项目名称:InfinityLib,
代码行数:36,
代码来源:BlockWithTileRenderer.java

示例22: doRender

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
private void doRender(ITessellator tessellator, boolean dynamicRender) {
    tessellator.setApplyDiffuseLighting(true);
    if(!dynamicRender) {
        tessellator.setApplyDiffuseLighting(true);
        //tessellator.drawScaledFace(0, 0, 16, 16, EnumFacing.WEST, getIcon(), 0);
        tessellator.drawScaledPrism(0, 0, 0, 16, 16, 16, getIcon());
    } else {
        tessellator.setBrightness(15 << 24);
        //tessellator.drawScaledFace(0, 0, 16, 16, EnumFacing.WEST, getIcon(), 0);
        //tessellator.drawScaledPrism(0, 0, 0, 16, 16, 16, getIcon());
    }
}
 

开发者ID:InfinityRaider,
项目名称:SettlerCraft,
代码行数:13,
代码来源:RenderBlockTest.java

示例23: renderWorldBlockDynamic

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
public void renderWorldBlockDynamic(ITessellator tessellator, World world, BlockPos pos, double x, double y, double z,
                                    BlockPeripheral block, TileEntityPeripheral tile, float partialTick, int destroyStage, float alpha) {
    tessellator.draw();
    this.renderSeed(tile, 0, 0, 0);
    tessellator.startDrawingQuads(DefaultVertexFormats.BLOCK);
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:8,
代码来源:RenderPeripheral.java

示例24: renderChasis

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
private void renderChasis(ITessellator tessellator) {
    // Fetch Icons
    final TextureAtlasSprite iconTop = getIcon(TEXTURE_TOP);
    final TextureAtlasSprite iconSide = getIcon(TEXTURE_SIDE);
    final TextureAtlasSprite iconBottom = getIcon(TEXTURE_BOTTOM);
    final TextureAtlasSprite iconInside = getIcon(TEXTURE_INNER);
    
    // Render Top
    tessellator.drawScaledFace(0, 0, 16, 16, EnumFacing.UP, iconTop, 16);
    tessellator.drawScaledFace(0, 0, 16, 16, EnumFacing.DOWN, iconTop, 14);
    
    // Render Bottom
    tessellator.drawScaledFace(0, 0, 16, 16, EnumFacing.UP, iconInside, 2);
    tessellator.drawScaledFace(0, 0, 16, 16, EnumFacing.DOWN, iconBottom, 0);
    
    // Render Sides - Don't Ask Why This Works...
    for (EnumFacing side : EnumFacing.HORIZONTALS) {
        // Push Matrix
        tessellator.pushMatrix();
        // Rotate The Block
        rotateBlock(tessellator, side);
        // Render Outer Face
        tessellator.drawScaledFace(0, 0, 16, 16, EnumFacing.NORTH, iconSide, 0);
        // Render Inner Face
        tessellator.drawScaledFaceDouble(0, 0, 16, 16, EnumFacing.NORTH, iconInside, 4);
        // Pop Matrix
        tessellator.popMatrix();
    }
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:30,
代码来源:RenderPeripheral.java

示例25: renderProbe

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
private void renderProbe(ITessellator tessellator) {
    // Create Quads, If Needed
    if (probeQuads == null) {
        probeQuads = MODEL_PERIPHERAL.getBakedQuads(tessellator.getVertexFormat(), getIcon(TEXTURE_PROBE));
    }
    
    // Add Probe Quads
    tessellator.addQuads(probeQuads);
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:10,
代码来源:RenderPeripheral.java

示例26: renderBottom

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
protected void renderBottom(ITessellator tessellator, TextureAtlasSprite matIcon) {
    //draw bottom
    tessellator.drawScaledPrism(0, 0, 0, 16, 5, 16, matIcon);
    //draw top
    tessellator.drawScaledPrism(0, 12, 0, 16, 16, 16, matIcon);
    //draw four corners
    tessellator.drawScaledPrism(0, 5, 0, 5, 12, 5, matIcon);
    tessellator.drawScaledPrism(11, 5, 0, 16, 12, 5, matIcon);
    tessellator.drawScaledPrism(11, 5, 11, 16, 12, 16, matIcon);
    tessellator.drawScaledPrism(0, 5, 11, 5, 12, 16, matIcon);

}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:14,
代码来源:RenderChannelFull.java

示例27: renderInventoryBlockWood

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
protected void renderInventoryBlockWood(ITessellator tessellator, World world, IBlockState state, BlockWaterChannelFull block, TileEntityChannelFull channel,
        ItemStack stack, EntityLivingBase entity, ItemCameraTransforms.TransformType type, TextureAtlasSprite icon) {
    this.renderBottom(tessellator, icon);
    this.renderSide(tessellator, state, EnumFacing.NORTH, IrrigationConnectionType.PRIMARY, icon);
    this.renderSide(tessellator, state, EnumFacing.EAST, IrrigationConnectionType.PRIMARY, icon);
    this.renderSide(tessellator, state, EnumFacing.SOUTH, IrrigationConnectionType.PRIMARY, icon);
    this.renderSide(tessellator, state, EnumFacing.WEST, IrrigationConnectionType.PRIMARY, icon);
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:10,
代码来源:RenderChannelFull.java

示例28: renderSide

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
private static void renderSide(ITessellator tess, EnumFacing side, TextureAtlasSprite matIcon) {
    //data about side to render
    boolean xAxis = side.getAxis() == EnumFacing.Axis.X;
    int index = xAxis ? side.getFrontOffsetX() : side.getFrontOffsetZ();
    int min = index < 0 ? 0 : 15;
    int max = index < 0 ? 1 : 16;

    //render upper face
    tess.drawScaledFace(xAxis ? min : 0, xAxis ? 0 : min, xAxis ? max : 16, xAxis ? 16 : max, EnumFacing.UP, matIcon, 16);

    //render side
    tess.drawScaledFace(0, 8, 16, 16, side, matIcon, index > 0 ? 16 : 0);
    tess.drawScaledFace(0, 8, 16, 16, side.getOpposite(), matIcon, index > 0 ? 15 : 1);
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:15,
代码来源:RenderWaterPad.java

示例29: renderModel

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
private void renderModel(ITessellator tessellator, EnumFacing direction, boolean journal) {
    tessellator.pushMatrix();
    rotateBlock(tessellator, direction);
    if (analyzerQuads == null) {
        analyzerQuads = MODEL_ANALYZER.getBakedQuads(tessellator.getVertexFormat(), getIcon(TEXTURE_ANALYZER));
    }
    tessellator.addQuads(analyzerQuads);
    if (journal) {
        if (bookQuads == null) {
            bookQuads = MODEL_BOOK.getBakedQuads(tessellator.getVertexFormat(), getIcon(TEXTURE_ANALYZER));
        }
        tessellator.addQuads(bookQuads);
    }
    tessellator.popMatrix();
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:16,
代码来源:RenderSeedAnalyzer.java

示例30: renderWorldBlockDynamic

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
public void renderWorldBlockDynamic(ITessellator tessellator, World world, BlockPos pos, double x, double y, double z,
                                    BlockSeedAnalyzer block, TileEntitySeedAnalyzer tile, float partialTick, int destroyStage, float alpha) {
    tessellator.draw();
    this.renderSeed(tile, 0, 0, 0);
    tessellator.startDrawingQuads(DefaultVertexFormats.BLOCK);
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:8,
代码来源:RenderSeedAnalyzer.java

示例31: renderWorldBlockStatic

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
public void renderWorldBlockStatic(ITessellator tessellator, IBlockState state, B block, EnumFacing side) {
    if (state instanceof IExtendedBlockState) {
        CustomWoodType type = ((IExtendedBlockState) state).getValue(AgriProperties.CUSTOM_WOOD_TYPE);
        this.renderWorldBlockWoodStatic(tessellator, (IExtendedBlockState) state, block, side, type.getIcon());
    }
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:8,
代码来源:RenderBlockCustomWood.java

示例32: renderInventoryBlockWood

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@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);
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:13,
代码来源:RenderBlockGrate.java

示例33: renderSides

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
private void renderSides(ITessellator tessellator, TextureAtlasSprite matIcon) {
    //casing
    tessellator.drawScaledPrism(0, 0, 0, 16, 1, 16, matIcon);
    tessellator.drawScaledPrism(0, 15, 0, 16, 16, 16, matIcon);
    tessellator.drawScaledPrism(0, 1, 0, 1, 15, 16, matIcon);
    tessellator.drawScaledPrism(15, 1, 0, 16, 15, 16, matIcon);
    tessellator.drawScaledPrism(1, 1, 15, 15, 15, 16, matIcon);

    //drawer
    tessellator.drawScaledPrism(1.1F, 1.1F, 1, 14.9F, 14.9F, 2, matIcon);
    tessellator.drawScaledPrism(4, 3, 0, 5, 10, 1, matIcon);
    tessellator.drawScaledPrism(11, 3, 0, 12, 10, 1, matIcon);
    tessellator.drawScaledPrism(4, 10, 0, 12, 11, 1, matIcon);
    tessellator.drawScaledPrism(4, 3, 0, 12, 4, 1, matIcon);

    //handle
    tessellator.drawScaledPrism(7, 12, 0, 9, 13, 1, BaseIcons.IRON_BLOCK.getIcon());

    //trace
    tessellator.drawScaledFace(1, 1, 1.5F, 15, EnumFacing.NORTH, matIcon, 0.99F);
    tessellator.drawScaledFace(14.5F, 1, 15, 15, EnumFacing.NORTH, matIcon, 0.99F);
    tessellator.drawScaledFace(1, 14.5F, 15F, 15, EnumFacing.NORTH, matIcon, 0.99F);
    tessellator.drawScaledFace(1, 1, 15, 1.5F, EnumFacing.NORTH, matIcon, 0.99F);
    tessellator.drawScaledFace(3.5F, 2.5F, 5.5F, 11.5F, EnumFacing.NORTH, matIcon, 0.99F);
    tessellator.drawScaledFace(10.5F, 2.5F, 12.5F, 11.5F, EnumFacing.NORTH, matIcon, 0.99F);
    tessellator.drawScaledFace(3.5F, 2.5F, 12.5F, 4.5F, EnumFacing.NORTH, matIcon, 0.99F);
    tessellator.drawScaledFace(3.5F, 9.5F, 12.5F, 11.5F, EnumFacing.NORTH, matIcon, 0.99F);
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:29,
代码来源:RenderSeedStorage.java

示例34: renderWorldBlockWoodDynamic

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
protected void renderWorldBlockWoodDynamic(ITessellator tess, World world, BlockPos pos, BlockSeedStorage block,
        TileEntitySeedStorage tile, TextureAtlasSprite icon) {
    tess.pushMatrix();
    rotateBlock(tess, tile.getOrientation().getOpposite());
    tile.getLockedSeed().ifPresent(s -> drawSeed(tess, s.toStack()));
    tess.popMatrix();
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:9,
代码来源:RenderSeedStorage.java

示例35: renderWorldBlockWoodStatic

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
protected void renderWorldBlockWoodStatic(ITessellator tess, IExtendedBlockState state, BlockSeedStorage block, EnumFacing side, TextureAtlasSprite icon) {
    tess.pushMatrix();
    rotateBlock(tess, AgriProperties.FACING.getValue(state));
    renderSides(tess, icon);
    tess.popMatrix();

}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:9,
代码来源:RenderSeedStorage.java

示例36: renderWorldBlockWoodStatic

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
protected void renderWorldBlockWoodStatic(ITessellator tess, IExtendedBlockState state, BlockWaterTank block, EnumFacing side, TextureAtlasSprite sprite) {
    final IrrigationConnection connections = new IrrigationConnection();
    connections.read(state);
    renderSide(tess, EnumFacing.NORTH, connections.get(EnumFacing.NORTH), sprite);
    renderSide(tess, EnumFacing.EAST, connections.get(EnumFacing.EAST), sprite);
    renderSide(tess, EnumFacing.SOUTH, connections.get(EnumFacing.SOUTH), sprite);
    renderSide(tess, EnumFacing.WEST, connections.get(EnumFacing.WEST), sprite);
    renderBottom(tess, connections.get(EnumFacing.DOWN), sprite);
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:11,
代码来源:RenderTank.java

示例37: renderInventoryBlockWood

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@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, IrrigationConnectionType.NONE, sprite);
    renderSide(tess, EnumFacing.EAST, IrrigationConnectionType.NONE, sprite);
    renderSide(tess, EnumFacing.SOUTH, IrrigationConnectionType.NONE, sprite);
    renderSide(tess, EnumFacing.WEST, IrrigationConnectionType.NONE, sprite);
    renderBottom(tess, IrrigationConnectionType.NONE, sprite);
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:10,
代码来源:RenderTank.java

示例38: renderInventoryBlock

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
public void renderInventoryBlock(ITessellator tessellator, World world, IBlockState state, BlockSprinkler block, TileEntitySprinkler tile,
        ItemStack stack, EntityLivingBase entity, ItemCameraTransforms.TransformType type) {
    // Draw Top
    tessellator.drawScaledPrism(4, 8, 4, 12, 16, 12, BaseIcons.OAK_PLANKS.getIcon());
    // Get Core Icon
    final TextureAtlasSprite coreIcon = BaseIcons.IRON_BLOCK.getIcon();
    // Draw Core
    tessellator.drawScaledPrism(MIN_C, MIN_Y - 8, MIN_C, MAX_C, MAX_Y - 4, MAX_C, coreIcon);
    // Draw Blades
    tessellator.drawScaledPrism(BMX_A, MIN_Y - 8, MIN_C, BMX_B, BMX_Y - 8, MAX_C, coreIcon);
    tessellator.drawScaledPrism(MIN_C, MIN_Y - 8, BMX_A, MAX_C, BMX_Y - 8, BMX_B, coreIcon);

}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:15,
代码来源:RenderSprinkler.java

示例39: renderWorldBlockStatic

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
@Override
public void renderWorldBlockStatic(ITessellator tessellator, IBlockState state, BlockSprinkler block, EnumFacing side) {
    tessellator.translate(0, 4 * Constants.UNIT, 0);
    CustomWoodType type;
    if (state instanceof IExtendedBlockState) {
        type = ((IExtendedBlockState) state).getValue(AgriProperties.CUSTOM_WOOD_TYPE);
    } else {
        type = CustomWoodTypeRegistry.DEFAULT;
    }
    tessellator.drawScaledPrism(4, 8, 4, 12, 16, 12, type.getIcon());
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:12,
代码来源:RenderSprinkler.java

示例40: renderWoodChannel

点赞 2

import com.infinityraider.infinitylib.render.tessellation.ITessellator; //导入依赖的package包/类
protected void renderWoodChannel(ITessellator tessellator, IBlockState state, TextureAtlasSprite icon) {
    final IrrigationConnection metas = new IrrigationConnection();
    metas.read(state);
    this.renderBottom(tessellator, icon);
    this.renderSide(tessellator, state, EnumFacing.NORTH, metas.get(EnumFacing.NORTH), icon);
    this.renderSide(tessellator, state, EnumFacing.EAST, metas.get(EnumFacing.EAST), icon);
    this.renderSide(tessellator, state, EnumFacing.SOUTH, metas.get(EnumFacing.SOUTH), icon);
    this.renderSide(tessellator, state, EnumFacing.WEST, metas.get(EnumFacing.WEST), icon);
}
 

开发者ID:AgriCraft,
项目名称:AgriCraft,
代码行数:10,
代码来源:RenderChannel.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)