Some fixes for the snapshot

This commit is contained in:
Christian 2013-03-09 12:10:13 -05:00
parent 1a3022ae7a
commit 3c14424e30
5 changed files with 97 additions and 33 deletions

View File

@ -102,7 +102,7 @@ public class GuiModList extends GuiScreen
public int drawLine(String line, int offset, int shifty) public int drawLine(String line, int offset, int shifty)
{ {
this.field_73886_k.func_78276_b(line, offset, shifty, 0xd7edea); int r = this.field_73886_k.func_78276_b(line, offset, shifty, 0xd7edea);
return shifty + 10; return shifty + 10;
} }
@ -116,12 +116,21 @@ public class GuiModList extends GuiScreen
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
if (!selectedMod.getMetadata().autogenerated) { if (!selectedMod.getMetadata().autogenerated) {
int shifty = 35; int shifty = 35;
if (!selectedMod.getMetadata().logoFile.isEmpty()) String logoFile = selectedMod.getMetadata().logoFile;
if (!logoFile.isEmpty())
{ {
int texture = this.field_73882_e.field_71446_o.func_78341_b(selectedMod.getMetadata().logoFile);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_73882_e.field_71446_o.func_78342_b(texture); this.field_73882_e.field_71446_o.func_98187_b(logoFile);
Dimension dim = TextureFXManager.instance().getTextureDimensions(texture); Dimension dim = TextureFXManager.instance().getTextureDimensions(logoFile);
double scaleX = dim.width / 200.0;
double scaleY = dim.height / 65.0;
double scale = 1.0;
if (scaleX > 1 || scaleY > 1)
{
scale = 1.0 / Math.max(scaleX, scaleY);
}
dim.width *= scale;
dim.height *= scale;
int top = 32; int top = 32;
Tessellator tess = Tessellator.field_78398_a; Tessellator tess = Tessellator.field_78398_a;
tess.func_78382_b(); tess.func_78382_b();
@ -144,7 +153,11 @@ public class GuiModList extends GuiScreen
shifty = drawLine(String.format("Authors: %s", selectedMod.getMetadata().getAuthorList()), offset, shifty); shifty = drawLine(String.format("Authors: %s", selectedMod.getMetadata().getAuthorList()), offset, shifty);
shifty = drawLine(String.format("URL: %s", selectedMod.getMetadata().url), offset, shifty); shifty = drawLine(String.format("URL: %s", selectedMod.getMetadata().url), offset, shifty);
shifty = drawLine(selectedMod.getMetadata().childMods.isEmpty() ? "No child mods for this mod" : String.format("Child mods: %s", selectedMod.getMetadata().getChildModList()), offset, shifty); shifty = drawLine(selectedMod.getMetadata().childMods.isEmpty() ? "No child mods for this mod" : String.format("Child mods: %s", selectedMod.getMetadata().getChildModList()), offset, shifty);
this.getFontRenderer().func_78279_b(selectedMod.getMetadata().description, offset, shifty + 10, this.field_73880_f - offset - 20, 0xDDDDDD); int rightSide = this.field_73880_f - offset - 20;
if (rightSide > 20)
{
this.getFontRenderer().func_78279_b(selectedMod.getMetadata().description, offset, shifty + 10, rightSide, 0xDDDDDD);
}
} else { } else {
offset = ( this.listWidth + this.field_73880_f ) / 2; offset = ( this.listWidth + this.field_73880_f ) / 2;
this.func_73732_a(this.field_73886_k, selectedMod.getName(), offset, 35, 0xFFFFFF); this.func_73732_a(this.field_73886_k, selectedMod.getName(), offset, 35, 0xFFFFFF);

View File

@ -12,12 +12,16 @@
package cpw.mods.fml.client; package cpw.mods.fml.client;
import java.awt.Dimension;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.Map;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import com.google.common.collect.Maps;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderEngine; import net.minecraft.client.renderer.RenderEngine;
@ -27,6 +31,9 @@ public class TextureFXManager
private Minecraft client; private Minecraft client;
private Map<Integer,TextureHolder> texturesById = Maps.newHashMap();
private Map<String, TextureHolder> texturesByName = Maps.newHashMap();
void setClient(Minecraft client) void setClient(Minecraft client)
{ {
this.client = client; this.client = client;
@ -64,5 +71,35 @@ public class TextureFXManager
} }
} }
} }
public void bindTextureToName(String name, int index)
{
TextureHolder holder = new TextureHolder();
holder.textureId = index;
holder.textureName = name;
texturesById.put(index,holder);
texturesByName.put(name,holder);
}
public void setTextureDimensions(int index, int j, int k)
{
TextureHolder holder = texturesById.get(index);
if (holder == null)
{
return;
}
holder.x = j;
holder.y = k;
}
private class TextureHolder {
private int textureId;
private String textureName;
private int x;
private int y;
}
public Dimension getTextureDimensions(String texture)
{
return texturesByName.containsKey(texture) ? new Dimension(texturesByName.get(texture).x, texturesByName.get(texture).y) : new Dimension(1,1);
}
} }

View File

@ -4,21 +4,12 @@
def reallyrmtree(path): def reallyrmtree(path):
+ if os.path.isfile(os.path.join(path, 'asm-4.1.tar.gz')): #Check if asm exists, indicating the libs folder, if so, don't delete it + if os.path.isfile(os.path.join(path, 'asm-all-4.0.jar')): #Check if asm exists, indicating the libs folder, if so, don't delete it
+ return + return
if not sys.platform.startswith('win'): if not sys.platform.startswith('win'):
if os.path.exists(path): if os.path.exists(path):
shutil.rmtree(path) shutil.rmtree(path)
@@ -139,6 +141,8 @@ @@ -788,6 +790,8 @@
fieldnames = csvreader.fieldnames
return set(fieldnames)
+def commands_sanity_check():
+ print 'Commands patch applied successfully'
class Commands(object):
"""Contains the commands and initialisation for a full mcp run"""
@@ -796,6 +800,8 @@
binlk = {CLIENT: self.binclient, SERVER: self.binserver} binlk = {CLIENT: self.binclient, SERVER: self.binserver}
testlk = {CLIENT: self.testclient, SERVER: self.testserver} testlk = {CLIENT: self.testclient, SERVER: self.testserver}
@ -27,7 +18,7 @@
if not os.path.exists(os.path.join(binlk[side], os.path.normpath(testlk[side] + '.class'))): if not os.path.exists(os.path.join(binlk[side], os.path.normpath(testlk[side] + '.class'))):
return False return False
return True return True
@@ -1037,6 +1043,10 @@ @@ -1029,6 +1033,10 @@
pathsrclk = {CLIENT: self.srcclient, SERVER: self.srcserver} pathsrclk = {CLIENT: self.srcclient, SERVER: self.srcserver}
pathlog = {CLIENT: self.clientrecomplog, SERVER: self.serverrecomplog} pathlog = {CLIENT: self.clientrecomplog, SERVER: self.serverrecomplog}
@ -38,7 +29,7 @@
if not os.path.exists(pathbinlk[side]): if not os.path.exists(pathbinlk[side]):
os.makedirs(pathbinlk[side]) os.makedirs(pathbinlk[side])
@@ -1070,7 +1080,7 @@ @@ -1062,7 +1070,7 @@
raise raise
def startserver(self): def startserver(self):
@ -47,7 +38,7 @@
classpath = [os.path.join('..', p) for p in classpath] classpath = [os.path.join('..', p) for p in classpath]
classpath = os.pathsep.join(classpath) classpath = os.pathsep.join(classpath)
os.chdir(self.dirjars) os.chdir(self.dirjars)
@@ -1078,7 +1088,7 @@ @@ -1070,7 +1078,7 @@
self.runmc(forkcmd) self.runmc(forkcmd)
def startclient(self): def startclient(self):
@ -56,7 +47,7 @@
classpath = [os.path.join('..', p) for p in classpath] classpath = [os.path.join('..', p) for p in classpath]
classpath = os.pathsep.join(classpath) classpath = os.pathsep.join(classpath)
natives = os.path.join('..', self.dirnatives) natives = os.path.join('..', self.dirnatives)
@@ -1205,20 +1215,20 @@ @@ -1197,20 +1205,20 @@
with open(self.csvmethods, 'rb') as fh: with open(self.csvmethods, 'rb') as fh:
methodsreader = csv.DictReader(fh) methodsreader = csv.DictReader(fh)
for row in methodsreader: for row in methodsreader:
@ -80,7 +71,7 @@
names['params'][row['param']] = row['name'] names['params'][row['param']] = row['name']
regexps = { regexps = {
@@ -1352,13 +1362,13 @@ @@ -1344,13 +1352,13 @@
methods = {} methods = {}
for row in methodsreader: for row in methodsreader:
#HINT: Only include methods that have a non-empty description #HINT: Only include methods that have a non-empty description
@ -96,7 +87,7 @@
fields[row['searge']] = row['desc'].replace('*/', '* /') fields[row['searge']] = row['desc'].replace('*/', '* /')
regexps = { regexps = {
@@ -1435,7 +1445,7 @@ @@ -1427,7 +1435,7 @@
self.runcmd(forkcmd) self.runcmd(forkcmd)
return True return True
@ -105,7 +96,7 @@
if not reobf: if not reobf:
md5lk = {CLIENT: self.md5client, SERVER: self.md5server} md5lk = {CLIENT: self.md5client, SERVER: self.md5server}
else: else:
@@ -1450,6 +1460,9 @@ @@ -1442,6 +1450,9 @@
class_path = '' class_path = ''
else: else:
class_path += '/' class_path += '/'
@ -115,7 +106,7 @@
for class_file in fnmatch.filter(filelist, '*.class'): for class_file in fnmatch.filter(filelist, '*.class'):
class_name = class_path + os.path.splitext(class_file)[0] class_name = class_path + os.path.splitext(class_file)[0]
bin_file = os.path.normpath(os.path.join(path, class_file)) bin_file = os.path.normpath(os.path.join(path, class_file))
@@ -1546,6 +1559,8 @@ @@ -1535,6 +1546,8 @@
if not os.path.exists(outpathlk[side]): if not os.path.exists(outpathlk[side]):
os.makedirs(outpathlk[side]) os.makedirs(outpathlk[side])
@ -124,7 +115,7 @@
# HINT: We extract the modified class files # HINT: We extract the modified class files
with closing(zipfile.ZipFile(jarlk[side])) as zipjar: with closing(zipfile.ZipFile(jarlk[side])) as zipjar:
for in_class in trgclasses: for in_class in trgclasses:
@@ -1559,6 +1574,23 @@ @@ -1548,6 +1561,23 @@
out_class = out_class.replace(self.nullpkg, '') out_class = out_class.replace(self.nullpkg, '')
if out_class[0] == '/': if out_class[0] == '/':
out_class = out_class[1:] out_class = out_class[1:]
@ -148,7 +139,7 @@
try: try:
zipjar.extract(out_class, outpathlk[side]) zipjar.extract(out_class, outpathlk[side])
self.logger.info('> Outputted %s to %s as %s', in_class.ljust(35), outpathlk[side], out_class) self.logger.info('> Outputted %s to %s as %s', in_class.ljust(35), outpathlk[side], out_class)
@@ -1605,6 +1637,9 @@ @@ -1594,6 +1624,9 @@
sys.exit(1) sys.exit(1)
for entry in newfiles: for entry in newfiles:
@ -158,7 +149,7 @@
if entry[3] == 'U': if entry[3] == 'U':
self.logger.info('Retrieving file from server : %s', entry[0]) self.logger.info('Retrieving file from server : %s', entry[0])
cur_file = os.path.normpath(entry[0]) cur_file = os.path.normpath(entry[0])
@@ -1625,6 +1660,9 @@ @@ -1614,6 +1647,9 @@
md5reoblk = {CLIENT: self.md5reobfclient, SERVER: self.md5reobfserver} md5reoblk = {CLIENT: self.md5reobfclient, SERVER: self.md5reobfserver}
outpathlk = {CLIENT: self.srcmodclient, SERVER: self.srcmodserver} outpathlk = {CLIENT: self.srcmodclient, SERVER: self.srcmodserver}
src = {CLIENT: self.srcclient, SERVER: self.srcserver} src = {CLIENT: self.srcclient, SERVER: self.srcserver}
@ -168,3 +159,10 @@
# HINT: We need a table for the old md5 and the new ones # HINT: We need a table for the old md5 and the new ones
md5table = {} md5table = {}
@@ -1656,3 +1692,6 @@
except IOError:
self.logger.error('* File %s copy failed', in_class)
+def commands_sanity_check():
+ print 'Commands patch applied successfully'
+

View File

@ -5,7 +5,7 @@
"description": "Modding toolkit to decompile and deobfuscate the Minecraft client and server files.", "description": "Modding toolkit to decompile and deobfuscate the Minecraft client and server files.",
"version": "7.42", "version": "7.42",
"mcversion": "1.5", "mcversion": "1.5",
"logoFile": "mcp.png", "logoFile": "/mcp.png",
"url": "http://mcp.ocean-labs.de/", "url": "http://mcp.ocean-labs.de/",
"updateUrl": "", "updateUrl": "",
"authors": ["Searge", "ProfMobius", "IngisKahn", "Fesh0r", "ZeuX", "R4wk", "Others"], "authors": ["Searge", "ProfMobius", "IngisKahn", "Fesh0r", "ZeuX", "R4wk", "Others"],

View File

@ -52,7 +52,15 @@
ioexception.printStackTrace(); ioexception.printStackTrace();
int[] aint2 = this.func_78348_b(this.field_78364_l); int[] aint2 = this.func_78348_b(this.field_78364_l);
this.field_78359_d.put(p_78346_1_, aint2); this.field_78359_d.put(p_78346_1_, aint2);
@@ -184,7 +195,9 @@ @@ -162,6 +173,7 @@
try
{
int i = GLAllocation.func_74528_a();
+ TextureFXManager.instance().bindTextureToName(p_78341_1_, i);
boolean flag = p_78341_1_.startsWith("%blur%");
if (flag)
@@ -184,7 +196,9 @@
} }
else else
{ {
@ -63,7 +71,15 @@
} }
this.field_78362_c.put(s1, Integer.valueOf(i)); this.field_78362_c.put(s1, Integer.valueOf(i));
@@ -412,10 +425,12 @@ @@ -240,6 +254,7 @@
int j = p_98184_1_.getWidth();
int k = p_98184_1_.getHeight();
+ TextureFXManager.instance().setTextureDimensions(p_98184_2_, j, k);
int[] aint = new int[j * k];
p_98184_1_.getRGB(0, 0, j, k, aint, 0, j);
@@ -412,10 +427,12 @@
} }
BufferedImage bufferedimage1 = this.func_78345_a(itexturepack.func_77532_a(s)); BufferedImage bufferedimage1 = this.func_78345_a(itexturepack.func_77532_a(s));
@ -78,7 +94,7 @@
ioexception.printStackTrace(); ioexception.printStackTrace();
} }
} }
@@ -429,10 +444,12 @@ @@ -429,10 +446,12 @@
try try
{ {
bufferedimage = this.func_78345_a(itexturepack.func_77532_a(s)); bufferedimage = this.func_78345_a(itexturepack.func_77532_a(s));