Skip to content

Commit cbf1cf0

Browse files
Handle DEBUG_SAMPLE_SUBSCRIPTION structure change in 1.21.9->1.21.7
1 parent fbe6a67 commit cbf1cf0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

common/src/main/java/com/viaversion/viabackwards/protocol/v1_21_9to1_21_7/Protocol1_21_9To1_21_7.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,20 @@ protected void registerPackets() {
185185
}
186186
});
187187

188+
registerServerbound(ServerboundPackets1_21_6.DEBUG_SAMPLE_SUBSCRIPTION, wrapper -> {
189+
final int sampleType = wrapper.read(Types.VAR_INT);
190+
if (sampleType == 0) { // TICK_TIME
191+
wrapper.clearPacket();
192+
wrapper.write(Types.VAR_INT, 1); // Subscription count
193+
wrapper.write(Types.VAR_INT, 0); // Subscription registry id (DEDICATED_SERVER_TICK_TIME)
194+
}
195+
});
196+
188197
cancelClientbound(ClientboundPackets1_21_9.DEBUG_BLOCK_VALUE);
189198
cancelClientbound(ClientboundPackets1_21_9.DEBUG_CHUNK_VALUE);
190199
cancelClientbound(ClientboundPackets1_21_9.DEBUG_ENTITY_VALUE);
191200
cancelClientbound(ClientboundPackets1_21_9.DEBUG_EVENT);
192201
cancelClientbound(ClientboundPackets1_21_9.GAME_EVENT_TEST_HIGHLIGHT_POS);
193-
cancelServerbound(ServerboundPackets1_21_6.DEBUG_SAMPLE_SUBSCRIPTION);
194202
}
195203

196204
@Override

0 commit comments

Comments
 (0)