diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/ComputeAction.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/ComputeAction.kt index 1571b96bf..9bbe9b673 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/ComputeAction.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/ComputeAction.kt @@ -41,7 +41,7 @@ class ComputeAction( it.group( DecimalCodec.fieldOf("matter").forGetter(Constant::matter), Codec.DOUBLE.fieldOf("complexity").forGetter(Constant::complexity), - IMatterFunction.registry.byNameCodec().fieldOf("function").forGetter(Constant::matterFunction), + MBuiltInRegistries.MATTER_FUNCTION.byNameCodec().fieldOf("function").forGetter(Constant::matterFunction), ).apply(it) { a, b, c -> Constant(a, b, c, c) } } to Predicate { it.matterFunction == it.complexityFunction } } @@ -50,8 +50,8 @@ class ComputeAction( RecordCodecBuilder.create { it.group( DecimalCodec.fieldOf("value").forGetter(Constant::matter), - IMatterFunction.registry.byNameCodec().fieldOf("matterFunction").forGetter(Constant::matterFunction), - IMatterFunction.registry.byNameCodec().fieldOf("complexityFunction").forGetter(Constant::complexityFunction), + MBuiltInRegistries.MATTER_FUNCTION.byNameCodec().fieldOf("matterFunction").forGetter(Constant::matterFunction), + MBuiltInRegistries.MATTER_FUNCTION.byNameCodec().fieldOf("complexityFunction").forGetter(Constant::complexityFunction), ).apply(it) { a, b, c -> Constant(a, a.toDouble(), b, c) } } to Predicate { it.matter == Decimal(it.complexity.toString()) } } @@ -60,7 +60,7 @@ class ComputeAction( RecordCodecBuilder.create { it.group( DecimalCodec.fieldOf("value").forGetter(Constant::matter), - IMatterFunction.registry.byNameCodec().fieldOf("function").forGetter(Constant::matterFunction), + MBuiltInRegistries.MATTER_FUNCTION.byNameCodec().fieldOf("function").forGetter(Constant::matterFunction), ).apply(it) { a, b -> Constant(a, a.toDouble(), b, b) } } to Predicate { it.matter == Decimal(it.complexity.toString()) && it.matterFunction == it.complexityFunction } } @@ -69,7 +69,7 @@ class ComputeAction( RecordCodecBuilder.create { it.group( Codec.DOUBLE.fieldOf("complexity").forGetter(Constant::complexity), - IMatterFunction.registry.byNameCodec().fieldOf("function").forGetter(Constant::complexityFunction), + MBuiltInRegistries.MATTER_FUNCTION.byNameCodec().fieldOf("function").forGetter(Constant::complexityFunction), ).apply(it) { a, b -> Constant(Decimal.ZERO, a.toDouble(), IMatterFunction.NOOP, b) } } to Predicate { it.matterFunction == IMatterFunction.NOOP } } @@ -78,7 +78,7 @@ class ComputeAction( RecordCodecBuilder.create { it.group( Codec.DOUBLE.fieldOf("complexity").forGetter(Constant::complexity), - IMatterFunction.registry.byNameCodec().fieldOf("complexityFunction").forGetter(Constant::complexityFunction), + MBuiltInRegistries.MATTER_FUNCTION.byNameCodec().fieldOf("complexityFunction").forGetter(Constant::complexityFunction), ).apply(it) { a, b -> Constant(Decimal.ZERO, a.toDouble(), IMatterFunction.NOOP, b) } } to Predicate { it.matterFunction == IMatterFunction.NOOP } } @@ -87,7 +87,7 @@ class ComputeAction( RecordCodecBuilder.create { it.group( DecimalCodec.fieldOf("matter").forGetter(Constant::matter), - IMatterFunction.registry.byNameCodec().fieldOf("function").forGetter(Constant::matterFunction), + MBuiltInRegistries.MATTER_FUNCTION.byNameCodec().fieldOf("function").forGetter(Constant::matterFunction), ).apply(it) { a, b -> Constant(a, 0.0, b, IMatterFunction.NOOP) } } to Predicate { it.complexityFunction == IMatterFunction.NOOP } } @@ -96,7 +96,7 @@ class ComputeAction( RecordCodecBuilder.create { it.group( DecimalCodec.fieldOf("matter").forGetter(Constant::matter), - IMatterFunction.registry.byNameCodec().fieldOf("matterFunction").forGetter(Constant::matterFunction), + MBuiltInRegistries.MATTER_FUNCTION.byNameCodec().fieldOf("matterFunction").forGetter(Constant::matterFunction), ).apply(it) { a, b -> Constant(a, 0.0, b, IMatterFunction.NOOP) } } to Predicate { it.complexityFunction == IMatterFunction.NOOP } } @@ -183,7 +183,7 @@ class ComputeAction( RecordCodecBuilder.create { it.group( TargetCodec.fieldOf("id").forGetter(Value::id), - IMatterFunction.registry.byNameCodec().fieldOf("function").forGetter(Value::matterFunction), + MBuiltInRegistries.MATTER_FUNCTION.byNameCodec().fieldOf("function").forGetter(Value::matterFunction), ).apply(it, ::Value) } } @@ -192,8 +192,8 @@ class ComputeAction( RecordCodecBuilder.create { it.group( TargetCodec.fieldOf("id").forGetter(Value::id), - IMatterFunction.registry.byNameCodec().fieldOf("matterFunction").forGetter(Value::matterFunction), - IMatterFunction.registry.byNameCodec().fieldOf("complexityFunction").forGetter(Value::complexityFunction), + MBuiltInRegistries.MATTER_FUNCTION.byNameCodec().fieldOf("matterFunction").forGetter(Value::matterFunction), + MBuiltInRegistries.MATTER_FUNCTION.byNameCodec().fieldOf("complexityFunction").forGetter(Value::complexityFunction), ).apply(it, ::Value) } }