Java 类net.minecraft.client.resources.ResourceManager 实例源码

项目:RuneCraftery    文件:Locale.java   
public synchronized void func_135022_a(ResourceManager p_135022_1_, List p_135022_2_) {
   this.field_135032_a.clear();
   Iterator var3 = p_135022_2_.iterator();

   while(var3.hasNext()) {
      String var4 = (String)var3.next();
      String var5 = String.format("lang/%s.lang", new Object[]{var4});
      Iterator var6 = p_135022_1_.func_135055_a().iterator();

      while(var6.hasNext()) {
         String var7 = (String)var6.next();

         try {
            this.func_135028_a(p_135022_1_.func_135056_b(new ResourceLocation(var7, var5)));
         } catch (IOException var9) {
            ;
         }
      }
   }

   this.func_135024_b();
}
项目:RuneCraftery    文件:LayeredTexture.java   
public void func_110551_a(ResourceManager p_110551_1_) throws IOException {
   BufferedImage var2 = null;

   try {
      Iterator var3 = this.field_110567_b.iterator();

      while(var3.hasNext()) {
         String var4 = (String)var3.next();
         if(var4 != null) {
            InputStream var5 = p_110551_1_.func_110536_a(new ResourceLocation(var4)).func_110527_b();
            BufferedImage var6 = ImageIO.read(var5);
            if(var2 == null) {
               var2 = new BufferedImage(var6.getWidth(), var6.getHeight(), 2);
            }

            var2.getGraphics().drawImage(var6, 0, 0, (ImageObserver)null);
         }
      }
   } catch (IOException var7) {
      var7.printStackTrace();
      return;
   }

   TextureUtil.func_110987_a(this.func_110552_b(), var2);
}
项目:RuneCraftery    文件:ThreadDownloadImageData.java   
public void func_110551_a(ResourceManager p_110551_1_) throws IOException {
   if(this.field_110560_d == null) {
      if(this.field_110558_f != null) {
         this.field_110558_f.func_110551_a(p_110551_1_);
         this.field_110553_a = this.field_110558_f.func_110552_b();
      }
   } else {
      TextureUtil.func_110987_a(this.func_110552_b(), this.field_110560_d);
   }

   if(this.field_110561_e == null) {
      this.field_110561_e = new ThreadDownloadImageDataINNER1(this);
      this.field_110561_e.setDaemon(true);
      this.field_110561_e.setName("Skin downloader: " + this.field_110562_b);
      this.field_110561_e.start();
   }

}
项目:RuneCraftery    文件:SoundManager.java   
public SoundManager(ResourceManager p_i1326_1_, GameSettings p_i1326_2_, File p_i1326_3_) {
   this.field_77383_i = this.field_77382_h.nextInt(12000);
   this.field_77375_f = p_i1326_2_;
   this.field_130085_i = p_i1326_3_;
   this.field_77379_b = new SoundPool(p_i1326_1_, "sound", true);
   this.field_77380_c = new SoundPool(p_i1326_1_, "records", false);
   this.field_77377_d = new SoundPool(p_i1326_1_, "music", true);

   try {
      SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class);
      SoundSystemConfig.setCodec("ogg", CodecJOrbis.class);
      SoundSystemConfig.setCodec("wav", CodecWav.class);
   } catch (SoundSystemException var5) {
      var5.printStackTrace();
      System.err.println("error linking with the LibraryJavaSound plug-in");
   }

   this.func_130083_h();
}
项目:RuneCraftery    文件:ThreadDownloadImageData.java   
public void loadTexture(ResourceManager par1ResourceManager) throws IOException
{
    if (this.bufferedImage == null)
    {
        if (this.imageLocation != null)
        {
            this.imageLocation.loadTexture(par1ResourceManager);
            this.glTextureId = this.imageLocation.getGlTextureId();
        }
    }
    else
    {
        TextureUtil.uploadTextureImage(this.getGlTextureId(), this.bufferedImage);
    }

    if (this.imageThread == null)
    {
        this.imageThread = new ThreadDownloadImageDataINNER1(this);
        this.imageThread.setDaemon(true);
        this.imageThread.setName("Skin downloader: " + this.imageUrl);
        this.imageThread.start();
    }
}
项目:RuneCraftery    文件:SoundManager.java   
public SoundManager(ResourceManager par1ResourceManager, GameSettings par2GameSettings, File par3File)
{
    this.ticksBeforeMusic = this.rand.nextInt(MUSIC_INTERVAL);
    this.options = par2GameSettings;
    this.fileAssets = par3File;
    this.soundPoolSounds = new SoundPool(par1ResourceManager, "sound", true);
    this.soundPoolStreaming = new SoundPool(par1ResourceManager, "records", false);
    this.soundPoolMusic = new SoundPool(par1ResourceManager, "music", true);

    try
    {
        SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class);
        SoundSystemConfig.setCodec("ogg", CodecJOrbis.class);
        SoundSystemConfig.setCodec("wav", CodecWav.class);
        MinecraftForge.EVENT_BUS.post(new SoundSetupEvent(this));
    }
    catch (SoundSystemException soundsystemexception)
    {
        soundsystemexception.printStackTrace();
        System.err.println("error linking with the LibraryJavaSound plug-in");
    }

    this.loadSounds();
}
项目:BetterNutritionMod    文件:ThreadDownloadImageData.java   
public void loadTexture(ResourceManager par1ResourceManager) throws IOException
{
    if (this.bufferedImage == null)
    {
        if (this.imageLocation != null)
        {
            this.imageLocation.loadTexture(par1ResourceManager);
            this.glTextureId = this.imageLocation.getGlTextureId();
        }
    }
    else
    {
        TextureUtil.uploadTextureImage(this.getGlTextureId(), this.bufferedImage);
    }

    if (this.imageThread == null)
    {
        this.imageThread = new ThreadDownloadImageDataINNER1(this);
        this.imageThread.setDaemon(true);
        this.imageThread.setName("Skin downloader: " + this.imageUrl);
        this.imageThread.start();
    }
}
项目:BetterNutritionMod    文件:SoundManager.java   
public SoundManager(ResourceManager par1ResourceManager, GameSettings par2GameSettings, File par3File)
{
    this.ticksBeforeMusic = this.rand.nextInt(MUSIC_INTERVAL);
    this.options = par2GameSettings;
    this.fileAssets = par3File;
    this.soundPoolSounds = new SoundPool(par1ResourceManager, "sound", true);
    this.soundPoolStreaming = new SoundPool(par1ResourceManager, "records", false);
    this.soundPoolMusic = new SoundPool(par1ResourceManager, "music", true);

    try
    {
        SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class);
        SoundSystemConfig.setCodec("ogg", CodecJOrbis.class);
        SoundSystemConfig.setCodec("wav", CodecWav.class);
        MinecraftForge.EVENT_BUS.post(new SoundSetupEvent(this));
    }
    catch (SoundSystemException soundsystemexception)
    {
        soundsystemexception.printStackTrace();
        System.err.println("error linking with the LibraryJavaSound plug-in");
    }

    this.loadSounds();
}
项目:MineFantasy    文件:HeraldryTextureSmall.java   
@Override
public void loadTexture(ResourceManager resourcemanager) {
    int [][][][] patt = PatternStore.patterns.get(heraldryData.getPatternIndex());
    BufferedImage image = new BufferedImage(patt[heraldryData.getPattern()][0].length, patt[heraldryData.getPattern()][0][0].length,BufferedImage.TYPE_4BYTE_ABGR);

    for(int x = 0; x < image.getWidth(); x++){
        for(int y = 0; y < image.getHeight(); y++){
            image.setRGB(x, y, PatternStore.getBlendedSmallPixel(patt, heraldryData.getPattern(), x, y, heraldryData.getColour(0), heraldryData.getColour(1), heraldryData.getColour(2)));
        }
    }
    TextureUtil.uploadTextureImage(this.getGlTextureId(),  image);
}
项目:RuneCraftery    文件:FoliageColorReloadListener.java   
public void func_110549_a(ResourceManager p_110549_1_) {
   try {
      ColorizerFoliage.func_77467_a(TextureUtil.func_110986_a(p_110549_1_, field_130079_a));
   } catch (IOException var3) {
      ;
   }

}
项目:RuneCraftery    文件:LanguageManager.java   
public void func_110549_a(ResourceManager p_110549_1_) {
   ArrayList var2 = Lists.newArrayList(new String[]{"en_US"});
   if(!"en_US".equals(this.field_135048_c)) {
      var2.add(this.field_135048_c);
   }

   field_135049_a.func_135022_a(p_110549_1_, var2);
   StringTranslate.func_135063_a(field_135049_a.field_135032_a);
}
项目:RuneCraftery    文件:SimpleReloadableResourceManager.java   
public Resource func_110536_a(ResourceLocation p_110536_1_) throws IOException {
   ResourceManager var2 = (ResourceManager)this.field_110548_a.get(p_110536_1_.func_110624_b());
   if(var2 != null) {
      return var2.func_110536_a(p_110536_1_);
   } else {
      throw new FileNotFoundException(p_110536_1_.toString());
   }
}
项目:RuneCraftery    文件:SimpleReloadableResourceManager.java   
public List func_135056_b(ResourceLocation p_135056_1_) throws IOException {
   ResourceManager var2 = (ResourceManager)this.field_110548_a.get(p_135056_1_.func_110624_b());
   if(var2 != null) {
      return var2.func_135056_b(p_135056_1_);
   } else {
      throw new FileNotFoundException(p_135056_1_.toString());
   }
}
项目:RuneCraftery    文件:GrassColorReloadListener.java   
public void func_110549_a(ResourceManager p_110549_1_) {
   try {
      ColorizerGrass.func_77479_a(TextureUtil.func_110986_a(p_110549_1_, field_130078_a));
   } catch (IOException var3) {
      ;
   }

}
项目:RuneCraftery    文件:TextureManager.java   
public void func_110549_a(ResourceManager p_110549_1_) {
   Iterator var2 = this.field_110585_a.entrySet().iterator();

   while(var2.hasNext()) {
      Entry var3 = (Entry)var2.next();
      this.func_110579_a((ResourceLocation)var3.getKey(), (TextureObject)var3.getValue());
   }

}
项目:RuneCraftery    文件:SimpleTexture.java   
public void func_110551_a(ResourceManager p_110551_1_) throws IOException {
   InputStream var2 = null;

   try {
      Resource var3 = p_110551_1_.func_110536_a(this.field_110568_b);
      var2 = var3.func_110527_b();
      BufferedImage var4 = ImageIO.read(var2);
      boolean var5 = false;
      boolean var6 = false;
      if(var3.func_110528_c()) {
         try {
            TextureMetadataSection var7 = (TextureMetadataSection)var3.func_110526_a("texture");
            if(var7 != null) {
               var5 = var7.func_110479_a();
               var6 = var7.func_110480_b();
            }
         } catch (RuntimeException var11) {
            Minecraft.func_71410_x().func_98033_al().func_98235_b("Failed reading metadata of: " + this.field_110568_b, var11);
         }
      }

      TextureUtil.func_110989_a(this.func_110552_b(), var4, var5, var6);
   } finally {
      if(var2 != null) {
         var2.close();
      }

   }

}
项目:RuneCraftery    文件:TextureUtil.java   
public static int[] func_110986_a(ResourceManager p_110986_0_, ResourceLocation p_110986_1_) throws IOException {
   BufferedImage var2 = ImageIO.read(p_110986_0_.func_110536_a(p_110986_1_).func_110527_b());
   int var3 = var2.getWidth();
   int var4 = var2.getHeight();
   int[] var5 = new int[var3 * var4];
   var2.getRGB(0, 0, var3, var4, var5, 0, var3);
   return var5;
}
项目:RuneCraftery    文件:TextureManager.java   
public void onResourceManagerReload(ResourceManager par1ResourceManager)
{
    Iterator iterator = this.mapTextureObjects.entrySet().iterator();

    while (iterator.hasNext())
    {
        Entry entry = (Entry)iterator.next();
        this.loadTexture((ResourceLocation)entry.getKey(), (TextureObject)entry.getValue());
    }
}
项目:RuneCraftery    文件:LayeredTexture.java   
public void loadTexture(ResourceManager par1ResourceManager) throws IOException
{
    BufferedImage bufferedimage = null;

    try
    {
        Iterator iterator = this.layeredTextureNames.iterator();

        while (iterator.hasNext())
        {
            String s = (String)iterator.next();

            if (s != null)
            {
                InputStream inputstream = par1ResourceManager.getResource(new ResourceLocation(s)).getInputStream();
                BufferedImage bufferedimage1 = ImageIO.read(inputstream);

                if (bufferedimage == null)
                {
                    bufferedimage = new BufferedImage(bufferedimage1.getWidth(), bufferedimage1.getHeight(), 2);
                }

                bufferedimage.getGraphics().drawImage(bufferedimage1, 0, 0, (ImageObserver)null);
            }
        }
    }
    catch (IOException ioexception)
    {
        ioexception.printStackTrace();
        return;
    }

    TextureUtil.uploadTextureImage(this.getGlTextureId(), bufferedimage);
}
项目:RuneCraftery    文件:SimpleTexture.java   
public void loadTexture(ResourceManager par1ResourceManager) throws IOException
{
    InputStream inputstream = null;

    try
    {
        Resource resource = par1ResourceManager.getResource(this.textureLocation);
        inputstream = resource.getInputStream();
        BufferedImage bufferedimage = ImageIO.read(inputstream);
        boolean flag = false;
        boolean flag1 = false;

        if (resource.hasMetadata())
        {
            try
            {
                TextureMetadataSection texturemetadatasection = (TextureMetadataSection)resource.getMetadata("texture");

                if (texturemetadatasection != null)
                {
                    flag = texturemetadatasection.getTextureBlur();
                    flag1 = texturemetadatasection.getTextureClamp();
                }
            }
            catch (RuntimeException runtimeexception)
            {
                Minecraft.getMinecraft().getLogAgent().logWarningException("Failed reading metadata of: " + this.textureLocation, runtimeexception);
            }
        }

        TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, flag, flag1);
    }
    finally
    {
        if (inputstream != null)
        {
            inputstream.close();
        }
    }
}
项目:RuneCraftery    文件:TextureUtil.java   
public static int[] readImageData(ResourceManager par0ResourceManager, ResourceLocation par1ResourceLocation) throws IOException
{
    BufferedImage bufferedimage = ImageIO.read(par0ResourceManager.getResource(par1ResourceLocation).getInputStream());
    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;
}
项目:RuneCraftery    文件:SoundManager.java   
public void onResourceManagerReload(ResourceManager par1ResourceManager)
{
    if (!this.LOAD_SOUND_SYSTEM) return; //Stop the sound system from initializing three times at startup. Causing race conditions on some machines.
    this.stopAllSounds();
    this.cleanup();
    this.tryToSetLibraryAndCodecs();
    MinecraftForge.EVENT_BUS.post(new SoundLoadEvent(this));
}
项目:BetterNutritionMod    文件:TextureManager.java   
public void onResourceManagerReload(ResourceManager par1ResourceManager)
{
    Iterator iterator = this.mapTextureObjects.entrySet().iterator();

    while (iterator.hasNext())
    {
        Entry entry = (Entry)iterator.next();
        this.loadTexture((ResourceLocation)entry.getKey(), (TextureObject)entry.getValue());
    }
}
项目:BetterNutritionMod    文件:LayeredTexture.java   
public void loadTexture(ResourceManager par1ResourceManager) throws IOException
{
    BufferedImage bufferedimage = null;

    try
    {
        Iterator iterator = this.layeredTextureNames.iterator();

        while (iterator.hasNext())
        {
            String s = (String)iterator.next();

            if (s != null)
            {
                InputStream inputstream = par1ResourceManager.getResource(new ResourceLocation(s)).getInputStream();
                BufferedImage bufferedimage1 = ImageIO.read(inputstream);

                if (bufferedimage == null)
                {
                    bufferedimage = new BufferedImage(bufferedimage1.getWidth(), bufferedimage1.getHeight(), 2);
                }

                bufferedimage.getGraphics().drawImage(bufferedimage1, 0, 0, (ImageObserver)null);
            }
        }
    }
    catch (IOException ioexception)
    {
        ioexception.printStackTrace();
        return;
    }

    TextureUtil.uploadTextureImage(this.getGlTextureId(), bufferedimage);
}
项目:BetterNutritionMod    文件:SimpleTexture.java   
public void loadTexture(ResourceManager par1ResourceManager) throws IOException
{
    InputStream inputstream = null;

    try
    {
        Resource resource = par1ResourceManager.getResource(this.textureLocation);
        inputstream = resource.getInputStream();
        BufferedImage bufferedimage = ImageIO.read(inputstream);
        boolean flag = false;
        boolean flag1 = false;

        if (resource.hasMetadata())
        {
            try
            {
                TextureMetadataSection texturemetadatasection = (TextureMetadataSection)resource.getMetadata("texture");

                if (texturemetadatasection != null)
                {
                    flag = texturemetadatasection.getTextureBlur();
                    flag1 = texturemetadatasection.getTextureClamp();
                }
            }
            catch (RuntimeException runtimeexception)
            {
                Minecraft.getMinecraft().getLogAgent().logWarningException("Failed reading metadata of: " + this.textureLocation, runtimeexception);
            }
        }

        TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, flag, flag1);
    }
    finally
    {
        if (inputstream != null)
        {
            inputstream.close();
        }
    }
}
项目:BetterNutritionMod    文件:TextureUtil.java   
public static int[] readImageData(ResourceManager par0ResourceManager, ResourceLocation par1ResourceLocation) throws IOException
{
    BufferedImage bufferedimage = ImageIO.read(par0ResourceManager.getResource(par1ResourceLocation).getInputStream());
    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;
}
项目:BetterNutritionMod    文件:SoundManager.java   
public void onResourceManagerReload(ResourceManager par1ResourceManager)
{
    if (!this.LOAD_SOUND_SYSTEM) return; //Stop the sound system from initializing three times at startup. Causing race conditions on some machines.
    this.stopAllSounds();
    this.cleanup();
    this.tryToSetLibraryAndCodecs();
    MinecraftForge.EVENT_BUS.post(new SoundLoadEvent(this));
}
项目:RuneCraftery    文件:TextureManager.java   
public TextureManager(ResourceManager p_i1284_1_) {
   this.field_110582_d = p_i1284_1_;
}
项目:RuneCraftery    文件:TextureMap.java   
public void func_110551_a(ResourceManager p_110551_1_) throws IOException {
   this.func_110569_e();
   this.func_110571_b(p_110551_1_);
}
项目:RuneCraftery    文件:TextureMap.java   
public void func_110571_b(ResourceManager p_110571_1_) {
   int var2 = Minecraft.func_71369_N();
   Stitcher var3 = new Stitcher(var2, var2, true);
   this.field_94252_e.clear();
   this.field_94258_i.clear();
   Iterator var4 = this.field_110574_e.entrySet().iterator();

   while(var4.hasNext()) {
      Entry var5 = (Entry)var4.next();
      ResourceLocation var6 = new ResourceLocation((String)var5.getKey());
      TextureAtlasSprite var7 = (TextureAtlasSprite)var5.getValue();
      ResourceLocation var8 = new ResourceLocation(var6.func_110624_b(), String.format("%s/%s%s", new Object[]{this.field_94254_c, var6.func_110623_a(), ".png"}));

      try {
         var7.func_130100_a(p_110571_1_.func_110536_a(var8));
      } catch (RuntimeException var13) {
         Minecraft.func_71410_x().func_98033_al().func_98232_c(String.format("Unable to parse animation metadata from %s: %s", new Object[]{var8, var13.getMessage()}));
         continue;
      } catch (IOException var14) {
         Minecraft.func_71410_x().func_98033_al().func_98232_c("Using missing texture, unable to load: " + var8);
         continue;
      }

      var3.func_110934_a(var7);
   }

   var3.func_110934_a(this.field_94249_f);

   try {
      var3.func_94305_f();
   } catch (StitcherException var12) {
      throw var12;
   }

   TextureUtil.func_110991_a(this.func_110552_b(), var3.func_110935_a(), var3.func_110936_b());
   HashMap var15 = Maps.newHashMap(this.field_110574_e);
   Iterator var16 = var3.func_94309_g().iterator();

   TextureAtlasSprite var17;
   while(var16.hasNext()) {
      var17 = (TextureAtlasSprite)var16.next();
      String var18 = var17.func_94215_i();
      var15.remove(var18);
      this.field_94252_e.put(var18, var17);

      try {
         TextureUtil.func_110998_a(var17.func_110965_a(0), var17.func_94211_a(), var17.func_94216_b(), var17.func_130010_a(), var17.func_110967_i(), false, false);
      } catch (Throwable var11) {
         CrashReport var9 = CrashReport.func_85055_a(var11, "Stitching texture atlas");
         CrashReportCategory var10 = var9.func_85058_a("Texture being stitched together");
         var10.func_71507_a("Atlas path", this.field_94254_c);
         var10.func_71507_a("Sprite", var17);
         throw new ReportedException(var9);
      }

      if(var17.func_130098_m()) {
         this.field_94258_i.add(var17);
      } else {
         var17.func_130103_l();
      }
   }

   var16 = var15.values().iterator();

   while(var16.hasNext()) {
      var17 = (TextureAtlasSprite)var16.next();
      var17.func_94217_a(this.field_94249_f);
   }

}
项目:RuneCraftery    文件:FontRenderer.java   
public void func_110549_a(ResourceManager p_110549_1_) {
   this.func_111272_d();
}
项目:RuneCraftery    文件:SoundManager.java   
public void func_110549_a(ResourceManager p_110549_1_) {
   this.func_82464_d();
   this.func_77370_b();
   this.func_77363_d();
}
项目:RuneCraftery    文件:SoundPool.java   
public SoundPool(ResourceManager p_i1330_1_, String p_i1330_2_, boolean p_i1330_3_) {
   this.field_110657_c = p_i1330_1_;
   this.field_110656_d = p_i1330_2_;
   this.field_77463_b = p_i1330_3_;
}
项目:RuneCraftery    文件:SoundPool.java   
static ResourceManager func_110655_a(SoundPool p_110655_0_) {
   return p_110655_0_.field_110657_c;
}
项目:RuneCraftery    文件:Minecraft.java   
public ResourceManager func_110442_L() {
   return this.field_110451_am;
}
项目:RuneCraftery    文件:TextureManager.java   
public TextureManager(ResourceManager par1ResourceManager)
{
    this.theResourceManager = par1ResourceManager;
}
项目:RuneCraftery    文件:TextureMap.java   
public void loadTexture(ResourceManager par1ResourceManager) throws IOException
{
    this.initMissingImage();
    this.loadTextureAtlas(par1ResourceManager);
}
项目:RuneCraftery    文件:FontRenderer.java   
public void onResourceManagerReload(ResourceManager par1ResourceManager)
{
    this.readFontTexture();
}
项目:RuneCraftery    文件:SoundPool.java   
public SoundPool(ResourceManager par1ResourceManager, String par2Str, boolean par3)
{
    this.soundResourceManager = par1ResourceManager;
    this.soundType = par2Str;
    this.isGetRandomSound = par3;
}
项目:RuneCraftery    文件:SoundPool.java   
static ResourceManager func_110655_a(SoundPool par0SoundPool)
{
    return par0SoundPool.soundResourceManager;
}