Fix MetaTypes1_20_2 item type

This commit is contained in:
Nassim Jahnke 2023-08-31 11:44:55 +10:00
parent a9288ebd3a
commit 625373827c
2 changed files with 5 additions and 7 deletions

View File

@ -35,7 +35,7 @@ public final class MetaTypes1_20_2 extends AbstractMetaTypes {
public final MetaType stringType = add(4, Type.STRING);
public final MetaType componentType = add(5, Type.COMPONENT);
public final MetaType optionalComponentType = add(6, Type.OPTIONAL_COMPONENT);
public final MetaType itemType = add(7, Type.FLAT_VAR_INT_ITEM);
public final MetaType itemType = add(7, Type.ITEM1_20_2);
public final MetaType booleanType = add(8, Type.BOOLEAN);
public final MetaType rotationType = add(9, Type.ROTATION);
public final MetaType positionType = add(10, Type.POSITION1_14);

View File

@ -311,7 +311,7 @@ public abstract class ItemRewriter<C extends ClientboundPacketType, S extends Se
});
}
public void registerAdvancements1_20(C packetType) {
public void registerAdvancements1_20_2(C packetType) {
protocol.registerClientbound(packetType, wrapper -> {
wrapper.passthrough(Type.BOOLEAN); // Reset/clear
int size = wrapper.passthrough(Type.VAR_INT); // Mapping size
@ -336,11 +336,9 @@ public abstract class ItemRewriter<C extends ClientboundPacketType, S extends Se
wrapper.passthrough(Type.FLOAT); // Y
}
wrapper.passthrough(Type.STRING_ARRAY); // Criteria
int arrayLength = wrapper.passthrough(Type.VAR_INT);
for (int array = 0; array < arrayLength; array++) {
wrapper.passthrough(Type.STRING_ARRAY); // String array
int requirements = wrapper.passthrough(Type.VAR_INT);
for (int array = 0; array < requirements; array++) {
wrapper.passthrough(Type.STRING_ARRAY);
}
wrapper.passthrough(Type.BOOLEAN); // Send telemetry