From 537620ba6c5d568ab85caba910deb537d0064d4a Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Tue, 11 Feb 2025 21:18:43 +0700 Subject: [PATCH 1/4] Add netherite as flywheel material --- .../mc/otm/datagen/FlywheelData.kt | 3 ++- .../otm/data/FlywheelMaterialDataProvider.kt | 24 +++++++++++-------- .../mc/otm/data/FlywheelMaterials.kt | 4 ++-- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/FlywheelData.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/FlywheelData.kt index 55ecc2949..a4079ddcb 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/FlywheelData.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/FlywheelData.kt @@ -9,6 +9,7 @@ fun addFlywheelMaterials(provider: FlywheelMaterialDataProvider) { provider.add(Tags.Blocks.STORAGE_BLOCKS_DIAMOND, Decimal(25_000_000)) provider.add(Tags.Blocks.STORAGE_BLOCKS_COPPER, Decimal(60_000_000)) provider.add(Tags.Blocks.STORAGE_BLOCKS_IRON, Decimal(50_000_000)) - provider.add(Tags.Blocks.STORAGE_BLOCKS_GOLD, Decimal(300_000_000)) + provider.add(Tags.Blocks.STORAGE_BLOCKS_GOLD, Decimal(300_000_000), momentumLossSpeed = Decimal("0.75")) + provider.add(Tags.Blocks.STORAGE_BLOCKS_NETHERITE, Decimal(1_250_000_000), receiveEfficiency = Decimal("0.99"), momentumLossSpeed = Decimal.ONE_HALF) provider.add(MBlockTags.TRITANIUM_BLOCKS, Decimal(225_000_000)) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/data/FlywheelMaterialDataProvider.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/data/FlywheelMaterialDataProvider.kt index 13f41ede0..229c1a964 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/data/FlywheelMaterialDataProvider.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/data/FlywheelMaterialDataProvider.kt @@ -33,34 +33,34 @@ open class FlywheelMaterialDataProvider(val modid: String, val location: String? } @JvmOverloads - fun add(block: Block, storage: Decimal, priority: Int = 0) { - entries.add(FlywheelMaterials.Entry(block, storage, priority)) + fun add(block: Block, storage: Decimal, priority: Int = 0, receiveEfficiency: Decimal = Decimal.ONE, momentumLossSpeed: Decimal = Decimal.ONE) { + entries.add(FlywheelMaterials.Entry(block, storage, priority, receiveEfficiency, momentumLossSpeed)) } @JvmOverloads - fun add(block: TagKey, storage: Decimal, priority: Int = 0) { - entries.add(FlywheelMaterials.Entry(block, storage, priority)) + fun add(block: TagKey, storage: Decimal, priority: Int = 0, receiveEfficiency: Decimal = Decimal.ONE, momentumLossSpeed: Decimal = Decimal.ONE) { + entries.add(FlywheelMaterials.Entry(block, storage, priority, receiveEfficiency, momentumLossSpeed)) } @JvmName("addBlocks") @JvmOverloads - fun add(blocks: Collection, storage: Decimal, priority: Int = 0) { + fun add(blocks: Collection, storage: Decimal, priority: Int = 0, receiveEfficiency: Decimal = Decimal.ONE, momentumLossSpeed: Decimal = Decimal.ONE) { for (block in blocks) - entries.add(FlywheelMaterials.Entry(block, storage, priority)) + entries.add(FlywheelMaterials.Entry(block, storage, priority, receiveEfficiency, momentumLossSpeed)) } @JvmName("addBlocks") @JvmOverloads - fun add(blocks: Array, storage: Decimal, priority: Int = 0) { + fun add(blocks: Array, storage: Decimal, priority: Int = 0, receiveEfficiency: Decimal = Decimal.ONE, momentumLossSpeed: Decimal = Decimal.ONE) { for (block in blocks) - entries.add(FlywheelMaterials.Entry(block, storage, priority)) + entries.add(FlywheelMaterials.Entry(block, storage, priority, receiveEfficiency, momentumLossSpeed)) } @JvmName("addTags") @JvmOverloads - fun add(blocks: Array>, storage: Decimal, priority: Int = 0) { + fun add(blocks: Array>, storage: Decimal, priority: Int = 0, receiveEfficiency: Decimal = Decimal.ONE, momentumLossSpeed: Decimal = Decimal.ONE) { for (block in blocks) - entries.add(FlywheelMaterials.Entry(block, storage, priority)) + entries.add(FlywheelMaterials.Entry(block, storage, priority, receiveEfficiency, momentumLossSpeed)) } @JvmName("addBlocks") @@ -83,6 +83,10 @@ open class FlywheelMaterialDataProvider(val modid: String, val location: String? return add(blocks, storage, priority) } + fun add(entry: FlywheelMaterials.Entry) { + entries.add(entry) + } + override fun run(output: CachedOutput): CompletableFuture<*> { if (location == null) { val futures = ArrayList>() diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/data/FlywheelMaterials.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/data/FlywheelMaterials.kt index 3fef6436a..8844b8251 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/data/FlywheelMaterials.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/data/FlywheelMaterials.kt @@ -55,8 +55,8 @@ object FlywheelMaterials : SimpleJsonResourceReloadListener(GsonBuilder().setPre val receiveEfficiency: Decimal = Decimal.ONE, val momentumLossSpeed: Decimal = Decimal.ONE ) : Comparable { - constructor(id: Block, storage: Decimal, priority: Int = 0, windUpEfficiency: Decimal = Decimal.ONE, windDownEfficiency: Decimal = Decimal.ONE) : this(Either.right(id), storage, priority, windUpEfficiency, windDownEfficiency) - constructor(id: TagKey, storage: Decimal, priority: Int = 0, windUpEfficiency: Decimal = Decimal.ONE, windDownEfficiency: Decimal = Decimal.ONE) : this(Either.left(id), storage, priority, windUpEfficiency, windDownEfficiency) + constructor(id: Block, storage: Decimal, priority: Int = 0, receiveEfficiency: Decimal = Decimal.ONE, momentumLossSpeed: Decimal = Decimal.ONE) : this(Either.right(id), storage, priority, receiveEfficiency, momentumLossSpeed) + constructor(id: TagKey, storage: Decimal, priority: Int = 0, receiveEfficiency: Decimal = Decimal.ONE, momentumLossSpeed: Decimal = Decimal.ONE) : this(Either.left(id), storage, priority, receiveEfficiency, momentumLossSpeed) override fun compareTo(other: Entry): Int { val selfLeft = id.left().isPresent From 43eb2b7ac8cee9ac3137b9b06e4fb2933353043b Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Tue, 11 Feb 2025 21:22:33 +0700 Subject: [PATCH 2/4] Bump default cable throughput once again --- .../kotlin/ru/dbotthepony/mc/otm/config/CablesConfig.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/config/CablesConfig.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/config/CablesConfig.kt index 40559732d..fe5e269e3 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/config/CablesConfig.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/config/CablesConfig.kt @@ -7,9 +7,9 @@ import ru.dbotthepony.mc.otm.core.math.defineDecimal object CablesConfig : AbstractConfig("cables") { enum class E(throughput: Decimal) { - CRUDE(Decimal(320)), - REGULAR(Decimal(4096)), - ADVANCED(Decimal(20480)), + CRUDE(Decimal(1024)), + REGULAR(Decimal(8192)), + ADVANCED(Decimal(40960)), SUPERCONDUCTOR(Decimal.POSITIVE_INFINITY); init { From 46d5a8758226cd5f45176a76d737f8af11325517 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Tue, 11 Feb 2025 21:35:24 +0700 Subject: [PATCH 3/4] Display two digits in flywheel material tooltip --- .../kotlin/ru/dbotthepony/mc/otm/data/FlywheelMaterials.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/data/FlywheelMaterials.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/data/FlywheelMaterials.kt index 8844b8251..51ef535fc 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/data/FlywheelMaterials.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/data/FlywheelMaterials.kt @@ -248,11 +248,11 @@ object FlywheelMaterials : SimpleJsonResourceReloadListener(GsonBuilder().setPre event.toolTip.add(TranslatableComponent("otm.gui.flywheel.storage", entry.storage.formatPower()).withStyle(ChatFormatting.GRAY)) if (entry.receiveEfficiency != Decimal.ONE) { - event.toolTip.add(TranslatableComponent("otm.gui.flywheel.receive_efficiency", entry.receiveEfficiency.toString(1)).withStyle(ChatFormatting.GRAY)) + event.toolTip.add(TranslatableComponent("otm.gui.flywheel.receive_efficiency", entry.receiveEfficiency.toString(2)).withStyle(ChatFormatting.GRAY)) } if (entry.momentumLossSpeed != Decimal.ONE) { - event.toolTip.add(TranslatableComponent("otm.gui.flywheel.momentum_loss_speed", entry.momentumLossSpeed.toString(1)).withStyle(ChatFormatting.GRAY)) + event.toolTip.add(TranslatableComponent("otm.gui.flywheel.momentum_loss_speed", entry.momentumLossSpeed.toString(2)).withStyle(ChatFormatting.GRAY)) } } } From 3cb604bd98693a064facc234ce272d75274a750d Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Tue, 11 Feb 2025 21:36:47 +0700 Subject: [PATCH 4/4] Changed my mind about wind up inefficiency of netherite --- src/data/kotlin/ru/dbotthepony/mc/otm/datagen/FlywheelData.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/FlywheelData.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/FlywheelData.kt index a4079ddcb..7944ca425 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/FlywheelData.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/FlywheelData.kt @@ -10,6 +10,6 @@ fun addFlywheelMaterials(provider: FlywheelMaterialDataProvider) { provider.add(Tags.Blocks.STORAGE_BLOCKS_COPPER, Decimal(60_000_000)) provider.add(Tags.Blocks.STORAGE_BLOCKS_IRON, Decimal(50_000_000)) provider.add(Tags.Blocks.STORAGE_BLOCKS_GOLD, Decimal(300_000_000), momentumLossSpeed = Decimal("0.75")) - provider.add(Tags.Blocks.STORAGE_BLOCKS_NETHERITE, Decimal(1_250_000_000), receiveEfficiency = Decimal("0.99"), momentumLossSpeed = Decimal.ONE_HALF) + provider.add(Tags.Blocks.STORAGE_BLOCKS_NETHERITE, Decimal(1_250_000_000), momentumLossSpeed = Decimal.ONE_HALF) provider.add(MBlockTags.TRITANIUM_BLOCKS, Decimal(225_000_000)) }