Skip to content

Commit

Permalink
Update NeoForge
Browse files Browse the repository at this point in the history
  • Loading branch information
embeddedt committed May 7, 2024
1 parent bebf3cc commit f13910a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false
id "dev.architectury.loom" version "1.6.396" apply false
id "maven-publish"
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
id 'com.palantir.git-version' version '1.0.0'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mixinextras_version=0.3.2
mod_id=modernfix
minecraft_version=1.20.6
enabled_platforms=fabric,neoforge
forge_version=20.6.1-beta
forge_version=20.6.42-beta
# parchment_version=2023.07.09
refined_storage_version=4392788
jei_version=16.0.0.28
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.ModContainer;
import net.neoforged.fml.ModLoader;
import net.neoforged.fml.ModLoadingContext;
import net.neoforged.fml.ModLoadingWarning;
import net.neoforged.fml.ModLoadingIssue;
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
import net.neoforged.neoforge.client.event.ClientTickEvent;
import net.neoforged.neoforge.client.event.CustomizeGuiOverlayEvent;
Expand Down Expand Up @@ -52,7 +51,7 @@ private void keyBindRegister(RegisterKeyMappingsEvent event) {
private void onClientSetup(FMLClientSetupEvent event) {
if(false) {
event.enqueueWork(() -> {
ModLoader.addWarning(new ModLoadingWarning(ModLoadingContext.get().getActiveContainer().getModInfo(), "modernfix.connectedness_dynresoruces"));
ModLoader.addLoadingIssue(ModLoadingIssue.warning("modernfix.connectedness_dynresoruces"));
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ public void commonSetup(FMLCommonSetupEvent event) {
boolean isPresent = !FMLLoader.isProduction() || warning.getLeft().stream().anyMatch(name -> ModList.get().isLoaded(name));
if(!isPresent) {
atLeastOneWarning = true;
ModLoader.addWarning(new ModLoadingWarning(ModLoadingContext.get().getActiveContainer().getModInfo(), warning.getRight()));
ModLoader.addLoadingIssue(ModLoadingIssue.warning(warning.getRight()));
}
}
if(atLeastOneWarning)
ModLoader.addWarning(new ModLoadingWarning(ModLoadingContext.get().getActiveContainer().getModInfo(), "modernfix.perf_mod_warning"));
ModLoader.addLoadingIssue(ModLoadingIssue.warning("modernfix.perf_mod_warning"));
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class ForgeHooksClientMixin {
*/
@Redirect(method = "onModifyBakingResult", at = @At(value = "INVOKE", target = "Lnet/neoforged/fml/ModLoader;postEvent(Lnet/neoforged/bus/api/Event;)V"), remap = false)
private static void postNamespacedKeySetEvent(Event event) {
if(!ModLoader.isLoadingStateValid())
if(ModLoader.hasErrors())
return;
ModelEvent.ModifyBakingResult bakeEvent = ((ModelEvent.ModifyBakingResult)event);
ModelBakeEventHelper helper = new ModelBakeEventHelper(bakeEvent.getModels());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ public MinecraftServer getCurrentServer() {
}

public boolean isEarlyLoadingNormally() {
return LoadingModList.get().getErrors().isEmpty();
return !LoadingModList.get().hasErrors();
}

public boolean isLoadingNormally() {
return isEarlyLoadingNormally() && ModLoader.isLoadingStateValid();
return isEarlyLoadingNormally() && !ModLoader.hasErrors();
}

public Path getGameDirectory() {
Expand Down
2 changes: 1 addition & 1 deletion neoforge/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ modId = "neoforge" #mandatory
# Does this dependency have to exist - if not, ordering below must be specified
type = "required" #mandatory
# The version range of the dependency
versionRange = "[20.5.0-beta,)" #mandatory
versionRange = "[20.6.42-beta,)" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
ordering = "NONE"
# Side this dependency is applied on - BOTH, CLIENT or SERVER
Expand Down

0 comments on commit f13910a

Please sign in to comment.