Fixed Diemsnion API related NPEs, and updated FML to 231.

This commit is contained in:
LexManos 2012-08-11 03:08:09 -07:00
parent 55636eabab
commit ba55320462
4 changed files with 21 additions and 3 deletions

Binary file not shown.

BIN
fml-src-2.9.138.231.zip Normal file

Binary file not shown.

View file

@ -94,12 +94,30 @@
this.setDifficultyForAllDimensions(this.getDifficulty());
this.initialWorldChunkLoad();
}
@@ -611,13 +586,13 @@
{
this.theProfiler.startSection("levels");
- for (int var1 = 0; var1 < this.theWorldServer.length; ++var1)
+ for (Integer id : DimensionManager.getIDs())
{
long var2 = System.nanoTime();
- if (var1 == 0 || this.getAllowNether())
- {
- WorldServer var4 = this.theWorldServer[var1];
+ if (id == 0 || this.getAllowNether())
+ {
+ WorldServer var4 = DimensionManager.getWorld(id);
this.theProfiler.startSection(var4.getWorldInfo().getWorldName());
if (this.tickCounter % 20 == 0)
@@ -653,7 +628,7 @@
}
}
- this.timeOfLastDimenstionTick[var1][this.tickCounter % 100] = System.nanoTime() - var2;
+ worldTickTimes.get(var1)[this.tickCounter % 100] = System.nanoTime() - var2;
+ worldTickTimes.get(id)[this.tickCounter % 100] = System.nanoTime() - var2;
}
this.theProfiler.endStartSection("connection");

View file

@ -16,13 +16,13 @@
long var1 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
System.gc();
this.displayStrings[0] = "Memory use: " + var1 / 1024L / 1024L + " mb (" + Runtime.getRuntime().freeMemory() * 100L / Runtime.getRuntime().maxMemory() + "% free)";
@@ -51,14 +53,18 @@
@@ -51,14 +53,17 @@
if (this.field_79017_e.theWorldServer != null)
{
- for (int var3 = 0; var3 < this.field_79017_e.theWorldServer.length; ++var3)
+ int x = 0;
+ for (Integer id : DimensionManager.getIDs())
for (int var3 = 0; var3 < this.field_79017_e.theWorldServer.length; ++var3)
{
- this.displayStrings[5 + var3] = "Lvl " + var3 + " tick: " + field_79020_a.format(this.func_79015_a(this.field_79017_e.timeOfLastDimenstionTick[var3]) * 1.0E-6D) + " ms";
+ this.displayStrings[5 + x] = "Lvl " + id + " tick: " + field_79020_a.format(this.func_79015_a(this.field_79017_e.worldTickTimes.get(id)) * 1.0E-6D) + " ms";