Skip to content

Commit bdfb659

Browse files
committed
fix attachment register issue
1 parent 128e99e commit bdfb659

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

common/src/main/java/com/github/litermc/vschunkloader/VSCListeners.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ private VSCListeners() {}
2525

2626
public static void onModInit() {
2727
VSCRegistry.register();
28+
}
29+
30+
public static void onModSetup() {
2831
registerAttachments();
2932
}
3033

fabric/src/main/java/com/github/litermc/vschunkloader/VSChunkLoaderMod.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,7 @@ public void onInitialize() {
4444
ServerTickEvents.END_SERVER_TICK.register(VSCListeners::postServerTick);
4545
ServerChunkEvents.CHUNK_LOAD.register(VSCListeners::onServerChunkLoad);
4646
ServerChunkEvents.CHUNK_UNLOAD.register(VSCListeners::onServerChunkUnload);
47+
48+
VSCListeners.onModSetup();
4749
}
4850
}

forge/src/main/java/com/github/litermc/vschunkloader/VSChunkLoaderMod.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import net.minecraftforge.fml.common.Mod;
1919
import net.minecraftforge.fml.config.ModConfig;
2020
import net.minecraftforge.fml.event.config.ModConfigEvent;
21+
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
2122
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
2223

2324
@Mod(Constants.MOD_ID)
@@ -31,10 +32,15 @@ public VSChunkLoaderMod() {
3132
BlockCapabilityProviders.register();
3233

3334
context.registerConfig(ModConfig.Type.SERVER, ((ForgeConfigFile)(ConfigSpec.serverSpec)).spec());
35+
modBus.addListener(this::onCommonSetup);
3436
modBus.addListener(this::onConfigLoad);
3537
modBus.addListener(this::onConfigReload);
3638
}
3739

40+
private void onCommonSetup(final FMLCommonSetupEvent event) {
41+
event.enqueueWork(VSCListeners::onModSetup);
42+
}
43+
3844
@SubscribeEvent
3945
public static void onRegisterCommands(final RegisterCommandsEvent event) {
4046
VSCCommands.register(event.getDispatcher());

0 commit comments

Comments
 (0)