Redesign CreativeTab collection event to be a lot more straight forward. (#9198)

This commit is contained in:
LexManos authored and GitHub committed 2022-12-10 15:03:23 -08:00
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)
{