changed System.out.println to Log.debug

master
flying sheep 2013-04-13 22:49:13 +02:00
parent c2124315e3
commit 14329b64a6
6 changed files with 22 additions and 17 deletions

View File

@ -2,6 +2,7 @@ package MoF;
import amidst.Log;
import amidst.map.*; import amidst.map.*;
import java.awt.Color; import java.awt.Color;
@ -45,7 +46,7 @@ public class ChunkManager extends Thread
t = types[1]; t = types[1];
} }
} }
System.out.println("Err: " + t.toString()); Log.debug("Err: " + t.toString());
s12w03a = ClassLoader.getSystemClassLoader().loadClass(t.toString().split(" ")[1]); s12w03a = ClassLoader.getSystemClassLoader().loadClass(t.toString().split(" ")[1]);
} }
@ -62,7 +63,7 @@ public class ChunkManager extends Thread
genString = "c"; genString = "c";
else if (SaveLoader.genType.equals("largeBiomes")) else if (SaveLoader.genType.equals("largeBiomes"))
genString = "d"; genString = "d";
System.out.println("GenString: " + genString); Log.debug("GenString: " + genString);
ret = (Object[])init.invoke(null, seed, s12w03a.getField(genString).get(null)); ret = (Object[])init.invoke(null, seed, s12w03a.getField(genString).get(null));
} else { } else {
init = iBiome.getDeclaredMethod("a", new Class[] {Long.TYPE}); init = iBiome.getDeclaredMethod("a", new Class[] {Long.TYPE});
@ -87,7 +88,7 @@ public class ChunkManager extends Thread
pyramidFinder = new MapGenPyramid(); pyramidFinder = new MapGenPyramid();
} }
public void dispose() { public void dispose() {
System.out.println("DISPOSING OF CHUNKMANAGER"); Log.debug("DISPOSING OF CHUNKMANAGER");
this.active = false; this.active = false;
this.b = null; this.b = null;
this.strongholds = null; this.strongholds = null;
@ -305,7 +306,7 @@ public class ChunkManager extends Thread
int i4 = i + i3 % n << 2; int i4 = i + i3 % n << 2;
int i5 = j + i3 / n << 2; int i5 = j + i3 / n << 2;
if (arrayOfInt[i3] > Biome.a.length) { if (arrayOfInt[i3] > Biome.a.length) {
System.out.println(arrayOfInt[i3]); Log.debug(arrayOfInt[i3]);
System.exit(0); System.exit(0);
} }
Biome localBiome = Biome.a[arrayOfInt[i3]]; Biome localBiome = Biome.a[arrayOfInt[i3]];

View File

@ -2,6 +2,7 @@ package MoF;
import amidst.Amidst; import amidst.Amidst;
import amidst.Log;
import amidst.Options; import amidst.Options;
import amidst.Util; import amidst.Util;
import amidst.gui.AmidstMenu; import amidst.gui.AmidstMenu;
@ -149,7 +150,7 @@ public class FinderWindow extends JFrame {
if (typeString.startsWith("class ") && !typeString.contains(".")) if (typeString.startsWith("class ") && !typeString.contains("."))
typeDump += typeString.substring(6); typeDump += typeString.substring(6);
} }
System.out.println(typeDump.replace("[", "-")); Log.debug(typeDump.replace("[", "-"));
String worldName; String worldName;
Field f; Field f;
java.lang.reflect.Type t; java.lang.reflect.Type t;
@ -212,7 +213,7 @@ public class FinderWindow extends JFrame {
worldName = "acv"; worldName = "acv";
} }
} }
System.out.println("World class : " + worldName); Log.debug("World class:", worldName);
//Find biomeManager: //Find biomeManager:
mc = ClassLoader.getSystemClassLoader().loadClass(worldName); mc = ClassLoader.getSystemClassLoader().loadClass(worldName);
@ -222,7 +223,7 @@ public class FinderWindow extends JFrame {
m = mc.getMethod("a"); m = mc.getMethod("a");
} catch (NoSuchMethodException e3) { } catch (NoSuchMethodException e3) {
v13 = true; v13 = true;
System.out.println("1.3-pre or newer found."); Log.debug("1.3-pre or newer found.");
} }
if (v13) { if (v13) {
try { try {
@ -245,16 +246,15 @@ public class FinderWindow extends JFrame {
//12w07a or newer. //12w07a or newer.
m = mc.getDeclaredMethod("i"); m = mc.getDeclaredMethod("i");
t = m.getReturnType(); t = m.getReturnType();
System.out.println("Version 12w07a or newer found!"); Log.debug("Version 12w07a or newer found!");
} }
if (t.toString().equals("void")) { if (t.toString().equals("void")) {
System.out.println("Version 1.4.2 or newer found."); Log.debug("Version 1.4.2 or newer found.");
} }
String chunkName = t.toString().split(" ")[1]; String chunkName = t.toString().split(" ")[1];
mc = ClassLoader.getSystemClassLoader().loadClass(chunkName); mc = ClassLoader.getSystemClassLoader().loadClass(chunkName);
biomeFinder = mc; biomeFinder = mc;
System.out.println("Biome Finder : " + chunkName); Log.debug("Biome Finder:", chunkName);
f = mc.getDeclaredField(is131?"d":"b"); f = mc.getDeclaredField(is131?"d":"b");
t = f.getType(); t = f.getType();
@ -274,7 +274,7 @@ public class FinderWindow extends JFrame {
t = f.getType(); t = f.getType();
ReflectionInfo.biomeName = t.toString().split(" ")[1]; ReflectionInfo.biomeName = t.toString().split(" ")[1];
String intCache; String intCache;
System.out.println(biomeName); Log.debug("Biome class:", biomeName);
if (biomeName.equals("ait")&&is131) { if (biomeName.equals("ait")&&is131) {
ReflectionInfo.version = "1.5.1"; ReflectionInfo.version = "1.5.1";
ReflectionInfo.versionID = 60; ReflectionInfo.versionID = 60;
@ -434,7 +434,8 @@ public class FinderWindow extends JFrame {
intCache = st; intCache = st;
} }
} }
System.out.println("Version " + ReflectionInfo.version + " detected. " + (Options.instance.saveEnabled ? "" : "Saves disabled.")); Log.debug("Version:", ReflectionInfo.version);
if (!Options.instance.saveEnabled) Log.debug("Saves disabled.");
// pre5 - y, ug // pre5 - y, ug
// pre4 - y, uh // pre4 - y, uh
// pre3 - x, to // pre3 - x, to

View File

@ -1,4 +1,5 @@
package MoF; package MoF;
import amidst.Log;
import amidst.map.MapObjectStronghold; import amidst.map.MapObjectStronghold;
import java.awt.Point; import java.awt.Point;
@ -21,7 +22,7 @@ public class MapGenStronghold {
double d1 = this.c.nextDouble() * 3.141592653589793D * 2.0D; double d1 = this.c.nextDouble() * 3.141592653589793D * 2.0D;
for (j = 0; j < this.coords.length; j++) { for (j = 0; j < this.coords.length; j++) {
double d2 = (1.25D + this.c.nextDouble()) * 32.0D; double d2 = (1.25D + this.c.nextDouble()) * 32.0D;
System.out.println(d2); Log.debug(d2);
int k = (int)Math.round(Math.cos(d1) * d2); int k = (int)Math.round(Math.cos(d1) * d2);
int m = (int)Math.round(Math.sin(d1) * d2); int m = (int)Math.round(Math.sin(d1) * d2);
Biome[] v = a; Biome[] v = a;

View File

@ -1,6 +1,7 @@
package MoF; package MoF;
import amidst.Log;
import amidst.Options; import amidst.Options;
import amidst.map.Map; import amidst.map.Map;
import amidst.map.MapObject; import amidst.map.MapObject;
@ -53,7 +54,7 @@ public class MapViewer extends JComponent implements MouseListener, MouseWheelLi
private Point zoomMouse; private Point zoomMouse;
public void dispose() { public void dispose() {
System.out.println("DISPOSING OF MAPVIEWER"); Log.debug("DISPOSING OF MAPVIEWER");
testMap.dispose(); testMap.dispose();
chart.dispose(); chart.dispose();
menu.removeAll(); menu.removeAll();

View File

@ -1,4 +1,5 @@
package MoF; package MoF;
import amidst.Log;
import amidst.Util; import amidst.Util;
import amidst.map.MapObjectPlayer; import amidst.map.MapObjectPlayer;
import amidst.nbt.Tag; import amidst.nbt.Tag;
@ -121,7 +122,7 @@ public class SaveLoader {
TagCompound pTag = (TagCompound) t.findTagByName("MapObjectPlayer"); TagCompound pTag = (TagCompound) t.findTagByName("MapObjectPlayer");
seed = (Long) t.findTagByName("RandomSeed").getValue(); seed = (Long) t.findTagByName("RandomSeed").getValue();
genType = Type.fromMixedCase((String) t.findTagByName("generatorName").getValue()); genType = Type.fromMixedCase((String) t.findTagByName("generatorName").getValue());
System.out.println("Gen Type: " + genType); Log.debug("Gen Type:", genType);
multi = pTag == null; multi = pTag == null;
if (!multi) { if (!multi) {
addPlayer("MapObjectPlayer", pTag); addPlayer("MapObjectPlayer", pTag);

View File

@ -40,7 +40,7 @@ public class Log {
System.out.print("[" + tag + "] "); System.out.print("[" + tag + "] ");
for (int i=0; i<msgs.length; i++) { for (int i=0; i<msgs.length; i++) {
System.out.print(msgs[i]); System.out.print(msgs[i]);
System.out.print((i < msgs.length) ? ", " : "\n"); System.out.print((i < msgs.length - 1) ? " " : "\n");
} }
} }
} }