From c5edd9ff59bcaa0c0cb1476844b5ec8d9abfc95f Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Mon, 6 Jan 2025 12:53:16 +0700 Subject: [PATCH] Briefcase grill config --- .../entity/decorative/GrillBlockEntity.kt | 7 ++--- .../mc/otm/config/MachinesConfig.kt | 26 +++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/decorative/GrillBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/decorative/GrillBlockEntity.kt index 2d35f562f..606fa87fd 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/decorative/GrillBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/decorative/GrillBlockEntity.kt @@ -29,6 +29,7 @@ import ru.dbotthepony.mc.otm.block.entity.ExperienceStorage import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity import ru.dbotthepony.mc.otm.block.entity.MatteryDeviceBlockEntity import ru.dbotthepony.mc.otm.block.entity.MatteryDeviceBlockEntity.Companion +import ru.dbotthepony.mc.otm.config.MachinesConfig import ru.dbotthepony.mc.otm.container.MatteryContainer import ru.dbotthepony.mc.otm.core.TextComponent import ru.dbotthepony.mc.otm.core.get @@ -157,7 +158,7 @@ class GrillBlockEntity(blockPos: BlockPos, blockState: BlockState) : MatteryBloc super.tick() if (fuelTicks <= 0 && activeSlots.isNotEmpty()) { - val fuel = fuelSlot[0].getBurnTime(null) * 8 + val fuel = fuelSlot[0].getBurnTime(null) * MachinesConfig.BriefcaseGrill.FUEL_EFFICIENCY if (fuel > 0) { fuelTicks = fuel @@ -179,12 +180,12 @@ class GrillBlockEntity(blockPos: BlockPos, blockState: BlockState) : MatteryBloc if (fuelTicks > 0) { if (activeSlots.isNotEmpty()) { - fuelTicks -= 5 + fuelTicks -= MachinesConfig.BriefcaseGrill.FUEL_CONSUMPTION for (slot in activeSlots.toIntArray()) { val recipe = outputs[slot]!! - if (recipe.cookingTime * 3 <= ++inputProgress[slot]) { + if (recipe.cookingTime * MachinesConfig.BriefcaseGrill.COOK_TIME <= ++inputProgress[slot]) { experience.storeExperience(recipe.experience) inputSlots[slot] = recipe.assemble(SingleRecipeInput(inputSlots[slot]), level!!.registryAccess()) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/config/MachinesConfig.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/config/MachinesConfig.kt index 9075f56ca..fca8fd99a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/config/MachinesConfig.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/config/MachinesConfig.kt @@ -282,8 +282,34 @@ object MachinesConfig : AbstractConfig("machines") { } } + object BriefcaseGrill { + init { + builder.push(MNames.GRILL) + } + + val FUEL_EFFICIENCY: Int by builder + .comment("How efficient is fuel, in other words:") + .comment("It burns this times longer inside Briefcase Grill when nothing is being cooked") + .defineInRange("FUEL_EFFICIENCY", 8, 1) + + val FUEL_CONSUMPTION: Int by builder + .comment("How fast fuel burns when something is being cooked") + .comment("At default settings (efficiency 8 consumption 5) each fuel is at worst 8/5 more effective") + .defineInRange("FUEL_CONSUMPTION", 5, 1) + + val COOK_TIME: Int by builder + .comment("How slow is the grill") + .comment("Amount of ticks requires to cook is multiplied by this value") + .defineInRange("FUEL_CONSUMPTION", 3, 1) + + init { + builder.pop() + } + } + init { Upgrades EssenceStorage + BriefcaseGrill } }