Briefcase grill config

This commit is contained in:
DBotThePony 2025-01-06 12:53:16 +07:00
parent dfeb638b7c
commit c5edd9ff59
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 30 additions and 3 deletions

View File

@ -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())
}

View File

@ -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
}
}