From 4f03e241be17877d191a1a708ebbaae3151f899d Mon Sep 17 00:00:00 2001 From: xiewuzhiying Date: Wed, 17 Jul 2024 05:25:43 +0800 Subject: [PATCH] fix creative tab --- .../someperipherals/SomePeripheralsItems.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/common/src/main/kotlin/net/spaceeye/someperipherals/SomePeripheralsItems.kt b/common/src/main/kotlin/net/spaceeye/someperipherals/SomePeripheralsItems.kt index b09edd5..0e28a46 100644 --- a/common/src/main/kotlin/net/spaceeye/someperipherals/SomePeripheralsItems.kt +++ b/common/src/main/kotlin/net/spaceeye/someperipherals/SomePeripheralsItems.kt @@ -11,10 +11,11 @@ import net.spaceeye.someperipherals.blocks.SomePeripheralsCommonBlocks import net.spaceeye.someperipherals.items.goggles.RangeGogglesItem import net.spaceeye.someperipherals.items.goggles.StatusGogglesItem + object SomePeripheralsItems { val ITEMS = DeferredRegister.create(SomePeripherals.MOD_ID, Registries.ITEM) - var LOGO: RegistrySupplier = ITEMS.register("someperipherals_logo") { Item(Item.Properties()) } + //var LOGO: RegistrySupplier = ITEMS.register("someperipherals_logo") { Item(Item.Properties()) } var STATUS_GOGGLES: RegistrySupplier = ITEMS.register("status_goggles") { StatusGogglesItem() } var RANGE_GOGGLES: RegistrySupplier = ITEMS.register("range_goggles") { RangeGogglesItem() } @@ -28,11 +29,10 @@ object SomePeripheralsItems { val CREATIVE_TAB = DeferredRegister.create(SomePeripherals.MOD_ID, Registries.CREATIVE_MODE_TAB) - val TAB: RegistrySupplier by lazy { - CREATIVE_TAB.register( - SomePeripherals.MOD_ID, CreativeModeTab.builder(CreativeModeTab.Row.TOP, 0) - .title(Component.translatable("someperipherals_tab")) - .displayItems { _, output -> + val TAB: RegistrySupplier = CREATIVE_TAB.register(SomePeripherals.MOD_ID) { + CreativeModeTab.builder(CreativeModeTab.Row.TOP, 0) + .title(Component.translatable("itemGroup.some_peripherals.someperipherals_tab")) + .displayItems { itemDisplayParameters: CreativeModeTab.ItemDisplayParameters, output: CreativeModeTab.Output -> ITEMS.forEach { e -> output.accept( e.get() @@ -41,8 +41,8 @@ object SomePeripheralsItems { } .icon { ItemStack( - LOGO.get() + SomePeripheralsCommonBlocks.RAYCASTER.get() ) - }::build) + }.build() } } \ No newline at end of file