Plate press coloring
@ -1,6 +1,7 @@
|
|||||||
package ru.dbotthepony.mc.otm.datagen.advancements
|
package ru.dbotthepony.mc.otm.datagen.advancements
|
||||||
|
|
||||||
import net.minecraft.advancements.AdvancementHolder
|
import net.minecraft.advancements.AdvancementHolder
|
||||||
|
import net.minecraft.advancements.AdvancementRequirements
|
||||||
import net.minecraft.advancements.FrameType
|
import net.minecraft.advancements.FrameType
|
||||||
import net.minecraft.advancements.critereon.ItemPredicate
|
import net.minecraft.advancements.critereon.ItemPredicate
|
||||||
import net.minecraft.world.item.Item
|
import net.minecraft.world.item.Item
|
||||||
@ -58,6 +59,7 @@ private data class CraftEntry(
|
|||||||
it.addCriterion(i.toString(), criterion(item))
|
it.addCriterion(i.toString(), criterion(item))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.requirements(AdvancementRequirements.Strategy.OR)
|
||||||
.save(serializer, modLocation("machines/$path"))
|
.save(serializer, modLocation("machines/$path"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -82,7 +84,7 @@ fun addMachineAdvancements(serializer: Consumer<AdvancementHolder>, lang: Matter
|
|||||||
val press = AdvancementBuilder()
|
val press = AdvancementBuilder()
|
||||||
.parent(chem)
|
.parent(chem)
|
||||||
.display(
|
.display(
|
||||||
itemStack = ItemStack(MItems.PLATE_PRESS),
|
itemStack = ItemStack(MItems.PLATE_PRESS[null]!!),
|
||||||
title = translation.add("plate_press", "Bending the Material") {
|
title = translation.add("plate_press", "Bending the Material") {
|
||||||
russian("Раскатка металла")
|
russian("Раскатка металла")
|
||||||
},
|
},
|
||||||
@ -90,10 +92,14 @@ fun addMachineAdvancements(serializer: Consumer<AdvancementHolder>, lang: Matter
|
|||||||
russian("Создайте пресс пластин, не суйте свои или чужие конечности внутрь")
|
russian("Создайте пресс пластин, не суйте свои или чужие конечности внутрь")
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.addCriterion("has_machine", criterion(MItems.PLATE_PRESS))
|
.also {
|
||||||
|
for ((i, m) in MItems.PLATE_PRESS.values.withIndex())
|
||||||
|
it.addCriterion(i.toString(), criterion(m))
|
||||||
|
}
|
||||||
|
.requirements(AdvancementRequirements.Strategy.OR)
|
||||||
.save(serializer, modLocation("machines/plate_press"))
|
.save(serializer, modLocation("machines/plate_press"))
|
||||||
|
|
||||||
CraftEntry(MItems.TWIN_PLATE_PRESS, "Twice the Thud",
|
CraftEntry(MItems.TWIN_PLATE_PRESS.values, "Twice the Thud",
|
||||||
russianName = "Двойной стук").make(serializer, press, translation)
|
russianName = "Двойной стук").make(serializer, press, translation)
|
||||||
|
|
||||||
val scanner = CraftEntry(MItems.MATTER_SCANNER, "Scanning Things that Matter",
|
val scanner = CraftEntry(MItems.MATTER_SCANNER, "Scanning Things that Matter",
|
||||||
|
@ -12,5 +12,8 @@ fun addBlockModels(provider: MatteryBlockModelProvider) {
|
|||||||
|
|
||||||
coloredMachine(MBlocks.COBBLESTONE_GENERATOR, listOf("0", "particle"))
|
coloredMachine(MBlocks.COBBLESTONE_GENERATOR, listOf("0", "particle"))
|
||||||
coloredMachine(MBlocks.ESSENCE_STORAGE, listOf("0", "particle"))
|
coloredMachine(MBlocks.ESSENCE_STORAGE, listOf("0", "particle"))
|
||||||
|
|
||||||
|
coloredMachineCombined("plate_press", "plate_press2", listOf("idle", "error", "working"), listOf("0", "particle"))
|
||||||
|
coloredMachineCombined("twin_plate_press", "plate_press2", listOf("idle", "error", "working"), listOf("0", "particle"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,8 +93,8 @@ fun addBlockStates(provider: MatteryBlockStateProvider) {
|
|||||||
|
|
||||||
provider.block(MBlocks.MATTER_DECOMPOSER)
|
provider.block(MBlocks.MATTER_DECOMPOSER)
|
||||||
provider.block(MBlocks.MATTER_REPLICATOR)
|
provider.block(MBlocks.MATTER_REPLICATOR)
|
||||||
provider.block(MBlocks.PLATE_PRESS)
|
provider.block(MBlocks.PLATE_PRESS.values)
|
||||||
provider.block(MBlocks.TWIN_PLATE_PRESS)
|
provider.block(MBlocks.TWIN_PLATE_PRESS.values)
|
||||||
provider.block(MBlocks.GRAVITATION_STABILIZER)
|
provider.block(MBlocks.GRAVITATION_STABILIZER)
|
||||||
provider.block(MBlocks.GRAVITATION_STABILIZER_LENS)
|
provider.block(MBlocks.GRAVITATION_STABILIZER_LENS)
|
||||||
|
|
||||||
|
@ -178,8 +178,8 @@ fun addItemModels(provider: MatteryItemModelProvider) {
|
|||||||
provider.block(MItems.POWERED_FURNACE, "powered_furnace_working")
|
provider.block(MItems.POWERED_FURNACE, "powered_furnace_working")
|
||||||
provider.block(MItems.POWERED_SMOKER, "powered_smoker_working")
|
provider.block(MItems.POWERED_SMOKER, "powered_smoker_working")
|
||||||
|
|
||||||
provider.block(MItems.PLATE_PRESS, "plate_press_idle")
|
provider.coloredWithBaseBlock(MItems.PLATE_PRESS, "plate_press", "_idle")
|
||||||
provider.block(MItems.TWIN_PLATE_PRESS, "twin_plate_press_idle")
|
provider.coloredWithBaseBlock(MItems.TWIN_PLATE_PRESS, "twin_plate_press", "_idle")
|
||||||
provider.block(MItems.STORAGE_POWER_SUPPLIER, "storage_power_supplier")
|
provider.block(MItems.STORAGE_POWER_SUPPLIER, "storage_power_supplier")
|
||||||
provider.block(MItems.MATTER_RECYCLER, "matter_recycler_working")
|
provider.block(MItems.MATTER_RECYCLER, "matter_recycler_working")
|
||||||
provider.coloredWithBaseBlock(MItems.COBBLESTONE_GENERATOR, "cobblestone_generator")
|
provider.coloredWithBaseBlock(MItems.COBBLESTONE_GENERATOR, "cobblestone_generator")
|
||||||
|
@ -32,25 +32,21 @@ class MatteryItemModelProvider(event: GatherDataEvent) : ItemModelProvider(event
|
|||||||
fun block(item: Item, path: String) = exec { withExistingParent(item.registryName!!.path, modLocation("block/$path")) }
|
fun block(item: Item, path: String) = exec { withExistingParent(item.registryName!!.path, modLocation("block/$path")) }
|
||||||
|
|
||||||
fun coloredWithBaseBlock(items: Map<DyeColor?, Item>, path: String) {
|
fun coloredWithBaseBlock(items: Map<DyeColor?, Item>, path: String) {
|
||||||
block(items[DyeColor.BLACK]!!, path + "_black")
|
for (color in DyeColor.entries) {
|
||||||
block(items[DyeColor.BLUE]!!, path + "_blue")
|
block(items[color]!!, path + "_${color.name.lowercase()}")
|
||||||
block(items[DyeColor.BROWN]!!, path + "_brown")
|
}
|
||||||
block(items[DyeColor.CYAN]!!, path + "_cyan")
|
|
||||||
block(items[DyeColor.GRAY]!!, path + "_gray")
|
|
||||||
block(items[DyeColor.GREEN]!!, path + "_green")
|
|
||||||
block(items[DyeColor.LIGHT_BLUE]!!, path + "_light_blue")
|
|
||||||
block(items[DyeColor.LIGHT_GRAY]!!, path + "_light_gray")
|
|
||||||
block(items[DyeColor.LIME]!!, path + "_lime")
|
|
||||||
block(items[DyeColor.MAGENTA]!!, path + "_magenta")
|
|
||||||
block(items[DyeColor.ORANGE]!!, path + "_orange")
|
|
||||||
block(items[DyeColor.PINK]!!, path + "_pink")
|
|
||||||
block(items[DyeColor.PURPLE]!!, path + "_purple")
|
|
||||||
block(items[DyeColor.RED]!!, path + "_red")
|
|
||||||
block(items[DyeColor.WHITE]!!, path + "_white")
|
|
||||||
block(items[DyeColor.YELLOW]!!, path + "_yellow")
|
|
||||||
block(items[null]!!, path)
|
block(items[null]!!, path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun coloredWithBaseBlock(items: Map<DyeColor?, Item>, path: String, suffix: String) {
|
||||||
|
for (color in DyeColor.entries) {
|
||||||
|
block(items[color]!!, path + "_${color.name.lowercase()}$suffix")
|
||||||
|
}
|
||||||
|
|
||||||
|
block(items[null]!!, path + suffix)
|
||||||
|
}
|
||||||
|
|
||||||
fun blocks(vararg items: Item) = items.forEach(this::block)
|
fun blocks(vararg items: Item) = items.forEach(this::block)
|
||||||
fun blocks(items: Collection<Item>) = items.forEach(this::block)
|
fun blocks(items: Collection<Item>) = items.forEach(this::block)
|
||||||
|
|
||||||
|
@ -455,8 +455,8 @@ private fun blocks(provider: MatteryLanguageProvider) {
|
|||||||
add(MBlocks.CHEMICAL_GENERATOR, "Chemical Generator")
|
add(MBlocks.CHEMICAL_GENERATOR, "Chemical Generator")
|
||||||
add(MBlocks.DRIVE_RACK, "Condensation Drive Rack")
|
add(MBlocks.DRIVE_RACK, "Condensation Drive Rack")
|
||||||
add(MBlocks.ITEM_MONITOR, "Item Monitor")
|
add(MBlocks.ITEM_MONITOR, "Item Monitor")
|
||||||
add(MBlocks.PLATE_PRESS, "Plate Press")
|
addBlock(MBlocks.PLATE_PRESS.values, "Plate Press")
|
||||||
add(MBlocks.TWIN_PLATE_PRESS, "Twin Plate Press")
|
addBlock(MBlocks.TWIN_PLATE_PRESS.values, "Twin Plate Press")
|
||||||
|
|
||||||
add(MBlocks.POWERED_FURNACE, "Electric Furnace")
|
add(MBlocks.POWERED_FURNACE, "Electric Furnace")
|
||||||
add(MBlocks.POWERED_SMOKER, "Microwave Oven")
|
add(MBlocks.POWERED_SMOKER, "Microwave Oven")
|
||||||
|
@ -349,52 +349,6 @@ class MatteryLanguageProvider(private val gen: DataGenerator) {
|
|||||||
slave.add(redItem, toFormat.format(red))
|
slave.add(redItem, toFormat.format(red))
|
||||||
slave.add(blackItem, toFormat.format(black))
|
slave.add(blackItem, toFormat.format(black))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun addBlocks(list: List<Block>, toFormat: String) {
|
|
||||||
add(
|
|
||||||
whiteBlock = list[0],
|
|
||||||
orangeBlock = list[1],
|
|
||||||
magentaBlock = list[2],
|
|
||||||
lightBlueBlock = list[3],
|
|
||||||
yellowBlock = list[4],
|
|
||||||
limeBlock = list[5],
|
|
||||||
pinkBlock = list[6],
|
|
||||||
grayBlock = list[7],
|
|
||||||
lightGrayBlock = list[8],
|
|
||||||
cyanBlock = list[9],
|
|
||||||
purpleBlock = list[10],
|
|
||||||
blueBlock = list[11],
|
|
||||||
brownBlock = list[12],
|
|
||||||
greenBlock = list[13],
|
|
||||||
redBlock = list[14],
|
|
||||||
blackBlock = list[15],
|
|
||||||
|
|
||||||
toFormat = toFormat
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun addItems(list: List<Item>, toFormat: String) {
|
|
||||||
add(
|
|
||||||
whiteItem = list[0],
|
|
||||||
orangeItem = list[1],
|
|
||||||
magentaItem = list[2],
|
|
||||||
lightBlueItem = list[3],
|
|
||||||
yellowItem = list[4],
|
|
||||||
limeItem = list[5],
|
|
||||||
pinkItem = list[6],
|
|
||||||
grayItem = list[7],
|
|
||||||
lightGrayItem = list[8],
|
|
||||||
cyanItem = list[9],
|
|
||||||
purpleItem = list[10],
|
|
||||||
blueItem = list[11],
|
|
||||||
brownItem = list[12],
|
|
||||||
greenItem = list[13],
|
|
||||||
redItem = list[14],
|
|
||||||
blackItem = list[15],
|
|
||||||
|
|
||||||
toFormat = toFormat
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val englishColors = Colors("en_us",
|
val englishColors = Colors("en_us",
|
||||||
|
@ -457,8 +457,8 @@ private fun blocks(provider: MatteryLanguageProvider) {
|
|||||||
add(MBlocks.CHEMICAL_GENERATOR, "Химический генератор")
|
add(MBlocks.CHEMICAL_GENERATOR, "Химический генератор")
|
||||||
add(MBlocks.DRIVE_RACK, "Стеллаж дисков конденсации")
|
add(MBlocks.DRIVE_RACK, "Стеллаж дисков конденсации")
|
||||||
add(MBlocks.ITEM_MONITOR, "Монитор предметов")
|
add(MBlocks.ITEM_MONITOR, "Монитор предметов")
|
||||||
add(MBlocks.PLATE_PRESS, "Пресс пластин")
|
addBlock(MBlocks.PLATE_PRESS.values, "Пресс пластин")
|
||||||
add(MBlocks.TWIN_PLATE_PRESS, "Двойной пресс пластин")
|
addBlock(MBlocks.TWIN_PLATE_PRESS.values, "Двойной пресс пластин")
|
||||||
|
|
||||||
add(MBlocks.POWERED_FURNACE, "Электрическая печь")
|
add(MBlocks.POWERED_FURNACE, "Электрическая печь")
|
||||||
add(MBlocks.POWERED_BLAST_FURNACE, "Индукционная печь")
|
add(MBlocks.POWERED_BLAST_FURNACE, "Индукционная печь")
|
||||||
|
@ -157,8 +157,8 @@ fun addLootTables(lootTables: LootTables) {
|
|||||||
lootTables.tile(MBlocks.MATTER_REPLICATOR)
|
lootTables.tile(MBlocks.MATTER_REPLICATOR)
|
||||||
lootTables.tile(MBlocks.MATTER_RECYCLER)
|
lootTables.tile(MBlocks.MATTER_RECYCLER)
|
||||||
lootTables.tile(MBlocks.MATTER_SCANNER)
|
lootTables.tile(MBlocks.MATTER_SCANNER)
|
||||||
lootTables.tile(MBlocks.PLATE_PRESS)
|
lootTables.tile(MBlocks.PLATE_PRESS.values)
|
||||||
lootTables.tile(MBlocks.TWIN_PLATE_PRESS)
|
lootTables.tile(MBlocks.TWIN_PLATE_PRESS.values)
|
||||||
|
|
||||||
lootTables.tile(MBlocks.POWERED_FURNACE)
|
lootTables.tile(MBlocks.POWERED_FURNACE)
|
||||||
lootTables.tile(MBlocks.POWERED_SMOKER)
|
lootTables.tile(MBlocks.POWERED_SMOKER)
|
||||||
|
@ -113,4 +113,18 @@ class MatteryBlockModelProvider(event: GatherDataEvent) : BlockModelProvider(eve
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun coloredMachineCombined(modelName: String, textureName: String, states: Collection<String>, textureKeys: Collection<String>) {
|
||||||
|
exec {
|
||||||
|
for (color in DyeColor.entries) {
|
||||||
|
for (state in states) {
|
||||||
|
val model = withExistingParent(modelName + "_${color.name.lowercase()}_$state", modLocation(modelName + "_$state"))
|
||||||
|
|
||||||
|
for (key in textureKeys) {
|
||||||
|
model.texture(key, modLocation("block/$textureName/${color.name.lowercase()}"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) {
|
|||||||
.unlockedBy(MItems.HOLO_SIGN)
|
.unlockedBy(MItems.HOLO_SIGN)
|
||||||
.save(consumer, modLocation("holo_sign_reset"))
|
.save(consumer, modLocation("holo_sign_reset"))
|
||||||
|
|
||||||
MatteryRecipe(MBlocks.PLATE_PRESS, category = machinesCategory)
|
MatteryRecipe(MBlocks.PLATE_PRESS[null]!!, category = machinesCategory)
|
||||||
.row(MItems.ELECTRIC_PARTS, MItems.ENERGY_BUS, MItems.ELECTRIC_PARTS)
|
.row(MItems.ELECTRIC_PARTS, MItems.ENERGY_BUS, MItems.ELECTRIC_PARTS)
|
||||||
.row(MItemTags.TRITANIUM_INGOTS, Items.BLAST_FURNACE, MItemTags.TRITANIUM_INGOTS)
|
.row(MItemTags.TRITANIUM_INGOTS, Items.BLAST_FURNACE, MItemTags.TRITANIUM_INGOTS)
|
||||||
.row(MItemTags.PISTONS, MItemTags.TRITANIUM_INGOTS, MItemTags.PISTONS)
|
.row(MItemTags.PISTONS, MItemTags.TRITANIUM_INGOTS, MItemTags.PISTONS)
|
||||||
@ -65,21 +65,23 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) {
|
|||||||
.unlockedBy(MItems.ELECTRIC_PARTS)
|
.unlockedBy(MItems.ELECTRIC_PARTS)
|
||||||
.build(consumer)
|
.build(consumer)
|
||||||
|
|
||||||
MatteryRecipe(MBlocks.PLATE_PRESS, category = machinesCategory)
|
MatteryRecipe(MBlocks.PLATE_PRESS[null]!!, category = machinesCategory)
|
||||||
.rowB(MItemTags.PISTONS)
|
.rowB(MItemTags.PISTONS)
|
||||||
.rowB(MItems.MACHINE_FRAME)
|
.rowB(MItems.MACHINE_FRAME)
|
||||||
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
|
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
|
||||||
.unlockedBy(MItems.ELECTRIC_PARTS)
|
.unlockedBy(MItems.ELECTRIC_PARTS)
|
||||||
.build(consumer, "advanced")
|
.build(consumer, "advanced")
|
||||||
|
|
||||||
MatteryRecipe(MBlocks.TWIN_PLATE_PRESS, category = machinesCategory)
|
for ((color, press) in MBlocks.PLATE_PRESS) {
|
||||||
.setUpgradeSource(MItems.PLATE_PRESS)
|
MatteryRecipe(MBlocks.TWIN_PLATE_PRESS[color]!!, category = machinesCategory)
|
||||||
|
.setUpgradeSource(press)
|
||||||
.addUpgradeOps(UpgradeRecipe.Direct("BlockEntityTag"))
|
.addUpgradeOps(UpgradeRecipe.Direct("BlockEntityTag"))
|
||||||
.rowB(MItemTags.PISTONS)
|
.rowB(MItemTags.PISTONS)
|
||||||
.rowB(MItems.PLATE_PRESS)
|
.rowB(press)
|
||||||
.rowB(MItemTags.TRITANIUM_PLATES)
|
.rowB(MItemTags.TRITANIUM_PLATES)
|
||||||
.unlockedBy(MItems.PLATE_PRESS)
|
.unlockedBy(MBlocks.PLATE_PRESS.values)
|
||||||
.build(consumer)
|
.build(consumer, "twin_plate_press/${color?.name?.lowercase() ?: "default"}")
|
||||||
|
}
|
||||||
|
|
||||||
MatteryRecipe(MItems.PATTERN_DRIVE_NORMAL, category = machinesCategory)
|
MatteryRecipe(MItems.PATTERN_DRIVE_NORMAL, category = machinesCategory)
|
||||||
.rowAC(MItemTags.ADVANCED_CIRCUIT, MItemTags.ADVANCED_CIRCUIT)
|
.rowAC(MItemTags.ADVANCED_CIRCUIT, MItemTags.ADVANCED_CIRCUIT)
|
||||||
|
@ -91,6 +91,11 @@ class MatteryRecipe(val result: ItemLike, val count: Int = 1, val category: Reci
|
|||||||
return unlockedBy("has_${location.namespace}_${location.path}", has(item))
|
return unlockedBy("has_${location.namespace}_${location.path}", has(item))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun unlockedBy(item: Collection<ItemLike>): MatteryRecipe {
|
||||||
|
item.forEach { unlockedBy(it) }
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
fun unlockedBy(item: TagKey<Item>): MatteryRecipe {
|
fun unlockedBy(item: TagKey<Item>): MatteryRecipe {
|
||||||
return unlockedBy("has_${item.location.namespace}_${item.location.path}", has(item))
|
return unlockedBy("has_${item.location.namespace}_${item.location.path}", has(item))
|
||||||
}
|
}
|
||||||
|
@ -273,6 +273,8 @@ fun addPainterRecipes(consumer: RecipeOutput) {
|
|||||||
|
|
||||||
generate(consumer, MItems.COBBLESTONE_GENERATOR[null]!!, MItems.COBBLESTONE_GENERATOR)
|
generate(consumer, MItems.COBBLESTONE_GENERATOR[null]!!, MItems.COBBLESTONE_GENERATOR)
|
||||||
generate(consumer, MItems.ESSENCE_STORAGE[null]!!, MItems.ESSENCE_STORAGE)
|
generate(consumer, MItems.ESSENCE_STORAGE[null]!!, MItems.ESSENCE_STORAGE)
|
||||||
|
generate(consumer, MItems.PLATE_PRESS[null]!!, MItems.PLATE_PRESS)
|
||||||
|
generate(consumer, MItems.TWIN_PLATE_PRESS[null]!!, MItems.TWIN_PLATE_PRESS)
|
||||||
|
|
||||||
generate(consumer, MRegistry.VENT.item, MRegistry.VENT.items)
|
generate(consumer, MRegistry.VENT.item, MRegistry.VENT.items)
|
||||||
generate(consumer, MRegistry.VENT_ALTERNATIVE.item, MRegistry.VENT_ALTERNATIVE.items)
|
generate(consumer, MRegistry.VENT_ALTERNATIVE.item, MRegistry.VENT_ALTERNATIVE.items)
|
||||||
|
@ -190,8 +190,8 @@ fun addTags(tagsProvider: TagsProvider) {
|
|||||||
MBlocks.MATTER_BOTTLER,
|
MBlocks.MATTER_BOTTLER,
|
||||||
MBlocks.ENERGY_COUNTER,
|
MBlocks.ENERGY_COUNTER,
|
||||||
MBlocks.CHEMICAL_GENERATOR,
|
MBlocks.CHEMICAL_GENERATOR,
|
||||||
MBlocks.PLATE_PRESS,
|
*MBlocks.PLATE_PRESS.values.toTypedArray(),
|
||||||
MBlocks.TWIN_PLATE_PRESS,
|
*MBlocks.TWIN_PLATE_PRESS.values.toTypedArray(),
|
||||||
MBlocks.MATTER_RECYCLER,
|
MBlocks.MATTER_RECYCLER,
|
||||||
MBlocks.MATTER_ENTANGLER,
|
MBlocks.MATTER_ENTANGLER,
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package ru.dbotthepony.mc.otm.block.tech
|
|||||||
|
|
||||||
import net.minecraft.core.BlockPos
|
import net.minecraft.core.BlockPos
|
||||||
import net.minecraft.network.chat.Component
|
import net.minecraft.network.chat.Component
|
||||||
|
import net.minecraft.world.item.DyeColor
|
||||||
import net.minecraft.world.item.ItemStack
|
import net.minecraft.world.item.ItemStack
|
||||||
import net.minecraft.world.item.TooltipFlag
|
import net.minecraft.world.item.TooltipFlag
|
||||||
import net.minecraft.world.level.BlockGetter
|
import net.minecraft.world.level.BlockGetter
|
||||||
@ -13,6 +14,8 @@ import net.minecraft.world.level.block.entity.BlockEntityTicker
|
|||||||
import net.minecraft.world.level.block.entity.BlockEntityType
|
import net.minecraft.world.level.block.entity.BlockEntityType
|
||||||
import net.minecraft.world.level.block.state.BlockState
|
import net.minecraft.world.level.block.state.BlockState
|
||||||
import net.minecraft.world.level.block.state.StateDefinition
|
import net.minecraft.world.level.block.state.StateDefinition
|
||||||
|
import net.minecraft.world.level.material.MapColor
|
||||||
|
import net.minecraft.world.level.material.PushReaction
|
||||||
import net.minecraft.world.phys.shapes.CollisionContext
|
import net.minecraft.world.phys.shapes.CollisionContext
|
||||||
import net.minecraft.world.phys.shapes.VoxelShape
|
import net.minecraft.world.phys.shapes.VoxelShape
|
||||||
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
|
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
|
||||||
@ -24,7 +27,7 @@ import ru.dbotthepony.mc.otm.block.getShapeForEachState
|
|||||||
import ru.dbotthepony.mc.otm.core.get
|
import ru.dbotthepony.mc.otm.core.get
|
||||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||||
|
|
||||||
class PlatePressBlock(properties: Properties = DEFAULT_MACHINE_PROPERTIES, val isTwin: Boolean = false) : RotatableMatteryBlock(properties), EntityBlock {
|
class PlatePressBlock(val color: DyeColor?, val isTwin: Boolean = false) : RotatableMatteryBlock(Properties.of().mapColor(color?.mapColor ?: MapColor.METAL).pushReaction(PushReaction.BLOCK).requiresCorrectToolForDrops().destroyTime(1.5f).explosionResistance(25.0f)), EntityBlock {
|
||||||
override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity {
|
override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity {
|
||||||
return PlatePressBlockEntity(p_153215_, p_153216_, isTwin)
|
return PlatePressBlockEntity(p_153215_, p_153216_, isTwin)
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,8 @@ class JEIPlugin : IModPlugin {
|
|||||||
registration.addRecipeCatalyst(ItemStack(MItems.POWERED_SMOKER), MicrowaveRecipeCategory.recipeType)
|
registration.addRecipeCatalyst(ItemStack(MItems.POWERED_SMOKER), MicrowaveRecipeCategory.recipeType)
|
||||||
registration.addRecipeCatalyst(ItemStack(MItems.ExopackUpgrades.CRAFTING_UPGRADE), RecipeTypes.CRAFTING)
|
registration.addRecipeCatalyst(ItemStack(MItems.ExopackUpgrades.CRAFTING_UPGRADE), RecipeTypes.CRAFTING)
|
||||||
registration.addRecipeCatalyst(ItemStack(MItems.ITEM_MONITOR), RecipeTypes.CRAFTING)
|
registration.addRecipeCatalyst(ItemStack(MItems.ITEM_MONITOR), RecipeTypes.CRAFTING)
|
||||||
registration.addRecipeCatalyst(ItemStack(MItems.PLATE_PRESS), PlatePressRecipeCategory.recipeType)
|
MItems.PLATE_PRESS.values.forEach { registration.addRecipeCatalyst(ItemStack(it), PlatePressRecipeCategory.recipeType) }
|
||||||
|
MItems.TWIN_PLATE_PRESS.values.forEach { registration.addRecipeCatalyst(ItemStack(it), PlatePressRecipeCategory.recipeType) }
|
||||||
registration.addRecipeCatalyst(ItemStack(MItems.PAINTER), PainterRecipeCategory.recipeType)
|
registration.addRecipeCatalyst(ItemStack(MItems.PAINTER), PainterRecipeCategory.recipeType)
|
||||||
registration.addRecipeCatalyst(ItemStack(MItems.MATTER_ENTANGLER), MatterEntanglerRecipeCategory.recipeType)
|
registration.addRecipeCatalyst(ItemStack(MItems.MATTER_ENTANGLER), MatterEntanglerRecipeCategory.recipeType)
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ object PlatePressRecipeCategory : IRecipeCategory<PlatePressRecipe>, IDrawable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun getTitle(): Component {
|
override fun getTitle(): Component {
|
||||||
return MItems.PLATE_PRESS.description
|
return MItems.PLATE_PRESS[null]!!.description
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun draw(graphics: GuiGraphics, xOffset: Int, yOffset: Int) {
|
override fun draw(graphics: GuiGraphics, xOffset: Int, yOffset: Int) {
|
||||||
@ -96,7 +96,7 @@ object PlatePressRecipeCategory : IRecipeCategory<PlatePressRecipe>, IDrawable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private val iconField by lazy {
|
private val iconField by lazy {
|
||||||
JEIPlugin.helpers.guiHelper.createDrawableItemStack(ItemStack(MItems.PLATE_PRESS))
|
JEIPlugin.helpers.guiHelper.createDrawableItemStack(ItemStack(MItems.PLATE_PRESS[null]!!))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getIcon(): IDrawable {
|
override fun getIcon(): IDrawable {
|
||||||
|
@ -76,7 +76,7 @@ class PlatePressRecipe(
|
|||||||
override fun getType(): RecipeType<PlatePressRecipe> = MRecipes.PLATE_PRESS
|
override fun getType(): RecipeType<PlatePressRecipe> = MRecipes.PLATE_PRESS
|
||||||
|
|
||||||
override fun getToastSymbol(): ItemStack {
|
override fun getToastSymbol(): ItemStack {
|
||||||
return ItemStack(MItems.PLATE_PRESS)
|
return ItemStack(MItems.PLATE_PRESS[null]!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun toFinished(id: ResourceLocation) = SERIALIZER.toFinished(this, id)
|
fun toFinished(id: ResourceLocation) = SERIALIZER.toFinished(this, id)
|
||||||
|
@ -62,8 +62,8 @@ object MBlockEntities {
|
|||||||
val ITEM_MONITOR by register(MNames.ITEM_MONITOR, ::ItemMonitorBlockEntity, MBlocks::ITEM_MONITOR)
|
val ITEM_MONITOR by register(MNames.ITEM_MONITOR, ::ItemMonitorBlockEntity, MBlocks::ITEM_MONITOR)
|
||||||
val ENERGY_COUNTER by register(MNames.ENERGY_COUNTER, ::EnergyCounterBlockEntity, MBlocks::ENERGY_COUNTER)
|
val ENERGY_COUNTER by register(MNames.ENERGY_COUNTER, ::EnergyCounterBlockEntity, MBlocks::ENERGY_COUNTER)
|
||||||
val CHEMICAL_GENERATOR by register(MNames.CHEMICAL_GENERATOR, ::ChemicalGeneratorBlockEntity, MBlocks::CHEMICAL_GENERATOR)
|
val CHEMICAL_GENERATOR by register(MNames.CHEMICAL_GENERATOR, ::ChemicalGeneratorBlockEntity, MBlocks::CHEMICAL_GENERATOR)
|
||||||
val PLATE_PRESS by register(MNames.PLATE_PRESS, ::PlatePressBlockEntity, MBlocks::PLATE_PRESS)
|
val PLATE_PRESS by register(MNames.PLATE_PRESS, ::PlatePressBlockEntity, *MBlocks.PLATE_PRESS.asSupplierArray())
|
||||||
val TWIN_PLATE_PRESS by register(MNames.TWIN_PLATE_PRESS, { a, b -> PlatePressBlockEntity(a, b, true) }, MBlocks::TWIN_PLATE_PRESS)
|
val TWIN_PLATE_PRESS by register(MNames.TWIN_PLATE_PRESS, { a, b -> PlatePressBlockEntity(a, b, true) }, *MBlocks.TWIN_PLATE_PRESS.asSupplierArray())
|
||||||
val GRAVITATION_STABILIZER by register(MNames.GRAVITATION_STABILIZER, ::GravitationStabilizerBlockEntity, MBlocks::GRAVITATION_STABILIZER)
|
val GRAVITATION_STABILIZER by register(MNames.GRAVITATION_STABILIZER, ::GravitationStabilizerBlockEntity, MBlocks::GRAVITATION_STABILIZER)
|
||||||
val MATTER_RECYCLER by register(MNames.MATTER_RECYCLER, ::MatterRecyclerBlockEntity, MBlocks::MATTER_RECYCLER)
|
val MATTER_RECYCLER by register(MNames.MATTER_RECYCLER, ::MatterRecyclerBlockEntity, MBlocks::MATTER_RECYCLER)
|
||||||
val ENERGY_SERVO by register(MNames.ENERGY_SERVO, ::EnergyServoBlockEntity, MBlocks::ENERGY_SERVO)
|
val ENERGY_SERVO by register(MNames.ENERGY_SERVO, ::EnergyServoBlockEntity, MBlocks::ENERGY_SERVO)
|
||||||
|
@ -106,8 +106,8 @@ object MBlocks {
|
|||||||
val MATTER_BOTTLER: Block by registry.register(MNames.MATTER_BOTTLER) { MatterBottlerBlock() }
|
val MATTER_BOTTLER: Block by registry.register(MNames.MATTER_BOTTLER) { MatterBottlerBlock() }
|
||||||
val ENERGY_COUNTER: Block by registry.register(MNames.ENERGY_COUNTER) { EnergyCounterBlock() }
|
val ENERGY_COUNTER: Block by registry.register(MNames.ENERGY_COUNTER) { EnergyCounterBlock() }
|
||||||
val CHEMICAL_GENERATOR: Block by registry.register(MNames.CHEMICAL_GENERATOR) { ChemicalGeneratorBlock() }
|
val CHEMICAL_GENERATOR: Block by registry.register(MNames.CHEMICAL_GENERATOR) { ChemicalGeneratorBlock() }
|
||||||
val PLATE_PRESS: Block by registry.register(MNames.PLATE_PRESS) { PlatePressBlock() }
|
val PLATE_PRESS = registry.coloredWithBase(MNames.PLATE_PRESS) { color, _ -> PlatePressBlock(color) }
|
||||||
val TWIN_PLATE_PRESS: Block by registry.register(MNames.TWIN_PLATE_PRESS) { PlatePressBlock(isTwin = true) }
|
val TWIN_PLATE_PRESS = registry.coloredWithBase(MNames.TWIN_PLATE_PRESS) { color, _ -> PlatePressBlock(color, isTwin = true) }
|
||||||
val POWERED_FURNACE: PoweredFurnaceBlock by registry.register(MNames.POWERED_FURNACE) { PoweredFurnaceBlock(MBlockEntities::POWERED_FURNACE, RecipeType.SMELTING, null, MachinesConfig.POWERED_FURNACE, BlockShapes.POWERED_FURNACE) }
|
val POWERED_FURNACE: PoweredFurnaceBlock by registry.register(MNames.POWERED_FURNACE) { PoweredFurnaceBlock(MBlockEntities::POWERED_FURNACE, RecipeType.SMELTING, null, MachinesConfig.POWERED_FURNACE, BlockShapes.POWERED_FURNACE) }
|
||||||
val POWERED_BLAST_FURNACE: PoweredFurnaceBlock by registry.register(MNames.POWERED_BLAST_FURNACE) { PoweredFurnaceBlock(MBlockEntities::POWERED_BLAST_FURNACE, RecipeType.BLASTING, null, MachinesConfig.POWERED_BLAST_FURNACE, BlockShapes.POWERED_BLAST_FURNACE) }
|
val POWERED_BLAST_FURNACE: PoweredFurnaceBlock by registry.register(MNames.POWERED_BLAST_FURNACE) { PoweredFurnaceBlock(MBlockEntities::POWERED_BLAST_FURNACE, RecipeType.BLASTING, null, MachinesConfig.POWERED_BLAST_FURNACE, BlockShapes.POWERED_BLAST_FURNACE) }
|
||||||
val POWERED_SMOKER: PoweredFurnaceBlock by registry.register(MNames.POWERED_SMOKER) { PoweredFurnaceBlock(MBlockEntities::POWERED_SMOKER, RecipeType.SMOKING, MRecipes::MICROWAVE, MachinesConfig.POWERED_SMOKER, BlockShapes.POWERED_SMOKER_IDLE) }
|
val POWERED_SMOKER: PoweredFurnaceBlock by registry.register(MNames.POWERED_SMOKER) { PoweredFurnaceBlock(MBlockEntities::POWERED_SMOKER, RecipeType.SMOKING, MRecipes::MICROWAVE, MachinesConfig.POWERED_SMOKER, BlockShapes.POWERED_SMOKER_IDLE) }
|
||||||
|
@ -73,8 +73,8 @@ object MItems {
|
|||||||
val TRITANIUM_RAW_BLOCK: BlockItem by registry.register(MNames.TRITANIUM_RAW_BLOCK) { BlockItem(MBlocks.TRITANIUM_RAW_BLOCK, DEFAULT_PROPERTIES) }
|
val TRITANIUM_RAW_BLOCK: BlockItem by registry.register(MNames.TRITANIUM_RAW_BLOCK) { BlockItem(MBlocks.TRITANIUM_RAW_BLOCK, DEFAULT_PROPERTIES) }
|
||||||
val ENERGY_COUNTER: BlockItem by registry.register(MNames.ENERGY_COUNTER) { BlockItem(MBlocks.ENERGY_COUNTER, DEFAULT_PROPERTIES) }
|
val ENERGY_COUNTER: BlockItem by registry.register(MNames.ENERGY_COUNTER) { BlockItem(MBlocks.ENERGY_COUNTER, DEFAULT_PROPERTIES) }
|
||||||
val CHEMICAL_GENERATOR: BlockItem by registry.register(MNames.CHEMICAL_GENERATOR) { BlockItem(MBlocks.CHEMICAL_GENERATOR, DEFAULT_PROPERTIES) }
|
val CHEMICAL_GENERATOR: BlockItem by registry.register(MNames.CHEMICAL_GENERATOR) { BlockItem(MBlocks.CHEMICAL_GENERATOR, DEFAULT_PROPERTIES) }
|
||||||
val PLATE_PRESS: BlockItem by registry.register(MNames.PLATE_PRESS) { BlockItem(MBlocks.PLATE_PRESS, DEFAULT_PROPERTIES) }
|
val PLATE_PRESS = registry.coloredWithBase(MNames.PLATE_PRESS) { color, _ -> BlockItem(MBlocks.PLATE_PRESS[color]!!, DEFAULT_PROPERTIES) }
|
||||||
val TWIN_PLATE_PRESS: BlockItem by registry.register(MNames.TWIN_PLATE_PRESS) { BlockItem(MBlocks.TWIN_PLATE_PRESS, DEFAULT_PROPERTIES) }
|
val TWIN_PLATE_PRESS = registry.coloredWithBase(MNames.TWIN_PLATE_PRESS) { color, _ -> BlockItem(MBlocks.TWIN_PLATE_PRESS[color]!!, DEFAULT_PROPERTIES) }
|
||||||
val MATTER_RECYCLER: BlockItem by registry.register(MNames.MATTER_RECYCLER) { BlockItem(MBlocks.MATTER_RECYCLER, DEFAULT_PROPERTIES) }
|
val MATTER_RECYCLER: BlockItem by registry.register(MNames.MATTER_RECYCLER) { BlockItem(MBlocks.MATTER_RECYCLER, DEFAULT_PROPERTIES) }
|
||||||
|
|
||||||
val POWERED_FURNACE: BlockItem by registry.register(MNames.POWERED_FURNACE) { BlockItem(MBlocks.POWERED_FURNACE, DEFAULT_PROPERTIES) }
|
val POWERED_FURNACE: BlockItem by registry.register(MNames.POWERED_FURNACE) { BlockItem(MBlocks.POWERED_FURNACE, DEFAULT_PROPERTIES) }
|
||||||
@ -170,8 +170,8 @@ object MItems {
|
|||||||
init {
|
init {
|
||||||
val machines = ArrayList<Supplier<BlockItem>>()
|
val machines = ArrayList<Supplier<BlockItem>>()
|
||||||
|
|
||||||
machines.add(::PLATE_PRESS)
|
machines.addAll(PLATE_PRESS.asSupplierArray())
|
||||||
machines.add(::TWIN_PLATE_PRESS)
|
machines.addAll(TWIN_PLATE_PRESS.asSupplierArray())
|
||||||
machines.add(::POWERED_FURNACE)
|
machines.add(::POWERED_FURNACE)
|
||||||
machines.add(::POWERED_BLAST_FURNACE)
|
machines.add(::POWERED_BLAST_FURNACE)
|
||||||
machines.add(::POWERED_SMOKER)
|
machines.add(::POWERED_SMOKER)
|
||||||
|
@ -77,7 +77,7 @@ open class ColoredDecorativeBlock(
|
|||||||
check(registeredBlocks) { "wtffffff???????????" }
|
check(registeredBlocks) { "wtffffff???????????" }
|
||||||
|
|
||||||
MRegistry.DYE_ORDER.forEach {
|
MRegistry.DYE_ORDER.forEach {
|
||||||
itemMap[it] = registry.register("${baseName}_${it.name.lowercase()}") { BlockItem(blockMap[DyeColor.WHITE]!!.get(), properties) }
|
itemMap[it] = registry.register("${baseName}_${it.name.lowercase()}") { BlockItem(blockMap[it]!!.get(), properties) }
|
||||||
}
|
}
|
||||||
|
|
||||||
registeredItems = true
|
registeredItems = true
|
||||||
|
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 730 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 858 B |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.3 KiB |