3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 00:22:51 +01:00

Use raw data filler in 1.12->1.13

Dieser Commit ist enthalten in:
Nassim Jahnke 2024-04-27 10:23:04 +02:00
Ursprung 798b70cbe6
Commit c9733948b3
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F
2 geänderte Dateien mit 11 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -22,6 +22,7 @@
*/
package com.viaversion.viaversion.api.type.types.misc;
import com.google.common.base.Preconditions;
import com.viaversion.viaversion.api.data.FullMappings;
import com.viaversion.viaversion.api.protocol.Protocol;
import com.viaversion.viaversion.api.type.Type;
@ -58,6 +59,10 @@ public abstract class DynamicType<T extends IdHolder> extends Type<T> {
}
}
public RawDataFiller rawFiller() {
return new RawDataFiller();
}
public final class DataFiller {
private final FullMappings mappings;
@ -65,6 +70,7 @@ public abstract class DynamicType<T extends IdHolder> extends Type<T> {
private DataFiller(final Protocol<?, ?, ?, ?> protocol, final boolean useMappedNames) {
this.mappings = mappings(protocol);
Preconditions.checkNotNull(mappings, "Mappings for %s are null", protocol.getClass());
this.useMappedNames = useMappedNames;
}
@ -72,8 +78,11 @@ public abstract class DynamicType<T extends IdHolder> extends Type<T> {
readers.put(useMappedNames ? mappings.mappedId(identifier) : mappings.id(identifier), reader);
return this;
}
}
public DataFiller reader(final int id, final DataReader<T> reader) {
public final class RawDataFiller {
public RawDataFiller reader(final int id, final DataReader<T> reader) {
readers.put(id, reader);
return this;
}

Datei anzeigen

@ -845,7 +845,7 @@ public class Protocol1_13To1_12_2 extends AbstractProtocol<ClientboundPackets1_1
RecipeData.init();
BlockIdData.init();
Types1_13.PARTICLE.filler(this)
Types1_13.PARTICLE.rawFiller()
.reader(3, ParticleType.Readers.BLOCK)
.reader(20, ParticleType.Readers.DUST)
.reader(11, ParticleType.Readers.DUST)