diff --git a/color datagen/base_with_mask.js b/color datagen/base_with_mask.js index e3be0dc5b..657b550cb 100644 --- a/color datagen/base_with_mask.js +++ b/color datagen/base_with_mask.js @@ -34,6 +34,10 @@ const child_process = require('child_process'); const bSize = (await getSize(fBase))[2] const mSize = (await getSize(fMask))[2] + if (subfolder !== '') { + fs.mkdirSync(`${fullBaseFolder}/${subfolder}`, {recursive: true}) + } + if (bSize != mSize) { process.stderr.write(`${fBase} has size of ${bSize}, ${fMask} has size of ${mSize}!\n`) process.exit(3) diff --git a/color datagen/tritanium_anvil.sh b/color datagen/tritanium_anvil.sh new file mode 100644 index 000000000..7316147d1 --- /dev/null +++ b/color datagen/tritanium_anvil.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +node ./base_with_mask.js block/tritanium_anvil block/tritanium_anvil_mask tritanium_anvil +node ./base_with_mask.js block/tritanium_anvil_top block/tritanium_anvil_top_mask tritanium_anvil_top diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DecorativeData.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DecorativeData.kt index f0bee8fc8..886c9ce79 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DecorativeData.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DecorativeData.kt @@ -1,5 +1,6 @@ package ru.dbotthepony.mc.otm.datagen +import net.minecraft.world.item.DyeColor import net.minecraft.world.level.block.AnvilBlock import net.minecraft.world.level.block.SlabBlock import net.minecraft.world.level.block.StairBlock @@ -37,13 +38,32 @@ fun addDecorativeData(blockStateProvider: MatteryBlockStateProvider, itemModelPr DataGen.decoratives(MRegistry.TRITANIUM_BLOCK) - for (anvil in MBlocks.TRITANIUM_ANVIL) { - blockStateProvider.exec { - blockStateProvider.getVariantBuilder(anvil).forAllStates { - ConfiguredModel.builder() - .modelFile(blockStateProvider.models().getExistingFile(modLocation("block/${anvil.registryName!!.path}"))) - .rotationY(it[AnvilBlock.FACING].yRotationBlockstateNorth()) - .build() + for (color in DyeColor.entries) { + blockModelProvider.exec { + blockModelProvider.withExistingParent("block/tritanium_anvil0_${color.name.lowercase()}", "${DataGen.MOD_ID}:block/tritanium_anvil0") + .texture("3", modLocation("block/tritanium_anvil/${color.name.lowercase()}")) + .texture("particle", modLocation("block/tritanium_anvil/${color.name.lowercase()}")) + } + + for (i in 1 until MBlocks.TRITANIUM_ANVIL_VARIANTS) { + blockModelProvider.exec { + blockModelProvider.withExistingParent("block/tritanium_anvil${i}_${color.name.lowercase()}", "${DataGen.MOD_ID}:block/tritanium_anvil$i") + .texture("2", modLocation("block/tritanium_anvil_top/${color.name.lowercase()}")) + .texture("3", modLocation("block/tritanium_anvil/${color.name.lowercase()}")) + .texture("particle", modLocation("block/tritanium_anvil/${color.name.lowercase()}")) + } + } + } + + for (anvils in MBlocks.TRITANIUM_ANVIL.values) { + for (anvil in anvils) { + blockStateProvider.exec { + blockStateProvider.getVariantBuilder(anvil).forAllStates { + ConfiguredModel.builder() + .modelFile(blockStateProvider.models().getExistingFile(modLocation("block/${anvil.registryName!!.path}"))) + .rotationY(it[AnvilBlock.FACING].yRotationBlockstateNorth()) + .build() + } } } } diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/MatterData.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/MatterData.kt index a53bfed95..d288f3e34 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/MatterData.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/MatterData.kt @@ -16,8 +16,10 @@ fun addMatterData(provider: MatterDataProvider) { provider.inherit(Items.CHIPPED_ANVIL, Items.ANVIL, 0.75) provider.inherit(Items.DAMAGED_ANVIL, Items.ANVIL, 0.5) - for (i in 1 until MItems.TRITANIUM_ANVIL.size) { - provider.inherit(MItems.TRITANIUM_ANVIL[i], MItems.TRITANIUM_ANVIL[i - 1], 0.85) + for (anvils in MItems.TRITANIUM_ANVIL.values) { + for (i in 1 until anvils.size) { + provider.inherit(anvils[i], anvils[i - 1], 0.85) + } } provider.inherit(Items.WATER_BUCKET, Items.BUCKET) { diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt index 1dd0bfcc9..35e0d619b 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt @@ -247,11 +247,7 @@ fun addItemModels(provider: MatteryItemModelProvider) { provider.block(MItems.MATTER_INPUT_HATCH) provider.block(MItems.MATTER_OUTPUT_HATCH) - - - for (item in MItems.TRITANIUM_ANVIL) { - provider.block(item) - } + MItems.TRITANIUM_ANVIL.values.forEach { provider.blocks(it) } for ((color, item) in MItems.CARGO_CRATE_MINECARTS) { provider.generated(item) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt index 9b210051b..316efeb0e 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt @@ -683,8 +683,15 @@ private fun blocks(provider: MatteryLanguageProvider) { add(MBlocks.TRITANIUM_BARS, "Tritanium Bars") add(MBlocks.METAL_RAILING, "Metal Railing") - for (block in MBlocks.TRITANIUM_ANVIL) - add(block, "Tritanium Anvil") + for ((color, blocks) in MBlocks.TRITANIUM_ANVIL.entries) { + if (color == null) { + for (block in blocks) + add(block, "Tritanium Anvil") + } else { + for (block in blocks) + add(block, "${provider.englishColors.mapped[color]} Tritanium Anvil") + } + } } } diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/MatteryLanguageProvider.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/MatteryLanguageProvider.kt index 3bb71b5b4..87faba8da 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/MatteryLanguageProvider.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/MatteryLanguageProvider.kt @@ -173,13 +173,13 @@ class MatteryLanguageProvider(private val gen: DataGenerator) { } } - fun add(map: Map, toFormat: String) { + fun add(map: Map, toFormat: String) { for ((color, block) in map) { slave.add(block, toFormat.format(mapped[color]!!)) } } - fun addIntermediate(map: Map, toFormat: String) { + fun addIntermediate(map: Map, toFormat: String) { for ((color, block) in map) { slave.add(block, toFormat.format(if (lowercaseIntermediate) mapped[color]!!.lowercase() else mapped[color]!!)) } diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt index 1e2375d4a..4da51e7bd 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt @@ -14,12 +14,19 @@ private const val FEELING_SAFE_NOW = "...ощущаете ли вы себя т private fun decoratives(provider: MatteryLanguageProvider) { with (provider.russian) { + for (block in MBlocks.TRITANIUM_ANVIL[null]!!) + add(block, "Тритановая наковальня") + for ((color, name) in provider.russianColors.mapped) { val nameF = name.replace("ый", "ая").replace("ой", "ая").replace("ий", "яя") add(MRegistry.VENT.getBlock(color), "$nameF вентиляция") add(MRegistry.VENT_ALTERNATIVE.getBlock(color), "$nameF альтернативная вентиляция") + for (block in MBlocks.TRITANIUM_ANVIL[color]!!) { + add(block, "$nameF тритановая наковальня") + } + val nameMul = name.replace("ый", "ые").replace("ой", "ые").replace("ий", "ие") add(MRegistry.TRITANIUM_BLOCK.getBlock(color), "$name тритановый блок") add(MRegistry.COMPUTER_TERMINAL.getBlock(color), "$name компьютерный терминал") @@ -678,9 +685,6 @@ private fun blocks(provider: MatteryLanguageProvider) { add(MBlocks.TRITANIUM_BARS, "Тритановая решётка") add(MBlocks.METAL_RAILING, "Металлические перила") - - for (block in MBlocks.TRITANIUM_ANVIL) - add(block, "Тритановая наковальня") } } diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/DecorativeLoot.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/DecorativeLoot.kt index 936449861..53b969cc1 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/DecorativeLoot.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/DecorativeLoot.kt @@ -58,8 +58,7 @@ fun addDecorativeLoot(lootTables: LootTables) { lootTables.dropsSelf(MBlocks.REINFORCED_REDSTONE_LAMP) { condition(ExplosionCondition.survivesExplosion()) } lootTables.dropsSelf(MBlocks.REINFORCED_REDSTONE_LAMP_INVERTED) { condition(ExplosionCondition.survivesExplosion()) } - for (block in MBlocks.TRITANIUM_ANVIL) - lootTables.dropsSelf(block) { condition(ExplosionCondition.survivesExplosion()) } + MBlocks.TRITANIUM_ANVIL.values.forEach { it.forEach { lootTables.dropsSelf(it) { condition(ExplosionCondition.survivesExplosion()) } } } for (door in MBlocks.TRITANIUM_TRAPDOOR.values) lootTables.dropsSelf(door) { condition(ExplosionCondition.survivesExplosion()) } diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/DecorativesRecipes.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/DecorativesRecipes.kt index ebedd418c..9d2799116 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/DecorativesRecipes.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/DecorativesRecipes.kt @@ -419,7 +419,7 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutpu .row(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS) .build(consumer, modLocation("decorative/tritanium_bars")) - MatteryRecipe(MItems.TRITANIUM_ANVIL[0], category = RecipeCategory.DECORATIONS) + MatteryRecipe(MItems.TRITANIUM_ANVIL[null]!![0], category = RecipeCategory.DECORATIONS) .row(MItemTags.TRITANIUM_INGOTS_STORAGE, MItemTags.TRITANIUM_INGOTS_STORAGE, MItemTags.TRITANIUM_INGOTS_STORAGE) .rowB(MItemTags.TRITANIUM_INGOTS) .row(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/PainterRecipes.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/PainterRecipes.kt index 456306ba4..62d0063f1 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/PainterRecipes.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/PainterRecipes.kt @@ -19,6 +19,7 @@ import ru.dbotthepony.mc.otm.recipe.PainterArmorDyeRecipe import ru.dbotthepony.mc.otm.recipe.PainterRecipe import ru.dbotthepony.mc.otm.registry.game.MItems import ru.dbotthepony.mc.otm.registry.MRegistry +import ru.dbotthepony.mc.otm.registry.game.MBlocks private val Item.recipeName get() = registryName!!.namespace + "/" + registryName!!.path @@ -356,6 +357,10 @@ fun addPainterRecipes(consumer: RecipeOutput) { generate(consumer, list[null]!!,list) } + for (i in 0 until MBlocks.TRITANIUM_ANVIL_VARIANTS) { + generate(consumer, MItems.TRITANIUM_ANVIL[null]!![i], DyeColor.entries.associateWith { MItems.TRITANIUM_ANVIL[it]!![i] }) + } + generate(consumer, MRegistry.COMPUTER_TERMINAL.item, MRegistry.COMPUTER_TERMINAL.items) generate(consumer, MRegistry.STAR_CHAIR.item, MRegistry.STAR_CHAIR.items) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/MineableTags.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/MineableTags.kt index 158121a1e..48cd4aada 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/MineableTags.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/MineableTags.kt @@ -96,7 +96,7 @@ fun addMineableTags(tagsProvider: TagsProvider) { MBlocks.GRAVITATION_STABILIZER_LENS, ), Tiers.DIAMOND) - tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_ANVIL, Tiers.IRON) + tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_ANVIL.values.stream().flatMap { it.stream() }, Tiers.IRON) tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_ORE, Tiers.IRON) tagsProvider.requiresPickaxe(MBlocks.DEEPSLATE_TRITANIUM_ORE, Tiers.IRON) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/Tags.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/Tags.kt index 882206eb9..0d70d1a62 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/Tags.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/Tags.kt @@ -5,6 +5,7 @@ import net.minecraft.tags.ItemTags import net.minecraft.world.effect.MobEffects import net.minecraft.world.item.Items import net.neoforged.neoforge.common.Tags +import ru.dbotthepony.kommons.collect.flatMap import ru.dbotthepony.mc.otm.core.ResourceLocation import ru.dbotthepony.mc.otm.registry.MBlockTags import ru.dbotthepony.mc.otm.registry.game.MBlocks @@ -35,8 +36,8 @@ fun addTags(tagsProvider: TagsProvider) { tagsProvider.items.Appender(MItemTags.MINECART_CARGO_CRATES).add(MItems.CARGO_CRATE_MINECARTS.values) - tagsProvider.blocks.Appender(BlockTags.ANVIL).add(MBlocks.TRITANIUM_ANVIL) - tagsProvider.items.Appender(ItemTags.ANVIL).add(MItems.TRITANIUM_ANVIL) + tagsProvider.blocks.Appender(BlockTags.ANVIL).add(MBlocks.TRITANIUM_ANVIL.values.stream().flatMap { it.stream() }) + tagsProvider.items.Appender(ItemTags.ANVIL).add(MItems.TRITANIUM_ANVIL.values.stream().flatMap { it.stream() }) tagsProvider.items.Appender(MItemTags.UPGRADES) .add(MItems.MachineUpgrades.Basic.LIST) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/TagsProvider.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/TagsProvider.kt index 69f1b591a..6b5050bc0 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/TagsProvider.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/TagsProvider.kt @@ -115,6 +115,11 @@ class TagsProvider(private val event: GatherDataEvent) { return this } + fun add(values: Iterator): Appender { + values.forEach { add(it) } + return this + } + fun leaf(name: String) = Appender(TagKey.create(tag.registry, ResourceLocation(tag.location.namespace, tag.location.path + "/$name"))) fun add(leaf: String, value: T) = also { leaf(leaf).add(value) } @@ -327,6 +332,16 @@ class TagsProvider(private val event: GatherDataEvent) { return this } + fun requiresPickaxe(blocks: Stream, tier: Tier? = null): TagsProvider { + for (block in blocks) requiresPickaxe(block, tier) + return this + } + + fun requiresPickaxe(blocks: Iterator, tier: Tier? = null): TagsProvider { + for (block in blocks) requiresPickaxe(block, tier) + return this + } + fun requiresPickaxe(vararg blocks: Block, tier: Tier? = null): TagsProvider { for (block in blocks) requiresPickaxe(block, tier) return this diff --git a/src/main/java/ru/dbotthepony/mc/otm/mixin/MixinAnvilBlock.java b/src/main/java/ru/dbotthepony/mc/otm/mixin/MixinAnvilBlock.java index 24ef7f8a5..4d10a0f31 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/mixin/MixinAnvilBlock.java +++ b/src/main/java/ru/dbotthepony/mc/otm/mixin/MixinAnvilBlock.java @@ -17,17 +17,17 @@ public class MixinAnvilBlock { remap = false, cancellable = true) private static void damage(BlockState pState, CallbackInfoReturnable info) { - var list = MBlocks.INSTANCE.getTRITANIUM_ANVIL(); + for (var list : MBlocks.INSTANCE.getTRITANIUM_ANVIL().values()) { + for (int i = 0; i < list.size(); i++) { + if (pState.is(list.get(i))) { + if (i == list.size() - 1) { + info.setReturnValue(null); + } else { + info.setReturnValue(list.get(i + 1).defaultBlockState().setValue(AnvilBlock.FACING, pState.getValue(AnvilBlock.FACING))); + } - for (int i = 0; i < list.size(); i++) { - if (pState.is(list.get(i))) { - if (i == list.size() - 1) { - info.setReturnValue(null); - } else { - info.setReturnValue(list.get(i + 1).defaultBlockState().setValue(AnvilBlock.FACING, pState.getValue(AnvilBlock.FACING))); + return; } - - return; } } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/compat/condensed_creative/CondensedCreativeCompat.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/compat/condensed_creative/CondensedCreativeCompat.kt index b86aa2957..a7950944d 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/compat/condensed_creative/CondensedCreativeCompat.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/compat/condensed_creative/CondensedCreativeCompat.kt @@ -66,7 +66,8 @@ class CondensedCreativeCompat : CondensedCreativeInitializer { addByBase(MRegistry.CARGO_CRATES.allItems, MCreativeTabs.DECORATIVE) addByBase(MItems.CARGO_CRATE_MINECARTS, MCreativeTabs.DECORATIVE) - addByFirst(MItems.TRITANIUM_ANVIL, MCreativeTabs.DECORATIVE) + for (anvils in MItems.TRITANIUM_ANVIL.values) + addByFirst(anvils, MCreativeTabs.DECORATIVE) addByBase(MRegistry.COMPUTER_TERMINAL.allItems, MCreativeTabs.DECORATIVE) addByBase(MRegistry.STAR_CHAIR.allItems, MCreativeTabs.DECORATIVE) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MBlocks.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MBlocks.kt index 5f5493ada..1fd3cd3fd 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MBlocks.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MBlocks.kt @@ -4,6 +4,7 @@ import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet import net.minecraft.core.Direction import net.minecraft.core.registries.BuiltInRegistries import net.minecraft.util.valueproviders.UniformInt +import net.minecraft.world.item.DyeColor import net.minecraft.world.level.block.AnvilBlock import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.Blocks @@ -94,6 +95,10 @@ import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.registry.MDeferredRegister import ru.dbotthepony.mc.otm.registry.MNames import ru.dbotthepony.mc.otm.registry.MRegistry +import java.util.Collections +import java.util.EnumMap +import java.util.HashMap +import java.util.LinkedHashMap import java.util.function.Supplier object MBlocks { @@ -339,24 +344,35 @@ object MBlocks { const val TRITANIUM_ANVIL_VARIANTS = 7 - val TRITANIUM_ANVIL: List + val TRITANIUM_ANVIL: Map> init { - val anvils = ArrayList>() + val map = LinkedHashMap>() - for (i in 0 until TRITANIUM_ANVIL_VARIANTS) { - val props = BlockBehaviour.Properties.of() - .mapColor(MapColor.COLOR_LIGHT_BLUE) - .sound(SoundType.ANVIL) - .destroyTime(2.5f - i * 0.15f) - .explosionResistance(1200f - i * 80f) - .pushReaction(PushReaction.BLOCK) - .requiresCorrectToolForDrops() + for (color in DyeColor.entries.toMutableList().also { it.add(0, null) }) { + val anvils = ArrayList>() - anvils.add(registry.register(MNames.TRITANIUM_ANVIL + i) { AnvilBlock(props) }::get) + for (i in 0 until TRITANIUM_ANVIL_VARIANTS) { + val props = BlockBehaviour.Properties.of() + .mapColor(color?.mapColor ?: MapColor.COLOR_LIGHT_BLUE) + .sound(SoundType.ANVIL) + .destroyTime(2.5f - i * 0.15f) + .explosionResistance(1200f - i * 80f) + .pushReaction(PushReaction.BLOCK) + .requiresCorrectToolForDrops() + + var name = MNames.TRITANIUM_ANVIL + i + + if (color != null) + name += "_${color.name.lowercase()}" + + anvils.add(registry.register(name) { AnvilBlock(props) }) + } + + map[color] = SupplierList(anvils) } - TRITANIUM_ANVIL = SupplierList(anvils) + TRITANIUM_ANVIL = Collections.unmodifiableMap(map) } val TRITANIUM_DOOR = registry.coloredWithBase(MNames.TRITANIUM_DOOR, ::TritaniumDoorBlock) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MCreativeTabs.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MCreativeTabs.kt index 1a90da578..5e979ea79 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MCreativeTabs.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MCreativeTabs.kt @@ -213,7 +213,7 @@ private fun addMainCreativeTabItems(consumer: CreativeModeTab.Output) { base(MItems.TRITANIUM_DOOR) base(MItems.TRITANIUM_TRAPDOOR) accept(MRegistry.TRITANIUM_PRESSURE_PLATE.item) - accept(MItems.TRITANIUM_ANVIL[0]) + accept(MItems.TRITANIUM_ANVIL[null]!![0]) accept(MItems.GRILL.values) @@ -323,9 +323,7 @@ private fun addDecorativeTabItems(consumer: CreativeModeTab.Output) { colored(MItems.TRITANIUM_TRAPDOOR) accept(MRegistry.TRITANIUM_PRESSURE_PLATE.items.values) - for (i in 0 until MItems.TRITANIUM_ANVIL.size) - accept(MItems.TRITANIUM_ANVIL[i]) - + accept(MItems.TRITANIUM_ANVIL[null]!!) colored(MRegistry.CARGO_CRATES.items) colored(MItems.CARGO_CRATE_MINECARTS) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt index c599c02e5..4719fdd34 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt @@ -78,6 +78,8 @@ import ru.dbotthepony.mc.otm.registry.MDeferredRegister import ru.dbotthepony.mc.otm.registry.MItemTags import ru.dbotthepony.mc.otm.registry.MNames import ru.dbotthepony.mc.otm.registry.MRegistry +import java.util.Collections +import java.util.LinkedHashMap import java.util.function.Supplier object MItems { @@ -170,17 +172,27 @@ object MItems { val ENERGY_OUTPUT_INTERFACE by registry.register(MNames.ENERGY_OUTPUT_INTERFACE) { BlockItem(MBlocks.ENERGY_OUTPUT_INTERFACE, DEFAULT_PROPERTIES) } val MULTIBLOCK_TEST by registry.register("multiblock_test") { BlockItem(MBlocks.MULTIBLOCK_TEST, Properties().stacksTo(64)) } - - val TRITANIUM_ANVIL: List + val TRITANIUM_ANVIL: Map> init { - val props = ArrayList>() + val map = LinkedHashMap>() - for (i in MBlocks.TRITANIUM_ANVIL.indices) { - props.add(registry.register(MNames.TRITANIUM_ANVIL + i) { BlockItem(MBlocks.TRITANIUM_ANVIL[i], DEFAULT_PROPERTIES) }::get) + for ((color, anvils) in MBlocks.TRITANIUM_ANVIL) { + val props = ArrayList>() + + for (i in anvils.indices) { + var name = MNames.TRITANIUM_ANVIL + i + + if (color != null) + name += "_${color.name.lowercase()}" + + props.add(registry.register(name) { BlockItem(anvils[i], DEFAULT_PROPERTIES) }) + } + + map[color] = SupplierList(props) } - TRITANIUM_ANVIL = SupplierList(props) + TRITANIUM_ANVIL = Collections.unmodifiableMap(map) } object MachineUpgrades { diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/black.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/black.png new file mode 100644 index 000000000..a6dd1f1da Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/black.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/blue.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/blue.png new file mode 100644 index 000000000..fad142c26 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/blue.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/brown.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/brown.png new file mode 100644 index 000000000..20cb5f0a6 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/brown.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/cyan.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/cyan.png new file mode 100644 index 000000000..85e64952e Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/cyan.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/gray.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/gray.png new file mode 100644 index 000000000..581eec2eb Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/gray.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/green.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/green.png new file mode 100644 index 000000000..d15dfc3e3 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/green.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/light_blue.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/light_blue.png new file mode 100644 index 000000000..491a69c82 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/light_blue.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/light_gray.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/light_gray.png new file mode 100644 index 000000000..80b95ccf3 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/light_gray.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/lime.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/lime.png new file mode 100644 index 000000000..442c3e811 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/lime.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/magenta.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/magenta.png new file mode 100644 index 000000000..e74fcf695 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/magenta.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/orange.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/orange.png new file mode 100644 index 000000000..9a5a126a7 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/orange.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/pink.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/pink.png new file mode 100644 index 000000000..2229c7459 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/pink.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/purple.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/purple.png new file mode 100644 index 000000000..5b4560c56 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/purple.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/red.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/red.png new file mode 100644 index 000000000..80018cdd4 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/red.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/white.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/white.png new file mode 100644 index 000000000..ff03be6a2 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/white.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/yellow.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/yellow.png new file mode 100644 index 000000000..4b19a8f35 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil/yellow.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_mask.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_mask.png new file mode 100644 index 000000000..58ef54614 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_mask.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/black.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/black.png new file mode 100644 index 000000000..e13043426 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/black.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/blue.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/blue.png new file mode 100644 index 000000000..83a63f9be Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/blue.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/brown.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/brown.png new file mode 100644 index 000000000..fe0d644c7 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/brown.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/cyan.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/cyan.png new file mode 100644 index 000000000..a7401b5bc Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/cyan.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/gray.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/gray.png new file mode 100644 index 000000000..445c858a2 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/gray.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/green.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/green.png new file mode 100644 index 000000000..025ee85f1 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/green.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/light_blue.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/light_blue.png new file mode 100644 index 000000000..f512fa17e Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/light_blue.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/light_gray.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/light_gray.png new file mode 100644 index 000000000..c29cee492 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/light_gray.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/lime.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/lime.png new file mode 100644 index 000000000..cec05566d Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/lime.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/magenta.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/magenta.png new file mode 100644 index 000000000..c6076db16 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/magenta.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/orange.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/orange.png new file mode 100644 index 000000000..0fc5f33f9 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/orange.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/pink.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/pink.png new file mode 100644 index 000000000..6e447483c Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/pink.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/purple.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/purple.png new file mode 100644 index 000000000..acb6b026a Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/purple.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/red.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/red.png new file mode 100644 index 000000000..1192ec48b Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/red.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/white.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/white.png new file mode 100644 index 000000000..505468cc3 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/white.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/yellow.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/yellow.png new file mode 100644 index 000000000..9e7b9700d Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top/yellow.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top_mask.png b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top_mask.png new file mode 100644 index 000000000..d8a3edca2 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/tritanium_anvil_top_mask.png differ