Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-26 16:12:42 +01:00
Fix finish configuration state change
Dieser Commit ist enthalten in:
Ursprung
84bd1d0782
Commit
6fd421d36e
@ -198,6 +198,14 @@ public abstract class AbstractProtocol<CU extends ClientboundPacketType, CM exte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void registerFinishConfiguration(final CU packetType, final PacketHandler handler) {
|
||||||
|
registerClientbound(packetType, wrapper -> {
|
||||||
|
// TODO Temporary solution to handle the finish configuration packet already having changed our tracked protocol state in a previous handler
|
||||||
|
wrapper.user().getProtocolInfo().setServerState(State.CONFIGURATION);
|
||||||
|
handler.handle(wrapper);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void loadMappingData() {
|
public final void loadMappingData() {
|
||||||
getMappingData().load();
|
getMappingData().load();
|
||||||
|
@ -70,7 +70,7 @@ public final class EntityPacketRewriter1_21 extends EntityRewriter<ClientboundPa
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
protocol.registerClientbound(ClientboundConfigurationPackets1_20_5.FINISH_CONFIGURATION, wrapper -> {
|
protocol.registerFinishConfiguration(ClientboundConfigurationPackets1_20_5.FINISH_CONFIGURATION, wrapper -> {
|
||||||
// Add new registries
|
// Add new registries
|
||||||
final PacketWrapper paintingRegistryPacket = wrapper.create(ClientboundConfigurationPackets1_20_5.REGISTRY_DATA);
|
final PacketWrapper paintingRegistryPacket = wrapper.create(ClientboundConfigurationPackets1_20_5.REGISTRY_DATA);
|
||||||
paintingRegistryPacket.write(Types.STRING, "minecraft:painting_variant");
|
paintingRegistryPacket.write(Types.STRING, "minecraft:painting_variant");
|
||||||
|
@ -129,7 +129,7 @@ public final class Protocol1_21To1_21_2 extends AbstractProtocol<ClientboundPack
|
|||||||
wrapper.passthrough(Types.BYTE); // View distance
|
wrapper.passthrough(Types.BYTE); // View distance
|
||||||
wrapper.passthrough(Types.VAR_INT); // Chat visibility
|
wrapper.passthrough(Types.VAR_INT); // Chat visibility
|
||||||
wrapper.passthrough(Types.BOOLEAN); // Chat colors
|
wrapper.passthrough(Types.BOOLEAN); // Chat colors
|
||||||
wrapper.passthrough(Types.BYTE); // Skin parts
|
wrapper.passthrough(Types.UNSIGNED_BYTE); // Skin parts
|
||||||
wrapper.passthrough(Types.VAR_INT); // Main hand
|
wrapper.passthrough(Types.VAR_INT); // Main hand
|
||||||
wrapper.passthrough(Types.BOOLEAN); // Text filtering enabled
|
wrapper.passthrough(Types.BOOLEAN); // Text filtering enabled
|
||||||
wrapper.passthrough(Types.BOOLEAN); // Allow listing
|
wrapper.passthrough(Types.BOOLEAN); // Allow listing
|
||||||
|
@ -60,7 +60,7 @@ public final class EntityPacketRewriter1_21_2 extends EntityRewriter<Clientbound
|
|||||||
registerSetEntityData(ClientboundPackets1_21.SET_ENTITY_DATA, Types1_21.ENTITY_DATA_LIST, Types1_21_2.ENTITY_DATA_LIST);
|
registerSetEntityData(ClientboundPackets1_21.SET_ENTITY_DATA, Types1_21.ENTITY_DATA_LIST, Types1_21_2.ENTITY_DATA_LIST);
|
||||||
registerRemoveEntities(ClientboundPackets1_21.REMOVE_ENTITIES);
|
registerRemoveEntities(ClientboundPackets1_21.REMOVE_ENTITIES);
|
||||||
|
|
||||||
protocol.registerClientbound(ClientboundConfigurationPackets1_21.FINISH_CONFIGURATION, wrapper -> {
|
protocol.registerFinishConfiguration(ClientboundConfigurationPackets1_21.FINISH_CONFIGURATION, wrapper -> {
|
||||||
final PacketWrapper instrumentsPacket = wrapper.create(ClientboundConfigurationPackets1_21.REGISTRY_DATA);
|
final PacketWrapper instrumentsPacket = wrapper.create(ClientboundConfigurationPackets1_21.REGISTRY_DATA);
|
||||||
instrumentsPacket.write(Types.STRING, "minecraft:instrument");
|
instrumentsPacket.write(Types.STRING, "minecraft:instrument");
|
||||||
final RegistryEntry[] entries = new RegistryEntry[GOAT_HORN_INSTRUMENTS.length];
|
final RegistryEntry[] entries = new RegistryEntry[GOAT_HORN_INSTRUMENTS.length];
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren