diff --git a/colorizer.js b/colorizer.js new file mode 100644 index 000000000..c9f848298 --- /dev/null +++ b/colorizer.js @@ -0,0 +1,85 @@ + +// Использует Image Magick для автоматической перекраски текстур + +const fs = require('fs') +const root_main = './src/main/resources/assets/overdrive_that_matters/textures/' +const child_process = require('child_process') + +const args = process.argv.slice(2) + +if (args.length == 0) { + console.error('No texture(s) names specified.') + process.exit(2) +} + +const colors = [ + ['orange', [245, 116, 16]], + ['magenta', [186, 63, 175]], + ['light_blue', [59, 180, 219]], + ['yellow', [252, 199, 36]], + ['lime', [111, 187, 24]], + ['pink', [243, 139, 170]], + ['gray', [62, 66, 70]], + ['light_gray', [140, 140, 131]], + ['cyan', [22, 134, 145]], + ['purple', [116, 38, 169]], + ['blue', [51, 53, 155]], + ['brown', [114, 71, 40]], + ['green', [84, 109, 28]], + ['red', [156, 37, 34]], + ['black', [31, 31, 35]], +] + +process.stderr.setMaxListeners(40) +process.stdout.setMaxListeners(40) + +for (const texture of args) { + if (!fs.existsSync(`${root_main}${texture}.png`)) { + process.stderr.write(`${texture}.png does not exist\n`) + continue + } + + const splitted = texture.split('/') + const last = splitted.pop() + const combined = splitted.join('/') + + const basedir = `${root_main}${combined}` + + for (const color of colors) { + (async function() { + const identify = child_process.spawn('magick', [ + 'identify', + `${root_main}${texture}.png`, + ]) + + identify.stderr.pipe(process.stderr) + + const chunks = [] + identify.stdout.on('data', (a) => chunks.push(a)) + + await new Promise((resolve) => { + identify.on('close', () => resolve()) + }) + + const chunk = chunks[0].toString('utf-8') + const size = chunk.match(/PNG ([0-9]+)x([0-9]+)/) + const width = parseInt(size[1]) + const height = parseInt(size[2]) + + const name = color[0] + const rgb = color[1] + const magick = child_process.spawn('magick', [ + 'convert', + `${root_main}${texture}.png`, + '-size', `${width}x${height}`, + `xc:rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`, + '-compose', 'Multiply', + '-composite', + //'-layers', 'merge', + `${basedir}/${last.replace(/_colorless/, '').replace(/_white/, '')}_${name}.png`]) + + magick.stdout.pipe(process.stdout) + magick.stderr.pipe(process.stderr) + })() + } +} diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt index dd815a3ca..1c5671552 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt @@ -18,8 +18,6 @@ import net.minecraftforge.fml.common.Mod import net.minecraftforge.forge.event.lifecycle.GatherDataEvent import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.block.* -import ru.dbotthepony.mc.otm.registry.MBlocks -import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.data.LootTableBasicAppender import ru.dbotthepony.mc.otm.datagen.blocks.BatteryBankProvider @@ -32,8 +30,7 @@ import ru.dbotthepony.mc.otm.datagen.loot.TileNbtCopy import ru.dbotthepony.mc.otm.datagen.models.BlockMatteryModelProvider import ru.dbotthepony.mc.otm.datagen.recipes.MatteryRecipeProvider import ru.dbotthepony.mc.otm.datagen.recipes.has -import ru.dbotthepony.mc.otm.registry.MItemTags -import ru.dbotthepony.mc.otm.registry.MNames +import ru.dbotthepony.mc.otm.registry.* @Mod.EventBusSubscriber(modid = DataGen.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) object DataGen { @@ -108,6 +105,17 @@ object DataGen { } } + private fun decoratives(list: ColoredDecorativeBlock) { + for (block in list.blocks) { + decorativeCubeAll(block) + lootTableProvider.simpleBlock(block) + } + + for (item in list.items) { + itemModelProvider.block(item) + } + } + @SubscribeEvent @JvmStatic @Suppress("unused") @@ -131,10 +139,11 @@ object DataGen { decorativeCubeAll(MBlocks.CRATE_LIST) decorativeCubeAll(MBlocks.CARBON_FIBRE_BLOCK) decorativeCubeAll(MBlocks.TRITANIUM_BLOCK) - decorativeCubeAll(MBlocks.TRITANIUM_BLOCK_COLORLESS) decorativeCubeAll(MBlocks.VENT) decorativeCubeAll(MBlocks.VENT_ALTERNATIVE) - decorativeCubeAll(MBlocks.FLOOR_TILES) + + decoratives(MRegistry.TRITANIUM_BLOCK) + decoratives(MRegistry.FLOOR_TILES) for (glass in MBlocks.INDUSTRIAL_GLASS_LIST) { decorativeCubeAll(glass) @@ -305,10 +314,8 @@ object DataGen { block(MItems.TRITANIUM_RAW_BLOCK) block(MItems.ITEM_MONITOR) block(MItems.TRITANIUM_BLOCK) - block(MItems.TRITANIUM_BLOCK_COLORLESS) block(MItems.VENT) block(MItems.VENT_ALTERNATIVE) - block(MItems.FLOOR_TILES) for (glass in MItems.INDUSTRIAL_GLASS_LIST) { block(glass) @@ -465,10 +472,8 @@ object DataGen { simpleBlock(MBlocks.CARBON_FIBRE_BLOCK) simpleBlock(MBlocks.TRITANIUM_RAW_BLOCK) simpleBlock(MBlocks.TRITANIUM_BLOCK) - simpleBlock(MBlocks.TRITANIUM_BLOCK_COLORLESS) simpleBlock(MBlocks.VENT) simpleBlock(MBlocks.VENT_ALTERNATIVE) - simpleBlock(MBlocks.FLOOR_TILES) simpleBlock(MBlocks.TRITANIUM_STRIPED_BLOCK) simpleBlock(MBlocks.MATTER_CABLE) simpleBlock(MBlocks.GRAVITATION_STABILIZER) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlocks.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlocks.kt index adaa9e679..ff1a2cccb 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlocks.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlocks.kt @@ -17,6 +17,7 @@ import net.minecraftforge.registries.ForgeRegistries import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.block.* + object MBlocks { private val registry = DeferredRegister.create(ForgeRegistries.BLOCKS, OverdriveThatMatters.MOD_ID) @@ -97,13 +98,9 @@ object MBlocks { .strength(4f) ) } - val TRITANIUM_BLOCK_COLORLESS: Block by registry.register(MNames.TRITANIUM_BLOCK_COLORLESS) { Block( - BlockBehaviour.Properties.of(Material.METAL, DyeColor.WHITE) - .sound(SoundType.BASALT) - .requiresCorrectToolForDrops() - .explosionResistance(80f) - .strength(4f) - ) } + init { + MRegistry.TRITANIUM_BLOCK.registerBlocks(registry) + } val TRITANIUM_STRIPED_BLOCK: Block by registry.register(MNames.TRITANIUM_STRIPED_BLOCK) { Block( BlockBehaviour.Properties.of(Material.METAL, MaterialColor.COLOR_LIGHT_BLUE) @@ -121,13 +118,6 @@ object MBlocks { .strength(3f) ) } - val FLOOR_TILES: Block by registry.register(MNames.FLOOR_TILES) { Block( - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.COLOR_LIGHT_GRAY) - .sound(SoundType.STONE) - .requiresCorrectToolForDrops() - .strength(3f) - ) } - val VENT: Block by registry.register(MNames.VENT) { Block( BlockBehaviour.Properties.of(Material.METAL, MaterialColor.COLOR_LIGHT_BLUE) .sound(SoundType.BASALT) @@ -144,6 +134,10 @@ object MBlocks { .strength(4f) ) } + init { + MRegistry.FLOOR_TILES.registerBlocks(registry) + } + val CARGO_CRATE: Block by registry.register(MNames.CARGO_CRATE) { CargoCrateBlock(null) } val CARGO_CRATE_WHITE: Block by registry.register(MNames.CARGO_CRATE_WHITE) { CargoCrateBlock(DyeColor.WHITE) } val CARGO_CRATE_ORANGE: Block by registry.register(MNames.CARGO_CRATE_ORANGE) { CargoCrateBlock(DyeColor.ORANGE) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItems.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItems.kt index ce9786a7d..a803cdc02 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItems.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItems.kt @@ -291,13 +291,21 @@ object MItems { ) val TRITANIUM_BLOCK: Item by registry.register(MNames.TRITANIUM_BLOCK) { BlockItem(MBlocks.TRITANIUM_BLOCK, DEFAULT_PROPERTIES) } - val TRITANIUM_BLOCK_COLORLESS: Item by registry.register(MNames.TRITANIUM_BLOCK_COLORLESS) { BlockItem(MBlocks.TRITANIUM_BLOCK_COLORLESS, DEFAULT_PROPERTIES) } + + init { + MRegistry.TRITANIUM_BLOCK.registerItems(registry) + } + val VENT: Item by registry.register(MNames.VENT) { BlockItem(MBlocks.VENT, DEFAULT_PROPERTIES) } val VENT_ALTERNATIVE: Item by registry.register(MNames.VENT_ALTERNATIVE) { BlockItem(MBlocks.VENT_ALTERNATIVE, DEFAULT_PROPERTIES) } - val FLOOR_TILES: Item by registry.register(MNames.FLOOR_TILES) { BlockItem(MBlocks.FLOOR_TILES, DEFAULT_PROPERTIES) } + val TRITANIUM_STRIPED_BLOCK: Item by registry.register(MNames.TRITANIUM_STRIPED_BLOCK) { BlockItem(MBlocks.TRITANIUM_STRIPED_BLOCK, DEFAULT_PROPERTIES) } val CARBON_FIBRE_BLOCK: Item by registry.register(MNames.CARBON_FIBRE_BLOCK) { BlockItem(MBlocks.CARBON_FIBRE_BLOCK, DEFAULT_PROPERTIES) } + init { + MRegistry.FLOOR_TILES.registerItems(registry) + } + val INDUSTRIAL_GLASS: Item by registry.register(MRegistry.INDUSTRIAL_GLASS.name) { BlockItem(MBlocks.INDUSTRIAL_GLASS, DEFAULT_PROPERTIES) } val INDUSTRIAL_GLASS_WHITE: Item by registry.register(MRegistry.INDUSTRIAL_GLASS_WHITE.name) { BlockItem(MBlocks.INDUSTRIAL_GLASS_WHITE, DEFAULT_PROPERTIES) } val INDUSTRIAL_GLASS_ORANGE: Item by registry.register(MRegistry.INDUSTRIAL_GLASS_ORANGE.name) { BlockItem(MBlocks.INDUSTRIAL_GLASS_ORANGE, DEFAULT_PROPERTIES) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt index 6209e723a..1bf52c07c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt @@ -58,7 +58,6 @@ object MNames { // building blocks const val TRITANIUM_BLOCK = "tritanium_block" - const val TRITANIUM_BLOCK_COLORLESS = "tritanium_block_colorless" const val TRITANIUM_STRIPED_BLOCK = "tritanium_striped_block" const val CARBON_FIBRE_BLOCK = "carbon_fibre_block" diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt index 368300822..0c1841f7c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt @@ -4,7 +4,9 @@ import net.minecraft.core.BlockPos import net.minecraft.resources.ResourceLocation import net.minecraft.world.damagesource.DamageSource import net.minecraft.world.entity.EntityType +import net.minecraft.world.item.BlockItem import net.minecraft.world.item.DyeColor +import net.minecraft.world.item.Item import net.minecraft.world.level.BlockGetter import net.minecraft.world.level.block.* import net.minecraft.world.level.block.state.BlockBehaviour @@ -12,15 +14,19 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.material.Material import net.minecraft.world.level.material.MaterialColor import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext +import net.minecraftforge.registries.DeferredRegister import net.minecraftforge.registries.ForgeRegistry import net.minecraftforge.registries.IForgeRegistry import net.minecraftforge.registries.NewRegistryEvent import net.minecraftforge.registries.RegistryBuilder +import net.minecraftforge.registries.RegistryObject import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.android.AndroidFeatureType import ru.dbotthepony.mc.otm.android.AndroidResearchType import java.util.function.Supplier +import kotlin.properties.Delegates import kotlin.properties.ReadOnlyProperty +import kotlin.properties.ReadWriteProperty import kotlin.reflect.KProperty class CrateProperties(val color: MaterialColor, val name: String) { @@ -85,6 +91,171 @@ private class RegistryDelegate(private val name: String) { } } +private class WriteOnce : ReadWriteProperty { + private var value: V? = null + + override fun getValue(thisRef: Any, property: KProperty<*>): V { + return checkNotNull(value) { "Property wasn't initialized" } + } + + override fun setValue(thisRef: Any, property: KProperty<*>, value: V) { + if (this.value != null) { + throw IllegalStateException("Property already initialized") + } + + this.value = value + } +} + +class ColoredDecorativeBlock( + val baseName: String, + private val propertySupplier: (DyeColor) -> BlockBehaviour.Properties +) { + private var _whiteBlock: RegistryObject by WriteOnce() + private var _orangeBlock: RegistryObject by WriteOnce() + private var _magentaBlock: RegistryObject by WriteOnce() + private var _lightBlueBlock: RegistryObject by WriteOnce() + private var _yellowBlock: RegistryObject by WriteOnce() + private var _limeBlock: RegistryObject by WriteOnce() + private var _pinkBlock: RegistryObject by WriteOnce() + private var _grayBlock: RegistryObject by WriteOnce() + private var _lightGrayBlock: RegistryObject by WriteOnce() + private var _cyanBlock: RegistryObject by WriteOnce() + private var _purpleBlock: RegistryObject by WriteOnce() + private var _blueBlock: RegistryObject by WriteOnce() + private var _brownBlock: RegistryObject by WriteOnce() + private var _greenBlock: RegistryObject by WriteOnce() + private var _redBlock: RegistryObject by WriteOnce() + private var _blackBlock: RegistryObject by WriteOnce() + + val whiteBlock: Block get() = _whiteBlock.get() + val orangeBlock: Block get() = _orangeBlock.get() + val magentaBlock: Block get() = _magentaBlock.get() + val lightBlueBlock: Block get() = _lightBlueBlock.get() + val yellowBlock: Block get() = _yellowBlock.get() + val limeBlock: Block get() = _limeBlock.get() + val pinkBlock: Block get() = _pinkBlock.get() + val grayBlock: Block get() = _grayBlock.get() + val lightGrayBlock: Block get() = _lightGrayBlock.get() + val cyanBlock: Block get() = _cyanBlock.get() + val purpleBlock: Block get() = _purpleBlock.get() + val blueBlock: Block get() = _blueBlock.get() + val brownBlock: Block get() = _brownBlock.get() + val greenBlock: Block get() = _greenBlock.get() + val redBlock: Block get() = _redBlock.get() + val blackBlock: Block get() = _blackBlock.get() + + private var _whiteItem: RegistryObject by WriteOnce() + private var _orangeItem: RegistryObject by WriteOnce() + private var _magentaItem: RegistryObject by WriteOnce() + private var _lightBlueItem: RegistryObject by WriteOnce() + private var _yellowItem: RegistryObject by WriteOnce() + private var _limeItem: RegistryObject by WriteOnce() + private var _pinkItem: RegistryObject by WriteOnce() + private var _grayItem: RegistryObject by WriteOnce() + private var _lightGrayItem: RegistryObject by WriteOnce() + private var _cyanItem: RegistryObject by WriteOnce() + private var _purpleItem: RegistryObject by WriteOnce() + private var _blueItem: RegistryObject by WriteOnce() + private var _brownItem: RegistryObject by WriteOnce() + private var _greenItem: RegistryObject by WriteOnce() + private var _redItem: RegistryObject by WriteOnce() + private var _blackItem: RegistryObject by WriteOnce() + + val whiteItem: Item get() = _whiteItem.get() + val orangeItem: Item get() = _orangeItem.get() + val magentaItem: Item get() = _magentaItem.get() + val lightBlueItem: Item get() = _lightBlueItem.get() + val yellowItem: Item get() = _yellowItem.get() + val limeItem: Item get() = _limeItem.get() + val pinkItem: Item get() = _pinkItem.get() + val grayItem: Item get() = _grayItem.get() + val lightGrayItem: Item get() = _lightGrayItem.get() + val cyanItem: Item get() = _cyanItem.get() + val purpleItem: Item get() = _purpleItem.get() + val blueItem: Item get() = _blueItem.get() + val brownItem: Item get() = _brownItem.get() + val greenItem: Item get() = _greenItem.get() + val redItem: Item get() = _redItem.get() + val blackItem: Item get() = _blackItem.get() + + val blocks = LazyList( + { _whiteBlock.get() }, + { _orangeBlock.get() }, + { _magentaBlock.get() }, + { _lightBlueBlock.get() }, + { _yellowBlock.get() }, + { _limeBlock.get() }, + { _pinkBlock.get() }, + { _grayBlock.get() }, + { _lightGrayBlock.get() }, + { _cyanBlock.get() }, + { _purpleBlock.get() }, + { _blueBlock.get() }, + { _brownBlock.get() }, + { _greenBlock.get() }, + { _redBlock.get() }, + { _blackBlock.get() }, + ) + + val items = LazyList( + { _whiteItem.get() }, + { _orangeItem.get() }, + { _magentaItem.get() }, + { _lightBlueItem.get() }, + { _yellowItem.get() }, + { _limeItem.get() }, + { _pinkItem.get() }, + { _grayItem.get() }, + { _lightGrayItem.get() }, + { _cyanItem.get() }, + { _purpleItem.get() }, + { _blueItem.get() }, + { _brownItem.get() }, + { _greenItem.get() }, + { _redItem.get() }, + { _blackItem.get() }, + ) + + fun registerBlocks(registry: DeferredRegister) { + _whiteBlock = registry.register("${baseName}_white") { Block(propertySupplier.invoke(DyeColor.WHITE)) } + _orangeBlock = registry.register("${baseName}_orange") { Block(propertySupplier.invoke(DyeColor.ORANGE)) } + _magentaBlock = registry.register("${baseName}_magenta") { Block(propertySupplier.invoke(DyeColor.MAGENTA)) } + _lightBlueBlock = registry.register("${baseName}_light_blue") { Block(propertySupplier.invoke(DyeColor.LIGHT_BLUE)) } + _yellowBlock = registry.register("${baseName}_yellow") { Block(propertySupplier.invoke(DyeColor.YELLOW)) } + _limeBlock = registry.register("${baseName}_lime") { Block(propertySupplier.invoke(DyeColor.LIME)) } + _pinkBlock = registry.register("${baseName}_pink") { Block(propertySupplier.invoke(DyeColor.PINK)) } + _grayBlock = registry.register("${baseName}_gray") { Block(propertySupplier.invoke(DyeColor.GRAY)) } + _lightGrayBlock = registry.register("${baseName}_light_gray") { Block(propertySupplier.invoke(DyeColor.LIGHT_GRAY)) } + _cyanBlock = registry.register("${baseName}_cyan") { Block(propertySupplier.invoke(DyeColor.CYAN)) } + _purpleBlock = registry.register("${baseName}_purple") { Block(propertySupplier.invoke(DyeColor.PURPLE)) } + _blueBlock = registry.register("${baseName}_blue") { Block(propertySupplier.invoke(DyeColor.BLUE)) } + _brownBlock = registry.register("${baseName}_brown") { Block(propertySupplier.invoke(DyeColor.BROWN)) } + _greenBlock = registry.register("${baseName}_green") { Block(propertySupplier.invoke(DyeColor.GREEN)) } + _redBlock = registry.register("${baseName}_red") { Block(propertySupplier.invoke(DyeColor.RED)) } + _blackBlock = registry.register("${baseName}_black") { Block(propertySupplier.invoke(DyeColor.BLACK)) } + } + + fun registerItems(registry: DeferredRegister) { + _whiteItem = registry.register("${baseName}_white") { BlockItem(_whiteBlock.get(), Item.Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)) } + _orangeItem = registry.register("${baseName}_orange") { BlockItem(_orangeBlock.get(), Item.Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)) } + _magentaItem = registry.register("${baseName}_magenta") { BlockItem(_magentaBlock.get(), Item.Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)) } + _lightBlueItem = registry.register("${baseName}_light_blue") { BlockItem(_lightBlueBlock.get(), Item.Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)) } + _yellowItem = registry.register("${baseName}_yellow") { BlockItem(_yellowBlock.get(), Item.Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)) } + _limeItem = registry.register("${baseName}_lime") { BlockItem(_limeBlock.get(), Item.Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)) } + _pinkItem = registry.register("${baseName}_pink") { BlockItem(_pinkBlock.get(), Item.Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)) } + _grayItem = registry.register("${baseName}_gray") { BlockItem(_grayBlock.get(), Item.Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)) } + _lightGrayItem = registry.register("${baseName}_light_gray") { BlockItem(_lightGrayBlock.get(), Item.Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)) } + _cyanItem = registry.register("${baseName}_cyan") { BlockItem(_cyanBlock.get(), Item.Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)) } + _purpleItem = registry.register("${baseName}_purple") { BlockItem(_purpleBlock.get(), Item.Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)) } + _blueItem = registry.register("${baseName}_blue") { BlockItem(_blueBlock.get(), Item.Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)) } + _brownItem = registry.register("${baseName}_brown") { BlockItem(_brownBlock.get(), Item.Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)) } + _greenItem = registry.register("${baseName}_green") { BlockItem(_greenBlock.get(), Item.Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)) } + _redItem = registry.register("${baseName}_red") { BlockItem(_redBlock.get(), Item.Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)) } + _blackItem = registry.register("${baseName}_black") { BlockItem(_blackBlock.get(), Item.Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)) } + } +} + object MRegistry { private val features = RegistryDelegate>>("ANDROID_FEATURES") private val research = RegistryDelegate>>("ANDROID_RESEARCH") @@ -92,19 +263,19 @@ object MRegistry { val ANDROID_FEATURES get() = features.get() as ForgeRegistry> val ANDROID_RESEARCH get() = research.get() as ForgeRegistry> - fun initialize(context: FMLJavaModLoadingContext) { - context.modEventBus.addListener(this::register) - context.modEventBus.register(MStats) - context.modEventBus.register(LootModifiers) + val TRITANIUM_BLOCK = ColoredDecorativeBlock(MNames.TRITANIUM_BLOCK) { + BlockBehaviour.Properties.of(Material.METAL, it.materialColor) + .sound(SoundType.BASALT) + .requiresCorrectToolForDrops() + .explosionResistance(80f) + .strength(4f) + } - MBlocks.register() - MBlockEntities.register() - MEntityTypes.register() - MMenus.register() - MItems.register() - AndroidFeatures.register() - AndroidResearch.register() - MSoundEvents.register() + val FLOOR_TILES = ColoredDecorativeBlock(MNames.FLOOR_TILES) { + BlockBehaviour.Properties.of(Material.STONE, it.materialColor) + .sound(SoundType.STONE) + .requiresCorrectToolForDrops() + .strength(3f) } private fun register(event: NewRegistryEvent) { @@ -188,4 +359,19 @@ object MRegistry { INDUSTRIAL_GLASS_RED, INDUSTRIAL_GLASS_BLACK, ) + + fun initialize(context: FMLJavaModLoadingContext) { + context.modEventBus.addListener(this::register) + context.modEventBus.register(MStats) + context.modEventBus.register(LootModifiers) + + MBlocks.register() + MBlockEntities.register() + MEntityTypes.register() + MMenus.register() + MItems.register() + AndroidFeatures.register() + AndroidResearch.register() + MSoundEvents.register() + } } diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_black.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_black.png new file mode 100644 index 000000000..bca871048 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_black.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_blue.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_blue.png new file mode 100644 index 000000000..e21597d4d Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_blue.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_brown.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_brown.png new file mode 100644 index 000000000..a8a8874f8 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_brown.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_cyan.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_cyan.png new file mode 100644 index 000000000..7709a8c5d Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_cyan.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_gray.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_gray.png new file mode 100644 index 000000000..2140b27fd Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_gray.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_green.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_green.png new file mode 100644 index 000000000..3aae66a0b Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_green.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_light_blue.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_light_blue.png new file mode 100644 index 000000000..0325b4fa2 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_light_blue.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_light_gray.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_light_gray.png new file mode 100644 index 000000000..5b4fab6d2 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_light_gray.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_lime.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_lime.png new file mode 100644 index 000000000..d67da9e55 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_lime.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_magenta.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_magenta.png new file mode 100644 index 000000000..7a4add1a4 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_magenta.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_orange.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_orange.png new file mode 100644 index 000000000..b799704da Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_orange.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_pink.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_pink.png new file mode 100644 index 000000000..3de3c029a Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_pink.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_purple.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_purple.png new file mode 100644 index 000000000..db11e9346 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_purple.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_red.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_red.png new file mode 100644 index 000000000..4c040dcf0 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_red.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_white.png similarity index 100% rename from src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles.png rename to src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_white.png diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_yellow.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_yellow.png new file mode 100644 index 000000000..7260ff5bd Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/floor_tiles_yellow.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_black.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_black.png new file mode 100644 index 000000000..42ea98a87 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_black.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_blue.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_blue.png new file mode 100644 index 000000000..bb4605b98 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_blue.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_brown.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_brown.png new file mode 100644 index 000000000..0da196ade Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_brown.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_cyan.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_cyan.png new file mode 100644 index 000000000..5f004ef76 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_cyan.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_gray.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_gray.png new file mode 100644 index 000000000..70690a2a5 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_gray.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_green.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_green.png new file mode 100644 index 000000000..b244663fa Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_green.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_light_blue.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_light_blue.png new file mode 100644 index 000000000..3d61fe78a Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_light_blue.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_light_gray.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_light_gray.png new file mode 100644 index 000000000..290fb6bb8 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_light_gray.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_lime.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_lime.png new file mode 100644 index 000000000..97bf58f14 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_lime.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_magenta.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_magenta.png new file mode 100644 index 000000000..6f7f5ba60 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_magenta.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_orange.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_orange.png new file mode 100644 index 000000000..993d660e0 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_orange.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_pink.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_pink.png new file mode 100644 index 000000000..6150820a8 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_pink.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_purple.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_purple.png new file mode 100644 index 000000000..b901bce3a Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_purple.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_red.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_red.png new file mode 100644 index 000000000..8d1887300 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_red.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_colorless.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_white.png similarity index 100% rename from src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_colorless.png rename to src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_white.png diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_yellow.png b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_yellow.png new file mode 100644 index 000000000..a7b8b6289 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/decorative/tritanium_block_yellow.png differ