From 2e86f2b5996c111bb887d25a688e904b8bde288f Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sun, 25 Sep 2022 22:36:37 +0700 Subject: [PATCH] Lab lamp recipe, hardened glass tags --- .../ru/dbotthepony/mc/otm/datagen/DataGen.kt | 2 + .../mc/otm/datagen/lang/English.kt | 4 ++ .../mc/otm/datagen/recipes/BlastingRecipes.kt | 11 +++++ .../datagen/recipes/CraftingTableRecipes.kt | 15 ++++++- .../mc/otm/datagen/recipes/MatteryRecipe.kt | 10 +---- .../datagen/recipes/MatteryRecipeProvider.kt | 11 +++++ .../dbotthepony/mc/otm/datagen/tags/Tags.kt | 23 +++++++++++ .../ru/dbotthepony/mc/otm/ServerConfig.kt | 4 ++ .../mc/otm/block/LaboratoryLamp.kt | 22 ++++++++-- .../ru/dbotthepony/mc/otm/registry/MItems.kt | 14 +++++++ .../ru/dbotthepony/mc/otm/registry/Tags.kt | 39 ++++++++++++++++++ .../objects/ColoredDecorativeBlock.kt | 39 ++++++++++++++++++ .../textures/item/component/mirror.png | Bin 0 -> 2437 bytes .../item/component/mirror_compound.png | Bin 0 -> 2437 bytes 14 files changed, 180 insertions(+), 14 deletions(-) create mode 100644 src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/BlastingRecipes.kt create mode 100644 src/main/resources/assets/overdrive_that_matters/textures/item/component/mirror.png create mode 100644 src/main/resources/assets/overdrive_that_matters/textures/item/component/mirror_compound.png 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 e0d531013..59daf53fe 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt @@ -31,6 +31,7 @@ import ru.dbotthepony.mc.otm.datagen.lang.MatteryLanguageProvider import ru.dbotthepony.mc.otm.datagen.loot.addLootModifiers import ru.dbotthepony.mc.otm.datagen.loot.addLootTables import ru.dbotthepony.mc.otm.datagen.models.MatteryModelBuilder +import ru.dbotthepony.mc.otm.datagen.recipes.addBlastingRecipes import ru.dbotthepony.mc.otm.datagen.recipes.addCraftingTableRecipes import ru.dbotthepony.mc.otm.datagen.recipes.addDecorativesRecipes import ru.dbotthepony.mc.otm.datagen.recipes.addPlatePressRecipes @@ -269,6 +270,7 @@ object DataGen { recipeProvider.exec { _, consumer -> addCraftingTableRecipes(consumer) + addBlastingRecipes(consumer) addDecorativesRecipes(recipeProvider, consumer) } 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 3dde05b1a..59d397dd4 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 @@ -339,6 +339,7 @@ private fun blocks(provider: MatteryLanguageProvider) { add(MBlocks.PHANTOM_ATTRACTOR, "desc2", "Requires no power to operate") add(MBlocks.LABORATORY_LAMP, "Laboratory Lamp") + add(MBlocks.LABORATORY_LAMP, "description", "Provides directional light with redstone switch") add(MBlocks.LABORATORY_LAMP_INVERTED, "Laboratory Lamp (Inverted Signal)") add(MBlocks.DANGER_STRIPE_BLOCK, "Danger Stripes") add(MBlocks.METAL_BEAM, "Metal Beam") @@ -401,6 +402,9 @@ private fun items(provider: MatteryLanguageProvider) { add(MItems.ADVANCED_CONTROL_CIRCUIT, "Advanced Control Circuit") add(MItems.QUANTUM_TRANSCEIVER, "Quantum Transceiver") add(MItems.ELECTROMAGNET, "Electromagnet") + add(MItems.MIRROR_COMPOUND, "Mirror Compound") + add(MItems.MIRROR, "Mirror") + add(MItems.MIRROR, "description", "You can clearly see your reflection in this thing") add(MItems.GRAVITATIONAL_DISRUPTOR, "Gravitational Disruptor") diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/BlastingRecipes.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/BlastingRecipes.kt new file mode 100644 index 000000000..e4ffb9101 --- /dev/null +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/BlastingRecipes.kt @@ -0,0 +1,11 @@ +package ru.dbotthepony.mc.otm.datagen.recipes + +import net.minecraft.data.recipes.FinishedRecipe +import net.minecraft.data.recipes.SimpleCookingRecipeBuilder +import net.minecraft.world.item.crafting.Ingredient +import ru.dbotthepony.mc.otm.registry.MItems +import java.util.function.Consumer + +fun addBlastingRecipes(consumer: Consumer) { + SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItems.MIRROR_COMPOUND), MItems.MIRROR, 0.1f, 100).unlockedBy(MItems.MIRROR_COMPOUND).save(consumer) +} diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/CraftingTableRecipes.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/CraftingTableRecipes.kt index 830c70d51..aa8d6851b 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/CraftingTableRecipes.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/CraftingTableRecipes.kt @@ -155,7 +155,14 @@ fun addCraftingTableRecipes(consumer: Consumer) { MatteryRecipe(MItems.ENERGY_SERVO) .row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES) .row(MItemTags.TRITANIUM_PLATES, MItems.ENERGY_BUS, MItemTags.TRITANIUM_PLATES) - .unlockedBy(Tags.Items.ENDER_PEARLS) + .unlockedBy(MItems.ENERGY_BUS) + .build(consumer) + + MatteryRecipe(MItems.MIRROR_COMPOUND, 3) + .row(Tags.Items.GLASS_PANES_COLORLESS, Tags.Items.GLASS_PANES_COLORLESS, Tags.Items.GLASS_PANES_COLORLESS) + .row(MItemTags.IRON_PLATES, MItemTags.IRON_PLATES, MItemTags.IRON_PLATES) + .unlockedBy(MItemTags.IRON_PLATES) + .unlockedBy(Tags.Items.GLASS_PANES_COLORLESS) .build(consumer) // броня @@ -237,4 +244,10 @@ fun addCraftingTableRecipes(consumer: Consumer) { .row(MItems.BATTERY_CAPACITOR, MItems.TRITANIUM_SWORD, MItemTags.ADVANCED_CIRCUIT) .unlockedBy(MItems.BATTERY_CAPACITOR) .buildEnergetic(consumer) + + MatteryRecipe(MItems.LABORATORY_LAMP) + .row(MItemTags.IRON_PLATES, MItemTags.HARDENED_GLASS_PANES_COLORLESS, MItemTags.IRON_PLATES) + .row(MItems.MIRROR, Items.GLOWSTONE, MItems.MIRROR) + .row(MItemTags.TRITANIUM_PLATES, Tags.Items.DUSTS_REDSTONE, MItemTags.TRITANIUM_PLATES) + .build(consumer) } diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/MatteryRecipe.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/MatteryRecipe.kt index 2f7c4ad6d..f16e148aa 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/MatteryRecipe.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/MatteryRecipe.kt @@ -3,6 +3,7 @@ package ru.dbotthepony.mc.otm.datagen.recipes import net.minecraft.advancements.CriterionTriggerInstance import net.minecraft.data.recipes.FinishedRecipe +import net.minecraft.data.recipes.RecipeBuilder import net.minecraft.data.recipes.ShapedRecipeBuilder import net.minecraft.data.recipes.ShapelessRecipeBuilder import net.minecraft.resources.ResourceLocation @@ -49,15 +50,6 @@ private data class RecipeRow( val c: RecipeCell?, ) -fun ShapelessRecipeBuilder.unlockedBy(item: ItemLike): ShapelessRecipeBuilder { - val location = item.asItem().registryName!! - return unlockedBy("has_${location.namespace}_${location.path}", has(item)) -} - -fun ShapelessRecipeBuilder.unlockedBy(item: TagKey): ShapelessRecipeBuilder { - return unlockedBy("has_${item.location.namespace}_${item.location.path}", has(item)) -} - /** * [ShapedRecipeBuilder] that doesn't suck */ diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/MatteryRecipeProvider.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/MatteryRecipeProvider.kt index a115404d4..fb57bb1ef 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/MatteryRecipeProvider.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/MatteryRecipeProvider.kt @@ -6,12 +6,14 @@ import net.minecraft.advancements.critereon.ItemPredicate import net.minecraft.advancements.critereon.MinMaxBounds import net.minecraft.data.DataGenerator import net.minecraft.data.recipes.FinishedRecipe +import net.minecraft.data.recipes.RecipeBuilder import net.minecraft.data.recipes.RecipeProvider import net.minecraft.resources.ResourceLocation import net.minecraft.tags.TagKey import net.minecraft.world.item.Item import net.minecraft.world.item.crafting.Ingredient import net.minecraft.world.level.ItemLike +import ru.dbotthepony.mc.otm.core.registryName import ru.dbotthepony.mc.otm.datagen.DataGen import ru.dbotthepony.mc.otm.recipe.PlatePressRecipe import java.util.LinkedList @@ -41,6 +43,15 @@ fun inventoryTrigger(vararg p_126012_: ItemPredicate): InventoryChangeTrigger.Tr ) } +fun RecipeBuilder.unlockedBy(item: ItemLike): RecipeBuilder { + val location = item.asItem().registryName!! + return unlockedBy("has_${location.namespace}_${location.path}", has(item)) +} + +fun RecipeBuilder.unlockedBy(item: TagKey): RecipeBuilder { + return unlockedBy("has_${item.location.namespace}_${item.location.path}", has(item)) +} + class MatteryRecipeProvider(generatorIn: DataGenerator) : RecipeProvider(generatorIn) { private val callbacks = LinkedList() 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 906ef4d7b..bf22cafdb 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 @@ -1,6 +1,7 @@ package ru.dbotthepony.mc.otm.datagen.tags import net.minecraft.world.effect.MobEffects +import net.minecraft.world.item.DyeColor import net.minecraft.world.item.Items import net.minecraft.world.item.Tiers import ru.dbotthepony.mc.otm.registry.MBlocks @@ -31,6 +32,28 @@ fun addTags(tagsProvider: TagsProvider) { MBlocks.STORAGE_CABLE ) + tagsProvider.items.forge("hardened_glass").add(MRegistry.INDUSTRIAL_GLASS.allItems.values) + tagsProvider.items.forge("hardened_glass/colorless").add(MRegistry.INDUSTRIAL_GLASS.item) + tagsProvider.items.forge("hardened_glass/tinted").add(MRegistry.INDUSTRIAL_GLASS.items.values) + + tagsProvider.items.forge("hardened_glass_panes").add(MRegistry.INDUSTRIAL_GLASS_PANE.allItems.values) + tagsProvider.items.forge("hardened_glass_panes/colorless").add(MRegistry.INDUSTRIAL_GLASS_PANE.item) + tagsProvider.items.forge("hardened_glass_panes/tinted").add(MRegistry.INDUSTRIAL_GLASS_PANE.items.values) + + MRegistry.INDUSTRIAL_GLASS.forEachItem { s, _, item -> tagsProvider.items.forge("hardened_glass/$s").add(item) } + MRegistry.INDUSTRIAL_GLASS_PANE.forEachItem { s, _, item -> tagsProvider.items.forge("hardened_glass_panes/$s").add(item) } + + tagsProvider.blocks.forge("hardened_glass").add(MRegistry.INDUSTRIAL_GLASS.allBlocks.values) + tagsProvider.blocks.forge("hardened_glass/colorless").add(MRegistry.INDUSTRIAL_GLASS.block) + tagsProvider.blocks.forge("hardened_glass/tinted").add(MRegistry.INDUSTRIAL_GLASS.blocks.values) + + tagsProvider.blocks.forge("hardened_glass_panes").add(MRegistry.INDUSTRIAL_GLASS_PANE.allBlocks.values) + tagsProvider.blocks.forge("hardened_glass_panes/colorless").add(MRegistry.INDUSTRIAL_GLASS_PANE.block) + tagsProvider.blocks.forge("hardened_glass_panes/tinted").add(MRegistry.INDUSTRIAL_GLASS_PANE.blocks.values) + + MRegistry.INDUSTRIAL_GLASS.forEachBlock { s, _, block -> tagsProvider.blocks.forge("hardened_glass/$s").add(block) } + MRegistry.INDUSTRIAL_GLASS_PANE.forEachBlock { s, _, block -> tagsProvider.blocks.forge("hardened_glass_panes/$s").add(block) } + tagsProvider.requiresPickaxe(listOf( MBlocks.ANDROID_STATION, MBlocks.BATTERY_BANK, diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/ServerConfig.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/ServerConfig.kt index 7ca1fdd61..9e03be4bf 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/ServerConfig.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/ServerConfig.kt @@ -82,7 +82,11 @@ object ServerConfig { init { specBuilder.comment("Serverside config, holds shared values that are required to be read by both client and server.").push("server") + } + val LABORATORY_LAMP_LIGHT_LENGTH: Int by specBuilder.comment("In blocks").defineInRange("laboratoryLampLightLength", 3, 1, 128) + + init { specBuilder.comment("Energy batteries balance values").push("energyBatteries") } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/LaboratoryLamp.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/LaboratoryLamp.kt index 78801d672..3f99ea112 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/LaboratoryLamp.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/LaboratoryLamp.kt @@ -1,7 +1,11 @@ package ru.dbotthepony.mc.otm.block +import net.minecraft.ChatFormatting import net.minecraft.core.BlockPos +import net.minecraft.network.chat.Component +import net.minecraft.world.item.ItemStack import net.minecraft.world.item.Items +import net.minecraft.world.item.TooltipFlag import net.minecraft.world.item.context.BlockPlaceContext import net.minecraft.world.level.BlockGetter import net.minecraft.world.level.Level @@ -15,6 +19,8 @@ import net.minecraft.world.level.material.Material import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.Shapes import net.minecraft.world.phys.shapes.VoxelShape +import ru.dbotthepony.mc.otm.ServerConfig +import ru.dbotthepony.mc.otm.core.TranslatableComponent import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.core.plus import ru.dbotthepony.mc.otm.core.times @@ -22,8 +28,6 @@ import ru.dbotthepony.mc.otm.core.unaryMinus import ru.dbotthepony.mc.otm.once import ru.dbotthepony.mc.otm.registry.MBlocks -const val LIGHT_LENGTH = 3 - class LaboratoryLampLight : Block(Properties.of(Material.AIR).strength(-1.0F, 3600000.8F).noLootTable().noOcclusion().lightLevel { 15 }) { override fun createBlockStateDefinition(builder: StateDefinition.Builder) { super.createBlockStateDefinition(builder) @@ -72,7 +76,7 @@ class LaboratoryLampLight : Block(Properties.of(Material.AIR).strength(-1.0F, 36 var hit = false - for (i in 1 .. LIGHT_LENGTH) { + for (i in 1 .. ServerConfig.LABORATORY_LAMP_LIGHT_LENGTH) { val target = pos + facing * i val targetState = level.getBlockState(target) @@ -107,6 +111,16 @@ class LaboratoryLamp(val invertRedstone: Boolean) : Block(Properties.of(Material return super.getStateForPlacement(context)!!.setValue(BlockStateProperties.LIT, !invertRedstone).setValue(RotatableMatteryBlock.FACING_FULL, context.nearestLookingDirection) } + override fun appendHoverText( + p_49816_: ItemStack, + p_49817_: BlockGetter?, + p_49818_: MutableList, + p_49819_: TooltipFlag + ) { + super.appendHoverText(p_49816_, p_49817_, p_49818_, p_49819_) + p_49818_.add(TranslatableComponent("${MBlocks.LABORATORY_LAMP.descriptionId}.description").withStyle(ChatFormatting.GRAY)) + } + @Suppress("OVERRIDE_DEPRECATION") override fun onPlace( state: BlockState, @@ -144,7 +158,7 @@ class LaboratoryLamp(val invertRedstone: Boolean) : Block(Properties.of(Material val facing = state[RotatableMatteryBlock.FACING_FULL] - for (i in 1 .. LIGHT_LENGTH) { + for (i in 1 .. ServerConfig.LABORATORY_LAMP_LIGHT_LENGTH) { val target = pos + facing * i val targetState = level.getBlockState(target) 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 09c7a63db..79e4074a7 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItems.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItems.kt @@ -244,6 +244,18 @@ object MItems { val QUANTUM_TRANSCEIVER: Item by registry.register("quantum_transceiver") { Item(DEFAULT_PROPERTIES) } val ELECTROMAGNET: Item by registry.register("electromagnet") { Item(DEFAULT_PROPERTIES) } + val MIRROR_COMPOUND: Item by registry.register("mirror_compound") { Item(DEFAULT_PROPERTIES) } + val MIRROR: Item by registry.register("mirror") { object : Item(DEFAULT_PROPERTIES) { + override fun appendHoverText( + p_41421_: ItemStack, + p_41422_: Level?, + p_41423_: MutableList, + p_41424_: TooltipFlag + ) { + super.appendHoverText(p_41421_, p_41422_, p_41423_, p_41424_) + p_41423_.add(TranslatableComponent("$descriptionId.description").withStyle(ChatFormatting.DARK_GRAY)) + } + } } val DATAGEN_COMPONENTS = LazyList( { ENERGY_BUS }, @@ -261,6 +273,8 @@ object MItems { { MATTER_TRANSFORM_MATRIX }, { QUANTUM_TRANSCEIVER }, { ELECTROMAGNET }, + { MIRROR_COMPOUND }, + { MIRROR }, ) val EXOSUIT_PROBE: Item by registry.register(MNames.EXOSUIT_PROBE, ::ExoSuitProbeItem) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/Tags.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/Tags.kt index 5746e3d44..49008ff18 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/Tags.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/Tags.kt @@ -6,6 +6,7 @@ import net.minecraft.tags.TagKey import net.minecraft.world.item.Item import ru.dbotthepony.mc.otm.OverdriveThatMatters +@Suppress("unused") object MItemTags { val TRITANIUM_INGOTS: TagKey = ItemTags.create(ResourceLocation("forge", "ingots/tritanium")) val TRITANIUM_PLATES: TagKey = ItemTags.create(ResourceLocation("forge", "plates/tritanium")) @@ -21,4 +22,42 @@ object MItemTags { val GOLD_WIRES: TagKey = ItemTags.create(ResourceLocation("forge", "wires/gold")) val PISTONS: TagKey = ItemTags.create(ResourceLocation("forge", "pistons")) + + val HARDENED_GLASS_PANES: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass_panes")) + val HARDENED_GLASS_PANES_BLACK: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass_panes/black")) + val HARDENED_GLASS_PANES_BLUE: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass_panes/blue")) + val HARDENED_GLASS_PANES_BROWN: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass_panes/brown")) + val HARDENED_GLASS_PANES_COLORLESS: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass_panes/colorless")) + val HARDENED_GLASS_PANES_CYAN: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass_panes/cyan")) + val HARDENED_GLASS_PANES_GRAY: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass_panes/gray")) + val HARDENED_GLASS_PANES_GREEN: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass_panes/green")) + val HARDENED_GLASS_PANES_LIGHT_BLUE: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass_panes/light_blue")) + val HARDENED_GLASS_PANES_LIGHT_GRAY: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass_panes/light_gray")) + val HARDENED_GLASS_PANES_LIME: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass_panes/lime")) + val HARDENED_GLASS_PANES_MAGENTA: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass_panes/magenta")) + val HARDENED_GLASS_PANES_ORANGE: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass_panes/orange")) + val HARDENED_GLASS_PANES_PINK: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass_panes/pink")) + val HARDENED_GLASS_PANES_PURPLE: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass_panes/purple")) + val HARDENED_GLASS_PANES_RED: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass_panes/red")) + val HARDENED_GLASS_PANES_WHITE: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass_panes/white")) + val HARDENED_GLASS_PANES_YELLOW: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass_panes/yellow")) + + val HARDENED_GLASS: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass")) + val HARDENED_GLASS_BLACK: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass/black")) + val HARDENED_GLASS_BLUE: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass/blue")) + val HARDENED_GLASS_BROWN: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass/brown")) + val HARDENED_GLASS_COLORLESS: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass/colorless")) + val HARDENED_GLASS_CYAN: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass/cyan")) + val HARDENED_GLASS_GRAY: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass/gray")) + val HARDENED_GLASS_GREEN: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass/green")) + val HARDENED_GLASS_LIGHT_BLUE: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass/light_blue")) + val HARDENED_GLASS_LIGHT_GRAY: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass/light_gray")) + val HARDENED_GLASS_LIME: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass/lime")) + val HARDENED_GLASS_MAGENTA: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass/magenta")) + val HARDENED_GLASS_ORANGE: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass/orange")) + val HARDENED_GLASS_PINK: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass/pink")) + val HARDENED_GLASS_PURPLE: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass/purple")) + val HARDENED_GLASS_RED: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass/red")) + val HARDENED_GLASS_WHITE: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass/white")) + val HARDENED_GLASS_YELLOW: TagKey = ItemTags.create(ResourceLocation("forge", "hardened_glass/yellow")) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/ColoredDecorativeBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/ColoredDecorativeBlock.kt index ff2c6a960..066def2b7 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/ColoredDecorativeBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/ColoredDecorativeBlock.kt @@ -10,6 +10,7 @@ import net.minecraftforge.registries.DeferredRegister import net.minecraftforge.registries.RegistryObject import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.registry.LazyMap +import ru.dbotthepony.mc.otm.registry.MRegistry import java.util.EnumMap /** @@ -30,6 +31,44 @@ open class ColoredDecorativeBlock( protected val itemMap = EnumMap>(DyeColor::class.java) protected val blockMap = EnumMap>(DyeColor::class.java) + fun forEachItem(consumer: (String, DyeColor, Item) -> Unit) { + consumer.invoke("black", DyeColor.BLACK, getItem(DyeColor.BLACK)) + consumer.invoke("blue", DyeColor.BLUE, getItem(DyeColor.BLUE)) + consumer.invoke("brown", DyeColor.BROWN, getItem(DyeColor.BROWN)) + consumer.invoke("cyan", DyeColor.CYAN, getItem(DyeColor.CYAN)) + consumer.invoke("gray", DyeColor.GRAY, getItem(DyeColor.GRAY)) + consumer.invoke("green", DyeColor.GREEN, getItem(DyeColor.GREEN)) + consumer.invoke("light_blue", DyeColor.LIGHT_BLUE, getItem(DyeColor.LIGHT_BLUE)) + consumer.invoke("light_gray", DyeColor.LIGHT_GRAY, getItem(DyeColor.LIGHT_GRAY)) + consumer.invoke("lime", DyeColor.LIME, getItem(DyeColor.LIME)) + consumer.invoke("magenta", DyeColor.MAGENTA, getItem(DyeColor.MAGENTA)) + consumer.invoke("orange", DyeColor.ORANGE, getItem(DyeColor.ORANGE)) + consumer.invoke("pink", DyeColor.PINK, getItem(DyeColor.PINK)) + consumer.invoke("purple", DyeColor.PURPLE, getItem(DyeColor.PURPLE)) + consumer.invoke("red", DyeColor.RED, getItem(DyeColor.RED)) + consumer.invoke("white", DyeColor.WHITE, getItem(DyeColor.WHITE)) + consumer.invoke("yellow", DyeColor.YELLOW, getItem(DyeColor.YELLOW)) + } + + fun forEachBlock(consumer: (String, DyeColor, Block) -> Unit) { + consumer.invoke("black", DyeColor.BLACK, getBlock(DyeColor.BLACK)) + consumer.invoke("blue", DyeColor.BLUE, getBlock(DyeColor.BLUE)) + consumer.invoke("brown", DyeColor.BROWN, getBlock(DyeColor.BROWN)) + consumer.invoke("cyan", DyeColor.CYAN, getBlock(DyeColor.CYAN)) + consumer.invoke("gray", DyeColor.GRAY, getBlock(DyeColor.GRAY)) + consumer.invoke("green", DyeColor.GREEN, getBlock(DyeColor.GREEN)) + consumer.invoke("light_blue", DyeColor.LIGHT_BLUE, getBlock(DyeColor.LIGHT_BLUE)) + consumer.invoke("light_gray", DyeColor.LIGHT_GRAY, getBlock(DyeColor.LIGHT_GRAY)) + consumer.invoke("lime", DyeColor.LIME, getBlock(DyeColor.LIME)) + consumer.invoke("magenta", DyeColor.MAGENTA, getBlock(DyeColor.MAGENTA)) + consumer.invoke("orange", DyeColor.ORANGE, getBlock(DyeColor.ORANGE)) + consumer.invoke("pink", DyeColor.PINK, getBlock(DyeColor.PINK)) + consumer.invoke("purple", DyeColor.PURPLE, getBlock(DyeColor.PURPLE)) + consumer.invoke("red", DyeColor.RED, getBlock(DyeColor.RED)) + consumer.invoke("white", DyeColor.WHITE, getBlock(DyeColor.WHITE)) + consumer.invoke("yellow", DyeColor.YELLOW, getBlock(DyeColor.YELLOW)) + } + fun getItem(dyeColor: DyeColor): Item { check(registeredItems) { "Didn't register items yet" } return itemMap[dyeColor]!!.get() diff --git a/src/main/resources/assets/overdrive_that_matters/textures/item/component/mirror.png b/src/main/resources/assets/overdrive_that_matters/textures/item/component/mirror.png new file mode 100644 index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