Initial 1.20 port. Still untested

This commit is contained in:
2023-05-11 19:30:00 +02:00
parent 8e72212bf6
commit 5b6bf5fd8a
20 changed files with 60 additions and 50 deletions

View File

@@ -19,7 +19,7 @@ public class MinecraftMixin {
@Inject(method = "<init>", at = @At("RETURN"))
private void injectCraterLateInit(GameConfig gameConfig, CallbackInfo ci) {
CreativeTabRegistry.getTabs().forEach(tab -> {
CreativeModeTab finalTab = FabricItemGroup.builder(tab.getResourceLocation())
CreativeModeTab finalTab = FabricItemGroup.builder()
.title(Component.translatable("itemGroup." +
tab.getResourceLocation().toString().replace(":", ".")
))
@@ -28,7 +28,7 @@ public class MinecraftMixin {
tab.setTab(finalTab);
ItemGroupEvents.modifyEntriesEvent(finalTab).register(entries -> CreativeTabRegistry
ItemGroupEvents.modifyEntriesEvent(tab.getResourceKey()).register(entries -> CreativeTabRegistry
.getTabItems()
.stream().filter(t -> t.getLeft().get() == finalTab && t.getRight() != null)
.map(Pair::getRight).forEach(itm -> entries.accept(itm.get())));