Skip to content

Commit

Permalink
Origins: Fix #400.
Browse files Browse the repository at this point in the history
  • Loading branch information
MerchantPug committed Dec 18, 2023
1 parent 069fb32 commit afdfc32
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import io.github.apace100.origins.badge.BadgeFactories;
import io.github.apace100.origins.badge.BadgeManager;
import io.github.apace100.origins.power.OriginsPowerTypes;
import io.github.apace100.origins.registry.ModItems;
import io.github.edwinmindcraft.apoli.api.registry.ApoliDynamicRegistries;
import io.github.edwinmindcraft.calio.api.event.CalioDynamicRegistryEvent;
import io.github.edwinmindcraft.calio.api.registry.ICalioDynamicRegistryManager;
Expand All @@ -19,7 +20,9 @@
import io.github.edwinmindcraft.origins.common.registry.OriginArgumentTypes;
import io.github.edwinmindcraft.origins.common.registry.OriginRegisters;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraftforge.common.capabilities.RegisterCapabilitiesEvent;
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
Expand Down Expand Up @@ -86,6 +89,7 @@ public static void initialize() {
mod.addListener(OriginsCommon::initializeDynamicRegistries);
mod.addListener(OriginsCommon::registerCapabilities);
mod.addListener(OriginsCommon::commonSetup);
mod.addListener(OriginsCommon::modifyCreativeTabs);
}

public static void registerCapabilities(RegisterCapabilitiesEvent event) {
Expand All @@ -107,4 +111,10 @@ public static void initializeDynamicRegistries(CalioDynamicRegistryEvent.Initial
registryManager.addReload(OriginsDynamicRegistries.LAYERS_REGISTRY, "origin_layers", LayerLoader.INSTANCE);
registryManager.addValidation(OriginsDynamicRegistries.LAYERS_REGISTRY, LayerLoader.INSTANCE, OriginLayer.class, OriginsDynamicRegistries.ORIGINS_REGISTRY);
}

public static void modifyCreativeTabs(BuildCreativeModeTabContentsEvent event) {
if (event.getTabKey() == CreativeModeTabs.TOOLS_AND_UTILITIES) {
event.accept(ModItems.ORB_OF_ORIGIN);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,4 @@ public static void onOriginLoad(DynamicRegistrationEvent<Origin> event) {
}
}

@SubscribeEvent
public static void modifyCreativeTabs(BuildCreativeModeTabContentsEvent event) {
if (event.getTabKey() == CreativeModeTabs.TOOLS_AND_UTILITIES) {
event.accept(ModItems.ORB_OF_ORIGIN);
}
}
}

0 comments on commit afdfc32

Please sign in to comment.