本文整理汇总了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;
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例10: getTextureSkin
import net.minecraft.client.renderer.texture.AbstractTexture; //导入依赖的package包/类
public AbstractTexture getTextureSkin() {
return dataSkin;
}
示例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();
}
}