Update some stuff

This commit is contained in:
Christian 2012-07-02 23:49:40 -04:00
parent 777b4407c2
commit 07a1927c25
15 changed files with 162 additions and 42 deletions

View file

@ -126,6 +126,7 @@
<side prop="merge-to" src="mcp.srcdir" side="${side}" />
<side prop="side-from" src="src.dir" side="${side}" />
<delete dir="${merge-to}/argo"/>
<copy todir="${merge-to}" overwrite="true" verbose="true">
<fileset dir="${side-from}" includes="**/*.java" />
<fileset dir="${common.src.dir}" includes="**/*.java" />

View file

@ -794,11 +794,11 @@ public class FMLClientHandler implements IFMLSidedHandler
@Override
public ModMetadata readMetadataFrom(InputStream input, ModContainer mod) throws Exception
{
JsonNode root=new JdomParser().func_27366_a(new InputStreamReader(input));
List<JsonNode> lst=root.func_27217_b();
JsonNode root=new JdomParser().parse(new InputStreamReader(input));
List<JsonNode> lst=root.getArrayNode();
JsonNode modinfo = null;
for (JsonNode tmodinfo : lst) {
if (mod.getName().equals(tmodinfo.func_27213_a("modid"))) {
if (mod.getName().equals(tmodinfo.getStringValue("modid"))) {
modinfo = tmodinfo;
break;
}
@ -809,23 +809,23 @@ public class FMLClientHandler implements IFMLSidedHandler
}
ModMetadata meta=new ModMetadata(mod);
try {
meta.name=modinfo.func_27213_a("name");
meta.description=modinfo.func_27213_a("description").replace("\r", "");
meta.version=modinfo.func_27213_a("version");
meta.credits=modinfo.func_27213_a("credits");
List authors=modinfo.func_27217_b("authors");
meta.name=modinfo.getStringValue("name");
meta.description=modinfo.getStringValue("description").replace("\r", "");
meta.version=modinfo.getStringValue("version");
meta.credits=modinfo.getStringValue("credits");
List<JsonNode> authors=modinfo.getArrayNode("authors");
StringBuilder sb=new StringBuilder();
for (int i=0; i<authors.size(); i++) {
meta.authorList.add(((JsonNode)authors.get(i)).func_27216_b());
meta.authorList.add(((JsonNode)authors.get(i)).getText());
}
meta.logoFile=modinfo.func_27213_a("logoFile");
meta.url=modinfo.func_27213_a("url");
meta.updateUrl=modinfo.func_27213_a("updateUrl");
meta.parent=modinfo.func_27213_a("parent");
List screenshots=modinfo.func_27217_b("screenshots");
meta.logoFile=modinfo.getStringValue("logoFile");
meta.url=modinfo.getStringValue("url");
meta.updateUrl=modinfo.getStringValue("updateUrl");
meta.parent=modinfo.getStringValue("parent");
List<JsonNode> screenshots=modinfo.getArrayNode("screenshots");
meta.screenshots=new String[screenshots.size()];
for (int i=0; i<screenshots.size(); i++) {
meta.screenshots[i]=((JsonNode)screenshots.get(i)).func_27216_b();
meta.screenshots[i]=((JsonNode)screenshots.get(i)).getText();
}
} catch (Exception e) {
FMLCommonHandler.instance().getFMLLogger().log(Level.FINE, String.format("An error occured reading the info file for %s",mod.getName()), e);
@ -918,15 +918,6 @@ public class FMLClientHandler implements IFMLSidedHandler
Profiler.func_40662_b();
}
/**
*
*/
public void preGameLoad(String[] args)
{
// Currently this does nothing, but it's possible I could relaunch Minecraft in a new classloader if I wished
Minecraft.fmlReentry(args);
}
public void onTexturePackChange(RenderEngine engine, TexturePackBase texturepack, List<TextureFX> effects)
{
FMLClientHandler.instance().pruneOldTextureFX(texturepack, effects);

View file

@ -0,0 +1,11 @@
package cpw.mods.fml.relauncher;
public class ArgsWrapper
{
public ArgsWrapper(String[] args)
{
this.args=args;
}
public String[] args;
}

View file

@ -0,0 +1,48 @@
package cpw.mods.fml.relauncher;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.net.URLClassLoader;
import net.minecraft.client.Minecraft;
import net.minecraft.src.WorldSettings;
public class FMLEmbeddingRelauncher
{
private static FMLEmbeddingRelauncher INSTANCE;
private RelaunchClassLoader clientLoader;
private RelaunchClassLoader serverLoader;
public static void relaunch(ArgsWrapper wrap)
{
INSTANCE = new FMLEmbeddingRelauncher();
INSTANCE.relaunchClient(wrap);
}
private FMLEmbeddingRelauncher()
{
URLClassLoader ucl = (URLClassLoader)getClass().getClassLoader();
clientLoader = new RelaunchClassLoader(ucl.getURLs());
serverLoader = new RelaunchClassLoader(ucl.getURLs());
}
private void relaunchClient(ArgsWrapper wrap)
{
try
{
Class<?> original = Class.forName("net.minecraft.client.Minecraft", false, getClass().getClassLoader());
Field origDir = original.getDeclaredField("field_6275_Z");
origDir.setAccessible(true);
Class client = Class.forName("net.minecraft.client.Minecraft", false, clientLoader);
Field homeDir = client.getDeclaredField("field_6275_Z");
homeDir.setAccessible(true);
homeDir.set(null, origDir.get(null));
client.getMethod("fmlReentry", ArgsWrapper.class).invoke(null, wrap);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}

View file

@ -0,0 +1,31 @@
package cpw.mods.fml.relauncher;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Arrays;
public class RelaunchClassLoader extends URLClassLoader
{
public RelaunchClassLoader(URL[] sources)
{
super(sources);
System.out.println(Arrays.toString(sources));
}
@Override
public Class<?> loadClass(String name) throws ClassNotFoundException
{
if (name.startsWith("cpw.mods.fml.relauncher"))
{
return super.loadClass(name);
}
try
{
return findClass(name);
}
catch (ClassNotFoundException cnfe)
{
return super.loadClass(name);
}
}
}

View file

@ -20,5 +20,6 @@
</attributes>
</classpathentry>
<classpathentry kind="lib" path="jars/bin/minecraft.jar"/>
<classpathentry kind="lib" path="/home/cpw/projects/FML/mcsnapshot/lib/argo-2.25.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -1,16 +1,18 @@
--- ../src-base/minecraft/net/minecraft/client/Minecraft.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src-work/minecraft/net/minecraft/client/Minecraft.java 0000-00-00 00:00:00.000000000 -0000
@@ -120,6 +120,9 @@
@@ -120,6 +120,11 @@
import org.lwjgl.opengl.PixelFormat;
import org.lwjgl.util.glu.GLU;
+import cpw.mods.fml.client.FMLClientHandler;
+import cpw.mods.fml.common.FMLCommonHandler;
+import cpw.mods.fml.relauncher.ArgsWrapper;
+import cpw.mods.fml.relauncher.FMLEmbeddingRelauncher;
+
public abstract class Minecraft implements IPlayerUsage, Runnable
{
public static byte[] field_28006_b = new byte[10485760];
@@ -301,6 +304,7 @@
@@ -301,6 +306,7 @@
this.field_6315_n = new RenderEngine(this.field_6298_C, this.field_6304_y);
this.func_6257_q();
this.field_6314_o = new FontRenderer(this.field_6304_y, "/font/default.png", this.field_6315_n, false);
@ -18,7 +20,7 @@
this.field_40007_r = new FontRenderer(this.field_6304_y, "/font/alternate.png", this.field_6315_n, false);
if (this.field_6304_y.field_44018_Q != null)
@@ -332,6 +336,9 @@
@@ -332,6 +338,9 @@
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
@ -28,9 +30,9 @@
this.func_6250_c("Startup");
this.field_6301_A.func_340_a(this.field_6304_y);
this.field_6315_n.func_1066_a(this.field_9231_Y);
@@ -1337,11 +1344,13 @@
@@ -1318,11 +1327,13 @@
public void func_6246_i() throws IOException
public void func_6246_i()
{
+ FMLCommonHandler.instance().rescheduleTicks();
if (this.field_35001_ab > 0)
@ -42,7 +44,7 @@
Profiler.func_40663_a("stats");
this.field_25001_G.func_27178_d();
Profiler.func_40661_c("gui");
@@ -1710,6 +1719,7 @@
@@ -1691,6 +1702,7 @@
}
Profiler.func_40662_b();
@ -50,7 +52,7 @@
this.field_6287_N = System.currentTimeMillis();
}
@@ -1854,6 +1864,7 @@
@@ -1849,6 +1861,7 @@
System.gc();
this.field_6287_N = 0L;
@ -58,14 +60,15 @@
}
public void func_6268_a(String p_6268_1_, File p_6268_2_)
@@ -1944,6 +1955,10 @@
@@ -1940,6 +1953,11 @@
public static void main(String[] p_main_0_)
{
+ FMLClientHandler.instance().preGameLoad(p_main_0_);
+ FMLEmbeddingRelauncher.relaunch(new ArgsWrapper(p_main_0_));
+ }
+ public static void fmlReentry(String[] p_main_0_)
+ public static void fmlReentry(ArgsWrapper wrapper)
+ {
+ String[] p_main_0_ = wrapper.args;
HashMap var1 = new HashMap();
boolean var2 = false;
boolean var3 = true;

View file

@ -39,7 +39,7 @@
+ }
if (p_572_1_.field_938_f == 11)
{
this.field_945_b.func_56442_a("Demo_World", DemoWorldServer.field_56874_a);
this.field_945_b.func_58039_a("Demo_World", "Demo_World", DemoWorldServer.field_56874_a);
@@ -399,7 +409,11 @@
var9 = var9 + " Demo";
}

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/src/NetClientHandler.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src-work/minecraft/net/minecraft/src/NetClientHandler.java 0000-00-00 00:00:00.000000000 -0000
@@ -22,6 +22,8 @@
@@ -20,6 +20,8 @@
import net.minecraft.client.Minecraft;
import org.lwjgl.input.Keyboard;
@ -9,7 +9,7 @@
public class NetClientHandler extends NetHandler
{
private boolean field_55324_f = false;
@@ -1157,4 +1159,13 @@
@@ -1165,4 +1167,13 @@
{
return this.field_1213_d;
}

View file

@ -0,0 +1,34 @@
--- ../src-base/minecraft/net/minecraft/src/StatFileWriter.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src-work/minecraft/net/minecraft/src/StatFileWriter.java 0000-00-00 00:00:00.000000000 -0000
@@ -124,17 +124,17 @@
{
String var2 = "local";
StringBuilder var3 = new StringBuilder();
- JsonRootNode var4 = (new JdomParser()).func_27367_a(p_27177_0_);
- List var5 = var4.func_27217_b(new Object[] {"stats-change"});
+ JsonRootNode var4 = (new JdomParser()).parse(p_27177_0_);
+ List var5 = var4.getArrayNode(new Object[] {"stats-change"});
Iterator var6 = var5.iterator();
while (var6.hasNext())
{
JsonNode var7 = (JsonNode)var6.next();
- Map var8 = var7.func_27214_c();
+ Map var8 = var7.getFields();
Entry var9 = (Entry)var8.entrySet().iterator().next();
- int var10 = Integer.parseInt(((JsonStringNode)var9.getKey()).func_27216_b());
- int var11 = Integer.parseInt(((JsonNode)var9.getValue()).func_27216_b());
+ int var10 = Integer.parseInt(((JsonStringNode)var9.getKey()).getText());
+ int var11 = Integer.parseInt(((JsonNode)var9.getValue()).getText());
StatBase var12 = StatList.func_27361_a(var10);
if (var12 == null)
@@ -152,7 +152,7 @@
MD5String var14 = new MD5String(var2);
String var15 = var14.func_27369_a(var3.toString());
- if (!var15.equals(var4.func_27213_a(new Object[] {"checksum"})))
+ if (!var15.equals(var4.getNode(new Object[] {"checksum"})))
{
System.out.println("CHECKSUM MISMATCH");
return null;

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/src/World.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src-work/minecraft/net/minecraft/src/World.java 0000-00-00 00:00:00.000000000 -0000
@@ -3320,7 +3320,7 @@
@@ -3322,7 +3322,7 @@
public double func_46068_G()
{

View file

@ -9,7 +9,7 @@
public class ChunkProviderServer implements IChunkProvider
{
private Set field_725_a = new HashSet();
@@ -173,6 +175,7 @@
@@ -177,6 +179,7 @@
if (this.field_730_c != null)
{
this.field_730_c.func_4055_a(p_4055_1_, p_4055_2_, p_4055_3_);

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft_server/net/minecraft/src/Entity.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src-work/minecraft_server/net/minecraft/src/Entity.java 0000-00-00 00:00:00.000000000 -0000
@@ -1525,4 +1525,8 @@
@@ -1539,4 +1539,8 @@
{
return String.format("%s[\'%s\'/%d, l=\'%s\', x=%.2f, y=%.2f, z=%.2f]", new Object[] {this.getClass().getSimpleName(), this.func_35150_Y(), Integer.valueOf(this.field_331_c), this.field_9093_l == null ? "~NULL~" : this.field_9093_l.func_22081_n().func_55310_h(), Double.valueOf(this.field_322_l), Double.valueOf(this.field_321_m), Double.valueOf(this.field_320_n)});
}

View file

@ -9,7 +9,7 @@
import net.minecraft.server.MinecraftServer;
public class NetServerHandler extends NetHandler
@@ -1011,4 +1013,9 @@
@@ -1014,4 +1016,9 @@
}
}
}

View file

@ -9,7 +9,7 @@
import net.minecraft.server.MinecraftServer;
public abstract class ServerConfigurationManager
@@ -359,6 +361,8 @@
@@ -355,6 +357,8 @@
p_28168_1_.field_425_ad.func_35694_a(var5);
this.func_28170_a(p_28168_1_, var5);
this.func_30008_g(p_28168_1_);