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


Java AbstractTexture类代码示例

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


AbstractTexture类属于net.minecraft.client.renderer.texture包,在下文中一共展示了AbstractTexture类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMultiTexID

import net.minecraft.client.renderer.texture.AbstractTexture; //导入依赖的package包/类
public static MultiTexID getMultiTexID(AbstractTexture tex)
{
    MultiTexID multitexid = tex.multiTex;

    if (multitexid == null)
    {
        int i = tex.getGlTextureId();
        multitexid = (MultiTexID)multiTexMap.get(Integer.valueOf(i));

        if (multitexid == null)
        {
            multitexid = new MultiTexID(i, GL11.glGenTextures(), GL11.glGenTextures());
            multiTexMap.put(Integer.valueOf(i), multitexid);
        }

        tex.multiTex = multitexid;
    }

    return multitexid;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:21,代码来源:ShadersTex.java

示例2: deleteTextures

import net.minecraft.client.renderer.texture.AbstractTexture; //导入依赖的package包/类
public static void deleteTextures(AbstractTexture atex, int texid)
{
    MultiTexID multitexid = atex.multiTex;

    if (multitexid != null)
    {
        atex.multiTex = null;
        multiTexMap.remove(Integer.valueOf(multitexid.base));
        GlStateManager.deleteTexture(multitexid.norm);
        GlStateManager.deleteTexture(multitexid.spec);

        if (multitexid.base != texid)
        {
            SMCLog.warning("Error : MultiTexID.base mismatch: " + multitexid.base + ", texid: " + texid);
            GlStateManager.deleteTexture(multitexid.base);
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:19,代码来源:ShadersTex.java

示例3: spawnPaintEffect

import net.minecraft.client.renderer.texture.AbstractTexture; //导入依赖的package包/类
public static void spawnPaintEffect(World world,int x, int y, int z) {
	TileEntity te = world.getTileEntity(x, y, z);
	if (! (te instanceof TileEntityStatue))
		return;
	TileEntityStatue statue=(TileEntityStatue) te;
	EntityStatuePlayer player=statue.getStatue();
	
	AbstractTexture tex=player.getTextureSkin();
	
	for(int side=2;side<6;side++){
		for(int i=0;i<80;i++){
			EntityTextureFX p=addTextureEffects(world,x,y+i%2,z,tex,side,0.05f,0.1f);
			if(p!=null) world.spawnEntityInWorld(p);
		}
	}
	
}
 
开发者ID:asiekierka,项目名称:Statues,代码行数:18,代码来源:GeneralStatueClient.java

示例4: EntityTextureFX

import net.minecraft.client.renderer.texture.AbstractTexture; //导入依赖的package包/类
public EntityTextureFX(World world, double x, double y, double z, double vx, double vy, double vz,AbstractTexture tex,float particleScaleU,float particleScaleV) {
	super(world);
       
	setPosition(x,y,z);
	setSize(0.2f,0.2f);
	
	prevPosX = posX;
	prevPosY = posY;
	prevPosZ = posZ;
	
       motionX = vx;
       motionY = vy;
       motionZ = vz;
       
       texture=tex;	
       
       particleAge=0;
       particleMaxAge=2+rand.nextInt(12);
       scaleU=particleScaleU;
       scaleV=particleScaleV;
       
       pu=rand.nextFloat()*(1.0f-scaleU);
       pv=rand.nextFloat()*(1.0f-scaleV);
}
 
开发者ID:asiekierka,项目名称:Statues,代码行数:25,代码来源:EntityTextureFX.java

示例5: applySkin

import net.minecraft.client.renderer.texture.AbstractTexture; //导入依赖的package包/类
public void applySkin(String name, Block block, int side, int meta) {
	if(block==null) block=Blocks.stone;
	
	ResourceLocation steveSkin = new ResourceLocation("statues:textures/steve.png|B" + Block.getIdFromBlock(block) + "," + side + "," + meta);
	AbstractTexture steveDataSkin = getDataForSteve(steveSkin, new ResourceLocation("statues:textures/steve.png"), block, side, meta);

	if (name != null && !name.isEmpty()) {
		skin = new ResourceLocation("skins/" + StringUtils.stripControlCodes(name) + "|B" + Block.getIdFromBlock(block) + "," + side + "," + meta);
		dataSkin = getTextureForSkin(skin, steveDataSkin, name, block, side, meta);
	} else {
		skin = steveSkin;
		dataSkin = steveDataSkin;
	}
}
 
开发者ID:asiekierka,项目名称:Statues,代码行数:15,代码来源:EntityStatuePlayer.java

示例6: getTextureForSkin

import net.minecraft.client.renderer.texture.AbstractTexture; //导入依赖的package包/类
public AbstractTexture getTextureForSkin(ResourceLocation skin, AbstractTexture fallbackSkin, String name, Block block, int side, int meta) {
	TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
	AbstractTexture tex = (AbstractTexture) texturemanager.getTexture(skin);

	if (tex == null) {
		tex = new StatueTextureDownloaded(skin, Statues.skinServerLocation + name + ".png", fallbackSkin, new ImageStatueBufferDownload(this, block, side, meta, name+"."+Block.getIdFromBlock(block)+"."+meta));
		texturemanager.loadTexture(skin, tex);
	}

	return tex;
}
 
开发者ID:asiekierka,项目名称:Statues,代码行数:12,代码来源:EntityStatuePlayer.java

示例7: getDataForSteve

import net.minecraft.client.renderer.texture.AbstractTexture; //导入依赖的package包/类
public AbstractTexture getDataForSteve(ResourceLocation skin, ResourceLocation base, Block block, int side, int meta) {
	TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
	AbstractTexture tex = (AbstractTexture) texturemanager.getTexture(skin);

	if (tex == null) {
		tex = new StatueTextureStatic(base, new ImageStatueBufferDownload(this, block, side, meta,"steve."+Block.getIdFromBlock(block)+"."+meta));
		texturemanager.loadTexture(skin, tex);
	}

	return tex;
}
 
开发者ID:asiekierka,项目名称:Statues,代码行数:12,代码来源:EntityStatuePlayer.java

示例8: getBlockTexture

import net.minecraft.client.renderer.texture.AbstractTexture; //导入依赖的package包/类
private AbstractTexture getBlockTexture() {
	final TextureManager texturemanager = rendererDispatcher.renderEngine;
	if (texturemanager != null) {
		final ITextureObject texture = texturemanager.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
		if (texture instanceof AbstractTexture)
			return (AbstractTexture)texture;
	}

	return null;
}
 
开发者ID:OpenMods,项目名称:OpenBlocks,代码行数:11,代码来源:TileEntityTrophyRenderer.java

示例9: addTextureEffects

import net.minecraft.client.renderer.texture.AbstractTexture; //导入依赖的package包/类
public static EntityTextureFX addTextureEffects(World world, int x, int y, int z, AbstractTexture texture, int side,float u,float v) {
	Block block = world.getBlock(x, y, z);
	if(block==null) return null;
	
	double w = block.getBlockBoundsMaxX() - block.getBlockBoundsMinX();
	double h = block.getBlockBoundsMaxY() - block.getBlockBoundsMinY();
	double l = block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ();
	double px = rand.nextDouble() * w;
	double py = rand.nextDouble() * h;
	double pz = rand.nextDouble() * l;
	
	float f = 0.25F;
	double d0 = x + block.getBlockBoundsMinX() + px;
	double d1 = y + block.getBlockBoundsMinY() + py;
	double d2 = z + block.getBlockBoundsMinZ() + pz;

	switch (side) {
	case 0:
		d1 = y + block.getBlockBoundsMinY() - f;
		break;
	case 1:
		d1 = y + block.getBlockBoundsMaxY() + f;
		break;
	case 2:
		d2 = z + block.getBlockBoundsMinZ() - f;
		break;
	case 3:
		d2 = z + block.getBlockBoundsMaxZ() + f;
		break;
	case 4:
		d0 = x + block.getBlockBoundsMinX() - f;
		break;
	case 5:
		d0 = x + block.getBlockBoundsMaxX() + f;
		break;
	}

	double motion=0.5;
	EntityTextureFX res = new EntityTextureFX(world, d0, d1, d2, motion*(px/w-0.5), motion*(py/h-0.5), motion*(pz/l-0.5), texture, u, v);

	return res;
}
 
开发者ID:asiekierka,项目名称:Statues,代码行数:43,代码来源:GeneralStatueClient.java

示例10: getTextureSkin

import net.minecraft.client.renderer.texture.AbstractTexture; //导入依赖的package包/类
public AbstractTexture getTextureSkin() {
	return dataSkin;
}
 
开发者ID:asiekierka,项目名称:Statues,代码行数:4,代码来源:EntityStatuePlayer.java

示例11: renderTrophy

import net.minecraft.client.renderer.texture.AbstractTexture; //导入依赖的package包/类
private void renderTrophy(Trophy type, double x, double y, double z, float angle) {
	Entity entity = type.getEntity();
	if (entity != null) {
		GL11.glPushMatrix();
		GL11.glTranslated(x, y + type.getVerticalOffset() + 0.2, z);
		GL11.glRotatef(angle, 0, 1, 0);

		final double ratio = type.getScale();
		GL11.glScaled(ratio, ratio, ratio);
		World renderWorld = RenderUtils.getRenderWorld();
		if (renderWorld != null) {
			Render<Entity> renderer = Minecraft.getMinecraft().getRenderManager().getEntityRenderObject(entity);
			// yeah we don't care about fonts, but we do care that the
			// renderManager is available
			if (renderer != null && renderer.getFontRendererFromRenderManager() != null) {

				final boolean blurLast;
				final boolean mipmapLast;
				final AbstractTexture blocksTexture = getBlockTexture();
				if (blocksTexture != null) {
					blurLast = blocksTexture.blurLast;
					mipmapLast = blocksTexture.mipmapLast;
				} else {
					blurLast = false;
					mipmapLast = false;
				}

				GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
				final boolean lightmapEnabled = GL11.glGetBoolean(GL11.GL_TEXTURE_2D);
				GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);

				synchronized (entity) {
					entity.world = renderWorld;
					renderer.doRender(entity, 0, 0, 0, 0, 0);
					entity.world = null;
				}

				GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
				if (lightmapEnabled) GlStateManager.enableTexture2D();
				else GlStateManager.disableTexture2D();
				GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);

				if (blocksTexture != null) {
					blocksTexture.mipmapLast = mipmapLast;
					blocksTexture.blurLast = blurLast;
				}
			}
		}
		GL11.glPopMatrix();

	}
}
 
开发者ID:OpenMods,项目名称:OpenBlocks,代码行数:53,代码来源:TileEntityTrophyRenderer.java


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