package org.cyclops.integrateddynamics.command;

import com.mojang.brigadier.Command;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.command.CommandSource;
import net.minecraft.command.Commands;
import org.cyclops.integrateddynamics.IntegratedDynamics;
import org.cyclops.integrateddynamics.network.packet.NetworkDiagnosticsOpenClient;

/**
 * Command for opening the network diagnostics gui.
 * @author rubensworks
 *
 */
public class CommandNetworkDiagnostics implements Command<CommandSource> {

    @Override
    public int run(CommandContext<CommandSource> context) throws CommandSyntaxException {
        IntegratedDynamics._instance.getPacketHandler().sendToPlayer(new NetworkDiagnosticsOpenClient(), context.getSource().asPlayer());
        return 0;
    }

    public static LiteralArgumentBuilder<CommandSource> make() {
        return Commands.literal("networkdiagnostics")
                .requires((commandSource) -> commandSource.hasPermissionLevel(2))
                .executes(new CommandNetworkDiagnostics());
    }
}

@@ -348,137 +348,231 @@
 ort 
-org.cyclops.integrateddynamics.IntegratedDynamics;%0Aimport org.cyclops.integrateddynamics.network.packet.NetworkDiagnosticsOpenCli
+net.minecraft.util.text.ITextComponent;%0Aimport net.minecraft.util.text.StringTextComponent;%0Aimport net.minecraft.util.text.Style;%0Aimport net.minecraft.util.text.event.ClickEvent;%0Aimport net.minecraft.util.text.event.HoverEv
 ent;
@@ -839,24 +839,24 @@
 ption %7B%0A
-
         
 Integrat
@@ -847,16 +847,624 @@
         
+Style downloadStyle = new Style();%0A        downloadStyle.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new StringTextComponent(%22Click to visit the relevant GitHub issue%22)));%0A        downloadStyle.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, %22https://github.com/CyclopsMC/IntegratedDynamics/issues/863%22));%0A        ITextComponent message = new StringTextComponent(%22Network diagnostics are not working (yet) in 1.15. Click here to help (re)making it!%22).setStyle(downloadStyle);%0A        context.getSource().asPlayer().sendMessage(message);%0A        // TODO: rewrite gui in LWJGL%0A        //
 Integrat

Disable network diagnostics