本文整理匯總了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++;
});
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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();
}
}
示例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;
}
}
示例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;
}
示例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();
}
}
示例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;
}
}
}
示例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]);
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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);
}
}
}
示例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);
}
示例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_);
}