本文整理匯總了Java中net.minecraft.client.renderer.texture.ITextureObject類的典型用法代碼示例。如果您正苦於以下問題:Java ITextureObject類的具體用法?Java ITextureObject怎麽用?Java ITextureObject使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ITextureObject類屬於net.minecraft.client.renderer.texture包,在下文中一共展示了ITextureObject類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateTextureMinMagFilter
import net.minecraft.client.renderer.texture.ITextureObject; //導入依賴的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.ITextureObject; //導入依賴的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: bindTexture
import net.minecraft.client.renderer.texture.ITextureObject; //導入依賴的package包/類
public static void bindTexture(ITextureObject tex)
{
int i = tex.getGlTextureId();
if (tex instanceof TextureMap)
{
Shaders.atlasSizeX = ((TextureMap)tex).atlasWidth;
Shaders.atlasSizeY = ((TextureMap)tex).atlasHeight;
bindTextures(tex.getMultiTexID());
}
else
{
Shaders.atlasSizeX = 0;
Shaders.atlasSizeY = 0;
bindTextures(tex.getMultiTexID());
}
}
示例4: getTextureWidth
import net.minecraft.client.renderer.texture.ITextureObject; //導入依賴的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;
}
示例5: getTextureHeight
import net.minecraft.client.renderer.texture.ITextureObject; //導入依賴的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;
}
示例6: getTexture
import net.minecraft.client.renderer.texture.ITextureObject; //導入依賴的package包/類
public static ITextureObject getTexture(ResourceLocation p_getTexture_0_)
{
ITextureObject itextureobject = Config.getTextureManager().getTexture(p_getTexture_0_);
if (itextureobject != null)
{
return itextureobject;
}
else if (!Config.hasResource(p_getTexture_0_))
{
return null;
}
else
{
SimpleTexture simpletexture = new SimpleTexture(p_getTexture_0_);
Config.getTextureManager().loadTexture(p_getTexture_0_, simpletexture);
return simpletexture;
}
}
示例7: execute
import net.minecraft.client.renderer.texture.ITextureObject; //導入依賴的package包/類
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
TextureManager manager = Minecraft.getMinecraft().renderEngine;
Map<ResourceLocation, ITextureObject> map = getTextures(manager);
if (map != null)
{
Iterator<Map.Entry<ResourceLocation, ITextureObject>> it = map.entrySet().iterator();
while (it.hasNext())
{
Map.Entry<ResourceLocation, ITextureObject> entry = it.next();
if (entry.getKey().getResourceDomain().equals("blockbuster.actors") && entry.getValue() instanceof DynamicTexture)
{
TextureUtil.deleteTexture(entry.getValue().getGlTextureId());
it.remove();
}
}
}
}
示例8: getTextures
import net.minecraft.client.renderer.texture.ITextureObject; //導入依賴的package包/類
/**
* Get texture map from texture manager using reflection API
*/
@SuppressWarnings("unchecked")
public static Map<ResourceLocation, ITextureObject> getTextures(TextureManager manager)
{
if (TEXTURE_MAP == null)
{
setupTextureMapField(manager);
}
try
{
return (Map<ResourceLocation, ITextureObject>) TEXTURE_MAP.get(manager);
}
catch (Exception e)
{
return null;
}
}
示例9: getTexture
import net.minecraft.client.renderer.texture.ITextureObject; //導入依賴的package包/類
public static ITextureObject getTexture(ResourceLocation loc)
{
ITextureObject tex = Config.getTextureManager().getTexture(loc);
if (tex != null)
{
return tex;
}
else if (!Config.hasResource(loc))
{
return null;
}
else
{
SimpleTexture tex1 = new SimpleTexture(loc);
Config.getTextureManager().loadTexture(loc, tex1);
return tex1;
}
}
示例10: findResourceLocation
import net.minecraft.client.renderer.texture.ITextureObject; //導入依賴的package包/類
private ResourceLocation findResourceLocation(String name) {
Map<ResourceLocation, ITextureObject> mapTextureObjects = FastReflection.Fields.TextureManager_mapTextureObjects.get(MC.getTextureManager());
return mapTextureObjects.keySet()
.stream()
.filter(k -> k.getResourcePath().contains(name))
.findFirst()
.orElse(null);
}
示例11: updateHeldMapTexture
import net.minecraft.client.renderer.texture.ITextureObject; //導入依賴的package包/類
private void updateHeldMapTexture(String url) {
if (MC.player == null || !(MC.player.getHeldItemMainhand().getItem() instanceof ItemMap)) return;
MC.addScheduledTask(() -> { // allows DynamicTexture to work
ItemMap map = (ItemMap) MC.player.getHeldItemMainhand().getItem();
MapData heldMapData = map.getMapData(MC.player.getHeldItemMainhand(), MC.world);
try {
BufferedImage image = getImageFromUrl(url);
DynamicTexture dynamicTexture = new DynamicTexture(image);
dynamicTexture.loadTexture(MC.getResourceManager());
Map<ResourceLocation, ITextureObject> mapTextureObjects = FastReflection.Fields.TextureManager_mapTextureObjects.get(MC.getTextureManager());
ResourceLocation textureLocation =
mapTextureObjects.keySet()
.stream()
.filter(k -> k.getResourcePath().contains(heldMapData.mapName))
.findFirst()
.orElse(null);
mapTextureObjects.put(textureLocation, dynamicTexture); // overwrite old texture with our custom one
} catch (Exception e) {
e.printStackTrace();
}
});
}
示例12: createDefaultTexture
import net.minecraft.client.renderer.texture.ITextureObject; //導入依賴的package包/類
public static ITextureObject createDefaultTexture()
{
DynamicTexture dynamictexture = new DynamicTexture(1, 1);
dynamictexture.getTextureData()[0] = -1;
dynamictexture.updateDynamicTexture();
return dynamictexture;
}
示例13: func_152789_a
import net.minecraft.client.renderer.texture.ITextureObject; //導入依賴的package包/類
@Override
public ResourceLocation func_152789_a(final MinecraftProfileTexture texture, final Type type, final SkinManager.SkinAvailableCallback callBack) {
if (type != Type.SKIN)
return super.func_152789_a(texture, type, callBack);
final boolean isSpecialCallBack = callBack instanceof ISkinDownloadCallback;
final ResourceLocation resLocationOld = new ResourceLocation("skins/" + texture.getHash());
final ResourceLocation resLocation = new ResourceLocation(Reference.MOD_ID, resLocationOld.getResourcePath());
ITextureObject itextureobject = textureManager.getTexture(resLocation);
if (itextureobject != null) {
if (callBack != null)
callBack.func_152121_a(type, resLocation);
} else {
File file1 = new File(skinFolder, texture.getHash().substring(0, 2));
File file2 = new File(file1, texture.getHash());
final NewImageBufferDownload imgDownload = new NewImageBufferDownload();
ITextureObject imgData = new NewThreadDownloadImageData(file2, texture.getUrl(), field_152793_a, imgDownload, resLocationOld, new IImageBuffer() {
@Override
public BufferedImage parseUserSkin(BufferedImage buffImg) {
if (buffImg != null)
PlayerModelManager.analyseTexture(buffImg, resLocation);
return imgDownload.parseUserSkin(buffImg);
}
@Override
public void func_152634_a() {
imgDownload.func_152634_a();
if (callBack != null)
callBack.func_152121_a(type, isSpecialCallBack ? resLocation : resLocationOld);
}
});
textureManager.loadTexture(resLocation, imgData);
textureManager.loadTexture(resLocationOld, imgData); // Avoid thrown exception if the image is requested before the download is done
}
return isSpecialCallBack ? resLocation : resLocationOld;
}
示例14: bindCustomTextures
import net.minecraft.client.renderer.texture.ITextureObject; //導入依賴的package包/類
private static void bindCustomTextures(CustomTexture[] cts)
{
if (cts != null)
{
for (int i = 0; i < cts.length; ++i)
{
CustomTexture customtexture = cts[i];
GlStateManager.setActiveTexture(33984 + customtexture.getTextureUnit());
ITextureObject itextureobject = customtexture.getTexture();
GlStateManager.bindTexture(itextureobject.getGlTextureId());
}
}
}
示例15: deleteCustomTextures
import net.minecraft.client.renderer.texture.ITextureObject; //導入依賴的package包/類
private static void deleteCustomTextures(CustomTexture[] cts)
{
if (cts != null)
{
for (int i = 0; i < cts.length; ++i)
{
CustomTexture customtexture = cts[i];
ITextureObject itextureobject = customtexture.getTexture();
TextureUtil.deleteTexture(itextureobject.getGlTextureId());
}
}
}