EntityProfiler has been replaced by a ProfilerEntityUpdate based on ProfilerSection

All next gen profilers are now inheriting an abstract class to provide null implementations of unused methods.
This commit is contained in:
ProfMobius committed 2014-04-03 16:37:10 +02:00
1 parent e50fcd7b85
commit 1b0cbeae51
7 files changed
+73 -98

No files matched your search

@@ -0,0 +1,39 @@
package mcp.mobius.opis.data.profilers;
import java.util.HashMap;
import net.minecraft.entity.Entity;
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
import mcp.mobius.mobiuscore.profiler_v2.IProfilerBase;
public class ProfilerEntityUpdate extends ProfilerAbstract implements IProfilerBase {
private Clock clock = new Clock();
public HashMap<Integer, DescriptiveStatistics> data = new HashMap<Integer, DescriptiveStatistics>();
@Override
public void reset() {
this.data.clear();
}
@Override
public void start(Object key) {
Entity entity = (Entity)key;
if (entity.worldObj.isRemote) return;
if (!data.containsKey(entity.entityId))
data.put(entity.entityId, new DescriptiveStatistics());
clock.start();
}
@Override
public void stop(Object key) {
Entity entity = (Entity)key;
if (entity.worldObj.isRemote) return;
clock.stop();
data.get(entity.entityId).addValue((double)clock.timeDelta);
}
}