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 40818389e..f6bf12a78 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt @@ -95,7 +95,6 @@ import kotlin.collections.LinkedHashMap import kotlin.math.pow internal sealed class MutableEntry( - val modificationChain: MutableList, var matter: ImpreciseFraction, var complexity: Double, var priority: Int @@ -105,23 +104,21 @@ internal sealed class MutableEntry( internal class MutableTagEntry( val tag: TagKey, - modificationChain: MutableList, matter: ImpreciseFraction, complexity: Double, priority: Int -) : MutableEntry(modificationChain, matter, complexity, priority) { +) : MutableEntry(matter, complexity, priority) { override fun freeze(): Entry { - return TagEntry(tag, ImmutableList.copyOf(modificationChain), matter, complexity, priority) + return TagEntry(tag, matter, complexity, priority) } } internal class MutableKeyEntry( val key: ResourceLocation, - modificationChain: MutableList, matter: ImpreciseFraction, complexity: Double, priority: Int -) : MutableEntry(modificationChain, matter, complexity, priority) { +) : MutableEntry(matter, complexity, priority) { init { if (key == AIR) { throw JsonSyntaxException("you wot, can't modify $key") @@ -129,7 +126,7 @@ internal class MutableKeyEntry( } override fun freeze(): Entry { - return KeyEntry(key, ImmutableList.copyOf(modificationChain), matter, complexity, priority) + return KeyEntry(key, matter, complexity, priority) } companion object { @@ -138,21 +135,19 @@ internal class MutableKeyEntry( } internal sealed class Entry( - val modificationChain: List, final override val matter: ImpreciseFraction, final override val complexity: Double, val priority: Int, ) : IMatterValue { - companion object : Entry(listOf(), ImpreciseFraction.ZERO, 0.0, Int.MIN_VALUE) + companion object : Entry(ImpreciseFraction.ZERO, 0.0, Int.MIN_VALUE) } internal class TagEntry( val tag: TagKey, - modificationChain: List, matter: ImpreciseFraction, complexity: Double, priority: Int, -) : Entry(modificationChain, matter, complexity, priority) { +) : Entry(matter, complexity, priority) { val bound by lazy { val manager = ForgeRegistries.ITEMS.tags() ?: throw NullPointerException("Forge registry of Items has no tags!") manager.getTag(tag) @@ -161,11 +156,10 @@ internal class TagEntry( internal class KeyEntry( val key: ResourceLocation, - modificationChain: List, matter: ImpreciseFraction, complexity: Double, priority: Int, -) : Entry(modificationChain, matter, complexity, priority) +) : Entry(matter, complexity, priority) private fun transformQuotes(it: String?): String = if (it != null) '"' + it.replace("\"", "\"\"") + '"' else "NULL"