We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ac9f980 + c893c43 commit fa33ddeCopy full SHA for fa33dde
1 file changed
src/main/java/dev/anvilcraft/lib/util/CodecUtil.java
@@ -102,16 +102,17 @@ public abstract class CodecUtil {
102
);
103
104
public static final Codec<NumberProvider> NUMBER_PROVIDER_CODEC = Codec.either(
105
+ NumberProviders.CODEC,
106
Codec.INT.xmap(
107
ConstantValue::new,
108
value -> Math.round(value.value())
- ), NumberProviders.CODEC
109
+ )
110
).xmap(
111
Either::unwrap, provider -> {
112
if (!(provider instanceof ConstantValue(float value)) || value - Math.floor(value) >= 1E-5) {
- return Either.right(provider);
113
+ return Either.left(provider);
114
}
- return Either.left((ConstantValue) provider);
115
+ return Either.right((ConstantValue) provider);
116
117
118
0 commit comments