mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 03:49:14 +00:00
Redesign CreativeTab collection event to be a lot more straight forward. (#9198)
This commit is contained in:
1 parent
4cf5508e04
commit
ec3abdea14
41 files changed
+696
-512
No files matched your search
@@ -70,17 +70,16 @@ public class GameTestTest
|
||||
BLOCKS.register(modBus);
|
||||
ITEMS.register(modBus);
|
||||
BLOCK_ENTITIES.register(modBus);
|
||||
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener((Consumer<CreativeModeTabEvent.BuildContents>) onBuildContents -> {
|
||||
if (onBuildContents.getTab() == CreativeModeTabs.INGREDIENTS) {
|
||||
onBuildContents.register((flags, output, permissions) -> {
|
||||
output.accept(ENERGY_BLOCK_ITEM.get());
|
||||
});
|
||||
}
|
||||
});
|
||||
modBus.addListener(this::addCreative);
|
||||
}
|
||||
}
|
||||
|
||||
private void addCreative(CreativeModeTabEvent.BuildContents event)
|
||||
{
|
||||
if (event.getTab() == CreativeModeTabs.INGREDIENTS)
|
||||
event.accept(ENERGY_BLOCK_ITEM);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRegisterGameTests(RegisterGameTestsEvent event)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user