package land.chipmunk.chipmunkmod.util;

import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientPacketListener;

public class ServerUtilities {
    public static boolean serverHasCommand (final String name) {
        final Minecraft client = Minecraft.getInstance();
        final ClientPacketListener networkHandler = client.getConnection();

        if (networkHandler == null) return false;

        return networkHandler.getCommands().getRoot().getChild(name) != null;
    }
}
