Search in sources :

Example 1 with TraceParticleManager

use of org.blockartistry.DynSurround.client.handlers.trace.TraceParticleManager in project DynamicSurroundings by OreCruncher.

the class DiagnosticHandler method process.

@Override
public void process(@Nonnull final EntityPlayer player) {
    // Gather diagnostics if needed
    if (Minecraft.getMinecraft().gameSettings.showDebugInfo) {
        this.diagnostics = new ArrayList<>();
        if (DSurround.isDeveloperMode())
            this.diagnostics.add(TextFormatting.RED + "DEVELOPER MODE ENABLED");
        if (ModOptions.logging.enableDebugLogging) {
            final DiagnosticEvent.Gather gather = new DiagnosticEvent.Gather(player.getEntityWorld(), player);
            MinecraftForge.EVENT_BUS.post(gather);
            this.diagnostics.addAll(gather.output);
        }
    } else {
        this.diagnostics = null;
    }
    if (ModOptions.logging.showDebugDialog)
        DiagnosticPanel.refresh();
    if (DSurround.isDeveloperMode()) {
        final ParticleManager pm = Minecraft.getMinecraft().effectRenderer;
        if (!(pm instanceof TraceParticleManager)) {
            DSurround.log().info("Wrapping particle manager [%s]", pm.getClass().getName());
            Minecraft.getMinecraft().effectRenderer = new TraceParticleManager(pm);
        }
    }
}
Also used : DiagnosticEvent(org.blockartistry.DynSurround.event.DiagnosticEvent) TraceParticleManager(org.blockartistry.DynSurround.client.handlers.trace.TraceParticleManager) TraceParticleManager(org.blockartistry.DynSurround.client.handlers.trace.TraceParticleManager) ParticleManager(net.minecraft.client.particle.ParticleManager)

Aggregations

ParticleManager (net.minecraft.client.particle.ParticleManager)1 TraceParticleManager (org.blockartistry.DynSurround.client.handlers.trace.TraceParticleManager)1 DiagnosticEvent (org.blockartistry.DynSurround.event.DiagnosticEvent)1