mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-30 16:28:00 +01:00
Fix spell ingredient serializing
This commit is contained in:
parent
1980cf634e
commit
dc7a5debaa
1 changed files with 3 additions and 3 deletions
|
@ -55,9 +55,9 @@ public interface CodecUtils {
|
||||||
@Override
|
@Override
|
||||||
public <T> DataResult<T> encode(Pair<Optional<A>, Optional<B>> input, DynamicOps<T> ops, T prefix) {
|
public <T> DataResult<T> encode(Pair<Optional<A>, Optional<B>> input, DynamicOps<T> ops, T prefix) {
|
||||||
return baseCodec.encode(input.getFirst().get(), ops, prefix)
|
return baseCodec.encode(input.getFirst().get(), ops, prefix)
|
||||||
.flatMap(leftResult -> input.getSecond()
|
.flatMap(l -> input.getSecond()
|
||||||
.map(r -> fieldCodec.encode(r, ops, ops.mapBuilder()).build(prefix))
|
.map(r -> fieldCodec.encode(r, ops, ops.mapBuilder()).build(prefix).flatMap(rr -> ops.getMap(rr).flatMap(rrr -> ops.mergeToMap(l, rrr))))
|
||||||
.orElse(DataResult.success(leftResult)));
|
.orElse(DataResult.success(l)));
|
||||||
}
|
}
|
||||||
}, new Decoder<Pair<Optional<A>, Optional<B>>>() {
|
}, new Decoder<Pair<Optional<A>, Optional<B>>>() {
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue