本文整理匯總了Java中net.minecraft.client.renderer.texture.TextureManager類的典型用法代碼示例。如果您正苦於以下問題:Java TextureManager類的具體用法?Java TextureManager怎麽用?Java TextureManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TextureManager類屬於net.minecraft.client.renderer.texture包,在下文中一共展示了TextureManager類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateTextureMinMagFilter
import net.minecraft.client.renderer.texture.TextureManager; //導入依賴的package包/類
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);
}
}
示例2: updateTextureMinMagFilter
import net.minecraft.client.renderer.texture.TextureManager; //導入依賴的package包/類
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);
}
}
示例3: renderItemInWorld
import net.minecraft.client.renderer.texture.TextureManager; //導入依賴的package包/類
@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();
}
}
示例4: EffectRenderer
import net.minecraft.client.renderer.texture.TextureManager; //導入依賴的package包/類
public EffectRenderer(World worldIn, TextureManager rendererIn)
{
this.worldObj = worldIn;
this.renderer = rendererIn;
for (int i = 0; i < 4; ++i)
{
this.fxLayers[i] = new List[2];
for (int j = 0; j < 2; ++j)
{
this.fxLayers[i][j] = Lists.newArrayList();
}
}
this.registerVanillaParticles();
}
示例5: cacheActiveRenderInfo
import net.minecraft.client.renderer.texture.TextureManager; //導入依賴的package包/類
public void cacheActiveRenderInfo(World worldIn, TextureManager textureManagerIn, FontRenderer fontrendererIn, Entity entityIn, float partialTicks)
{
if (this.worldObj != worldIn)
{
this.setWorld(worldIn);
}
this.renderEngine = textureManagerIn;
this.entity = entityIn;
this.fontRenderer = fontrendererIn;
this.entityYaw = entityIn.prevRotationYaw + (entityIn.rotationYaw - entityIn.prevRotationYaw) * partialTicks;
this.entityPitch = entityIn.prevRotationPitch + (entityIn.rotationPitch - entityIn.prevRotationPitch) * partialTicks;
this.entityX = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double)partialTicks;
this.entityY = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double)partialTicks;
this.entityZ = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double)partialTicks;
}
示例6: getTextureHeight
import net.minecraft.client.renderer.texture.TextureManager; //導入依賴的package包/類
public float getTextureHeight(TextureManager p_getTextureHeight_1_)
{
if (this.textureHeight <= 0)
{
if (this.textureLocation != null)
{
ITextureObject itextureobject = p_getTextureHeight_1_.getTexture(this.textureLocation);
int i = itextureobject.getGlTextureId();
int j = GlStateManager.getBoundTexture();
GlStateManager.bindTexture(i);
this.textureHeight = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT);
GlStateManager.bindTexture(j);
}
if (this.textureHeight <= 0)
{
this.textureHeight = 16;
}
}
return (float)this.textureHeight;
}
示例7: getTextureWidth
import net.minecraft.client.renderer.texture.TextureManager; //導入依賴的package包/類
public float getTextureWidth(TextureManager p_getTextureWidth_1_)
{
if (this.textureWidth <= 0)
{
if (this.textureLocation != null)
{
ITextureObject itextureobject = p_getTextureWidth_1_.getTexture(this.textureLocation);
int i = itextureobject.getGlTextureId();
int j = GlStateManager.getBoundTexture();
GlStateManager.bindTexture(i);
this.textureWidth = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH);
GlStateManager.bindTexture(j);
}
if (this.textureWidth <= 0)
{
this.textureWidth = 16;
}
}
return (float)this.textureWidth;
}
示例8: RenderItem
import net.minecraft.client.renderer.texture.TextureManager; //導入依賴的package包/類
public RenderItem(TextureManager textureManager, ModelManager modelManager)
{
this.textureManager = textureManager;
Config.setModelManager(modelManager);
if (Reflector.ItemModelMesherForge_Constructor.exists())
{
this.itemModelMesher = (ItemModelMesher)Reflector.newInstance(Reflector.ItemModelMesherForge_Constructor, new Object[] {modelManager});
}
else
{
this.itemModelMesher = new ItemModelMesher(modelManager);
}
this.registerItems();
}
示例9: ParticleManager
import net.minecraft.client.renderer.texture.TextureManager; //導入依賴的package包/類
public ParticleManager(World worldIn, TextureManager rendererIn)
{
this.worldObj = worldIn;
this.renderer = rendererIn;
for (int i = 0; i < 4; ++i)
{
this.fxLayers[i] = new ArrayDeque[2];
for (int j = 0; j < 2; ++j)
{
this.fxLayers[i][j] = Queues.newArrayDeque();
}
}
this.registerVanillaParticles();
}
示例10: render
import net.minecraft.client.renderer.texture.TextureManager; //導入依賴的package包/類
private void render(EntityPlayerSP player, float partialTicks) {
double x = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks;
double y = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks;
double z = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks;
TextureManager tm = Minecraft.getMinecraft().renderEngine;
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
GL11.glPushMatrix();
GL11.glColor4f(1.0f, 1.0f, 1.0f, 0.3f);
GL11.glEnable(GL11.GL_BLEND);
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
if (areaOverlays != null) {
for (PowerOverlayData overlay : areaOverlays) {
drawIconVectors(x, y, z, tm, overlay);
}
}
drawIconVectors(x, y, z, tm, cursorOverlay);
GL11.glPopMatrix();
GL11.glPopAttrib();
}
示例11: drawIconVectors
import net.minecraft.client.renderer.texture.TextureManager; //導入依賴的package包/類
private void drawIconVectors(double x, double y, double z, TextureManager tm, PowerOverlayData overlay) {
if (overlay == null || overlay.pos == null || overlay.power < 1) {
return;
}
VertexBuffer vb;
tm.bindTexture(ICONS_TEXTURE);
vb = Tessellator.getInstance().getBuffer();
vb.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
vb.setTranslation(-x, -y, -z);
if (overlay.power > 0) {
renderVectors(vb, overlay.pos, TEXTURE_OFFSETS[0],
overlay.strongPowered ? TEXTURE_OFFSETS[0] : TEXTURE_OFFSETS[1]);
}
vb.setTranslation(0, 0, 0);
Tessellator.getInstance().draw();
}
示例12: draw
import net.minecraft.client.renderer.texture.TextureManager; //導入依賴的package包/類
@Override
public void draw() {
super.draw();
TextureManager render = mc.renderEngine;
render.bindTexture(resource);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.color(1F, 1F, 1F, 1F);
int k = (gui.width - gui.WIDTH) / 2;
gui.drawTexturedModalRect(k + 5, 5, 0, 0, gui.WIDTH, gui.HEIGHT);
gui.drawCenteredString(mc.fontRendererObj, text, drawX + 60, drawY + 150, Color.gray.getRGB());
GlStateManager.disableBlend();
}
示例13: draw
import net.minecraft.client.renderer.texture.TextureManager; //導入依賴的package包/類
@Override
public void draw() {
super.draw();
if (this.title != null) {
TextureManager render = mc.renderEngine;
render.bindTexture(resource);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.color(1F, 1F, 1F, 1F);
int k = (gui.width - gui.WIDTH) / 2;
gui.drawTexturedModalRect(k, 5, 0, 0, gui.WIDTH, gui.HEIGHT);
drawSplitStringWithShadow(I18n.format(this.title), drawX + 10, drawY + 140, this.wordWrap, Color.gray.getRGB());
gui.drawCenteredString(mc.fontRendererObj, "-by " + gui.reader.getName(), drawX + 60, drawY + 155, Color.lightGray.getRGB());
GlStateManager.disableBlend();
}
}
示例14: prepare
import net.minecraft.client.renderer.texture.TextureManager; //導入依賴的package包/類
public void prepare(World p_190056_1_, TextureManager p_190056_2_, FontRenderer p_190056_3_, Entity p_190056_4_, RayTraceResult p_190056_5_, float p_190056_6_)
{
if (this.worldObj != p_190056_1_)
{
this.setWorld(p_190056_1_);
}
this.renderEngine = p_190056_2_;
this.entity = p_190056_4_;
this.fontRenderer = p_190056_3_;
this.cameraHitResult = p_190056_5_;
this.entityYaw = p_190056_4_.prevRotationYaw + (p_190056_4_.rotationYaw - p_190056_4_.prevRotationYaw) * p_190056_6_;
this.entityPitch = p_190056_4_.prevRotationPitch + (p_190056_4_.rotationPitch - p_190056_4_.prevRotationPitch) * p_190056_6_;
this.entityX = p_190056_4_.lastTickPosX + (p_190056_4_.posX - p_190056_4_.lastTickPosX) * (double)p_190056_6_;
this.entityY = p_190056_4_.lastTickPosY + (p_190056_4_.posY - p_190056_4_.lastTickPosY) * (double)p_190056_6_;
this.entityZ = p_190056_4_.lastTickPosZ + (p_190056_4_.posZ - p_190056_4_.lastTickPosZ) * (double)p_190056_6_;
}
示例15: SkinManager
import net.minecraft.client.renderer.texture.TextureManager; //導入依賴的package包/類
public SkinManager(TextureManager textureManagerInstance, File skinCacheDirectory, MinecraftSessionService sessionService)
{
this.textureManager = textureManagerInstance;
this.skinCacheDir = skinCacheDirectory;
this.sessionService = sessionService;
this.skinCacheLoader = CacheBuilder.newBuilder().expireAfterAccess(15L, TimeUnit.SECONDS).<GameProfile, Map<Type, MinecraftProfileTexture>>build(new CacheLoader<GameProfile, Map<Type, MinecraftProfileTexture>>()
{
public Map<Type, MinecraftProfileTexture> load(GameProfile p_load_1_) throws Exception
{
try
{
return Minecraft.getMinecraft().getSessionService().getTextures(p_load_1_, false);
}
catch (Throwable var3)
{
return Maps.<Type, MinecraftProfileTexture>newHashMap();
}
}
});
}