diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt index 35da1f29b..bfb02748d 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt @@ -422,18 +422,18 @@ object DataGen { addTags(tagsProvider) - event.generator.addProvider(true, blockModelProvider) - event.generator.addProvider(true, blockStateProvider) - event.generator.addProvider(true, itemModelProvider) - event.generator.addProvider(true, recipeProvider) - event.generator.addProvider(true, MatterBankProvider(event)) - event.generator.addProvider(true, BatteryBankProvider(event)) - event.generator.addProvider(true, lootTableProvider) - event.generator.addProvider(true, lootModifier) - event.generator.addProvider(true, SoundDataProvider(event)) - event.generator.addProvider(true, researchProvider) - event.generator.addProvider(true, advancementProvider) - event.generator.addProvider(true, matterData) + event.generator.addProvider(event.includeClient(), blockModelProvider) + event.generator.addProvider(event.includeServer(), blockStateProvider) + event.generator.addProvider(event.includeClient(), itemModelProvider) + event.generator.addProvider(event.includeServer(), recipeProvider) + event.generator.addProvider(event.includeClient(), MatterBankProvider(event)) + event.generator.addProvider(event.includeClient(), BatteryBankProvider(event)) + event.generator.addProvider(event.includeServer(), lootTableProvider) + event.generator.addProvider(event.includeServer(), lootModifier) + event.generator.addProvider(event.includeServer(), SoundDataProvider(event)) + event.generator.addProvider(event.includeServer(), researchProvider) + event.generator.addProvider(event.includeServer(), advancementProvider) + event.generator.addProvider(event.includeServer(), matterData) AddEnglishLanguage(languageProvider) @@ -470,5 +470,7 @@ object DataGen { } languageProvider.registerProviders() + + addMatterData(matterData) } } diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/MatterData.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/MatterData.kt new file mode 100644 index 000000000..f5ad98b3b --- /dev/null +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/MatterData.kt @@ -0,0 +1,23 @@ +package ru.dbotthepony.mc.otm.datagen + +import net.minecraft.world.item.Items +import net.minecraftforge.common.Tags +import ru.dbotthepony.mc.otm.core.ImpreciseFraction +import ru.dbotthepony.mc.otm.matter.MatterDataProvider + +// general rule - anything plant or organic is much more complex than mineral +// and anything mineral has much bigger matter value than complexity (just throw a lot of same molecules) + +fun addMatterData(provider: MatterDataProvider) { + provider.scope(Items.DIRT, ImpreciseFraction(1), 1.0) { + relative(Items.GRASS, Items.GRASS) + + relative(Items.COAL, 40, 4) + + scope(Tags.Items.INGOTS_IRON, 128, 10) { + relative(Tags.Items.INGOTS_GOLD, 4, 2) + relative(Tags.Items.GEMS_DIAMOND, 16, 3) + relative(Tags.Items.GEMS_EMERALD, 20, 3.4) + } + } +} diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterDataProvider.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterDataProvider.kt index c06597eb0..a5b72a7d5 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterDataProvider.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterDataProvider.kt @@ -13,6 +13,7 @@ import ru.dbotthepony.mc.otm.core.registryName import java.util.Collections import java.util.function.Consumer +@Suppress("FunctionName", "unused") open class MatterDataProvider(protected val dataGenerator: DataGenerator, val namespace: String?) : DataProvider { constructor(event: GatherDataEvent) : this(event.generator, event.modContainer.namespace) @@ -173,6 +174,296 @@ open class MatterDataProvider(protected val dataGenerator: DataGenerator, val na } } + fun Scope( matterValue: Int, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity, configurator) + fun Scope(item: ItemLike, matterValue: Int, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity, configurator) + fun Scope(tag: TagKey, matterValue: Int, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity, configurator) + fun Scope( matterValue: Long, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity, configurator) + fun Scope(item: ItemLike, matterValue: Long, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity, configurator) + fun Scope(tag: TagKey, matterValue: Long, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity, configurator) + fun Scope( matterValue: Double, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity, configurator) + fun Scope(item: ItemLike, matterValue: Double, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity, configurator) + fun Scope(tag: TagKey, matterValue: Double, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity, configurator) + fun Scope( matterValue: Float, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity, configurator) + fun Scope(item: ItemLike, matterValue: Float, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity, configurator) + fun Scope(tag: TagKey, matterValue: Float, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity, configurator) + + fun Scope( matterValue: Int, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(item: ItemLike, matterValue: Int, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(tag: TagKey, matterValue: Int, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope( matterValue: Long, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(item: ItemLike, matterValue: Long, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(tag: TagKey, matterValue: Long, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope( matterValue: Double, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(item: ItemLike, matterValue: Double, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(tag: TagKey, matterValue: Double, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope( matterValue: Float, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(item: ItemLike, matterValue: Float, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(tag: TagKey, matterValue: Float, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + + fun Scope( matterValue: Int, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(item: ItemLike, matterValue: Int, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(tag: TagKey, matterValue: Int, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope( matterValue: Long, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(item: ItemLike, matterValue: Long, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(tag: TagKey, matterValue: Long, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope( matterValue: Double, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(item: ItemLike, matterValue: Double, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(tag: TagKey, matterValue: Double, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope( matterValue: Float, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(item: ItemLike, matterValue: Float, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(tag: TagKey, matterValue: Float, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + + fun Scope( matterValue: Int, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(item: ItemLike, matterValue: Int, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(tag: TagKey, matterValue: Int, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope( matterValue: Long, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(item: ItemLike, matterValue: Long, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(tag: TagKey, matterValue: Long, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope( matterValue: Double, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(item: ItemLike, matterValue: Double, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(tag: TagKey, matterValue: Double, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope( matterValue: Float, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(item: ItemLike, matterValue: Float, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun Scope(tag: TagKey, matterValue: Float, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + + fun scope( matterValue: ImpreciseFraction, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(matterValue, complexity, configurator) + fun scope(item: ItemLike, matterValue: ImpreciseFraction, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, matterValue, complexity, configurator) + fun scope(tag: TagKey, matterValue: ImpreciseFraction, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, matterValue, complexity, configurator) + fun scope( matterValue: Int, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity, configurator) + fun scope(item: ItemLike, matterValue: Int, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity, configurator) + fun scope(tag: TagKey, matterValue: Int, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity, configurator) + fun scope( matterValue: Long, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity, configurator) + fun scope(item: ItemLike, matterValue: Long, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity, configurator) + fun scope(tag: TagKey, matterValue: Long, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity, configurator) + fun scope( matterValue: Double, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity, configurator) + fun scope(item: ItemLike, matterValue: Double, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity, configurator) + fun scope(tag: TagKey, matterValue: Double, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity, configurator) + fun scope( matterValue: Float, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity, configurator) + fun scope(item: ItemLike, matterValue: Float, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity, configurator) + fun scope(tag: TagKey, matterValue: Float, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity, configurator) + + fun scope( matterValue: Int, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(item: ItemLike, matterValue: Int, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(tag: TagKey, matterValue: Int, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope( matterValue: Long, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(item: ItemLike, matterValue: Long, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(tag: TagKey, matterValue: Long, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope( matterValue: Double, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(item: ItemLike, matterValue: Double, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(tag: TagKey, matterValue: Double, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope( matterValue: Float, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(item: ItemLike, matterValue: Float, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(tag: TagKey, matterValue: Float, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + + fun scope( matterValue: Int, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(item: ItemLike, matterValue: Int, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(tag: TagKey, matterValue: Int, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope( matterValue: Long, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(item: ItemLike, matterValue: Long, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(tag: TagKey, matterValue: Long, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope( matterValue: Double, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(item: ItemLike, matterValue: Double, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(tag: TagKey, matterValue: Double, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope( matterValue: Float, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(item: ItemLike, matterValue: Float, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(tag: TagKey, matterValue: Float, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + + fun scope( matterValue: Int, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(item: ItemLike, matterValue: Int, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(tag: TagKey, matterValue: Int, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope( matterValue: Long, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(item: ItemLike, matterValue: Long, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(tag: TagKey, matterValue: Long, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope( matterValue: Double, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(item: ItemLike, matterValue: Double, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(tag: TagKey, matterValue: Double, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope( matterValue: Float, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(item: ItemLike, matterValue: Float, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + fun scope(tag: TagKey, matterValue: Float, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue), complexity.toDouble(), configurator) + + /** + * Allows to easily declare matter values using relative costs in "pyramid" pattern + * + * do not even think about using this in Java + * + * JUST DONT + */ + inner class Scope(val matterValue: ImpreciseFraction, val complexity: Double, configurator: Scope.() -> Unit) { + constructor(item: ItemLike, matterValue: ImpreciseFraction, complexity: Double, configurator: Scope.() -> Unit) : this(matterValue, complexity, configurator) { + insert(item, matterValue, complexity) + } + + constructor(tag: TagKey, matterValue: ImpreciseFraction, complexity: Double, configurator: Scope.() -> Unit) : this(matterValue, complexity, configurator) { + insert(tag, matterValue, complexity) + } + + init { + configurator.invoke(this) + } + + fun Scope( matterValue: ImpreciseFraction, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(matterValue * this.matterValue, complexity * this.complexity, configurator) + fun Scope(item: ItemLike, matterValue: ImpreciseFraction, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, matterValue * this.matterValue, complexity * this.complexity, configurator) + fun Scope(tag: TagKey, matterValue: ImpreciseFraction, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, matterValue * this.matterValue, complexity * this.complexity, configurator) + fun Scope( matterValue: Int, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(item: ItemLike, matterValue: Int, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(tag: TagKey, matterValue: Int, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope( matterValue: Long, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(item: ItemLike, matterValue: Long, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(tag: TagKey, matterValue: Long, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope( matterValue: Double, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(item: ItemLike, matterValue: Double, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(tag: TagKey, matterValue: Double, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope( matterValue: Float, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(item: ItemLike, matterValue: Float, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(tag: TagKey, matterValue: Float, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + + fun Scope( matterValue: Int, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(item: ItemLike, matterValue: Int, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(tag: TagKey, matterValue: Int, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope( matterValue: Long, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(item: ItemLike, matterValue: Long, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(tag: TagKey, matterValue: Long, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope( matterValue: Double, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(item: ItemLike, matterValue: Double, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(tag: TagKey, matterValue: Double, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope( matterValue: Float, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(item: ItemLike, matterValue: Float, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(tag: TagKey, matterValue: Float, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + + fun Scope( matterValue: Int, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(item: ItemLike, matterValue: Int, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(tag: TagKey, matterValue: Int, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope( matterValue: Long, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(item: ItemLike, matterValue: Long, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(tag: TagKey, matterValue: Long, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope( matterValue: Double, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(item: ItemLike, matterValue: Double, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(tag: TagKey, matterValue: Double, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope( matterValue: Float, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(item: ItemLike, matterValue: Float, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(tag: TagKey, matterValue: Float, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + + fun Scope( matterValue: Int, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(item: ItemLike, matterValue: Int, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(tag: TagKey, matterValue: Int, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope( matterValue: Long, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(item: ItemLike, matterValue: Long, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(tag: TagKey, matterValue: Long, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope( matterValue: Double, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(item: ItemLike, matterValue: Double, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(tag: TagKey, matterValue: Double, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope( matterValue: Float, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(item: ItemLike, matterValue: Float, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun Scope(tag: TagKey, matterValue: Float, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + + fun scope( matterValue: ImpreciseFraction, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(matterValue * this.matterValue, complexity * this.complexity, configurator) + fun scope(item: ItemLike, matterValue: ImpreciseFraction, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, matterValue * this.matterValue, complexity * this.complexity, configurator) + fun scope(tag: TagKey, matterValue: ImpreciseFraction, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, matterValue * this.matterValue, complexity * this.complexity, configurator) + fun scope( matterValue: Int, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(item: ItemLike, matterValue: Int, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(tag: TagKey, matterValue: Int, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope( matterValue: Long, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(item: ItemLike, matterValue: Long, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(tag: TagKey, matterValue: Long, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope( matterValue: Double, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(item: ItemLike, matterValue: Double, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(tag: TagKey, matterValue: Double, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope( matterValue: Float, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(item: ItemLike, matterValue: Float, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(tag: TagKey, matterValue: Float, complexity: Double, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + + fun scope( matterValue: Int, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(item: ItemLike, matterValue: Int, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(tag: TagKey, matterValue: Int, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope( matterValue: Long, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(item: ItemLike, matterValue: Long, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(tag: TagKey, matterValue: Long, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope( matterValue: Double, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(item: ItemLike, matterValue: Double, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(tag: TagKey, matterValue: Double, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope( matterValue: Float, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(item: ItemLike, matterValue: Float, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(tag: TagKey, matterValue: Float, complexity: Int, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + + fun scope( matterValue: Int, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(item: ItemLike, matterValue: Int, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(tag: TagKey, matterValue: Int, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope( matterValue: Long, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(item: ItemLike, matterValue: Long, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(tag: TagKey, matterValue: Long, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope( matterValue: Double, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(item: ItemLike, matterValue: Double, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(tag: TagKey, matterValue: Double, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope( matterValue: Float, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(item: ItemLike, matterValue: Float, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(tag: TagKey, matterValue: Float, complexity: Float, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + + fun scope( matterValue: Int, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(item: ItemLike, matterValue: Int, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(tag: TagKey, matterValue: Int, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope( matterValue: Long, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(item: ItemLike, matterValue: Long, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(tag: TagKey, matterValue: Long, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope( matterValue: Double, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(item: ItemLike, matterValue: Double, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(tag: TagKey, matterValue: Double, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope( matterValue: Float, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(item: ItemLike, matterValue: Float, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun scope(tag: TagKey, matterValue: Float, complexity: Long, configurator: Scope.() -> Unit) = this@MatterDataProvider.Scope(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + + ////////// + fun relative(item: ItemLike, matterValue: ImpreciseFraction, complexity: Double, configurator: InsertConfiguration.() -> Unit = {}) = insert(item, matterValue * this.matterValue, complexity * this.complexity, configurator) + fun relative(tag: TagKey, matterValue: ImpreciseFraction, complexity: Double, configurator: InsertConfiguration.() -> Unit = {}) = insert(tag, matterValue * this.matterValue, complexity * this.complexity, configurator) + fun relative(item: ItemLike, matterValue: Int, complexity: Double, configurator: InsertConfiguration.() -> Unit = {}) = insert(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(tag: TagKey, matterValue: Int, complexity: Double, configurator: InsertConfiguration.() -> Unit = {}) = insert(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(item: ItemLike, matterValue: Long, complexity: Double, configurator: InsertConfiguration.() -> Unit = {}) = insert(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(tag: TagKey, matterValue: Long, complexity: Double, configurator: InsertConfiguration.() -> Unit = {}) = insert(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(item: ItemLike, matterValue: Double, complexity: Double, configurator: InsertConfiguration.() -> Unit = {}) = insert(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(tag: TagKey, matterValue: Double, complexity: Double, configurator: InsertConfiguration.() -> Unit = {}) = insert(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(item: ItemLike, matterValue: Float, complexity: Double, configurator: InsertConfiguration.() -> Unit = {}) = insert(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(tag: TagKey, matterValue: Float, complexity: Double, configurator: InsertConfiguration.() -> Unit = {}) = insert(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + + fun relative(item: ItemLike, matterValue: Int, complexity: Int, configurator: InsertConfiguration.() -> Unit = {}) = insert(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(tag: TagKey, matterValue: Int, complexity: Int, configurator: InsertConfiguration.() -> Unit = {}) = insert(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(item: ItemLike, matterValue: Long, complexity: Int, configurator: InsertConfiguration.() -> Unit = {}) = insert(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(tag: TagKey, matterValue: Long, complexity: Int, configurator: InsertConfiguration.() -> Unit = {}) = insert(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(item: ItemLike, matterValue: Double, complexity: Int, configurator: InsertConfiguration.() -> Unit = {}) = insert(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(tag: TagKey, matterValue: Double, complexity: Int, configurator: InsertConfiguration.() -> Unit = {}) = insert(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(item: ItemLike, matterValue: Float, complexity: Int, configurator: InsertConfiguration.() -> Unit = {}) = insert(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(tag: TagKey, matterValue: Float, complexity: Int, configurator: InsertConfiguration.() -> Unit = {}) = insert(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + + fun relative(item: ItemLike, matterValue: Int, complexity: Float, configurator: InsertConfiguration.() -> Unit = {}) = insert(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(tag: TagKey, matterValue: Int, complexity: Float, configurator: InsertConfiguration.() -> Unit = {}) = insert(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(item: ItemLike, matterValue: Long, complexity: Float, configurator: InsertConfiguration.() -> Unit = {}) = insert(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(tag: TagKey, matterValue: Long, complexity: Float, configurator: InsertConfiguration.() -> Unit = {}) = insert(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(item: ItemLike, matterValue: Double, complexity: Float, configurator: InsertConfiguration.() -> Unit = {}) = insert(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(tag: TagKey, matterValue: Double, complexity: Float, configurator: InsertConfiguration.() -> Unit = {}) = insert(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(item: ItemLike, matterValue: Float, complexity: Float, configurator: InsertConfiguration.() -> Unit = {}) = insert(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(tag: TagKey, matterValue: Float, complexity: Float, configurator: InsertConfiguration.() -> Unit = {}) = insert(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + + fun relative(item: ItemLike, matterValue: Int, complexity: Long, configurator: InsertConfiguration.() -> Unit = {}) = insert(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(tag: TagKey, matterValue: Int, complexity: Long, configurator: InsertConfiguration.() -> Unit = {}) = insert(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(item: ItemLike, matterValue: Long, complexity: Long, configurator: InsertConfiguration.() -> Unit = {}) = insert(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(tag: TagKey, matterValue: Long, complexity: Long, configurator: InsertConfiguration.() -> Unit = {}) = insert(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(item: ItemLike, matterValue: Double, complexity: Long, configurator: InsertConfiguration.() -> Unit = {}) = insert(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(tag: TagKey, matterValue: Double, complexity: Long, configurator: InsertConfiguration.() -> Unit = {}) = insert(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(item: ItemLike, matterValue: Float, complexity: Long, configurator: InsertConfiguration.() -> Unit = {}) = insert(item, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + fun relative(tag: TagKey, matterValue: Float, complexity: Long, configurator: InsertConfiguration.() -> Unit = {}) = insert(tag, ImpreciseFraction(matterValue) * this.matterValue, complexity * this.complexity, configurator) + + //////// + fun relative(vararg items: ItemLike) { + for (item in items) { + insert(item, matterValue, complexity) + } + } + + fun relative(vararg tags: TagKey) { + for (tag in tags) { + relative(tag, matterValue, complexity) + } + } + } + fun insert(name: ResourceLocation, configurator: InsertConfiguration.() -> Unit): MatterManager.InsertAction { check(!actions.containsKey(name)) { "Already has action with name $name" } val config = InsertConfiguration(name) @@ -264,39 +555,39 @@ open class MatterDataProvider(protected val dataGenerator: DataGenerator, val na fun delete(name: TagKey, configurator: Consumer) = delete(name, configurator::accept) fun update(name: TagKey, configurator: Consumer) = update(name, configurator::accept) - fun insert(name: ResourceLocation, matterValue: ImpreciseFraction, complexity: Double, configurator: InsertConfiguration.() -> Unit = {}) = insert(name) { + fun insert(name: ResourceLocation, matterValue: ImpreciseFraction, complexity: Double, configurator: InsertConfiguration.() -> Unit) = insert(name) { this.matter = matterValue this.complexity = complexity configurator.invoke(this) } - fun insert(name: ItemLike, matterValue: ImpreciseFraction, complexity: Double, configurator: InsertConfiguration.() -> Unit = {}) = insert(name) { + fun insert(name: ItemLike, matterValue: ImpreciseFraction, complexity: Double, configurator: InsertConfiguration.() -> Unit) = insert(name) { this.matter = matterValue this.complexity = complexity configurator.invoke(this) } - fun insert(name: TagKey, matterValue: ImpreciseFraction, complexity: Double, configurator: InsertConfiguration.() -> Unit = {}) = insert(name) { + fun insert(name: TagKey, matterValue: ImpreciseFraction, complexity: Double, configurator: InsertConfiguration.() -> Unit) = insert(name) { this.matter = matterValue this.complexity = complexity configurator.invoke(this) } - fun insert(name: ResourceLocation, matterValue: ImpreciseFraction, complexity: Double, priority: Int, configurator: InsertConfiguration.() -> Unit = {}) = insert(name) { + fun insert(name: ResourceLocation, matterValue: ImpreciseFraction, complexity: Double, priority: Int, configurator: InsertConfiguration.() -> Unit) = insert(name) { this.matter = matterValue this.complexity = complexity this.priority = priority configurator.invoke(this) } - fun insert(name: ItemLike, matterValue: ImpreciseFraction, complexity: Double, priority: Int, configurator: InsertConfiguration.() -> Unit = {}) = insert(name) { + fun insert(name: ItemLike, matterValue: ImpreciseFraction, complexity: Double, priority: Int, configurator: InsertConfiguration.() -> Unit) = insert(name) { this.matter = matterValue this.complexity = complexity this.priority = priority configurator.invoke(this) } - fun insert(name: TagKey, matterValue: ImpreciseFraction, complexity: Double, priority: Int, configurator: InsertConfiguration.() -> Unit = {}) = insert(name) { + fun insert(name: TagKey, matterValue: ImpreciseFraction, complexity: Double, priority: Int, configurator: InsertConfiguration.() -> Unit) = insert(name) { this.matter = matterValue this.complexity = complexity this.priority = priority diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt index f33755814..546c5f634 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt @@ -183,7 +183,7 @@ object MatterManager : SimpleJsonResourceReloadListener(GsonBuilder().setPrettyP priority: Int? = null, errorOnFailure: Boolean = false, replaceIfExists: Boolean = false, - comparePriority: Boolean = false, + comparePriority: Boolean = true, ) : super(key = key, matter = matter, complexity = complexity, priority = priority, errorOnFailure = errorOnFailure) { this.replaceIfExists = replaceIfExists this.comparePriority = comparePriority @@ -196,7 +196,7 @@ object MatterManager : SimpleJsonResourceReloadListener(GsonBuilder().setPrettyP priority: Int? = null, errorOnFailure: Boolean = false, replaceIfExists: Boolean = false, - comparePriority: Boolean = false, + comparePriority: Boolean = true, ) : super(tag = tag, matter = matter, complexity = complexity, priority = priority, errorOnFailure = errorOnFailure) { this.replaceIfExists = replaceIfExists this.comparePriority = comparePriority @@ -204,7 +204,7 @@ object MatterManager : SimpleJsonResourceReloadListener(GsonBuilder().setPrettyP constructor(json: JsonObject) : super(json) { this.replaceIfExists = json["replace_if_exists"]?.asBoolean ?: false - this.comparePriority = json["compare_priority"]?.asBoolean ?: false + this.comparePriority = json["compare_priority"]?.asBoolean ?: true } override fun toJson(): JsonObject {