Skip to content

Commit

Permalink
fix creative tab
Browse files Browse the repository at this point in the history
  • Loading branch information
xiewuzhiying committed Jul 16, 2024
1 parent 9a9ffdb commit 4f03e24
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item> = ITEMS.register("someperipherals_logo") { Item(Item.Properties()) }
//var LOGO: RegistrySupplier<Item> = ITEMS.register("someperipherals_logo") { Item(Item.Properties()) }

var STATUS_GOGGLES: RegistrySupplier<Item> = ITEMS.register("status_goggles") { StatusGogglesItem() }
var RANGE_GOGGLES: RegistrySupplier<Item> = ITEMS.register("range_goggles") { RangeGogglesItem() }
Expand All @@ -28,11 +29,10 @@ object SomePeripheralsItems {

val CREATIVE_TAB = DeferredRegister.create(SomePeripherals.MOD_ID, Registries.CREATIVE_MODE_TAB)

val TAB: RegistrySupplier<CreativeModeTab> by lazy {
CREATIVE_TAB.register(
SomePeripherals.MOD_ID, CreativeModeTab.builder(CreativeModeTab.Row.TOP, 0)
.title(Component.translatable("someperipherals_tab"))
.displayItems { _, output ->
val TAB: RegistrySupplier<CreativeModeTab> = 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()
Expand All @@ -41,8 +41,8 @@ object SomePeripheralsItems {
}
.icon {
ItemStack(
LOGO.get()
SomePeripheralsCommonBlocks.RAYCASTER.get()
)
}::build)
}.build()
}
}

0 comments on commit 4f03e24

Please sign in to comment.