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:
Ursprung
798b70cbe6
Commit
c9733948b3
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren