Skip to content

Commit

Permalink
fixing a problem caused by the essentiall mod on Windows(see screensh…
Browse files Browse the repository at this point in the history
…ot in commit comment)
  • Loading branch information
PumpkinXD committed Nov 18, 2022
1 parent ccfed5e commit 2e67b36
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ compileJava {
sourceCompatibility = targetCompatibility = 8
}

version= "0.1.1145141919810"
version= "0.2.0"
group= "io.github.pumpkinxd.linuxlegacymcurlfix"

minecraft {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.client.gui.GuiScreenResourcePacks;
import net.minecraft.client.resources.ResourcePackRepository;
import net.minecraft.util.Util;
import net.minecraftforge.fml.common.Loader;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.Sys;
Expand Down Expand Up @@ -66,8 +67,14 @@ public void fixOpenResFolder(CallbackInfo ci){

} else {
if (SystemUtils.IS_OS_WINDOWS) {
String s1 = String.format("cmd.exe /C start \"Open file\" \"%s\"", new Object[] {repopath});

String s1;
if(Loader.isModLoaded("essential")&&repopath.charAt(0)=='\\')
{
s1 = String.format("cmd.exe /C start \"Open file\" \"%s\"", new Object[] {repopath.substring(1)});
}
else {
s1 = String.format("cmd.exe /C start \"Open file\" \"%s\"", new Object[]{repopath});
}
try
{
Runtime.getRuntime().exec(s1);
Expand Down

1 comment on commit 2e67b36

@PumpkinXD
Copy link
Owner Author

@PumpkinXD PumpkinXD commented on 2e67b36 Nov 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

and this commit did not fix this bug(gonna fix it in the next commit)

Please sign in to comment.