Skip to content

Commit

Permalink
chore: change the instance to a field
Browse files Browse the repository at this point in the history
  • Loading branch information
RawDiamondMC committed Oct 27, 2024
1 parent 7b2d9b9 commit b9bc944
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public boolean isSoft() {
*/
@Nullable
public String getKey() {
return LoaderService.getInstance().isFabric() ? fabricKey : neoKey;
return Loader.isFabric() ? fabricKey : neoKey;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,46 +25,46 @@ private Loader() {
}

public static Metadata getModMetadata(String modid) {
return LoaderService.getInstance().getModMetadata(modid);
return LoaderService.INSTANCE.getModMetadata(modid);
}

public static boolean isFabric() {
return LoaderService.getInstance().isFabric();
return LoaderService.INSTANCE.isFabric();
}

public static boolean isNeoForge() {
return LoaderService.getInstance().isNeoForge();
return LoaderService.INSTANCE.isNeoForge();
}

public static Env getEnv() {
return LoaderService.getInstance().getEnv();
return LoaderService.INSTANCE.getEnv();
}

public static Path getGameFolder() {
return LoaderService.getInstance().getGameFolder();
return LoaderService.INSTANCE.getGameFolder();
}

public static Path getConfigFolder() {
return LoaderService.getInstance().getConfigFolder();
return LoaderService.INSTANCE.getConfigFolder();
}

public static Path getModsFolder() {
return LoaderService.getInstance().getModsFolder();
return LoaderService.INSTANCE.getModsFolder();
}

public static boolean isModLoaded(String id) {
return LoaderService.getInstance().isModLoaded(id);
return LoaderService.INSTANCE.isModLoaded(id);
}

public static Collection<String> getModIds() {
return LoaderService.getInstance().getModIds();
return LoaderService.INSTANCE.getModIds();
}

public static Collection<? extends Metadata> getMods() {
return LoaderService.getInstance().getMods();
return LoaderService.INSTANCE.getMods();
}

public static boolean isDevEnv() {
return LoaderService.getInstance().isDevEnv();
return LoaderService.INSTANCE.isDevEnv();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
import band.kessoku.lib.api.platform.Metadata;

public interface LoaderService {
static LoaderService getInstance() {
return KessokuLib.loadService(LoaderService.class);
}
LoaderService INSTANCE = KessokuLib.loadService(LoaderService.class);

Metadata getModMetadata(String modid);

Expand Down

0 comments on commit b9bc944

Please sign in to comment.