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


Java IResourceManager类代码示例

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


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

示例1: init

import net.minecraft.client.resources.IResourceManager; //导入依赖的package包/类
public static void init()
{
    if (initialized)
        return;

    initialized = true;

    IResourceManager rm = Minecraft.getMinecraft().getResourceManager();
    if (rm instanceof IReloadableResourceManager)
    {
        ((IReloadableResourceManager) rm).registerReloadListener(__ ->
        {
            loadedModels.clear();
            reloadCount++;
        });
    }
}
 
开发者ID:BenjaminSutter,项目名称:genera,代码行数:18,代码来源:ModelHandle.java

示例2: detectMaxMipmapLevel

import net.minecraft.client.resources.IResourceManager; //导入依赖的package包/类
private int detectMaxMipmapLevel(Map p_detectMaxMipmapLevel_1_, IResourceManager p_detectMaxMipmapLevel_2_)
{
    int i = this.detectMinimumSpriteSize(p_detectMaxMipmapLevel_1_, p_detectMaxMipmapLevel_2_, 20);

    if (i < 16)
    {
        i = 16;
    }

    i = MathHelper.smallestEncompassingPowerOfTwo(i);

    if (i > 16)
    {
        Config.log("Sprite size: " + i);
    }

    int j = MathHelper.log2(i);

    if (j < 4)
    {
        j = 4;
    }

    return j;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:TextureMap.java

示例3: loadNSMap1

import net.minecraft.client.resources.IResourceManager; //导入依赖的package包/类
public static void loadNSMap1(IResourceManager manager, ResourceLocation location, int width, int height, int[] aint, int offset, int defaultColor)
{
    boolean flag = false;

    try
    {
        IResource iresource = manager.getResource(location);
        BufferedImage bufferedimage = ImageIO.read(iresource.getInputStream());

        if (bufferedimage != null && bufferedimage.getWidth() == width && bufferedimage.getHeight() == height)
        {
            bufferedimage.getRGB(0, 0, width, height, aint, offset, width);
            flag = true;
        }
    }
    catch (IOException var10)
    {
        ;
    }

    if (!flag)
    {
        Arrays.fill(aint, offset, offset + width * height, defaultColor);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:26,代码来源:ShadersTex.java

示例4: create

import net.minecraft.client.resources.IResourceManager; //导入依赖的package包/类
public static int create(IResourceManager manager, @Nullable ResourceLocation vsh, @Nullable ResourceLocation fsh) {
	int vshId = 0, fshId = 0, program = 0;
	if(vsh != null) {
		vshId = parse(manager, vsh, VERTEX);
	}
	if(fsh != null) {
		fshId = parse(manager, fsh, FRAGMENT);
	}
	if(vsh != null || fsh != null) {
		program = ARBShaderObjects.glCreateProgramObjectARB();
	}
	if(vsh != null) {
		OpenGlHelper.glAttachShader(program, vshId);
	}
	if(fsh != null) {
		OpenGlHelper.glAttachShader(program, fshId);
	}
	OpenGlHelper.glLinkProgram(program);
	if(OpenGlHelper.glGetShaderi(program, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE) {
		return 0;
	}
	if(OpenGlHelper.glGetShaderi(program, ARBShaderObjects.GL_OBJECT_VALIDATE_STATUS_ARB) == GL11.GL_FALSE) {
		return 0;
	}
	return program;
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:27,代码来源:ShaderManager.java

示例5: resourcesReloaded

import net.minecraft.client.resources.IResourceManager; //导入依赖的package包/类
public static void resourcesReloaded(IResourceManager p_resourcesReloaded_0_)
{
    if (getTextureMapBlocks() != null)
    {
        Config.dbg("*** Reloading custom textures ***");
        CustomSky.reset();
        TextureAnimations.reset();
        update();
        NaturalTextures.update();
        BetterGrass.update();
        BetterSnow.update();
        TextureAnimations.update();
        CustomColors.update();
        CustomSky.update();
        RandomMobs.resetTextures();
        CustomItems.updateModels();
        CustomEntityModels.update();
        Shaders.resourcesReloaded();
        Lang.resourcesReloaded();
        Config.updateTexturePackClouds();
        SmartLeaves.updateLeavesModels();
        CustomPanorama.update();
        Config.getTextureManager().tick();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:TextureUtils.java

示例6: readImageData

import net.minecraft.client.resources.IResourceManager; //导入依赖的package包/类
public static int[] readImageData(IResourceManager resourceManager, ResourceLocation imageLocation) throws IOException
{
    BufferedImage bufferedimage = readBufferedImage(resourceManager.getResource(imageLocation).getInputStream());

    if (bufferedimage == null)
    {
        return null;
    }
    else
    {
        int i = bufferedimage.getWidth();
        int j = bufferedimage.getHeight();
        int[] aint = new int[i * j];
        bufferedimage.getRGB(0, 0, i, j, aint, 0, i);
        return aint;
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:18,代码来源:TextureUtil.java

示例7: detectMaxMipmapLevel

import net.minecraft.client.resources.IResourceManager; //导入依赖的package包/类
private int detectMaxMipmapLevel(Map p_detectMaxMipmapLevel_1_, IResourceManager p_detectMaxMipmapLevel_2_)
{
    int i = this.detectMinimumSpriteSize(p_detectMaxMipmapLevel_1_, p_detectMaxMipmapLevel_2_, 20);

    if (i < 16)
    {
        i = 16;
    }

    i = MathHelper.roundUpToPowerOfTwo(i);

    if (i > 16)
    {
        Config.log("Sprite size: " + i);
    }

    int j = MathHelper.calculateLogBaseTwo(i);

    if (j < 4)
    {
        j = 4;
    }

    return j;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:26,代码来源:TextureMap.java

示例8: resourcesReloaded

import net.minecraft.client.resources.IResourceManager; //导入依赖的package包/类
public static void resourcesReloaded(IResourceManager p_resourcesReloaded_0_)
{
    if (getTextureMapBlocks() != null)
    {
        Config.dbg("*** Reloading custom textures ***");
        CustomSky.reset();
        TextureAnimations.reset();
        update();
        NaturalTextures.update();
        BetterGrass.update();
        BetterSnow.update();
        TextureAnimations.update();
        CustomColorizer.update();
        CustomSky.update();
        RandomMobs.resetTextures();
        Config.updateTexturePackClouds();
        Config.getTextureManager().tick();
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:20,代码来源:TextureUtils.java

示例9: EntityRenderer

import net.minecraft.client.resources.IResourceManager; //导入依赖的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

示例10: onResourceManagerReload

import net.minecraft.client.resources.IResourceManager; //导入依赖的package包/类
public void onResourceManagerReload(IResourceManager resourceManager)
{
    if (this.theShaderGroup != null)
    {
        this.theShaderGroup.deleteShaderGroup();
    }

    this.theShaderGroup = null;

    if (this.shaderIndex == SHADER_COUNT)
    {
        this.loadEntityShader(this.mc.getRenderViewEntity());
    }
    else
    {
        this.loadShader(SHADERS_TEXTURES[this.shaderIndex]);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:19,代码来源:EntityRenderer.java

示例11: EntityRenderer

import net.minecraft.client.resources.IResourceManager; //导入依赖的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

示例12: EntityRenderer

import net.minecraft.client.resources.IResourceManager; //导入依赖的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

示例13: loadTexture

import net.minecraft.client.resources.IResourceManager; //导入依赖的package包/类
public void loadTexture(IResourceManager resourceManager) throws IOException
{
    this.deleteGlTexture();
    InputStream inputstream = Shaders.getShaderPackResourceStream(this.texturePath);

    if (inputstream == null)
    {
        throw new FileNotFoundException("Shader texture not found: " + this.texturePath);
    }
    else
    {
        try
        {
            BufferedImage bufferedimage = TextureUtil.readBufferedImage(inputstream);
            TextureMetadataSection texturemetadatasection = this.loadTextureMetadataSection();
            TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, texturemetadatasection.getTextureBlur(), texturemetadatasection.getTextureClamp());
        }
        finally
        {
            IOUtils.closeQuietly(inputstream);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:24,代码来源:SimpleShaderTexture.java

示例14: Parser

import net.minecraft.client.resources.IResourceManager; //导入依赖的package包/类
public Parser(IResource from, IResourceManager manager) throws IOException
{
    this.manager = manager;
    this.objFrom = from.getResourceLocation();
    this.objStream = new InputStreamReader(from.getInputStream(), StandardCharsets.UTF_8);
    this.objReader = new BufferedReader(objStream);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:8,代码来源:TintedOBJModel.java

示例15: ShaderGroup

import net.minecraft.client.resources.IResourceManager; //导入依赖的package包/类
public ShaderGroup(TextureManager p_i1050_1_, IResourceManager p_i1050_2_, Framebuffer p_i1050_3_, ResourceLocation p_i1050_4_) throws JsonException, IOException, JsonSyntaxException
{
    this.resourceManager = p_i1050_2_;
    this.mainFramebuffer = p_i1050_3_;
    this.field_148036_j = 0.0F;
    this.field_148037_k = 0.0F;
    this.mainFramebufferWidth = p_i1050_3_.framebufferWidth;
    this.mainFramebufferHeight = p_i1050_3_.framebufferHeight;
    this.shaderGroupName = p_i1050_4_.toString();
    this.resetProjectionMatrix();
    this.parseGroup(p_i1050_1_, p_i1050_4_);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:ShaderGroup.java


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