java类net.minecraft.client.renderer.texture.TextureMap的实例源码

ShadersTex.java 文件源码 项目:Backmemed 阅读 24 收藏 0 点赞 0 评论 0
static void updateTextureMinMagFilter()
{
    TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
    ITextureObject itextureobject = texturemanager.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);

    if (itextureobject != null)
    {
        MultiTexID multitexid = itextureobject.getMultiTexID();
        GlStateManager.bindTexture(multitexid.base);
        GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.texMinFilValue[Shaders.configTexMinFilB]);
        GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, Shaders.texMagFilValue[Shaders.configTexMagFilB]);
        GlStateManager.bindTexture(multitexid.norm);
        GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.texMinFilValue[Shaders.configTexMinFilN]);
        GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, Shaders.texMagFilValue[Shaders.configTexMagFilN]);
        GlStateManager.bindTexture(multitexid.spec);
        GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.texMinFilValue[Shaders.configTexMinFilS]);
        GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, Shaders.texMagFilValue[Shaders.configTexMagFilS]);
        GlStateManager.bindTexture(0);
    }
}
ModelBakery.java 文件源码 项目:CustomWorldGen 阅读 24 收藏 0 点赞 0 评论 0
private void loadSprites()
{
    final Set<ResourceLocation> set = this.getVariantsTextureLocations();
    set.addAll(this.getItemsTextureLocations());
    set.remove(TextureMap.LOCATION_MISSING_TEXTURE);
    ITextureMapPopulator itexturemappopulator = new ITextureMapPopulator()
    {
        public void registerSprites(TextureMap textureMapIn)
        {
            for (ResourceLocation resourcelocation : set)
            {
                TextureAtlasSprite textureatlassprite = textureMapIn.registerSprite(resourcelocation);
                ModelBakery.this.sprites.put(resourcelocation, textureatlassprite);
            }
        }
    };
    this.textureMap.loadSprites(this.resourceManager, itexturemappopulator);
    this.sprites.put(new ResourceLocation("missingno"), this.textureMap.getMissingSprite());
}
ModelBakery.java 文件源码 项目:Backmemed 阅读 28 收藏 0 点赞 0 评论 0
private void loadSprites()
{
    final Set<ResourceLocation> set = this.getVariantsTextureLocations();
    set.addAll(this.getItemsTextureLocations());
    set.remove(TextureMap.LOCATION_MISSING_TEXTURE);
    ITextureMapPopulator itexturemappopulator = new ITextureMapPopulator()
    {
        public void registerSprites(TextureMap textureMapIn)
        {
            for (ResourceLocation resourcelocation : set)
            {
                TextureAtlasSprite textureatlassprite = textureMapIn.registerSprite(resourcelocation);
                ModelBakery.this.sprites.put(resourcelocation, textureatlassprite);
            }
        }
    };
    this.textureMap.loadSprites(this.resourceManager, itexturemappopulator);
    this.sprites.put(new ResourceLocation("missingno"), this.textureMap.getMissingSprite());
}
CustomItems.java 文件源码 项目:Backmemed 阅读 31 收藏 0 点赞 0 评论 0
public static void updateModels()
{
    if (itemProperties != null)
    {
        for (int i = 0; i < itemProperties.length; ++i)
        {
            CustomItemProperties[] acustomitemproperties = itemProperties[i];

            if (acustomitemproperties != null)
            {
                for (int j = 0; j < acustomitemproperties.length; ++j)
                {
                    CustomItemProperties customitemproperties = acustomitemproperties[j];

                    if (customitemproperties != null && customitemproperties.type == 1)
                    {
                        TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
                        customitemproperties.updateModel(texturemap, itemModelGenerator);
                    }
                }
            }
        }
    }
}
Util.java 文件源码 项目:Metalworks 阅读 21 收藏 0 点赞 0 评论 0
@SideOnly(Side.CLIENT)
public static void renderItemInWorld(ItemStack stack){
    if(!stack.isEmpty()){
        Minecraft mc = Minecraft.getMinecraft();
        RenderItem renderer = mc.getRenderItem();
        TextureManager manager = mc.getTextureManager();

        IBakedModel model = renderer.getItemModelWithOverrides(stack, null, null);

        manager.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        manager.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).setBlurMipmap(false, false);
        GlStateManager.enableRescaleNormal();
        GlStateManager.enableBlend();
        GlStateManager.pushMatrix();
        model = ForgeHooksClient.handleCameraTransforms(model, ItemCameraTransforms.TransformType.FIXED, false);
        renderer.renderItem(stack, model);
        GlStateManager.cullFace(GlStateManager.CullFace.BACK);
        GlStateManager.popMatrix();
        GlStateManager.disableRescaleNormal();
        GlStateManager.disableBlend();
        manager.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        manager.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap();
    }
}
ConnectedTextures.java 文件源码 项目:BaseClient 阅读 22 收藏 0 点赞 0 评论 0
public static void updateIcons(TextureMap p_updateIcons_0_)
{
    blockProperties = (ConnectedProperties[][])null;
    tileProperties = (ConnectedProperties[][])null;

    if (Config.isConnectedTextures())
    {
        IResourcePack[] airesourcepack = Config.getResourcePacks();

        for (int i = airesourcepack.length - 1; i >= 0; --i)
        {
            IResourcePack iresourcepack = airesourcepack[i];
            updateIcons(p_updateIcons_0_, iresourcepack);
        }

        updateIcons(p_updateIcons_0_, Config.getDefaultResourcePack());
        ResourceLocation resourcelocation = new ResourceLocation("mcpatcher/ctm/default/empty");
        emptySprite = p_updateIcons_0_.registerSprite(resourcelocation);
        spriteQuadMaps = new Map[p_updateIcons_0_.getCountRegisteredSprites() + 1];
    }
}
LayerRenderHeldBlock.java 文件源码 项目:MeeCreeps 阅读 24 收藏 0 点赞 0 评论 0
@Override
public void doRenderLayer(EntityMeeCreeps entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
    IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();

    if (iblockstate != null) {
        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        GlStateManager.enableRescaleNormal();
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, 0.6875F, -0.75F);
        GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(0.25F, 0.1875F, 0.25F);
        float f = 0.5F;
        GlStateManager.scale(-0.5F, -0.5F, 0.5F);
        int i = entitylivingbaseIn.getBrightnessForRender();
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j, k);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.endermanRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.disableRescaleNormal();
    }
}
ConnectedProperties.java 文件源码 项目:Backmemed 阅读 27 收藏 0 点赞 0 评论 0
public void updateIcons(TextureMap p_updateIcons_1_)
{
    if (this.matchTiles != null)
    {
        this.matchTileIcons = registerIcons(this.matchTiles, p_updateIcons_1_);
    }

    if (this.connectTiles != null)
    {
        this.connectTileIcons = registerIcons(this.connectTiles, p_updateIcons_1_);
    }

    if (this.tiles != null)
    {
        this.tileIcons = registerIcons(this.tiles, p_updateIcons_1_);
    }
}
XrayMod.java 文件源码 项目:ForgeHax 阅读 24 收藏 0 点赞 0 评论 0
@SubscribeEvent
public void onPreRenderBlockLayer(RenderBlockLayerEvent.Pre event) {
    if(!isInternalCall) {
        if (!event.getRenderLayer().equals(BlockRenderLayer.TRANSLUCENT)) {
            event.setCanceled(true);
        } else if (event.getRenderLayer().equals(BlockRenderLayer.TRANSLUCENT)) {
            isInternalCall = true;
            Entity renderEntity = MC.getRenderViewEntity();
            GlStateManager.disableAlpha();
            MC.renderGlobal.renderBlockLayer(BlockRenderLayer.SOLID, event.getPartialTicks(), 0, renderEntity);
            GlStateManager.enableAlpha();
            MC.renderGlobal.renderBlockLayer(BlockRenderLayer.CUTOUT_MIPPED, event.getPartialTicks(), 0, renderEntity);
            MC.getTextureManager().getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).setBlurMipmap(false, false);
            MC.renderGlobal.renderBlockLayer(BlockRenderLayer.CUTOUT, event.getPartialTicks(), 0, renderEntity);
            MC.getTextureManager().getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap();
            GlStateManager.disableAlpha();
            isInternalCall = false;
        }
    }
}
LayerHeldBlock2.java 文件源码 项目:EndermanEvolution 阅读 21 收藏 0 点赞 0 评论 0
@Override
public void doRenderLayer(EntityEvolvedEnderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
    IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();

    if (iblockstate != null) {
        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        GlStateManager.enableRescaleNormal();
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, 0.6875F, -0.75F);
        GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(0.25F, 0.1875F, 0.25F);
        GlStateManager.scale(-0.5F, -0.5F, 0.5F);
        int i = entitylivingbaseIn.getBrightnessForRender();
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j, k);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        endermanRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.disableRescaleNormal();
    }
}
ModelBakery.java 文件源码 项目:DecompiledMinecraft 阅读 20 收藏 0 点赞 0 评论 0
private void loadSprites()
{
    final Set<ResourceLocation> set = this.getVariantsTextureLocations();
    set.addAll(this.getItemsTextureLocations());
    set.remove(TextureMap.LOCATION_MISSING_TEXTURE);
    IIconCreator iiconcreator = new IIconCreator()
    {
        public void registerSprites(TextureMap iconRegistry)
        {
            for (ResourceLocation resourcelocation : set)
            {
                TextureAtlasSprite textureatlassprite = iconRegistry.registerSprite(resourcelocation);
                ModelBakery.this.sprites.put(resourcelocation, textureatlassprite);
            }
        }
    };
    this.textureMap.loadSprites(this.resourceManager, iiconcreator);
    this.sprites.put(new ResourceLocation("missingno"), this.textureMap.getMissingSprite());
}
BetterGrass.java 文件源码 项目:Backmemed 阅读 23 收藏 0 点赞 0 评论 0
private static TextureAtlasSprite registerSprite(Properties p_registerSprite_0_, String p_registerSprite_1_, String p_registerSprite_2_, TextureMap p_registerSprite_3_)
{
    String s = p_registerSprite_0_.getProperty(p_registerSprite_1_);

    if (s == null)
    {
        s = p_registerSprite_2_;
    }

    ResourceLocation resourcelocation = new ResourceLocation("textures/" + s + ".png");

    if (!Config.hasResource(resourcelocation))
    {
        Config.warn("BetterGrass texture not found: " + resourcelocation);
        s = p_registerSprite_2_;
    }

    ResourceLocation resourcelocation1 = new ResourceLocation(s);
    TextureAtlasSprite textureatlassprite = p_registerSprite_3_.registerSprite(resourcelocation1);
    return textureatlassprite;
}
LayerHeldBlock.java 文件源码 项目:DecompiledMinecraft 阅读 22 收藏 0 点赞 0 评论 0
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();

    if (iblockstate.getBlock().getMaterial() != Material.air)
    {
        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        GlStateManager.enableRescaleNormal();
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, 0.6875F, -0.75F);
        GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(0.25F, 0.1875F, 0.25F);
        float f = 0.5F;
        GlStateManager.scale(-f, -f, f);
        int i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.endermanRenderer.bindTexture(TextureMap.locationBlocksTexture);
        blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.disableRescaleNormal();
    }
}
RenderItem.java 文件源码 项目:DecompiledMinecraft 阅读 26 收藏 0 点赞 0 评论 0
public void renderItemIntoGUI(ItemStack stack, int x, int y)
{
    IBakedModel ibakedmodel = this.itemModelMesher.getItemModel(stack);
    GlStateManager.pushMatrix();
    this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
    this.textureManager.getTexture(TextureMap.locationBlocksTexture).setBlurMipmap(false, false);
    GlStateManager.enableRescaleNormal();
    GlStateManager.enableAlpha();
    GlStateManager.alphaFunc(516, 0.1F);
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(770, 771);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.setupGuiTransform(x, y, ibakedmodel.isGui3d());
    ibakedmodel.getItemCameraTransforms().applyTransform(ItemCameraTransforms.TransformType.GUI);
    this.renderItem(stack, ibakedmodel);
    GlStateManager.disableAlpha();
    GlStateManager.disableRescaleNormal();
    GlStateManager.disableLighting();
    GlStateManager.popMatrix();
    this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
    this.textureManager.getTexture(TextureMap.locationBlocksTexture).restoreLastBlurMipmap();
}
ItemRenderer.java 文件源码 项目:BaseClient 阅读 26 收藏 0 点赞 0 评论 0
private void func_178108_a(float p_178108_1_, TextureAtlasSprite p_178108_2_)
{
    this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    float f = 0.1F;
    GlStateManager.color(0.1F, 0.1F, 0.1F, 0.5F);
    GlStateManager.pushMatrix();
    float f1 = -1.0F;
    float f2 = 1.0F;
    float f3 = -1.0F;
    float f4 = 1.0F;
    float f5 = -0.5F;
    float f6 = p_178108_2_.getMinU();
    float f7 = p_178108_2_.getMaxU();
    float f8 = p_178108_2_.getMinV();
    float f9 = p_178108_2_.getMaxV();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
    worldrenderer.pos(-1.0D, -1.0D, -0.5D).tex((double)f7, (double)f9).endVertex();
    worldrenderer.pos(1.0D, -1.0D, -0.5D).tex((double)f6, (double)f9).endVertex();
    worldrenderer.pos(1.0D, 1.0D, -0.5D).tex((double)f6, (double)f8).endVertex();
    worldrenderer.pos(-1.0D, 1.0D, -0.5D).tex((double)f7, (double)f8).endVertex();
    tessellator.draw();
    GlStateManager.popMatrix();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
LayerHeldBlock.java 文件源码 项目:BaseClient 阅读 19 收藏 0 点赞 0 评论 0
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();

    if (iblockstate.getBlock().getMaterial() != Material.air)
    {
        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        GlStateManager.enableRescaleNormal();
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, 0.6875F, -0.75F);
        GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(0.25F, 0.1875F, 0.25F);
        float f = 0.5F;
        GlStateManager.scale(-f, -f, f);
        int i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.endermanRenderer.bindTexture(TextureMap.locationBlocksTexture);
        blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.disableRescaleNormal();
    }
}
ShadersTex.java 文件源码 项目:BaseClient 阅读 20 收藏 0 点赞 0 评论 0
public static void allocateTextureMap(int texID, int mipmapLevels, int width, int height, Stitcher stitcher, TextureMap tex)
{
    SMCLog.info("allocateTextureMap " + mipmapLevels + " " + width + " " + height + " ");
    updatingTextureMap = tex;
    tex.atlasWidth = width;
    tex.atlasHeight = height;
    MultiTexID multitexid = getMultiTexID(tex);
    updatingTex = multitexid;
    TextureUtil.allocateTextureImpl(multitexid.base, mipmapLevels, width, height);

    if (Shaders.configNormalMap)
    {
        TextureUtil.allocateTextureImpl(multitexid.norm, mipmapLevels, width, height);
    }

    if (Shaders.configSpecularMap)
    {
        TextureUtil.allocateTextureImpl(multitexid.spec, mipmapLevels, width, height);
    }

    GlStateManager.bindTexture(texID);
}
ShadersTex.java 文件源码 项目:BaseClient 阅读 55 收藏 0 点赞 0 评论 0
static void updateTextureMinMagFilter()
{
    TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
    ITextureObject itextureobject = texturemanager.getTexture(TextureMap.locationBlocksTexture);

    if (itextureobject != null)
    {
        MultiTexID multitexid = itextureobject.getMultiTexID();
        GlStateManager.bindTexture(multitexid.base);
        GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.texMinFilValue[Shaders.configTexMinFilB]);
        GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, Shaders.texMagFilValue[Shaders.configTexMagFilB]);
        GlStateManager.bindTexture(multitexid.norm);
        GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.texMinFilValue[Shaders.configTexMinFilN]);
        GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, Shaders.texMagFilValue[Shaders.configTexMagFilN]);
        GlStateManager.bindTexture(multitexid.spec);
        GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.texMinFilValue[Shaders.configTexMinFilS]);
        GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, Shaders.texMagFilValue[Shaders.configTexMagFilS]);
        GlStateManager.bindTexture(0);
    }
}
CustomItems.java 文件源码 项目:BaseClient 阅读 26 收藏 0 点赞 0 评论 0
public static void updateModels()
{
    if (itemProperties != null)
    {
        for (int i = 0; i < itemProperties.length; ++i)
        {
            CustomItemProperties[] acustomitemproperties = itemProperties[i];

            if (acustomitemproperties != null)
            {
                for (int j = 0; j < acustomitemproperties.length; ++j)
                {
                    CustomItemProperties customitemproperties = acustomitemproperties[j];

                    if (customitemproperties != null && customitemproperties.type == 1)
                    {
                        TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
                        customitemproperties.updateModel(texturemap, itemModelGenerator);
                    }
                }
            }
        }
    }
}
Render_Projectile.java 文件源码 项目:minecraft-quiverbow 阅读 25 收藏 0 点赞 0 评论 0
@Override
protected ResourceLocation getEntityTexture(Entity entity)
{       
    _ProjectileBase shot = (_ProjectileBase) entity;
    String loc = shot.getEntityTexturePath();

    if (loc != null) { return new ResourceLocation("quiverchevsky", loc); }
    else    // Texture path is null. Is this using an MC-internal texture?
    {           
        byte[] type = shot.getRenderType();

        if (type[0] == 1) { return new ResourceLocation("textures/entity/arrow.png"); } // Regular arrow
    }

    return TextureMap.locationItemsTexture; // Fallback. Can't remember the damn texture map location, which is what I need for items
}
BlockFluidRenderer.java 文件源码 项目:Backmemed 阅读 22 收藏 0 点赞 0 评论 0
protected void initAtlasSprites()
{
    TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
    this.atlasSpritesLava[0] = texturemap.getAtlasSprite("minecraft:blocks/lava_still");
    this.atlasSpritesLava[1] = texturemap.getAtlasSprite("minecraft:blocks/lava_flow");
    this.atlasSpritesWater[0] = texturemap.getAtlasSprite("minecraft:blocks/water_still");
    this.atlasSpritesWater[1] = texturemap.getAtlasSprite("minecraft:blocks/water_flow");
    this.atlasSpriteWaterOverlay = texturemap.getAtlasSprite("minecraft:blocks/water_overlay");
}
LayerMooshroomMushroom.java 文件源码 项目:BaseClient 阅读 19 收藏 0 点赞 0 评论 0
public void doRenderLayer(EntityMooshroom entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    if (!entitylivingbaseIn.isChild() && !entitylivingbaseIn.isInvisible())
    {
        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        this.mooshroomRenderer.bindTexture(TextureMap.locationBlocksTexture);
        GlStateManager.enableCull();
        GlStateManager.cullFace(1028);
        GlStateManager.pushMatrix();
        GlStateManager.scale(1.0F, -1.0F, 1.0F);
        GlStateManager.translate(0.2F, 0.35F, 0.5F);
        GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.pushMatrix();
        GlStateManager.translate(-0.5F, -0.5F, 0.5F);
        blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getDefaultState(), 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.1F, 0.0F, -0.6F);
        GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(-0.5F, -0.5F, 0.5F);
        blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getDefaultState(), 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.popMatrix();
        GlStateManager.pushMatrix();
        ((ModelQuadruped)this.mooshroomRenderer.getMainModel()).head.postRender(0.0625F);
        GlStateManager.scale(1.0F, -1.0F, 1.0F);
        GlStateManager.translate(0.0F, 0.7F, -0.2F);
        GlStateManager.rotate(12.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(-0.5F, -0.5F, 0.5F);
        blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getDefaultState(), 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.cullFace(1029);
        GlStateManager.disableCull();
    }
}
BlockFluidRenderer.java 文件源码 项目:BaseClient 阅读 27 收藏 0 点赞 0 评论 0
protected void initAtlasSprites()
{
    TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
    this.atlasSpritesLava[0] = texturemap.getAtlasSprite("minecraft:blocks/lava_still");
    this.atlasSpritesLava[1] = texturemap.getAtlasSprite("minecraft:blocks/lava_flow");
    this.atlasSpritesWater[0] = texturemap.getAtlasSprite("minecraft:blocks/water_still");
    this.atlasSpritesWater[1] = texturemap.getAtlasSprite("minecraft:blocks/water_flow");
}
GuiBarrel.java 文件源码 项目:Bewitchment 阅读 31 收藏 0 点赞 0 评论 0
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
    this.drawDefaultBackground();
    if (te != null) {
        FluidStack fstack = te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null).drain(1000, false);
        Minecraft.getMinecraft().renderEngine.bindTexture(texture);
        drawTexturedModalRect(guiLeft + 62, guiTop + 17, 176, 32, 52, 16);
        if (fstack == null) {
            drawTexturedModalRect(guiLeft + 80, guiTop + 17, xSize, 0, 16, 16);
        } else {
            TextureMap map = Minecraft.getMinecraft().getTextureMapBlocks();
            TextureAtlasSprite sprite = map.getTextureExtry(fstack.getFluid().getStill().toString());
            Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
            for (int i = 0; i < 4; i++) drawTexturedModalRect(guiLeft + 62 + (16 * i), guiTop + 17, sprite, 16, 16);
        }
    }
    Minecraft.getMinecraft().renderEngine.bindTexture(texture);
    drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
    if (te != null) {

        int[] data = ((ContainerBarrel) inventorySlots).data_a;
        if (data[2] > 0) {
            double progress = (double) data[0] / (double) data[2];
            if (progress > 1) progress = 1;
            int dy = (int) Math.ceil(31 * progress);
            drawTexturedModalRect(guiLeft + 29, guiTop + 27 + 31 - dy, 0, ySize + 31 - dy, 11, dy);
        }
        float absorption = 1;
        if (data[3] > 0) absorption = (float) data[1] / (float) data[3];
        GlStateManager.pushMatrix();
        {
            GlStateManager.color(2 * (1f - absorption), 2 * absorption, 0f);
            drawTexturedModalRect(guiLeft + 134, guiTop + 20, xSize, 16, 16, 16);
            GlStateManager.color(1f, 1f, 1f);
        }
        GlStateManager.popMatrix();
    }
}
JEIHereticRitualCategory.java 文件源码 项目:harshencastle 阅读 23 收藏 0 点赞 0 评论 0
@Override
protected void drawMore(Minecraft minecraft) {
    if(currentFluid != null)
        currentFluid.draw(minecraft, 6, 46);
    else
    {
        Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        TextureAtlasSprite textureSprite = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getTexture((IBlockState) catalyst.getStateOrLoc());
        Minecraft.getMinecraft().currentScreen.drawTexturedModalRect(6, 46, textureSprite, 17, 17);

    }
       ritualFront.draw(minecraft);
}
RenderHelper.java 文件源码 项目:Lector 阅读 30 收藏 0 点赞 0 评论 0
public static void customRenderItem(ItemStack is, boolean normal) {
        RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
        TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();

//        IBakedModel ibakedmodel = renderItem.getItemModelMesher().getItemModel(is);
        EntityPlayerSP player = MinecraftTools.getPlayer(Minecraft.getMinecraft());
        IBakedModel ibakedmodel = renderItem.getItemModelWithOverrides(is, player.getEntityWorld(), player);

        textureManager.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        textureManager.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).setBlurMipmap(false, false);
        preTransform(renderItem, is);
        GlStateManager.enableRescaleNormal();
        GlStateManager.alphaFunc(516, 0.1F);

        if (normal) {
            GlStateManager.enableBlend();
            GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
        }

        GlStateManager.pushMatrix();
        ibakedmodel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel, ItemCameraTransforms.TransformType.NONE, false);

        renderItem.renderItem(is, ibakedmodel);
        GlStateManager.cullFace(GlStateManager.CullFace.BACK);
        GlStateManager.popMatrix();
        GlStateManager.disableRescaleNormal();

        if (normal) {
            GlStateManager.disableBlend();
        }

        textureManager.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        textureManager.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap();
    }
TileEntityGlassTerminalRenderer.java 文件源码 项目:GeneralLaymansAestheticSpyingScreen 阅读 21 收藏 0 点赞 0 评论 0
@Override
public void render(TileEntityGlassTerminal te, double x, double y, double z, float partialTick, int destroyStage, float alpha1)
{
    if(WorldPortalRenderer.renderLevel == 0)
    {
        bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        GlStateManager.pushMatrix();
        GlStateManager.disableLighting();

        GlStateManager.color(1F, 1F, 1F, 1F);

        GlStateManager.translate(x, y, z);

        Tessellator tessellator = Tessellator.getInstance();
        BufferBuilder bufferbuilder = tessellator.getBuffer();

        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        bufferbuilder.begin(7, DefaultVertexFormats.BLOCK);
        blockrendererdispatcher.getBlockModelRenderer().renderModel(te.getWorld(), blockrendererdispatcher.getModelForState(Blocks.OBSIDIAN.getDefaultState()), Blocks.OBSIDIAN.getDefaultState(), BlockPos.ORIGIN, bufferbuilder, false);
        tessellator.draw();

        GlStateManager.pushMatrix();
        float scale = 0.25F;
        GlStateManager.translate(0.5D, 0.5D, 0.5D);
        GlStateManager.rotate(45F, te.facing.getFrontOffsetX(), te.facing.getFrontOffsetY(), te.facing.getFrontOffsetZ());
        GlStateManager.translate(-0.5D, -0.5D, -0.5D);

        GlStateManager.translate(0.375D, 0.375D, 0.375D);
        GlStateManager.translate(te.facing.getFrontOffsetX() * -0.4D, te.facing.getFrontOffsetY() * -0.4D, te.facing.getFrontOffsetZ() * -0.4D);
        GlStateManager.scale(scale, scale, scale);

        bufferbuilder.begin(7, DefaultVertexFormats.BLOCK);
        blockrendererdispatcher.getBlockModelRenderer().renderModel(te.getWorld(), blockrendererdispatcher.getModelForState(Blocks.GLASS.getDefaultState()), Blocks.GLASS.getDefaultState(), BlockPos.ORIGIN, bufferbuilder, false);
        tessellator.draw();
        GlStateManager.popMatrix();

        GlStateManager.enableLighting();
        GlStateManager.popMatrix();
    }
}
ExtraBlockBreakHandler.java 文件源码 项目:Adventurers-Toolbox 阅读 23 收藏 0 点赞 0 评论 0
@SubscribeEvent
public void renderBlockBreakAnim(RenderWorldLastEvent event) {
    GlStateManager.enableBlend();
       GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
       this.mc.getTextureManager().getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).setBlurMipmap(false, false);
       this.drawBlockDamageTexture(Tessellator.getInstance(), Tessellator.getInstance().getBuffer(), this.mc.getRenderViewEntity(), event.getPartialTicks());
       this.mc.getTextureManager().getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap();
       GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
       GlStateManager.disableBlend();
}
VacuumConveyorRenderer.java 文件源码 项目:Solar 阅读 18 收藏 0 点赞 0 评论 0
private void renderModel(EnumFacing facing, double x, double y, double z, float partialTicks) {
    float tick = RenderHelper.getRenderWorldTime(partialTicks);
    final float prevU = OpenGlHelper.lastBrightnessX;
    final float prevV = OpenGlHelper.lastBrightnessY;
    bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    //Top
    GlStateManager.pushMatrix();
    GlStateManager.translate(x + 0.5D, y + 0.5D, z + 0.5D);
    if(facing != null && facing != EnumFacing.UP && facing != EnumFacing.DOWN) {
        GlStateManager.rotate(90F, facing == EnumFacing.NORTH || facing == EnumFacing.SOUTH ? 1F : 0F, 0F, facing == EnumFacing.EAST || facing == EnumFacing.WEST ? 1F : 0F);
    }
    GlStateManager.pushMatrix();
    GlStateManager.rotate(partialTicks + tick * 0.5F % 360F, 0F, 1F, 0F);
    BlockBaker.render(BlockBaker.VACUUM_TOP);
    GlStateManager.popMatrix();
    //Middle
    GlStateManager.disableLighting();
    GLHelper.lightMap(255F, 255F);
    BlockBaker.render(BlockBaker.VACUUM_PIECE);
    GLHelper.lightMap(prevU, prevV);
    GlStateManager.enableLighting();
    //Bottom
    GlStateManager.pushMatrix();
    GlStateManager.rotate(partialTicks + tick * 0.5F % 360F, 0F, -1F, 0F);
    BlockBaker.render(BlockBaker.VACUUM_BOTTOM);
    GlStateManager.popMatrix();
    GlStateManager.popMatrix();
}
GuiIngame.java 文件源码 项目:CustomWorldGen 阅读 36 收藏 0 点赞 0 评论 0
protected void renderPortal(float timeInPortal, ScaledResolution scaledRes)
{
    if (timeInPortal < 1.0F)
    {
        timeInPortal = timeInPortal * timeInPortal;
        timeInPortal = timeInPortal * timeInPortal;
        timeInPortal = timeInPortal * 0.8F + 0.2F;
    }

    GlStateManager.disableAlpha();
    GlStateManager.disableDepth();
    GlStateManager.depthMask(false);
    GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
    GlStateManager.color(1.0F, 1.0F, 1.0F, timeInPortal);
    this.mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    TextureAtlasSprite textureatlassprite = this.mc.getBlockRendererDispatcher().getBlockModelShapes().getTexture(Blocks.PORTAL.getDefaultState());
    float f = textureatlassprite.getMinU();
    float f1 = textureatlassprite.getMinV();
    float f2 = textureatlassprite.getMaxU();
    float f3 = textureatlassprite.getMaxV();
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
    vertexbuffer.pos(0.0D, (double)scaledRes.getScaledHeight(), -90.0D).tex((double)f, (double)f3).endVertex();
    vertexbuffer.pos((double)scaledRes.getScaledWidth(), (double)scaledRes.getScaledHeight(), -90.0D).tex((double)f2, (double)f3).endVertex();
    vertexbuffer.pos((double)scaledRes.getScaledWidth(), 0.0D, -90.0D).tex((double)f2, (double)f1).endVertex();
    vertexbuffer.pos(0.0D, 0.0D, -90.0D).tex((double)f, (double)f1).endVertex();
    tessellator.draw();
    GlStateManager.depthMask(true);
    GlStateManager.enableDepth();
    GlStateManager.enableAlpha();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}


问题


面经


文章

微信
公众号

扫码关注公众号