public void doStitch() { Stitcher.Holder[] astitcher$holder = (Stitcher.Holder[])this.setStitchHolders.toArray(new Stitcher.Holder[this.setStitchHolders.size()]); Arrays.sort((Object[])astitcher$holder); for (Stitcher.Holder stitcher$holder : astitcher$holder) { if (!this.allocateSlot(stitcher$holder)) { String s = String.format("Unable to fit: %s - size: %dx%d - Maybe try a lowerresolution resourcepack?", new Object[] {stitcher$holder.getAtlasSprite().getIconName(), Integer.valueOf(stitcher$holder.getAtlasSprite().getIconWidth()), Integer.valueOf(stitcher$holder.getAtlasSprite().getIconHeight())}); throw new StitcherException(stitcher$holder, s); } } if (this.forcePowerOf2) { this.currentWidth = MathHelper.roundUpToPowerOfTwo(this.currentWidth); this.currentHeight = MathHelper.roundUpToPowerOfTwo(this.currentHeight); } }
public void doStitch() { Stitcher.Holder[] astitcher$holder = (Stitcher.Holder[])((Stitcher.Holder[])this.setStitchHolders.toArray(new Stitcher.Holder[this.setStitchHolders.size()])); Arrays.sort((Object[])astitcher$holder); for (Stitcher.Holder stitcher$holder : astitcher$holder) { if (!this.allocateSlot(stitcher$holder)) { String s = String.format("Unable to fit: %s, size: %dx%d, atlas: %dx%d, atlasMax: %dx%d - Maybe try a lower resolution resourcepack?", new Object[] {stitcher$holder.getAtlasSprite().getIconName(), Integer.valueOf(stitcher$holder.getAtlasSprite().getIconWidth()), Integer.valueOf(stitcher$holder.getAtlasSprite().getIconHeight()), Integer.valueOf(this.currentWidth), Integer.valueOf(this.currentHeight), Integer.valueOf(this.maxWidth), Integer.valueOf(this.maxHeight)}); throw new StitcherException(stitcher$holder, s); } } if (this.forcePowerOf2) { this.currentWidth = MathHelper.roundUpToPowerOfTwo(this.currentWidth); this.currentHeight = MathHelper.roundUpToPowerOfTwo(this.currentHeight); } }
public void doStitch() { Stitcher.Holder[] astitcher$holder = (Stitcher.Holder[])((Stitcher.Holder[])this.setStitchHolders.toArray(new Stitcher.Holder[this.setStitchHolders.size()])); Arrays.sort((Object[])astitcher$holder); for (Stitcher.Holder stitcher$holder : astitcher$holder) { if (!this.allocateSlot(stitcher$holder)) { String s = String.format("Unable to fit: %s, size: %dx%d, atlas: %dx%d, atlasMax: %dx%d - Maybe try a lower resolution resourcepack?", new Object[] {stitcher$holder.getAtlasSprite().getIconName(), Integer.valueOf(stitcher$holder.getAtlasSprite().getIconWidth()), Integer.valueOf(stitcher$holder.getAtlasSprite().getIconHeight()), Integer.valueOf(this.currentWidth), Integer.valueOf(this.currentHeight), Integer.valueOf(this.maxWidth), Integer.valueOf(this.maxHeight)}); throw new StitcherException(stitcher$holder, s); } } this.currentWidth = MathHelper.smallestEncompassingPowerOfTwo(this.currentWidth); this.currentHeight = MathHelper.smallestEncompassingPowerOfTwo(this.currentHeight); }
public void doStitch() { Stitcher.Holder[] astitcher$holder = (Stitcher.Holder[])this.setStitchHolders.toArray(new Stitcher.Holder[this.setStitchHolders.size()]); Arrays.sort((Object[])astitcher$holder); net.minecraftforge.fml.common.ProgressManager.ProgressBar bar = net.minecraftforge.fml.common.ProgressManager.push("Texture stitching", astitcher$holder.length); for (Stitcher.Holder stitcher$holder : astitcher$holder) { bar.step(stitcher$holder.getAtlasSprite().getIconName()); if (!this.allocateSlot(stitcher$holder)) { String s = String.format("Unable to fit: %s - size: %dx%d - Maybe try a lowerresolution resourcepack?", new Object[] {stitcher$holder.getAtlasSprite().getIconName(), Integer.valueOf(stitcher$holder.getAtlasSprite().getIconWidth()), Integer.valueOf(stitcher$holder.getAtlasSprite().getIconHeight())}); net.minecraftforge.fml.common.FMLLog.info(s); for (Stitcher.Holder h : astitcher$holder) net.minecraftforge.fml.common.FMLLog.info(" %s", h); throw new StitcherException(stitcher$holder, s); } } this.currentWidth = MathHelper.roundUpToPowerOfTwo(this.currentWidth); this.currentHeight = MathHelper.roundUpToPowerOfTwo(this.currentHeight); net.minecraftforge.fml.common.ProgressManager.pop(bar); }
public void doStitch() { Stitcher.Holder[] var1 = (Stitcher.Holder[])this.setStitchHolders.toArray(new Stitcher.Holder[this.setStitchHolders.size()]); Arrays.sort(var1); Stitcher.Holder[] var2 = var1; int var3 = var1.length; for (int var4 = 0; var4 < var3; ++var4) { Stitcher.Holder var5 = var2[var4]; if (!this.allocateSlot(var5)) { String var6 = String.format("Unable to fit: %s - size: %dx%d - Maybe try a lowerresolution texturepack?", new Object[] {var5.getAtlasSprite().getIconName(), Integer.valueOf(var5.getAtlasSprite().getIconWidth()), Integer.valueOf(var5.getAtlasSprite().getIconHeight())}); throw new StitcherException(var5, var6); } } if (this.forcePowerOf2) { this.currentWidth = MathHelper.roundUpToPowerOfTwo(this.currentWidth); this.currentHeight = MathHelper.roundUpToPowerOfTwo(this.currentHeight); } }
public void doStitch() { Stitcher.Holder[] aholder = (Stitcher.Holder[])this.setStitchHolders.toArray(new Stitcher.Holder[this.setStitchHolders.size()]); Arrays.sort(aholder); Stitcher.Holder[] aholder1 = aholder; int i = aholder.length; for (int j = 0; j < i; ++j) { Stitcher.Holder holder = aholder1[j]; if (!this.allocateSlot(holder)) { String s = String.format("Unable to fit: %s - size: %dx%d - Maybe try a lowerresolution resourcepack?", new Object[] {holder.getAtlasSprite().getIconName(), Integer.valueOf(holder.getAtlasSprite().getIconWidth()), Integer.valueOf(holder.getAtlasSprite().getIconHeight())}); throw new StitcherException(holder, s); } } if (this.forcePowerOf2) { this.currentWidth = MathHelper.roundUpToPowerOfTwo(this.currentWidth); this.currentHeight = MathHelper.roundUpToPowerOfTwo(this.currentHeight); } }
public void func_94305_f() { StitchHolder[] var1 = (StitchHolder[])this.field_94319_a.toArray(new StitchHolder[this.field_94319_a.size()]); Arrays.sort(var1); StitchHolder[] var2 = var1; int var3 = var1.length; for(int var4 = 0; var4 < var3; ++var4) { StitchHolder var5 = var2[var4]; if(!this.func_94310_b(var5)) { String var6 = String.format("Unable to fit: %s - size: %dx%d - Maybe try a lowerresolution texturepack?", new Object[]{var5.func_98150_a().func_94215_i(), Integer.valueOf(var5.func_98150_a().func_94211_a()), Integer.valueOf(var5.func_98150_a().func_94216_b())}); throw new StitcherException(var5, var6); } } if(this.field_94314_g) { this.field_94318_c = this.func_94308_a(this.field_94318_c); this.field_94315_d = this.func_94308_a(this.field_94315_d); } }
public void doStitch() { StitchHolder[] astitchholder = (StitchHolder[])this.setStitchHolders.toArray(new StitchHolder[this.setStitchHolders.size()]); Arrays.sort(astitchholder); StitchHolder[] astitchholder1 = astitchholder; int i = astitchholder.length; for (int j = 0; j < i; ++j) { StitchHolder stitchholder = astitchholder1[j]; if (!this.allocateSlot(stitchholder)) { String s = String.format("Unable to fit: %s - size: %dx%d - Maybe try a lowerresolution texturepack?", new Object[] {stitchholder.getAtlasSprite().getIconName(), Integer.valueOf(stitchholder.getAtlasSprite().getIconWidth()), Integer.valueOf(stitchholder.getAtlasSprite().getIconHeight())}); throw new StitcherException(stitchholder, s); } } if (this.forcePowerOf2) { this.currentWidth = this.getCeilPowerOf2(this.currentWidth); this.currentHeight = this.getCeilPowerOf2(this.currentHeight); } }
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); } }