本文整理汇总了Java中net.minecraft.client.renderer.texture.TextureMap类的典型用法代码示例。如果您正苦于以下问题:Java TextureMap类的具体用法?Java TextureMap怎么用?Java TextureMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TextureMap类属于net.minecraft.client.renderer.texture包,在下文中一共展示了TextureMap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateTextureMinMagFilter
import net.minecraft.client.renderer.texture.TextureMap; //导入依赖的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);
}
}
示例2: updateTextureMinMagFilter
import net.minecraft.client.renderer.texture.TextureMap; //导入依赖的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);
}
}
示例3: loadSprites
import net.minecraft.client.renderer.texture.TextureMap; //导入依赖的package包/类
private void loadSprites()
{
final Set<ResourceLocation> set = this.getVariantsTextureLocations();
set.addAll(this.getItemsTextureLocations());
set.remove(TextureMap.LOCATION_MISSING_TEXTURE);
ITextureMapPopulator itexturemappopulator = new ITextureMapPopulator()
{
public void registerSprites(TextureMap textureMapIn)
{
for (ResourceLocation resourcelocation : set)
{
TextureAtlasSprite textureatlassprite = textureMapIn.registerSprite(resourcelocation);
ModelBakery.this.sprites.put(resourcelocation, textureatlassprite);
}
}
};
this.textureMap.loadSprites(this.resourceManager, itexturemappopulator);
this.sprites.put(new ResourceLocation("missingno"), this.textureMap.getMissingSprite());
}
示例4: updateModels
import net.minecraft.client.renderer.texture.TextureMap; //导入依赖的package包/类
public static void updateModels()
{
if (itemProperties != null)
{
for (int i = 0; i < itemProperties.length; ++i)
{
CustomItemProperties[] acustomitemproperties = itemProperties[i];
if (acustomitemproperties != null)
{
for (int j = 0; j < acustomitemproperties.length; ++j)
{
CustomItemProperties customitemproperties = acustomitemproperties[j];
if (customitemproperties != null && customitemproperties.type == 1)
{
TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
customitemproperties.updateModel(texturemap, itemModelGenerator);
}
}
}
}
}
}
示例5: renderItemInWorld
import net.minecraft.client.renderer.texture.TextureMap; //导入依赖的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();
}
}
示例6: updateIcons
import net.minecraft.client.renderer.texture.TextureMap; //导入依赖的package包/类
public static void updateIcons(TextureMap p_updateIcons_0_)
{
blockProperties = (ConnectedProperties[][])null;
tileProperties = (ConnectedProperties[][])null;
if (Config.isConnectedTextures())
{
IResourcePack[] airesourcepack = Config.getResourcePacks();
for (int i = airesourcepack.length - 1; i >= 0; --i)
{
IResourcePack iresourcepack = airesourcepack[i];
updateIcons(p_updateIcons_0_, iresourcepack);
}
updateIcons(p_updateIcons_0_, Config.getDefaultResourcePack());
ResourceLocation resourcelocation = new ResourceLocation("mcpatcher/ctm/default/empty");
emptySprite = p_updateIcons_0_.registerSprite(resourcelocation);
spriteQuadMaps = new Map[p_updateIcons_0_.getCountRegisteredSprites() + 1];
}
}
示例7: doRenderLayer
import net.minecraft.client.renderer.texture.TextureMap; //导入依赖的package包/类
@Override
public void doRenderLayer(EntityMeeCreeps entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();
if (iblockstate != null) {
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
GlStateManager.enableRescaleNormal();
GlStateManager.pushMatrix();
GlStateManager.translate(0.0F, 0.6875F, -0.75F);
GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(0.25F, 0.1875F, 0.25F);
float f = 0.5F;
GlStateManager.scale(-0.5F, -0.5F, 0.5F);
int i = entitylivingbaseIn.getBrightnessForRender();
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j, k);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.endermanRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
GlStateManager.popMatrix();
GlStateManager.disableRescaleNormal();
}
}
示例8: updateIcons
import net.minecraft.client.renderer.texture.TextureMap; //导入依赖的package包/类
public void updateIcons(TextureMap p_updateIcons_1_)
{
if (this.matchTiles != null)
{
this.matchTileIcons = registerIcons(this.matchTiles, p_updateIcons_1_);
}
if (this.connectTiles != null)
{
this.connectTileIcons = registerIcons(this.connectTiles, p_updateIcons_1_);
}
if (this.tiles != null)
{
this.tileIcons = registerIcons(this.tiles, p_updateIcons_1_);
}
}
示例9: onPreRenderBlockLayer
import net.minecraft.client.renderer.texture.TextureMap; //导入依赖的package包/类
@SubscribeEvent
public void onPreRenderBlockLayer(RenderBlockLayerEvent.Pre event) {
if(!isInternalCall) {
if (!event.getRenderLayer().equals(BlockRenderLayer.TRANSLUCENT)) {
event.setCanceled(true);
} else if (event.getRenderLayer().equals(BlockRenderLayer.TRANSLUCENT)) {
isInternalCall = true;
Entity renderEntity = MC.getRenderViewEntity();
GlStateManager.disableAlpha();
MC.renderGlobal.renderBlockLayer(BlockRenderLayer.SOLID, event.getPartialTicks(), 0, renderEntity);
GlStateManager.enableAlpha();
MC.renderGlobal.renderBlockLayer(BlockRenderLayer.CUTOUT_MIPPED, event.getPartialTicks(), 0, renderEntity);
MC.getTextureManager().getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).setBlurMipmap(false, false);
MC.renderGlobal.renderBlockLayer(BlockRenderLayer.CUTOUT, event.getPartialTicks(), 0, renderEntity);
MC.getTextureManager().getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap();
GlStateManager.disableAlpha();
isInternalCall = false;
}
}
}
示例10: doRenderLayer
import net.minecraft.client.renderer.texture.TextureMap; //导入依赖的package包/类
@Override
public void doRenderLayer(EntityEvolvedEnderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();
if (iblockstate != null) {
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
GlStateManager.enableRescaleNormal();
GlStateManager.pushMatrix();
GlStateManager.translate(0.0F, 0.6875F, -0.75F);
GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(0.25F, 0.1875F, 0.25F);
GlStateManager.scale(-0.5F, -0.5F, 0.5F);
int i = entitylivingbaseIn.getBrightnessForRender();
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j, k);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
endermanRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
GlStateManager.popMatrix();
GlStateManager.disableRescaleNormal();
}
}
示例11: loadSprites
import net.minecraft.client.renderer.texture.TextureMap; //导入依赖的package包/类
private void loadSprites()
{
final Set<ResourceLocation> set = this.getVariantsTextureLocations();
set.addAll(this.getItemsTextureLocations());
set.remove(TextureMap.LOCATION_MISSING_TEXTURE);
IIconCreator iiconcreator = new IIconCreator()
{
public void registerSprites(TextureMap iconRegistry)
{
for (ResourceLocation resourcelocation : set)
{
TextureAtlasSprite textureatlassprite = iconRegistry.registerSprite(resourcelocation);
ModelBakery.this.sprites.put(resourcelocation, textureatlassprite);
}
}
};
this.textureMap.loadSprites(this.resourceManager, iiconcreator);
this.sprites.put(new ResourceLocation("missingno"), this.textureMap.getMissingSprite());
}
示例12: registerSprite
import net.minecraft.client.renderer.texture.TextureMap; //导入依赖的package包/类
private static TextureAtlasSprite registerSprite(Properties p_registerSprite_0_, String p_registerSprite_1_, String p_registerSprite_2_, TextureMap p_registerSprite_3_)
{
String s = p_registerSprite_0_.getProperty(p_registerSprite_1_);
if (s == null)
{
s = p_registerSprite_2_;
}
ResourceLocation resourcelocation = new ResourceLocation("textures/" + s + ".png");
if (!Config.hasResource(resourcelocation))
{
Config.warn("BetterGrass texture not found: " + resourcelocation);
s = p_registerSprite_2_;
}
ResourceLocation resourcelocation1 = new ResourceLocation(s);
TextureAtlasSprite textureatlassprite = p_registerSprite_3_.registerSprite(resourcelocation1);
return textureatlassprite;
}
示例13: doRenderLayer
import net.minecraft.client.renderer.texture.TextureMap; //导入依赖的package包/类
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();
if (iblockstate.getBlock().getMaterial() != Material.air)
{
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
GlStateManager.enableRescaleNormal();
GlStateManager.pushMatrix();
GlStateManager.translate(0.0F, 0.6875F, -0.75F);
GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(0.25F, 0.1875F, 0.25F);
float f = 0.5F;
GlStateManager.scale(-f, -f, f);
int i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.endermanRenderer.bindTexture(TextureMap.locationBlocksTexture);
blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
GlStateManager.popMatrix();
GlStateManager.disableRescaleNormal();
}
}
示例14: renderItemIntoGUI
import net.minecraft.client.renderer.texture.TextureMap; //导入依赖的package包/类
public void renderItemIntoGUI(ItemStack stack, int x, int y)
{
IBakedModel ibakedmodel = this.itemModelMesher.getItemModel(stack);
GlStateManager.pushMatrix();
this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
this.textureManager.getTexture(TextureMap.locationBlocksTexture).setBlurMipmap(false, false);
GlStateManager.enableRescaleNormal();
GlStateManager.enableAlpha();
GlStateManager.alphaFunc(516, 0.1F);
GlStateManager.enableBlend();
GlStateManager.blendFunc(770, 771);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.setupGuiTransform(x, y, ibakedmodel.isGui3d());
ibakedmodel.getItemCameraTransforms().applyTransform(ItemCameraTransforms.TransformType.GUI);
this.renderItem(stack, ibakedmodel);
GlStateManager.disableAlpha();
GlStateManager.disableRescaleNormal();
GlStateManager.disableLighting();
GlStateManager.popMatrix();
this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
this.textureManager.getTexture(TextureMap.locationBlocksTexture).restoreLastBlurMipmap();
}
示例15: func_178108_a
import net.minecraft.client.renderer.texture.TextureMap; //导入依赖的package包/类
private void func_178108_a(float p_178108_1_, TextureAtlasSprite p_178108_2_)
{
this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
float f = 0.1F;
GlStateManager.color(0.1F, 0.1F, 0.1F, 0.5F);
GlStateManager.pushMatrix();
float f1 = -1.0F;
float f2 = 1.0F;
float f3 = -1.0F;
float f4 = 1.0F;
float f5 = -0.5F;
float f6 = p_178108_2_.getMinU();
float f7 = p_178108_2_.getMaxU();
float f8 = p_178108_2_.getMinV();
float f9 = p_178108_2_.getMaxV();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(-1.0D, -1.0D, -0.5D).tex((double)f7, (double)f9).endVertex();
worldrenderer.pos(1.0D, -1.0D, -0.5D).tex((double)f6, (double)f9).endVertex();
worldrenderer.pos(1.0D, 1.0D, -0.5D).tex((double)f6, (double)f8).endVertex();
worldrenderer.pos(-1.0D, 1.0D, -0.5D).tex((double)f7, (double)f8).endVertex();
tessellator.draw();
GlStateManager.popMatrix();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}