/* * Decompiled with CFR 0.152. * * Could not load the following classes: * com.mojang.datafixers.util.Pair * com.mojang.serialization.DataResult * com.mojang.serialization.DynamicOps * com.mojang.serialization.Encoder * com.mojang.serialization.Lifecycle * com.mojang.serialization.ListBuilder * com.mojang.serialization.MapLike * com.mojang.serialization.RecordBuilder */ package net.minecraft.resources; import com.mojang.datafixers.util.Pair; import com.mojang.serialization.DataResult; import com.mojang.serialization.DynamicOps; import com.mojang.serialization.Encoder; import com.mojang.serialization.Lifecycle; import com.mojang.serialization.ListBuilder; import com.mojang.serialization.MapLike; import com.mojang.serialization.RecordBuilder; import java.nio.ByteBuffer; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.function.BiConsumer; import java.util.function.Consumer; import java.util.function.UnaryOperator; import java.util.stream.IntStream; import java.util.stream.LongStream; import java.util.stream.Stream; public abstract class DelegatingOps implements DynamicOps { protected final DynamicOps delegate; protected DelegatingOps(DynamicOps delegate) { this.delegate = delegate; } public T empty() { return (T)this.delegate.empty(); } public T emptyMap() { return (T)this.delegate.emptyMap(); } public T emptyList() { return (T)this.delegate.emptyList(); } public U convertTo(DynamicOps outOps, T input) { if (Objects.equals(outOps, this.delegate)) { return (U)input; } return (U)this.delegate.convertTo(outOps, input); } public DataResult getNumberValue(T input) { return this.delegate.getNumberValue(input); } public T createNumeric(Number i) { return (T)this.delegate.createNumeric(i); } public T createByte(byte value) { return (T)this.delegate.createByte(value); } public T createShort(short value) { return (T)this.delegate.createShort(value); } public T createInt(int value) { return (T)this.delegate.createInt(value); } public T createLong(long value) { return (T)this.delegate.createLong(value); } public T createFloat(float value) { return (T)this.delegate.createFloat(value); } public T createDouble(double value) { return (T)this.delegate.createDouble(value); } public DataResult getBooleanValue(T input) { return this.delegate.getBooleanValue(input); } public T createBoolean(boolean value) { return (T)this.delegate.createBoolean(value); } public DataResult getStringValue(T input) { return this.delegate.getStringValue(input); } public T createString(String value) { return (T)this.delegate.createString(value); } public DataResult mergeToList(T list, T value) { return this.delegate.mergeToList(list, value); } public DataResult mergeToList(T list, List values) { return this.delegate.mergeToList(list, values); } public DataResult mergeToMap(T map, T key, T value) { return this.delegate.mergeToMap(map, key, value); } public DataResult mergeToMap(T map, MapLike values) { return this.delegate.mergeToMap(map, values); } public DataResult mergeToMap(T map, Map values) { return this.delegate.mergeToMap(map, values); } public DataResult mergeToPrimitive(T prefix, T value) { return this.delegate.mergeToPrimitive(prefix, value); } public DataResult>> getMapValues(T input) { return this.delegate.getMapValues(input); } public DataResult>> getMapEntries(T input) { return this.delegate.getMapEntries(input); } public T createMap(Map map) { return (T)this.delegate.createMap(map); } public T createMap(Stream> map) { return (T)this.delegate.createMap(map); } public DataResult> getMap(T input) { return this.delegate.getMap(input); } public DataResult> getStream(T input) { return this.delegate.getStream(input); } public DataResult>> getList(T input) { return this.delegate.getList(input); } public T createList(Stream input) { return (T)this.delegate.createList(input); } public DataResult getByteBuffer(T input) { return this.delegate.getByteBuffer(input); } public T createByteList(ByteBuffer input) { return (T)this.delegate.createByteList(input); } public DataResult getIntStream(T input) { return this.delegate.getIntStream(input); } public T createIntList(IntStream input) { return (T)this.delegate.createIntList(input); } public DataResult getLongStream(T input) { return this.delegate.getLongStream(input); } public T createLongList(LongStream input) { return (T)this.delegate.createLongList(input); } public T remove(T input, String key) { return (T)this.delegate.remove(input, key); } public boolean compressMaps() { return this.delegate.compressMaps(); } public ListBuilder listBuilder() { return new DelegateListBuilder(this.delegate.listBuilder()); } public RecordBuilder mapBuilder() { return new DelegateRecordBuilder(this.delegate.mapBuilder()); } protected class DelegateListBuilder implements ListBuilder { private final ListBuilder original; protected DelegateListBuilder(ListBuilder original) { this.original = original; } public DynamicOps ops() { return DelegatingOps.this; } public DataResult build(T prefix) { return this.original.build(prefix); } public ListBuilder add(T value) { this.original.add(value); return this; } public ListBuilder add(DataResult value) { this.original.add(value); return this; } public ListBuilder add(E value, Encoder encoder) { this.original.add(encoder.encodeStart(this.ops(), value)); return this; } public ListBuilder addAll(Iterable values, Encoder encoder) { values.forEach(v -> this.original.add(encoder.encode(v, this.ops(), this.ops().empty()))); return this; } public ListBuilder withErrorsFrom(DataResult result) { this.original.withErrorsFrom(result); return this; } public ListBuilder mapError(UnaryOperator onError) { this.original.mapError(onError); return this; } public DataResult build(DataResult prefix) { return this.original.build(prefix); } } protected class DelegateRecordBuilder implements RecordBuilder { private final RecordBuilder original; protected DelegateRecordBuilder(RecordBuilder original) { this.original = original; } public DynamicOps ops() { return DelegatingOps.this; } public RecordBuilder add(T key, T value) { this.original.add(key, value); return this; } public RecordBuilder add(T key, DataResult value) { this.original.add(key, value); return this; } public RecordBuilder add(DataResult key, DataResult value) { this.original.add(key, value); return this; } public RecordBuilder add(String key, T value) { this.original.add(key, value); return this; } public RecordBuilder add(String key, DataResult value) { this.original.add(key, value); return this; } public RecordBuilder add(String key, E value, Encoder encoder) { return this.original.add(key, encoder.encodeStart(this.ops(), value)); } public RecordBuilder withErrorsFrom(DataResult result) { this.original.withErrorsFrom(result); return this; } public RecordBuilder setLifecycle(Lifecycle lifecycle) { this.original.setLifecycle(lifecycle); return this; } public RecordBuilder mapError(UnaryOperator onError) { this.original.mapError(onError); return this; } public DataResult build(T prefix) { return this.original.build(prefix); } public DataResult build(DataResult prefix) { return this.original.build(prefix); } } }