From f0fc6085df26f41084a0d9404f4e6826a63688ed Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 27 Jan 2019 19:18:21 +0100 Subject: [PATCH] add some particle profiling --- .../de/ellpeck/naturesaura/events/ClientEvents.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java b/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java index 90df51fe..770f70d7 100644 --- a/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java +++ b/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java @@ -82,7 +82,10 @@ public class ClientEvents { @SubscribeEvent public void onRenderLast(RenderWorldLastEvent event) { + Minecraft mc = Minecraft.getMinecraft(); + mc.profiler.func_194340_a(() -> NaturesAura.MOD_ID + ":renderParticles"); ParticleHandler.renderParticles(event.getPartialTicks()); + mc.profiler.endSection(); } @SubscribeEvent @@ -94,12 +97,12 @@ public class ClientEvents { public void onClientTick(ClientTickEvent event) { if (event.phase == Phase.END) { Minecraft mc = Minecraft.getMinecraft(); - if (!mc.isGamePaused()) { + mc.profiler.func_194340_a(() -> NaturesAura.MOD_ID + ":updateParticles"); + if (!mc.isGamePaused()) ParticleHandler.updateParticles(); - } - if (mc.world == null) { + if (mc.world == null) ParticleHandler.clearParticles(); - } + mc.profiler.endSection(); } }