Add power net to profiling data.
This commit is contained in:
parent
2ec7340383
commit
b8949ee8fa
3 changed files with 11 additions and 2 deletions
|
@ -40,7 +40,7 @@ public class TRTickHandler {
|
|||
}
|
||||
|
||||
long start = System.nanoTime();
|
||||
MinecraftForge.EVENT_BUS.post(new PowerTickEvent());
|
||||
MinecraftForge.EVENT_BUS.post(new PowerTickEvent(e.world));
|
||||
long elapsed = System.nanoTime() - start;
|
||||
tickTime += elapsed;
|
||||
ticksCounted++;
|
||||
|
|
|
@ -1,8 +1,15 @@
|
|||
package techreborn.power;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
public class PowerTickEvent extends Event {
|
||||
public PowerTickEvent() {
|
||||
World world;
|
||||
public PowerTickEvent(World world) {
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
public World getWorld() {
|
||||
return world;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,6 +58,7 @@ public class TRPowerNet {
|
|||
|
||||
@SubscribeEvent
|
||||
public void tick(PowerTickEvent evt) {
|
||||
evt.getWorld().theProfiler.startSection("TechRebornPowerNet");
|
||||
if (tick < 20) {
|
||||
tick++;
|
||||
return;
|
||||
|
@ -101,6 +102,7 @@ public class TRPowerNet {
|
|||
MinecraftForge.EVENT_BUS.unregister(this);
|
||||
}
|
||||
tick++;
|
||||
evt.getWorld().theProfiler.endSection();
|
||||
}
|
||||
|
||||
public void addElement(CableMultipart te) {
|
||||
|
|
Loading…
Add table
Reference in a new issue