Fixes #177
This commit is contained in:
DBotThePony 2022-11-27 13:02:08 +07:00
parent 83ce1e28f2
commit 0b31085dc6
Signed by: DBot
GPG Key ID: DCC23B5715498507
26 changed files with 42 additions and 13 deletions

View File

@ -1,6 +1,7 @@
package ru.dbotthepony.mc.otm.datagen package ru.dbotthepony.mc.otm.datagen
import net.minecraft.resources.ResourceLocation import net.minecraft.resources.ResourceLocation
import net.minecraft.world.item.DyeColor
import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.DoorBlock import net.minecraft.world.level.block.DoorBlock
import net.minecraft.world.level.block.IronBarsBlock import net.minecraft.world.level.block.IronBarsBlock
@ -440,7 +441,11 @@ object DataGen {
for ((color, door) in MBlocks.TRITANIUM_DOOR) 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" } ?: ""}")) 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[null]!!, modLocation("block/decorative/tritanium_trapdoor"))
for (color in DyeColor.values())
trapdoor(MBlocks.TRITANIUM_TRAPDOOR[color]!!, modLocation("block/decorative/tritanium_trapdoor_${color.name.lowercase()}"))
addBlockModels(blockModelProvider) addBlockModels(blockModelProvider)
addDecorativeData(blockStateProvider, itemModelProvider, blockModelProvider) addDecorativeData(blockStateProvider, itemModelProvider, blockModelProvider)

View File

@ -1,6 +1,7 @@
package ru.dbotthepony.mc.otm.datagen.items package ru.dbotthepony.mc.otm.datagen.items
import net.minecraft.resources.ResourceLocation import net.minecraft.resources.ResourceLocation
import net.minecraft.world.item.DyeColor
import ru.dbotthepony.mc.otm.core.registryName import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.datagen.DataGen import ru.dbotthepony.mc.otm.datagen.DataGen
import ru.dbotthepony.mc.otm.datagen.modLocation import ru.dbotthepony.mc.otm.datagen.modLocation
@ -96,7 +97,11 @@ fun addItemModels(provider: MatteryItemModelProvider) {
provider.generated(MItems.MATTER_DUST) provider.generated(MItems.MATTER_DUST)
provider.generated(MItems.TRITANIUM_DOOR.values) provider.generated(MItems.TRITANIUM_DOOR.values)
provider.block(MItems.TRITANIUM_TRAPDOOR, "tritanium_trapdoor_bottom")
provider.block(MItems.TRITANIUM_TRAPDOOR[null]!!, "tritanium_trapdoor_bottom")
for (color in DyeColor.values())
provider.block(MItems.TRITANIUM_TRAPDOOR[color]!!, "tritanium_trapdoor_${color.name.lowercase()}_bottom")
for (item in MRegistry.CARGO_CRATES.allItems.values) { for (item in MRegistry.CARGO_CRATES.allItems.values) {
provider.block(item, "${item.registryName!!.path}_closed") provider.block(item, "${item.registryName!!.path}_closed")

View File

@ -34,6 +34,11 @@ private fun decoratives(provider: MatteryLanguageProvider) {
add(MBlocks.TRITANIUM_DOOR[color]!!, "description0", "High blast resistance door with redstone latch...") 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]!!, "description1", "...feeling safe now?")
add(MBlocks.TRITANIUM_DOOR[color]!!, "description2", "This one is painted $name") add(MBlocks.TRITANIUM_DOOR[color]!!, "description2", "This one is painted $name")
add(MBlocks.TRITANIUM_TRAPDOOR[color]!!, "$name Tritanium Trapdoor")
add(MBlocks.TRITANIUM_TRAPDOOR[color]!!, "description0", "High blast resistance door with redstone latch...")
add(MBlocks.TRITANIUM_TRAPDOOR[color]!!, "description1", "...feeling safe now?")
add(MBlocks.TRITANIUM_TRAPDOOR[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")
@ -418,9 +423,9 @@ private fun blocks(provider: MatteryLanguageProvider) {
add(MBlocks.TRITANIUM_DOOR[null]!!, "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[null]!!, "description1", "...feeling safe now?") add(MBlocks.TRITANIUM_DOOR[null]!!, "description1", "...feeling safe now?")
add(MBlocks.TRITANIUM_TRAPDOOR, "Tritanium Trapdoor") add(MBlocks.TRITANIUM_TRAPDOOR[null]!!, "Tritanium Trapdoor")
add(MBlocks.TRITANIUM_TRAPDOOR, "description0", "High blast resistance door with redstone latch...") add(MBlocks.TRITANIUM_TRAPDOOR[null]!!, "description0", "High blast resistance door with redstone latch...")
add(MBlocks.TRITANIUM_TRAPDOOR, "description1", "...feeling safe now?") add(MBlocks.TRITANIUM_TRAPDOOR[null]!!, "description1", "...feeling safe now?")
} }
} }

View File

@ -58,7 +58,9 @@ fun addLootTables(lootTables: LootTables) {
lootTables.dropsSelf(MBlocks.METAL_BEAM) { condition(ExplosionCondition.survivesExplosion()) } lootTables.dropsSelf(MBlocks.METAL_BEAM) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.TRITANIUM_INGOT_BLOCK) { condition(ExplosionCondition.survivesExplosion()) } lootTables.dropsSelf(MBlocks.TRITANIUM_INGOT_BLOCK) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.TRITANIUM_TRAPDOOR) { condition(ExplosionCondition.survivesExplosion()) } for (door in MBlocks.TRITANIUM_TRAPDOOR.values)
lootTables.dropsSelf(door) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.TRITANIUM_PRESSURE_PLATE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } lootTables.dropsSelf(MRegistry.TRITANIUM_PRESSURE_PLATE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.block(MBlocks.PHANTOM_ATTRACTOR) { lootTables.block(MBlocks.PHANTOM_ATTRACTOR) {

View File

@ -288,12 +288,20 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: Consumer<Fi
.save(consumer) .save(consumer)
} }
MatteryRecipe(MBlocks.TRITANIUM_TRAPDOOR) MatteryRecipe(MBlocks.TRITANIUM_TRAPDOOR[null]!!)
.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_TRAPDOOR[color]!!, 1)
.requires(Ingredient.of(MItems.TRITANIUM_TRAPDOOR.entries.stream().filter { it.key != color }.map { ItemStack(it.value) }))
.requires(color.tag)
.unlockedBy(MItems.TRITANIUM_TRAPDOOR.entries.stream().filter { it.key != color }.map { it.value })
.save(consumer)
}
MatteryRecipe(MRegistry.TRITANIUM_PRESSURE_PLATE.item) MatteryRecipe(MRegistry.TRITANIUM_PRESSURE_PLATE.item)
.row(MItemTags.TRITANIUM_PLATES, MItemTags.BASIC_CIRCUIT, MItemTags.TRITANIUM_PLATES) .row(MItemTags.TRITANIUM_PLATES, MItemTags.BASIC_CIRCUIT, MItemTags.TRITANIUM_PLATES)
.unlockedBy(MItemTags.TRITANIUM_PLATES) .unlockedBy(MItemTags.TRITANIUM_PLATES)

View File

@ -74,8 +74,8 @@ fun addTags(tagsProvider: TagsProvider) {
tagsProvider.items.appender(ItemTags.DOORS).add(MItems.TRITANIUM_DOOR.values) tagsProvider.items.appender(ItemTags.DOORS).add(MItems.TRITANIUM_DOOR.values)
tagsProvider.blocks.appender(BlockTags.DOORS).add(MBlocks.TRITANIUM_DOOR.values) 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.values)
tagsProvider.blocks.appender(BlockTags.TRAPDOORS).add(MBlocks.TRITANIUM_TRAPDOOR) tagsProvider.blocks.appender(BlockTags.TRAPDOORS).add(MBlocks.TRITANIUM_TRAPDOOR.values)
tagsProvider.blocks.appender(BlockTags.PRESSURE_PLATES).add(MRegistry.TRITANIUM_PRESSURE_PLATE.allBlocks.values) tagsProvider.blocks.appender(BlockTags.PRESSURE_PLATES).add(MRegistry.TRITANIUM_PRESSURE_PLATE.allBlocks.values)
@ -111,6 +111,7 @@ fun addTags(tagsProvider: TagsProvider) {
.add(MItems.TRITANIUM_STRIPED_WALL) .add(MItems.TRITANIUM_STRIPED_WALL)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_DOOR.values, Tiers.IRON) tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_DOOR.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_TRAPDOOR.values, Tiers.IRON)
tagsProvider.requiresPickaxe(listOf( tagsProvider.requiresPickaxe(listOf(
MBlocks.ANDROID_STATION, MBlocks.ANDROID_STATION,
@ -139,7 +140,6 @@ fun addTags(tagsProvider: TagsProvider) {
MBlocks.PHANTOM_ATTRACTOR, MBlocks.PHANTOM_ATTRACTOR,
MBlocks.ENERGY_SERVO, MBlocks.ENERGY_SERVO,
MBlocks.TRITANIUM_TRAPDOOR,
MBlocks.TRITANIUM_INGOT_BLOCK, MBlocks.TRITANIUM_INGOT_BLOCK,
), Tiers.IRON) ), Tiers.IRON)

View File

@ -147,8 +147,8 @@ object MBlocks {
} }
} }
val TRITANIUM_TRAPDOOR: Block by registry.register(MNames.TRITANIUM_TRAPDOOR) { val TRITANIUM_TRAPDOOR = registry.allColored(MNames.TRITANIUM_TRAPDOOR) { color, _ ->
object : TrapDoorBlock(Properties.of(Material.METAL, DyeColor.LIGHT_BLUE).explosionResistance(80f).noOcclusion().destroyTime(3f).requiresCorrectToolForDrops()) { object : TrapDoorBlock(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?,
@ -158,6 +158,10 @@ 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))
}
} }
} } } }

View File

@ -234,7 +234,7 @@ object MItems {
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 = registry.allColored(MNames.TRITANIUM_DOOR) { color, _ -> DoubleHighBlockItem(MBlocks.TRITANIUM_DOOR[color]!!, 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 = registry.allColored(MNames.TRITANIUM_TRAPDOOR) { color, _ -> BlockItem(MBlocks.TRITANIUM_TRAPDOOR[color]!!, DEFAULT_PROPERTIES_DECORATIVE) }
init { init {
MRegistry.TRITANIUM_PRESSURE_PLATE.registerItems(registry) MRegistry.TRITANIUM_PRESSURE_PLATE.registerItems(registry)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 901 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB