本文整理匯總了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();
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
}
}
示例11: ExtraBlockBreakHandler
import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
private ExtraBlockBreakHandler(Minecraft mcIn) {
this.mc = mcIn;
this.renderEngine = mcIn.getTextureManager();
((IReloadableResourceManager) mc.getResourceManager()).registerReloadListener(this);
}