Make mod actually run

This commit is contained in:
DBotThePony 2024-01-02 11:31:41 +07:00
parent fa67353eae
commit 2220a7039f
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 11 additions and 6 deletions

View File

@ -17,10 +17,14 @@ public abstract class ItemMixin {
cancellable = true
)
public void getItemCategory$hook(CallbackInfoReturnable<CreativeModeTab> info) {
if (MCreativeTabsKt.getMainTabContents().contains((Item) ((Object) this))) {
info.setReturnValue(OverdriveThatMatters.INSTANCE.CREATIVE_TAB);
} else if (MCreativeTabsKt.getDecorativeTabContents().contains((Item) ((Object) this))) {
info.setReturnValue(OverdriveThatMatters.INSTANCE.CREATIVE_TAB_DECORATIVE);
try {
if (MCreativeTabsKt.getMainTabContents().contains((Item) ((Object) this))) {
info.setReturnValue(OverdriveThatMatters.INSTANCE.CREATIVE_TAB);
} else if (MCreativeTabsKt.getDecorativeTabContents().contains((Item) ((Object) this))) {
info.setReturnValue(OverdriveThatMatters.INSTANCE.CREATIVE_TAB_DECORATIVE);
}
} catch(Throwable err) {
info.setReturnValue(CreativeModeTab.TAB_MISC); // fuck you shapedrecipebuilder
}
}
}

View File

@ -285,5 +285,6 @@ private fun addDecorativeTabItems(consumer: CreativeTabOutput) {
}
}
val MainTabContents = CreativeTabOutput().also { addMainCreativeTabItems(it) }
val DecorativeTabContents = CreativeTabOutput().also { addDecorativeTabItems(it) }
// lazy is to prevent "exception in initializer" and allow to re-initialize in future
val MainTabContents by lazy { CreativeTabOutput().also { addMainCreativeTabItems(it) } }
val DecorativeTabContents by lazy { CreativeTabOutput().also { addDecorativeTabItems(it) } }