Search in sources :

Example 1 with EntityInstance

use of com.kahzerx.kahzerxmod.profiler.instances.EntityInstance in project KahzerxMod by otakucraft.

the class EntityProfiler method addEntity.

public static void addEntity(Entity e, ServerWorld world) {
    Identifier id = EntityType.getId(e.getType());
    if (id == null) {
        return;
    }
    BlockPos pos = e.getBlockPos();
    entityList.add(new EntityInstance(id.getPath(), world.getRegistryKey().getValue().getPath(), pos.getX(), pos.getY(), pos.getZ()));
}
Also used : Identifier(net.minecraft.util.Identifier) EntityInstance(com.kahzerx.kahzerxmod.profiler.instances.EntityInstance) BlockPos(net.minecraft.util.math.BlockPos)

Example 2 with EntityInstance

use of com.kahzerx.kahzerxmod.profiler.instances.EntityInstance in project KahzerxMod by otakucraft.

the class EntityProfiler method onTick.

@Override
public void onTick(MinecraftServer server, String id) {
    entityList.add(new EntityInstance("", "", 0.0D, 0.0D, 0.0D));
    this.addResult(server.getTicks(), new ProfilerResult("entities", id, new ArrayList<>(entityList)));
    entityList.clear();
}
Also used : ArrayList(java.util.ArrayList) EntityInstance(com.kahzerx.kahzerxmod.profiler.instances.EntityInstance) ProfilerResult(com.kahzerx.kahzerxmod.profiler.instances.ProfilerResult)

Aggregations

EntityInstance (com.kahzerx.kahzerxmod.profiler.instances.EntityInstance)2 ProfilerResult (com.kahzerx.kahzerxmod.profiler.instances.ProfilerResult)1 ArrayList (java.util.ArrayList)1 Identifier (net.minecraft.util.Identifier)1 BlockPos (net.minecraft.util.math.BlockPos)1