Search in sources :

Example 1 with BlockEntityInstance

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

the class BlockEntitiesProfiler method onTick.

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

Example 2 with BlockEntityInstance

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

the class BlockEntitiesProfiler method addBlockEntity.

public static void addBlockEntity(BlockEntity be, World world) {
    Identifier id = BlockEntityType.getId(be.getType());
    if (id == null) {
        return;
    }
    BlockPos pos = be.getPos();
    blockEntityList.add(new BlockEntityInstance(id.getPath(), world.getRegistryKey().getValue().getPath(), pos.getX(), pos.getY(), pos.getZ()));
}
Also used : Identifier(net.minecraft.util.Identifier) BlockPos(net.minecraft.util.math.BlockPos) BlockEntityInstance(com.kahzerx.kahzerxmod.profiler.instances.BlockEntityInstance)

Aggregations

BlockEntityInstance (com.kahzerx.kahzerxmod.profiler.instances.BlockEntityInstance)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