Skip to content

Commit

Permalink
switch back to class
Browse files Browse the repository at this point in the history
  • Loading branch information
UpcraftLP committed Nov 27, 2024
1 parent 9d620e1 commit ed5f6d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 6 additions & 2 deletions src/api/java/dev/upcraft/libraryinjector/api/Relauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
import java.util.function.BooleanSupplier;

@ApiStatus.Experimental
public interface Relauncher {
public final class Relauncher {

static void relaunch(boolean load, BooleanSupplier abortGetter, Path... jars) {
private Relauncher() {
throw new UnsupportedOperationException();
}

public static void relaunch(boolean load, BooleanSupplier abortGetter, Path... jars) {
MinecraftFabricRelauncher.relaunch(load, abortGetter, jars);
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
package dev.upcraft.libraryinjector.api.util;

import java.util.ServiceLoader;

public final class Environment {

private Environment() {
throw new UnsupportedOperationException();
}

public static final boolean FORCE_RELAUNCH_ON_POSIX_SYSTEMS = Boolean.getBoolean("injector.relauncher.force_relaunch_on_posix_systems");

public static <T> T loadService(Class<T> service) {
return ServiceLoader.load(service).findFirst().orElseThrow(() -> new IllegalStateException("No service implementation provided for " + service.getName()));
}
}

0 comments on commit ed5f6d1

Please sign in to comment.