Java 类net.minecraft.client.renderer.block.model.BakedQuad 实例源码

项目:Backmemed    文件:RenderEnv.java   
public boolean isBreakingAnimation(BakedQuad p_isBreakingAnimation_1_)
{
    if (this.breakingAnimation < 0)
    {
        if (p_isBreakingAnimation_1_ instanceof BakedQuadRetextured)
        {
            this.breakingAnimation = 1;
        }
        else
        {
            this.breakingAnimation = 0;
        }
    }

    return this.breakingAnimation == 1;
}
项目:DankNull    文件:RenderModel.java   
public static void renderQuads(VertexBuffer renderer, List<BakedQuad> quads, int color, ItemStack stack) {
    boolean flag = (color == -1) && (!stack.isEmpty());
    int i = 0;
    for (int j = quads.size(); i < j; i++) {
        BakedQuad bakedquad = quads.get(i);
        int k = color;
        if ((flag) && (bakedquad.hasTintIndex())) {
            ItemColors itemColors = Minecraft.getMinecraft().getItemColors();
            k = itemColors.getColorFromItemstack(stack, bakedquad.getTintIndex());
            if (EntityRenderer.anaglyphEnable) {
                k = TextureUtil.anaglyphColor(k);
            }
            k |= 0xFF000000;
        }
        LightUtil.renderQuadColor(renderer, bakedquad, k);
    }
}
项目:Backmemed    文件:NaturalProperties.java   
private BakedQuad makeQuad(BakedQuad p_makeQuad_1_, int p_makeQuad_2_, boolean p_makeQuad_3_)
{
    int[] aint = p_makeQuad_1_.getVertexData();
    int i = p_makeQuad_1_.getTintIndex();
    EnumFacing enumfacing = p_makeQuad_1_.getFace();
    TextureAtlasSprite textureatlassprite = p_makeQuad_1_.getSprite();

    if (!this.isFullSprite(p_makeQuad_1_))
    {
        p_makeQuad_2_ = 0;
    }

    aint = this.transformVertexData(aint, p_makeQuad_2_, p_makeQuad_3_);
    BakedQuad bakedquad = new BakedQuad(aint, i, enumfacing, textureatlassprite);
    return bakedquad;
}
项目:Backmemed    文件:BlockModelUtils.java   
public static IBakedModel makeModelCube(TextureAtlasSprite p_makeModelCube_0_, int p_makeModelCube_1_)
{
    List list = new ArrayList();
    EnumFacing[] aenumfacing = EnumFacing.VALUES;
    Map<EnumFacing, List<BakedQuad>> map = new HashMap();

    for (int i = 0; i < aenumfacing.length; ++i)
    {
        EnumFacing enumfacing = aenumfacing[i];
        List list1 = new ArrayList();
        list1.add(makeBakedQuad(enumfacing, p_makeModelCube_0_, p_makeModelCube_1_));
        map.put(enumfacing, list1);
    }

    ItemOverrideList itemoverridelist = new ItemOverrideList(new ArrayList());
    IBakedModel ibakedmodel = new SimpleBakedModel(list, map, true, true, p_makeModelCube_0_, ItemCameraTransforms.DEFAULT, itemoverridelist);
    return ibakedmodel;
}
项目:Solar    文件:BakedHyperConductor.java   
@Override
protected List<BakedQuad> getQuads(IBlockState state) {
    List<BakedQuad> quads = new ArrayList<>();
    switch(MinecraftForgeClient.getRenderLayer()) {
        case SOLID:
            //Base
            quads.addAll(QuadBuilder.withFormat(format)
                    .setFrom(0, 0, 0)
                    .setTo(16, 16, 16)
                    .addAll(base)
                    .bake()
            );
            break;
        case CUTOUT_MIPPED:
            //Overlay
            quads.addAll(QuadBuilder.withFormat(format)
                    .setFrom(0, 0, 0)
                    .setTo(16, 16, 16)
                    .setHasBrightness(true)
                    .addAll(overlay)
                    .bake()
            );
            break;
    }
    return quads;
}
项目:CustomWorldGen    文件:OBJModel.java   
@Override
public List<BakedQuad> getQuads(IBlockState blockState, EnumFacing side, long rand)
{
    if (side != null) return ImmutableList.of();
    if (quads == null)
    {
        quads = buildQuads(this.state);
    }
    if (blockState instanceof IExtendedBlockState)
    {
        IExtendedBlockState exState = (IExtendedBlockState) blockState;
        if (exState.getUnlistedNames().contains(Properties.AnimationProperty))
        {

            IModelState newState = exState.getValue(Properties.AnimationProperty);
            if (newState != null)
            {
                newState = new ModelStateComposition(this.state, newState);
                return buildQuads(newState);
            }
        }
    }
    return quads;
}
项目:Backmemed    文件:BlockModelUtils.java   
private static void replaceTexture(List<BakedQuad> p_replaceTexture_0_, TextureAtlasSprite p_replaceTexture_1_, TextureAtlasSprite p_replaceTexture_2_)
{
    List<BakedQuad> list = new ArrayList();

    for (BakedQuad bakedquad : p_replaceTexture_0_)
    {
        if (bakedquad.getSprite() != p_replaceTexture_1_)
        {
            list.add(bakedquad);
            break;
        }

        BakedQuad bakedquad1 = new BakedQuadRetextured(bakedquad, p_replaceTexture_2_);
        list.add(bakedquad1);
    }

    p_replaceTexture_0_.clear();
    p_replaceTexture_0_.addAll(list);
}
项目:DecompiledMinecraft    文件:BlockModelRenderer.java   
private void renderModelBrightnessColorQuads(float p_178264_1_, float p_178264_2_, float p_178264_3_, float p_178264_4_, List<BakedQuad> p_178264_5_)
{
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();

    for (BakedQuad bakedquad : p_178264_5_)
    {
        worldrenderer.begin(7, DefaultVertexFormats.ITEM);
        worldrenderer.addVertexData(bakedquad.getVertexData());

        if (bakedquad.hasTintIndex())
        {
            worldrenderer.putColorRGB_F4(p_178264_2_ * p_178264_1_, p_178264_3_ * p_178264_1_, p_178264_4_ * p_178264_1_);
        }
        else
        {
            worldrenderer.putColorRGB_F4(p_178264_1_, p_178264_1_, p_178264_1_);
        }

        Vec3i vec3i = bakedquad.getFace().getDirectionVec();
        worldrenderer.putNormal((float)vec3i.getX(), (float)vec3i.getY(), (float)vec3i.getZ());
        tessellator.draw();
    }
}
项目:CustomWorldGen    文件:ModelFluid.java   
public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand)
{
    BakedFluid model = this;
    if(state instanceof IExtendedBlockState)
    {
        IExtendedBlockState exState = (IExtendedBlockState)state;
        int[] cornerRound = getCorners(Optional.of(exState));
        int flowRound = getFlow(Optional.of(exState));
        long key = flowRound + 1024;
        for(int i = 3; i >= 0; i--)
        {
            key <<= 10;
            key |= cornerRound[i];
        }
        key <<= 1;
        key |= 1;
        model = modelCache.getUnchecked(key);
    }
    if(side == null) return ImmutableList.of();
    return model.faceQuads.get(side);
}
项目:BaseClient    文件:NaturalProperties.java   
private BakedQuad makeQuad(BakedQuad p_makeQuad_1_, int p_makeQuad_2_, boolean p_makeQuad_3_)
{
    int[] aint = p_makeQuad_1_.getVertexData();
    int i = p_makeQuad_1_.getTintIndex();
    EnumFacing enumfacing = p_makeQuad_1_.getFace();
    TextureAtlasSprite textureatlassprite = p_makeQuad_1_.getSprite();

    if (!this.isFullSprite(p_makeQuad_1_))
    {
        return p_makeQuad_1_;
    }
    else
    {
        aint = this.transformVertexData(aint, p_makeQuad_2_, p_makeQuad_3_);
        BakedQuad bakedquad = new BakedQuad(aint, i, enumfacing, textureatlassprite);
        return bakedquad;
    }
}
项目:CustomWorldGen    文件:BlockModelRenderer.java   
private void renderModelBrightnessColorQuads(float brightness, float red, float green, float blue, List<BakedQuad> listQuads)
{
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    int i = 0;

    for (int j = listQuads.size(); i < j; ++i)
    {
        BakedQuad bakedquad = (BakedQuad)listQuads.get(i);
        vertexbuffer.begin(7, DefaultVertexFormats.ITEM);
        vertexbuffer.addVertexData(bakedquad.getVertexData());

        if (bakedquad.hasTintIndex())
        {
            vertexbuffer.putColorRGB_F4(red * brightness, green * brightness, blue * brightness);
        }
        else
        {
            vertexbuffer.putColorRGB_F4(brightness, brightness, brightness);
        }

        Vec3i vec3i = bakedquad.getFace().getDirectionVec();
        vertexbuffer.putNormal((float)vec3i.getX(), (float)vec3i.getY(), (float)vec3i.getZ());
        tessellator.draw();
    }
}
项目:BaseClient    文件:RenderEnv.java   
public boolean isBreakingAnimation(BakedQuad p_isBreakingAnimation_1_)
{
    if (this.breakingAnimation < 0)
    {
        if (p_isBreakingAnimation_1_ instanceof BreakingFour)
        {
            this.breakingAnimation = 1;
        }
        else
        {
            this.breakingAnimation = 0;
        }
    }

    return this.breakingAnimation == 1;
}
项目:BaseClient    文件:RenderItem.java   
private void renderQuad(WorldRenderer renderer, BakedQuad quad, int color)
{
    if (renderer.isMultiTexture())
    {
        renderer.addVertexData(quad.getVertexDataSingle());
        renderer.putSprite(quad.getSprite());
    }
    else
    {
        renderer.addVertexData(quad.getVertexData());
    }

    if (Reflector.IColoredBakedQuad.exists() && Reflector.IColoredBakedQuad.isInstance(quad))
    {
        forgeHooksClient_putQuadColor(renderer, quad, color);
    }
    else
    {
        renderer.putColor4(color);
    }

    this.putQuadNormal(renderer, quad);
}
项目:CustomWorldGen    文件:LightUtil.java   
public static void renderQuadColorSlow(VertexBuffer wr, BakedQuad quad, int auxColor)
{
    ItemConsumer cons;
    if(wr == Tessellator.getInstance().getBuffer())
    {
        cons = getItemConsumer();
    }
    else
    {
        cons = new ItemConsumer(new VertexBufferConsumer(wr));
    }
    float b = (float)(auxColor & 0xFF) / 0xFF;
    float g = (float)((auxColor >>> 8) & 0xFF) / 0xFF;
    float r = (float)((auxColor >>> 16) & 0xFF) / 0xFF;
    float a = (float)((auxColor >>> 24) & 0xFF) / 0xFF;

    cons.setAuxColor(r, g, b, a);
    quad.pipe(cons);
}
项目:Backmemed    文件:ConnectedTextures.java   
public static synchronized BakedQuad[] getConnectedTexture(IBlockAccess p_getConnectedTexture_0_, IBlockState p_getConnectedTexture_1_, BlockPos p_getConnectedTexture_2_, BakedQuad p_getConnectedTexture_3_, RenderEnv p_getConnectedTexture_4_)
{
    TextureAtlasSprite textureatlassprite = p_getConnectedTexture_3_.getSprite();

    if (textureatlassprite == null)
    {
        return p_getConnectedTexture_4_.getArrayQuadsCtm(p_getConnectedTexture_3_);
    }
    else
    {
        Block block = p_getConnectedTexture_1_.getBlock();

        if (skipConnectedTexture(p_getConnectedTexture_0_, p_getConnectedTexture_1_, p_getConnectedTexture_2_, p_getConnectedTexture_3_, p_getConnectedTexture_4_))
        {
            p_getConnectedTexture_3_ = getQuad(emptySprite, p_getConnectedTexture_3_);
            return p_getConnectedTexture_4_.getArrayQuadsCtm(p_getConnectedTexture_3_);
        }
        else
        {
            EnumFacing enumfacing = p_getConnectedTexture_3_.getFace();
            BakedQuad[] abakedquad = getConnectedTextureMultiPass(p_getConnectedTexture_0_, p_getConnectedTexture_1_, p_getConnectedTexture_2_, enumfacing, p_getConnectedTexture_3_, p_getConnectedTexture_4_);
            return abakedquad;
        }
    }
}
项目:BaseClient    文件:RenderEnv.java   
public boolean isBreakingAnimation(BakedQuad p_isBreakingAnimation_1_)
{
    if (this.breakingAnimation < 0)
    {
        if (p_isBreakingAnimation_1_ instanceof BreakingFour)
        {
            this.breakingAnimation = 1;
        }
        else
        {
            this.breakingAnimation = 0;
        }
    }

    return this.breakingAnimation == 1;
}
项目:pnc-repressurized    文件:PressureGlassBakedModel.java   
private BakedQuad createQuad(Vec3d v1, Vec3d v2, Vec3d v3, Vec3d v4, TextureAtlasSprite sprite) {
    Vec3d normal = v3.subtract(v2).crossProduct(v1.subtract(v2)).normalize();

    UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(format);
    builder.setTexture(sprite);
    putVertex(builder, normal, v1.x, v1.y, v1.z, sprite, 0, 0);
    putVertex(builder, normal, v2.x, v2.y, v2.z, sprite, 0, 16);
    putVertex(builder, normal, v3.x, v3.y, v3.z, sprite, 16, 16);
    putVertex(builder, normal, v4.x, v4.y, v4.z, sprite, 16, 0);
    return builder.build();
}
项目:Backmemed    文件:BlockModelUtils.java   
public static BakedQuad makeBakedQuad(EnumFacing p_makeBakedQuad_0_, TextureAtlasSprite p_makeBakedQuad_1_, int p_makeBakedQuad_2_)
{
    Vector3f vector3f = new Vector3f(0.0F, 0.0F, 0.0F);
    Vector3f vector3f1 = new Vector3f(16.0F, 16.0F, 16.0F);
    BlockFaceUV blockfaceuv = new BlockFaceUV(new float[] {0.0F, 0.0F, 16.0F, 16.0F}, 0);
    BlockPartFace blockpartface = new BlockPartFace(p_makeBakedQuad_0_, p_makeBakedQuad_2_, "#" + p_makeBakedQuad_0_.getName(), blockfaceuv);
    ModelRotation modelrotation = ModelRotation.X0_Y0;
    BlockPartRotation blockpartrotation = null;
    boolean flag = false;
    boolean flag1 = true;
    FaceBakery facebakery = new FaceBakery();
    BakedQuad bakedquad = facebakery.makeBakedQuad(vector3f, vector3f1, blockpartface, p_makeBakedQuad_1_, p_makeBakedQuad_0_, modelrotation, blockpartrotation, flag, flag1);
    return bakedquad;
}
项目:WirelessRedstone    文件:WirelessTriangulatorBakery.java   
@Override
public List<BakedQuad> bakeItemQuads(EnumFacing face, ItemStack stack) {

    int damage = stack.getItemDamage();
    if (damage < 0 || damage > RedstoneEther.numfreqs) {
        damage = 0;
    }

    return ItemQuadBakery.bakeItem(ImmutableList.of(TriangTexManager.getIconFromDamage(damage)));
}
项目:WirelessRedstone    文件:WirelessRemoteBakery.java   
@Override
public List<BakedQuad> bakeItemQuads(EnumFacing face, ItemStack stack) {
    TextureAtlasSprite sprite;
    int freq = stack.getItemDamage();
    if (freq <= 0 || freq > RedstoneEther.numfreqs) {
        sprite = RemoteTexManager.getIcon(-1, false);
    } else {
        sprite = RemoteTexManager.getIcon(RedstoneEther.get(true).getFreqColourId(freq), ItemWirelessRemote.getTransmitting(stack));
    }
    return ItemQuadBakery.bakeItem(ImmutableList.of(sprite));
}
项目:Adventurers-Toolbox    文件:AxeModel.java   
@Override
public IBakedModel bake(IModelState state, VertexFormat format,
        java.util.function.Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {

    ImmutableMap<TransformType, TRSRTransformation> transformMap = PerspectiveMapWrapper.getTransforms(state);

    TRSRTransformation transform = (TRSRTransformation.identity());

    ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();

    if (headTexture != null && haftTexture != null && handleTexture != null) {

        ImmutableList.Builder<ResourceLocation> texBuilder = ImmutableList.builder();
        if (haftTexture != null) {
            texBuilder.add(haftTexture);
        }
        if (headTexture != null) {
            texBuilder.add(headTexture);
        }
        if (handleTexture != null) {
            texBuilder.add(handleTexture);
        }
        if (adornmentTexture != null) {
            texBuilder.add(adornmentTexture);
        }
        ImmutableList<ResourceLocation> textures = texBuilder.build();

        IBakedModel model = (new ItemLayerModel(textures)).bake(state, format, bakedTextureGetter);
        builder.addAll(model.getQuads(null, null, 0));
    }

    return new BakedAxeModel(this, builder.build(), format, Maps.immutableEnumMap(transformMap),
            Maps.<String, IBakedModel>newHashMap());
}
项目:CustomWorldGen    文件:LightUtil.java   
public static void putBakedQuad(IVertexConsumer consumer, BakedQuad quad)
{
    try
    {
        consumer.setTexture(quad.getSprite());
    }
    catch(AbstractMethodError e)
    {
        // catch missing method errors caused by change to IVertexConsumer
    }
    consumer.setQuadOrientation(quad.getFace());
    if(quad.hasTintIndex())
    {
        consumer.setQuadTint(quad.getTintIndex());
    }
    consumer.setApplyDiffuseLighting(quad.shouldApplyDiffuseLighting());
    //int[] eMap = mapFormats(consumer.getVertexFormat(), DefaultVertexFormats.ITEM);
    float[] data = new float[4];
    VertexFormat formatFrom = consumer.getVertexFormat();
    VertexFormat formatTo = quad.getFormat();
    int countFrom = formatFrom.getElementCount();
    int countTo = formatTo.getElementCount();
    int[] eMap = formatMaps.getUnchecked(Pair.of(formatFrom, formatTo));
    for(int v = 0; v < 4; v++)
    {
        for(int e = 0; e < countFrom; e++)
        {
            if(eMap[e] != countTo)
            {
                unpack(quad.getVertexData(), data, quad.getFormat(), v, eMap[e]);
                consumer.put(e, data);
            }
            else
            {
                consumer.put(e);
            }
        }
    }
}
项目:Adventurers-Toolbox    文件:PickaxeModel.java   
@Override
public IBakedModel bake(IModelState state, VertexFormat format,
        java.util.function.Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {

    ImmutableMap<TransformType, TRSRTransformation> transformMap = PerspectiveMapWrapper.getTransforms(state);

    TRSRTransformation transform = (TRSRTransformation.identity());

    ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();

    if (headTexture != null && haftTexture != null && handleTexture != null) {

        ImmutableList.Builder<ResourceLocation> texBuilder = ImmutableList.builder();
        if (haftTexture != null) {
            texBuilder.add(haftTexture);
        }
        if (headTexture != null) {
            texBuilder.add(headTexture);
        }
        if (handleTexture != null) {
            texBuilder.add(handleTexture);
        }
        if (adornmentTexture != null) {
            texBuilder.add(adornmentTexture);
        }
        ImmutableList<ResourceLocation> textures = texBuilder.build();

        IBakedModel model = (new ItemLayerModel(textures)).bake(state, format, bakedTextureGetter);
        builder.addAll(model.getQuads(null, null, 0));
    }

    return new BakedPickaxeModel(this, builder.build(), format, Maps.immutableEnumMap(transformMap),
            Maps.<String, IBakedModel>newHashMap());
}
项目:Etheric    文件:PipeModel.java   
@Override
public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand) {
    if (state instanceof IExtendedBlockState) {
        List<IBakedModel> subModels = getSubModels((IExtendedBlockState) state);
        List<BakedQuad> quads = new ArrayList<BakedQuad>();

        for (IBakedModel model : subModels) {
            quads.addAll(model.getQuads(state, side, rand));
        }

        return quads;
    }
    return Collections.EMPTY_LIST;
}
项目:Adventurers-Toolbox    文件:AxeModel.java   
public BakedAxeModel(AxeModel parent, ImmutableList<BakedQuad> quads, VertexFormat format,
        ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transforms,
        Map<String, IBakedModel> cache) {
    this.quads = quads;
    this.format = format;
    this.parent = parent;
    this.transforms = itemTransforms();
    this.cache = cache;
}
项目:DankNull    文件:DankNullPanelRenderer.java   
private IBakedModel getModel(@Nonnull ItemStack stack) {
    String key = getKey(stack);
    int meta = stack.getMetadata();
    if (!modelCache.containsKey(key)) {
        if (DankTextures.DANKNULL_PANELS == null) {
            DankTextures.getInstance().registerIcons(RenderUtils.getBlocksTextureMap());
        }
        List<BakedQuad> quads = ItemQuadBakery.bakeItem(DankTextures.DANKNULL_PANELS[meta]);
        modelCache.put(key, new PerspectiveAwareBakedModel(quads, props));
    }
    return modelCache.get(key);
}
项目:DecompiledMinecraft    文件:SimpleBakedModel.java   
public SimpleBakedModel(List<BakedQuad> p_i46077_1_, List<List<BakedQuad>> p_i46077_2_, boolean p_i46077_3_, boolean p_i46077_4_, TextureAtlasSprite p_i46077_5_, ItemCameraTransforms p_i46077_6_)
{
    this.generalQuads = p_i46077_1_;
    this.faceQuads = p_i46077_2_;
    this.ambientOcclusion = p_i46077_3_;
    this.gui3d = p_i46077_4_;
    this.texture = p_i46077_5_;
    this.cameraTransforms = p_i46077_6_;
}
项目:Clef    文件:EventHandlerClient.java   
@SubscribeEvent
public void onModelBake(ModelBakeEvent event)
{
    ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
    builder.addAll(ItemLayerModel.getQuadsForSprite(0, txInstrument, DefaultVertexFormats.ITEM, Optional.empty()));
    event.getModelRegistry().putObject(new ModelResourceLocation("clef:instrument", "inventory"), new BakedModelInstrument(builder.build(), txInstrument, ImmutableMap.copyOf(new HashMap<>()), null, null));
}
项目:DecompiledMinecraft    文件:SimpleBakedModel.java   
private void addGeneralBreakingFours(IBakedModel p_177647_1_, TextureAtlasSprite p_177647_2_)
{
    for (BakedQuad bakedquad : p_177647_1_.getGeneralQuads())
    {
        this.addGeneralQuad(new BreakingFour(bakedquad, p_177647_2_));
    }
}
项目:SimpleTubes    文件:ModelTube.java   
@Override
public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand) {

    List<TexturedCuboid> cuboidList = new ArrayList<TexturedCuboid>();
    TexturedCuboid boxStraightYAxis = new TexturedCuboid(0.25F, 0F, 0.25F, 0.5F, 1F, 0.5F, itemTexMap);
    cuboidList.add(boxStraightYAxis);
    return ModelFactory.convertCuboidListToModel(DefaultVertexFormats.BLOCK, cuboidList, false);
}
项目:Backmemed    文件:NaturalProperties.java   
private boolean isFullSprite(BakedQuad p_isFullSprite_1_)
{
    TextureAtlasSprite textureatlassprite = p_isFullSprite_1_.getSprite();
    float f = textureatlassprite.getMinU();
    float f1 = textureatlassprite.getMaxU();
    float f2 = f1 - f;
    float f3 = f2 / 256.0F;
    float f4 = textureatlassprite.getMinV();
    float f5 = textureatlassprite.getMaxV();
    float f6 = f5 - f4;
    float f7 = f6 / 256.0F;
    int[] aint = p_isFullSprite_1_.getVertexData();
    int i = aint.length / 4;

    for (int j = 0; j < 4; ++j)
    {
        int k = j * i;
        float f8 = Float.intBitsToFloat(aint[k + 4]);
        float f9 = Float.intBitsToFloat(aint[k + 4 + 1]);

        if (!this.equalsDelta(f8, f, f3) && !this.equalsDelta(f8, f1, f3))
        {
            return false;
        }

        if (!this.equalsDelta(f9, f4, f7) && !this.equalsDelta(f9, f5, f7))
        {
            return false;
        }
    }

    return true;
}
项目:Solar    文件:BakedMonolithicGlyph.java   
@Override
protected List<BakedQuad> getQuads(IBlockState state) {
    List<BakedQuad> quads = new ArrayList<>();
    switch(MinecraftForgeClient.getRenderLayer()) {
        case SOLID:
            //Base
            quads.addAll(QuadBuilder.withFormat(format)
                    .setFrom(0, 0, 0)
                    .setTo(16, 16, 16)
                    .addAll(base)
                    .bake()
            );
            break;
        case CUTOUT_MIPPED:
            //Overlay
            int glyph = state.getValue(State.GLYPH);
            quads.addAll(QuadBuilder.withFormat(format)
                    .setFrom(0, 0, 0)
                    .setTo(16, 16, 16)
                    .setHasBrightness(true)
                    .addAll(overlay[glyph])
                    .bake()
            );
            break;
    }
    return quads;
}
项目:DecompiledMinecraft    文件:BlockModelRenderer.java   
public boolean renderModelAmbientOcclusion(IBlockAccess blockAccessIn, IBakedModel modelIn, Block blockIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides)
{
    boolean flag = false;
    float[] afloat = new float[EnumFacing.values().length * 2];
    BitSet bitset = new BitSet(3);
    BlockModelRenderer.AmbientOcclusionFace blockmodelrenderer$ambientocclusionface = new BlockModelRenderer.AmbientOcclusionFace();

    for (EnumFacing enumfacing : EnumFacing.values())
    {
        List<BakedQuad> list = modelIn.getFaceQuads(enumfacing);

        if (!list.isEmpty())
        {
            BlockPos blockpos = blockPosIn.offset(enumfacing);

            if (!checkSides || blockIn.shouldSideBeRendered(blockAccessIn, blockpos, enumfacing))
            {
                this.renderModelAmbientOcclusionQuads(blockAccessIn, blockIn, blockPosIn, worldRendererIn, list, afloat, bitset, blockmodelrenderer$ambientocclusionface);
                flag = true;
            }
        }
    }

    List<BakedQuad> list1 = modelIn.getGeneralQuads();

    if (list1.size() > 0)
    {
        this.renderModelAmbientOcclusionQuads(blockAccessIn, blockIn, blockPosIn, worldRendererIn, list1, afloat, bitset, blockmodelrenderer$ambientocclusionface);
        flag = true;
    }

    return flag;
}
项目:DecompiledMinecraft    文件:BlockModelRenderer.java   
public boolean renderModelStandard(IBlockAccess blockAccessIn, IBakedModel modelIn, Block blockIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides)
{
    boolean flag = false;
    BitSet bitset = new BitSet(3);

    for (EnumFacing enumfacing : EnumFacing.values())
    {
        List<BakedQuad> list = modelIn.getFaceQuads(enumfacing);

        if (!list.isEmpty())
        {
            BlockPos blockpos = blockPosIn.offset(enumfacing);

            if (!checkSides || blockIn.shouldSideBeRendered(blockAccessIn, blockpos, enumfacing))
            {
                int i = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos);
                this.renderModelStandardQuads(blockAccessIn, blockIn, blockPosIn, enumfacing, i, false, worldRendererIn, list, bitset);
                flag = true;
            }
        }
    }

    List<BakedQuad> list1 = modelIn.getGeneralQuads();

    if (list1.size() > 0)
    {
        this.renderModelStandardQuads(blockAccessIn, blockIn, blockPosIn, (EnumFacing)null, -1, true, worldRendererIn, list1, bitset);
        flag = true;
    }

    return flag;
}
项目:Adventurers-Toolbox    文件:ShovelModel.java   
@Override
public IBakedModel bake(IModelState state, VertexFormat format,
        java.util.function.Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {

    ImmutableMap<TransformType, TRSRTransformation> transformMap = PerspectiveMapWrapper.getTransforms(state);

    TRSRTransformation transform = (TRSRTransformation.identity());

    ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();

    if (headTexture != null && haftTexture != null && handleTexture != null) {

        ImmutableList.Builder<ResourceLocation> texBuilder = ImmutableList.builder();
        if (haftTexture != null) {
            texBuilder.add(haftTexture);
        }
        if (headTexture != null) {
            texBuilder.add(headTexture);
        }
        if (handleTexture != null) {
            texBuilder.add(handleTexture);
        }
        if (adornmentTexture != null) {
            texBuilder.add(adornmentTexture);
        }
        ImmutableList<ResourceLocation> textures = texBuilder.build();

        IBakedModel model = (new ItemLayerModel(textures)).bake(state, format, bakedTextureGetter);
        builder.addAll(model.getQuads(null, null, 0));
    }

    return new BakedShovelModel(this, builder.build(), format, Maps.immutableEnumMap(transformMap),
            Maps.<String, IBakedModel>newHashMap());
}
项目:Backmemed    文件:ModelUtils.java   
private static void dbgQuads(String p_dbgQuads_0_, List p_dbgQuads_1_, String p_dbgQuads_2_)
{
    for (Object bakedquad : p_dbgQuads_1_)
    {
        dbgQuad(p_dbgQuads_0_, (BakedQuad) bakedquad, p_dbgQuads_2_);
    }
}
项目:Backmemed    文件:BlockModelRenderer.java   
public boolean renderModelSmooth(IBlockAccess worldIn, IBakedModel modelIn, IBlockState stateIn, BlockPos posIn, VertexBuffer buffer, boolean checkSides, long rand)
{
    boolean flag = false;
    RenderEnv renderenv = buffer.getRenderEnv(worldIn, stateIn, posIn);

    for (EnumFacing enumfacing : EnumFacing.VALUES)
    {
        List<BakedQuad> list = modelIn.getQuads(stateIn, enumfacing, rand);

        if (!list.isEmpty() && (!checkSides || stateIn.shouldSideBeRendered(worldIn, posIn, enumfacing)) && (!Hacks.findMod(XRay.class).isEnabled() || !XRay.xrayBlocks.contains(stateIn.getBlock())))
        {
            list = BlockModelCustomizer.getRenderQuads(list, worldIn, stateIn, posIn, enumfacing, rand, renderenv);
            this.renderQuadsSmooth(worldIn, stateIn, posIn, buffer, list, renderenv);
            flag = true;
        }
    }

    List<BakedQuad> list1 = modelIn.getQuads(stateIn, (EnumFacing)null, rand);

    if (!list1.isEmpty())
    {
        list1 = BlockModelCustomizer.getRenderQuads(list1, worldIn, stateIn, posIn, (EnumFacing)null, rand, renderenv);
        this.renderQuadsSmooth(worldIn, stateIn, posIn, buffer, list1, renderenv);
        flag = true;
    }

    return flag;
}
项目:Adventurers-Toolbox    文件:ToolHeadModel.java   
public BakedToolHeadModel(ToolHeadModel parent, ImmutableList<BakedQuad> quads, VertexFormat format,
        ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transforms,
        Map<String, IBakedModel> cache) {
    this.quads = quads;
    this.format = format;
    this.parent = parent;
    this.transforms = itemTransforms();
}
项目:BaseClient    文件:SimpleBakedModel.java   
public SimpleBakedModel(List<BakedQuad> p_i46077_1_, List<List<BakedQuad>> p_i46077_2_, boolean p_i46077_3_, boolean p_i46077_4_, TextureAtlasSprite p_i46077_5_, ItemCameraTransforms p_i46077_6_)
{
    this.generalQuads = p_i46077_1_;
    this.faceQuads = p_i46077_2_;
    this.ambientOcclusion = p_i46077_3_;
    this.gui3d = p_i46077_4_;
    this.texture = p_i46077_5_;
    this.cameraTransforms = p_i46077_6_;
}
项目:SimpleTubes    文件:ModelFactory.java   
public static List<BakedQuad> convertCuboidToQuads(VertexFormat format, TexturedCuboid cuboid, boolean cull) {
    List<BakedQuad> list = new ArrayList<BakedQuad>();

    float x = cuboid.getX();
    float y = cuboid.getY();
    float z = cuboid.getZ();
    float width = cuboid.getWidth();
    float height = cuboid.getHeight();
    float depth = cuboid.getDepth();

    for (EnumFacing facing : EnumFacing.VALUES) {
        if (cuboid.getSidesToIgnore().contains(facing))
            continue;

        if (cuboid != null && cuboid.getTextureForSide(facing) != null && facing != null) {
            TextureAtlasSprite tex = cuboid.getTextureForSide(facing).getTexture();
            TRSRTransformation transform = cuboid.getTransform();
            float minU = getInterpU(cuboid.getTextureForSide(facing).getMinU(), tex);
            float minV = getInterpV(cuboid.getTextureForSide(facing).getMinV(), tex);
            float maxU = getInterpU(cuboid.getTextureForSide(facing).getMaxU(), tex);
            float maxV = getInterpV(cuboid.getTextureForSide(facing).getMaxV(), tex);
            Color col = cuboid.getColor();

            if (transform == null)
                transform = TRSRTransformation.identity();

            list.add(buildQuad(facing, x, y, z, width, height, depth, col, tex, minU, minV, maxU, maxV, false, transform));
            if (!cull)
                list.add(buildQuad(facing, x, y, z, width, height, depth, col, tex, minU, minV, maxU, maxV, true, transform));

        }
    }

    return list;
}