fix really bad bug and add memory counter

pull/12/head
SuperCoder7979 2020-03-01 07:47:37 -05:00
parent e285e752b0
commit b82f24b4ad
3 changed files with 8 additions and 3 deletions

View File

@ -31,10 +31,14 @@ public class IngameHUD extends Screen
@Override
public void tick()
{
// long maxMemory = Runtime.getRuntime().maxMemory();
long totalMemory = Runtime.getRuntime().totalMemory();
long freeMemory = Runtime.getRuntime().freeMemory();
long usedMemory = totalMemory - freeMemory;
Vector4i dbg = litecraft.dbgStats;
Vector3f position = GingerRegister.getInstance().game.data.player.getPosition();
debugText.setText("FPS: " + dbg.x() + " UPS: " + dbg.y + " TPS: " + dbg.z);
positionText.setText("Position " + (int) position.x() + ", " + (int) position.y() + ", "+ (int) position.z());
debugText.setText("FPS: " + dbg.x() + " UPS: " + dbg.y + " TPS: " + dbg.z + " Mem: " + (usedMemory / 1024 / 1024) + "MB / " + (totalMemory / 1024 / 1024) + " MB");
positionText.setText("Position " + (int) position.x() + ", " + (int) position.y() + ", "+ (int) position.z() );
}
@Override

View File

@ -197,7 +197,7 @@ public class World implements BlockAccess, WorldGenConstants
this.save.saveChunk(chunk); // save chunk
});
chunkPositions.forEach((LongConsumer) (pos -> this.chunks.remove(pos))); // remove all chunks
});
}).join();
}
public long getSeed()

View File

@ -1,6 +1,7 @@
package com.github.halotroop.litecraft.world.dimension;
import com.github.halotroop.litecraft.world.gen.*;
import com.github.halotroop.litecraft.world.gen.modifier.CavesModifier;
public final class Dimensions
{