Why so screenious

This commit is contained in:
mewhenthe
2026-04-11 17:45:43 +02:00
parent 9af5b77a1f
commit 0d92d59958
11 changed files with 153 additions and 248 deletions

View File

@@ -22,47 +22,15 @@ import java.util.function.Consumer
import java.util.function.Supplier
object Blocks {
// val CASE: MutableList<RegistrySupplier<Block?>?>? =
// BaseBlock.register(intArrayOf(0, 1, 2), "case", { tier -> CaseBlock(tier) })
val BLOCKS: DeferredRegister<Block?> = DeferredRegister.create(NeoComputers.MODID, Registries.BLOCK)
// val TESTBLOCK : RegistrySupplier<Block> = registerBlock("test")
val TESTBLOCK: RegistrySupplier<Block> = BLOCKS.register("test") { Block(BlockBehaviour.Properties.of().setId(ResourceKey.create(Registries.BLOCK, Identifier.fromNamespaceAndPath(NeoComputers.MODID, "test")))) }
// public static final RegistrySupplier<Block> CASE0 = BLOCKS.register("case0", () -> new CaseBlock(0));
// public static final RegistrySupplier<Block> CASE1 = BLOCKS.register("case1", () -> new CaseBlock(1));
// public static final RegistrySupplier<Block> CASE2 = BLOCKS.register("case2", () -> new CaseBlock(2));
// public static final RegistrySupplier<Block> CABLE = BLOCKS.register("cable", () -> new CableBlock());
// val SCREEN: RegistrySupplier<Block?>? = BLOCKS.register<Block?>("screen", Supplier { ScreenBlock() })
// val CABLE: RegistrySupplier<Block?>? = BLOCKS.register<Block?>("cable", Supplier { CableBlock() })
// fun registerBlock(name: String): RegistrySupplier<Block> {
// // var Registrar<Item> items = MANAGER.get().get(Registries.ITEM);
// var blocks: Registrar<Block> = NeoComputers.MANAGER.get().get(Registries.BLOCK);
// return blocks.register(Identifier.fromNamespaceAndPath(NeoComputers.MODID, name)) {
// Block(
// BlockBehaviour.Properties.of().setId(
// ResourceKey.create(
// Registries.BLOCK,
// Identifier.fromNamespaceAndPath(NeoComputers.MODID, name)
// )
// )
// )
// }
// }
val BLOCKS: DeferredRegister<Block> = DeferredRegister.create(NeoComputers.MODID, Registries.BLOCK)
val TEST_BLOCK: RegistrySupplier<Block> = BaseBlock.register("test") { BaseBlock("test") }
val SCREEN_BLOCK: RegistrySupplier<Block> = BaseBlock.register("screen") { ScreenBlock() }
fun registerBlockItems() {
BLOCKS.forEach(Consumer { sup: RegistrySupplier<Block?>? ->
NeoComputers.LOGGER.info("mango viagra")
// TODO: base blocks
// if (blk instanceof BaseBlock) {
// Items.ITEMS.register(sup.getId().getPath(), () -> new BaseBlock.BaseBlockItem(blk, new Item.Properties().arch$tab(Tabs.TAB)));
// } else {
// Items.ITEMS.register(sup.getId().getPath(), () -> new BlockItem(blk, new Item.Properties().arch$tab(Tabs.TAB)));
// }
Items.ITEMS.register(sup!!.id.path) { BlockItem(sup.get()!!, Item.Properties().`arch$tab`(Tabs.TAB).setId(ResourceKey.create(Registries.ITEM, sup.id)))}
BLOCKS.forEach(Consumer { sup: RegistrySupplier<Block> ->
Items.ITEMS.register(sup.id.path) { BlockItem(sup.get()!!, Item.Properties().`arch$tab`(Tabs.TAB).setId(ResourceKey.create(Registries.ITEM, sup.id)))}
})
}
}