mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-24 05:47:59 +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
|
||||
public <T> DataResult<T> encode(Pair<Optional<A>, Optional<B>> input, DynamicOps<T> ops, T prefix) {
|
||||
return baseCodec.encode(input.getFirst().get(), ops, prefix)
|
||||
.flatMap(leftResult -> input.getSecond()
|
||||
.map(r -> fieldCodec.encode(r, ops, ops.mapBuilder()).build(prefix))
|
||||
.orElse(DataResult.success(leftResult)));
|
||||
.flatMap(l -> input.getSecond()
|
||||
.map(r -> fieldCodec.encode(r, ops, ops.mapBuilder()).build(prefix).flatMap(rr -> ops.getMap(rr).flatMap(rrr -> ops.mergeToMap(l, rrr))))
|
||||
.orElse(DataResult.success(l)));
|
||||
}
|
||||
}, new Decoder<Pair<Optional<A>, Optional<B>>>() {
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue