Skip to content

Commit

Permalink
refactor: use new bus parameter, fix gradle more, rundata
Browse files Browse the repository at this point in the history
  • Loading branch information
bconlon1 committed Jan 20, 2024
1 parent 9fa33c7 commit 36f725d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ runs {
}

data {
programArguments.addAll '--mod', mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/'), '--existing', file('src/generated/resources/').getAbsolutePath()
programArguments.addAll '--mod', mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath(), '--existing', file('src/generated/resources/').getAbsolutePath()
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.20.1 2023-08-22T18:52:58.2097967 Pack Metadata
dd3c60fd02429ac402f8102d597a833e5a37450f pack.mcmeta
// 1.20.2 2024-01-20T01:02:56.2526951 Pack Metadata
61c7f3da7fb8c1a0151b861036884160c7bccf5a pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.20.1 2023-08-22T18:52:58.1947962 Languages: en_us
// 1.20.2 2024-01-20T01:00:14.5929562 Languages: en_us
0cb2af7dbbd8bd2ff78b335c92a753a3048b1730 assets/cumulus_menus/lang/en_us.json
7 changes: 6 additions & 1 deletion src/generated/resources/pack.mcmeta
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
"description": {
"translate": "pack.cumulus_menus.mod.description"
},
"pack_format": 15
"neoforge": {
"versions": {
"server_data": 18
}
},
"pack_format": 18
}
}
13 changes: 5 additions & 8 deletions src/main/java/com/aetherteam/cumulus/Cumulus.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import net.neoforged.fml.ModLoadingContext;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.config.ModConfig;
import net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext;
import net.neoforged.fml.loading.FMLEnvironment;
import net.neoforged.neoforge.data.event.GatherDataEvent;
import net.neoforged.neoforge.registries.DeferredRegister;
import net.neoforged.neoforge.registries.NewRegistryEvent;
Expand All @@ -37,19 +35,18 @@ public class Cumulus {
public static final ResourceKey<Registry<Menu>> MENU_REGISTRY_KEY = ResourceKey.createRegistryKey(new ResourceLocation(Cumulus.MODID, "menu"));
public static final Registry<Menu> MENU_REGISTRY = new RegistryBuilder<>(MENU_REGISTRY_KEY).sync(true).create();

public Cumulus() {
if (FMLEnvironment.dist == Dist.CLIENT) {
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
modEventBus.addListener(NewRegistryEvent.class, event -> event.register(MENU_REGISTRY));
public Cumulus(IEventBus bus, Dist dist) {
if (dist == Dist.CLIENT) {
bus.addListener(NewRegistryEvent.class, event -> event.register(MENU_REGISTRY));

modEventBus.addListener(this::dataSetup);
bus.addListener(this::dataSetup);

DeferredRegister<?>[] registers = {
Menus.MENUS,
};

for (DeferredRegister<?> register : registers) {
register.register(modEventBus);
register.register(bus);
}

ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, CumulusConfig.CLIENT_SPEC);
Expand Down

0 comments on commit 36f725d

Please sign in to comment.