Skip to content

Commit

Permalink
2.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
MORIMORI0317 committed Jul 25, 2023
1 parent ffd9ebc commit 371dbb9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
public class GameMenuRemoveGFARBForge {
private static final String FORGE_MOD_ID = "forge";
private static final String MINECRAFT_MOD_ID = "minecraft";
private static final String NEO_FORGE_DISPLAY_NAME = "NeoForge";
private static final DefaultArtifactVersion EXIST_MOD_BUTTON_FORGE_VERSION_1194 = new DefaultArtifactVersion("45.1.15");
private static final DefaultArtifactVersion EXIST_MOD_BUTTON_FORGE_VERSION_1201 = new DefaultArtifactVersion("47.1.25");
private static final DefaultArtifactVersion MC_1194_VERSION = new DefaultArtifactVersion("1.19.4");
Expand All @@ -31,16 +30,13 @@ public class GameMenuRemoveGFARBForge {
return new DefaultArtifactVersion(forgeMod.versionString());
});
private static final Supplier<DefaultArtifactVersion> CURRENT_MC_VERSION = Suppliers.memoize(() -> new DefaultArtifactVersion(ModList.get().getModFileById(MINECRAFT_MOD_ID).versionString()));
private static final Supplier<Boolean> NEO_FORGE = Suppliers.memoize(GameMenuRemoveGFARBForge::isNeoForge);

public GameMenuRemoveGFARBForge() {
ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, () -> new IExtensionPoint.DisplayTest(() -> NetworkConstants.IGNORESERVERONLY, (remote, isServer) -> true));
}

public static boolean existModButton() {
if (NEO_FORGE.get()) {
return false;
}


DefaultArtifactVersion currentForgeVersion = CURRENT_FORGE_VERSION.get();

Expand All @@ -61,11 +57,4 @@ public static boolean existModButton() {

return currentForgeVersion.compareTo(existVersion) >= 0;
}

private static boolean isNeoForge() {
return ModList.get().getMods().stream()
.filter(it -> FORGE_MOD_ID.equals(it.getModId()))
.limit(1)
.anyMatch(it -> NEO_FORGE_DISPLAY_NAME.equals(it.getDisplayName()));
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ enabled_platforms=fabric,forge
#Mod
mod_display_name=GameMenuRemoveGFARB
archives_base_name=gamemenuremovegfarb
mod_version=2.1.2+pre.1
mod_version=2.1.2
#Dependencies
fabric_loader_version=0.14.17
fabric_api_version=0.76.0+1.19.4
Expand Down

0 comments on commit 371dbb9

Please sign in to comment.