mc-utils icon indicating copy to clipboard operation
mc-utils copied to clipboard

[Util Change]: Having auto-restart enabled makes user copy <br> tags

Open stephendotgg opened this issue 1 year ago • 1 comments

Util Name

start-file-generator

Changes

Having auto-restart enabled makes user copy <br> tags.

Extra Info

No response

stephendotgg avatar May 10 '24 16:05 stephendotgg

Can be fixed by doing the same thing as is being done to the download file:

function copyValue() {
        const content = tabData[activeTab].content.replace(/<br>/g, '\n')
        navigator.clipboard.writeText(content)
        toast.push('Copied successfully!', {
            theme: {
                '--toastColor': 'mintcream',
                '--toastBackground': 'rgba(72,187,120,0.9)',
                '--toastBarBackground': '#2F855A'
            }
        })
}

This simply replaces the
tags with \n.

This results in an output like this:

:start
java -Xmx8G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Daikars.new.flags=true -Dusing.aikars.flags=https://mcutils.com -jar server.jar --nogui

echo Server restarting...
goto :start

Instead of

:start<br>java -Xmx8G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Daikars.new.flags=true -Dusing.aikars.flags=https://mcutils.com -jar server.jar --nogui<br><br>echo Server restarting...<br>goto :start

ShadowThijs avatar May 10 '24 17:05 ShadowThijs

This was fixed with my commit, can be closed @stephendotgg

ShadowThijs avatar May 22 '24 17:05 ShadowThijs

Nice one, thanks!

This was fixed with my commit, can be closed @stephendotgg

stephendotgg avatar May 22 '24 17:05 stephendotgg