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


Java Minecraft.getTextureManager方法代码示例

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


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

示例1: renderItemInWorld

import net.minecraft.client.Minecraft; //导入方法依赖的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();
    }
}
 
开发者ID:canitzp,项目名称:Metalworks,代码行数:25,代码来源:Util.java

示例2: EntityRenderer

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
public EntityRenderer(Minecraft mcIn, IResourceManager resourceManagerIn)
{
    this.shaderIndex = shaderCount;
    this.useShader = false;
    this.frameCount = 0;
    this.mc = mcIn;
    this.resourceManager = resourceManagerIn;
    this.itemRenderer = mcIn.getItemRenderer();
    this.theMapItemRenderer = new MapItemRenderer(mcIn.getTextureManager());
    this.lightmapTexture = new DynamicTexture(16, 16);
    this.locationLightMap = mcIn.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture);
    this.lightmapColors = this.lightmapTexture.getTextureData();
    this.theShaderGroup = null;

    for (int i = 0; i < 32; ++i)
    {
        for (int j = 0; j < 32; ++j)
        {
            float f = (float)(j - 16);
            float f1 = (float)(i - 16);
            float f2 = MathHelper.sqrt_float(f * f + f1 * f1);
            this.rainXCoords[i << 5 | j] = -f1 / f2;
            this.rainYCoords[i << 5 | j] = f / f2;
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:27,代码来源:EntityRenderer.java

示例3: EntityRenderer

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
public EntityRenderer(Minecraft mcIn, IResourceManager resourceManagerIn) {
	this.shaderIndex = shaderCount;
	this.useShader = false;
	this.frameCount = 0;
	this.mc = mcIn;
	this.resourceManager = resourceManagerIn;
	this.itemRenderer = mcIn.getItemRenderer();
	this.theMapItemRenderer = new MapItemRenderer(mcIn.getTextureManager());
	this.lightmapTexture = new DynamicTexture(16, 16);
	this.locationLightMap = mcIn.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture);
	this.lightmapColors = this.lightmapTexture.getTextureData();
	this.theShaderGroup = null;

	for (int i = 0; i < 32; ++i) {
		for (int j = 0; j < 32; ++j) {
			float f = (float) (j - 16);
			float f1 = (float) (i - 16);
			float f2 = MathHelper.sqrt_float(f * f + f1 * f1);
			this.rainXCoords[i << 5 | j] = -f1 / f2;
			this.rainYCoords[i << 5 | j] = f / f2;
		}
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:24,代码来源:EntityRenderer.java

示例4: EntityRenderer

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
public EntityRenderer(Minecraft mcIn, IResourceManager resourceManagerIn)
{
    this.shaderIndex = SHADER_COUNT;
    this.mc = mcIn;
    this.resourceManager = resourceManagerIn;
    this.itemRenderer = mcIn.getItemRenderer();
    this.theMapItemRenderer = new MapItemRenderer(mcIn.getTextureManager());
    this.lightmapTexture = new DynamicTexture(16, 16);
    this.locationLightMap = mcIn.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture);
    this.lightmapColors = this.lightmapTexture.getTextureData();
    this.theShaderGroup = null;

    for (int i = 0; i < 32; ++i)
    {
        for (int j = 0; j < 32; ++j)
        {
            float f = (float)(j - 16);
            float f1 = (float)(i - 16);
            float f2 = MathHelper.sqrt(f * f + f1 * f1);
            this.rainXCoords[i << 5 | j] = -f1 / f2;
            this.rainYCoords[i << 5 | j] = f / f2;
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:EntityRenderer.java

示例5: EntityRenderer

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
public EntityRenderer(Minecraft mcIn, IResourceManager resourceManagerIn)
{
    this.shaderIndex = SHADER_COUNT;
    this.mc = mcIn;
    this.resourceManager = resourceManagerIn;
    this.itemRenderer = mcIn.getItemRenderer();
    this.theMapItemRenderer = new MapItemRenderer(mcIn.getTextureManager());
    this.lightmapTexture = new DynamicTexture(16, 16);
    this.locationLightMap = mcIn.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture);
    this.lightmapColors = this.lightmapTexture.getTextureData();
    this.theShaderGroup = null;

    for (int i = 0; i < 32; ++i)
    {
        for (int j = 0; j < 32; ++j)
        {
            float f = (float)(j - 16);
            float f1 = (float)(i - 16);
            float f2 = MathHelper.sqrt_float(f * f + f1 * f1);
            this.rainXCoords[i << 5 | j] = -f1 / f2;
            this.rainYCoords[i << 5 | j] = f / f2;
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:25,代码来源:EntityRenderer.java

示例6: RenderGlobal

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
public RenderGlobal(Minecraft mcIn)
{
    this.mc = mcIn;
    this.renderManager = mcIn.getRenderManager();
    this.renderEngine = mcIn.getTextureManager();
    this.renderEngine.bindTexture(locationForcefieldPng);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT);
    GlStateManager.bindTexture(0);
    this.updateDestroyBlockIcons();
    this.vboEnabled = OpenGlHelper.useVbo();

    if (this.vboEnabled)
    {
        this.renderContainer = new VboRenderList();
        this.renderChunkFactory = new VboChunkFactory();
    }
    else
    {
        this.renderContainer = new RenderList();
        this.renderChunkFactory = new ListChunkFactory();
    }

    this.vertexBufferFormat = new VertexFormat();
    this.vertexBufferFormat.func_181721_a(new VertexFormatElement(0, VertexFormatElement.EnumType.FLOAT, VertexFormatElement.EnumUsage.POSITION, 3));
    this.generateStars();
    this.generateSky();
    this.generateSky2();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:30,代码来源:RenderGlobal.java

示例7: RenderGlobal

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
public RenderGlobal(Minecraft mcIn)
{
    this.cloudRenderer = new CloudRenderer(mcIn);
    this.mc = mcIn;
    this.renderManager = mcIn.getRenderManager();
    this.renderEngine = mcIn.getTextureManager();
    this.renderEngine.bindTexture(locationForcefieldPng);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT);
    GlStateManager.bindTexture(0);
    this.updateDestroyBlockIcons();
    this.vboEnabled = OpenGlHelper.useVbo();

    if (this.vboEnabled)
    {
        this.renderContainer = new VboRenderList();
        this.renderChunkFactory = new VboChunkFactory();
    }
    else
    {
        this.renderContainer = new RenderList();
        this.renderChunkFactory = new ListChunkFactory();
    }

    this.vertexBufferFormat = new VertexFormat();
    this.vertexBufferFormat.func_181721_a(new VertexFormatElement(0, VertexFormatElement.EnumType.FLOAT, VertexFormatElement.EnumUsage.POSITION, 3));
    this.generateStars();
    this.generateSky();
    this.generateSky2();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:31,代码来源:RenderGlobal.java

示例8: RenderGlobal

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
public RenderGlobal(Minecraft mcIn)
{
    this.renderEnv = new RenderEnv(this.theWorld, Blocks.AIR.getDefaultState(), new BlockPos(0, 0, 0));
    this.renderOverlayDamaged = false;
    this.renderOverlayEyes = false;
    this.cloudRenderer = new CloudRenderer(mcIn);
    this.mc = mcIn;
    this.renderManager = mcIn.getRenderManager();
    this.renderEngine = mcIn.getTextureManager();
    this.renderEngine.bindTexture(FORCEFIELD_TEXTURES);
    GlStateManager.glTexParameteri(3553, 10242, 10497);
    GlStateManager.glTexParameteri(3553, 10243, 10497);
    GlStateManager.bindTexture(0);
    this.updateDestroyBlockIcons();
    this.vboEnabled = OpenGlHelper.useVbo();

    if (this.vboEnabled)
    {
        this.renderContainer = new VboRenderList();
        this.renderChunkFactory = new VboChunkFactory();
    }
    else
    {
        this.renderContainer = new RenderList();
        this.renderChunkFactory = new ListChunkFactory();
    }

    this.vertexBufferFormat = new VertexFormat();
    this.vertexBufferFormat.addElement(new VertexFormatElement(0, VertexFormatElement.EnumType.FLOAT, VertexFormatElement.EnumUsage.POSITION, 3));
    this.generateStars();
    this.generateSky();
    this.generateSky2();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:34,代码来源:RenderGlobal.java

示例9: RenderGlobal

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
public RenderGlobal(Minecraft mcIn)
{
    this.mc = mcIn;
    this.renderManager = mcIn.getRenderManager();
    this.renderEngine = mcIn.getTextureManager();
    this.renderEngine.bindTexture(FORCEFIELD_TEXTURES);
    GlStateManager.glTexParameteri(3553, 10242, 10497);
    GlStateManager.glTexParameteri(3553, 10243, 10497);
    GlStateManager.bindTexture(0);
    this.updateDestroyBlockIcons();
    this.vboEnabled = OpenGlHelper.useVbo();

    if (this.vboEnabled)
    {
        this.renderContainer = new VboRenderList();
        this.renderChunkFactory = new VboChunkFactory();
    }
    else
    {
        this.renderContainer = new RenderList();
        this.renderChunkFactory = new ListChunkFactory();
    }

    this.vertexBufferFormat = new VertexFormat();
    this.vertexBufferFormat.addElement(new VertexFormatElement(0, VertexFormatElement.EnumType.FLOAT, VertexFormatElement.EnumUsage.POSITION, 3));
    this.generateStars();
    this.generateSky();
    this.generateSky2();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:30,代码来源:RenderGlobal.java

示例10: renderOverlay

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
@SubscribeEvent
public void renderOverlay(RenderGameOverlayEvent.Post event) {
	if (event.getType() == RenderGameOverlayEvent.ElementType.HOTBAR && renderTime > 0) {
		Minecraft mc = Minecraft.getMinecraft();
		TextureManager manager = mc.getTextureManager();
		Optional<IEnergy> optional = EnergyHandler.getEnergy(mc.player);

		if (optional.isPresent()) {
			IEnergy energy = optional.get();

			GlStateManager.pushMatrix();
			GlStateManager.enableBlend();

			ScaledResolution resolution = event.getResolution();
			double interpEnergy = 0;
			if (oldEnergy >= 0) {
				interpEnergy = (double) (energy.get() - oldEnergy) * event.getPartialTicks() + oldEnergy;
			} else {
				interpEnergy = energy.get();
			}
			double filled = interpEnergy / energy.getMax();

			// System.out.println("fil: " + filled + ", chg: " + energy.get() + ", max: " + energy.getMax());

			int height = ConfigHandler.ENERGY_HUD.height;
			int width = ConfigHandler.ENERGY_HUD.width;
			int x = ConfigHandler.ENERGY_HUD.x;
			int y = resolution.getScaledHeight() - ConfigHandler.ENERGY_HUD.y;

			if (ConfigHandler.ENERGY_HUD.hide) {
				GlStateManager.color(1F, 1F, 1F, visible);
			}

			double barWidth = width * 7 / 25;

			GlStateManager.disableCull();
			manager.bindTexture(ResourceLocations.ENERGY_BACKGROUND[0]);
			renderTexture(x + 9, y + 88, barWidth, -(height - 28D) * filled, 0, filled);

			if (visible == 1f) {
				GlStateManager.pushMatrix();
				GlStateManager.color(1F, 1F, 1F, visible == 1F ? barAlpha : visible);

				manager.bindTexture(ResourceLocations.ENERGY_BACKGROUND[1]);
				renderTexture(x + 9, y + 88, barWidth, -(height - 28D) * filled, 0, filled);
				GlStateManager.enableCull();

				GlStateManager.popMatrix();
			}

			if (ConfigHandler.ENERGY_HUD.hide) {
				GlStateManager.color(1F, 1F, 1F, visible);
			}

			manager.bindTexture(energy.getType().getTexture());
			renderTexture(x, y, width, height, 0, 1);

			int textColor = 0x990066;
			if (ConfigHandler.ENERGY_HUD.hide) {
				int alpha = (int) (visible * 255);
				textColor = alpha << 24 | 0x990066;
			}

			String text = "E: " + energy.get();
			mc.fontRenderer.drawStringWithShadow(text, x, y - 10, textColor);
			GlStateManager.disableBlend();
			GlStateManager.popMatrix();
		}
	}
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:71,代码来源:EnergyHUD.java

示例11: ExtraBlockBreakHandler

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
private ExtraBlockBreakHandler(Minecraft mcIn) {
	this.mc = mcIn;
	this.renderEngine = mcIn.getTextureManager();
	((IReloadableResourceManager) mc.getResourceManager()).registerReloadListener(this);
}
 
开发者ID:the-realest-stu,项目名称:Adventurers-Toolbox,代码行数:6,代码来源:ExtraBlockBreakHandler.java


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