Skip to content

Commit 5806565

Browse files
author
Smartin
committed
- fix startup crash with Immersive Engineering
1 parent 8e22bf9 commit 5806565

File tree

3 files changed

+13
-42
lines changed

3 files changed

+13
-42
lines changed

CHANGELOG.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,2 @@
1-
## v1.1.3 (1.20.1)
2-
- added Banner cosmetic support
3-
- expanded Lore Text to allow for Formatting
4-
- normalised module expansion and skin and synergy format to support "replace","remove" and "merge"
5-
- added Slot-types and Cosmetic sub-slot option for purely cosmetic modules
6-
- added Projectile Armor attribute
7-
- added Exhaustion attribute for passive food drain
8-
- added fabric swimspeed attribute to match forges
9-
- changing settings related to fallback-renderer now apply instantly without world reloading(on fabric)
10-
- fixed issues were enchantments could not be applied to items
11-
- fixed compatibility issues with Entity Texture Features
12-
- fixed Bug were Buster skin would not load
13-
- fixed some Typos and wordings within Translations
14-
- fixed arrow-part items not stacking correctly
15-
- fixed internal issues where slot rotation was not normalised correctly
1+
## v1.1.4 (1.20.1)
2+
- fixed server startup crash with Immersive Engineering

forge/src/main/java/smartin/miapi/forge/TrulyModularForge.java

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import dev.architectury.event.events.common.LifecycleEvent;
55
import dev.architectury.platform.forge.EventBuses;
66
import net.minecraft.resource.ResourcePackManager;
7-
import net.minecraft.server.ServerTask;
87
import net.minecraft.world.SaveProperties;
98
import net.minecraftforge.api.distmarker.Dist;
109
import net.minecraftforge.client.event.EntityRenderersEvent;
@@ -16,11 +15,13 @@
1615
import smartin.miapi.Miapi;
1716
import smartin.miapi.attributes.AttributeRegistry;
1817
import smartin.miapi.config.MiapiConfig;
19-
import smartin.miapi.events.MiapiEvents;
18+
import smartin.miapi.datapack.ReloadEvents;
2019
import smartin.miapi.modules.properties.AttributeProperty;
2120

2221
import java.util.Collection;
22+
import java.util.HashMap;
2323
import java.util.Iterator;
24+
import java.util.Map;
2425

2526
import static smartin.miapi.Miapi.MOD_ID;
2627
import static smartin.miapi.attributes.AttributeRegistry.SWIM_SPEED;
@@ -41,33 +42,16 @@ public TrulyModularForge() {
4142
}));
4243
LifecycleEvent.SERVER_STARTED.register((minecraftServer -> {
4344
if(!Environment.isClient() && MiapiConfig.OtherConfigGroup.forgeAutoReloads.getValue()){
45+
Map<String,String> cacheDatapack = new HashMap<>(ReloadEvents.DATA_PACKS);
4446
Miapi.LOGGER.info("Truly Modular will now go onto reload twice.");
4547
Miapi.LOGGER.info("This is done because Forges classloading is buggy and stupid. Until we have a better fix, this is used");
4648
Miapi.LOGGER.info("This can be turned off in Miapis config.json");
47-
MiapiEvents.GENERATED_MATERIAL.hasBeenSorted();
48-
minecraftServer.executeTask(new ServerTask(10, () -> {
49-
ResourcePackManager resourcePackManager = minecraftServer.getDataPackManager();
50-
SaveProperties saveProperties = minecraftServer.getSaveProperties();
51-
Collection<String> collection = resourcePackManager.getEnabledNames();
52-
Collection<String> collection2 = findNewDataPacks(resourcePackManager, saveProperties, collection);
53-
minecraftServer.reloadResources(collection2).exceptionally((throwable) -> {
54-
Miapi.LOGGER.warn("Failed to execute sceduled reload reload", throwable);
55-
return null;
56-
});
57-
minecraftServer.executeTask(new ServerTask(10, () -> {
58-
ResourcePackManager resourcePackManager1 = minecraftServer.getDataPackManager();
59-
SaveProperties saveProperties1 = minecraftServer.getSaveProperties();
60-
Collection<String> collection1 = resourcePackManager1.getEnabledNames();
61-
Collection<String> collection21 = findNewDataPacks(resourcePackManager1, saveProperties1, collection1);
62-
minecraftServer.reloadResources(collection21).exceptionally((throwable) -> {
63-
Miapi.LOGGER.warn("Failed to execute sceduled reload reload", throwable);
64-
return null;
65-
});
66-
Miapi.LOGGER.info("Truly Modulars double Reload was successfull.");
67-
Miapi.LOGGER.info("This is done because Forges classloading is buggy and stupid. Until we have a better fix, this is used");
68-
Miapi.LOGGER.info("This can be turned off in Miapis config.json");
69-
}));
70-
}));
49+
ReloadEvents.inReload = true;
50+
ReloadEvents.START.fireEvent(false);
51+
ReloadEvents.DataPackLoader.trigger(cacheDatapack);
52+
ReloadEvents.MAIN.fireEvent(false);
53+
ReloadEvents.END.fireEvent(false);
54+
ReloadEvents.inReload = false;
7155
}
7256
}));
7357
AttributeProperty.replaceMap.put("miapi:generic.reach", ForgeMod.BLOCK_REACH);

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx3G
33
minecraft_version=1.20.1
44

55
archives_base_name=Truly-Modular-miapi
6-
mod_version=1.1.3
6+
mod_version=1.1.4
77
maven_group=smartin
88
github=Truly-Modular.Modular-Item-API
99

0 commit comments

Comments
 (0)