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