Essence storage coloring

This commit is contained in:
DBotThePony 2024-01-03 18:51:59 +07:00
parent cb50ee2c68
commit d6dc8689f8
Signed by: DBot
GPG Key ID: DCC23B5715498507
32 changed files with 26 additions and 19 deletions

View File

@ -11,5 +11,6 @@ fun addBlockModels(provider: MatteryBlockModelProvider) {
resourceCubeAll(MBlocks.TRITANIUM_INGOT_BLOCK)
coloredMachine(MBlocks.COBBLESTONE_GENERATOR, listOf("0", "particle"))
coloredMachine(MBlocks.ESSENCE_STORAGE, listOf("0", "particle"))
}
}

View File

@ -107,7 +107,7 @@ fun addBlockStates(provider: MatteryBlockStateProvider) {
provider.block(MBlocks.MATTER_RECONSTRUCTOR)
provider.block(MBlocks.ENERGY_SERVO)
provider.block(MBlocks.COBBLESTONE_GENERATOR.values)
provider.block(MBlocks.ESSENCE_STORAGE)
provider.block(MBlocks.ESSENCE_STORAGE.values)
provider.exec {
for (crate in MRegistry.CARGO_CRATES.allBlocks.values) {

View File

@ -159,12 +159,11 @@ fun addItemModels(provider: MatteryItemModelProvider) {
provider.block(MItems.TRITANIUM_TRAPDOOR[null]!!, "tritanium_trapdoor_bottom")
for (color in DyeColor.values())
for (color in DyeColor.entries)
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(MItems.CHEMICAL_GENERATOR, "chemical_generator_working")
provider.block(MItems.ENERGY_COUNTER, "energy_counter_down")
@ -172,7 +171,7 @@ fun addItemModels(provider: MatteryItemModelProvider) {
provider.block(MItems.MATTER_CABLE, "matter_cable_core")
provider.block(MItems.MATTER_DECOMPOSER, "matter_decomposer_working")
provider.block(MItems.ENERGY_SERVO, "energy_servo")
provider.block(MItems.ESSENCE_STORAGE, "essence_storage")
provider.coloredWithBaseBlock(MItems.ESSENCE_STORAGE, "essence_storage")
provider.block(MItems.MATTER_RECONSTRUCTOR, "matter_reconstructor")
provider.block(MItems.POWERED_BLAST_FURNACE, "powered_blast_furnace_working")
@ -183,7 +182,7 @@ fun addItemModels(provider: MatteryItemModelProvider) {
provider.block(MItems.TWIN_PLATE_PRESS, "twin_plate_press_idle")
provider.block(MItems.STORAGE_POWER_SUPPLIER, "storage_power_supplier")
provider.block(MItems.MATTER_RECYCLER, "matter_recycler_working")
provider.allColoredBlock(MItems.COBBLESTONE_GENERATOR, "cobblestone_generator")
provider.coloredWithBaseBlock(MItems.COBBLESTONE_GENERATOR, "cobblestone_generator")
provider.block(MItems.STORAGE_BUS)
provider.block(MItems.STORAGE_IMPORTER)

View File

@ -31,7 +31,7 @@ class MatteryItemModelProvider(event: GatherDataEvent) : ItemModelProvider(event
fun block(item: Item) = exec { withExistingParent(item.registryName!!.path, modLocation("block/${item.registryName!!.path}")) }
fun block(item: Item, path: String) = exec { withExistingParent(item.registryName!!.path, modLocation("block/$path")) }
fun allColoredBlock(items: Map<DyeColor?, Item>, path: String) {
fun coloredWithBaseBlock(items: Map<DyeColor?, Item>, path: String) {
block(items[DyeColor.BLACK]!!, path + "_black")
block(items[DyeColor.BLUE]!!, path + "_blue")
block(items[DyeColor.BROWN]!!, path + "_brown")

View File

@ -426,8 +426,8 @@ private fun blocks(provider: MatteryLanguageProvider) {
add(MBlocks.BLACK_HOLE, "Local Anomalous Spacetime Dilation Singular Point")
addBlock(MBlocks.COBBLESTONE_GENERATOR.values, "Cobblestone Generator")
add(MBlocks.INFINITE_WATER_SOURCE, "Infinite Water Source")
add(MBlocks.ESSENCE_STORAGE, "Essence Storage")
add(MBlocks.ESSENCE_STORAGE, "desc", "Allows to store and retrieve experience levels")
addBlock(MBlocks.ESSENCE_STORAGE.values, "Essence Storage")
addBlock(MBlocks.ESSENCE_STORAGE.values, "desc", "Allows to store and retrieve experience levels")
add(MBlocks.MATTER_RECONSTRUCTOR, "Matter Reconstructor")
add(MBlocks.MATTER_RECONSTRUCTOR, "desc", "Repairs tools using matter")
add(MBlocks.DEV_CHEST, "Dev Chest")

View File

@ -83,6 +83,7 @@ class MatteryLanguageProvider(private val gen: DataGenerator) {
fun add(key: Block, value: String) = slave.add(key, value)
fun addBlock(key: Collection<Block>, value: String) = key.forEach { add(it, value) }
fun add(key: Block, suffix: String, value: String) = slave.add("${key.descriptionId}.${suffix}", value)
fun addBlock(key: Collection<Block>, suffix: String, value: String) = key.forEach { add(it, suffix, value) }
fun add(key: Item, value: String) = slave.add(key, value)
fun addItem(key: Collection<Item>, value: String) = key.forEach { add(it, value) }
fun add(key: Item, suffix: String, value: String) = slave.add("${key.descriptionId}.${suffix}", value)

View File

@ -428,8 +428,8 @@ private fun blocks(provider: MatteryLanguageProvider) {
add(MBlocks.BLACK_HOLE, "Локализированная сингулярная точка аномального искажения пространства-времени")
addBlock(MBlocks.COBBLESTONE_GENERATOR.values, "Генератор булыжника")
add(MBlocks.INFINITE_WATER_SOURCE, "Неиссякаемый источник воды")
add(MBlocks.ESSENCE_STORAGE, "Хранилище эссенции")
add(MBlocks.ESSENCE_STORAGE, "desc", "Позволяет хранить очки опыта")
addBlock(MBlocks.ESSENCE_STORAGE.values, "Хранилище эссенции")
addBlock(MBlocks.ESSENCE_STORAGE.values, "desc", "Позволяет хранить очки опыта")
add(MBlocks.MATTER_RECONSTRUCTOR, "Материальный реконструктор")
add(MBlocks.MATTER_RECONSTRUCTOR, "desc", "Чинит инструменты используя материю")
add(MBlocks.DEV_CHEST, "Сундук разработчика")

View File

@ -131,7 +131,7 @@ fun addLootTables(lootTables: LootTables) {
}
lootTables.tile(MBlocks.COBBLESTONE_GENERATOR.values)
lootTables.tile(MBlocks.ESSENCE_STORAGE)
lootTables.tile(MBlocks.ESSENCE_STORAGE.values)
lootTables.tile(MBlocks.MATTER_RECONSTRUCTOR)
lootTables.tile(MBlocks.FLUID_TANK)
lootTables.tile(MBlocks.PAINTER)

View File

@ -391,7 +391,7 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) {
.unlockedBy(MItemTags.TRITANIUM_NUGGETS)
.save(consumer, modLocation("ingot_from_nuggets"))
MatteryRecipe(MItems.ESSENCE_STORAGE, category = machinesCategory)
MatteryRecipe(MItems.ESSENCE_STORAGE[null]!!, category = machinesCategory)
.row(MItems.MATTER_CAPACITOR_PARTS, Items.ENDER_EYE, MItemTags.ADVANCED_CIRCUIT)
.row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES)
.row(MItemTags.GOLD_WIRES, MItemTags.HARDENED_GLASS, MItemTags.HARDENED_GLASS)

View File

@ -272,6 +272,7 @@ fun addPainterRecipes(consumer: RecipeOutput) {
generate(consumer, MItems.TRITANIUM_TRAPDOOR[null]!!, MItems.TRITANIUM_TRAPDOOR)
generate(consumer, MItems.COBBLESTONE_GENERATOR[null]!!, MItems.COBBLESTONE_GENERATOR)
generate(consumer, MItems.ESSENCE_STORAGE[null]!!, MItems.ESSENCE_STORAGE)
generate(consumer, MRegistry.VENT.item, MRegistry.VENT.items)
generate(consumer, MRegistry.VENT_ALTERNATIVE.item, MRegistry.VENT_ALTERNATIVE.items)
@ -290,5 +291,6 @@ fun addPainterRecipes(consumer: RecipeOutput) {
for (color in DyeColor.entries) {
consumer.accept(PainterArmorDyeRecipe(mapOf(color to 1)).toFinished(modLocation("painter/armor_dye_" + color.getName().lowercase())))
}
consumer.accept(PainterArmorDyeRecipe(mapOf(null to 15)).toFinished(modLocation("painter/armor_clear_dye")))
}

View File

@ -219,7 +219,7 @@ fun addTags(tagsProvider: TagsProvider) {
MBlocks.ENGINE,
MBlocks.HOLO_SIGN,
*MBlocks.COBBLESTONE_GENERATOR.values.toTypedArray(),
MBlocks.ESSENCE_STORAGE,
*MBlocks.ESSENCE_STORAGE.values.toTypedArray(),
MBlocks.MATTER_RECONSTRUCTOR,
MBlocks.FLUID_TANK,
MBlocks.ANDROID_CHARGER,

View File

@ -4,6 +4,7 @@ import net.minecraft.core.BlockPos
import net.minecraft.world.InteractionHand
import net.minecraft.world.InteractionResult
import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.DyeColor
import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.Level
import net.minecraft.world.level.block.EntityBlock
@ -11,6 +12,8 @@ import net.minecraft.world.level.block.entity.BlockEntity
import net.minecraft.world.level.block.entity.BlockEntityTicker
import net.minecraft.world.level.block.entity.BlockEntityType
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.material.MapColor
import net.minecraft.world.level.material.PushReaction
import net.minecraft.world.phys.BlockHitResult
import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.VoxelShape
@ -21,7 +24,7 @@ import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.registry.MItems
import ru.dbotthepony.mc.otm.shapes.BlockShapes
class EssenceStorageBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock {
class EssenceStorageBlock(val color: DyeColor?) : RotatableMatteryBlock(Properties.of().mapColor(color?.mapColor ?: MapColor.METAL).pushReaction(PushReaction.BLOCK).requiresCorrectToolForDrops().destroyTime(1.5f).explosionResistance(60.0f)), EntityBlock {
override fun newBlockEntity(pPos: BlockPos, pState: BlockState): BlockEntity {
return EssenceStorageBlockEntity(pPos, pState)
}

View File

@ -68,7 +68,7 @@ object MBlockEntities {
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 COBBLESTONE_GENERATOR by register(MNames.COBBLESTONE_GENERATOR, ::CobblerBlockEntity, *MBlocks.COBBLESTONE_GENERATOR.asSupplierArray())
val ESSENCE_STORAGE by register(MNames.ESSENCE_STORAGE, ::EssenceStorageBlockEntity, MBlocks::ESSENCE_STORAGE)
val ESSENCE_STORAGE by register(MNames.ESSENCE_STORAGE, ::EssenceStorageBlockEntity, *MBlocks.ESSENCE_STORAGE.asSupplierArray())
val MATTER_RECONSTRUCTOR by register(MNames.MATTER_RECONSTRUCTOR, ::MatterReconstructorBlockEntity, MBlocks::MATTER_RECONSTRUCTOR)
val FLUID_TANK by register(MNames.FLUID_TANK, ::FluidTankBlockEntity, MBlocks::FLUID_TANK)
val ANDROID_CHARGER by register(MNames.ANDROID_CHARGER, ::AndroidChargerBlockEntity, MBlocks::ANDROID_CHARGER)

View File

@ -115,7 +115,7 @@ object MBlocks {
val ENERGY_SERVO: Block by registry.register(MNames.ENERGY_SERVO) { EnergyServoBlock() }
val COBBLESTONE_GENERATOR = registry.coloredWithBase(MNames.COBBLESTONE_GENERATOR) { color, _ -> CobblerBlock(color) }
val INFINITE_WATER_SOURCE: Block by registry.register(MNames.INFINITE_WATER_SOURCE) { InfiniteWaterSourceBlock() }
val ESSENCE_STORAGE: EssenceStorageBlock by registry.register(MNames.ESSENCE_STORAGE) { EssenceStorageBlock() }
val ESSENCE_STORAGE = registry.coloredWithBase(MNames.ESSENCE_STORAGE) { color, _ -> EssenceStorageBlock(color) }
val MATTER_RECONSTRUCTOR: MatterReconstructorBlock by registry.register(MNames.MATTER_RECONSTRUCTOR) { MatterReconstructorBlock() }
val PAINTER: PainterBlock by registry.register(MNames.PAINTER) { PainterBlock() }
val MATTER_ENTANGLER: MatterEntanglerBlock by registry.register(MNames.MATTER_ENTANGLER) { MatterEntanglerBlock() }

View File

@ -135,8 +135,8 @@ object MItems {
val INFINITE_WATER_SOURCE: BlockItem by registry.register(MNames.INFINITE_WATER_SOURCE) { BlockItem(MBlocks.INFINITE_WATER_SOURCE, DEFAULT_PROPERTIES) }
val ESSENCE_STORAGE: BlockItem by registry.register(MNames.ESSENCE_STORAGE) {
object : BlockItem(MBlocks.ESSENCE_STORAGE, DEFAULT_PROPERTIES) {
val ESSENCE_STORAGE: Map<DyeColor?, BlockItem> = registry.coloredWithBase(MNames.ESSENCE_STORAGE) { color, _ ->
object : BlockItem(MBlocks.ESSENCE_STORAGE[color]!!, DEFAULT_PROPERTIES) {
override fun appendHoverText(p_40572_: ItemStack, p_40573_: Level?, p_40574_: MutableList<Component>, p_40575_: TooltipFlag) {
super.appendHoverText(p_40572_, p_40573_, p_40574_, p_40575_)
p_40574_.add(TranslatableComponent("$descriptionId.desc").withStyle(ChatFormatting.GRAY))
@ -185,6 +185,7 @@ object MItems {
machines.add(::PAINTER)
machines.addAll(COBBLESTONE_GENERATOR.asSupplierArray().iterator())
machines.addAll(ESSENCE_STORAGE.asSupplierArray().iterator())
machines.add(::MATTER_DECOMPOSER)
machines.add(::MATTER_CAPACITOR_BANK)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB