Skip to content

Commit

Permalink
Compact a couple lines of code
Browse files Browse the repository at this point in the history
  • Loading branch information
Blobanium committed Sep 18, 2024
1 parent f7c1298 commit 0892d5c
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import io.github.blobanium.mcbrowser.util.TabManager;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.SemanticVersion;
import net.fabricmc.loader.api.Version;
import net.fabricmc.loader.api.VersionParsingException;
import net.fabricmc.loader.api.metadata.version.VersionComparisonOperator;
import net.minecraft.client.MinecraftClient;
Expand Down Expand Up @@ -42,14 +41,7 @@ private void onClose(CallbackInfo ci) {
@Inject(at = @At("TAIL"), method = "close")
private void onAfterClose(CallbackInfo ci) {
try {
String mcef = FabricLoader.getInstance().getModContainer("mcef").get().getMetadata().getVersion().toString();
SemanticVersion.parse(mcef);

VersionComparisonOperator operator = VersionComparisonOperator.LESS_EQUAL;
String versionToCompare = "2.1.5";
Version comparisonVersion = SemanticVersion.parse(versionToCompare);

if (operator.test(SemanticVersion.parse(mcef), comparisonVersion) && System.getProperty("os.name").toLowerCase().contains("win")) {
if (VersionComparisonOperator.LESS_EQUAL.test(SemanticVersion.parse(FabricLoader.getInstance().getModContainer("mcef").get().getMetadata().getVersion().toString()), SemanticVersion.parse("2.1.5")) && System.getProperty("os.name").toLowerCase().contains("win")) {
String processName = "jcef_helper.exe";
ProcessBuilder processBuilder = new ProcessBuilder("tasklist");
Process process = processBuilder.start();
Expand Down

0 comments on commit 0892d5c

Please sign in to comment.