tritanium d00r, painted

related to 
This commit is contained in:
DBotThePony 2022-11-27 00:16:11 +07:00
parent f52fc4eb84
commit 2e55e256d6
Signed by: DBot
GPG Key ID: DCC23B5715498507
61 changed files with 109 additions and 19 deletions
color_doors.jscolorizer.js
src
data/kotlin/ru/dbotthepony/mc/otm/datagen
main
kotlin/ru/dbotthepony/mc/otm/registry
resources/assets/overdrive_that_matters/textures

56
color_doors.js Normal file
View File

@ -0,0 +1,56 @@
'use strict';
const fs = require('fs')
const root_main = './src/main/resources/assets/overdrive_that_matters/textures/block/decorative/'
const child_process = require('child_process')
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]],
['white', [235, 235, 235]],
]
process.stderr.setMaxListeners(40)
process.stdout.setMaxListeners(40);
(async function() {
for (const [base, overlay, nameBase] of [['tritanium_door_base_top', 'tritanium_door_color_top', 'tritanium_door_top'], ['tritanium_door_base_bottom', 'tritanium_door_color_bottom', 'tritanium_door_bottom']]) {
for (const [name, rgb] of colors) {
const magick = child_process.spawn('magick', [
'convert',
`${root_main}${base}.png`,
'(',
`${root_main}${overlay}.png`,
'-size', '16x16',
`xc:rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`,
'-channel', 'rgb',
'-compose', 'Multiply',
'-composite',
')',
'-compose', 'Over',
'-composite',
`${root_main}/${nameBase}_${name}.png`])
magick.stdout.pipe(process.stdout)
magick.stderr.pipe(process.stderr)
}
}
})()

View File

@ -70,6 +70,11 @@ async function size(path) {
const splitted = texture.split('/') const splitted = texture.split('/')
const last = splitted.pop() const last = splitted.pop()
if (last.indexOf('_white') == -1) {
colors.push(['white', [235, 235, 235]])
}
const combined = splitted.join('/') const combined = splitted.join('/')
const basedir = `${root_main}${combined}` const basedir = `${root_main}${combined}`
@ -107,6 +112,11 @@ async function size(path) {
const splitted = textureColor.split('/') const splitted = textureColor.split('/')
const last = splitted.pop() const last = splitted.pop()
if (last.indexOf('_white') == -1) {
colors.push(['white', [235, 235, 235]])
}
const combined = splitted.join('/') const combined = splitted.join('/')
const basedir = `${root_main}${combined}` const basedir = `${root_main}${combined}`

View File

@ -437,7 +437,9 @@ object DataGen {
AddEnglishLanguage(languageProvider) AddEnglishLanguage(languageProvider)
door(MBlocks.TRITANIUM_DOOR, modLocation("block/decorative/tritanium_door_top"), modLocation("block/decorative/tritanium_door_bottom")) for ((color, door) in MBlocks.TRITANIUM_DOOR)
door(door, modLocation("block/decorative/tritanium_door_top${color?.name?.lowercase()?.let { "_$it" } ?: ""}"), modLocation("block/decorative/tritanium_door_bottom${color?.name?.lowercase()?.let { "_$it" } ?: ""}"))
trapdoor(MBlocks.TRITANIUM_TRAPDOOR, modLocation("block/decorative/tritanium_trapdoor")) trapdoor(MBlocks.TRITANIUM_TRAPDOOR, modLocation("block/decorative/tritanium_trapdoor"))
addBlockModels(blockModelProvider) addBlockModels(blockModelProvider)

View File

@ -95,7 +95,7 @@ fun addItemModels(provider: MatteryItemModelProvider) {
provider.generated(MItems.MATTER_DUST) provider.generated(MItems.MATTER_DUST)
provider.generated(MItems.TRITANIUM_DOOR) provider.generated(MItems.TRITANIUM_DOOR.values)
provider.block(MItems.TRITANIUM_TRAPDOOR, "tritanium_trapdoor_bottom") provider.block(MItems.TRITANIUM_TRAPDOOR, "tritanium_trapdoor_bottom")
for (item in MRegistry.CARGO_CRATES.allItems.values) { for (item in MRegistry.CARGO_CRATES.allItems.values) {

View File

@ -29,6 +29,11 @@ private fun decoratives(provider: MatteryLanguageProvider) {
add(MRegistry.TRITANIUM_PRESSURE_PLATE.getBlock(color), "$name Tritanium Pressure Plate") add(MRegistry.TRITANIUM_PRESSURE_PLATE.getBlock(color), "$name Tritanium Pressure Plate")
add(MRegistry.TRITANIUM_PRESSURE_PLATE.getBlock(color), "description0", "Activates only if player steps on it") add(MRegistry.TRITANIUM_PRESSURE_PLATE.getBlock(color), "description0", "Activates only if player steps on it")
add(MRegistry.TRITANIUM_PRESSURE_PLATE.getBlock(color), "description1", "High blast resistance") add(MRegistry.TRITANIUM_PRESSURE_PLATE.getBlock(color), "description1", "High blast resistance")
add(MBlocks.TRITANIUM_DOOR[color]!!, "$name Tritanium Door")
add(MBlocks.TRITANIUM_DOOR[color]!!, "description0", "High blast resistance door with redstone latch...")
add(MBlocks.TRITANIUM_DOOR[color]!!, "description1", "...feeling safe now?")
add(MBlocks.TRITANIUM_DOOR[color]!!, "description2", "This one is painted $name")
} }
add(MRegistry.TRITANIUM_PRESSURE_PLATE.block, "Tritanium Pressure Plate") add(MRegistry.TRITANIUM_PRESSURE_PLATE.block, "Tritanium Pressure Plate")
@ -409,9 +414,9 @@ private fun blocks(provider: MatteryLanguageProvider) {
add(MBlocks.DANGER_STRIPE_BLOCK, "Danger Stripes") add(MBlocks.DANGER_STRIPE_BLOCK, "Danger Stripes")
add(MBlocks.METAL_BEAM, "Metal Beam") add(MBlocks.METAL_BEAM, "Metal Beam")
add(MBlocks.TRITANIUM_DOOR, "Tritanium Door") add(MBlocks.TRITANIUM_DOOR[null]!!, "Tritanium Door")
add(MBlocks.TRITANIUM_DOOR, "description0", "High blast resistance door with redstone latch...") add(MBlocks.TRITANIUM_DOOR[null]!!, "description0", "High blast resistance door with redstone latch...")
add(MBlocks.TRITANIUM_DOOR, "description1", "...feeling safe now?") add(MBlocks.TRITANIUM_DOOR[null]!!, "description1", "...feeling safe now?")
add(MBlocks.TRITANIUM_TRAPDOOR, "Tritanium Trapdoor") add(MBlocks.TRITANIUM_TRAPDOOR, "Tritanium Trapdoor")
add(MBlocks.TRITANIUM_TRAPDOOR, "description0", "High blast resistance door with redstone latch...") add(MBlocks.TRITANIUM_TRAPDOOR, "description0", "High blast resistance door with redstone latch...")

View File

@ -71,14 +71,16 @@ fun addLootTables(lootTables: LootTables) {
condition(ExplosionCondition.survivesExplosion()) condition(ExplosionCondition.survivesExplosion())
} }
lootTables.block(MBlocks.TRITANIUM_DOOR) { for (door in MBlocks.TRITANIUM_DOOR.values) {
item(MBlocks.TRITANIUM_DOOR) { lootTables.block(door) {
blockStateCondition(MBlocks.TRITANIUM_DOOR) { item(door) {
this[BlockStateProperties.DOUBLE_BLOCK_HALF] = DoubleBlockHalf.LOWER blockStateCondition(door) {
this[BlockStateProperties.DOUBLE_BLOCK_HALF] = DoubleBlockHalf.LOWER
}
} }
}
condition(ExplosionCondition.survivesExplosion()) condition(ExplosionCondition.survivesExplosion())
}
} }
lootTables.builder(LootContextParamSets.ADVANCEMENT_ENTITY, modLocation("research_all_android")) { lootTables.builder(LootContextParamSets.ADVANCEMENT_ENTITY, modLocation("research_all_android")) {

View File

@ -273,13 +273,21 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: Consumer<Fi
.unlockedBy(MItemTags.TRITANIUM_PLATES) .unlockedBy(MItemTags.TRITANIUM_PLATES)
.build(consumer) .build(consumer)
MatteryRecipe(MBlocks.TRITANIUM_DOOR, 3) MatteryRecipe(MBlocks.TRITANIUM_DOOR[null]!!, 3)
.rowAB(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES) .rowAB(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES)
.rowAB(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES) .rowAB(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES)
.rowAB(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES) .rowAB(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES)
.unlockedBy(MItemTags.TRITANIUM_PLATES) .unlockedBy(MItemTags.TRITANIUM_PLATES)
.build(consumer) .build(consumer)
for (color in DyeColor.values()) {
ShapelessRecipeBuilder.shapeless(MItems.TRITANIUM_DOOR[color]!!, 1)
.requires(Ingredient.of(MItems.TRITANIUM_DOOR.entries.stream().filter { it.key != color }.map { ItemStack(it.value) }))
.requires(color.tag)
.unlockedBy(MItems.TRITANIUM_DOOR.entries.stream().filter { it.key != color }.map { it.value })
.save(consumer)
}
MatteryRecipe(MBlocks.TRITANIUM_TRAPDOOR) MatteryRecipe(MBlocks.TRITANIUM_TRAPDOOR)
.rowAB(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES) .rowAB(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES)
.rowAB(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES) .rowAB(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES)

View File

@ -1,6 +1,7 @@
package ru.dbotthepony.mc.otm.datagen.recipes package ru.dbotthepony.mc.otm.datagen.recipes
import com.google.common.collect.ImmutableList
import net.minecraft.advancements.CriterionTriggerInstance import net.minecraft.advancements.CriterionTriggerInstance
import net.minecraft.data.recipes.FinishedRecipe import net.minecraft.data.recipes.FinishedRecipe
import net.minecraft.data.recipes.RecipeBuilder import net.minecraft.data.recipes.RecipeBuilder

View File

@ -71,8 +71,8 @@ fun addTags(tagsProvider: TagsProvider) {
tagsProvider.blocks.appender(MBlockTags.INDUSTRIAL_GLASS).add(MRegistry.INDUSTRIAL_GLASS.allBlocks.values) tagsProvider.blocks.appender(MBlockTags.INDUSTRIAL_GLASS).add(MRegistry.INDUSTRIAL_GLASS.allBlocks.values)
tagsProvider.blocks.appender(MBlockTags.CARGO_CRATES).add(MRegistry.CARGO_CRATES.allBlocks.values) tagsProvider.blocks.appender(MBlockTags.CARGO_CRATES).add(MRegistry.CARGO_CRATES.allBlocks.values)
tagsProvider.items.appender(ItemTags.DOORS).add(MItems.TRITANIUM_DOOR) tagsProvider.items.appender(ItemTags.DOORS).add(MItems.TRITANIUM_DOOR.values)
tagsProvider.blocks.appender(BlockTags.DOORS).add(MBlocks.TRITANIUM_DOOR) tagsProvider.blocks.appender(BlockTags.DOORS).add(MBlocks.TRITANIUM_DOOR.values)
tagsProvider.items.appender(ItemTags.TRAPDOORS).add(MItems.TRITANIUM_TRAPDOOR) tagsProvider.items.appender(ItemTags.TRAPDOORS).add(MItems.TRITANIUM_TRAPDOOR)
tagsProvider.blocks.appender(BlockTags.TRAPDOORS).add(MBlocks.TRITANIUM_TRAPDOOR) tagsProvider.blocks.appender(BlockTags.TRAPDOORS).add(MBlocks.TRITANIUM_TRAPDOOR)
@ -110,6 +110,8 @@ fun addTags(tagsProvider: TagsProvider) {
.add(MRegistry.TRITANIUM_STRIPED_WALL.flatItems) .add(MRegistry.TRITANIUM_STRIPED_WALL.flatItems)
.add(MItems.TRITANIUM_STRIPED_WALL) .add(MItems.TRITANIUM_STRIPED_WALL)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_DOOR.values, Tiers.IRON)
tagsProvider.requiresPickaxe(listOf( tagsProvider.requiresPickaxe(listOf(
MBlocks.ANDROID_STATION, MBlocks.ANDROID_STATION,
MBlocks.BATTERY_BANK, MBlocks.BATTERY_BANK,
@ -137,7 +139,6 @@ fun addTags(tagsProvider: TagsProvider) {
MBlocks.PHANTOM_ATTRACTOR, MBlocks.PHANTOM_ATTRACTOR,
MBlocks.ENERGY_SERVO, MBlocks.ENERGY_SERVO,
MBlocks.TRITANIUM_DOOR,
MBlocks.TRITANIUM_TRAPDOOR, MBlocks.TRITANIUM_TRAPDOOR,
MBlocks.TRITANIUM_INGOT_BLOCK, MBlocks.TRITANIUM_INGOT_BLOCK,
), Tiers.IRON) ), Tiers.IRON)

View File

@ -128,8 +128,8 @@ object MBlocks {
val DANGER_STRIPE_BLOCK: Block by registry.register(MNames.DANGER_STRIPE_BLOCK) { Block(BlockBehaviour.Properties.of(Material.METAL, DyeColor.GRAY).explosionResistance(6f).destroyTime(1.5f).requiresCorrectToolForDrops()) } val DANGER_STRIPE_BLOCK: Block by registry.register(MNames.DANGER_STRIPE_BLOCK) { Block(BlockBehaviour.Properties.of(Material.METAL, DyeColor.GRAY).explosionResistance(6f).destroyTime(1.5f).requiresCorrectToolForDrops()) }
val METAL_BEAM: Block by registry.register(MNames.METAL_BEAM) { Block(BlockBehaviour.Properties.of(Material.METAL, DyeColor.GRAY).explosionResistance(14f).destroyTime(2.5f).requiresCorrectToolForDrops()) } val METAL_BEAM: Block by registry.register(MNames.METAL_BEAM) { Block(BlockBehaviour.Properties.of(Material.METAL, DyeColor.GRAY).explosionResistance(14f).destroyTime(2.5f).requiresCorrectToolForDrops()) }
val TRITANIUM_DOOR: Block by registry.register(MNames.TRITANIUM_DOOR) { val TRITANIUM_DOOR = registry.allColored(MNames.TRITANIUM_DOOR) { color, _ ->
object : DoorBlock(Properties.of(Material.METAL, DyeColor.LIGHT_BLUE).explosionResistance(80f).noOcclusion().destroyTime(3f).requiresCorrectToolForDrops()) { object : DoorBlock(Properties.of(Material.METAL, color ?: DyeColor.LIGHT_BLUE).explosionResistance(80f).noOcclusion().destroyTime(3f).requiresCorrectToolForDrops()) {
override fun appendHoverText( override fun appendHoverText(
p_49816_: ItemStack, p_49816_: ItemStack,
p_49817_: BlockGetter?, p_49817_: BlockGetter?,
@ -139,8 +139,13 @@ object MBlocks {
super.appendHoverText(p_49816_, p_49817_, p_49818_, p_49819_) super.appendHoverText(p_49816_, p_49817_, p_49818_, p_49819_)
p_49818_.add(TranslatableComponent("$descriptionId.description0").withStyle(ChatFormatting.DARK_GRAY)) p_49818_.add(TranslatableComponent("$descriptionId.description0").withStyle(ChatFormatting.DARK_GRAY))
p_49818_.add(TranslatableComponent("$descriptionId.description1").withStyle(ChatFormatting.DARK_GRAY)) p_49818_.add(TranslatableComponent("$descriptionId.description1").withStyle(ChatFormatting.DARK_GRAY))
if (color != null) {
p_49818_.add(TranslatableComponent("$descriptionId.description2").withStyle(ChatFormatting.DARK_GRAY))
}
} }
} } }
}
val TRITANIUM_TRAPDOOR: Block by registry.register(MNames.TRITANIUM_TRAPDOOR) { val TRITANIUM_TRAPDOOR: Block by registry.register(MNames.TRITANIUM_TRAPDOOR) {
object : TrapDoorBlock(Properties.of(Material.METAL, DyeColor.LIGHT_BLUE).explosionResistance(80f).noOcclusion().destroyTime(3f).requiresCorrectToolForDrops()) { object : TrapDoorBlock(Properties.of(Material.METAL, DyeColor.LIGHT_BLUE).explosionResistance(80f).noOcclusion().destroyTime(3f).requiresCorrectToolForDrops()) {

View File

@ -233,7 +233,7 @@ object MItems {
val DANGER_STRIPE_BLOCK: Item by registry.register(MNames.DANGER_STRIPE_BLOCK) { BlockItem(MBlocks.DANGER_STRIPE_BLOCK, DEFAULT_PROPERTIES_DECORATIVE) } val DANGER_STRIPE_BLOCK: Item by registry.register(MNames.DANGER_STRIPE_BLOCK) { BlockItem(MBlocks.DANGER_STRIPE_BLOCK, DEFAULT_PROPERTIES_DECORATIVE) }
val METAL_BEAM: Item by registry.register(MNames.METAL_BEAM) { BlockItem(MBlocks.METAL_BEAM, DEFAULT_PROPERTIES_DECORATIVE) } val METAL_BEAM: Item by registry.register(MNames.METAL_BEAM) { BlockItem(MBlocks.METAL_BEAM, DEFAULT_PROPERTIES_DECORATIVE) }
val TRITANIUM_DOOR: Item by registry.register(MNames.TRITANIUM_DOOR) { DoubleHighBlockItem(MBlocks.TRITANIUM_DOOR, DEFAULT_PROPERTIES_DECORATIVE) } val TRITANIUM_DOOR = registry.allColored(MNames.TRITANIUM_DOOR) { color, _ -> DoubleHighBlockItem(MBlocks.TRITANIUM_DOOR[color]!!, DEFAULT_PROPERTIES_DECORATIVE) }
val TRITANIUM_TRAPDOOR: Item by registry.register(MNames.TRITANIUM_TRAPDOOR) { BlockItem(MBlocks.TRITANIUM_TRAPDOOR, DEFAULT_PROPERTIES_DECORATIVE) } val TRITANIUM_TRAPDOOR: Item by registry.register(MNames.TRITANIUM_TRAPDOOR) { BlockItem(MBlocks.TRITANIUM_TRAPDOOR, DEFAULT_PROPERTIES_DECORATIVE) }
init { init {

Binary file not shown.

After

(image error) Size: 1.4 KiB

Binary file not shown.

After

(image error) Size: 1.4 KiB

Binary file not shown.

After

(image error) Size: 1.4 KiB

Binary file not shown.

After

(image error) Size: 643 B

Binary file not shown.

After

(image error) Size: 1.4 KiB

Binary file not shown.

After

(image error) Size: 1.4 KiB

Binary file not shown.

After

(image error) Size: 1.4 KiB

Binary file not shown.

After

(image error) Size: 1.4 KiB

Binary file not shown.

After

(image error) Size: 1.4 KiB

Binary file not shown.

After

(image error) Size: 1.4 KiB

Binary file not shown.

After

(image error) Size: 1.4 KiB

Binary file not shown.

After

(image error) Size: 1.4 KiB

Binary file not shown.

After

(image error) Size: 645 B

Binary file not shown.

After

(image error) Size: 1.4 KiB

Binary file not shown.

After

(image error) Size: 1.4 KiB

Binary file not shown.

After

(image error) Size: 1.4 KiB

Binary file not shown.

After

(image error) Size: 966 B

Binary file not shown.

After

(image error) Size: 1.4 KiB