FML is no more. FML has ceased to be. FML's expired and gone to meet its maker. FML's a stiff! Bereft of life, FML rests in peace.

This commit is contained in:
cpw committed 2015-08-01 23:51:40 -04:00
1 parent 9a859f8d5c
commit 614bbcb0da
356 files changed
+2676 -235

No files matched your search

@@ -1,17 +1,63 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureMap.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureMap.java
@@ -104,6 +104,8 @@
@@ -29,6 +29,7 @@
@SideOnly(Side.CLIENT)
public class TextureMap extends AbstractTexture implements ITickableTextureObject
{
+ private static final boolean ENABLE_SKIP = Boolean.parseBoolean(System.getProperty("fml.skipFirstTextureLoad", "true"));
private static final Logger field_147635_d = LogManager.getLogger();
public static final ResourceLocation field_174945_f = new ResourceLocation("missingno");
public static final ResourceLocation field_110575_b = new ResourceLocation("textures/atlas/blocks.png");
@@ -40,6 +41,7 @@
private int field_147636_j;
private final TextureAtlasSprite field_94249_f;
private static final String __OBFID = "CL_00001058";
+ private boolean skipFirst = false;
public TextureMap(String p_i46099_1_)
{
@@ -48,12 +50,23 @@
public TextureMap(String p_i46100_1_, IIconCreator p_i46100_2_)
{
+ this(p_i46100_1_, p_i46100_2_, false);
+ }
+
+ public TextureMap(String p_i46100_1_, boolean skipFirst)
+ {
+ this(p_i46100_1_, null, skipFirst);
+ }
+
+ public TextureMap(String p_i46100_1_, IIconCreator iconCreatorIn, boolean skipFirst)
+ {
this.field_94258_i = Lists.newArrayList();
this.field_110574_e = Maps.newHashMap();
this.field_94252_e = Maps.newHashMap();
this.field_94249_f = new TextureAtlasSprite("missingno");
this.field_94254_c = p_i46100_1_;
- this.field_174946_m = p_i46100_2_;
+ this.field_174946_m = iconCreatorIn;
+ this.skipFirst = skipFirst && ENABLE_SKIP;
}
private void func_110569_e()
@@ -91,15 +104,29 @@
this.field_94258_i.clear();
int j = Integer.MAX_VALUE;
int k = 1 << this.field_147636_j;
+ net.minecraftforge.client.ForgeHooksClient.onTextureStitchedPre(this);
+ net.minecraftforge.fml.common.FMLLog.info("Max texture size: %d", i);
net.minecraftforge.fml.common.ProgressManager.ProgressBar bar = net.minecraftforge.fml.common.ProgressManager.push("Texture stitching", skipFirst ? 0 : this.field_110574_e.size());
+ net.minecraftforge.fml.common.ProgressManager.ProgressBar bar = net.minecraftforge.fml.common.ProgressManager.push("Texture stitching", skipFirst ? 0 : this.field_110574_e.size());
Iterator iterator = this.field_110574_e.entrySet().iterator();
@@ -115,6 +117,16 @@
- while (iterator.hasNext())
+ while (!skipFirst && iterator.hasNext())
{
Entry entry = (Entry)iterator.next();
TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)entry.getValue();
ResourceLocation resourcelocation = new ResourceLocation(textureatlassprite.func_94215_i());
ResourceLocation resourcelocation1 = this.func_147634_a(resourcelocation, 0);
bar.step(resourcelocation1.func_110623_a());
+ bar.step(resourcelocation1.func_110623_a());
+ if (textureatlassprite.hasCustomLoader(p_110571_1_, resourcelocation))
+ {
@@ -26,7 +72,74 @@
try
{
IResource iresource = p_110571_1_.func_110536_a(resourcelocation1);
@@ -301,6 +313,9 @@
@@ -150,12 +177,14 @@
}
catch (RuntimeException runtimeexception)
{
- field_147635_d.error("Unable to parse metadata from " + resourcelocation1, runtimeexception);
+ //logger.error("Unable to parse metadata from " + resourcelocation1, runtimeexception);
+ net.minecraftforge.fml.client.FMLClientHandler.instance().trackBrokenTexture(resourcelocation1, runtimeexception.getMessage());
continue;
}
catch (IOException ioexception1)
{
- field_147635_d.error("Using missing texture, unable to load " + resourcelocation1, ioexception1);
+ //logger.error("Using missing texture, unable to load " + resourcelocation1, ioexception1);
+ net.minecraftforge.fml.client.FMLClientHandler.instance().trackMissingTexture(resourcelocation1);
continue;
}
@@ -171,6 +200,7 @@
stitcher.func_110934_a(textureatlassprite);
}
+ net.minecraftforge.fml.common.ProgressManager.pop(bar);
int j1 = Math.min(j, k);
int k1 = MathHelper.func_151239_c(j1);
@@ -181,10 +211,12 @@
}
Iterator iterator1 = this.field_110574_e.values().iterator();
+ bar = net.minecraftforge.fml.common.ProgressManager.push("Mipmap generation", skipFirst ? 0 : this.field_110574_e.size());
- while (iterator1.hasNext())
+ while (!skipFirst && iterator1.hasNext())
{
final TextureAtlasSprite textureatlassprite1 = (TextureAtlasSprite)iterator1.next();
+ bar.step(textureatlassprite1.func_94215_i());
try
{
@@ -225,9 +257,13 @@
this.field_94249_f.func_147963_d(this.field_147636_j);
stitcher.func_110934_a(this.field_94249_f);
+ net.minecraftforge.fml.common.ProgressManager.pop(bar);
+ skipFirst = false;
+ bar = net.minecraftforge.fml.common.ProgressManager.push("Texture creation", 3);
try
{
+ bar.step("Stitching");
stitcher.func_94305_f();
}
catch (StitcherException stitcherexception)
@@ -236,11 +272,13 @@
}
field_147635_d.info("Created: {}x{} {}-atlas", new Object[] {Integer.valueOf(stitcher.func_110935_a()), Integer.valueOf(stitcher.func_110936_b()), this.field_94254_c});
+ bar.step("Allocating GL texture");
TextureUtil.func_180600_a(this.func_110552_b(), this.field_147636_j, stitcher.func_110935_a(), stitcher.func_110936_b());
HashMap hashmap = Maps.newHashMap(this.field_110574_e);
Iterator iterator2 = stitcher.func_94309_g().iterator();
TextureAtlasSprite textureatlassprite2;
+ bar.step("Uploading GL texture");
while (iterator2.hasNext())
{
textureatlassprite2 = (TextureAtlasSprite)iterator2.next();
@@ -275,7 +313,11 @@
textureatlassprite2.func_94217_a(this.field_94249_f);
}
@@ -34,9 +147,11 @@
+
+ if (!net.minecraftforge.common.ForgeModContainer.disableStitchedFileSaving)
TextureUtil.func_177055_a(this.field_94254_c.replaceAll("/", "_"), this.func_110552_b(), this.field_147636_j, stitcher.func_110935_a(), stitcher.func_110936_b());
net.minecraftforge.fml.common.ProgressManager.pop(bar);
+ net.minecraftforge.fml.common.ProgressManager.pop(bar);
}
@@ -368,4 +383,37 @@
private ResourceLocation func_147634_a(ResourceLocation p_147634_1_, int p_147634_2_)
@@ -341,4 +383,37 @@
{
return this.field_94249_f;
}