当前位置: 首页>>代码示例>>Java>>正文


Java TextureMap.getAtlasSprite方法代码示例

本文整理汇总了Java中net.minecraft.client.renderer.texture.TextureMap.getAtlasSprite方法的典型用法代码示例。如果您正苦于以下问题:Java TextureMap.getAtlasSprite方法的具体用法?Java TextureMap.getAtlasSprite怎么用?Java TextureMap.getAtlasSprite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.renderer.texture.TextureMap的用法示例。


在下文中一共展示了TextureMap.getAtlasSprite方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initAtlasSprites

import net.minecraft.client.renderer.texture.TextureMap; //导入方法依赖的package包/类
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");
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:9,代码来源:BlockFluidRenderer.java

示例2: updateDestroyBlockIcons

import net.minecraft.client.renderer.texture.TextureMap; //导入方法依赖的package包/类
private void updateDestroyBlockIcons()
{
    TextureMap texturemap = this.mc.getTextureMapBlocks();

    for (int i = 0; i < this.destroyBlockIcons.length; ++i)
    {
        this.destroyBlockIcons[i] = texturemap.getAtlasSprite("minecraft:blocks/destroy_stage_" + i);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:10,代码来源:RenderGlobal.java

示例3: makeItemModel

import net.minecraft.client.renderer.texture.TextureMap; //导入方法依赖的package包/类
public ModelBlock makeItemModel(TextureMap textureMapIn, ModelBlock blockModel)
{
    Map<String, String> map = Maps.<String, String>newHashMap();
    List<BlockPart> list = Lists.<BlockPart>newArrayList();

    for (int i = 0; i < LAYERS.size(); ++i)
    {
        String s = (String)LAYERS.get(i);

        if (!blockModel.isTexturePresent(s))
        {
            break;
        }

        String s1 = blockModel.resolveTextureName(s);
        map.put(s, s1);
        TextureAtlasSprite textureatlassprite = textureMapIn.getAtlasSprite((new ResourceLocation(s1)).toString());
        list.addAll(this.func_178394_a(i, s, textureatlassprite));
    }

    if (list.isEmpty())
    {
        return null;
    }
    else
    {
        map.put("particle", blockModel.isTexturePresent("particle") ? blockModel.resolveTextureName("particle") : (String)map.get("layer0"));
        return new ModelBlock(list, map, false, false, blockModel.func_181682_g());
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:31,代码来源:ItemModelGenerator.java

示例4: makeItemModel

import net.minecraft.client.renderer.texture.TextureMap; //导入方法依赖的package包/类
public ModelBlock makeItemModel(TextureMap textureMapIn, ModelBlock blockModel)
{
    Map<String, String> map = Maps.<String, String>newHashMap();
    List<BlockPart> list = Lists.<BlockPart>newArrayList();

    for (int i = 0; i < LAYERS.size(); ++i)
    {
        String s = (String)LAYERS.get(i);

        if (!blockModel.isTexturePresent(s))
        {
            break;
        }

        String s1 = blockModel.resolveTextureName(s);
        map.put(s, s1);
        TextureAtlasSprite textureatlassprite = textureMapIn.getAtlasSprite((new ResourceLocation(s1)).toString());
        list.addAll(this.getBlockParts(i, s, textureatlassprite));
    }

    if (list.isEmpty())
    {
        return null;
    }
    else
    {
        map.put("particle", blockModel.isTexturePresent("particle") ? blockModel.resolveTextureName("particle") : (String)map.get("layer0"));
        return new ModelBlock((ResourceLocation)null, list, map, false, false, blockModel.getAllTransforms(), blockModel.getOverrides());
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:31,代码来源:ItemModelGenerator.java

示例5: onResourceManagerReload

import net.minecraft.client.renderer.texture.TextureMap; //导入方法依赖的package包/类
@Override
public void onResourceManagerReload(IResourceManager resourceManager) {
	TextureMap texturemap = this.mc.getTextureMapBlocks();

    for (int i = 0; i < this.destroyBlockIcons.length; ++i) {
        this.destroyBlockIcons[i] = texturemap.getAtlasSprite("minecraft:blocks/destroy_stage_" + i);
    }
}
 
开发者ID:the-realest-stu,项目名称:Adventurers-Toolbox,代码行数:9,代码来源:ExtraBlockBreakHandler.java

示例6: initAtlasSprites

import net.minecraft.client.renderer.texture.TextureMap; //导入方法依赖的package包/类
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");
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:10,代码来源:BlockFluidRenderer.java

示例7: makeItemModel

import net.minecraft.client.renderer.texture.TextureMap; //导入方法依赖的package包/类
@Nullable
public ModelBlock makeItemModel(TextureMap textureMapIn, ModelBlock blockModel)
{
    Map<String, String> map = Maps.<String, String>newHashMap();
    List<BlockPart> list = Lists.<BlockPart>newArrayList();

    for (int i = 0; i < LAYERS.size(); ++i)
    {
        String s = (String)LAYERS.get(i);

        if (!blockModel.isTexturePresent(s))
        {
            break;
        }

        String s1 = blockModel.resolveTextureName(s);
        map.put(s, s1);
        TextureAtlasSprite textureatlassprite = textureMapIn.getAtlasSprite((new ResourceLocation(s1)).toString());
        list.addAll(this.getBlockParts(i, s, textureatlassprite));
    }

    if (list.isEmpty())
    {
        return null;
    }
    else
    {
        map.put("particle", blockModel.isTexturePresent("particle") ? blockModel.resolveTextureName("particle") : (String)map.get("layer0"));
        return new ModelBlock((ResourceLocation)null, list, map, false, false, blockModel.getAllTransforms(), blockModel.getOverrides());
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:32,代码来源:ItemModelGenerator.java

示例8: renderEntityOnFire

import net.minecraft.client.renderer.texture.TextureMap; //导入方法依赖的package包/类
/**
 * Renders fire on top of the entity. Args: entity, x, y, z, partialTickTime
 */
private void renderEntityOnFire(Entity entity, double x, double y, double z, float partialTicks)
{
    GlStateManager.disableLighting();
    TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
    TextureAtlasSprite textureatlassprite = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_0");
    TextureAtlasSprite textureatlassprite1 = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_1");
    GlStateManager.pushMatrix();
    GlStateManager.translate((float)x, (float)y, (float)z);
    float f = entity.width * 1.4F;
    GlStateManager.scale(f, f, f);
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    float f1 = 0.5F;
    float f2 = 0.0F;
    float f3 = entity.height / f;
    float f4 = (float)(entity.posY - entity.getEntityBoundingBox().minY);
    GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GlStateManager.translate(0.0F, 0.0F, -0.3F + (float)((int)f3) * 0.02F);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    float f5 = 0.0F;
    int i = 0;
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);

    while (f3 > 0.0F)
    {
        TextureAtlasSprite textureatlassprite2 = i % 2 == 0 ? textureatlassprite : textureatlassprite1;
        this.bindTexture(TextureMap.locationBlocksTexture);
        float f6 = textureatlassprite2.getMinU();
        float f7 = textureatlassprite2.getMinV();
        float f8 = textureatlassprite2.getMaxU();
        float f9 = textureatlassprite2.getMaxV();

        if (i / 2 % 2 == 0)
        {
            float f10 = f8;
            f8 = f6;
            f6 = f10;
        }

        worldrenderer.pos((double)(f1 - f2), (double)(0.0F - f4), (double)f5).tex((double)f8, (double)f9).endVertex();
        worldrenderer.pos((double)(-f1 - f2), (double)(0.0F - f4), (double)f5).tex((double)f6, (double)f9).endVertex();
        worldrenderer.pos((double)(-f1 - f2), (double)(1.4F - f4), (double)f5).tex((double)f6, (double)f7).endVertex();
        worldrenderer.pos((double)(f1 - f2), (double)(1.4F - f4), (double)f5).tex((double)f8, (double)f7).endVertex();
        f3 -= 0.45F;
        f4 -= 0.45F;
        f1 *= 0.9F;
        f5 += 0.03F;
        ++i;
    }

    tessellator.draw();
    GlStateManager.popMatrix();
    GlStateManager.enableLighting();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:58,代码来源:Render.java

示例9: renderEntityOnFire

import net.minecraft.client.renderer.texture.TextureMap; //导入方法依赖的package包/类
/**
 * Renders fire on top of the entity. Args: entity, x, y, z, partialTickTime
 */
private void renderEntityOnFire(Entity entity, double x, double y, double z, float partialTicks) {
	GlStateManager.disableLighting();
	TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
	TextureAtlasSprite textureatlassprite = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_0");
	TextureAtlasSprite textureatlassprite1 = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_1");
	GlStateManager.pushMatrix();
	GlStateManager.translate((float) x, (float) y, (float) z);
	float f = entity.width * 1.4F;
	GlStateManager.scale(f, f, f);
	Tessellator tessellator = Tessellator.getInstance();
	WorldRenderer worldrenderer = tessellator.getWorldRenderer();
	float f1 = 0.5F;
	float f2 = 0.0F;
	float f3 = entity.height / f;
	float f4 = (float) (entity.posY - entity.getEntityBoundingBox().minY);
	GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
	GlStateManager.translate(0.0F, 0.0F, -0.3F + (float) ((int) f3) * 0.02F);
	GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
	float f5 = 0.0F;
	int i = 0;
	worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);

	while (f3 > 0.0F) {
		TextureAtlasSprite textureatlassprite2 = i % 2 == 0 ? textureatlassprite : textureatlassprite1;
		this.bindTexture(TextureMap.locationBlocksTexture);
		float f6 = textureatlassprite2.getMinU();
		float f7 = textureatlassprite2.getMinV();
		float f8 = textureatlassprite2.getMaxU();
		float f9 = textureatlassprite2.getMaxV();

		if (i / 2 % 2 == 0) {
			float f10 = f8;
			f8 = f6;
			f6 = f10;
		}

		worldrenderer.pos((double) (f1 - f2), (double) (0.0F - f4), (double) f5).tex((double) f8, (double) f9)
				.endVertex();
		worldrenderer.pos((double) (-f1 - f2), (double) (0.0F - f4), (double) f5).tex((double) f6, (double) f9)
				.endVertex();
		worldrenderer.pos((double) (-f1 - f2), (double) (1.4F - f4), (double) f5).tex((double) f6, (double) f7)
				.endVertex();
		worldrenderer.pos((double) (f1 - f2), (double) (1.4F - f4), (double) f5).tex((double) f8, (double) f7)
				.endVertex();
		f3 -= 0.45F;
		f4 -= 0.45F;
		f1 *= 0.9F;
		f5 += 0.03F;
		++i;
	}

	tessellator.draw();
	GlStateManager.popMatrix();
	GlStateManager.enableLighting();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:59,代码来源:Render.java

示例10: renderEntityOnFire

import net.minecraft.client.renderer.texture.TextureMap; //导入方法依赖的package包/类
/**
 * Renders a layer of fire on top of an entity.
 */
private void renderEntityOnFire(Entity entity, double x, double y, double z, float partialTicks)
{
    GlStateManager.disableLighting();
    TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
    TextureAtlasSprite textureatlassprite = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_0");
    TextureAtlasSprite textureatlassprite1 = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_1");
    GlStateManager.pushMatrix();
    GlStateManager.translate((float)x, (float)y, (float)z);
    float f = entity.width * 1.4F;
    GlStateManager.scale(f, f, f);
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    float f1 = 0.5F;
    float f2 = 0.0F;
    float f3 = entity.height / f;
    float f4 = (float)(entity.posY - entity.getEntityBoundingBox().minY);
    GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GlStateManager.translate(0.0F, 0.0F, -0.3F + (float)((int)f3) * 0.02F);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    float f5 = 0.0F;
    int i = 0;
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);

    while (f3 > 0.0F)
    {
        TextureAtlasSprite textureatlassprite2 = i % 2 == 0 ? textureatlassprite : textureatlassprite1;
        this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        float f6 = textureatlassprite2.getMinU();
        float f7 = textureatlassprite2.getMinV();
        float f8 = textureatlassprite2.getMaxU();
        float f9 = textureatlassprite2.getMaxV();

        if (i / 2 % 2 == 0)
        {
            float f10 = f8;
            f8 = f6;
            f6 = f10;
        }

        vertexbuffer.pos((double)(f1 - 0.0F), (double)(0.0F - f4), (double)f5).tex((double)f8, (double)f9).endVertex();
        vertexbuffer.pos((double)(-f1 - 0.0F), (double)(0.0F - f4), (double)f5).tex((double)f6, (double)f9).endVertex();
        vertexbuffer.pos((double)(-f1 - 0.0F), (double)(1.4F - f4), (double)f5).tex((double)f6, (double)f7).endVertex();
        vertexbuffer.pos((double)(f1 - 0.0F), (double)(1.4F - f4), (double)f5).tex((double)f8, (double)f7).endVertex();
        f3 -= 0.45F;
        f4 -= 0.45F;
        f1 *= 0.9F;
        f5 += 0.03F;
        ++i;
    }

    tessellator.draw();
    GlStateManager.popMatrix();
    GlStateManager.enableLighting();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:58,代码来源:Render.java


注:本文中的net.minecraft.client.renderer.texture.TextureMap.getAtlasSprite方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。